界面库

修改 external 方式
This commit is contained in:
JianjunLiu 2023-04-24 09:28:59 +08:00
parent f70ed1b63b
commit 2e6a766d09
4 changed files with 2198 additions and 524 deletions

View File

@ -5036,6 +5036,7 @@ type TEditerEchoWnd=class(TSynMemoNorm) //
function Create(AOwner);override;
begin
inherited;
autogutterwidth := true;
FDoLockTime := 0;
FIsLocked := false;
height := 250;

View File

@ -20,6 +20,97 @@ type TGdiplusflat=class
//----------------------------------------------------------------------------
{$ifdef linux}
//20210827 需要添加gdi功能
static fsgtkgdi;
class function getgtkgdi();
begin
if not fsgtkgdi then fsgtkgdi := new tgtkgdi();
return fsgtkgdi;
end
type tgtkgdi = class
{
class procedure cairo_pattern_destroy(p:pointer);cdecl;external 'libgtk-3.so';
class function cairo_image_surface_create_from_png(f:string):pointer;cdecl;external 'libgtk-3.so';
class function cairo_pattern_create_for_surface(f:pointer):pointer;cdecl;external 'libgtk-3.so';
class function cairo_image_surface_get_width(sf:pointer):integer;cdecl;external 'libgtk-3.so';
class function cairo_image_surface_get_height(sf:pointer):integer;cdecl;external 'libgtk-3.so';
class function gdk_pixbuf_new_from_file(f:string;er:pointer):pointer;cdecl;external 'libgtk-3.so';
class function gdk_pixbuf_save(pixbuf:pointer;p:string;tp:string;gerr:string;p1:string; p2:string;p3:string;p4:string;p5:string):integer;cdecl;external 'libgtk-3.so';
class procedure gdk_pixbuf_unref(pixbuf);cdecl;external 'libgtk-3.so';
class procedure gdk_pixbuf_ref(pixbuf);cdecl;external 'libgtk-3.so';
class function g_object_ref(g:pointer):pointer;cdecl;external 'libgtk-3.so';
class procedure g_object_unref(g:pointer);cdecl;external 'libgtk-3.so';
}
procedure cairo_pattern_destroy(p:pointer);
begin
_f_ := static procedure(p:pointer);cdecl;external getfuncptrbyname(0,functionname());
return ##_f_(p);
end
function cairo_image_surface_create_from_png(f:string):pointer;
begin
_f_ := static function(f:string):pointer;cdecl;external getfuncptrbyname(0,functionname());
return ##_f_(f);
end
function cairo_pattern_create_for_surface(f:pointer):pointer;
begin
_f_ := static function(f:pointer):pointer;cdecl;external getfuncptrbyname(0,functionname());
return ##_f_(f);
end
function cairo_image_surface_get_width(sf:pointer):integer;
begin
_f_ := static function(sf:pointer):integer;cdecl;external getfuncptrbyname(0,functionname());
return ##_f_(sf);
end
function cairo_image_surface_get_height(sf:pointer):integer;
begin
_f_ := static function(sf:pointer):integer;cdecl;external getfuncptrbyname(0,functionname());
return ##_f_(sf);
end
function gdk_pixbuf_new_from_file(f:string;er:pointer):pointer;
begin
_f_ := static function(f:string;er:pointer):pointer;cdecl;external getfuncptrbyname(0,functionname());
return ##_f_(f,er);
end
function gdk_pixbuf_save(pixbuf:pointer;p:string;tp:string;gerr:string;p1:string; p2:string;p3:string;p4:string;p5:string):integer;
begin
_f_ := static function(pixbuf:pointer;p:string;tp:string;gerr:string;p1:string; p2:string;p3:string;p4:string;p5:string):integer;cdecl;external getfuncptrbyname(0,functionname());
return ##_f_(pixbuf,p,tp,gerr,p1,p2,p3,p4,p5);
end
procedure gdk_pixbuf_unref(pixbuf);
begin
_f_ := static procedure(pixbuf);cdecl;external getfuncptrbyname(0,functionname());
return ##_f_();
end
class procedure gdk_pixbuf_ref(pixbuf);
begin
_f_ := static procedure(pixbuf);cdecl;external getfuncptrbyname(0,functionname());
return ##_f_();
end
function g_object_ref(g:pointer):pointer;
begin
_f_ := static function(g:pointer):pointer;cdecl;external getfuncptrbyname(0,functionname());
return ##_f_(g);
end
procedure g_object_unref(g:pointer);
begin
_f_ := static procedure(g:pointer);cdecl;external getfuncptrbyname(0,functionname());
return ##_f_(g);
end
function getfuncptrbyname(lib,n);
begin
case lib of
"libc":
begin
return getdlsymaddress("libc.so.6",n);
end
"gtk":
begin
end
else return getdlsymaddress("libgtk-3.so.0",n);
end
end
end
type TTempFile = class
function Create();
begin
@ -57,19 +148,64 @@ type TGdiplusflat=class
Fptr;
static _mtool;
end
class procedure cairo_pattern_destroy(p:pointer);cdecl;external 'libgtk-3.so';
class function cairo_image_surface_create_from_png(f:string):pointer;cdecl;external 'libgtk-3.so';
class function cairo_pattern_create_for_surface(f:pointer):pointer;cdecl;external 'libgtk-3.so';
class function cairo_image_surface_get_width(sf:pointer):integer;cdecl;external 'libgtk-3.so';
class function cairo_image_surface_get_height(sf:pointer):integer;cdecl;external 'libgtk-3.so';
class function gdk_pixbuf_new_from_file(f:string;er:pointer):pointer;cdecl;external 'libgtk-3.so';
class function gdk_pixbuf_save(pixbuf:pointer;p:string;tp:string;gerr:string;p1:string; p2:string;p3:string;p4:string;p5:string):integer;cdecl;external 'libgtk-3.so';
class procedure gdk_pixbuf_unref(pixbuf);cdecl;external 'libgtk-3.so';
class procedure gdk_pixbuf_ref(pixbuf);cdecl;external 'libgtk-3.so';
class function g_object_ref(g:pointer):pointer;cdecl;external 'libgtk-3.so';
class procedure g_object_unref(g:pointer);cdecl;external 'libgtk-3.so';
class procedure cairo_pattern_destroy(p:pointer);
begin
return getgtkgdi().cairo_pattern_destroy(p);
end
class function cairo_image_surface_create_from_png(f:string):pointer;
begin
return getgtkgdi().cairo_image_surface_create_from_png(f);
end
class function cairo_pattern_create_for_surface(f:pointer):pointer;
begin
return getgtkgdi().cairo_pattern_create_for_surface(f);
end
class function cairo_image_surface_get_width(sf:pointer):integer;
begin
return getgtkgdi().cairo_image_surface_get_width(sf);
end
class function cairo_image_surface_get_height(sf:pointer):integer;
begin
return getgtkgdi().cairo_image_surface_get_height(sf);
end
class function gdk_pixbuf_new_from_file(f:string;er:pointer):pointer;
begin
return getgtkgdi().gdk_pixbuf_new_from_file(f,er);
end
class function gdk_pixbuf_save(pixbuf:pointer;p:string;tp:string;gerr:string;p1:string; p2:string;p3:string;p4:string;p5:string):integer;
begin
return getgtkgdi().gdk_pixbuf_save(pixbuf,p,tp,gerr,p1,p2,p3,p4,p5);
end
class procedure gdk_pixbuf_unref(pixbuf);
begin
return getgtkgdi().gdk_pixbuf_unref(pixbuf);
end
class procedure gdk_pixbuf_ref(pixbuf);
begin
return getgtkgdi().gdk_pixbuf_ref(pixbuf);
end
class function g_object_ref(g:pointer):pointer;
begin
return getgtkgdi().g_object_ref(g);
end
class procedure g_object_unref(g:pointer);
begin
return getgtkgdi().g_object_unref(g);
end
class function getfuncptrbyname(lib,n);
begin
case lib of
"libc":
begin
return getdlsymaddress("libc.so.6",n);
end
"gtk":
begin
end
else return getdlsymaddress("libgtk-3.so.0",n);
end
end
class function GdipSaveImageToStream(image:pointer;var imgestr:string); //无用到
class function GdipLoadImageFromFile(filename:string;var image:pointer); //无用到
begin

