编辑器

修改拼写
This commit is contained in:
JianjunLiu 2023-03-06 17:48:40 +08:00
parent 25e7c91b64
commit dc98618d53
4 changed files with 323 additions and 6 deletions

View File

@ -164,7 +164,7 @@ begin
bkcl := k1.openKeyA("Directory\\Background\\shell\\tslediter\\command"); bkcl := k1.openKeyA("Directory\\Background\\shell\\tslediter\\command");
if bkcl then bkcl.SetValueStringA(nil,SysExecName()); if bkcl then bkcl.SetValueStringA(nil,SysExecName());
bkcl := k1.openKeyA("Directory\\Background\\shell\\tslediter"); bkcl := k1.openKeyA("Directory\\Background\\shell\\tslediter");
bkcl.SetValueStringA(nil,"TSL Editer"); bkcl.SetValueStringA(nil,"TSL Editor");
if bkcl then bkcl.SetValueStringA("Icon",SysExecName()); if bkcl then bkcl.SetValueStringA("Icon",SysExecName());
echo "register tslediter ok ~~"; echo "register tslediter ok ~~";
end end

View File

@ -36,6 +36,29 @@ type cef_point_t = class(tslcstructureobj)
property x index 0 read _getvalue_ write _setvalue_; property x index 0 read _getvalue_ write _setvalue_;
property y index 1 read _getvalue_ write _setvalue_; property y index 1 read _getvalue_ write _setvalue_;
end end
type cef_mouse_event_t = class(tslcstructureobj)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(
array(
(0,"int",0),
(1,"int",0),
(2,"int",0)
));
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(tslcstructureobj) type cef_popup_features_t = class(tslcstructureobj)
private private
static SSTRUCT; static SSTRUCT;
@ -237,6 +260,7 @@ type TTSLProcessMsg =class(tslcstructureobj)
property proc index "proc" read _getvalue_ write _setvalue_; property proc index "proc" read _getvalue_ write _setvalue_;
end end
type cef_string_t=class(tslcstructureobj) type cef_string_t=class(tslcstructureobj)
fdest; fdest;
function setansi(s); function setansi(s);
@ -413,6 +437,83 @@ type cef_string_list_t = class()
private private
FPtr; FPtr;
end 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 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;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";
end
type cef_main_args_t=class(tslcstructureobj) type cef_main_args_t=class(tslcstructureobj)
private private
@ -606,15 +707,16 @@ type cef_contain_base = class(tslcstructureobj)
FTSLCallbacks := array(); FTSLCallbacks := array();
flg := (ptr>0 or ptr<0); flg := (ptr>0 or ptr<0);
inherited create(getstruct(),ptr); inherited create(getstruct(),ptr);
//addref(_getptr_()); addref(_getptr_());
aftercreate(not flg); aftercreate(not flg);
savetoglobal(); savetoglobal();
end end
function destroy();override; function destroy();override;
begin begin
id := _getptr_(); id := _getptr_();
release(id);
inherited; inherited;
//release(id);
end end
property base read getbase; property base read getbase;
procedure addref(id:pointer);stdcall;virtual; procedure addref(id:pointer);stdcall;virtual;
@ -3449,6 +3551,21 @@ type cef_client_t=class(cef_contain_base)
if o then return o._getptr_(); if o then return o._getptr_();
end 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 _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
echo ">>>>>>>>>>>>>><<<<<<<<\r\n";
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,
message
);
end
end
end end
type cef_string_visitor_t=class(cef_contain_base) type cef_string_visitor_t=class(cef_contain_base)
private private
@ -4333,6 +4450,191 @@ type cef_process_message_t=class(cef_contain_base)
end end
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
end
type cef_frame_t=class(cef_contain_base) type cef_frame_t=class(cef_contain_base)
private private
function structdescribe();override; function structdescribe();override;
@ -4791,12 +5093,28 @@ type cef_browser_host_t=class(cef_contain_base)
//property was_resized index "was_resized" read _getvalue_ write _setvalue_; //property was_resized index "was_resized" read _getvalue_ write _setvalue_;
//property was_hidden index "was_hidden" 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_; //property notify_screen_info_changed index "notify_screen_info_changed" read _getvalue_ write _setvalue_;
//property invalidate index "invalidate" 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_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_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_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_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_; //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_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 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 notify_move_or_resize_started index "notify_move_or_resize_started" read _getvalue_ write _setvalue_;

View File

@ -641,10 +641,9 @@ type tcustomtabitem = class() //
@explan(说明)tab控件标签对象 %% @explan(说明)tab控件标签对象 %%
**} **}
private private
FPageCtrl;
FCaption; FCaption;
FVisible; FVisible;
FPageSheet; [weakref]FPageSheet;
function SetVisible(v);//设置可见 function SetVisible(v);//设置可见
begin begin
nv := v?true:false; nv := v?true:false;

Binary file not shown.