界面库

优化代码树快捷键,添加动态库函数句柄获取方法
This commit is contained in:
JianjunLiu
2023-03-28 16:37:41 +08:00
parent bcb38e3d02
commit 4f4029a835
3 changed files with 37 additions and 4 deletions
+12
View File
@@ -0,0 +1,12 @@
function getdlsymaddress(lib,n); //获取动态库中的函数句柄
begin
if not(ifstring(lib) and lib and n and ifstring(n)) then return 0;
{$ifdef linux}
Return dlsym(dlopen(lib,0x101) ,n);
{$endif}
Return GetProcAddress(LoadLibraryA(lib),n);
end
function dlopen(dl:string;flg:integer):pointer;cdecl ;external "libdl.so.2";
function dlsym(handle:pointer;symbol:string):pointer;cdecl ;external "libdl.so.2";
function LoadLibraryA(txt:string):POINTER;stdcall;external "Kernel32.dll" name "LoadLibraryA";
function GetProcAddress(h:pointer;n:string):pointer;stdcall;external "Kernel32.dll" name "GetProcAddress";
+8 -2
View File
@@ -6,6 +6,7 @@ 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);
@@ -696,6 +697,7 @@ type cef_contain_base = class(tslcstructureobj)
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);
@@ -1281,7 +1283,7 @@ type cef_display_handler_t=class(cef_contain_base)
);
end
end
property on_title_change index "on_title_change" read getcallpropertybyindex write setcallpropertybyindex;
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());
@@ -1293,7 +1295,7 @@ type cef_display_handler_t=class(cef_contain_base)
);
end
end
property on_favicon_urlchange index "on_favicon_urlchange" read getcallpropertybyindex write setcallpropertybyindex;
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());
@@ -5371,6 +5373,10 @@ function cef_string_ascii_to_utf16(uf8:string;len:pointer;o:pointer):integer;cde
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";
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();