"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "app/formmain_py_api.inc" between
CudaText-1.92.0.tar.gz and CudaText-1.93.0.tar.gz

About: CudaText is a cross-platform text editor (written in Lazarus).

formmain_py_api.inc  (CudaText-1.92.0):formmain_py_api.inc  (CudaText-1.93.0)
skipping to change at line 153 skipping to change at line 153
Strs:= Ed.Strings; Strs:= Ed.Strings;
NLen:= Strs.Count; NLen:= Strs.Count;
Result:= PyList_New(NLen); Result:= PyList_New(NLen);
for i:= 0 to NLen-1 do for i:= 0 to NLen-1 do
begin begin
PyList_SetItem(Result, i, PyBool_FromLong(Ord(Strs.LinesUpdated[i]))); PyList_SetItem(Result, i, PyBool_FromLong(Ord(Strs.LinesUpdated[i])));
end; end;
end; end;
end; end;
function AppEmmetOptions(const ASyntax: string): TExpandOptions;
begin
FillChar(Result, SizeOf(Result), 0);
Result.AlwaysAddNewLine:= ASyntax = 'xml';
Result.AddSlashToEmptyTags:= UiOps.Emmet_AddSlashToEmptyTags;
Result.CommentTags:= UiOps.Emmet_CommentTags;
Result.IndentChilds:= UiOps.Emmet_IndentNested;
Result.SingleLine:= UiOps.Emmet_SingleLine;
Result.TabSize:= EditorOps.OpTabSize;
Result.TrimLineMarkers:= UiOps.Emmet_TrimLineMarkers;
Result.Wordwrap:= UiOps.Emmet_WordWrap;
Result.WordwrapAt:= EditorOps.OpMarginFixed;
end;
function Py_emmet(Self, Args: PPyObject): PPyObject; cdecl; function Py_emmet(Self, Args: PPyObject): PPyObject; cdecl;
var var
Id: integer; Id: integer;
PtrText, Ptr1, Ptr2: PChar; PtrText, Ptr1, Ptr2: PChar;
StrText, Str1, Str2: string; StrText, Str1, Str2: string;
var var
dir, filenameSnips, filenameLorem, dir, filenameSnips, filenameLorem,
SSection: string; SSection: string;
bMulLine: boolean; bMulLine: boolean;
NPos, NRes: integer; NPos, NRes: integer;
skipping to change at line 184 skipping to change at line 198
filenameSnips:= dir+DirectorySeparator+'emmet_snippets.ini'; filenameSnips:= dir+DirectorySeparator+'emmet_snippets.ini';
filenameLorem:= dir+DirectorySeparator+'emmet_lorem.txt'; filenameLorem:= dir+DirectorySeparator+'emmet_lorem.txt';
if not FileExistsUTF8(filenameSnips) then exit(ReturnNone); if not FileExistsUTF8(filenameSnips) then exit(ReturnNone);
if not FileExistsUTF8(filenameLorem) then exit(ReturnNone); if not FileExistsUTF8(filenameLorem) then exit(ReturnNone);
AppEmmet:= TEmmet.Create(filenameSnips, filenameLorem); AppEmmet:= TEmmet.Create(filenameSnips, filenameLorem);
end; end;
case Id of case Id of
EMMET_EXPAND: EMMET_EXPAND:
begin begin
StrText:= AppEmmet.ExpandAbbreviation(StrText, Str1, '', SSection, bMu StrText:= AppEmmet.ExpandAbbreviation(
lLine); StrText,
Str1,
'',
SSection,
bMulLine,
AppEmmetOptions(Str1)
);
StrText:= StringReplace(StrText, #13#10, #10, [rfReplaceAll]); StrText:= StringReplace(StrText, #13#10, #10, [rfReplaceAll]);
Result:= Py_BuildValue('(sO)', Result:= Py_BuildValue('(sO)',
PChar(StrText), PChar(StrText),
PyBool_FromLong(Ord(bMulLine)) PyBool_FromLong(Ord(bMulLine))
); );
end; end;
EMMET_WRAP: EMMET_WRAP:
begin begin
Str2:= StringReplace(Str2, #10, #13#10, [rfReplaceAll]); Str2:= StringReplace(Str2, #10, #13#10, [rfReplaceAll]);
StrText:= AppEmmet.ExpandAbbreviation(StrText, Str1, Str2, SSection, b StrText:= AppEmmet.ExpandAbbreviation(
MulLine); StrText,
Str1,
Str2,
SSection,
bMulLine,
AppEmmetOptions(Str1)
);
StrText:= StringReplace(StrText, #13#10, #10, [rfReplaceAll]); StrText:= StringReplace(StrText, #13#10, #10, [rfReplaceAll]);
Result:= PyString_FromString(PChar(StrText)); Result:= PyString_FromString(PChar(StrText));
end; end;
EMMET_GET_POS: EMMET_GET_POS:
begin begin
NPos:= StrToIntDef(Str1, -1); NPos:= StrToIntDef(Str1, -1);
if StrText='' then if StrText='' then
exit(ReturnNone); exit(ReturnNone);
if NPos<=0 then if NPos<=0 then
skipping to change at line 2572 skipping to change at line 2600
var var
NOps: integer; NOps: integer;
PtrTitle: PChar; PtrTitle: PChar;
StrTitle, Str: string; StrTitle, Str: string;
begin begin
with GetPythonEngine do with GetPythonEngine do
if Bool(PyArg_ParseTuple(Args, 'is:dlg_commands', @NOps, @PtrTitle)) then if Bool(PyArg_ParseTuple(Args, 'is:dlg_commands', @NOps, @PtrTitle)) then
begin begin
StrTitle:= string(PtrTitle); StrTitle:= string(PtrTitle);
fmMain.UpdateKeymapDynamicItems(categ_Lexer);
fmMain.UpdateKeymapDynamicItems(categ_OpenedFile); fmMain.UpdateKeymapDynamicItems(categ_OpenedFile);
fmMain.UpdateKeymapDynamicItems(categ_RecentFile); fmMain.UpdateKeymapDynamicItems(categ_RecentFile);
Str:= fmMain.DoDialogCommands_Py( Str:= fmMain.DoDialogCommands_Py(
(NOps and COMMANDS_USUAL)<>0, (NOps and COMMANDS_USUAL)<>0,
(NOps and COMMANDS_PLUGINS)<>0, (NOps and COMMANDS_PLUGINS)<>0,
(NOps and COMMANDS_LEXERS)<>0, (NOps and COMMANDS_LEXERS)<>0,
(NOps and COMMANDS_FILES)<>0, (NOps and COMMANDS_FILES)<>0,
(NOps and COMMANDS_RECENTS)<>0, (NOps and COMMANDS_RECENTS)<>0,
(NOps and COMMANDS_CONFIG)<>0, (NOps and COMMANDS_CONFIG)<>0,
skipping to change at line 3946 skipping to change at line 3975
Result:= ReturnNone; Result:= ReturnNone;
end; end;
APP_PROC_SET_CLIP_ALT: APP_PROC_SET_CLIP_ALT:
begin begin
SClipboardCopy(Str, PrimarySelection); //for Linux SClipboardCopy(Str, PrimarySelection); //for Linux
Result:= ReturnNone; Result:= ReturnNone;
end; end;
APP_PROC_GET_COMMANDS: APP_PROC_GET_COMMANDS:
begin begin
fmMain.UpdateKeymapDynamicItems(categ_Lexer);
fmMain.UpdateKeymapDynamicItems(categ_OpenedFile); fmMain.UpdateKeymapDynamicItems(categ_OpenedFile);
fmMain.UpdateKeymapDynamicItems(categ_RecentFile); fmMain.UpdateKeymapDynamicItems(categ_RecentFile);
Result:= Py_CommandList; Result:= Py_CommandList;
end; end;
APP_PROC_SAVE_SESSION: APP_PROC_SAVE_SESSION:
begin begin
ParamBool:= fmMain.DoOps_SaveSession(Str); ParamBool:= fmMain.DoOps_SaveSession(Str);
Result:= PyBool_FromLong(Ord(ParamBool)); Result:= PyBool_FromLong(Ord(ParamBool));
end; end;
skipping to change at line 4728 skipping to change at line 4758
try try
DoLexerEnum(List, AppStrToBool(StrValue)); DoLexerEnum(List, AppStrToBool(StrValue));
Result:= StringsToPyList(List); Result:= StringsToPyList(List);
finally finally
FreeAndNil(List); FreeAndNil(List);
end; end;
end; end;
LEXER_REREAD_LIB: LEXER_REREAD_LIB:
begin begin
fmMain.DoOps_LoadLexerLib; fmMain.DoOps_LoadLexerLib(false);
Result:= ReturnNone; Result:= ReturnNone;
end; end;
else else
Result:= ReturnNone; Result:= ReturnNone;
end; end;
end; end;
end; end;
function Py_ed_convert(Self, Args: PPyObject): PPyObject; cdecl; function Py_ed_convert(Self, Args: PPyObject): PPyObject; cdecl;
skipping to change at line 5744 skipping to change at line 5774
function Py_tree_proc(Self, Args: PPyObject): PPyObject; cdecl; function Py_tree_proc(Self, Args: PPyObject): PPyObject; cdecl;
var var
IdTree, IdItem: Int64; IdTree, IdItem: Int64;
IdAction, NIndex, NImageIndex: integer; IdAction, NIndex, NImageIndex: integer;
Pnt1, Pnt2: TPoint; Pnt1, Pnt2: TPoint;
PtrText: PChar; PtrText: PChar;
StrText: string; StrText: string;
TreeCont: TAppTreeContainer; TreeCont: TAppTreeContainer;
TreeNode, Node1: TTreeNode; TreeNode, Node1: TTreeNode;
ItemList: TList; ItemList: TFPList;
Sep: TATStringSeparator; Sep: TATStringSeparator;
i: integer; i: integer;
begin begin
with GetPythonEngine do with GetPythonEngine do
if Bool(PyArg_ParseTuple(Args, 'LiLisi:tree_proc', @IdTree, @IdAction, @IdIt em, @NIndex, @PtrText, @NImageIndex)) then if Bool(PyArg_ParseTuple(Args, 'LiLisi:tree_proc', @IdTree, @IdAction, @IdIt em, @NIndex, @PtrText, @NImageIndex)) then
begin begin
StrText:= string(PtrText); StrText:= string(PtrText);
TreeCont:= TAppTreeContainer(PtrInt(IdTree)); TreeCont:= TAppTreeContainer(PtrInt(IdTree));
TreeNode:= TTreeNode(PtrInt(IdItem)); TreeNode:= TTreeNode(PtrInt(IdItem));
case IdAction of case IdAction of
TREE_ITEM_ENUM: TREE_ITEM_ENUM:
begin begin
if Assigned(TreeNode) then if Assigned(TreeNode) then
Node1:= TreeNode.GetFirstChild Node1:= TreeNode.GetFirstChild
else else
Node1:= TreeCont.Tree.Items.GetFirstNode; Node1:= TreeCont.Tree.Items.GetFirstNode;
if Node1=nil then exit(ReturnNone); if Node1=nil then exit(ReturnNone);
ItemList:= TList.Create; ItemList:= TFPList.Create;
try try
repeat repeat
ItemList.Add(Node1); ItemList.Add(Node1);
Node1:= TreeNode.GetNextChild(Node1); Node1:= TreeNode.GetNextChild(Node1);
until Node1=nil; until Node1=nil;
Result:= PyList_New(ItemList.Count); Result:= PyList_New(ItemList.Count);
if not Assigned(Result) then if not Assigned(Result) then
raise EPythonError.Create(msgPythonListError); raise EPythonError.Create(msgPythonListError);
for i:= 0 to ItemList.Count-1 do for i:= 0 to ItemList.Count-1 do
 End of changes. 8 change blocks. 
7 lines changed or deleted 35 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)