tsl64 gtk
This commit is contained in:
2024-03-29 16:34:15 +08:00
parent 8b505199fb
commit 3afa122571
22 changed files with 327 additions and 110 deletions
+2 -2
View File
@@ -2127,14 +2127,14 @@ begin
@param(data)(array) 结构体信息数组,参考 cstructurelib中 tslarraytocstructcalc %%
@param(baselen)(integer) 基准位置默认为0 %%
@param(ssize)(integer) 大小 %%
@param(pack)(integer) 对其方式 windows 默认8 linux 默认4 %%
@param(pack)(integer) 对其方式 默认8 %%
**}
if not ifnumber(baselen)then baselen := 1; //最小长度
if not ifnumber(ssize)then ssize := 0; //大小
if not ifnumber(pack)then
begin
{$ifdef linux}
pack := 4;
pack := 8;
{$else}
pack := 8; //对齐
{$endif}
+35 -1
View File
@@ -407,7 +407,41 @@ begin
begin
indx++;
if tokens[indx,2]="//" or tokens[indx,2]="/*" then continue;
tkv := tokens[indx,0];
tkv := tokens[indx,0];
if tkv="(" then //碰到括号,为函数指针
begin
flg := 0;
while indx<len do
begin
indx++;
if tokens[indx,2]="//" or tokens[indx,2]="/*" then continue;
tkvi := tokens[indx,0];
if tkvi="*" and flg=0 then //指针标志
begin
flg := 1;
mc := "";
end else
if flg =1 then //函数指针名称
begin
mc := tkvi;
zz := 0;
lx := array("fptr");
flg := 2;
end else
if flg=2 and tkvi=")" then //第一次碰到反括号
begin
flg := 3;
end else
if flg=3 and tkvi=")" then //第二次碰到反括号,如果有嵌套依然存在问题
begin
break;
end
end
end else
if tkv="struct" then
begin
end else
if tkv="}" then
begin
return ret;
+53 -40
View File
@@ -4222,7 +4222,7 @@ type tgtkapis = class() //gtk
////////////////////ÍÏ×§ÎļþÏà¹Ø///////////////////////////////////////////
function gtk_drag_get_data(w:pointer;c:pointer;ls:pointer;tm:integer);
begin
_f_ := static procedure(w:pointer;c:pointer;ls:pointer;tm:integer);cdecl;external getfuncptrbyname(0,functionname());
_f_ := static procedure(w:pointer;c:pointer;var ls:pointer;tm:integer);cdecl;external getfuncptrbyname(0,functionname());
return ##_f_(w,c,ls,tm);
end
@@ -4292,9 +4292,11 @@ type tgtkapis = class() //gtk
end
function gtk_selection_data_get_uris(d);
begin
if not d then return array();
_f_ := static function(d:pointer):pointer;cdecl;external getfuncptrbyname(0,functionname());
r := ##_f_(d);
rr := r;
if not r then return array();
ret := array();
_tool := unit(cstructurelib).get_mem_mgr();
while true do
@@ -5806,14 +5808,14 @@ type tgtkapis = class() //gtk
_f_ := static function():integer;cdecl;external getfuncptrbyname(0,functionname());
return ##_f_();
end
function g_signal_connect_data(instance:pointer; detailed_signal:string; c_handler:pointer;data:pointer;dd:pointer;f:integer):integer;
function g_signal_connect_data(instance:pointer; detailed_signal:string; c_handler:pointer;data:pointer;dd:pointer;f:integer):pointer; //gulong
begin
_f_ := static function(instance:pointer; detailed_signal:string; c_handler:pointer;data:pointer;dd:pointer;f:integer):integer;cdecl;external getfuncptrbyname(0,functionname());
_f_ := static function(instance:pointer; detailed_signal:string; c_handler:pointer;data:pointer;dd:pointer;f:integer):pointer;cdecl;external getfuncptrbyname(0,functionname());
return ##_f_(instance,detailed_signal,c_handler,data,dd,f);
end
procedure g_signal_handler_disconnect(instance:pointer;id:integer);
procedure g_signal_handler_disconnect(instance:pointer;id:pointer); //gulong
begin
_f_ := static procedure(instance:pointer;id:integer);cdecl;external getfuncptrbyname(0,functionname());
_f_ := static procedure(instance:pointer;id:pointer);cdecl;external getfuncptrbyname(0,functionname());
return ##_f_(instance,id);
end
function g_signal_new(signal_name:string;itype:pointer;signal_flags:integer;class_offset:integer;accumulator:pointer;accu_data:pointer;c_marshaller:pointer;return_type:pointer;n_params:integer;p1:pointer;p2:pointer):integer;
@@ -6049,7 +6051,7 @@ type _cairo_matrix_t = class(tslcstructureobj)
("yy","double",0),
("x0","double",0),
("y0","double",0)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
@@ -6078,7 +6080,7 @@ type _cairo_text_extents_t = class(tslcstructureobj)
("height","double",0),
("x_advance","double",0),
("y_advance","double",0)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
@@ -6107,7 +6109,7 @@ type _cairo_font_extents_t = class(tslcstructureobj)
("height","double",0),
("max_x_advance","double",0),
("max_y_advance","double",0)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
@@ -6134,7 +6136,7 @@ type _dlgwidgets = class(tslcstructureobj)
(1,"intptr",0),
(2,"intptr",0),
(3,"intptr",0)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
@@ -6162,7 +6164,7 @@ type _GdkGeometry = class(tslcstructureobj)
("min_aspect","int",-1),
("max_aspect","int",-1),
("win_gravity","int",-1)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
public
@@ -6200,7 +6202,7 @@ type _GdkEventButton=class(tslcstructureobj)
("device","intptr",0),
("x_root","double",0),
("y_root","double",0)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
public
@@ -6239,7 +6241,7 @@ type _GdkEventKey=class(tslcstructureobj)
("hardware_keycode","short",0),
("group","byte",0),
("is_modifier","int",1)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
public
@@ -6271,7 +6273,7 @@ type _GdkEventConfigure=class(tslcstructureobj)
("y","int",0),
("width","int",0),
("height","int",0)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
public
@@ -6305,7 +6307,7 @@ type _GdkEventMotion=class(tslcstructureobj)
("is_hint","short",0),
("device","intptr",0),
("x_root","double",0),
("y_root","double",0)),nil,nil,4);
("y_root","double",0)));//,nil,nil,4);
return SSTRUCT;
end
public
@@ -6343,7 +6345,7 @@ type _GdkEventScroll=class(tslcstructureobj)
("direction","int",0),
("device","intptr",0),
("x_root","double",0),
("y_root","double",0)),nil,nil,4);
("y_root","double",0)));//,nil,nil,4);
return SSTRUCT;
end
public
@@ -6374,7 +6376,7 @@ type _GdkEventAny=class(tslcstructureobj)
("ttype","intptr",0),
("window","intptr",0),
("send_event","byte",0)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
public
@@ -6396,7 +6398,7 @@ type _GdkEventFocus=class(tslcstructureobj)
("window","intptr",0),
("send_event","byte",0),
("iin","short",0)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
public
@@ -6421,7 +6423,7 @@ type _GdkEventExpose=class(tslcstructureobj)
("area","int[4]",0),
("region","intptr",0),
("count","int",0)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
public
@@ -6450,7 +6452,7 @@ type _GdkEventVisibility=class(tslcstructureobj)
("window","intptr",0),
("send_event","byte",0),
("state","int",0)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
public
@@ -6482,7 +6484,7 @@ type _GdkEventCrossing=class(tslcstructureobj)
("detail","intptr",0),
("focus","int",0),
("state","int",0)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
public
@@ -6504,7 +6506,7 @@ type _GdkEventWindowState=class(tslcstructureobj)
("send_event","byte",0),
("changed_mask","int",0),
("new_window_state","int",0)
),nil,nil,4);
));//,nil,nil,4);
return SSTRUCT;
end
public
@@ -6540,7 +6542,7 @@ type _GtkTextIter=class(tslcstructureobj)
("dummy13","int",0),
("dummy14","intptr",0),
("dummy15","intptr",0)
),nil,nil,4);
));//,nil,nil,4);
end
return classstruct;
end
@@ -6898,7 +6900,7 @@ type _gslist =class(tslcstructureobj)
begin
classstruct := MemoryAlignmentCalculate( array(
("data","intptr",0),
("next","intptr",0)),nil,nil,4);
("next","intptr",0)));//,nil,nil,4);
end
return classstruct;
end
@@ -8496,15 +8498,17 @@ type tgtk_ctl_scroll_window = class(tgtk_ctl_object)
if (dwExStyle .& _const.WS_EX_ACCEPTFILES)>0 then
begin
ftarget := _wapi.gtk_target_entry_new("text/uri-list",4,1);
wg := _wapi.GTK_WIDGET(h);
_wapi.gtk_drag_dest_set(wg,GTK_DEST_DEFAULT_DROP,ftarget,1,GDK_ACTION_COPY);
_wapi.g_signal_connect_data(wg,"drag-motion",get_instance_i(thisfunction(do_motion)),0,0);
_wapi.g_signal_connect_data(wg,"drag-data-received",get_instance_i(thisfunction(do_received)),0,0);
_wapi.g_signal_connect_data(wg,"drag-drop",get_instance_i(thisfunction(do_drop)),0,0);
ftargetsids := array();
//wg := _wapi.GTK_WIDGET(h);
wg := h;
_wapi.gtk_drag_dest_set(wg,GTK_DEST_DEFAULT_DROP,ftarget,1,GDK_ACTION_PRIVATE);
ftargetsids[0] := _wapi.g_signal_connect_data(wg,"drag-motion",get_instance_i(thisfunction(do_motion)),0,0,0);
ftargetsids[1] := _wapi.g_signal_connect_data(wg,"drag-data-received",get_instance_i(thisfunction(do_received)),0,0,0);
ftargetsids[2] := _wapi.g_signal_connect_data(wg,"drag-drop",get_instance_i(thisfunction(do_drop)),0,0,0);
end
return inherited;
return inherited;
end
procedure do_drop(w:pointer;ctx:pointer;x:integer;y:integer;tm:integer;ud:pointer);cdecl;
function do_drop(w:pointer;ctx:pointer;x:integer;y:integer;tm:integer;ud:pointer):integer;cdecl;
begin
return true;
end
@@ -8517,7 +8521,7 @@ type tgtk_ctl_scroll_window = class(tgtk_ctl_object)
end
function do_motion(w:pointer;c:pointer;x:integer;y:integer;tm:integer;d:pointer):integer;cdecl;
begin
_wapi.gdk_drag_status(c,GDK_ACTION_COPY,tm);
_wapi.gdk_drag_status(c,GDK_ACTION_PRIVATE,tm);
return true;
end
function widgetsizechanged(h_,w_);override; //´óС¸Ä±ä
@@ -8756,6 +8760,7 @@ type tgtk_ctl_scroll_window = class(tgtk_ctl_object)
end
private
ftarget ;
ftargetsids;
fscrollinfos;
ftimerobj;ftimerfptr;
Fscrolltimedo;
@@ -8860,6 +8865,19 @@ type tgtk_ctl_scroll_window = class(tgtk_ctl_object)
end
function Destroy();override;
begin
if ftarget then //´¦ÀíÍÏ×§ÎÊÌâ
begin
h := handle;
_wapi.gtk_target_entry_free(ftarget);
ftarget := nil;
if h then
begin
for i,v in ftargetsids do
begin
_wapi.g_signal_handler_disconnect(h,v);
end
end
end
inherited;
if ftimerobj then
begin
@@ -8868,10 +8886,9 @@ type tgtk_ctl_scroll_window = class(tgtk_ctl_object)
ftimerfptr := 0;
ftimerobj := nil;
end
get_instance_u(thisfunction(do_motion));
get_instance_u(thisfunction(do_received));
get_instance_u(thisfunction(do_drop));
//get_instance_u(thisfunction(do_motion));
//get_instance_u(thisfunction(do_received));
//get_instance_u(thisfunction(do_drop));
FHadjustment := nil;
Fvadjustment := nil;
FHscrollbar := nil;
@@ -8880,11 +8897,7 @@ type tgtk_ctl_scroll_window = class(tgtk_ctl_object)
Fvscrollbarobj := nil;
Fhscrollbarobj := nil;
FClientWideget := nil;
if ftarget then
begin
_wapi.gtk_target_entry_free(ftarget);
ftarget := nil;
end
end
protected
function initadjustSignal();
+17 -6
View File
@@ -2656,6 +2656,7 @@ type TSynCompletion = class(TSynCompletionList)
function Create(AOwner);override;
begin
inherited;
fminmatch := 1;
fmatchfirst := true;
{$ifdef linuxpop} //处理避免闪烁
@@ -2730,17 +2731,17 @@ type TSynCompletion = class(TSynCompletionList)
//s := PrevWordPos
//SetFilter();
s := Memo.PrevWord();
sl := length(s);
if visible then
begin
if s then
if s and (sl>=fminmatch) then
begin
SetFilter(s);
end
else Visible := false;
end else
begin
if s then
if s and (sl>=fminmatch) then
begin
SetFilter(s);
if ItemCount>0 then
@@ -2792,7 +2793,7 @@ type TSynCompletion = class(TSynCompletionList)
end else
begin
if completedCase() then
if {completedCase()}true then
begin
if s<>FFiltero and s and ls and fl then
begin
@@ -2855,10 +2856,10 @@ type TSynCompletion = class(TSynCompletionList)
end
return false;
end
function completedCase();virtual; //区分大小写
{function completedCase();virtual; //区分大小写
begin
return true;
end
end }
function SetFilter(s); //筛选
begin
if not FCompData then return ;
@@ -2918,7 +2919,9 @@ type TSynCompletion = class(TSynCompletionList)
property IgnoreCase read FIgnoreCase Write SetIgnoreCase; //忽略大小写
property OnJumpChoosed read GetJumpChoosed write SetJumpChoosed;
property matchfirst read fmatchfirst write fmatchfirst ;//匹配首字母
property minmatch read fminmatch write setminmatch ;//最小匹配长度
private
fminmatch;
fmatchfirst;
FCurrentWidth;
FCompData;
@@ -2927,6 +2930,14 @@ type TSynCompletion = class(TSynCompletionList)
FIgnoreCase;
FFilter;
FFiltero;
private
function setminmatch(v);
begin
if v>=1 and v<>fminmatch then
begin
fminmatch := v;
end
end
function GetJumpChoosed();
begin
return FJump.OnjumpChoosed ;
+156 -61
View File
@@ -19,7 +19,14 @@ function cef_execute_process(arg:pointer;app:pointer;dow:pointer):integer;
//function IsBadWritePtr(ptr:pointer;ucb:pointer):integer;
function cef_command_line_get_global():pointer;
function cef_command_line_create():pointer;
type cef_point_t = class(tslcstructureobj)
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()
@@ -28,7 +35,7 @@ type cef_point_t = class(tslcstructureobj)
array(
(0,"int",0),
(1,"int",0)
));
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -39,7 +46,7 @@ type cef_point_t = class(tslcstructureobj)
property x index 0 read _getvalue_ write _setvalue_;
property y index 1 read _getvalue_ write _setvalue_;
end
type cef_mouse_event_t = class(tslcstructureobj)
type cef_mouse_event_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
@@ -49,7 +56,7 @@ type cef_mouse_event_t = class(tslcstructureobj)
(0,"int",0),
(1,"int",0),
(2,"int",0)
));
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -62,7 +69,7 @@ type cef_mouse_event_t = class(tslcstructureobj)
property modifiers index 2 read _getvalue_ write _setvalue_; //Bit flags describing any pressed modifier keys. See
end
type cef_popup_features_t = class(tslcstructureobj)
type cef_popup_features_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
@@ -81,7 +88,7 @@ type cef_popup_features_t = class(tslcstructureobj)
(9,"int",0),
(10,"int",0),
(11,"int",0)
));
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -102,7 +109,7 @@ type cef_popup_features_t = class(tslcstructureobj)
property toolBarVisible index 10 read _getvalue_ write _setvalue_;
property scrollbarsVisible index 11 read _getvalue_ write _setvalue_;
end
type cef_audio_parameters_t = class(tslcstructureobj)
type cef_audio_parameters_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
@@ -112,7 +119,7 @@ type cef_audio_parameters_t = class(tslcstructureobj)
(0,"int",0),
(1,"int",0),
(2,"int",0)
));
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -124,7 +131,7 @@ type cef_audio_parameters_t = class(tslcstructureobj)
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(tslcstructureobj)
type cef_cursor_info_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
@@ -141,7 +148,7 @@ type cef_cursor_info_t = class(tslcstructureobj)
(0,"int",0),
(1,"int",0)
)))
);
,nil,nil,C_CEF_PACK);
;;
return SSTRUCT;
end
@@ -154,7 +161,7 @@ type cef_cursor_info_t = class(tslcstructureobj)
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(tslcstructureobj)
type cef_size_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
@@ -163,7 +170,7 @@ type cef_size_t = class(tslcstructureobj)
array(
(0,"int",0),
(1,"int",0)
));
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -174,7 +181,7 @@ type cef_size_t = class(tslcstructureobj)
property width index 0 read _getvalue_ write _setvalue_;
property height index 1 read _getvalue_ write _setvalue_;
end
type cef_rect_t = class(tslcstructureobj)
type cef_rect_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
@@ -185,7 +192,7 @@ type cef_rect_t = class(tslcstructureobj)
(1,"int",0),
(2,"int",0),
(3,"int",0)
));
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -198,7 +205,7 @@ type cef_rect_t = class(tslcstructureobj)
property width index 2 read _getvalue_ write _setvalue_;
property height index 3 read _getvalue_ write _setvalue_;
end
type cef_insets_t = class(tslcstructureobj)
type cef_insets_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
@@ -283,7 +290,7 @@ type tcefmessage = class(TTSLProcessMsg)
return ##_f_(p);
end
end
type TTSLProcessMsg =class(tslcstructureobj)
type TTSLProcessMsg =class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
@@ -293,7 +300,7 @@ type TTSLProcessMsg =class(tslcstructureobj)
("prev","intptr",0),
("next","intptr",0),
("proc","intptr",0),
));
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -305,7 +312,7 @@ type TTSLProcessMsg =class(tslcstructureobj)
end
type cef_string_t=class(tslcstructureobj)
type cef_string_t=class(t_cef_stc_base)
fdest;
function setansi(s);
begin
@@ -354,7 +361,7 @@ type cef_string_t=class(tslcstructureobj)
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(getcefstr16struct());
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(getcefstr16struct(),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -495,6 +502,10 @@ type cef_string_map_t = class()
end
fptr := ptr;
end
function _getptr_();
begin
return FPtr;
end
function destroy();
begin
if FPtr and fdest then
@@ -591,12 +602,12 @@ type cef_string_map_t = class()
end
end
{$ifdef linux}
type cef_main_args_t=class(tslcstructureobj)
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)));
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(("argc","int",0),("argv","intptr",0)),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -608,12 +619,12 @@ type cef_main_args_t=class(tslcstructureobj)
property argv index "argv" read _getvalue_ write _setvalue_;
end
{$else}
type cef_main_args_t=class(tslcstructureobj)
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)));
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(("instance","intptr",0)),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -625,7 +636,7 @@ type cef_main_args_t=class(tslcstructureobj)
end
{$endif}
type cef_basetime_t = class(tslcstructureobj) //32bit 可能有问题需要修正
type cef_basetime_t = class(t_cef_stc_base) //32bit 可能有问题需要修正
function create(ptr);
begin
inherited create(getstruct(),ptr);
@@ -635,16 +646,16 @@ type cef_basetime_t = class(tslcstructureobj) //32bit
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(("val","intptr",0)));
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(tslcstructureobj)
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());
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(getbasestruct(),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -674,7 +685,7 @@ type cef_base_ref_counted_t=class(tslcstructureobj)
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(tslcstructureobj)
type cef_contain_base = class(t_cef_stc_base)
private
FBase;
fbptr;
@@ -702,7 +713,7 @@ type cef_contain_base = class(tslcstructureobj)
begin
if not SSTRUCT then
begin
SSTRUCT := MemoryAlignmentCalculate(structdescribe());
SSTRUCT := MemoryAlignmentCalculate(structdescribe(),nil,nil,C_CEF_PACK);
end
return SSTRUCT;
end
@@ -1958,7 +1969,7 @@ type cef_frame_handler_t=class(cef_handler_base)
begin
return call(c,self(true),
cef_object_get(browser,class(cef_browser_t)),
cef_object_get(old_frame,class(cef_frame_t)),
(old_frame?cef_object_get(old_frame,class(cef_frame_t)):0),
cef_object_get(new_frame,class(cef_frame_t))
);
end
@@ -2747,7 +2758,7 @@ type cef_keyboard_handler_t=class(cef_handler_base)
end
end
end
type cef_key_event_t=class(tslcstructureobj)
type cef_key_event_t=class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
@@ -2760,7 +2771,7 @@ type cef_key_event_t=class(tslcstructureobj)
("is_system_key","int",0),
("character","short",0),
("unmodified_character","short",0),
("focus_on_editable_field","int",0)));
("focus_on_editable_field","int",0)),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -3300,7 +3311,7 @@ type cef_post_data_t=class(cef_contain_base)
("get_elements","intptr",0),
("remove_element","intptr",0),
("add_element","intptr",0),
("remove_elements","intptr",0)));
("remove_elements","intptr",0)),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -3598,6 +3609,32 @@ type cef_command_line_t=class(cef_contain_base)
/// 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());
@@ -3614,6 +3651,54 @@ type cef_command_line_t=class(cef_contain_base)
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;
@@ -3657,12 +3742,11 @@ type cef_app_t=class(cef_contain_base) //cef_app_capi.h
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
echo "\r\non_before_command_line_processing_i";
c := getcallback(functionname());
if c then
begin
return call(c,self(true),
(new cef_string_t(process)).str,
(process?((new cef_string_t(process)).str):""),
new cef_command_line_t(cmd)
);
end
@@ -3673,7 +3757,7 @@ type cef_app_t=class(cef_contain_base) //cef_app_capi.h
// property get_render_process_handler index "get_render_process_handler" read _getvalue_ write _setvalue_;
end
type cef_bounds_t = class(tslcstructureobj)
type cef_bounds_t = class(t_cef_stc_base)
private
static SSTRUCT;
class function getstruct()
@@ -3683,7 +3767,7 @@ type cef_bounds_t = class(tslcstructureobj)
("y","int",0),
("width","int",0),
("height","int",0)
));
),nil,nil,C_CEF_PACK);
return SSTRUCT;
end
public
@@ -3714,7 +3798,10 @@ type cef_window_info_t=class(cef_contain_base)
{$endif}
("bounds","user",getcefboundsstruct()),
("parent_window","intptr",0),
("menu","intptr",0),
{$ifdef linux}
{$else}
("menu","intptr",0),
{$endif}
("windowless_rendering_enabled","int",0),
("shared_texture_enabled","int",0),
("external_begin_frame_enabled","int",0),
@@ -3754,11 +3841,12 @@ type cef_window_info_t=class(cef_contain_base)
inherited ;
end
property ex_style index "ex_style" read _getvalue_ write _setvalue_;
property window_name index "window_name" read getcefstrmenber write setcefstrmenber;
property style index "style" read _getvalue_ write _setvalue_;
property bounds read getbounds;
property parent_window index "parent_window" 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_;
@@ -3769,6 +3857,7 @@ type cef_settings_t=class(cef_contain_base) //cef_types.h
function structdescribe();override;
begin
/////////////////120.1.8/////////////////////
if cef_version_info(0)>119 then
return array(
("size","intptr",0),
("no_sandbox","int",1),
@@ -3789,7 +3878,7 @@ type cef_settings_t=class(cef_contain_base) //cef_types.h
("locale","user",getcefstr16struct()),
("log_file","user",getcefstr16struct()),
("log_severity","int",3),
("log_items","int",3),
("log_items","int",0),
("javascript_flags","user",getcefstr16struct()),
("resources_dir_path","user",getcefstr16struct()),
("locales_dir_path","user",getcefstr16struct()),
@@ -3842,7 +3931,7 @@ type cef_settings_t=class(cef_contain_base) //cef_types.h
function aftercreate(flg);override;
begin
size := memsize();
locale := "ZH-CH";
//locale := "ZH-CH";
end
public
function create(ptr)
@@ -3852,39 +3941,44 @@ type cef_settings_t=class(cef_contain_base) //cef_types.h
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 _getvalue_ write _setvalue_;
property main_bundle_path index "main_bundle_path" read _getvalue_ write _setvalue_;
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 _getvalue_ write _setvalue_;
property user_data_path index "user_data_path" read _getvalue_ write _setvalue_;
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 _getvalue_ write _setvalue_;
property user_agent_product index "user_agent_product" 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 javascript_flags index "javascript_flags" read _getvalue_ write _setvalue_;
property resources_dir_path index "resources_dir_path" 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 _getvalue_ write _setvalue_;
property cookieable_schemes_list index "cookieable_schemes_list" 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
@@ -3959,17 +4053,17 @@ type cef_browser_settings_t=class(cef_contain_base) //cef_types.h
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 _getvalue_ write _setvalue_;
property fixed_font_family index "fixed_font_family" read _getvalue_ write _setvalue_;
property serif_font_family index "serif_font_family" read _getvalue_ write _setvalue_;
property sans_serif_font_family index "sans_serif_font_family" read _getvalue_ write _setvalue_;
property cursive_font_family index "cursive_font_family" read _getvalue_ write _setvalue_;
property fantasy_font_family index "fantasy_font_family" 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 _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_;
@@ -3983,8 +4077,9 @@ type cef_browser_settings_t=class(cef_contain_base) //cef_types.h
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 _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_client_t=class(cef_contain_base) //cef_client_capi.h
private