tslediter/funcext/tvclib/utslvclcefinterface.tsf

7005 lines
272 KiB
Plaintext
Raw Blame History

unit utslvclcefinterface;
interface
uses cstructurelib;
function cef_version_info(entry:integer);
function cef_object_get(ptr,cls);
function cef_object_del(ptr);
function cef_dictionary_value_create();
function cef_request_context_get_global_context();
function cef_initialize(args:pointer;sett:pointer;app:pointer;info:pointer):integer;
function cef_initialize_tsl(args:pointer;sett:pointer;app:pointer;info:pointer);
function cef_browser_host_create_browser_sync(winfo:pointer;client:pointer;url:pointer;bs:pointer;ef:pointer;ef2:pointer):pointer;
function cef_browser_host_create_browser_sync_tsl(winfo;client;url;bs;ef;ef2);
function cef_browser_host_create_browser_tsl(winfo;client;url;bs;ef;ef2);
function cef_browser_host_create_browser(winfo:pointer;client:pointer;url:pointer;bs:pointer;ef:pointer;ef2:pointer):pointer;
procedure cef_shutdown();
procedure cef_run_message_loop();
procedure cef_do_message_loop_work();
function cef_execute_process(arg:pointer;app:pointer;dow:pointer):integer;
//function IsBadReadPtr(ptr:pointer;ucb:pointer):integer;
//function IsBadWritePtr(ptr:pointer;ucb:pointer):integer;
function cef_command_line_get_global():pointer;
function cef_command_line_create():pointer;
type t_cef_stc_base = class(tslcstructureobj)
static const C_CEF_PACK = 8;
function create(d,p);
begin
inherited;
end
end
type cef_point_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(
array(
(0,"int",0),
(1,"int",0)
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
property x index 0 read _getvalue_ write _setvalue_;
property y index 1 read _getvalue_ write _setvalue_;
end
type cef_mouse_event_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(
array(
(0,"int",0),
(1,"int",0),
(2,"int",0)
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
property x index 0 read _getvalue_ write _setvalue_;
property y index 1 read _getvalue_ write _setvalue_;
property modifiers index 2 read _getvalue_ write _setvalue_; //Bit flags describing any pressed modifier keys. See
end
type cef_popup_features_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(
array(
(0,"int",0),
(1,"int",0),
(2,"int",0),
(3,"int",0),
(4,"int",0),
(5,"int",0),
(6,"int",0),
(7,"int",0),
(8,"int",0),
(9,"int",0),
(10,"int",0),
(11,"int",0)
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
property x index 0 read _getvalue_ write _setvalue_;
property xSet index 1 read _getvalue_ write _setvalue_;
property y index 2 read _getvalue_ write _setvalue_;
property ySet index 3 read _getvalue_ write _setvalue_;
property width index 4 read _getvalue_ write _setvalue_;
property widthSet index 5 read _getvalue_ write _setvalue_;
property height index 6 read _getvalue_ write _setvalue_;
property heightSet index 7 read _getvalue_ write _setvalue_;
property menuBarVisible index 8 read _getvalue_ write _setvalue_;
property statusBarVisible index 9 read _getvalue_ write _setvalue_;
property toolBarVisible index 10 read _getvalue_ write _setvalue_;
property scrollbarsVisible index 11 read _getvalue_ write _setvalue_;
end
type cef_audio_parameters_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(
array(
(0,"int",0),
(1,"int",0),
(2,"int",0)
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
property channel_layout index 0 read _getvalue_ write _setvalue_;
property sample_rate index 1 read _getvalue_ write _setvalue_;
property frames_per_buffer index 2 read _getvalue_ write _setvalue_;
end
type cef_cursor_info_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(
array(
("hotspot","user",(
(0,"int",0),
(1,"int",0)
)),
("image_scale_factor","float",0),
("buffer","intptr",0),
("size","user",(
(0,"int",0),
(1,"int",0)
)))
,nil,nil,C_CEF_PACK);
;;
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
property hotspot index "hotspot" read _getvalue_ write _setvalue_;
property image_scale_factor index "image_scale_factor" read _getvalue_ write _setvalue_;
property buffer index "buffer" read _getvalue_ write _setvalue_;
end
type cef_size_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(
array(
(0,"int",0),
(1,"int",0)
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
property width index 0 read _getvalue_ write _setvalue_;
property height index 1 read _getvalue_ write _setvalue_;
end
type cef_rect_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(
array(
(0,"int",0),
(1,"int",0),
(2,"int",0),
(3,"int",0)
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
property x index 0 read _getvalue_ write _setvalue_;
property y index 1 read _getvalue_ write _setvalue_;
property width index 2 read _getvalue_ write _setvalue_;
property height index 3 read _getvalue_ write _setvalue_;
end
type cef_insets_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(
array(
(0,"int",0),
(1,"int",0),
(2,"int",0),
(3,"int",0)
));
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
property top index 0 read _getvalue_ write _setvalue_;
property left index 1 read _getvalue_ write _setvalue_;
property bottom index 2 read _getvalue_ write _setvalue_;
property right index 3 read _getvalue_ write _setvalue_;
end
type tcefproc = class()
function create();
begin
cefproc_cunt++;
if cefproc_cunt=1 then
begin
cefprocer := new tcefmessage();
cefprocer.add();
end
end
function destroy();
begin
cefproc_cunt--;
if cefproc_cunt=0 then
begin
cefprocer.remove();
cefprocer := nil;
end
end
private
static cefproc_cunt;
static cefprocer;
end
type tcefmessage = class(TTSLProcessMsg)
function create(ptr);
begin
inherited;
proc := getceffunction("cef_do_message_loop_work");
//lb := LoadLibraryA("libcef.dll");
//p := GetProcAddress(lb,"cef_do_message_loop_work");
//proc := p;
end
function add();
begin
tslAddProcess(_getptr_());
end
function remove();
begin
tslRemoveProcess(_getptr_());
end
private
procedure tslAddProcess(p:pointer);
begin
{$ifdef linux}
_f_ := static procedure(p:pointer);cdecl;external getdlsymaddress("libTSLkrnl.so","tslAddProcess");
{$else}
_f_ := static procedure(p:pointer);cdecl;external getdlsymaddress("tslkrnl.dll","tslAddProcess");
{$endif}
return ##_f_(p);
end
procedure tslRemoveProcess(p:pointer);
begin
{$ifdef linux}
_f_ := static procedure(p:pointer);cdecl;external getdlsymaddress("libTSLkrnl.so","tslRemoveProcess");
{$else}
_f_ := static procedure(p:pointer);cdecl;external getdlsymaddress("tslkrnl.dll","tslRemoveProcess");
{$endif}
return ##_f_(p);
end
end
type TTSLProcessMsg =class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(
array(
("prev","intptr",0),
("next","intptr",0),
("proc","intptr",0),
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
property proc index "proc" read _getvalue_ write _setvalue_;
end
type cef_string_t=class(t_cef_stc_base)
private
fdest;
function isascii(s);
begin
for i:= 1 to length(s) do
begin
if ord(s[i])>127 then return 0;
end
return 1;
end
function setansi(s);
begin
if ifstring(s) then
begin
pr := _getptr_();
if isascii(s) then
begin
cd := cef_string_ascii_to_utf16(s,length(s),pr);
end else
begin
s1 := ansitoutf8(s);
cd := cef_string_utf8_to_utf16(s1,length(s1),pr); //<2F><><EFBFBD><EFBFBD>utf8;
end
end
end
function getasansi();
begin
e := _getvalue_("length");
if e>0 then
begin
pr := _getvalue_("str");
bts := ReadBytesFromPtr(pr,e*2);
s := "";
setlength(s,e*2);
for i, v in bts do
begin
s[i+1] := v;
end
return unicodetomultibyte(s,936);
end
return "";
end
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(getcefstr16struct(),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
fdest := not(ptr>0 or ptr<0);
end
function destroy();override;
begin
//return inherited;
dr := _getvalue_("dtor");
ps := _getvalue_("str");
if dr and ps and fdest then //ɾ<><C9BE>
begin
f := procedure(s:pointer);stdcall; external dr;
##f(ps);
_setvalue_("length",0);
_setvalue_("str",0);
_setvalue_("dtor",0);
end
inherited;
end
property len index "length" read _getvalue_;
property str read getasansi write setansi;
public
class function memsize();
begin
if not SSTRUCT then getstruct();
if SSTRUCT then
begin
ldata := length(SSTRUCT)-1;
return SSTRUCT[ldata,3]+SSTRUCT[ldata,4]-SSTRUCT[0,3];
end
return 0;
end
end
type cef_string_userfree_t = class(cef_string_t)
function create(ptr);
begin
inherited;
fdest := true;
end
end
type cef_string_list_t = class()
function create(ptr);
begin
FPtr := 0;
if ptr>0 or ptr<0 then
begin
fdest := false;
FPtr := ptr;
end else
begin
fdest := true;
FPtr := cef_string_list_alloc();
end
end
function copyfromptr(ptr);
begin
if ptr>0 or ptr<0 then
begin
nptr := cef_string_list_copy(ptr);
if nptr then
begin
o := new cef_string_list_t(nptr);
o.fdest := true;
return o;
end
end
end
function copy();
begin
return copyfromptr(FPtr);
end
function destroy();
begin
if fdest and FPtr then
begin
cef_string_list_free(FPtr);
end
FPtr := 0;
end
function size();
begin
if not FPtr then return 0;
return cef_string_list_size(FPtr);
end
function value(index);
begin
if not FPtr then return nil;
if not(index>=0) then return nil;
s := new cef_string_t();
cef_string_list_value(FPtr,index,s._getptr_());
return s.str;
end
function append(s);
begin
if not FPtr then return nil;
if not ifstring( s) then return ;
ns := new cef_string_t();
ns.str := s;
cef_string_list_append(FPtr,ns._getptr_());
end
function appends(s);
begin
for i,v in s do append(v);
end
function get_values();
begin
r := array();
for i:=0 to size()-1 do
begin
r[i] := value(i);
end
return r;
end
function _getptr_();
begin
return FPtr ;
end
fdest;
private
FPtr;
end
type cef_string_map_t = class()
fdest;
function create(ptr);
begin
if (ptr>0 or ptr<0) then
begin
end else
begin
fdest := true;
ptr := cef_string_map_alloc();
end
fptr := ptr;
end
function _getptr_();
begin
return FPtr;
end
function destroy();
begin
if FPtr and fdest then
begin
cef_string_map_free(FPtr);
FPtr := 0;
end
end
function size();
begin
return cef_string_map_size(FPtr);
end
function find(key);
begin
if not ifstring(key) then return ;
s := new cef_string_t();s.str := key;
v := new cef_string_t();
if cef_string_map_find(FPtr,s._getptr_(),v._getptr_())>=0 then return v.str;
end
function key(idx);
begin
if not(idx>=0) then return ;
s := new cef_string_t();
if cef_string_map_key(FPtr,idx,s._getptr_())>=0 then return s.str;
end
function value(idx);
begin
if not(idx>=0) then return ;
s := new cef_string_t();
if cef_string_map_value(FPtr,idx,s._getptr_())>=0 then return s.str;
end
function append(key,value);
begin
if not (ifstring(key) and ifstring(value)) then return ;
s := new cef_string_t();s.str := key;
v := new cef_string_t();v.str := value;
return cef_string_map_append(FPtr,s._getptr_(),v._getptr_());
end
function clear();
begin
cef_string_map_clear(FPtr);
end
function keyvalues();
begin
r := array();
for i:= 0 to size()-1 do
begin
r[key(i)] := value(i);
end
return r;
end
private
fptr;
private
function cef_string_map_alloc():pointer;
begin
_f_ := static function():pointer;cdecl;external getceffunction(functionname());
return ##_f_();
end
function cef_string_map_size(map:pointer):pointer;
begin
_f_ := static function(map:pointer):pointer;cdecl;external getceffunction(functionname());
return ##_f_(map);
end
function cef_string_map_find(map:pointer;key:pointer;value:pointer):pointer;
begin
_f_ := static function(map:pointer;key:pointer;value:pointer):pointer;cdecl;external getceffunction(functionname());
return ##_f_(map,key,value);
end
function cef_string_map_key(map:pointer;index:pointer;key:pointer):integer;
begin
_f_ := static function(map:pointer;index:pointer;key:pointer):integer;cdecl;external getceffunction(functionname());
return ##_f_(map,index,key);
end
function cef_string_map_value(map:pointer;index:pointer;value:pointer):integer;
begin
_f_ := static function(map:pointer;index:pointer;value:pointer):integer;cdecl;external getceffunction(functionname());
return ##_f_(map,index,value);
end
function cef_string_map_append(map:pointer;key:pointer;value:pointer):integer;
begin
_f_ := static function(map:pointer;key:pointer;value:pointer):integer;cdecl;external getceffunction(functionname());
return ##_f_(map,key,value);
end
procedure cef_string_map_clear(map:pointer);
begin
_f_ := static procedure(map:pointer);cdecl;external getceffunction(functionname());
return ##_f_(map);
end
procedure cef_string_map_free(map:pointer);
begin
_f_ := static procedure(map:pointer);cdecl;external getceffunction(functionname());
return ##_f_(map);
end
end
{$ifdef linux}
type cef_main_args_t=class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(("argc","int",0),("argv","intptr",0)),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
function create(ptr);override;
begin
inherited create(getstruct(),ptr);
end
property argc index "argc" read _getvalue_ write _setvalue_;
property argv index "argv" read _getvalue_ write _setvalue_;
end
{$else}
type cef_main_args_t=class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(("instance","intptr",0)),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
property instance index "instance" read _getvalue_ write _setvalue_;
end
{$endif}
type cef_basetime_t = class(t_cef_stc_base) //32bit <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>
function create(ptr);
begin
inherited create(getstruct(),ptr);
end
property val index "val" read _getvalue_ write _setvalue_;
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(("val","intptr",0)),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
end
type cef_base_ref_counted_t=class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(getbasestruct(),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
class function memsize();
begin
if not SSTRUCT then getstruct();
if SSTRUCT then
begin
ldata := length(SSTRUCT)-1;
return SSTRUCT[ldata,3]+SSTRUCT[ldata,4]-SSTRUCT[0,3];
end
return 0;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
function destroy();override;
begin
inherited;
end
property size index "size" read _getvalue_ write _setvalue_;
property add_ref index "add_ref" read _getvalue_ write _setvalue_;
property release index "release" read _getvalue_ write _setvalue_;
property has_one_ref index "has_one_ref" read _getvalue_ write _setvalue_;
property has_at_least_one_ref index "has_at_least_one_ref" read _getvalue_ write _setvalue_;
end
type cef_contain_base = class(t_cef_stc_base)
private
FBase;
fbptr;
fstrmenbers;
function getbase();
begin
if not fbase then
begin
fbptr := _getptr_("base");
if not(fbptr>0 or fbptr<0) then return nil;
fbase := createobject(getbasecalss(),fbptr);//new cef_base_ref_counted_t(fbptr);
end else
begin
nptr := _getptr_("base");
if nptr<>fbptr then
begin
fbase._setcptr_(nptr);
fbptr := nptr;
end
end
return fbase;
end
SSTRUCT;
function getstruct();
begin
if not SSTRUCT then
begin
SSTRUCT := MemoryAlignmentCalculate(structdescribe(),nil,nil,C_CEF_PACK);
end
return SSTRUCT;
end
function structdescribe();virtual;
begin
return array(
("base","user",getbasestruct()));
end
protected
FTSLCallbacks;
function getbasecalss();virtual;
begin
return class(cef_base_ref_counted_t);
end
function getcefstrmenber(n);
begin
if not ifarray(fstrmenbers) then fstrmenbers := array();
fb := fstrmenbers[n];
sp := _getvalueaddr2_(n);
if sp then
begin
if not fb then
begin
fb := new cef_string_t(sp);
fstrmenbers[n] := fb;
end else
begin
fb._setcptr_(sp);
end
end
return fb;
end
function setcefstrmenber(n,v);
begin
fb := getcefstrmenber(n);
if fb then fb.str := (v);
end
function getcallpropertybyindex(idx);
begin
return FTSLCallbacks[idx+"_i"];
end
function getcallback(idx);
begin
return FTSLCallbacks[idx];
end
function setcallpropertybyindex(idx,c);virtual;
begin
n := idx+"_i";
if not ifobj(c) then
begin
_setvalue_(idx,0);
reindex(FTSLCallbacks,array(n:nil));
return;
end
o := self(true);
fn := findfunction(n,o);
if not fn then
begin
_setvalue_(idx,0);
reindex(FTSLCallbacks,array(n:nil));
return;
end
_setvalue_(idx,getinstance(fn));
return FTSLCallbacks[n] := c;
end
function aftercreate(flg);virtual;
begin
if flg then
begin
base.size := memsize();
base.add_ref := getinstance(thisfunction(addref));
base.release := getinstance(thisfunction(release));
base.has_one_ref := getinstance(thisfunction(has_one_ref));
base.has_at_least_one_ref := getinstance(thisfunction(has_at_least_one_ref));
end
end
function savetoglobal();virtual;
begin
cef_object_save(self(true));
end
public
function memsize();
begin
if not SSTRUCT then getstruct();
if SSTRUCT then
begin
ldata := length(SSTRUCT)-1;
return SSTRUCT[ldata,3]+SSTRUCT[ldata,4]-SSTRUCT[0,3];
end
return 0;
end
function getinstance(fn);
begin
if not fn then return 0;
if not ifobj(fn) then return 0;
r := makeweakref(fn,ok);
if ok then return makeinstance(r);
return makeinstance(fn);
end
function create(ptr)
begin
FTSLCallbacks := array();
flg := (ptr>0 or ptr<0);
inherited create(getstruct(),ptr);
addref(_getptr_());
aftercreate(not flg);
savetoglobal();
end
function destroy();override;
begin
id := _getptr_();
release(id);
inherited;
end
property base read getbase;
procedure addref(id:pointer);stdcall;virtual;
begin
addcefref(id);
//echo "\r\n add base ref:",id,">>",getcefrefcount(id);
end
function release(id:pointer):integer;stdcall;virtual;
begin
remcefref(id);
ct := getcefrefcount(id);
//echo "\r\n release ref:",id,">>",getcefrefcount(id);
if ct<=0 then return 0;
return ct;
end
function has_one_ref(id:pointer):integer;stdcall;virtual;
begin
r := onecefref(id);
//echo "\r\n>>one ref:",id;
return r;
end
function has_at_least_one_ref(id:pointer):integer;stdcall;virtual;
begin
r := lastoneref(id);
//echo "\r\n>> last one ref:",id;
return r;
end
end
type cef_handler_base = class(cef_contain_base)
function create(ptr)
begin
inherited ;
end
property client read fclient write fclient;
property handlename read fhandlename write fhandlename;
function getcallcount();
begin
return length(FTSLCallbacks );
end
protected
function setcallpropertybyindex(idx,c);override;
begin
inherited;
if fclient and fhandlename then
begin
invoke(fclient,fhandlename,1,self(true));
end
end
private
[weakref]fclient;
fhandlename;
end
type cef_focus_handler_t = class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_take_focus","intptr",0),
("on_set_focus","intptr",0),
("on_got_focus","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
/// Called when the browser component is about to loose focus. For instance,
/// if focus was on the last HTML element and the user pressed the TAB key.
/// |next| will be true (1) if the browser is giving focus to the next
/// component and false (0) if the browser is giving focus to the previous
/// component.
property on_take_focus index "on_take_focus" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_take_focus_i(s:pointer;b:pointer;nxt:integer);stdcall;
begin
c := getcallback(functionname());
if c then call(c,self(true),cef_object_get(b,class(cef_browser_t)),nxt);
end
///
/// Called when the browser component is requesting focus. |source| indicates
/// where the focus request is originating from. Return false (0) to allow the
/// focus to be set or true (1) to cancel setting the focus.
///
property on_set_focus index "on_set_focus" read getcallpropertybyindex write setcallpropertybyindex;
function on_set_focus_i(s:pointer;b:pointer;source:integer):integer;stdcall;
begin
c := getcallback(functionname());
if c then return call(c,self(true),cef_object_get(b,class(cef_browser_t)),source);
end
/// Called when the browser component has received focus.
property on_got_focus index "on_got_focus" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_got_focus(s:pointer;b:pointer);stdcall;
begin
c := getcallback(functionname());
if c then return call(c,self(true),cef_object_get(b,class(cef_browser_t)));
end
end
type cef_context_menu_params_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("get_xcoord","intptr",0),
("get_ycoord","intptr",0),
("get_type_flags","intptr",0),
("get_link_url","intptr",0),
("get_unfiltered_link_url","intptr",0),
("get_source_url","intptr",0),
("has_image_contents","intptr",0),
("get_title_text","intptr",0),
("get_page_url","intptr",0),
("get_frame_url","intptr",0),
("get_frame_charset","intptr",0),
("get_media_type","intptr",0),
("get_media_state_flags","intptr",0),
("get_selection_text","intptr",0),
("get_misspelled_word","intptr",0),
("get_dictionary_suggestions","intptr",0),
("is_editable","intptr",0),
("is_spell_check_enabled","intptr",0),
("get_edit_state_flags","intptr",0),
("is_custom_menu","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
function get_xcoord();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall; external npr;
return ##f(_getptr_());
end
function get_ycoord();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall; external npr;
return ##f(_getptr_());
end
function get_type_flags();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall; external npr;
return ##f(_getptr_());
end
function get_link_url();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall; external npr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
function get_unfiltered_link_url();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall; external npr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
function get_source_url();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall; external npr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
function has_image_contents();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall; external npr;
return ##f(_getptr_());
end
function get_title_text();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall; external npr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
function get_page_url();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall; external npr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
function get_frame_url();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall; external npr;
s := new cef_string_userfree_t(##f(_getptr_()));
return s.str;
end
function get_frame_charset();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall; external npr;
s := new cef_string_userfree_t(##f(_getptr_()));
return s.str;
end
function get_media_type();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall; external npr;
return (##f(_getptr_()));
end
function get_media_state_flags();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall; external npr;
return (##f(_getptr_()));
end
function get_selection_text();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall; external npr;
s := new cef_string_userfree_t(##f(_getptr_()));
return s.str;
end
function get_misspelled_word();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall; external npr;
s := new cef_string_userfree_t(##f(_getptr_()));
return s.str;
end
function get_dictionary_suggestions(suggestions);
begin
if not ifarray(suggestions) then return ;
ls := new cef_string_list_t();
ls.appends(appends);
npr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall; external npr;
return (##f(_getptr_(),ls._getptr_()));
end
function is_editable();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall; external npr;
return (##f(_getptr_()));
end
function is_spell_check_enabled();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall; external npr;
return (##f(_getptr_()));
end
function get_edit_state_flags();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall; external npr;
return (##f(_getptr_()));
end
function is_custom_menu();
begin
npr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall; external npr;
return (##f(_getptr_()));
end
end
type cef_menu_model_t = class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_sub_menu","intptr",0),
("clear","intptr",0),
("get_count","intptr",0),
("add_separator","intptr",0),
("add_item","intptr",0),
("add_check_item","intptr",0),
("add_radio_item","intptr",0),
("add_sub_menu","intptr",0),
("insert_separator_at","intptr",0),
("insert_item_at","intptr",0),
("insert_check_item_at","intptr",0),
("insert_radio_item_at","intptr",0),
("insert_sub_menu_at","intptr",0),
("remove","intptr",0),
("remove_at","intptr",0),
("get_index_of","intptr",0),
("get_command_id_at","intptr",0),
("set_command_id_at","intptr",0),
("get_label","intptr",0),
("get_label_at","intptr",0),
("set_label","intptr",0),
("set_label_at","intptr",0),
("get_type","intptr",0),
("get_type_at","intptr",0),
("get_group_id","intptr",0),
("get_group_id_at","intptr",0),
("set_group_id","intptr",0),
("set_group_id_at","intptr",0),
("get_sub_menu","intptr",0),
("get_sub_menu_at","intptr",0),
("is_visible","intptr",0),
("is_visible_at","intptr",0),
("set_visible","intptr",0),
("set_visible_at","intptr",0),
("is_enabled","intptr",0),
("is_enabled_at","intptr",0),
("set_enabled","intptr",0),
("set_enabled_at","intptr",0),
("is_checked","intptr",0),
("is_checked_at","intptr",0),
("set_checked","intptr",0),
("set_checked_at","intptr",0),
("has_accelerator","intptr",0),
("has_accelerator_at","intptr",0),
("set_accelerator","intptr",0),
("set_accelerator_at","intptr",0),
("remove_accelerator","intptr",0),
("remove_accelerator_at","intptr",0),
("get_accelerator","intptr",0),
("get_accelerator_at","intptr",0),
("set_color","intptr",0),
("set_color_at","intptr",0),
("get_color","intptr",0),
("get_color_at","intptr",0),
("set_font_list","intptr",0),
("set_font_list_at","intptr",0)
);
end
public
function create(ptr);
begin
inherited;
end
function is_sub_menu();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
/// Clears the menu. Returns true (1) on success.
function clear();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
/// Returns the number of items in this menu.
function get_count();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;stdcall; external ptr;
return ##f(_getptr_());
end
/// Add a separator to the menu. Returns true (1) on success.
function add_separator();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
/// Add an item to the menu. Returns true (1) on success.
function add_item(id,lb);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;id:integer;s:pointer):integer;stdcall; external ptr;
s := new cef_string_t();s.str := lb;
return ##f(_getptr_(),id,s._getptr_());
end
/// Add a check item to the menu. Returns true (1) on success.
function add_check_item(id,lb);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;id:integer;s:pointer):integer;stdcall; external ptr;
s := new cef_string_t();s.str := lb;
return ##f(_getptr_(),id,s._getptr_());
end
/// Add a radio item to the menu. Only a single item with the specified
/// |group_id| can be checked at a time. Returns true (1) on success.
function add_radio_item(id,lb,gid);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;id:integer;s:pointer;gid:integer):integer;stdcall; external ptr;
s := new cef_string_t();s.str := lb;
return ##f(_getptr_(),id,s._getptr_(),gid);
end
/// Add a sub-menu to the menu. The new sub-menu is returned.
function add_sub_menu(id,lb);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;id:integer;s:pointer):pointer;stdcall; external ptr;
s := new cef_string_t();s.str := lb;
return new cef_menu_model_t( ##f(_getptr_(),id,s._getptr_()));
end
/// Insert a separator in the menu at the specified |index|. Returns true (1)
function insert_separator_at(index,id,lb);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;index:pointer;id:integer;s:pointer):integer;stdcall; external ptr;
s := new cef_string_t();s.str := lb;
return ##f(_getptr_(),index,id,s._getptr_());
end
/// Insert an item in the menu at the specified |index|. Returns true (1) on
function insert_item_at(index,id,lb);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;index:pointer;id:integer;s:pointer):integer;stdcall; external ptr;
s := new cef_string_t();s.str := lb;
return ##f(_getptr_(),index,id,s._getptr_());
end
/// Insert a check item in the menu at the specified |index|. Returns true (1)
/// on success.
function insert_check_item_at(index,id,lb);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;index:pointer;id:integer;s:pointer):integer;stdcall; external ptr;
s := new cef_string_t();s.str := lb;
return ##f(_getptr_(),index,id,s._getptr_());
end
/// Insert a radio item in the menu at the specified |index|. Only a single
/// item with the specified |group_id| can be checked at a time. Returns true
/// (1) on success.
function insert_radio_item_at(index,id,lb,gid);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;index:pointer;id:integer;s:pointer;gid:integer):integer;stdcall; external ptr;
s := new cef_string_t();s.str := lb;
return ##f(_getptr_(),index,id,s._getptr_(),gid);
end
/// Insert a sub-menu in the menu at the specified |index|. The new sub-menu
/// is returned.
function insert_sub_menu_at(index,id,lb);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;index:pointer;id:integer;s:pointer):pointer;stdcall; external ptr;
s := new cef_string_t();s.str := lb;
return new cef_menu_model_t( ##f(_getptr_(),index,id,s._getptr_()));
end
/// Removes the item with the specified |command_id|. Returns true (1) on
/// success.
function remove(id);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;id:integer):integer;stdcall; external ptr;
return ##f(_getptr_(),id);
end
/// Removes the item at the specified |index|. Returns true (1) on success.
function remove_at(index);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;index:pointer):integer;stdcall; external ptr;
return ##f(_getptr_(),index);
end
function get_index_of(id);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;id:integer):integer;stdcall; external ptr;
return ##f(_getptr_(),id);
end
function set_visible(id,v);
begin
if not(id>0 or id<0) then return ;
nv := v?true:false;
ptr := _getvalue_(functionname());
f := function(sf:pointer;id:integer;v:integer):integer;stdcall; external ptr;
return ##f(_getptr_(),id,nv);
end
function set_enabled(id,e);
begin
if not(id>0 or id<0) then return ;
nv := e?true:false;
ptr := _getvalue_(functionname());
f := function(sf:pointer;id:integer;v:integer):integer;stdcall; external ptr;
return ##f(_getptr_(),id,nv);
end
function get_command_id_at(index);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;id:pointer):integer;stdcall; external ptr;
return ##f(_getptr_(),index);
end
function get_label_at(index);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;id:pointer):pointer;stdcall; external ptr;
s := new cef_string_userfree_t( ##f(_getptr_(),index));
return s.str;
end
end
type cef_context_menu_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_before_context_menu","intptr",0),
("run_context_menu","intptr",0),
("on_context_menu_command","intptr",0),
("on_context_menu_dismissed","intptr",0),
("run_quick_menu","intptr",0),
("on_quick_menu_command","intptr",0),
("on_quick_menu_dismissed","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
property on_before_context_menu index "on_before_context_menu" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_before_context_menu_i(sf:pointer;b:pointer;f:pointer;pms:pointer;md:pointer);stdcall;
begin
c := getcallback(functionname());
if not c then return 0;
return call(c,cef_object_get(sf),
cef_object_get(b,class(cef_browser_t)),
cef_object_get(f,class(cef_frame_t)),
cef_object_get(pms,class(cef_context_menu_params_t)),
cef_object_get(md,class(cef_menu_model_t))
);
echo "\r\n on_Befor_context_menu_command_>",md,"--",pms;
pm := new cef_context_menu_params_t(pms);
d := new cef_menu_model_t(md);
for i:= 0 to d.get_count() -1 do
begin
echo "\r\n label:",d.get_label_at(i);
end
d.add_item(27500+randomfrom(10->300),"addtest");
d.add_item(103,"refresh");
//echo ">>>x:", pm.get_xcoord(),"<==>",pm.get_ycoord();
// echo ">>url:",pm.get_frame_url();
return 0;
end
property run_context_menu index "run_context_menu" read _getvalue_ write _setvalue_;
property on_context_menu_command index "on_context_menu_command" read getcallpropertybyindex write setcallpropertybyindex;
function on_context_menu_command_i(s:pointer;b:pointer;f:pointer;pms:pointer;id:integer;evtflg:integer):integer;stdcall;
begin
c := getcallback(functionname());
if not c then return 0;
return call(c,cef_object_get(sf),
cef_object_get(b,class(cef_browser_t)),
cef_object_get(f,class(cef_frame_t)),
cef_object_get(pms,class(cef_context_menu_params_t)),
id,evtflg);
echo "\r\n on_context_menu_command_>","--",pms,"----",id,"----",evtflg;
pm := new cef_context_menu_params_t(pms);
//echo tostn(pm._getdata_());
echo ">>>x:", pm.get_selection_text(),"===",pm.get_xcoord(),"<==>",pm.get_ycoord();
echo ">>url:",pm.get_source_url();
return 1;
end
property on_context_menu_dismissed index "on_context_menu_dismissed" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_context_menu_dismissed_i(s:pointer;b:pointer;f:pointer);stdcall;
begin
c := getcallback(functionname());
if not c then return 0;
return call(c,cef_object_get(sf),
cef_object_get(b,class(cef_browser_t)),
cef_object_get(f,class(cef_frame_t)));
end
property run_quick_menu index "run_quick_menu" read _getvalue_ write _setvalue_;
property on_quick_menu_command index "on_quick_menu_command" read _getvalue_ write _setvalue_;
property on_quick_menu_dismissed index "on_quick_menu_dismissed" read _getvalue_ write _setvalue_;
end
type cef_download_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("can_download","intptr",0),
("on_before_download","intptr",0),
("on_download_updated","intptr",0));
end
public
function create(ptr)
begin
inherited;
end
/// Called before a download begins in response to a user-initiated action
/// (e.g. alt + link click or link click that returns a `Content-Disposition:
/// attachment` response from the server). |url| is the target download URL
/// and |request_function| is the target function (GET, POST, etc). Return
/// true (1) to proceed with the download or false (0) to cancel the download.
///
//function can_download_(sf:pointer;browser:pointer;url:pointer;request_method:pointer):integer;stdcall;
property can_download index "can_download" read getcallpropertybyindex write setcallpropertybyindex;
function can_download_i(sf:pointer;browser:pointer;url:pointer;request_method:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if not c then return 0;
u := new cef_string_t(url);
m := new cef_string_t(request_method);
return call(c,cef_object_get(sf),cef_object_get(browser,class(cef_browser_t)),u.str,m.str);
end
///
/// Called before a download begins. |suggested_name| is the suggested name
/// for the download file. By default the download will be canceled. Execute
/// |callback| either asynchronously or in this function to continue the
/// download if desired. Do not keep a reference to |download_item| outside of
/// this function.
property on_before_download index "on_before_download" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_before_download_i(sf:pointer;browser:pointer;download_item:pointer;suggested_name:pointer;callback:pointer);stdcall;
begin
c := getcallback(functionname());
if not c then return;
sn := new cef_string_t(suggested_name);
call(c ,self(true),
cef_object_get(browser),
cef_object_get(download_item,class(cef_download_item_t)),
sn.str,
cef_object_get(callback,class(cef_before_download_callback_t))
);
end
///
/// Called when a download's status or progress information has been updated.
/// This may be called multiple times before and after on_before_download().
/// Execute |callback| either asynchronously or in this function to cancel the
/// download if desired. Do not keep a reference to |download_item| outside of
/// this function.
/// procedure on_download_updated_(s:pointer;browser:pointer;download_item:_cef_download_item_t;callback:_cef_download_item_callback_t);stdcall;
property on_download_updated index "on_download_updated" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_download_updated_i(sf:pointer;browser:pointer;download_item:pointer;callback:pointer);stdcall;
begin
c := getcallback(functionname());
if not c then return;
call(c,self(true),
cef_object_get(browser),
cef_object_get(download_item,class(cef_download_item_t)),
cef_object_get(callback,class(cef_download_item_callback_t)));
end
end
type cef_urlrequest_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("get_request","intptr",0), //(self) _cef_request_t
("get_client","intptr",0), //(self) _cef_urlrequest_client_t
("get_request_status","intptr",0), //(self) int
("get_request_error","intptr",0), //(self) int
("get_response","intptr",0), //(self) cef_response_t
("cancel","intptr",0) //(self) void
);
end
public
function create(ptr)
begin
inherited;
end
end
type cef_urlrequest_client_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_request_complete","intptr",0), //(self,cef_urlrequest_t)
("on_upload_progress","intptr",0), //(self,cef_urlrequest_t,int64,int64)
("on_download_progress","intptr",0), //(self,cef_urlrequest_t,int64,int64)
("on_download_data","intptr",0), //(self,cef_urlrequest_t,void*data,size_t)
("get_response","get_auth_credentials",0) //(self,int ,cefstring,int,cefstring,cefsgtring,cef_auth_callback_t) cef_response_t
);
end
public
function create(ptr)
begin
inherited;
end
end
type cef_auth_callback_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("cont","intptr",0),
("cancel","intptr",0)
);
end
public
function create(ptr)
begin
inherited;
end
function cont(uname,pswd);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;uname:string;pswd:string);cdecl;external ptr;
u := new cef_string_t();
u.str := uname;
p := new cef_string_t();
p.str := pswd;
return ##f(_getptr_(),u._getptr_(),p._getptr_());
end
function cancel();
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer);cdecl;external ptr;
return ##f(_getptr_());
end
end
type cef_before_download_callback_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("cont","intptr",0));
end
public
function create(ptr)
begin
inherited;
end
///
/// Call to continue the download. Set |download_path| to the full file path
/// for the download including the file name or leave blank to use the
/// suggested name and the default temp directory. Set |show_dialog| to true
/// (1) if you do wish to show the default "Save As" dialog.
///
//void(CEF_CALLBACK* cont)(struct _cef_before_download_callback_t* self,
// const cef_string_t* download_path,
// int show_dialog);
procedure cont(url,show_dialog);stdcall;
begin
ptr := _getvalue_(functionname());
f := function(s:pointer;dp:pointer;sd:integer);stdcall;external ptr;
s := new cef_string_t();
s.str := url;
##f(_getptr_(),s._getptr_(),show_dialog);
//echo "\r\nbefor down cout";
end
end
type cef_download_item_callback_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("cancel","intptr",0),
("pause","intptr",0),
("resume","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
//property cancel index "cancel" read _getvalue_ write _setvalue_;
procedure cancel()
begin
//echo "\r\ndown load cancel";
ptr := _getvalue_(functionname());
f := function(s:pointer);stdcall;external ptr;
##f(_getptr_());
end
//property pause index "pause" read _getvalue_ write _setvalue_;
procedure pause();
begin
//echo "\r\ndown load pause";
ptr := _getvalue_(functionname());
f := function(s:pointer);stdcall;external ptr;
##f(_getptr_());
end
procedure resume();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer);stdcall;external ptr;
##f(_getptr_());
end
end
type cef_download_item_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_valid","intptr",0),
("is_in_progress","intptr",0),
("is_complete","intptr",0),
("is_canceled","intptr",0),
("get_current_speed","intptr",0),
("get_percent_complete","intptr",0),
("get_total_bytes","intptr",0),
("get_received_bytes","intptr",0),
("get_start_time","intptr",0),
("get_end_time","intptr",0),
("get_full_path","intptr",0),
("get_id","intptr",0),
("get_url","intptr",0),
("get_original_url","intptr",0),
("get_suggested_file_name","intptr",0),
("get_content_disposition","intptr",0),
("get_mime_type","intptr",0));
end
protected
function savetoglobal();override;
begin
end
public
function create(ptr)
begin
inherited ;
end
//property is_valid index "is_valid" read _getvalue_ write _setvalue_;
function is_valid();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall ;external ptr;
return ##f(_getptr_());
end
//property is_in_progress index "is_in_progress" read _getvalue_ write _setvalue_;
function is_in_progress();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall ;external ptr;
return ##f(_getptr_());
end
//property is_complete index "is_complete" read _getvalue_ write _setvalue_;
function is_complete();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall ;external ptr;
return ##f(_getptr_());
end
//property is_canceled index "is_canceled" read _getvalue_ write _setvalue_;
function is_canceled();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall ;external ptr;
return ##f(_getptr_());
end
//property get_current_speed index "get_current_speed" read _getvalue_ write _setvalue_;
function get_current_speed();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):int64;stdcall ;external ptr;
return ##f(_getptr_());
end
//property get_percent_complete index "get_percent_complete" read _getvalue_ write _setvalue_;
function get_percent_complete();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall ;external ptr;
return ##f(_getptr_());
end
//property get_total_bytes index "get_total_bytes" read _getvalue_ write _setvalue_;
function get_total_bytes();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):int64;stdcall ;external ptr;
return ##f(_getptr_());
end
//property get_received_bytes index "get_received_bytes" read _getvalue_ write _setvalue_;
function get_received_bytes();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):int64;stdcall ;external ptr;
return ##f(_getptr_());
end
//property get_start_time index "get_start_time" read _getvalue_ write _setvalue_;
function get_start_time();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall ;external ptr;
t := new cef_basetime_t( ##f(_getptr_()));
return t.val;
end
//property get_end_time index "get_end_time" read _getvalue_ write _setvalue_;
function get_end_time();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall ;external ptr;
t := new cef_basetime_t( ##f(_getptr_()));
return t.val;
end
//property get_full_path index "get_full_path" read _getvalue_ write _setvalue_;
function get_full_path();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall ;external ptr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
//property get_id index "get_id" read _getvalue_ write _setvalue_;
function get_id();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall ;external ptr;
return ##f(_getptr_());
end
//property get_url index "get_url" read _getvalue_ write _setvalue_;
function get_url();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall ;external ptr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
//property get_original_url index "get_original_url" read _getvalue_ write _setvalue_;
function get_original_url();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall ;external ptr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
//property get_suggested_file_name index "get_suggested_file_name" read _getvalue_ write _setvalue_;
function get_suggested_file_name();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall ;external ptr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
//property get_content_disposition index "get_content_disposition" read _getvalue_ write _setvalue_;
function get_content_disposition();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall ;external ptr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
property get_mime_type index "get_mime_type" read _getvalue_ write _setvalue_;
function get_mime_type();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall ;external ptr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
end
type cef_display_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_address_change","intptr",0),
("on_title_change","intptr",0),
("on_favicon_urlchange","intptr",0),
("on_fullscreen_mode_change","intptr",0),
("on_tooltip","intptr",0),
("on_status_message","intptr",0),
("on_console_message","intptr",0),
("on_auto_resize","intptr",0),
("on_loading_progress_change","intptr",0),
("on_cursor_change","intptr",0),
("on_media_access_change","intptr",0),
);
end
public
function create(ptr)
begin
inherited;
end
/// Called when a frame's address has changed.
property on_address_change index "on_address_change" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_address_change_i(sf:pointer;browser:pointer;frame:pointer;url:pointer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cef_object_get(frame,class(cef_frame_t)),
(new cef_string_t(url)).str
);
end
end
property on_title_change index "on_title_change" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_title_change_i(sf:pointer;browser:pointer;title:pointer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
(new cef_string_t(title)).str
);
end
end
property on_favicon_urlchange index "on_favicon_urlchange" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_favicon_urlchange_i(sf:pointer;browser:pointer;icon_urls:pointer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
(new cef_string_list_t(icon_urls)).get_values
);
end
end
property on_fullscreen_mode_change index "on_fullscreen_mode_change" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_fullscreen_mode_change_i(sf:pointer;browser:pointer;fullscreen:integer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
fullscreen
);
end
end
///
/// Called when the browser is about to display a tooltip. |text| contains the
/// text that will be displayed in the tooltip. To handle the display of the
/// tooltip yourself return true (1). Otherwise, you can optionally modify
/// |text| and then return false (0) to allow the browser to display the
/// tooltip. When window rendering is disabled the application is responsible
/// for drawing tooltips and the return value is ignored.
///
// int(CEF_CALLBACK* on_tooltip)(struct _cef_display_handler_t* self,
// struct _cef_browser_t* browser,
// cef_string_t* text);
property on_tooltip index "on_tooltip" read getcallpropertybyindex write setcallpropertybyindex;
function on_tooltip_i(sf:pointer;browser:pointer;text:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
(new cef_string_t(text)).str
);
end
end
// ///
// /// Called when the browser receives a status message. |value| contains the
// /// text that will be displayed in the status message.
// ///
// void(CEF_CALLBACK* on_status_message)(struct _cef_display_handler_t* self,
// struct _cef_browser_t* browser,
// const cef_string_t* value);
property on_status_message index "on_status_message" read getcallpropertybyindex write setcallpropertybyindex;
function on_status_message_i(sf:pointer;browser:pointer;value:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
(new cef_string_t(value)).str
);
end
end
/// Called to display a console message. Return true (1) to stop the message
/// from being output to the console.
///
// int(CEF_CALLBACK* on_console_message)(struct _cef_display_handler_t* self,
// struct _cef_browser_t* browser,
// cef_log_severity_t level,
// const cef_string_t* message,
// const cef_string_t* source,
// int line);
property on_console_message index "on_console_message" read getcallpropertybyindex write setcallpropertybyindex;
function on_console_message_i(sf:pointer;browser:pointer;level:integer;message:pointer;source:pointer;line:integer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
level,
(new cef_string_t(message)).str,
(new cef_string_t(source)).str,
line
);
end
end
/// Called when auto-resize is enabled via
/// cef_browser_host_t::SetAutoResizeEnabled and the contents have auto-
/// resized. |new_size| will be the desired size in view coordinates. Return
/// true (1) if the resize was handled or false (0) for default handling.
///
// int(CEF_CALLBACK* on_auto_resize)(struct _cef_display_handler_t* self,
// struct _cef_browser_t* browser,
// const cef_size_t* new_size);
property on_auto_resize index "on_auto_resize" read getcallpropertybyindex write setcallpropertybyindex;
function on_auto_resize_i(sf:pointer;browser:pointer;new_size:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
new cef_size_t(new_size)
);
end
end
///
/// Called when the browser's cursor has changed. If |type| is CT_CUSTOM then
/// |custom_cursor_info| will be populated with the custom cursor information.
/// Return true (1) if the cursor change was handled or false (0) for default
/// handling.
///
// int(CEF_CALLBACK* on_cursor_change)(
// struct _cef_display_handler_t* self,
// struct _cef_browser_t* browser,
// cef_cursor_handle_t cursor,
// cef_cursor_type_t type,
// const cef_cursor_info_t* custom_cursor_info);
property on_cursor_change index "on_cursor_change" read getcallpropertybyindex write setcallpropertybyindex;
function on_cursor_change_i(sf:pointer;browser:pointer;cursor:pointer;ctype:integer;custom_cursor_info:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cursor,
ctype,
nil
//new cef_cursor_info_t(custom_cursor_info)
);
end
end
/// Called when the browser's access to an audio and/or video source has
/// changed.
///
// void(CEF_CALLBACK* on_media_access_change)(
// struct _cef_display_handler_t* self,
// struct _cef_browser_t* browser,
// int has_video_access,
// int has_audio_access);
property on_media_access_change index "on_media_access_change" read getcallpropertybyindex write setcallpropertybyindex;
function on_media_access_change_i(sf:pointer;browser:pointer;has_video_access:integer;has_audio_access:integer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
has_video_access,
has_audio_access
);
end
end
end
type cef_frame_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_frame_created","intptr",0),
("on_frame_attached","intptr",0),
("on_frame_detached","intptr",0),
("on_main_frame_changed","intptr",0));
end
public
function create(ptr)
begin
inherited;
end
/// that references |frame|. Any commands that require transport to the
/// associated renderer process (LoadRequest, SendProcessMessage, GetSource,
/// etc.) will be queued until OnFrameAttached is called for |frame|.
///
// void(CEF_CALLBACK* on_frame_created)(struct _cef_frame_handler_t* self,
// struct _cef_browser_t* browser,
// struct _cef_frame_t* frame);
property on_frame_created index "on_frame_created" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_frame_created_i(sf:pointer;browser:pointer;frame:pointer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cef_object_get(frame,class(cef_frame_t))
);
end
end
/// Called when the main frame changes due to (a) initial browser creation,
/// (b) final browser destruction, (c) cross-origin navigation or (d) re-
/// navigation after renderer process termination (due to crashes, etc).
/// |old_frame| will be NULL and |new_frame| will be non-NULL when a main
/// frame is assigned to |browser| for the first time. |old_frame| will be
/// non-NULL and |new_frame| will be NULL and when a main frame is removed
/// from |browser| for the last time. Both |old_frame| and |new_frame| will be
/// non-NULL for cross-origin navigations or re-navigation after renderer
/// process termination. This function will be called after on_frame_created()
/// for |new_frame| and/or after on_frame_detached() for |old_frame|. If
/// called after cef_life_span_handler_t::on_before_close() during browser
/// destruction then cef_browser_t::is_valid() will return false (0) for
/// |browser|.
///
// void(CEF_CALLBACK* on_main_frame_changed)(struct _cef_frame_handler_t* self,
// struct _cef_browser_t* browser,
// struct _cef_frame_t* old_frame,
// struct _cef_frame_t* new_frame);
property on_main_frame_changed index "on_main_frame_changed" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_main_frame_changed_i(sf:pointer;browser:pointer;old_frame:pointer;new_frame:pointer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
(old_frame?cef_object_get(old_frame,class(cef_frame_t)):0),
(new_frame?cef_object_get(new_frame,class(cef_frame_t)):0)
);
end
end
end
type cef_find_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_find_result","intptr",0));
end
public
function create(ptr)
begin
inherited;
end
///
/// Called to execute a Chrome command triggered via menu selection or
/// keyboard shortcut. Values for |command_id| can be found in the
/// cef_command_ids.h file. |disposition| provides information about the
/// intended command target. Return true (1) if the command was handled or
/// false (0) for the default implementation. For context menu commands this
/// will be called after cef_context_menu_handler_t::OnContextMenuCommand.
/// Only used with the Chrome runtime.
///
// int(CEF_CALLBACK* on_chrome_command)(
// struct _cef_command_handler_t* self,
// struct _cef_browser_t* browser,
// int command_id,
// cef_window_open_disposition_t disposition);
property on_find_result index "on_find_result" read getcallpropertybyindex write setcallpropertybyindex;
function on_find_result_i(sf:pointer;browser:pointer;identifier:integer;count_:integer;selectionRect:pointer;activeMatchOrdinal:integer;finalUpdate:integer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
identifier,
count_,
new cef_rect_t(selectionRect),
activeMatchOrdinal,
finalUpdate
);
end
end
end
type cef_jsdialog_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_jsdialog","intptr",0),
("on_before_unload_dialog","intptr",0),
("on_reset_dialog_state","intptr",0),
("on_dialog_closed","intptr",0),
);
end
public
function create(ptr)
begin
inherited;
end
///
/// Called to execute a Chrome command triggered via menu selection or
/// keyboard shortcut. Values for |command_id| can be found in the
/// cef_command_ids.h file. |disposition| provides information about the
/// intended command target. Return true (1) if the command was handled or
/// false (0) for the default implementation. For context menu commands this
/// will be called after cef_context_menu_handler_t::OnContextMenuCommand.
/// Only used with the Chrome runtime.
///
// int(CEF_CALLBACK* on_chrome_command)(
// struct _cef_command_handler_t* self,
// struct _cef_browser_t* browser,
// int command_id,
// cef_window_open_disposition_t disposition);
property on_dialog_closed index "on_dialog_closed" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_dialog_closed_i(sf:pointer;browser:pointer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t))
);
end
end
end
type cef_audio_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("get_audio_parameters","intptr",0),
("on_audio_stream_started","intptr",0),
("on_audio_stream_packet","intptr",0),
("on_audio_stream_stopped","intptr",0),
("on_audio_stream_error","intptr",0)
);
end
public
function create(ptr)
begin
inherited;
end
///
/// Called on the UI thread to allow configuration of audio stream parameters.
/// Return true (1) to proceed with audio stream capture, or false (0) to
/// cancel it. All members of |params| can optionally be configured here, but
/// they are also pre-filled with some sensible defaults.
///
// int(CEF_CALLBACK* get_audio_parameters)(struct _cef_audio_handler_t* self,
// struct _cef_browser_t* browser,
// cef_audio_parameters_t* params);
property get_audio_parameters index "get_audio_parameters" read getcallpropertybyindex write setcallpropertybyindex;
function get_audio_parameters_i(sf:pointer;browser:pointer;pms:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
new cef_audio_parameters_t(pms)
);
end
end
///
/// Called on a browser audio capture thread when the browser starts streaming
/// audio. OnAudioStreamStopped will always be called after
/// OnAudioStreamStarted; both functions may be called multiple times for the
/// same browser. |params| contains the audio parameters like sample rate and
/// channel layout. |channels| is the number of channels.
///
// void(CEF_CALLBACK* on_audio_stream_started)(
// struct _cef_audio_handler_t* self,
// struct _cef_browser_t* browser,
// const cef_audio_parameters_t* params,
// int channels);
property on_audio_stream_started index "on_audio_stream_started" read getcallpropertybyindex write setcallpropertybyindex;
function on_audio_stream_started_i(sf:pointer;browser:pointer;pms:pointer;channels:integer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
new cef_audio_parameters_t(pms),
channels
);
end
end
///
/// Called on the UI or audio stream thread when an error occurred. During the
/// stream creation phase this callback will be called on the UI thread while
/// in the capturing phase it will be called on the audio stream thread. The
/// stream will be stopped immediately.
///
// void(CEF_CALLBACK* on_audio_stream_error)(struct _cef_audio_handler_t* self,
// struct _cef_browser_t* browser,
// const cef_string_t* message);
property on_audio_stream_error index "on_audio_stream_error" read getcallpropertybyindex write setcallpropertybyindex;
function on_audio_stream_error_i(sf:pointer;browser:pointer;message:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
(new cef_string_t(message)).str
);
end
end
end
type cef_permission_prompt_callback_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("cont","intptr",0)
);
end
public
function create(ptr)
begin
inherited;
end
function cont(result);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;result:integer);cdecl;external ptr;
return ##f(_getptr_(),result);
end
end
type cef_media_access_callback_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("cont","intptr",0),
("cancel","intptr",0)
);
end
public
function create(ptr)
begin
inherited;
end
function cont(allowed_permissions);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;allowed_permissions:integer);cdecl;external ptr;
return ##f(_getptr_(),allowed_permissions);
end
function cancel();
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer);cdecl;external ptr;
return ##f(_getptr_());
end
end
type cef_permission_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_request_media_access_permission","intptr",0),
("on_show_permission_prompt","intptr",0),
("on_dismiss_permission_prompt","intptr",0),
);
end
public
function create(ptr)
begin
inherited;
end
/// Called when a page requests permission to access media.
/// |requesting_origin| is the URL origin requesting permission.
/// |requested_permissions| is a combination of values from
/// cef_media_access_permission_types_t that represent the requested
/// permissions. Return true (1) and call cef_media_access_callback_t
/// functions either in this function or at a later time to continue or cancel
/// the request. Return false (0) to proceed with default handling. With the
/// Chrome runtime, default handling will display the permission request UI.
/// With the Alloy runtime, default handling will deny the request. This
/// function will not be called if the "--enable-media-stream" command-line
/// switch is used to grant all permissions.
///
// int(CEF_CALLBACK* on_request_media_access_permission)(
// struct _cef_permission_handler_t* self,
// struct _cef_browser_t* browser,
// struct _cef_frame_t* frame,
// const cef_string_t* requesting_origin,
// uint32 requested_permissions,
// struct _cef_media_access_callback_t* callback);
property on_request_media_access_permission index "on_request_media_access_permission" read getcallpropertybyindex write setcallpropertybyindex;
function on_request_media_access_permission_i(sf:pointer;browser:pointer;frame:pointer;requesting_origin:pointer;requested_permissions:integer;callback:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cef_object_get(frame,class(cef_frame_t)),
(new cef_string_t(requesting_origin)).str,
requested_permissions,
cef_object_get(callback,class(cef_media_access_callback_t))
);
end
end
///
/// Called when a page should show a permission prompt. |prompt_id| uniquely
/// identifies the prompt. |requesting_origin| is the URL origin requesting
/// permission. |requested_permissions| is a combination of values from
/// cef_permission_request_types_t that represent the requested permissions.
/// Return true (1) and call cef_permission_prompt_callback_t::Continue either
/// in this function or at a later time to continue or cancel the request.
/// Return false (0) to proceed with default handling. With the Chrome
/// runtime, default handling will display the permission prompt UI. With the
/// Alloy runtime, default handling is CEF_PERMISSION_RESULT_IGNORE.
///
// int(CEF_CALLBACK* on_show_permission_prompt)(
// struct _cef_permission_handler_t* self,
// struct _cef_browser_t* browser,
// uint64 prompt_id,
// const cef_string_t* requesting_origin,
// uint32 requested_permissions,
// struct _cef_permission_prompt_callback_t* callback);
property on_show_permission_prompt index "on_show_permission_prompt" read getcallpropertybyindex write setcallpropertybyindex;
function on_show_permission_prompt_i(sf:pointer;browser:pointer;prompt_id:int64;requesting_origin:pointer;requested_permissions:integer;callback:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
prompt_id,
(new cef_string_t(requesting_origin)).str,
requested_permissions,
cef_object_get(callback,class(cef_permission_prompt_callback_t))
);
end
end
///
/// Called when a permission prompt handled via OnShowPermissionPrompt is
/// dismissed. |prompt_id| will match the value that was passed to
/// OnShowPermissionPrompt. |result| will be the value passed to
/// cef_permission_prompt_callback_t::Continue or CEF_PERMISSION_RESULT_IGNORE
/// if the dialog was dismissed for other reasons such as navigation, browser
/// closure, etc. This function will not be called if OnShowPermissionPrompt
/// returned false (0) for |prompt_id|.
///
// void(CEF_CALLBACK* on_dismiss_permission_prompt)(
// struct _cef_permission_handler_t* self,
// struct _cef_browser_t* browser,
// uint64 prompt_id,
// cef_permission_request_result_t result);
property on_dismiss_permission_prompt index "on_dismiss_permission_prompt" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_dismiss_permission_prompt_i(sf:pointer;browser:pointer;prompt_id:int64;result:integer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
prompt_id,
result
);
end
end
end
type cef_drag_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_drag_enter","intptr",0),
("on_draggable_regions_changed","intptr",0)
);
end
public
function create(ptr)
begin
inherited;
end
///
/// Called when an external drag event enters the browser window. |dragData|
/// contains the drag event data and |mask| represents the type of drag
/// operation. Return false (0) for default drag handling behavior or true (1)
/// to cancel the drag event.
///
// int(CEF_CALLBACK* on_drag_enter)(struct _cef_drag_handler_t* self,
// struct _cef_browser_t* browser,
// struct _cef_drag_data_t* dragData,
// cef_drag_operations_mask_t mask);
property on_drag_enter index "on_drag_enter" read getcallpropertybyindex write setcallpropertybyindex;
function on_drag_enter_i(sf:pointer;browser:pointer;dragData:pointer;mask:integer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cef_object_get(dragData,class(cef_drag_data_t)),
mask
);
end
end
/// Called whenever draggable regions for the browser window change. These can
/// be specified using the '-webkit-app-region: drag/no-drag' CSS-property. If
/// draggable regions are never defined in a document this function will also
/// never be called. If the last draggable region is removed from a document
/// this function will be called with an NULL vector.
///
// void(CEF_CALLBACK* on_draggable_regions_changed)(
// struct _cef_drag_handler_t* self,
// struct _cef_browser_t* browser,
// struct _cef_frame_t* frame,
// size_t regionsCount,
// cef_draggable_region_t const* regions);
property on_draggable_regions_changed index "on_draggable_regions_changed" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_draggable_regions_changed_i(sf:pointer;browser:pointer;frame:pointer;regionsCount:pointer;regions:pointer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cef_object_get(frame,class(cef_frame_t)),
regionsCount,
regions
);
end
end
end
type cef_stream_writer_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("write","intptr",0),
("seek","intptr",0),
("tell","intptr",0),
("flush","intptr",0),
("may_block","intptr",0)
);
end
public
function create(ptr)
begin
inherited;
end
function write(ptr,size,n);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;ptr:string;size:pointer;n:pointer):pointer;cdecl;external ptr;
return ##f(_getptr_(),ptr,size,n);
end
function seek(offset,whence);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;offset:pointer;whence:integer):integer;cdecl;external ptr;
return ##f(_getptr_(),offset,whence);
end
function tell();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):int64;cdecl;external ptr;
return ##f(_getptr_());
end
function flush();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;cdecl;external ptr;
return ##f(_getptr_());
end
///
/// Returns true (1) if this writer performs work like accessing the file
/// system which may block. Used as a hint for determining the thread to
/// access the writer from.
function may_block();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;cdecl;external ptr;
return ##f(_getptr_());
end
end
type cef_write_handler_t = class(cef_stream_writer_t)
function create(ptr);
begin
inherited;
end
end
type cef_drag_data_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("clone","intptr",0),
("is_read_only","intptr",0),
("is_link","intptr",0),
("is_fragment","intptr",0),
("is_file","intptr",0),
("get_link_url","intptr",0),
("get_link_title","intptr",0),
("get_link_metadata","intptr",0),
("get_fragment_text","intptr",0),
("get_fragment_html","intptr",0),
("get_fragment_base_url","intptr",0),
("get_file_name","intptr",0),
("get_file_contents","intptr",0),
("get_file_names","intptr",0),
("set_link_url","intptr",0),
("set_link_title","intptr",0),
("set_link_metadata","intptr",0),
("set_fragment_text","intptr",0),
("set_fragment_html","intptr",0),
("set_fragment_base_url","intptr",0),
("reset_file_contents","intptr",0),
("add_file","intptr",0),
("clear_filenames","intptr",0),
("get_image","intptr",0),
("get_image_hotspot","intptr",0),
("has_image","intptr",0)
);
end
public
function create(ptr)
begin
inherited;
end
///
/// Returns a copy of the current object.
///struct _cef_drag_data_t*(CEF_CALLBACK* clone)(struct _cef_drag_data_t* self);
function clone();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;cdecl;external ptr;
r := ##f(_getptr_());
if r then return new cef_drag_data_t(r);
end
///
/// Returns true (1) if this object is read-only.
///
//int(CEF_CALLBACK* is_read_only)(struct _cef_drag_data_t* self);
function is_read_only();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;cdecl;external ptr;
return ##f(_getptr_());
end
function is_link();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;cdecl;external ptr;
return ##f(_getptr_());
end
function is_fragment();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;cdecl;external ptr;
return ##f(_getptr_());
end
function is_file();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;cdecl;external ptr;
return ##f(_getptr_());
end
function get_link_url();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;cdecl;external ptr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
function get_link_title();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;cdecl;external ptr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
function get_link_metadata();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;cdecl;external ptr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
function get_fragment_text();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;cdecl;external ptr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
function get_fragment_html();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;cdecl;external ptr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
function get_fragment_base_url();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;cdecl;external ptr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
function get_file_name();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;cdecl;external ptr;
s := new cef_string_userfree_t( ##f(_getptr_()));
return s.str;
end
function get_file_contents(writer);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;writer:pointer):pointer;cdecl;external ptr;
return ##f(_getptr_(),writer._getptr_());
end
function get_file_names();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;names:pointer):integer;cdecl;external ptr;
ls := new cef_string_list_t();
##f(_getptr_(),ls._getptr_());
return ls.get_values();
end
function set_link_url(url);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;url:pointer);cdecl;external ptr;
s := new cef_string_t();
s.str := url;
##f(_getptr_(),s._getptr_());
end
function set_link_title(title);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;title:pointer);cdecl;external ptr;
s := new cef_string_t();
s.str := title;
##f(_getptr_(),s._getptr_());
end
function set_link_metadata(title);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;title:pointer);cdecl;external ptr;
s := new cef_string_t();
s.str := title;
##f(_getptr_(),s._getptr_());
end
function set_fragment_text(title);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;title:pointer);cdecl;external ptr;
s := new cef_string_t();
s.str := title;
##f(_getptr_(),s._getptr_());
end
function set_fragment_html(title);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;title:pointer);cdecl;external ptr;
s := new cef_string_t();
s.str := title;
##f(_getptr_(),s._getptr_());
end
function set_fragment_base_url(title);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;title:pointer);cdecl;external ptr;
s := new cef_string_t();
s.str := title;
##f(_getptr_(),s._getptr_());
end
function reset_file_contents();
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer);cdecl;external ptr;
##f(_getptr_());
end
function add_file(path,display_name);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;path:pointer;title:display_name);cdecl;external ptr;
s1 := new cef_string_t();
s2 := new cef_string_t();
s1.str := path;
s2.str := display_name;
##f(_getptr_(),s1._getptr_(),s2._getptr_());
end
function clear_filenames();
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer);cdecl;external ptr;
##f(_getptr_());
end
//struct _cef_image_t*(CEF_CALLBACK* get_image)(struct _cef_drag_data_t* self);
// cef_point_t(CEF_CALLBACK* get_image_hotspot)(struct _cef_drag_data_t* self);
function has_image();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;cdecl;external ptr;
##f(_getptr_());
end
end
type cef_command_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_chrome_command","intptr",0));
end
public
function create(ptr)
begin
inherited;
end
///
/// Called to execute a Chrome command triggered via menu selection or
/// keyboard shortcut. Values for |command_id| can be found in the
/// cef_command_ids.h file. |disposition| provides information about the
/// intended command target. Return true (1) if the command was handled or
/// false (0) for the default implementation. For context menu commands this
/// will be called after cef_context_menu_handler_t::OnContextMenuCommand.
/// Only used with the Chrome runtime.
///
// int(CEF_CALLBACK* on_chrome_command)(
// struct _cef_command_handler_t* self,
// struct _cef_browser_t* browser,
// int command_id,
// cef_window_open_disposition_t disposition);
property on_chrome_command index "on_chrome_command" read getcallpropertybyindex write setcallpropertybyindex;
function on_chrome_command_i(sf:pointer;browser:pointer;command_id:integer;disposition:integer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
command_id,
disposition
);
end
end
end
type cef_keyboard_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_pre_key_event","intptr",0),
("on_key_event","intptr",0),
);
end
public
function create(ptr)
begin
inherited;
end
/// Called before a keyboard event is sent to the renderer. |event| contains
/// information about the keyboard event. |os_event| is the operating system
/// event message, if any. Return true (1) if the event was handled or false
/// (0) otherwise. If the event will be handled in on_key_event() as a
/// keyboard shortcut set |is_keyboard_shortcut| to true (1) and return false
property on_pre_key_event index "on_pre_key_event" read getcallpropertybyindex write setcallpropertybyindex;
function on_pre_key_event_i(sf:pointer;b:pointer;event:pointer;os_event:pointer;var is_keyboard_shortcut:integer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
shortcut := is_keyboard_shortcut;
r := call(c,self(true),
cef_object_get(b,class(cef_browser_t)),
cef_object_get(event,class(cef_key_event_t)),
os_event, //cef_event_handle_t
shortcut);
is_keyboard_shortcut := shortcut;
return r;
end
end
/// Called after the renderer and JavaScript in the page has had a chance to
/// handle the event. |event| contains information about the keyboard event.
/// |os_event| is the operating system event message, if any. Return true (1)
/// if the keyboard event was handled or false (0) otherwise.
property on_key_event index "on_key_event" write setcallpropertybyindex;
function on_key_event_i(sf:pointer;b:pointer;event:pointer;os_event:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
r := call(c,self(true),
cef_object_get(b,class(cef_browser_t)),
cef_object_get(event,class(cef_key_event_t)),
os_event
);
return r;
end
end
end
type cef_key_event_t=class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(
("ttype","int",0),
("modifiers","int",0),
("windows_key_code","int",0),
("native_key_code","int",0),
("is_system_key","int",0),
("character","short",0),
("unmodified_character","short",0),
("focus_on_editable_field","int",0)),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
class function memsize();
begin
if not SSTRUCT then getstruct();
if SSTRUCT then
begin
ldata := length(SSTRUCT)-1;
return SSTRUCT[ldata,3]+SSTRUCT[ldata,4]-SSTRUCT[0,3];
end
return 0;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
property ttype index "ttype" read _getvalue_ write _setvalue_;
property modifiers index "modifiers" read _getvalue_ write _setvalue_;
property windows_key_code index "windows_key_code" read _getvalue_ write _setvalue_;
property native_key_code index "native_key_code" read _getvalue_ write _setvalue_;
property is_system_key index "is_system_key" read _getvalue_ write _setvalue_;
property character index "character" read _getvalue_ write _setvalue_;
property unmodified_character index "unmodified_character" read _getvalue_ write _setvalue_;
property focus_on_editable_field index "focus_on_editable_field" read _getvalue_ write _setvalue_;
end
type cef_life_span_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_before_popup","intptr",0),
("on_after_created","intptr",0),
("do_close","intptr",0),
("on_before_close","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
property on_before_popup index "on_before_popup" read getcallpropertybyindex write setcallpropertybyindex;
function on_before_popup_i(sf:pointer;browser:pointer;frame:pointer;target_url:pointer;target_frame_name:pointer;
target_disposition:integer;user_gesture:integer;popupFeatures:pointer;windowInfo:pointer;
var client:pointer;settings:pointer;var extra_info:pointer;var no_javascript_access:integer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
url := new cef_string_t(target_url);
targ := new cef_string_t(target_frame_name);
pf := new cef_popup_features_t(popupFeatures);
wi := new cef_window_info_t(windowInfo);
no_javascript_accessi := no_javascript_access;
r := call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cef_object_get(frame,class(cef_frame_t)),
url.str,
targ.str,
target_disposition,
user_gesture,
pf,
wi,
clienti,
cef_object_get(settings,class(cef_browser_settings_t)),
extra_infoi,
no_javascript_accessi
);
if clienti is class(cef_client_t) then
begin
client := clienti._getptr_();
end
if extra_infoi is class(cef_dictionary_value_t) then
begin
extra_info := extra_infoi._getptr_();
end
no_javascript_access := no_javascript_accessi;
return r;
end
end
///
/// Called on the UI thread before a new popup browser is created. The
/// |browser| and |frame| values represent the source of the popup request.
/// The |target_url| and |target_frame_name| values indicate where the popup
/// browser should navigate and may be NULL if not specified with the request.
/// The |target_disposition| value indicates where the user intended to open
/// the popup (e.g. current tab, new tab, etc). The |user_gesture| value will
/// be true (1) if the popup was opened via explicit user gesture (e.g.
/// clicking a link) or false (0) if the popup opened automatically (e.g. via
/// the DomContentLoaded event). The |popupFeatures| structure contains
/// additional information about the requested popup window. To allow creation
/// of the popup browser optionally modify |windowInfo|, |client|, |settings|
/// and |no_javascript_access| and return false (0). To cancel creation of the
/// popup browser return true (1). The |client| and |settings| values will
/// default to the source browser's values. If the |no_javascript_access|
/// value is set to false (0) the new browser will not be scriptable and may
/// not be hosted in the same renderer process as the source browser. Any
/// modifications to |windowInfo| will be ignored if the parent browser is
/// wrapped in a cef_browser_view_t. Popup browser creation will be canceled
/// if the parent browser is destroyed before the popup browser creation
/// completes (indicated by a call to OnAfterCreated for the popup browser).
/// The |extra_info| parameter provides an opportunity to specify extra
/// information specific to the created popup browser that will be passed to
/// cef_render_process_handler_t::on_browser_created() in the render process.
///
{int(CEF_CALLBACK* on_before_popup)(
struct _cef_life_span_handler_t* self,
struct _cef_browser_t* browser,
struct _cef_frame_t* frame,
const cef_string_t* target_url,
const cef_string_t* target_frame_name,
cef_window_open_disposition_t target_disposition,
int user_gesture,
const cef_popup_features_t* popupFeatures,
struct _cef_window_info_t* windowInfo,
struct _cef_client_t** client,
struct _cef_browser_settings_t* settings,
struct _cef_dictionary_value_t** extra_info,
int* no_javascript_access);}
///
/// Called after a new browser is created. It is now safe to begin performing
/// actions with |browser|. cef_frame_handler_t callbacks related to initial
/// main frame creation will arrive before this callback. See
/// cef_frame_handler_t documentation for additional usage information.
///
//void(CEF_CALLBACK* on_after_created)(struct _cef_life_span_handler_t* self,struct _cef_browser_t* browser);
property on_after_created index "on_after_created" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_after_created_i(sf:pointer;browser:pointer);stdcall;
begin
c := getcallback(functionname());
if c then
call(c,self(true),
cef_object_get(browser,class(cef_browser_t))
);
end
///
/// Called when a browser has recieved a request to close. This may result
/// directly from a call to cef_browser_host_t::*close_browser() or indirectly
/// if the browser is parented to a top-level window created by CEF and the
/// user attempts to close that window (by clicking the 'X', for example). The
/// do_close() function will be called after the JavaScript 'onunload' event
/// has been fired.
///
/// An application should handle top-level owner window close notifications by
/// calling cef_browser_host_t::try_close_browser() or
/// cef_browser_host_t::CloseBrowser(false (0)) instead of allowing the window
/// to close immediately (see the examples below). This gives CEF an
/// opportunity to process the 'onbeforeunload' event and optionally cancel
/// the close before do_close() is called.
///
/// When windowed rendering is enabled CEF will internally create a window or
/// view to host the browser. In that case returning false (0) from do_close()
/// will send the standard close notification to the browser's top-level owner
/// window (e.g. WM_CLOSE on Windows, performClose: on OS X, "delete_event" on
/// Linux or cef_window_delegate_t::can_close() callback from Views). If the
/// browser's host window/view has already been destroyed (via view hierarchy
/// tear-down, for example) then do_close() will not be called for that
/// browser since is no longer possible to cancel the close.
///
/// When windowed rendering is disabled returning false (0) from do_close()
/// will cause the browser object to be destroyed immediately.
///
/// If the browser's top-level owner window requires a non-standard close
/// notification then send that notification from do_close() and return true
/// (1).
///
/// The cef_life_span_handler_t::on_before_close() function will be called
/// after do_close() (if do_close() is called) and immediately before the
/// browser object is destroyed. The application should only exit after
/// on_before_close() has been called for all existing browsers.
///
/// The below examples describe what should happen during window close when
/// the browser is parented to an application-provided top-level window.
///
/// Example 1: Using cef_browser_host_t::try_close_browser(). This is
/// recommended for clients using standard close handling and windows created
/// on the browser process UI thread. 1. User clicks the window close button
/// which sends a close notification
/// to the application's top-level window.
/// 2. Application's top-level window receives the close notification and
/// calls TryCloseBrowser() (which internally calls CloseBrowser(false)).
/// TryCloseBrowser() returns false so the client cancels the window
/// close.
/// 3. JavaScript 'onbeforeunload' handler executes and shows the close
/// confirmation dialog (which can be overridden via
/// CefJSDialogHandler::OnBeforeUnloadDialog()).
/// 4. User approves the close. 5. JavaScript 'onunload' handler executes.
/// 6. CEF sends a close notification to the application's top-level window
/// (because DoClose() returned false by default).
/// 7. Application's top-level window receives the close notification and
/// calls TryCloseBrowser(). TryCloseBrowser() returns true so the client
/// allows the window close.
/// 8. Application's top-level window is destroyed. 9. Application's
/// on_before_close() handler is called and the browser object
/// is destroyed.
/// 10. Application exits by calling cef_quit_message_loop() if no other
/// browsers
/// exist.
///
/// Example 2: Using cef_browser_host_t::CloseBrowser(false (0)) and
/// implementing the do_close() callback. This is recommended for clients
/// using non-standard close handling or windows that were not created on the
/// browser process UI thread. 1. User clicks the window close button which
/// sends a close notification
/// to the application's top-level window.
/// 2. Application's top-level window receives the close notification and:
/// A. Calls CefBrowserHost::CloseBrowser(false).
/// B. Cancels the window close.
/// 3. JavaScript 'onbeforeunload' handler executes and shows the close
/// confirmation dialog (which can be overridden via
/// CefJSDialogHandler::OnBeforeUnloadDialog()).
/// 4. User approves the close. 5. JavaScript 'onunload' handler executes.
/// 6. Application's do_close() handler is called. Application will:
/// A. Set a flag to indicate that the next close attempt will be allowed.
/// B. Return false.
/// 7. CEF sends an close notification to the application's top-level window.
/// 8. Application's top-level window receives the close notification and
/// allows the window to close based on the flag from #6B.
/// 9. Application's top-level window is destroyed. 10. Application's
/// on_before_close() handler is called and the browser object
/// is destroyed.
/// 11. Application exits by calling cef_quit_message_loop() if no other
/// browsers
/// exist.
///
//int(CEF_CALLBACK* do_close)(struct _cef_life_span_handler_t* self,struct _cef_browser_t* browser);
property do_close index "do_close" read getcallpropertybyindex write setcallpropertybyindex;
function do_close_i(sf:pointer;browser:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then return call(c,self(true),cef_object_get(browser,class(cef_browser_t)));
end
///
/// Called just before a browser is destroyed. Release all references to the
/// browser object and do not attempt to execute any functions on the browser
/// object (other than IsValid, GetIdentifier or IsSame) after this callback
/// returns. cef_frame_handler_t callbacks related to final main frame
/// destruction will arrive after this callback and cef_browser_t::IsValid
/// will return false (0) at that time. Any in-progress network requests
/// associated with |browser| will be aborted when the browser is destroyed,
/// and cef_resource_request_handler_t callbacks related to those requests may
/// still arrive on the IO thread after this callback. See cef_frame_handler_t
/// and do_close() documentation for additional usage information.
///
///void(CEF_CALLBACK* on_before_close)(struct _cef_life_span_handler_t* self,struct _cef_browser_t* browser);
property on_before_close index "on_before_close" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_before_close_i(sf:pointer;browser:pointer);stdcall;
begin
c := getcallback(functionname());
if c then return call(c,self(true),
cef_object_get(browser,class(cef_browser_t))
);
end
end
type cef_v8value_t = class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_valid" ,"intptr",0),
("is_undefined" ,"intptr",0),
("is_null" ,"intptr",0),
("is_bool" ,"intptr",0),
("is_int" ,"intptr",0),
("is_uint" ,"intptr",0),
("is_double" ,"intptr",0),
("is_date" ,"intptr",0),
("is_string" ,"intptr",0),
("is_object" ,"intptr",0),
("is_array" ,"intptr",0),
("is_array_buffer" ,"intptr",0),
("is_function" ,"intptr",0),
("is_promise" ,"intptr",0),
("is_same" ,"intptr",0),
("get_bool_value" ,"intptr",0),
("get_int_value" ,"intptr",0),
("get_uint_value" ,"intptr",0),
("get_double_value" ,"intptr",0),
("get_date_value" ,"intptr",0),
("get_string_value" ,"intptr",0),
("is_user_created" ,"intptr",0),
("has_exception" ,"intptr",0),
("get_exception" ,"intptr",0),
("clear_exception" ,"intptr",0),
("will_rethrow_exceptions" ,"intptr",0),
("set_rethrow_exceptions" ,"intptr",0),
("has_value_bykey" ,"intptr",0),
("has_value_byindex" ,"intptr",0),
("delete_value_bykey" ,"intptr",0),
("delete_value_byindex" ,"intptr",0),
("get_value_bykey" ,"intptr",0),
("get_value_byindex" ,"intptr",0),
("set_value_bykey" ,"intptr",0),
("set_value_byindex" ,"intptr",0),
("set_value_byaccessor" ,"intptr",0),
("get_keys","intptr",0),
("set_user_data" ,"intptr",0),
("get_user_data" ,"intptr",0),
("get_externally_allocated_memory" ,"intptr",0),
("adjust_externally_allocated_memory" ,"intptr",0),
("get_array_length" ,"intptr",0),
("get_array_buffer_release_callback" ,"intptr",0),
("neuter_array_buffer" ,"intptr",0),
("get_array_buffer_byte_length" ,"intptr",0),
("get_array_buffer_data" ,"intptr",0),
("get_function_name" ,"intptr",0),
("get_function_handler" ,"intptr",0),
("execute_function" ,"intptr",0),
("execute_function_with_context" ,"intptr",0),
("resolve_promise" ,"intptr",0),
("reject_promise" ,"intptr",0)
);
end
public
function create(ptr)
begin
inherited;
end
end
type cef_v8handler_t = class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("execute","intptr",0)
);
end
public
function create(ptr)
begin
inherited;
end
property execute index "execute" read getcallpropertybyindex write setcallpropertybyindex;
function execute_i(sf:pointer;n:pointer;obj:pointer;argc:pointer;argv:pointer;var r:pointer;excp:pointer):integer;stdcall; ///////<2F><>Ҫ<EFBFBD><D2AA>չ
begin
n1 := new cef_string_t(n);
c := getcallback(functionname());
if c then
begin
return true;
end
end
end
type cef_v8context_t = class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("get_task_runner","intptr",0), //self =runer
("is_valid","intptr",0), //self
("get_browser","intptr",0), //self
("get_frame","intptr",0), //self
("get_global","intptr",0),//self =_cef_v8value_t
("enter","intptr",0), //self =int
("exit","intptr",0), //self = int
("is_same","intptr",0), //self that =int
("eval","intptr",0) //self,string ,string v8**,v8except
);
end
public
function create(ptr)
begin
inherited;
end
function get_global();
begin
fptr := _getvalue_(functionname());
if fptr then
begin
_f_ := function(s:pointer):pointer;stdcall;external fptr;
r := ##_f_(_getptr_());
if r then return cef_object_get(r,class(cef_v8context_t));
end
return 0;
end
end
type cef_render_process_handler_t=class(cef_handler_base) //render
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_web_kit_initialized","intptr",0),
("on_browser_created","intptr",0),
("on_browser_destroyed","intptr",0),
("get_load_handler","intptr",0),
("on_context_created","intptr",0),
("on_context_released","intptr",0),
("on_uncaught_exception","intptr",0),
("on_focused_node_changed","intptr",0),
("on_process_message_received","intptr",0)
);
end
public
function create(ptr)
begin
inherited;
end
property on_web_kit_initialized index "on_web_kit_initialized" read getcallpropertybyindex write setcallpropertybyindex;
function on_web_kit_initialized_i(sf:pointer;browser:pointer;mode:integer;title:pointer;default_file_path:pointer;accept_filters:pointer;callback:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true));
end
end
property on_context_created index "on_context_created" read getcallpropertybyindex write setcallpropertybyindex;
function on_context_created_i(sf:pointer;browser:pointer;frame:pointer;ctx:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),cef_object_get(browser,class(cef_browser_t)),
cef_object_get(frame,class(cef_frame_t)),
cef_object_get(ctx,class(cef_v8context_t))
);
end
end
end
type cef_dialog_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_file_dialog","intptr",0));
end
public
function create(ptr)
begin
inherited;
end
///
/// Called to run a file chooser dialog. |mode| represents the type of dialog
/// to display. |title| to the title to be used for the dialog and may be NULL
/// to show the default title ("Open" or "Save" depending on the mode).
/// |default_file_path| is the path with optional directory and/or file name
/// component that should be initially selected in the dialog.
/// |accept_filters| are used to restrict the selectable file types and may
/// any combination of (a) valid lower-cased MIME types (e.g. "text/*" or
/// "image/*"), (b) individual file extensions (e.g. ".txt" or ".png"), or (c)
/// combined description and file extension delimited using "|" and ";" (e.g.
/// "Image Types|.png;.gif;.jpg"). To display a custom dialog return true (1)
/// and execute |callback| either inline or at a later time. To display the
/// default dialog return false (0).
///
//function on_file_dialog(sf:pointer;browser:pointer;mode:integer;title:pointer;default_file_path:pointer;accept_filters:pointer;callback:pointer):integer;stdcall;
property on_file_dialog index "on_file_dialog" read getcallpropertybyindex write setcallpropertybyindex;
function on_file_dialog_i(sf:pointer;browser:pointer;mode:integer;title:pointer;default_file_path:pointer;accept_filters:pointer;callback:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
mode,
(new cef_string_t(title)).str,
(new cef_string_t(default_file_path)).str,
cef_object_get(accept_filters,class(cef_string_list_t)),
cef_object_get(callback,class(cef_file_dialog_callback_t))
);
end
end
end
type cef_file_dialog_callback_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("cont","intptr",0),
("cancel","intptr",0)
);
end
public
function create(ptr)
begin
inherited;
end
///
/// Continue the file selection. |file_paths| should be a single value or a
/// list of values depending on the dialog mode. An NULL |file_paths| value is
/// treated the same as calling cancel().
procedure cont(flst);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;lst:pointer);stdcall;external ptr;
##f(_getptr_(),flst._getptr_());
end
procedure cancel();
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer);stdcall;external ptr;
##f(_getptr_());
end
end
type cef_load_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_loading_state_change","intptr",0),
("on_load_start","intptr",0),
("on_load_end","intptr",0),
("on_load_error","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
///
/// Called when the loading state has changed. This callback will be executed
/// twice -- once when loading is initiated either programmatically or by user
/// action, and once when loading is terminated due to completion,
/// cancellation of failure. It will be called before any calls to OnLoadStart
/// and after all calls to OnLoadError and/or OnLoadEnd.
///
// void(CEF_CALLBACK* on_loading_state_change)(struct _cef_load_handler_t* self,
// struct _cef_browser_t* browser,
// int isLoading,
// int canGoBack,
// int canGoForward);
property on_loading_state_change index "on_loading_state_change" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_loading_state_change_i(sf:pointer;browser:pointer;isLoading:integer;canGoBack:integer;canGoForward:integer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
isLoading,canGoBack,canGoForward) ;
end
end
///
/// Called after a navigation has been committed and before the browser begins
/// loading contents in the frame. The |frame| value will never be NULL --
/// call the is_main() function to check if this frame is the main frame.
/// |transition_type| provides information about the source of the navigation
/// and an accurate value is only available in the browser process. Multiple
/// frames may be loading at the same time. Sub-frames may start or continue
/// loading after the main frame load has ended. This function will not be
/// called for same page navigations (fragments, history state, etc.) or for
/// navigations that fail or are canceled before commit. For notification of
/// overall browser load status use OnLoadingStateChange instead.
///
// void(CEF_CALLBACK* on_load_start)(struct _cef_load_handler_t* self,
// struct _cef_browser_t* browser,
// struct _cef_frame_t* frame,
// cef_transition_type_t transition_type);
property on_load_start index "on_load_start" write setcallpropertybyindex;
procedure on_load_start_i(sf:pointer;browser:pointer;frame:pointer;transition_type:pointer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cef_object_get(frame,class(cef_frame_t)),
transition_type) ;
end
end
/// Called when the browser is done loading a frame. The |frame| value will
/// never be NULL -- call the is_main() function to check if this frame is the
/// main frame. Multiple frames may be loading at the same time. Sub-frames
/// may start or continue loading after the main frame load has ended. This
/// function will not be called for same page navigations (fragments, history
/// state, etc.) or for navigations that fail or are canceled before commit.
/// For notification of overall browser load status use OnLoadingStateChange
/// instead.
///
// void(CEF_CALLBACK* on_load_end)(struct _cef_load_handler_t* self,
// struct _cef_browser_t* browser,
// struct _cef_frame_t* frame,
// int httpStatusCode);
//
property on_load_end index "on_load_end" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_load_end_i(sf:pointer;browser:pointer;frame:pointer;httpStatusCode:integer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cef_object_get(frame,class(cef_frame_t)),
httpStatusCode) ;
end
end
/// Called when a navigation fails or is canceled. This function may be called
/// by itself if before commit or in combination with OnLoadStart/OnLoadEnd if
/// after commit. |errorCode| is the error code number, |errorText| is the
/// 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.
///
// void(CEF_CALLBACK* on_load_error)(struct _cef_load_handler_t* self,
// struct _cef_browser_t* browser,
// struct _cef_frame_t* frame,
// cef_errorcode_t errorCode,
// const cef_string_t* errorText,
// const cef_string_t* failedUrl);
property on_load_error index "on_load_error" write setcallpropertybyindex;
procedure on_load_error_i(sf:pointer;browser:pointer;frame:pointer;errorCode:integer;errorText:pointer;failedUrl:pointer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cef_object_get(frame,class(cef_frame_t)),
errorCode,
(new cef_string_t(errorText)).str,
(new cef_string_t(failedUrl)).str
) ;
end
end
end
type cef_post_data_element_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_read_only","intptr",0),
("set_to_empty","intptr",0),
("set_to_file","intptr",0),
("set_to_bytes","intptr",0),
("get_type","intptr",0),
("get_file","intptr",0),
("get_bytes_count","intptr",0),
("get_bytes","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
//property is_read_only index "is_read_only" read _getvalue_ write _setvalue_;
function is_read_only();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall;external ptr;
return ##f(_getvalue_());
end
//property set_to_empty index "set_to_empty" read _getvalue_ write _setvalue_;
function set_to_empty();
begin
ptr := _getvalue_(functionname());
f := procedure(s:pointer);stdcall;external ptr;
return ##f(_getvalue_());
end
//property set_to_file index "set_to_file" read _getvalue_ write _setvalue_;
function set_to_file(fl);
begin
if not ifstring(fl) then return ;
ptr := _getvalue_(functionname());
f := procedure(s:pointer;f:pointer);stdcall;external ptr;
s := new cef_string_t();
s.str := fl;
return ##f(_getvalue_(),fl._getptr_());
end
//property set_to_bytes index "set_to_bytes" read _getvalue_ write _setvalue_;
//property get_type index "get_type" read _getvalue_ write _setvalue_;
//property get_file index "get_file" read _getvalue_ write _setvalue_;
//property get_bytes_count index "get_bytes_count" read _getvalue_ write _setvalue_;
//property get_bytes index "get_bytes" read _getvalue_ write _setvalue_;
end
type cef_post_data_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_read_only","intptr",0),
("has_excluded_elements","intptr",0),
("get_element_count","intptr",0),
("get_elements","intptr",0),
("remove_element","intptr",0),
("add_element","intptr",0),
("remove_elements","intptr",0));
end
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(
("base","intptr",0),
("is_read_only","intptr",0),
("has_excluded_elements","intptr",0),
("get_element_count","intptr",0),
("get_elements","intptr",0),
("remove_element","intptr",0),
("add_element","intptr",0),
("remove_elements","intptr",0)),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
function create(ptr)
begin
inherited ;
end
//property is_read_only index "is_read_only" read _getvalue_ write _setvalue_;
function is_read_only();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall;external ptr;
return ##f(_getvalue_());
end
//property has_excluded_elements index "has_excluded_elements" read _getvalue_ write _setvalue_;
//property get_element_count index "get_element_count" read _getvalue_ write _setvalue_;
//property get_elements index "get_elements" read _getvalue_ write _setvalue_;
//property remove_element index "remove_element" read _getvalue_ write _setvalue_;
//property add_element index "add_element" read _getvalue_ write _setvalue_;
//property remove_elements index "remove_elements" read _getvalue_ write _setvalue_;
end
type cef_task_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("execute","intptr",0)
);
end
public
function create(ptr)
begin
inherited ;
if not (ptr>0 or ptr<0) then
begin
fexecinstance := makeinstance(thisfunction(execute));
_setvalue_("execute",fexecinstance);
end
end
function execute(s:pointer);
begin
if fonexecute then call(fonexecute,self);
end
property onexecute read fonexecute write fonexecute;
function destroy();override;
begin
if fexecinstance then deleteinstance(fexecinstance);
fexecinstance := 0;
inherited;
end
private
[weakref]fonexecute;
fexecinstance;
end
type cef_task_runer_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_same","intptr",0),
("belongs_to_current_thread","intptr",0),
("belongs_to_thread","intptr",0),
("post_task","intptr",0),
("post_delayed_task","intptr",0)
);
end
public
function create(ptr)
begin
inherited ;
end
/// Returns true (1) if this object is pointing to the same task runner as
function is_same(that);
begin
ptr := _getptr_();
fptr := _getvalue_(functionname());
_f_ := function(s:pointer;t:pointer):integer;stdcall;external fptr;
return ##_f_(ptr,that);
end
/// Returns true (1) if this task runner belongs to the current thread.
function belongs_to_current_thread();
begin
ptr := _getptr_();
fptr := _getvalue_(functionname());
_f_ := function(s:pointer):integer;stdcall;external fptr;
return ##_f_(ptr);
end
/// Returns true (1) if this task runner is for the specified CEF thread.
function belongs_to_thread(tid);
begin
ptr := _getptr_();
fptr := _getvalue_(functionname());
_f_ := function(s:pointer;tid:integer):integer;stdcall;external fptr;
return ##_f_(ptr,tid);
end
/// Post a task for execution on the thread associated with this task runner.
/// Execution will occur asynchronously.
function post_task(task);
begin
ptr := _getptr_();
fptr := _getvalue_(functionname());
_f_ := function(s:pointer;task:pointer):integer;stdcall;external fptr;
return ##_f_(ptr,task);
end
/// Post a task for delayed execution on the thread associated with this task
/// runner. Execution will occur asynchronously. Delayed tasks are not
/// supported on V8 WebWorker threads and will be executed without the
/// specified delay.
function post_delayed_task(task,delay_ms);
begin
ptr := _getptr_();
fptr := _getvalue_(functionname());
_f_ := function(s:pointer;task:pointer;delay_ms:int64):integer;stdcall;external fptr;
return ##_f_(ptr,task,delay_ms);
end
end
type cef_request_t=class(cef_contain_base) //cef_request_capi.h
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_read_only","intptr",0),
("get_url","intptr",0),
("set_url","intptr",0),
("get_method","intptr",0),
("set_method","intptr",0),
("set_referrer","intptr",0),
("get_referrer_url","intptr",0),
("get_referrer_policy","intptr",0),
("get_post_data","intptr",0),
("set_post_data","intptr",0),
("get_header_map","intptr",0),
("set_header_map","intptr",0),
("get_header_by_name","intptr",0),
("set_header_by_name","intptr",0),
("set","intptr",0),
("get_flags","intptr",0),
("set_flags","intptr",0),
("get_first_party_for_cookies","intptr",0),
("set_first_party_for_cookies","intptr",0),
("get_resource_type","intptr",0),
("get_transition_type","intptr",0),
("get_identifier","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
//property is_read_only index "is_read_only" read _getvalue_ write _setvalue_;
function is_read_only();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):integer;stdcall;external ptr;
return ##f(_getvalue_());
end
//property get_url index "get_url" read _getvalue_ write _setvalue_;
function get_url();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall;external ptr;
s := new cef_string_userfree_t(##f(_getptr_()));
return s.str;
end
//property set_url index "set_url" read _getvalue_ write _setvalue_;
function set_url(url);
begin
if not ifstring(url) then return;
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;str:pointer);stdcall;external ptr;
s := new cef_string_t();
s.str := url;
##f(_getptr_(),s._getptr_());
end
//property get_method index "get_method" read _getvalue_ write _setvalue_;
function get_method();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall;external ptr;
s := new cef_string_userfree_t(##f(_getptr_()));
return s.str;
end
//property set_method index "set_method" read _getvalue_ write _setvalue_;
function set_method(url);
begin
if not ifstring(url) then return;
ptr := _getvalue_(functionname());
f := procedure(s:pointer;str:pointer);stdcall;external ptr;
s := new cef_string_t();
s.str := url;
##f(_getptr_(),s._getptr_());
end
//property set_referrer index "set_referrer" read _getvalue_ write _setvalue_;
//property get_referrer_url index "get_referrer_url" read _getvalue_ write _setvalue_;
function get_referrer_url();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall;external ptr;
s := new cef_string_userfree_t(##f(_getptr_()));
return s.str;
end
//property get_referrer_policy index "get_referrer_policy" read _getvalue_ write _setvalue_;
//property get_post_data index "get_post_data" read _getvalue_ write _setvalue_;
//property set_post_data index "set_post_data" read _getvalue_ write _setvalue_;
//property get_header_map index "get_header_map" read _getvalue_ write _setvalue_;
//property set_header_map index "set_header_map" read _getvalue_ write _setvalue_;
//property get_header_by_name index "get_header_by_name" read _getvalue_ write _setvalue_;
//property set_header_by_name index "set_header_by_name" read _getvalue_ write _setvalue_;
//property set index "set" read _getvalue_ write _setvalue_;
//property get_flags index "get_flags" read _getvalue_ write _setvalue_;
//property set_flags index "set_flags" read _getvalue_ write _setvalue_;
//property get_first_party_for_cookies index "get_first_party_for_cookies" read _getvalue_ write _setvalue_;
function get_first_party_for_cookies();
begin
ptr := _getvalue_(functionname());
f := function(s:pointer):pointer;stdcall;external ptr;
s := new cef_string_userfree_t(##f(_getptr_()));
return s.str;
end
//property set_first_party_for_cookies index "set_first_party_for_cookies" read _getvalue_ write _setvalue_;
function set_first_party_for_cookies(cookies);
begin
if not ifstring(cookies) then return ;
ptr := _getvalue_(functionname());
f := procedure(s:pointer;c:pointer);stdcall;external ptr;
s := new cef_string_t();
s.str := cookies;
##f(_getptr_(),s._getptr_());
end
//property get_resource_type index "get_resource_type" read _getvalue_ write _setvalue_;
//property get_transition_type index "get_transition_type" read _getvalue_ write _setvalue_;
//property get_identifier index "get_identifier" read _getvalue_ write _setvalue_;
end
type cef_request_context_handler_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_request_context_initialized","intptr",0),
("get_resource_request_handler","intptr",0)
);
end
public
function create(ptr)
begin
inherited ;
end
property on_request_context_initialized index "on_request_context_initialized" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_request_context_initialized_i(s:pointer;request_context:pointer );stdcall;
begin
c := getcallback(functionname());
if c then
call(c,self(true),cef_object_get(request_context,class(cef_request_context_t)));
end
property get_resource_request_handler index "get_resource_request_handler" read getcallpropertybyindex write setcallpropertybyindex;
function get_resource_request_handler_i(s:pointer;b:pointer;f:pointer;r:pointer;
is_navigation:integer;is_download:integer;
request_initiator:pointer;var disable_default_handling:integer ):pointer;stdcall;
begin
return 0;
c := getcallback(functionname());
if c then
call(c,self(true),cef_object_get(b,class(cef_browser_t)),cef_object_get(f,class(cef_frame_t)),
cef_object_get(r,class(cef_request_t))
,is_navigation
,is_download
,new cef_string_t(request_initiator)
,disable_default_handling
);
end
end
type cef_resource_request_handler_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("get_cookie_access_filter","intptr",0),
("get_resource_request_handler","intptr",0)
);
end
public
function create(ptr)
begin
inherited ;
end
/// Called on the IO thread before a resource request is loaded. The |browser|
/// and |frame| values represent the source of the request, and may be NULL
/// for requests originating from service workers or cef_urlrequest_t. To
/// optionally filter cookies for the request return a
/// cef_cookie_access_filter_t object. The |request| object cannot not be
/// modified in this callback.
property on_request_context_initialized index "on_request_context_initialized" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_request_context_initialized_i(s:pointer;request_context:pointer );stdcall;
begin
c := getcallback(functionname());
if c then
call(c,self(true),cef_object_get(request_context,class(cef_request_context_t)));
end
property get_resource_request_handler index "get_resource_request_handler" read getcallpropertybyindex write setcallpropertybyindex;
function get_resource_request_handler_i(s:pointer;b:pointer;f:pointer;r:pointer;
is_navigation:integer;is_download:integer;
request_initiator:pointer;var disable_default_handling:integer ):pointer;stdcall;
begin
return 0;
c := getcallback(functionname());
if c then
call(c,self(true),cef_object_get(b,class(cef_browser_t)),cef_object_get(f,class(cef_frame_t)),
cef_object_get(r,class(cef_request_t))
,is_navigation
,is_download
,new cef_string_t(request_initiator)
,disable_default_handling
);
end
end
type cef_request_handler_t=class(cef_handler_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_before_browse","intptr",0),
("on_open_urlfrom_tab","intptr",0),
("get_resource_request_handler","intptr",0),
("get_auth_credentials","intptr",0),
("on_quota_request","intptr",0),
("on_certificate_error","intptr",0),
("on_select_client_certificate","intptr",0),
("on_render_view_ready","intptr",0),
("on_render_process_terminated","intptr",0),
("on_document_available_in_main_frame","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
///
/// Called on the UI thread before browser navigation. Return true (1) to
/// cancel the navigation or false (0) to allow the navigation to proceed. The
/// |request| object cannot be modified in this callback.
/// cef_load_handler_t::OnLoadingStateChange will be called twice in all
/// cases. If the navigation is allowed cef_load_handler_t::OnLoadStart and
/// cef_load_handler_t::OnLoadEnd will be called. If the navigation is
/// canceled cef_load_handler_t::OnLoadError will be called with an
/// |errorCode| value of ERR_ABORTED. The |user_gesture| value will be true
/// (1) if the browser navigated via explicit user gesture (e.g. clicking a
/// link) or false (0) if it navigated automatically (e.g. via the
/// DomContentLoaded event).
///
// int(CEF_CALLBACK* on_before_browse)(struct _cef_request_handler_t* self,
// struct _cef_browser_t* browser,
// struct _cef_frame_t* frame,
// struct _cef_request_t* request,
// int user_gesture,
// int is_redirect);
property on_before_browse index "on_before_browse" read getcallpropertybyindex write setcallpropertybyindex;
function on_before_browse_i(sf:pointer;browser:pointer;frame:pointer;request:pointer;user_gesture:integer;is_redirect:integer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cef_object_get(frame,class(cef_frame_t)),
cef_object_get(request,class(cef_request_t)),
user_gesture,
is_redirect
);
end
end
/// Called on the UI thread before OnBeforeBrowse in certain limited cases
/// where navigating a new or different browser might be desirable. This
/// includes user-initiated navigation that might open in a special way (e.g.
/// links clicked via middle-click or ctrl + left-click) and certain types of
/// cross-origin navigation initiated from the renderer process (e.g.
/// navigating the top-level frame to/from a file URL). The |browser| and
/// |frame| values represent the source of the navigation. The
/// |target_disposition| value indicates where the user intended to navigate
/// the browser based on standard Chromium behaviors (e.g. current tab, new
/// tab, etc). The |user_gesture| value will be true (1) if the browser
/// navigated via explicit user gesture (e.g. clicking a link) or false (0) if
/// it navigated automatically (e.g. via the DomContentLoaded event). Return
/// true (1) to cancel the navigation or false (0) to allow the navigation to
/// proceed in the source browser's top-level frame.
///
// int(CEF_CALLBACK* on_open_urlfrom_tab)(
// struct _cef_request_handler_t* self,
// struct _cef_browser_t* browser,
// struct _cef_frame_t* frame,
// const cef_string_t* target_url,
// cef_window_open_disposition_t target_disposition,
// int user_gesture);
property on_open_urlfrom_tab index "on_open_urlfrom_tab" read getcallpropertybyindex write setcallpropertybyindex;
function on_open_urlfrom_tab_i(sf:pointer;browser:pointer;frame:pointer;target_url:pointer;target_disposition:integer;user_gesture:integer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cef_object_get(frame,class(cef_frame_t)),
(new cef_string_t(target_url)).str,
user_gesture,
is_redirect
);
end
end
property get_resource_request_handler index "get_resource_request_handler" write setcallpropertybyindex;
property get_auth_credentials index "get_auth_credentials" write setcallpropertybyindex;
property on_quota_request index "on_quota_request" write setcallpropertybyindex;;
property on_certificate_error index "on_certificate_error" write setcallpropertybyindex;
property on_select_client_certificate index "on_select_client_certificate" write setcallpropertybyindex;
property on_render_view_ready index "on_render_view_ready" write setcallpropertybyindex;
property on_render_process_terminated index "on_render_process_terminated" write setcallpropertybyindex;
property on_document_available_in_main_frame index "on_document_available_in_main_frame" read getcallpropertybyindex write setcallpropertybyindex;
function on_document_available_in_main_frame_i(sf:pointer;browser:pointer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t))
);
end
end
end
type cef_command_line_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_valid","intptr",0),
("is_read_only","intptr",0),
("copy","intptr",0),
("init_from_argv","intptr",0),
("init_from_string","intptr",0),
("reset","intptr",0),
("get_argv","intptr",0),
("get_command_line_string","intptr",0),
("get_program","intptr",0),
("set_program","intptr",0),
("has_switches","intptr",0),
("has_switch","intptr",0),
("get_switch_value","intptr",0),
("get_switches","intptr",0),
("append_switch","intptr",0),
("append_switch_with_value","intptr",0),
("has_arguments","intptr",0),
("get_arguments","intptr",0),
("append_argument","intptr",0),
("prepend_wrapper","intptr",0)
);
end
public
function create(ptr)
begin
inherited ;
end
///
/// Method executed for visiting the DOM. The document object passed to this
/// function represents a snapshot of the DOM at the time this function is
/// executed. DOM objects are only valid for the scope of this function. Do
/// not keep references to or attempt to access any DOM objects outside the
/// scope of this function.
function is_valid();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
function is_read_only();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
function init_from_argv(argc,argv);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;argc:integer;argv:pointer);stdcall; external ptr;
return ##f(_getptr_(),argc,argv);
end
function get_command_line_string();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;stdcall; external ptr;
s := new cef_string_userfree_t(##f(_getptr_()));
return s.str;
end
function get_program();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;stdcall; external ptr;
s := new cef_string_userfree_t(##f(_getptr_()));
return s.str;
end
function set_program(exe);
begin
if not (exe and ifstring(exe)) then return 0;
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;exe:pointer);stdcall; external ptr;
u := new cef_string_t();
u.str := exe;
##f(_getptr_(),u._getptr_());
end
function has_switches();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
function has_switch(s);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;sp:pointer):integer;stdcall; external ptr;
u := new cef_string_t();
u.str := s;
return ##f(_getptr_(),u._getptr_());
end
function get_switch_value(n);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;n:pointer):pointer;stdcall; external ptr;
u := new cef_string_t();
u.str := n;
s := new cef_string_userfree_t(##f(_getptr_(),u._getptr_()));
return s.str;
end
function get_switches();
begin
ptr := _getvalue_(functionname());
f:= procedure(s:pointer;attrMap:pointer);stdcall; external ptr;
m := new cef_string_map_t();
##f(_getptr_(),m._getptr_());
return m.keyvalues();
end
function append_switch(s);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;sp:pointer):integer;stdcall; external ptr;
u := new cef_string_t();
u.str := s;
return ##f(_getptr_(),u._getptr_());
end
function append_switch_with_value(n,v);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;sp:pointer):integer;stdcall; external ptr;
u1 := new cef_string_t();u2 := new cef_string_t();
u1.str := n;u2.str := v;
return ##f(_getptr_(),u1._getptr_(),u2._getptr_);
end
function append_argument(s);
begin
if not( s and ifstring(s)) then return 0;
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;argument:pointer);stdcall; external ptr;
u := new cef_string_t();
u.str := s;
##f(_getptr_(),u._getptr_());
end
function get_arguments();
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;arguments:pointer);stdcall; external ptr;
u := new cef_string_list_t();
##f(_getptr_(),u._getptr_());
return u.get_values();
end
end
type cef_app_t=class(cef_contain_hander) //cef_app_capi.h
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_before_command_line_processing","intptr",0),
("on_register_custom_schemes","intptr",0),
("get_resource_bundle_handler","intptr",0),
("get_browser_process_handler","intptr",0),
("get_render_process_handler","intptr",0));
end
protected
function aftercreate(flg);override;
begin
inherited;
end
public
function create(ptr)
begin
inherited;
end
property on_before_command_line_processing index "on_before_command_line_processing" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_before_command_line_processing_i(sf:pointer;process:pointer;cmd:pointer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
(process?((new cef_string_t(process)).str):""),
new cef_command_line_t(cmd)
);
end
end
// property on_register_custom_schemes index "on_register_custom_schemes" read _getvalue_ write _setvalue_;
// property get_resource_bundle_handler index "get_resource_bundle_handler" read _getvalue_ write _setvalue_;
// property get_browser_process_handler index "get_browser_process_handler" read _getvalue_ write _setvalue_;
property render_process_handler index "get_render_process_handler" read clientgethandler write clientsethandler;
function get_render_process_handler(s:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
end
type cef_bounds_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(
("x","int",0),
("y","int",0),
("width","int",0),
("height","int",0)
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
property x index "x" read _getvalue_ write _setvalue_;
property y index "y" read _getvalue_ write _setvalue_;
property width index "width" read _getvalue_ write _setvalue_;
property height index "height" read _getvalue_ write _setvalue_;
end
type cef_window_info_t=class(cef_contain_base)
private
fbounds;
fboundsaddr;
function structdescribe();override;
begin
{$ifdef linux}
return array(
("window_name","user",getcefstr16struct()),
("bounds","user",getcefboundsstruct()),
("parent_window","intptr",0),
("windowless_rendering_enabled","int",0),
("shared_texture_enabled","int",0),
("external_begin_frame_enabled","int",0),
("window","intptr",0)
);
{$else}
return array(
("ex_style","int",0),
("window_name","user",getcefstr16struct()),
("style","int",1442906112),
("bounds","user",getcefboundsstruct()),
("parent_window","intptr",0),
("menu","intptr",0),
("windowless_rendering_enabled","int",0),
("shared_texture_enabled","int",0),
("external_begin_frame_enabled","int",0),
("window","intptr",0));
{$endif}
end
function getbounds();
begin
if not fbounds then
begin
fboundsaddr := _getvalueaddr2_("bounds");
fbounds := new cef_bounds_t(fboundsaddr);
end else
begin
npr := _getvalueaddr2_("bounds");
if npr<>fboundsaddr then
begin
fbounds._setcptr_(npr);
fboundsaddr := npr;
end
end
return fbounds;
end
base;
protected
function aftercreate(flg);override;
begin
end
function savetoglobal();override;
begin
end
public
function create(ptr)
begin
inherited ;
end
property ex_style index "ex_style" read _getvalue_ write _setvalue_;
property style index "style" read _getvalue_ write _setvalue_;
property menu index "menu" read _getvalue_ write _setvalue_;
property window_name index "window_name" read getcefstrmenber write setcefstrmenber;
property bounds read getbounds;
property parent_window index "parent_window" read _getvalue_ write _setvalue_;
property windowless_rendering_enabled index "windowless_rendering_enabled" read _getvalue_ write _setvalue_;
property shared_texture_enabled index "shared_texture_enabled" read _getvalue_ write _setvalue_;
property external_begin_frame_enabled index "external_begin_frame_enabled" read _getvalue_ write _setvalue_;
property window index "window" read _getvalue_ write _setvalue_;
end
type cef_settings_t=class(cef_contain_base) //cef_types.h
private
function structdescribe();override;
begin
/////////////////120.1.8/////////////////////
if cef_version_info(0)>119 then
return array(
("size","intptr",0),
("no_sandbox","int",1),
("browser_subprocess_path","user",getcefstr16struct()),
("framework_dir_path","user",getcefstr16struct()),
("main_bundle_path","user",getcefstr16struct()),
("chrome_runtime","int",0),
("multi_threaded_message_loop","int",0),
("external_message_pump","int",0),
("windowless_rendering_enabled","int",0),
("command_line_args_disabled","int",0),
("cache_path","user",getcefstr16struct()),
("root_cache_path","user",getcefstr16struct()),
("persist_session_cookies","int",1),
("persist_user_preferences","int",0),
("user_agent","user",getcefstr16struct()),
("user_agent_product","user",getcefstr16struct()),
("locale","user",getcefstr16struct()),
("log_file","user",getcefstr16struct()),
("log_severity","int",3),
("log_items","int",0),
("javascript_flags","user",getcefstr16struct()),
("resources_dir_path","user",getcefstr16struct()),
("locales_dir_path","user",getcefstr16struct()),
("pack_loading_disabled","int",0),
("remote_debugging_port","int",0),
("uncaught_exception_stack_size","int",0),
("background_color","int",0),
("accept_language_list","user",getcefstr16struct()),
("cookieable_schemes_list","user",getcefstr16struct()),
("cookieable_schemes_exclude_defaults","int",0),
("chrome_policy_id","user",getcefstr16struct()),
("chrome_app_icon_id","int",0)
);
/////////////////////105.3.39/
return array(
("size","intptr",0),
("no_sandbox","int",1),
("browser_subprocess_path","user",getcefstr16struct()),
("framework_dir_path","user",getcefstr16struct()),
("main_bundle_path","user",getcefstr16struct()),
("chrome_runtime","int",0),
("multi_threaded_message_loop","int",0),
("external_message_pump","int",0),
("windowless_rendering_enabled","int",0),
("command_line_args_disabled","int",0),
("cache_path","user",getcefstr16struct()),
("root_cache_path","user",getcefstr16struct()),
("user_data_path","user",getcefstr16struct()),
("persist_session_cookies","int",1),
("persist_user_preferences","int",0),
("user_agent","user",getcefstr16struct()),
("user_agent_product","user",getcefstr16struct()),
("locale","user",getcefstr16struct()),
("log_file","user",getcefstr16struct()),
("log_severity","int",3),
("javascript_flags","user",getcefstr16struct()),
("resources_dir_path","user",getcefstr16struct()),
("locales_dir_path","user",getcefstr16struct()),
("pack_loading_disabled","int",0),
("remote_debugging_port","int",0),
("uncaught_exception_stack_size","int",0),
("background_color","int",0),
("accept_language_list","user",getcefstr16struct()),
("cookieable_schemes_list","user",getcefstr16struct()),
("cookieable_schemes_exclude_defaults","int",0));
end
base;
protected
function aftercreate(flg);override;
begin
size := memsize();
//locale := "ZH-CH";
end
public
function create(ptr)
begin
inherited;
end
property size index "size" read _getvalue_ write _setvalue_;
property no_sandbox index "no_sandbox" read _getvalue_ write _setvalue_;
property browser_subprocess_path index "browser_subprocess_path" read getcefstrmenber write setcefstrmenber;
property framework_dir_path index "framework_dir_path" read getcefstrmenber write setcefstrmenber;
property main_bundle_path index "main_bundle_path" read getcefstrmenber write setcefstrmenber;
property chrome_runtime index "chrome_runtime" read _getvalue_ write _setvalue_;
property multi_threaded_message_loop index "multi_threaded_message_loop" read _getvalue_ write _setvalue_;
property external_message_pump index "external_message_pump" read _getvalue_ write _setvalue_;
property windowless_rendering_enabled index "windowless_rendering_enabled" read _getvalue_ write _setvalue_;
property command_line_args_disabled index "command_line_args_disabled" read _getvalue_ write _setvalue_;
property cache_path index "cache_path" read getcefstrmenber write setcefstrmenber;
property root_cache_path index "root_cache_path" read getcefstrmenber write setcefstrmenber;
property user_data_path index "user_data_path" read getcefstrmenber write setcefstrmenber;
property persist_session_cookies index "persist_session_cookies" read _getvalue_ write _setvalue_;
property persist_user_preferences index "persist_user_preferences" read _getvalue_ write _setvalue_;
property user_agent index "user_agent" read getcefstrmenber write setcefstrmenber;
property user_agent_product index "user_agent_product" read getcefstrmenber write setcefstrmenber;
property locale index "locale" read getcefstrmenber write setcefstrmenber;
property log_file index "log_file" read getcefstrmenber write setcefstrmenber;
property log_severity index "log_severity" read _getvalue_ write _setvalue_;
property log_items index "log_items" read _getvalue_ write _setvalue_;
property javascript_flags index "javascript_flags" read getcefstrmenber write setcefstrmenber;
property resources_dir_path index "resources_dir_path" read getcefstrmenber write setcefstrmenber;
property locales_dir_path index "locales_dir_path" read getcefstrmenber write setcefstrmenber;
property pack_loading_disabled index "pack_loading_disabled" read _getvalue_ write _setvalue_;
property remote_debugging_port index "remote_debugging_port" read _getvalue_ write _setvalue_;
property uncaught_exception_stack_size index "uncaught_exception_stack_size" read _getvalue_ write _setvalue_;
property background_color index "background_color" read _getvalue_ write _setvalue_;
property accept_language_list index "accept_language_list" read getcefstrmenber write setcefstrmenber;
property cookieable_schemes_list index "cookieable_schemes_list" read getcefstrmenber write setcefstrmenber;
property cookieable_schemes_exclude_defaults index "cookieable_schemes_exclude_defaults" read _getvalue_ write _setvalue_;
property chrome_policy_id index "chrome_policy_id" read getcefstrmenber write setcefstrmenber;
property chrome_app_icon_id index "chrome_app_icon_id" read _getvalue_ write _setvalue_;
end
type cef_browser_settings_t=class(cef_contain_base) //cef_types.h
private
function structdescribe();override;
begin
//////////////120.1.8/////////////////////////////
if cef_version_info(0)>119 then
return array(
("size","intptr",0),
("windowless_frame_rate","int",30), //0
("standard_font_family","user",getcefstr16struct()),
("fixed_font_family","user",getcefstr16struct()),
("serif_font_family","user",getcefstr16struct()),
("sans_serif_font_family","user",getcefstr16struct()),
("cursive_font_family","user",getcefstr16struct()),
("fantasy_font_family","user",getcefstr16struct()),
("default_font_size","int",0),
("default_fixed_font_size","int",0),
("minimum_font_size","int",0),
("minimum_logical_font_size","int",0),
("default_encoding","user",getcefstr16struct()),
("remote_fonts","int",0),
("javascript","int",1),//0
("javascript_close_windows","int",0),
("javascript_access_clipboard","int",0),
("javascript_dom_paste","int",0),
("image_loading","int",1),//0
("image_shrink_standalone_to_fit","int",0),
("text_area_resize","int",0),
("tab_to_links","int",0),
("local_storage","int",0),
("databases","int",0),
("webgl","int",0),
("background_color","int",0),
("chrome_status_bubble","int",0),
("chrome_zoom_bubble","int",0),
);
/////////////////105.3.39///////////////////////////
return array(
("size","intptr",0),
("windowless_frame_rate","int",30), //0
("standard_font_family","user",getcefstr16struct()),
("fixed_font_family","user",getcefstr16struct()),
("serif_font_family","user",getcefstr16struct()),
("sans_serif_font_family","user",getcefstr16struct()),
("cursive_font_family","user",getcefstr16struct()),
("fantasy_font_family","user",getcefstr16struct()),
("default_font_size","int",0),
("default_fixed_font_size","int",0),
("minimum_font_size","int",0),
("minimum_logical_font_size","int",0),
("default_encoding","user",getcefstr16struct()),
("remote_fonts","int",0),
("javascript","int",1),//0
("javascript_close_windows","int",0),
("javascript_access_clipboard","int",0),
("javascript_dom_paste","int",0),
("image_loading","int",1),//0
("image_shrink_standalone_to_fit","int",0),
("text_area_resize","int",0),
("tab_to_links","int",0),
("local_storage","int",0),
("databases","int",0),
("webgl","int",0),
("background_color","int",0),
("accept_language_list","user",getcefstr16struct()),
("chrome_status_bubble","int",0));
end
base;
protected
function aftercreate(flg);override;
begin
size := memsize();
end
public
function create(ptr)
begin
inherited;
end
property size index "size" read _getvalue_ write _setvalue_;
property windowless_frame_rate index "windowless_frame_rate" read _getvalue_ write _setvalue_;
property standard_font_family index "standard_font_family" read getcefstrmenber write setcefstrmenber;
property fixed_font_family index "fixed_font_family" read getcefstrmenber write setcefstrmenber;
property serif_font_family index "serif_font_family" read getcefstrmenber write setcefstrmenber;
property sans_serif_font_family index "sans_serif_font_family" read getcefstrmenber write setcefstrmenber;
property cursive_font_family index "cursive_font_family" read getcefstrmenber write setcefstrmenber;
property fantasy_font_family index "fantasy_font_family" read getcefstrmenber write setcefstrmenber;
property default_font_size index "default_font_size" read _getvalue_ write _setvalue_;
property default_fixed_font_size index "default_fixed_font_size" read _getvalue_ write _setvalue_;
property minimum_font_size index "minimum_font_size" read _getvalue_ write _setvalue_;
property minimum_logical_font_size index "minimum_logical_font_size" read _getvalue_ write _setvalue_;
property default_encoding index "default_encoding" read getcefstrmenber write setcefstrmenber;
property remote_fonts index "remote_fonts" read _getvalue_ write _setvalue_;
property javascript index "javascript" read _getvalue_ write _setvalue_;
property javascript_close_windows index "javascript_close_windows" read _getvalue_ write _setvalue_;
property javascript_access_clipboard index "javascript_access_clipboard" read _getvalue_ write _setvalue_;
property javascript_dom_paste index "javascript_dom_paste" read _getvalue_ write _setvalue_;
property image_loading index "image_loading" read _getvalue_ write _setvalue_;
property image_shrink_standalone_to_fit index "image_shrink_standalone_to_fit" read _getvalue_ write _setvalue_;
property text_area_resize index "text_area_resize" read _getvalue_ write _setvalue_;
property tab_to_links index "tab_to_links" read _getvalue_ write _setvalue_;
property local_storage index "local_storage" read _getvalue_ write _setvalue_;
property databases index "databases" read _getvalue_ write _setvalue_;
property webgl index "webgl" read _getvalue_ write _setvalue_;
property background_color index "background_color" read _getvalue_ write _setvalue_;
property accept_language_list index "accept_language_list" read getcefstrmenber write setcefstrmenber;
property chrome_status_bubble index "chrome_status_bubble" read _getvalue_ write _setvalue_;
property chrome_zoom_bubble index "chrome_zoom_bubble" read _getvalue_ write _setvalue_;
end
type cef_contain_hander = class(cef_contain_base)
private
fclienthanders ;
protected
function clientgethandler(idx);
begin
return fclienthanders[idx];
end
function clientsethandler(idx,o);
begin
if pos("get_",idx)<>1 then return ;
nidx := idx[5:];
co := findclass("cef_"+nidx+"_t");
if o is co then
begin
p := o.client;
if p<>self(true) then
begin
if p then
begin
invoke(p,nidx,1,nil);
end
end
o.client := self(true);
o.handlename := nidx;
if o.getcallcount() then
begin
fclienthanders[idx] := o;
f := findfunction(idx,self(true));
_setvalue_(idx,getinstance(f));
end else
begin
fclienthanders[idx] := o;
_setvalue_(idx,0); //getinstance(f)
end
end else //<2F>Ƴ<EFBFBD>
begin
o := fclienthanders[idx];
if o then //<2F><><EFBFBD><EFBFBD>
begin
reindex(fclienthanders,array(idx:nil));
_setvalue_(idx,0);
o.client := nil;
o.handlename :="";
end
end
end
function gethandlerptr(n,c);
begin
return gethandler(n,c)._getptr_();
end
public
function create(ptr);
begin
fclienthanders := array();
inherited;
end
end
type cef_client_t=class(cef_contain_hander) //cef_client_capi.h
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("get_audio_handler","intptr",0),
("get_command_handler","intptr",0),
("get_context_menu_handler","intptr",0),
("get_dialog_handler","intptr",0),
("get_display_handler","intptr",0),
("get_download_handler","intptr",0),
("get_drag_handler","intptr",0),
("get_find_handler","intptr",0),
("get_focus_handler","intptr",0),
("get_frame_handler","intptr",0),
("get_permission_handler","intptr",0),
("get_jsdialog_handler","intptr",0),
("get_keyboard_handler","intptr",0),
("get_life_span_handler","intptr",0),
("get_load_handler","intptr",0),
("get_print_handler","intptr",0),
("get_render_handler","intptr",0),
("get_request_handler","intptr",0),
("on_process_message_received","intptr",0));
end
protected
function aftercreate(flg);override;
begin
inherited;
end
public
function create(ptr)
begin
fclienthanders := array();
inherited ;
end
property audio_handler index "get_audio_handler" read clientgethandler write clientsethandler;
function get_audio_handler(s:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
//echo "\r\n---------get audio:",o._getptr_();
if o then return o._getptr_();
end
property command_handler index "get_command_handler" read clientgethandler write clientsethandler;
function get_command_handler(s:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property context_menu_handler index "get_context_menu_handler" read clientgethandler write clientsethandler;
function get_context_menu_handler(s:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property dialog_handler index "get_dialog_handler" read clientgethandler write clientsethandler;
function get_dialog_handler(sf:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property display_handler index "get_display_handler" read clientgethandler write clientsethandler;
function get_display_handler(s:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property download_handler index "get_download_handler" read clientgethandler write clientsethandler;
function get_download_handler(s:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property drag_handler index "get_drag_handler" read clientgethandler write clientsethandler;
function get_drag_handler(s:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property find_handler index "get_find_handler" read clientgethandler write clientsethandler;
function get_find_handler(s:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property focus_handler index "get_focus_handler" read clientgethandler write clientsethandler;
function get_focus_handler(s:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property frame_handler index "get_frame_handler" read clientgethandler write clientsethandler;
function get_frame_handler(sf:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property permission_handler index "get_permission_handler" read clientgethandler write clientsethandler;
function get_permission_handler(sf:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property jsdialog_handler index "get_jsdialog_handler" read clientgethandler write clientsethandler;
function get_jsdialog_handler(sf:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property keyboard_handler index "get_keyboard_handler" read clientgethandler write clientsethandler;
function get_keyboard_handler(sf:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property life_span_handler index "get_life_span_handler" read clientgethandler write clientsethandler;
function get_life_span_handler(sf:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property load_handler index "get_load_handler" read clientgethandler write clientsethandler;
function get_load_handler(s:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
//property get_print_handler index "get_print_handler" read _getvalue_ write _setvalue_;
property render_handler index "get_render_handler" read clientgethandler write clientsethandler;
function get_render_handler(s:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
property request_handler index "get_request_handler" read clientgethandler write clientsethandler;
function get_request_handler(s:pointer):pointer;stdcall;
begin
o := clientgethandler(functionname());
if o then return o._getptr_();
end
//property on_process_message_received index "on_process_message_received" read _getvalue_ write _setvalue_;
property on_process_message_received index "on_process_message_received" read getcallpropertybyindex write setcallpropertybyindex;
function on_process_message_received_i(sf:pointer;browser:pointer;frame:pointer;source_process:integer;message:pointer):pointer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cef_object_get(frame,class(cef_frame_t)),
source_process,
cef_object_get(message,class(cef_process_message_t))
);
end
end
end
type cef_string_visitor_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("visit","intptr",0));
end
public
function create(ptr);
begin
inherited;
end
function destroy();override;
begin
inherited;
end
//property visited read fvisited write fvisited;
property visit index "visit" read getcallpropertybyindex write setcallpropertybyindex;
procedure visit_i(sf:pointer;cs:pointer);stdcall;
begin
c := getcallback(functionname());
if c then
begin
s := new cef_string_userfree_t(cs);
call(c,self(true),s.str)
end
end
end
type cef_preference_manager_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("has_preference","intptr",0),
("get_preference","intptr",0),
("get_all_preferences","intptr",0),
("can_set_preference","intptr",0),
("set_preference","intptr",0));
end
public
function create(ptr)
begin
inherited;
end
//property has_preference index "has_preference" read _getvalue_ write _setvalue_;
function has_preference(n);
begin
if not ifstring(n) then return
s := new cef_string_t();
s.str := n;
ptr := (_getvalue_(functionname()));
f := function(sf:pointer;s:pointer):integer;stdcall;external ptr;
return ##f(_getptr_(),s._getptr_());
end
//property get_preference index "get_preference" read _getvalue_ write _setvalue_;
//property get_all_preferences index "get_all_preferences" read _getvalue_ write _setvalue_;
//property can_set_preference index "can_set_preference" read _getvalue_ write _setvalue_;
//property set_preference index "set_preference" read _getvalue_ write _setvalue_;
end
type cef_request_context_t=class(cef_contain_base)
private
function getpms();
begin
return array(
("base","user",getbasestruct()),
("has_preference","intptr",0),
("get_preference","intptr",0),
("get_all_preferences","intptr",0),
("can_set_preference","intptr",0),
("set_preference","intptr",0));
end
function structdescribe();override;
begin
return array(
("base","user",getpms()),
("is_same","intptr",0),
("is_sharing_with","intptr",0),
("is_global","intptr",0),
("get_handler","intptr",0),
("get_cache_path","intptr",0),
("get_cookie_manager","intptr",0),
("register_scheme_handler_factory","intptr",0),
("clear_scheme_handler_factories","intptr",0),
("clear_certificate_exceptions","intptr",0),
("clear_http_auth_credentials","intptr",0),
("close_all_connections","intptr",0),
("resolve_host","intptr",0),
("load_extension","intptr",0),
("did_load_extension","intptr",0),
("has_extension","intptr",0),
("get_extensions","intptr",0),
("get_extension","intptr",0),
("get_media_router","intptr",0));
return SSTRUCT;
end
protected
function getbasecalss();override;
begin
return class(cef_preference_manager_t);
end
function aftercreate(flg);override;
begin
end
public
function create(ptr)
begin
inherited ;
//base.base.size := memsize();
end
//property is_same index "is_same" read _getvalue_ write _setvalue_;
//property is_sharing_with index "is_sharing_with" read _getvalue_ write _setvalue_;
//property is_global index "is_global" read _getvalue_ write _setvalue_;
function is_global();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall;external ptr;
return ##f(_getptr_());
end
//property get_handler index "get_handler" read _getvalue_ write _setvalue_;
function get_handler();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;stdcall;external ptr;
s := ##f(_getptr_());
return s;
end
//property get_cache_path index "get_cache_path" read _getvalue_ write _setvalue_;
function get_cache_path();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;stdcall;external ptr;
echo "{- ",ptr," -}";
s := ##f(_getptr_());
echo "{{",s,"}}";
if s then
begin
echo ">>>:",s;
p := new cef_string_userfree_t(s);
return p.str;
end
end
//property get_cookie_manager index "get_cookie_manager" read _getvalue_ write _setvalue_;
function get_cookie_manager(callback);
begin
ptr := (_getvalue_(functionname()));
f := function(sf:pointer;callback:pointer):pointer;stdcall;external ptr;
if callback is class(cef_completion_callback_t) then c := callback._getptr_;
else c := callback;
r := ##f(_getptr_(),c);
if r then
begin
return new cef_cookie_manager_t(r);
end
end
//property register_scheme_handler_factory index "register_scheme_handler_factory" read _getvalue_ write _setvalue_;
//property clear_scheme_handler_factories index "clear_scheme_handler_factories" read _getvalue_ write _setvalue_;
//property clear_certificate_exceptions index "clear_certificate_exceptions" read _getvalue_ write _setvalue_;
//property clear_http_auth_credentials index "clear_http_auth_credentials" read _getvalue_ write _setvalue_;
//property close_all_connections index "close_all_connections" read _getvalue_ write _setvalue_;
//property resolve_host index "resolve_host" read _getvalue_ write _setvalue_;
//property load_extension index "load_extension" read _getvalue_ write _setvalue_;
//property did_load_extension index "did_load_extension" read _getvalue_ write _setvalue_;
//property has_extension index "has_extension" read _getvalue_ write _setvalue_;
//property get_extensions index "get_extensions" read _getvalue_ write _setvalue_;
function get_extensions();
begin
ptr := (_getvalue_(functionname()));
echo "\r\nget_extensions:";
f := function(sf:pointer;ats:pointer):pointer;stdcall;external ptr;
ats := new cef_string_list_t();
r := ##f(_getptr_(),ats._getptr_());
return ats.get_values();
end
//property get_extension index "get_extension" read _getvalue_ write _setvalue_;
//property get_media_router index "get_media_router" read _getvalue_ write _setvalue_;
end
type cef_domvisitor_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("visit","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
///
/// Method executed for visiting the DOM. The document object passed to this
/// function represents a snapshot of the DOM at the time this function is
/// executed. DOM objects are only valid for the scope of this function. Do
/// not keep references to or attempt to access any DOM objects outside the
/// scope of this function.
property visit index "visit" read getcallpropertybyindex write setcallpropertybyindex;
procedure visit_i(sf:pointer;dom:pointer);stdcall;
begin
echo "\r\ninvisit=====";
c := getcallback(functionname());
if c then
begin
call(c,self(true),cef_object_get( dom,class(cef_domdocument_t)));
end
end
end
type cef_cookie_visitor_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("visit","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
function destroy();override;
begin
inherited;
p := _getvalue_("visit");
if p then
begin
deleteinstance(p);
end
end
/// Method that will be called once for each cookie. |count| is the 0-based
/// index for the current cookie. |total| is the total number of cookies. Set
/// |deleteCookie| to true (1) to delete the cookie currently being visited.
/// Return false (0) to stop visiting cookies. This function may never be
/// called if no cookies are found.
///int(CEF_CALLBACK* visit)(struct _cef_cookie_visitor_t* self,const struct _cef_cookie_t* cookie,int count,int total,int* deleteCookie);
property visit read getcallpropertybyindex write setcallpropertybyindex;
function visit_i(sf:pointer;cookie:pointer;ct:integer;total:integer;var deleteCookie:integer):integer;stdcall;
begin
c := getcallback(functionname());
if c then
begin
del := deleteCookie ;
r := call(c,self(true),
cef_object_get(cookie,class(cef_cookie_t)),
ct,total,
del
);
deleteCookie := del;
return r;
end
end
end
type cef_run_file_dialog_callback_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_file_dialog_dismissed","intptr",0)
);
end
public
function create(ptr)
begin
inherited ;
end
/// Called asynchronously after the file dialog is dismissed. |file_paths|
/// will be a single value or a list of values depending on the dialog mode.
/// If the selection was cancelled |file_paths| will be NULL.
///
//procedure on_file_dialog_dismissed(sf;cef_string_list_t file_paths);
property on_file_dialog_dismissed index "on_file_dialog_dismissed" write setcallpropertybyindex;
end
type cef_callback_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("cont","intptr",0),
("cancel","intptr",0)
);
end
public
function create(ptr)
begin
inherited ;
end
property cont index "cont" write setcallpropertybyindex;
property cancel index "cancel" write setcallpropertybyindex;
end
type cef_jsdialog_callback_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("cont","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
/// Continue the JS dialog request. Set |success| to true (1) if the OK button
/// was pressed. The |user_input| value should be specified for prompt
/// dialogs.
property cont index "cont" read getcallpropertybyindex write setcallpropertybyindex;
procedure cont_i(sf:pointer;success:integer;user_input:pointer);stdcall;virtual;
begin
c := getcallback(functionname());
if c then
call(c,self(true),
success,
(new cef_string_t(user_input)).str
);
end
end
type cef_completion_callback_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("on_complete","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
//procedure on_complete(sf:pointer);stdcall;
property on_complete index "on_complete" read getcallpropertybyindex write setcallpropertybyindex;
procedure on_complete_i(sf:pointer);stdcall;virtual;
begin
c := getcallback(functionname());
if c then call(c,self(true));
end
end
type cef_set_cookie_callback_t=class(cef_completion_callback_t)
public
function create(ptr)
begin
inherited ;
end
//procedure on_complete(sf:pointer;success:integer);stdcall;
procedure on_complete_i(sf:pointer;success:integer);stdcall;override;
begin
c := getcallback(functionname());
if c then call(c,self(true),success);
end
end
type cef_delete_cookies_callback_t=class(cef_set_cookie_callback_t)
public
function create(ptr)
begin
inherited ;
end
//procedure on_complete(sf:pointer;num_deleted:integer);stdcall;
procedure on_complete_i(sf:pointer;num_deleted:integer);stdcall;override;
begin
c := getcallback(functionname());
if c then call(c,self(true),num_deleted);
end
end
type cef_cookie_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("name","user",getcefstr16struct()),
("value","user",getcefstr16struct()),
("domain","user",getcefstr16struct()),
("path","user",getcefstr16struct()),
("secure","int",0),
("httponly","int",0),
("creation","intptr",0),
("last_access","intptr",0),
("has_expires","int",0),
("expires","intptr",0),
("same_site","int",0),
("priority","int",-1));
end
protected
function aftercreate(flg);override;
begin
end
public
function create(ptr)
begin
inherited ;
end
property name index "name" read getcefstrmenber write setcefstrmenber;
property value index "value" read getcefstrmenber write setcefstrmenber;
property domain index "domain" read getcefstrmenber write setcefstrmenber;
property path index "path" read getcefstrmenber write setcefstrmenber;
property secure index "secure" read _getvalue_ write _setvalue_;
property httponly index "httponly" read _getvalue_ write _setvalue_;
property creation index "creation" read _getvalue_ write _setvalue_;
property last_access index "last_access" read _getvalue_ write _setvalue_;
property has_expires index "has_expires" read _getvalue_ write _setvalue_;
property expires index "expires" read _getvalue_ write _setvalue_;
property same_site index "same_site" read _getvalue_ write _setvalue_;
property priority index "priority" read _getvalue_ write _setvalue_;
end
type cef_cookie_manager_global_t = class(cef_cookie_manager_t)
function create(ptr)
begin
fcbk := new cef_completion_callback_t();
ptr := cef_cookie_manager_get_global_manager(fcbk._getptr_());
inherited ;
end
property callback read fcbk;
private
[weakref]fcbk;
end
type cef_cookie_manager_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("visit_all_cookies","intptr",0),
("visit_url_cookies","intptr",0),
("set_cookie","intptr",0),
("delete_cookies","intptr",0),
("flush_store","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
//property visit_all_cookies index "visit_all_cookies" read _getvalue_ write _setvalue_;
function visit_all_cookies(visit);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;visitor:pointer):integer;stdcall;external ptr;
return ##f(_getptr_(),visit._getptr_);
end
/// Visit a subset of cookies on the UI thread. The results are filtered by
/// the given url scheme, host, domain and path. If |includeHttpOnly| is true
/// (1) HTTP-only cookies will also be included in the results. The returned
/// cookies are ordered by longest path, then by earliest creation date.
/// Returns false (0) if cookies cannot be accessed.
/// int(CEF_CALLBACK* visit_url_cookies)(struct _cef_cookie_manager_t* self,const cef_string_t* url,int includeHttpOnly,struct _cef_cookie_visitor_t* visitor)
//property visit_url_cookies index "visit_url_cookies" read _getvalue_ write _setvalue_;
function visit_url_cookies(url,includeHttpOnly,visit);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;url:pointer;includeHttpOnly:integer;visitor:pointer):integer;stdcall;external ptr;
s := new cef_string_t();
s.str := url;
return ##f(_getptr_(),s._getptr_(),includeHttpOnly,visit._getptr_);
end
/// Sets a cookie given a valid URL and explicit user-provided cookie
/// attributes. This function expects each attribute to be well-formed. It
/// will check for disallowed characters (e.g. the ';' character is disallowed
/// within the cookie value attribute) and fail without setting the cookie if
/// such characters are found. If |callback| is non-NULL it will be executed
/// asnychronously on the UI thread after the cookie has been set. Returns
/// false (0) if an invalid URL is specified or if cookies cannot be accessed.
///
// int(CEF_CALLBACK* set_cookie)(struct _cef_cookie_manager_t* self,
// const cef_string_t* url,
// const struct cef_cookie_t* cookie,
// struct _cef_set_cookie_callback_t* callback);
function set_cookie(url,cookie,callback);
begin
ptr := _getvalue_(functionname());
if not ptr then return 0;
f := function(sf:pointer;url:pointer;cookie:pointer;callback:pointer):integer;stdcall;external ptr;
s := new cef_string_t();
s.str := url;
return ##f(_getptr_(),s._getptr_(),cookie._getptr_(),callback._getptr_);
end
//property delete_cookies index "delete_cookies" read _getvalue_ write _setvalue_;
//
function delete_cookies(url,cookie_name,callback:cef_delete_cookies_callback_t);
begin
ptr := _getvalue_(functionname());
if not ptr then return 0;
f := function(sf:pointer;url:pointer;cookie_name:pointer;callback:pointer):integer;stdcall;external ptr;
s := new cef_string_t();s.str := url;
n := new cef_string_t(); n.str := cookie_name;
return ##f(_getptr_(),s._getptr_(),n._getptr_(),callback._getptr_);
end
//property flush_store index "flush_store" read _getvalue_ write _setvalue_;
//cef_completion_callback_t
function flush_store(callback);
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer;callback:pointer):integer;stdcall;external ptr;
return ##f(_getptr_(),callback._getptr_);
end
end
type cef_binary_value_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_valid","intptr",0),
("is_owned","intptr",0),
("is_same","intptr",0),
("is_equal","intptr",0),
("copy","intptr",0),
("get_size","intptr",0),
("get_data","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
//property base index "base" read _getvalue_ write _setvalue_;
//property is_valid index "is_valid" read _getvalue_ write _setvalue_;
//property is_owned index "is_owned" read _getvalue_ write _setvalue_;
//property is_same index "is_same" read _getvalue_ write _setvalue_;
//property is_equal index "is_equal" read _getvalue_ write _setvalue_;
//property copy index "copy" read _getvalue_ write _setvalue_;
//property get_size index "get_size" read _getvalue_ write _setvalue_;
//property get_data index "get_data" read _getvalue_ write _setvalue_;
end
type cef_dictionary_value_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_valid","intptr",0),
("is_owned","intptr",0),
("is_read_only","intptr",0),
("is_same","intptr",0),
("is_equal","intptr",0),
("copy","intptr",0),
("get_size","intptr",0),
("clear","intptr",0),
("has_key","intptr",0),
("get_keys","intptr",0),
("remove","intptr",0),
("get_type","intptr",0),
("get_value","intptr",0),
("get_bool","intptr",0),
("get_int","intptr",0),
("get_double","intptr",0),
("get_string","intptr",0),
("get_binary","intptr",0),
("get_dictionary","intptr",0),
("get_list","intptr",0),
("set_value","intptr",0),
("set_null","intptr",0),
("set_bool","intptr",0),
("set_int","intptr",0),
("set_double","intptr",0),
("set_string","intptr",0),
("set_binary","intptr",0),
("set_dictionary","intptr",0),
("set_list","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
//property is_valid index "is_valid" read _getvalue_ write _setvalue_;
//property is_owned index "is_owned" read _getvalue_ write _setvalue_;
//property is_read_only index "is_read_only" read _getvalue_ write _setvalue_;
//property is_same index "is_same" read _getvalue_ write _setvalue_;
//property is_equal index "is_equal" read _getvalue_ write _setvalue_;
//property copy index "copy" read _getvalue_ write _setvalue_;
//property get_size index "get_size" read _getvalue_ write _setvalue_;
//property clear index "clear" read _getvalue_ write _setvalue_;
//property has_key index "has_key" read _getvalue_ write _setvalue_;
//property get_keys index "get_keys" read _getvalue_ write _setvalue_;
//property remove index "remove" read _getvalue_ write _setvalue_;
//property get_type index "get_type" read _getvalue_ write _setvalue_;
//property get_value index "get_value" read _getvalue_ write _setvalue_;
//property get_bool index "get_bool" read _getvalue_ write _setvalue_;
//property get_int index "get_int" read _getvalue_ write _setvalue_;
//property get_double index "get_double" read _getvalue_ write _setvalue_;
//property get_string index "get_string" read _getvalue_ write _setvalue_;
//property get_binary index "get_binary" read _getvalue_ write _setvalue_;
//property get_dictionary index "get_dictionary" read _getvalue_ write _setvalue_;
//property get_list index "get_list" read _getvalue_ write _setvalue_;
//property set_value index "set_value" read _getvalue_ write _setvalue_;
//property set_null index "set_null" read _getvalue_ write _setvalue_;
//property set_bool index "set_bool" read _getvalue_ write _setvalue_;
//property set_int index "set_int" read _getvalue_ write _setvalue_;
//property set_double index "set_double" read _getvalue_ write _setvalue_;
//property set_string index "set_string" read _getvalue_ write _setvalue_;
//property set_binary index "set_binary" read _getvalue_ write _setvalue_;
//property set_dictionary index "set_dictionary" read _getvalue_ write _setvalue_;
//property set_list index "set_list" read _getvalue_ write _setvalue_;
end
type cef_value_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_valid","intptr",0),
("is_owned","intptr",0),
("is_read_only","intptr",0),
("is_same","intptr",0),
("is_equal","intptr",0),
("copy","intptr",0),
("get_type","intptr",0),
("get_bool","intptr",0),
("get_int","intptr",0),
("get_double","intptr",0),
("get_string","intptr",0),
("get_binary","intptr",0),
("get_dictionary","intptr",0),
("get_list","intptr",0),
("set_null","intptr",0),
("set_bool","intptr",0),
("set_int","intptr",0),
("set_double","intptr",0),
("set_string","intptr",0),
("set_binary","intptr",0),
("set_dictionary","intptr",0),
("set_list","intptr",0));
end
public
function create(ptr)
begin
inherited ;
end
//property is_valid index "is_valid" read _getvalue_ write _setvalue_;
//property is_owned index "is_owned" read _getvalue_ write _setvalue_;
//property is_read_only index "is_read_only" read _getvalue_ write _setvalue_;
//property is_same index "is_same" read _getvalue_ write _setvalue_;
//property is_equal index "is_equal" read _getvalue_ write _setvalue_;
//property copy index "copy" read _getvalue_ write _setvalue_;
//property get_type index "get_type" read _getvalue_ write _setvalue_;
//property get_bool index "get_bool" read _getvalue_ write _setvalue_;
//property get_int index "get_int" read _getvalue_ write _setvalue_;
//property get_double index "get_double" read _getvalue_ write _setvalue_;
//property get_string index "get_string" read _getvalue_ write _setvalue_;
//property get_binary index "get_binary" read _getvalue_ write _setvalue_;
//property get_dictionary index "get_dictionary" read _getvalue_ write _setvalue_;
//property get_list index "get_list" read _getvalue_ write _setvalue_;
//property set_null index "set_null" read _getvalue_ write _setvalue_;
//property set_bool index "set_bool" read _getvalue_ write _setvalue_;
//property set_int index "set_int" read _getvalue_ write _setvalue_;
//property set_double index "set_double" read _getvalue_ write _setvalue_;
//property set_string index "set_string" read _getvalue_ write _setvalue_;
//property set_binary index "set_binary" read _getvalue_ write _setvalue_;
//property set_dictionary index "set_dictionary" read _getvalue_ write _setvalue_;
//property set_list index "set_list" read _getvalue_ write _setvalue_;
end
{type cef_browser_view_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("get_browser","intptr",0),
("get_chrome_toolbar","intptr",0),
("set_prefer_accelerators","intptr",0));
end
public
function create(ptr)
begin
inherited;
end
//property get_browser index "get_browser" read _getvalue_ write _setvalue_;
//property get_chrome_toolbar index "get_chrome_toolbar" read _getvalue_ write _setvalue_;
//property set_prefer_accelerators index "set_prefer_accelerators" read _getvalue_ write _setvalue_;
end
}
type cef_browser_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_valid","intptr",0),
("get_host","intptr",0),
("can_go_back","intptr",0),
("go_back","intptr",0),
("can_go_forward","intptr",0),
("go_forward","intptr",0),
("reload","intptr",0),
("reload_ignore_cache","intptr",0),
("stop_load","intptr",0),
("get_identifier","intptr",0),
("is_same","intptr",0),
("is_popup","intptr",0),
("c","intptr",0),
("has_document","intptr",0),
("get_main_frame","intptr",0),
("get_focused_frame","intptr",0),
("get_frame_byident","intptr",0),
("get_frame","intptr",0),
("get_frame_count","intptr",0),
("get_frame_identifiers","intptr",0),
("get_frame_names","intptr",0));
end
protected
function aftercreate(flg);override;
begin
inherited;
end
public
function create(ptr)
begin
inherited;
end
function loaded();
begin
ptr := (_getvalue_("c"));
f := function(b:pointer):integer;stdcall;external ptr;
return ##f(_getptr_());
end
//property is_valid index "is_valid" read _getvalue_ write _setvalue_;
function is_valid();
begin
ptr := (_getvalue_(functionname()));
f := function(b:pointer):integer;stdcall;external ptr;
return ##f(_getptr_());
end
//-property get_host index "get_host" read _getvalue_ write _setvalue_;
function get_host();
begin
ptr := (_getvalue_(functionname()));
f := function(b:pointer):pointer;stdcall;external ptr;
p := ##f(_getptr_());
if p then
begin
return new cef_browser_host_t(p);
end
end
//property can_go_back index "can_go_back" read _getvalue_ write _setvalue_;
function can_go_back();
begin
ptr := (_getvalue_(functionname()));
f := function(b:pointer):integer;stdcall;external ptr;
return ##f(_getptr_());
end
//property go_back index "go_back" read _getvalue_ write _setvalue_;
function go_back();
begin
ptr := (_getvalue_(functionname()));
f := procedure(b:pointer);stdcall;external ptr;
return ##f(_getptr_());
end
//property can_go_forward index "can_go_forward" read _getvalue_ write _setvalue_;
function can_go_forward();
begin
ptr := (_getvalue_(functionname()));
f := function(b:pointer):integer;stdcall;external ptr;
return ##f(_getptr_());
end
//property go_forward index "go_forward" read _getvalue_ write _setvalue_;
function go_forward();
begin
ptr := (_getvalue_(functionname()));
f := procedure(b:pointer);stdcall;external ptr;
return ##f(_getptr_());
end
//property reload index "reload" read _getvalue_ write _setvalue_;
function reload();
begin
ptr := (_getvalue_(functionname()));
f := procedure(b:pointer);stdcall;external ptr;
return ##f(_getptr_());
end
//property reload_ignore_cache index "reload_ignore_cache" read _getvalue_ write _setvalue_;
function reload_ignore_cache();
begin
ptr := (_getvalue_(functionname()));
f := procedure(b:pointer);stdcall;external ptr;
return ##f(_getptr_());
end
//property stop_load index "stop_load" read _getvalue_ write _setvalue_;
function stop_load();
begin
ptr := (_getvalue_(functionname()));
f := procedure(b:pointer);stdcall;external ptr;
return ##f(_getptr_());
end
//property get_identifier index "get_identifier" read _getvalue_ write _setvalue_;
function get_identifier();
begin
ptr := (_getvalue_(functionname()));
f := function(b:pointer):int64;stdcall;external ptr;
return ##f(_getptr_());
end
//-property is_same index "is_same" read _getvalue_ write _setvalue_;
//property is_popup index "is_popup" read _getvalue_ write _setvalue_;
function is_popup();
begin
ptr := (_getvalue_(functionname()));
f := function(b:pointer):integer;stdcall;external ptr;
return ##f(_getptr_());
end
//property has_document index "has_document" read _getvalue_ write _setvalue_;
function has_document();
begin
ptr := (_getvalue_(functionname()));
f := function(b:pointer):integer;stdcall;external ptr;
return ##f(_getptr_());
end
//property get_main_frame index "get_main_frame" read _getvalue_ write _setvalue_;
function get_main_frame();
begin
ptr := (_getvalue_(functionname()));
f := function(b:pointer):pointer;stdcall;external ptr;
r := ##f(_getptr_());
if r>0 or r<0 then
begin
return new cef_frame_t(r);
end
end
//property get_focused_frame index "get_focused_frame" read _getvalue_ write _setvalue_;
function get_focused_frame();
begin
ptr := (_getvalue_(functionname()));
f := function(b:pointer):pointer;stdcall;external ptr;
r := ##f(_getptr_());
if r>0 or r<0 then
begin
return new cef_frame_t(r);
end
end
//property get_frame_byident index "get_frame_byident" read _getvalue_ write _setvalue_;
function get_frame_byident(ident);
begin
ptr := (_getvalue_(functionname()));
f := function(b:pointer;idt:int64):pointer;stdcall;external ptr;
r := ##f(_getptr_(),ident);
if r>0 or r<0 then
begin
return new cef_frame_t(r);
end
end
//-property get_frame index "get_frame" read _getvalue_ write _setvalue_;
//property get_frame_count index "get_frame_count" read _getvalue_ write _setvalue_;
function get_frame_count();
begin
ptr := (_getvalue_(functionname()));
f := function(b:pointer):pointer;stdcall;external ptr ;
return ##f(_getptr_());
end
//property get_frame_identifiers index "get_frame_identifiers" read _getvalue_ write _setvalue_;
function get_frame_identifiers();
begin
ptr := (_getvalue_(functionname()));
f := procedure(b:pointer;var c:integer;var ids : array of int64);stdcall;external ptr;
ct := 100;
ids := nils(100);
##f(_getptr_(),ct,ids);
if ct>0 then
begin
return ids[0:(ct-1)];
//return new cef_frame_t(r);
end
return array();
end
//-property get_frame_names index "get_frame_names" read _getvalue_ write _setvalue_;
end
type cef_process_message_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_valid","intptr",0),
("is_read_only","intptr",0),
("copy","intptr",0),
("get_name","intptr",0),
("get_argument_list","intptr",0),
("get_shared_memory_region","intptr",0)
);
end
public
function create(ptr)
begin
inherited;
end
function is_valid();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
function is_read_only();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
function copy();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
return ##f(_getptr_());
end
function get_name();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
r := ##f(_getptr_());
s := new cef_string_userfree_t(r);
return s;
end
end
type cef_domnode_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("get_type","intptr",0),
("is_text","intptr",0),
("is_element","intptr",0),
("is_editable","intptr",0),
("is_form_control_element","intptr",0),
("get_form_control_element_type","intptr",0),
("is_same","intptr",0),
("get_name","intptr",0),
("get_value","intptr",0),
("set_value","intptr",0),
("get_as_markup","intptr",0),
("get_document","intptr",0),
("get_parent","intptr",0),
("get_previous_sibling","intptr",0),
("get_next_sibling","intptr",0),
("has_children","intptr",0),
("get_first_child","intptr",0),
("get_last_child","intptr",0),
("get_element_tag_name","intptr",0),
("has_element_attributes","intptr",0),
("has_element_attribute","intptr",0),
("get_element_attribute","intptr",0),
("get_element_attributes","intptr",0),
("set_element_attribute","intptr",0),
("get_element_inner_text","intptr",0),
("get_element_bounds","intptr",0),
);
end
public
function create(ptr)
begin
inherited;
end
function get_element_attribute(attrName) ;
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer;attrName:pointer):pointer;stdcall; external ptr;
s1 := new cef_string_t();s1.str := attrName;
r := ##f(_getptr_(),s1._getptr_());
s := new cef_string_t(r);
return s.str;
end
function get_element_attributes();
begin
ptr := _getvalue_(functionname());
f:= procedure(s:pointer;attrMap:pointer);stdcall; external ptr;
m := new cef_string_map_t();
##f(_getptr_(),m._getptr_());
return m.keyvalues();
end
function set_element_attribute(attrName,value);
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer;attrName:pointer;value:pointer):integer;stdcall; external ptr;
s1 := new cef_string_t();s1.str := attrname;
s2 := new cef_string_t();s2.str := value;
return ##f(_getptr_(),s1._getptr_(),s2._getptr_());
end
function get_element_inner_text();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
r := ##f(_getptr_());
s := new cef_string_userfree_t(r);
return s.str;
end
function get_element_bounds();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
r := ##f(_getptr_());
return new cef_rect_t(r);
end
end
type cef_domdocument_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("get_type","intptr",0),
("get_document","intptr",0),
("get_body","intptr",0),
("get_head","intptr",0),
("get_title","intptr",0),
("get_element_by_id","intptr",0),
("get_focused_node","intptr",0),
("has_selection","intptr",0),
("get_selection_start_offset","intptr",0),
("get_selection_end_offset","intptr",0),
("get_selection_as_markup","intptr",0),
("get_selection_as_text","intptr",0),
("get_base_url","intptr",0),
("get_complete_url","intptr",0),
);
end
public
function create(ptr)
begin
inherited;
end
function get_type();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
function get_document();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
r := ##f(_getptr_());
if r then return new cef_domnode_t(r);
end
function get_body();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
r := ##f(_getptr_());
if r then return new cef_domnode_t(r);
end
function get_head();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
r := ##f(_getptr_());
if r then return new cef_domnode_t(r);
end
function get_title();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
r := ##f(_getptr_());
if r then
begin
return (new cef_string_userfree_t(r)).str;
end
end
function get_element_by_id(id);
begin
if not ifstring(id) then return ;
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
s := new cef_string_t(id);
r := ##f(_getptr_(),s._getptr_());
if r then return new cef_domnode_t(r);
end
function get_selection_as_markup();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
r := ##f(_getptr_());
if r then
begin
return (new cef_string_userfree_t(r)).str;
end
end
function get_selection_as_text();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
r := ##f(_getptr_());
if r then
begin
return (new cef_string_userfree_t(r)).str;
end
end
function get_base_url();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
r := ##f(_getptr_());
if r then
begin
return (new cef_string_userfree_t(r)).str;
end
end
function get_complete_url();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
r := ##f(_getptr_());
if r then
begin
return (new cef_string_userfree_t(r)).str;
end
end
end
type cef_frame_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("is_valid","intptr",0),
("undo","intptr",0),
("redo","intptr",0),
("cut","intptr",0),
("copy","intptr",0),
("paste","intptr",0),
("del","intptr",0),
("select_all","intptr",0),
("view_source","intptr",0),
("get_source","intptr",0),
("get_text","intptr",0),
("load_request","intptr",0),
("load_url","intptr",0),
("execute_java_script","intptr",0),
("is_main","intptr",0),
("is_focused","intptr",0),
("get_name","intptr",0),
("get_identifier","intptr",0),
("get_parent","intptr",0),
("get_url","intptr",0),
("get_browser","intptr",0),
("get_v8context","intptr",0),
("visit_dom","intptr",0),
("create_urlrequest","intptr",0),
("send_process_message","intptr",0));
end
public
function create(ptr)
begin
inherited;
end
//property is_valid index "is_valid" read _getvalue_ write _setvalue_;
function is_valid();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
//property undo index "undo" read _getvalue_ write _setvalue_;
function undo();
begin
ptr := _getvalue_(functionname());
if ptr then
begin
f:= procedure(s:pointer);stdcall; external ptr;
##f(_getptr_());
end
end
//property redo index "redo" read _getvalue_ write _setvalue_;
function redo();
begin
ptr := _getvalue_(functionname());
f:= procedure(s:pointer);stdcall; external ptr;
##f(_getptr_());
end
//property cut index "cut" read _getvalue_ write _setvalue_;
function cut();
begin
ptr := _getvalue_(functionname());
f:= procedure(s:pointer);stdcall; external ptr;
##f(_getptr_());
end
//property copy index "copy" read _getvalue_ write _setvalue_;
function copy();
begin
ptr := _getvalue_(functionname());
f:= procedure(s:pointer);stdcall; external ptr;
##f(_getptr_());
end
//property paste index "paste" read _getvalue_ write _setvalue_;
function paste();
begin
ptr := _getvalue_(functionname());
f:= procedure(s:pointer);stdcall; external ptr;
##f(_getptr_());
end
/// Execute delete in this frame.
//property del index "del" read _getvalue_ write _setvalue_;
function del();
begin
ptr := _getvalue_(functionname());
if ptr then
begin
f:= procedure(s:pointer);stdcall; external ptr;
##f(_getptr_());
end
end
//property select_all index "select_all" read _getvalue_ write _setvalue_;
function select_all();
begin
ptr := _getvalue_(functionname());
if ptr then
begin
f:= procedure(s:pointer);stdcall; external ptr;
##f(_getptr_());
end
end
//property view_source index "view_source" read _getvalue_ write _setvalue_;
function view_source();
begin
ptr := _getvalue_("view_source");
if ptr then
begin
f:= procedure(s:pointer);stdcall; external ptr;
##f(_getptr_());
end
end
//property get_source index "get_source" read _getvalue_ write _setvalue_;
function get_source(visit);
begin
if not (visit is class(cef_string_visitor_t)) then return 0;
ptr := _getvalue_(functionname());
f:= procedure(s:pointer;vt:pointer);stdcall; external ptr;
##f(_getptr_(),visit._getptr_());
return 1;
end
//property get_text index "get_text" read _getvalue_ write _setvalue_;
function get_text(visit);
begin
if not (visit is class(cef_string_visitor_t)) then return 0;
ptr := _getvalue_("get_text");
f:= procedure(s:pointer;vt:pointer);stdcall; external ptr;
##f(_getptr_(),visit._getptr_());
return 1;
end
//property load_url index "load_url" read _getvalue_ write _setvalue_;
function load_request(r);
begin
if r is class(cef_request_t) then
begin
ptr := _getvalue_("load_request");
f:= procedure(s:pointer;r:pointer);stdcall; external ptr;
//return ##f(_getptr_(),r._getptr_());
end
end
function load_url(url);
begin
if ifstring(url) then
begin
ptr := _getvalue_("load_url");
f:= procedure(s:pointer;u:pointer);stdcall; external ptr;
u := new cef_string_t();
u.str := url;
##f(_getptr_(),u._getptr_());
end
end
//property execute_java_script index "execute_java_script" read _getvalue_ write _setvalue_;
function execute_java_script(code,url,start_line);
begin
if ifstring(url) and ifstring(code) and (start_line>=0) then
begin
ptr := _getvalue_(functionname());
f:= procedure(s:pointer;c:pointer;u:pointer;sl:integer);stdcall; external ptr;
u := new cef_string_t();
u.str := url;
c := new cef_string_t();
c.str := code;
##f(_getptr_(),c._getptr_(),u._getptr_(),start_line);
end
end
//property is_main index "is_main" read _getvalue_ write _setvalue_;
function is_main();
begin
ptr := _getvalue_("is_main");
if ptr then
begin
f:= function(s:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
end
//property is_focused index "is_focused" read _getvalue_ write _setvalue_;
function is_focused();
begin
ptr := _getvalue_("is_focused");
f:= function(s:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
//property get_name index "get_name" read _getvalue_ write _setvalue_;
function get_name();
begin
ptr := _getvalue_("get_name");
f:= function(s:pointer):pointer;stdcall; external ptr;
rl := ##f(_getptr_());
if rl>0 or rl<0 then
begin
s := new cef_string_userfree_t(rl);
return s.str;
end
return "";
end
//property get_identifier index "get_identifier" read _getvalue_ write _setvalue_;
function get_identifier();
begin
ptr := _getvalue_("get_identifier");
f:= function(s:pointer):int64;stdcall; external ptr;
return ##f(_getptr_());
end
//property get_parent index "get_parent" read _getvalue_ write _setvalue_;
function get_parent();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
fm := ##f(_getptr_());
if fm>0 or rl<fm then
begin
return new cef_frame_t(fm);
end
end
//property get_url index "get_url" read _getvalue_ write _setvalue_;
function get_url();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
rl := ##f(_getptr_());
if rl>0 or rl<0 then
begin
s := new cef_string_userfree_t(rl);
return s.str;
end
return "";
end
//property get_browser index "get_browser" read _getvalue_ write _setvalue_;
function get_browser();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
return ##f(_getptr_());
end
//property get_v8context index "get_v8context" read _getvalue_ write _setvalue_;
function get_v8context();
begin
ptr := _getvalue_(functionname());
f:= function(s:pointer):pointer;stdcall; external ptr;
r := ##f(_getptr_());
return r;
end
//property visit_dom index "visit_dom" read _getvalue_ write _setvalue_;
function visit_dom(visit);
begin
if not(visit is class(cef_domvisitor_t)) then return 0;
ptr := _getvalue_(functionname());
f:= procedure(s:pointer;visitor:pointer);stdcall; external ptr;
return ##f(_getptr_(),visit._getptr_());
end
//property create_urlrequest index "create_urlrequest" read _getvalue_ write _setvalue_;
//property send_process_message index "send_process_message" read _getvalue_ write _setvalue_;
end
type cef_browser_host_t=class(cef_contain_base)
private
function structdescribe();override;
begin
return array(
("base","user",getbasestruct()),
("get_browser","intptr",0),
("close_browser","intptr",0),
("try_close_browser","intptr",0),
("set_focus","intptr",0),
("get_window_handle","intptr",0),
("get_opener_window_handle","intptr",0),
("has_view","intptr",0),
("get_client","intptr",0),
("get_request_context","intptr",0),
("get_zoom_level","intptr",0),
("set_zoom_level","intptr",0),
("run_file_dialog","intptr",0),
("start_download","intptr",0),
("download_image","intptr",0),
("print","intptr",0),
("print_to_pdf","intptr",0),
("find","intptr",0),
("stop_finding","intptr",0),
("show_dev_tools","intptr",0),
("close_dev_tools","intptr",0),
("has_dev_tools","intptr",0),
("send_dev_tools_message","intptr",0),
("execute_dev_tools_method","intptr",0),
("add_dev_tools_message_observer","intptr",0),
("get_navigation_entries","intptr",0),
("replace_misspelling","intptr",0),
("add_word_to_dictionary","intptr",0),
("is_window_rendering_disabled","intptr",0),
("was_resized","intptr",0),
("was_hidden","intptr",0),
("notify_screen_info_changed","intptr",0),
("invalidate","intptr",0),
("send_external_begin_frame","intptr",0),
("send_key_event","intptr",0),
("send_mouse_click_event","intptr",0),
("send_mouse_move_event","intptr",0),
("send_mouse_wheel_event","intptr",0),
("send_touch_event","intptr",0),
("send_capture_lost_event","intptr",0),
("notify_move_or_resize_started","intptr",0),
("get_windowless_frame_rate","intptr",0),
("set_windowless_frame_rate","intptr",0),
("ime_set_composition","intptr",0),
("ime_commit_text","intptr",0),
("ime_finish_composing_text","intptr",0),
("ime_cancel_composition","intptr",0),
("drag_target_drag_enter","intptr",0),
("drag_target_drag_over","intptr",0),
("drag_target_drag_leave","intptr",0),
("drag_target_drop","intptr",0),
("drag_source_ended_at","intptr",0),
("drag_source_system_drag_ended","intptr",0),
("get_visible_navigation_entry","intptr",0),
("set_accessibility_state","intptr",0),
("set_auto_resize_enabled","intptr",0),
("get_extension","intptr",0),
("is_background_host","intptr",0),
("set_audio_muted","intptr",0),
("is_audio_muted","intptr",0));
end
public
function create(ptr)
begin
inherited;
end
//property get_browser index "get_browser" read _getvalue_ write _setvalue_;
function get_browser();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;stdcall; external ptr;
p := ##f(_getptr_());
if p then
begin
return new cef_browser_t(p);
end
end
//property close_browser index "close_browser" read _getvalue_ write _setvalue_;
function close_browser();
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer);stdcall; external ptr;
##f(_getptr_());
end
/// Helper for closing a browser. Call this function from the top-level window
/// close handler (if any). Internally this calls CloseBrowser(false (0)) if
/// the close has not yet been initiated. This function returns false (0)
/// while the close is pending and true (1) after the close has completed. See
/// close_browser() and cef_life_span_handler_t::do_close() documentation for
/// additional usage information. This function must be called on the browser
/// process UI thread.
//property try_close_browser index "try_close_browser" read _getvalue_ write _setvalue_;
function try_close_browser();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
//property set_focus index "set_focus" read _getvalue_ write _setvalue_;
function set_focus(fc);
begin
if not(fc=0 or fc=1) then return ;
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;focus:integer);stdcall; external ptr;
##f(_getptr_(),fc);
end
//property get_window_handle index "get_window_handle" read _getvalue_ write _setvalue_;
//property get_opener_window_handle index "get_opener_window_handle" read _getvalue_ write _setvalue_;
/// Returns true (1) if this browser is wrapped in a cef_browser_view_t.
//property has_view index "has_view" read _getvalue_ write _setvalue_;
function has_view();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
//property get_client index "get_client" read _getvalue_ write _setvalue_;
function get_client();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;stdcall; external ptr;
p := ##f(_getptr_());
if p then
begin
return new cef_client_t(p);
end
end
//property get_request_context index "get_request_context" read _getvalue_ write _setvalue_;
function get_request_context();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):pointer;stdcall; external ptr;
p := ##f(_getptr_());
if p then
begin
return new cef_request_context_t(p);
end
end
//property get_zoom_level index "get_zoom_level" read _getvalue_ write _setvalue_;
function get_zoom_level();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):double;stdcall; external ptr;
return ##f(_getptr_());
end
//property set_zoom_level index "set_zoom_level" read _getvalue_ write _setvalue_;
function set_zoom_level(level:double);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;level:double);stdcall; external ptr;
##f(_getptr_(),level);
end
//property run_file_dialog index "run_file_dialog" read _getvalue_ write _setvalue_;
function run_file_dialog(md,title,dfp,filters,callback);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;md:pointer;title:pointer;default_file_path:pointer;accept_filters:pointer;callback:pointer);stdcall; external ptr;
t := new cef_string_t();t.str := title;
fp := new cef_string_t();fp.str := dfp;
##f(_getptr_(),md,t._getptr_(),fp._getptr_(),filters,callback);
end
//property start_download index "start_download" read _getvalue_ write _setvalue_;
function start_download(url);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;url:pointer);stdcall; external ptr;
s := new cef_string_t();s.str := url;
##f(_getptr_(),url._getptr_);
end
//property download_image index "download_image" read _getvalue_ write _setvalue_;
//property print index "print" read _getvalue_ write _setvalue_;
function print();
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer);stdcall; external ptr;
##f(_getptr_());
end
//property print_to_pdf index "print_to_pdf" read _getvalue_ write _setvalue_;
//property find index "find" read _getvalue_ write _setvalue_;
function find(str,forword,matchcase,findnext);
begin
if not( str and ifstring(str)) then return ;
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;s:pointer;forword:integer;matchcase:integer;findnext:integer);stdcall; external ptr;
s := new cef_string_t();
s.str := str;
##f(_getptr_(),s._getptr_(),forword,matchcase,findnext);
end
//property stop_finding index "stop_finding" read _getvalue_ write _setvalue_;
function stop_finding(clearSelection);
begin
if not( str and ifstring(str)) then return ;
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;clearSelection:integer);stdcall; external ptr;
##f(_getptr_(),clearSelection);
end
//property show_dev_tools index "show_dev_tools" read _getvalue_ write _setvalue_;
function show_dev_tools();
begin
//wd,c,st,ps
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;windowInfo:pointer;client:pointer;settings:pointer;inspect_element_at:pointer);stdcall; external ptr;
//##f(_getptr_(),wd._getptr_(),get_client()._getptr_(),st._getptr_(),ps._getptr_());
##f(_getptr_(),0,0,0,0);
end
//property close_dev_tools index "close_dev_tools" read _getvalue_ write _setvalue_;
function close_dev_tools();
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer);stdcall; external ptr;
##f(_getptr_());
end
//property has_dev_tools index "has_dev_tools" read _getvalue_ write _setvalue_;
function has_dev_tools();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
//property send_dev_tools_message index "send_dev_tools_message" read _getvalue_ write _setvalue_;
//property execute_dev_tools_method index "execute_dev_tools_method" read _getvalue_ write _setvalue_;
//property add_dev_tools_message_observer index "add_dev_tools_message_observer" read _getvalue_ write _setvalue_;
//property get_navigation_entries index "get_navigation_entries" read _getvalue_ write _setvalue_;
//property replace_misspelling index "replace_misspelling" read _getvalue_ write _setvalue_;
//property add_word_to_dictionary index "add_word_to_dictionary" read _getvalue_ write _setvalue_;
//property is_window_rendering_disabled index "is_window_rendering_disabled" read _getvalue_ write _setvalue_;
function is_window_rendering_disabled();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
//property was_resized index "was_resized" read _getvalue_ write _setvalue_;
//property was_hidden index "was_hidden" read _getvalue_ write _setvalue_;
//property notify_screen_info_changed index "notify_screen_info_changed" read _getvalue_ write _setvalue_;
/// Invalidate the view. The browser will call cef_render_handler_t::OnPaint
/// asynchronously. This function is only used when window rendering is
/// disabled.
///
////void(CEF_CALLBACK* invalidate)(struct _cef_browser_host_t* self,cef_paint_element_type_t type);
function invalidate();
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;tp:integer);stdcall; external ptr;
return ##f(_getptr_());
end
//property send_external_begin_frame index "send_external_begin_frame" read _getvalue_ write _setvalue_;
//property send_key_event index "send_key_event" read _getvalue_ write _setvalue_;
//property send_mouse_click_event index "send_mouse_click_event" read _getvalue_ write _setvalue_;
//property send_mouse_move_event index "send_mouse_move_event" read _getvalue_ write _setvalue_;
//property send_mouse_wheel_event index "send_mouse_wheel_event" read _getvalue_ write _setvalue_;
function send_mouse_wheel_event(event:cef_mouse_event_t;delatax;deltay);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;event:pointer;dx:integer;dy:integer);stdcall; external ptr;
return ##f(_getptr_(),event._getptr_(),dx,dy);
end
//property send_touch_event index "send_touch_event" read _getvalue_ write _setvalue_;
//property send_capture_lost_event index "send_capture_lost_event" read _getvalue_ write _setvalue_;
//property notify_move_or_resize_started index "notify_move_or_resize_started" read _getvalue_ write _setvalue_;
//property get_windowless_frame_rate index "get_windowless_frame_rate" read _getvalue_ write _setvalue_;
function get_windowless_frame_rate();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
//property set_windowless_frame_rate index "set_windowless_frame_rate" read _getvalue_ write _setvalue_;
function set_windowless_frame_rate(rate);
begin
if not(rate>=0) then return ;
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;rate:integer);stdcall; external ptr;
return ##f(_getptr_(),rate);
end
//property ime_set_composition index "ime_set_composition" read _getvalue_ write _setvalue_;
//property ime_commit_text index "ime_commit_text" read _getvalue_ write _setvalue_;
//property ime_finish_composing_text index "ime_finish_composing_text" read _getvalue_ write _setvalue_;
//property ime_cancel_composition index "ime_cancel_composition" read _getvalue_ write _setvalue_;
//property drag_target_drag_enter index "drag_target_drag_enter" read _getvalue_ write _setvalue_;
//property drag_target_drag_over index "drag_target_drag_over" read _getvalue_ write _setvalue_;
//property drag_target_drag_leave index "drag_target_drag_leave" read _getvalue_ write _setvalue_;
//property drag_target_drop index "drag_target_drop" read _getvalue_ write _setvalue_;
//property drag_source_ended_at index "drag_source_ended_at" read _getvalue_ write _setvalue_;
//property drag_source_system_drag_ended index "drag_source_system_drag_ended" read _getvalue_ write _setvalue_;
//property get_visible_navigation_entry index "get_visible_navigation_entry" read _getvalue_ write _setvalue_;
//property set_accessibility_state index "set_accessibility_state" read _getvalue_ write _setvalue_;
//property set_auto_resize_enabled index "set_auto_resize_enabled" read _getvalue_ write _setvalue_;
//property get_extension index "get_extension" read _getvalue_ write _setvalue_;
//property is_background_host index "is_background_host" read _getvalue_ write _setvalue_;
function is_background_host();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
//property set_audio_muted index "set_audio_muted" read _getvalue_ write _setvalue_;
function set_audio_muted(rate);
begin
ptr := _getvalue_(functionname());
f := procedure(sf:pointer;rate:integer);stdcall; external ptr;
return ##f(_getptr_(),rate);
end
//property is_audio_muted index "is_audio_muted" read _getvalue_ write _setvalue_;
function is_audio_muted();
begin
ptr := _getvalue_(functionname());
f := function(sf:pointer):integer;stdcall; external ptr;
return ##f(_getptr_());
end
end
type cef_MainMessageLoopStd_t=class
function run();
begin
_f_ := static procedure();stdcall;external getceffunction("cef_run_message_loop");
return ##_f_();
end
function quit();
begin
_f_ := static procedure();stdcall;external getceffunction("cef_quit_message_loop");
return ##_f_();
end
function PostTask(task);
begin
_f_ := static function(id:integer;task:pointer):integer;stdcall;external getceffunction("cef_post_task");
return ##_f_(0,task);
end
function RunsTasksOnCurrentThread();
begin
_f_ := static function(id:integer):integer;stdcall;external getceffunction("cef_currently_on");
return ##_f_(0);
end
end
implementation
type cef_thread_id_t = class
// BROWSER PROCESS THREADS -- Only available in the browser process.
/// The main thread in the browser. This will be the same as the main
/// application thread if CefInitialize() is called with a
/// CefSettings.multi_threaded_message_loop value of false. Do not perform
/// blocking tasks on this thread. All tasks posted after
/// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown()
/// are guaranteed to run. This thread will outlive all other CEF threads.
static const TID_UI =0;
/// Used for blocking tasks like file system access where the user won't
/// notice if the task takes an arbitrarily long time to complete. All tasks
/// posted after CefBrowserProcessHandler::OnContextInitialized() and before
/// CefShutdown() are guaranteed to run.
static const TID_FILE_BACKGROUND=1;
/// Used for blocking tasks like file system access that affect UI or
/// responsiveness of future user interactions. Do not use if an immediate
/// response to a user interaction is expected. All tasks posted after
/// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown()
/// are guaranteed to run.
/// Examples:
/// - Updating the UI to reflect progress on a long task.
/// - Loading data that might be shown in the UI after a future user
/// interaction.
static const TID_FILE_USER_VISIBLE=2;
/// Used for blocking tasks like file system access that affect UI
/// immediately after a user interaction. All tasks posted after
/// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown()
/// are guaranteed to run.
/// Example: Generating data shown in the UI immediately after a click.
static const TID_FILE_USER_BLOCKING=3;
/// Used to launch and terminate browser processes.
static const TID_PROCESS_LAUNCHER=4;
/// Used to process IPC and network messages. Do not perform blocking tasks on
/// this thread. All tasks posted after
/// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown()
/// are guaranteed to run.
static const TID_IO=5;
// RENDER PROCESS THREADS -- Only available in the render process.
/// The main thread in the renderer. Used for all WebKit and V8 interaction.
/// Tasks may be posted to this thread after
/// CefRenderProcessHandler::OnWebKitInitialized but are not guaranteed to
/// run before sub-process termination (sub-processes may be killed at any
/// time without warning).
static const TID_RENDERER=6;
end
type cef_log_severity_t = class()
/// Default logging (currently INFO logging).
static const LOGSEVERITY_DEFAULT = 0;
/// Verbose logging.
static const LOGSEVERITY_VERBOSE =1;
/// DEBUG logging.
static const LOGSEVERITY_DEBUG = 1;
/// INFO logging.
static const LOGSEVERITY_INFO =2;
/// WARNING logging.
static const LOGSEVERITY_WARNING = 3;
/// ERROR logging.
static const LOGSEVERITY_ERROR = 4;
/// FATAL logging.
static const LOGSEVERITY_FATAL = 5;
/// Disable logging to file for all messages, and to stderr for messages with
/// severity less than FATAL.
static const LOGSEVERITY_DISABLE = 99;
end
//function IsBadReadPtr(ptr:pointer;ucb:pointer):integer;stdcall;external "Kernel32.dll" name "IsBadReadPtr";
//function IsBadWritePtr(ptr:pointer;ucb:pointer):integer;stdcall;external "Kernel32.dll" name "IsBadWritePtr";
function addcefref(id);
begin
global g_cef_counter_;
return g_cef_counter_.addref(id);
end
function getcefrefcount(id);
begin
global g_cef_counter_;
return g_cef_counter_.refcount(id);
end
function remcefref(id);
begin
global g_cef_counter_;
return g_cef_counter_.remref(id);
end
function onecefref(id);
begin
global g_cef_counter_;
return (g_cef_counter_.refcount(id)>=0);
end
function lastonecefref(id);
begin
global g_cef_counter_;
return (g_cef_counter_.refcount(id)=0);
end
type tcefcounter = class()
function create();
begin
FData := array();
end
function addref(id);
begin
initct(id);
if id then
FData[id]++;
return FData[id];
end
function refcount(id);
begin
return FData[id];
end
function lastoneref(id);
begin
return FData[id]=1;
end
function remref(id);
begin
initct(id);
if id then
begin
FData[id]--;
end
end
private
function initct(id);
begin
if ifnil(FData[id]) then FData[id] := 0;
end
FData;
end
function cef_object_get(ptr,cls); //<2F><><EFBFBD><EFBFBD>
begin
global g_cef_objects_;
if not(ptr>0 or ptr<0) then return ;
sptr := inttostr(ptr);
r := g_cef_objects_[sptr];
if not( r) and (ptr>0 or ptr<0) and (cls is class(cef_contain_base)) then
begin
r := createobject(cls,ptr);
end else
begin
cef_object_del_invalid();
end
return r;
end
function cef_object_del(ptr); //ɾ<><C9BE>
begin
global g_cef_objects_;
if ptr>0 or ptr<0 then
begin
sptr := inttostr(ptr);
reindex(g_cef_objects_,array(sptr:nil));
end else
begin
if ptr is class(cef_contain_base) then
begin
cef_object_del(ptr._getptr_());
end
end
end
function cef_object_del_invalid();
begin
global g_cef_objects_;
rs := array();
for i,v in g_cef_objects_ do
begin
ptr := v._getptr_();
{if IsBadReadPtr(ptr,v.memsize()) then //ָ<><D6B8><EFBFBD><EFBFBD>Ч
begin
rs[i] := nil;
continue;
end }
isv := v._getvalue_("is_valid");
if isv then
begin
f := function(s:pointer):integer;cdecl;external isv;
if 0=##f(ptr) then
begin
rs[i] := nil;
end
end
end
if rs then
begin
reindex(g_cef_objects_,rs);
end
end
function cef_object_save(obj); //<2F><><EFBFBD><EFBFBD>
begin
global g_cef_objects_;
ptr := obj._getptr_();
sptr := inttostr(ptr);
if not g_cef_objects_[sptr] then
begin
g_cef_objects_[sptr] := obj;
end
end
/// Create a new URL request that is not associated with a specific browser or
/// frame. Use cef_frame_t::CreateURLRequest instead if you want the request to
/// have this association, in which case it may be handled differently (see
/// documentation on that function). A request created with this function may
/// only originate from the browser process, and will behave as follows:
/// - It may be intercepted by the client via CefResourceRequestHandler or
/// CefSchemeHandlerFactory.
/// - POST data may only contain only a single element of type PDE_TYPE_FILE
/// or PDE_TYPE_BYTES.
/// - If |request_context| is empty the global request context will be used.
///
/// The |request| object will be marked as read-only after calling this
/// function.
function cef_urlrequest_create(r,c,rct):pointer;
begin
_f_ := static function(r:pointer;c:pointer;rct:pointer):pointer;stdcall;external getceffunction(functionname());
return ##_f_(r,c,rct);
end
///
/// Returns the task runner for the current thread. Only CEF threads will have
/// task runners. An NULL reference will be returned if this function is called
/// on an invalid thread.
///
function cef_task_runner_get_for_current_thread();
begin
_f_ := static function():pointer;stdcall;external getceffunction(functionname());
return ##_f_();
end
///
/// Returns the task runner for the specified CEF thread.
///
function cef_task_runner_get_for_thread(threadId);
begin
_f_ := static function(threadId:integer):pointer;stdcall;external getceffunction(functionname());
return ##_f_(threadId);
end
/// Returns true (1) if called on the specified thread. Equivalent to using
/// cef_task_runner_t::GetForThread(threadId)->belongs_to_current_thread().
function cef_currently_on(threadId);
begin
_f_ := static function(threadId:integer):integer;stdcall;external getceffunction(functionname());
return ##_f_(threadId);
end
/// Post a task for execution on the specified thread. Equivalent to using
/// cef_task_runner_t::GetForThread(threadId)->PostTask(task).
///
function cef_post_task(threadId,task);
begin
_f_ := static function(threadId:integer;task:pointer):integer;stdcall;external getceffunction(functionname());
return ##_f_(threadId,task);
end
/// Post a task for delayed execution on the specified thread. Equivalent to
/// using cef_task_runner_t::GetForThread(threadId)->PostDelayedTask(task,
/// delay_ms).
function cef_post_delayed_task(threadId,task,delay_ms);
begin
_f_ := static function(threadId:integer;task:pointer;delay_ms:int64):integer;stdcall;external getceffunction(functionname());
return ##_f_(threadId,task,delay_ms);
end
/// Create a new cef_drag_data_t object.
//CEF_EXPORT cef_drag_data_t* cef_drag_data_create(void);
function cef_drag_data_create():pointer;
begin
_f_ := static function():pointer;cdecl;external getceffunction(functionname());
return ##_f_();
end
/// Create a new cef_stream_writer_t object for a file.
//CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file(const cef_string_t* fileName);
function cef_stream_writer_create_for_file(name:pointer):pointer;
begin
_f_ := static function(name:pointer):pointer;cdecl;external getceffunction(functionname());
return ##_f_(name);
end
//CEF_EXPORT cef_process_message_t* cef_process_message_create(const cef_string_t* name);
function cef_process_message_create(name:pointer):pointer;
begin
_f_ := static function(name:pointer):pointer;cdecl;external getceffunction(functionname());
return ##_f_(name);
end
//cef_request_t* cef_request_create(void);
function cef_request_create():pointer;
begin
_f_ := static function():pointer;cdecl;external getceffunction(functionname());
return ##_f_();
end
//CEF_EXPORT cef_binary_value_t* cef_binary_value_create(const void* data,size_t data_size);
function cef_binary_value_create(s:string;data_size:pointer):pointer;
begin
_f_ := static function(s:string;data_size:pointer):pointer;cdecl;external getceffunction(functionname());
return ##_f_(s,data_size);
end
//CEF_EXPORT cef_dictionary_value_t* cef_dictionary_value_create(void);
function cef_dictionary_value_create():pointer;
begin
_f_ := static function():pointer;cdecl;external getceffunction(functionname());
return ##_f_();
end
//CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(struct _cef_completion_callback_t* callback);
function cef_cookie_manager_get_global_manager(callback:pointer):pointer;
begin
_f_ := static function(callback:pointer):pointer;cdecl;external getceffunction(functionname());
return ##_f_(callback);
end
//CEF_EXPORT cef_request_context_t* cef_request_context_get_global_context(void);
function cef_request_context_get_global_context():pointer;
begin
_f_ := static function():pointer;cdecl;external getceffunction(functionname());
return ##_f_();
end
//CEF_EXPORT cef_value_t* cef_value_create(void);
function cef_value_create():pointer;
begin
_f_ := static function():pointer;cdecl;external getceffunction(functionname());
return ##_f_();
end
//CEF_EXPORT cef_preference_manager_t* cef_preference_manager_get_global(void);
function cef_preference_manager_get_global():pointer;
begin
_f_ := static function():pointer;cdecl;external getceffunction(functionname());
return ##_f_();
end
procedure cef_shutdown();
begin
_f_ := static procedure();cdecl;external getceffunction(functionname());
return ##_f_();
end
function cef_string_list_alloc():pointer;
begin
_f_ := static function():pointer;cdecl;external getceffunction(functionname());
return ##_f_();
end
/// Return the number of elements in the string list.
function cef_string_list_size(list:pointer):pointer;
begin
_f_ := static function(list:pointer):pointer;cdecl;external getceffunction(functionname());
return ##_f_(list);
end
/// Retrieve the value at the specified zero-based string list index. Returns
/// true (1) if the value was successfully retrieved.
function cef_string_list_value(list:pointer;index:pointer;value:pointer):integer;
begin
_f_ := static function(list:pointer;index:pointer;value:pointer):integer;cdecl;external getceffunction(functionname());
return ##_f_(list,index,value);
end
/// Append a new value at the end of the string list.
procedure cef_string_list_append(list:pointer;value:pointer);
begin
_f_ := static procedure(list:pointer;value:pointer);cdecl;external getceffunction(functionname());
return ##_f_(list,value);
end
/// Clear the string list.
procedure cef_string_list_clear(list:pointer);
begin
_f_ := static procedure(list:pointer);cdecl;external getceffunction(functionname());
return ##_f_(list);
end
/// Free the string list.
procedure cef_string_list_free(list:pointer);
begin
_f_ := static procedure(list:pointer);cdecl;external getceffunction(functionname());
return ##_f_(list);
end
/// Creates a copy of an existing string list.
function cef_string_list_copy(list:pointer):pointer;
begin
_f_ := static function(list:pointer):pointer;cdecl;external getceffunction(functionname());
return ##_f_(list);
end
//cef_string_multimap_t
function cef_string_multimap_alloc():pointer;
begin
_f_ := static function():pointer;cdecl;external getceffunction(functionname());
return ##_f_();
end
/// Return the number of elements in the string multimap.
function cef_string_multimap_size( map:pointer):pointer;
begin
_f_ := static function( map:pointer):pointer;cdecl;external getceffunction(functionname());
return ##_f_(map);
end
/// Return the number of values with the specified key.
function cef_string_multimap_find_count(map:pointer;key:pointer):pointer;
begin
_f_ := static function(map:pointer;key:pointer):pointer;cdecl;external getceffunction(functionname());
return ##_f_(map,key);
end
/// Return the value_index-th value with the specified key.
function cef_string_multimap_enumerate(map:pointer;key:pointer;value_index:pointer;value:pointer):integer;
begin
_f_ := static function(map:pointer;key:pointer;value_index:pointer;value:pointer):integer;cdecl;external getceffunction(functionname());
return ##_f_(map,key,value_index,value);
end
/// Return the key at the specified zero-based string multimap index.
function cef_string_multimap_key(map:pointer;index:pointer;key:pointer):integer;
begin
_f_ := static function(map:pointer;index:pointer;key:pointer):integer;cdecl;external getceffunction(functionname());
return ##_f_(map,index,key);
end
/// Return the value at the specified zero-based string multimap index.
function cef_string_multimap_value(map:pointer;index:pointer;value:pointer):integer;
begin
_f_ := static function(map:pointer;index:pointer;value:pointer):integer;cdecl;external getceffunction(functionname());
return ##_f_(map,index,value);
end
/// Append a new key/value pair at the end of the string multimap.
function cef_string_multimap_append(map:pointer;key:pointer;value:pointer):integer;
begin
_f_ := static function(map:pointer;key:pointer;value:pointer):integer;cdecl;external getceffunction(functionname());
return ##_f_(map,key,value);
end
/// Clear the string multimap.
procedure cef_string_multimap_clear( map:pointer);
begin
_f_ := static procedure( map:pointer);cdecl;external getceffunction(functionname());
return ##_f_(map);
end
/// Free the string multimap.
procedure cef_string_multimap_free(map:pointer);
begin
_f_ := static procedure(map:pointer);cdecl;external getceffunction(functionname());
return ##_f_(map);
end
function cef_post_data_element_create():pointer;
begin
_f_ := static function():pointer;cdecl;external getceffunction(functionname());
return ##_f_();
end
function cef_post_data_create():pointer;
begin
_f_ := static function():pointer;cdecl;external getceffunction(functionname());
return ##_f_();
end
function cef_string_utf8_to_utf16(uf8:string;len:pointer;o:pointer):integer;
begin
_f_ := static function(uf8:string;len:pointer;o:pointer):integer;cdecl;external getceffunction(functionname());
return ##_f_(uf8,len,o);
end
function cef_string_ascii_to_utf16(uf8:string;len:pointer;o:pointer):integer;
begin
_f_ := static function(uf8:string;len:pointer;o:pointer):integer;cdecl;external getceffunction(functionname());
return ##_f_(uf8,len,o);
end
function cef_initialize(args:pointer;sett:pointer;app:pointer;info:pointer):integer;
begin
_f_ := static function(args:pointer;sett:pointer;app:pointer;info:pointer):integer;cdecl;external getceffunction(functionname());
return ##_f_(args,sett,app,info);
end
function cef_browser_host_create_browser_sync(winfo:pointer;client:pointer;url:pointer;bs:pointer;ef:pointer;ef2:pointer):pointer;
begin
_f_ := static function(winfo:pointer;client:pointer;url:pointer;bs:pointer;ef:pointer;ef2:pointer):pointer;cdecl;external getceffunction(functionname());
return ##_f_(winfo,client,url,bs,ef,ef2);
end
function cef_browser_host_create_browser(winfo:pointer;client:pointer;url:pointer;bs:pointer;ef:pointer;ef2:pointer):pointer;
begin
_f_ := static function(winfo:pointer;client:pointer;url:pointer;bs:pointer;ef:pointer;ef2:pointer):pointer;cdecl;external getceffunction(functionname());
return ##_f_(winfo,client,url,bs,ef,ef2);
end
function cef_initialize_tsl(args:pointer;sett:pointer;app:pointer;info:pointer);
begin
return cef_initialize(args?args._getptr_():0,sett?sett._getptr_():0,app?app._getptr_():0,info?info._getptr_():0);
end
function cef_browser_host_create_browser_tsl(winfo;client;url;bs;ef;ef2);
begin
s := new cef_string_t();
s.str := url;
return cef_browser_host_create_browser(winfo._getptr_(),client._getptr_(),s._getptr_(),bs._getptr_(),ef,ef2);
end
function cef_browser_host_create_browser_sync_tsl(winfo;client;url;bs;ef;ef2);
begin
s := new cef_string_t();
s.str := url;
h := cef_browser_host_create_browser_sync(winfo._getptr_(),client._getptr_(),s._getptr_(),bs._getptr_(),ef,ef2);
if h then
begin
return cef_object_get(h,class( cef_browser_t));
end
end
function cef_command_line_get_global():pointer;
begin
_f_ := static function():pointer;cdecl;external getceffunction(functionname());
return ##_f_();
end
function cef_command_line_create():pointer;
begin
_f_ := static function():pointer;cdecl;external getceffunction(functionname());
return ##_f_();
end
procedure cef_run_message_loop();
begin
_f_ := static procedure();cdecl;external getceffunction(functionname());
return ##_f_();
end
procedure cef_do_message_loop_work();
begin
_f_ := static procedure();cdecl;external getceffunction(functionname());
return ##_f_();
end
function cef_execute_process(arg:pointer;app:pointer;dow:pointer):integer;
begin
_f_ := static function(arg:pointer;app:pointer;dow:pointer):integer;cdecl;external getceffunction(functionname());
return ##_f_(arg,app,dow);
end
// Returns CEF version information for the libcef library. The |entry|
// parameter describes which version component will be returned:
// 0 - CEF_VERSION_MAJOR
// 1 - CEF_VERSION_MINOR
// 2 - CEF_VERSION_PATCH
// 3 - CEF_COMMIT_NUMBER
// 4 - CHROME_VERSION_MAJOR
// 5 - CHROME_VERSION_MINOR
// 6 - CHROME_VERSION_BUILD
// 7 - CHROME_VERSION_PATCH
function cef_version_info(entry:integer):integer;
begin
_f_ := static function(entry:integer):integer;cdecl;external getceffunction(functionname());
return ##_f_(entry);
end
function getcefboundsstruct();
begin
return array(("x","int",0),
("y","int",0),
("width","int",0),
("height","int",0)
);
end
function getcefstr16struct();
begin
return array(("str","intptr",0),
("length","intptr",0),
("dtor","intptr",0));
end
function getbasestruct();
begin
return array(
("size","intptr",0),
("add_ref","intptr",0),
("release","intptr",0),
("has_one_ref","intptr",0),
("has_at_least_one_ref","intptr",0));
end
function init();
begin
global g_cef_counter_;
global g_cef_objects_;
g_cef_counter_ := new tcefcounter();
g_cef_objects_ := array();
end
function getceffunction(n);
begin
{$ifdef linux}
return getdlsymaddress("libcef.so",n);
{$endif}
return getdlsymaddress("libcef.dll",n);
end
initialization
init();
end.