File diff suppressed because it is too large Load Diff

View File

@ -15,8 +15,8 @@ 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 IsBadReadPtr(ptr:pointer;ucb:pointer):integer;
//function IsBadWritePtr(ptr:pointer;ucb:pointer):integer;
type cef_point_t = class(tslcstructureobj)
private
static SSTRUCT;
@ -224,9 +224,10 @@ type tcefmessage = class(TTSLProcessMsg)
function create(ptr);
begin
inherited;
lb := LoadLibraryA("libcef.dll");
p := GetProcAddress(lb,"cef_do_message_loop_work");
proc := p;
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
@ -237,8 +238,24 @@ type tcefmessage = class(TTSLProcessMsg)
tslRemoveProcess(_getptr_());
end
private
procedure tslAddProcess(p:pointer);cdecl;external "tslkrnl.dll" name "tslAddProcess";
procedure tslRemoveProcess(p:pointer);cdecl;external "tslkrnl.dll" name "tslRemoveProcess";
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(tslcstructureobj)
private
@ -506,14 +523,46 @@ type cef_string_map_t = class()
private
fptr;
private
function cef_string_map_alloc():pointer;cdecl;external "libcef.dll" name "cef_string_map_alloc";
function cef_string_map_size(map:pointer):pointer;cdecl;external "libcef.dll" name "cef_string_map_size";
function cef_string_map_find(map:pointer;key:pointer;value:pointer):pointer;cdecl;external "libcef.dll" name "cef_string_map_find";
function cef_string_map_key(map:pointer;index:pointer;key:pointer):integer;cdecl;external "libcef.dll" name "cef_string_map_key";
function cef_string_map_value(map:pointer;index:pointer;value:pointer):integer;cdecl;external "libcef.dll" name "cef_string_map_value";
function cef_string_map_append(map:pointer;key:pointer;value:pointer):integer;cdecl;external "libcef.dll" name "cef_string_map_append";
procedure cef_string_map_clear(map:pointer);cdecl;external "libcef.dll" name "cef_string_map_clear";
procedure cef_string_map_free(map:pointer);cdecl;external "libcef.dll" name "cef_string_map_free";
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
type cef_main_args_t=class(tslcstructureobj)
@ -5742,11 +5791,8 @@ type cef_log_severity_t = class
//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 LoadLibraryA(txt:string):POINTER;stdcall;external "Kernel32.dll" name "LoadLibraryA";
function FreeLibrary(hd:pointer):integer;stdcall;external "Kernel32.dll" name "FreeLibrary";
function GetProcAddress(h:pointer;n:string):pointer;stdcall;external "Kernel32.dll" name "GetProcAddress";
//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_;
@ -5846,11 +5892,11 @@ begin
for i,v in g_cef_objects_ do
begin
ptr := v._getptr_();
if IsBadReadPtr(ptr,v.memsize()) then //Ö¸ÕëÎÞЧ
{if IsBadReadPtr(ptr,v.memsize()) then //Ö¸ÕëÎÞЧ
begin
rs[i] := nil;
continue;
end
end }
isv := v._getvalue_("is_valid");
if isv then
begin
@ -5878,69 +5924,204 @@ begin
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;cdecl;external "libcef.dll" name "cef_drag_data_create";
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;cdecl;external "libcef.dll" name "cef_stream_writer_create_for_file";
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;cdecl;external "libcef.dll" name "cef_process_message_create";
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;cdecl;external "libcef.dll" name "cef_request_create";
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;cdecl;external "libcef.dll" name "cef_binary_value_create";
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;cdecl;external "libcef.dll" name "cef_dictionary_value_create";
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;cdecl;external "libcef.dll" name "cef_cookie_manager_get_global_manager";
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;cdecl;external "libcef.dll" name "cef_request_context_get_global_context";
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;cdecl;external "libcef.dll" name "cef_value_create";
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;cdecl;external "libcef.dll" name "cef_preference_manager_get_global";
procedure cef_shutdown();cdecl;external "libcef.dll" name "cef_shutdown";
function cef_string_list_alloc():pointer;cdecl;external "libcef.dll" name "cef_string_list_alloc";
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;cdecl;external "libcef.dll" name "cef_string_list_size";
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;cdecl;external "libcef.dll" name "cef_string_list_value";
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);cdecl;external "libcef.dll" name "cef_string_list_append";
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);cdecl;external "libcef.dll" name "cef_string_list_clear";
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);cdecl;external "libcef.dll" name "cef_string_list_free";
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;cdecl;external "libcef.dll" name "cef_string_list_copy";
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;cdecl;external "libcef.dll" name "cef_string_multimap_alloc";
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;cdecl;external "libcef.dll" name "cef_string_multimap_size";
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;cdecl;external "libcef.dll" name "cef_string_multimap_find_count";
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;cdecl;external "libcef.dll" name "cef_string_multimap_enumerate";
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;cdecl;external "libcef.dll" name "cef_string_multimap_key";
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;cdecl;external "libcef.dll" name "cef_string_multimap_value";
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;cdecl;external "libcef.dll" name "cef_string_multimap_append";
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);cdecl;external "libcef.dll" name "cef_string_multimap_clear";
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);cdecl;external "libcef.dll" name "cef_string_multimap_free";
function cef_post_data_element_create():pointer;cdecl;external "libcef.dll" name "cef_post_data_element_create";
function cef_post_data_create():pointer;cdecl;external "libcef.dll" name "cef_post_data_create";
function cef_string_utf8_to_utf16(uf8:string;len:pointer;o:pointer):integer;cdecl;external "libcef.dll" name "cef_string_utf8_to_utf16";
function cef_string_ascii_to_utf16(uf8:string;len:pointer;o:pointer):integer;cdecl;external "libcef.dll" name "cef_string_ascii_to_utf16";
function cef_initialize(args:pointer;sett:pointer;app:pointer;info:pointer):integer;cdecl;external "libcef.dll" name "cef_initialize";
function cef_browser_host_create_browser_sync(winfo:pointer;client:pointer;url:pointer;bs:pointer;ef:pointer;ef2:pointer):pointer;cdecl;external "libcef.dll" name "cef_browser_host_create_browser_sync";
function cef_browser_host_create_browser(winfo:pointer;client:pointer;url:pointer;bs:pointer;ef:pointer;ef2:pointer):pointer;cdecl;external "libcef.dll" name "cef_browser_host_create_browser";
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);
@ -5961,9 +6142,21 @@ begin
return cef_object_get(h,class( cef_browser_t));
end
end
procedure cef_run_message_loop();external "libcef.dll" name "cef_run_message_loop";
procedure cef_do_message_loop_work();external "libcef.dll" name "cef_do_message_loop_work";
function cef_execute_process(arg:pointer;app:pointer;dow:pointer):integer;cdecl;external "libcef.dll" name "cef_execute_process";
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
function getcefboundsstruct();
@ -5996,6 +6189,13 @@ begin
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.