Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-03

For what {$IFDEF SYN_LAZARUS} in SynEdit?

8 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin
to Zaher Dirkey
Zaher Dirkey wrote
I found many of {$IFDEF SYN_LAZARUS} in SynEdit, my ask is SynEdit used outside Lazarus (like Delphi for example)?

they are a relict from another time....

They were once meant to mark all places were SynEdit in Lazarus changed from the original synedit.
But they do no longer work.

Only the SYN_LAZARUS version compiles, without it it will not even compile. I started remove them a year or 2 back, but never finished....

Martin

Zaher Dirkey
to Martin
Martin wrote 17 lines
On 30/03/2011 22:47, Zaher Dirkey wrote: > I found many of {$IFDEF SYN_LAZARUS} in SynEdit, my ask is SynEdit used > outside Lazarus (like Delphi for example)? > they are a relict from another time.... They were once meant to mark all places were SynEdit in Lazarus changed from the original synedit. But they do no longer work. Only the SYN_LAZARUS version compiles, without it it will not even compile. I started remove them a year or 2 back, but never finished.... Martin

Can i remove it, and send the patch?

Regards

Zaher Dirkey -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110331/2e997ad7/attachment.html>
Martin
to Zaher Dirkey
Zaher Dirkey wrote 23 lines
On Thu, Mar 31, 2011 at 12:21 AM, Martin < <mailto:>> wrote: On 30/03/2011 22:47, Zaher Dirkey wrote: I found many of {$IFDEF SYN_LAZARUS} in SynEdit, my ask is SynEdit used outside Lazarus (like Delphi for example)? they are a relict from another time.... They were once meant to mark all places were SynEdit in Lazarus changed from the original synedit. But they do no longer work. Only the SYN_LAZARUS version compiles, without it it will not even compile. I started remove them a year or 2 back, but never finished.... Martin Can i remove it, and send the patch?

yes, but...
do it in small bits, because I still need/want to review. And I am a bit low on time...

Also, if you do any other cleanup: do it in separate patches please

Obviously the functionality need no review, just checking for typos, or flipping the if and else part, etc (big operations like this, almost always introduce an error somewhere)
otherwise I had them all removed already

Also I want to check any bigger block (several lines / if still existing), if the code still serves as inspirations. But small bits, are fine.

If you want to clean up a particular bit, in order to start reading into the code, thats cool...

---
Actually, just thinking about, could be easiest to run a perl script over it.....

Martin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110331/3387956c/attachment.html>

Zaher Dirkey
to Martin

2011/3/31 Martin

Show quoted text 49 lines
On 31/03/2011 00:31, Zaher Dirkey wrote: On Thu, Mar 31, 2011 at 12:21 AM, Martin wrote: > On 30/03/2011 22:47, Zaher Dirkey wrote: > >> I found many of {$IFDEF SYN_LAZARUS} in SynEdit, my ask is SynEdit used >> outside Lazarus (like Delphi for example)? >> > they are a relict from another time.... > > They were once meant to mark all places were SynEdit in Lazarus changed > from the original synedit. > But they do no longer work. > > Only the SYN_LAZARUS version compiles, without it it will not even > compile. > I started remove them a year or 2 back, but never finished.... > > Martin > > Can i remove it, and send the patch? yes, but... do it in small bits, because I still need/want to review. And I am a bit low on time... Also, if you do any other cleanup: do it in separate patches please Obviously the functionality need no review, just checking for typos, or flipping the if and else part, etc (big operations like this, almost always introduce an error somewhere) otherwise I had them all removed already Also I want to check any bigger block (several lines / if still existing), if the code still serves as inspirations. But small bits, are fine. If you want to clean up a particular bit, in order to start reading into the code, thats cool... --- Actually, just thinking about, could be easiest to run a perl script over it..... Martin

Ok, i will do it in small patches, i prefer use my hand for more be carefully clean it up.

Zaher Dirkey -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110331/c8713295/attachment.html>
Zaher Dirkey
to Martin: yes, but... do it in small bits, because I still need/want to review. And I am a bit low…

2011/3/31 Martin

Show quoted text 56 lines
On 31/03/2011 00:31, Zaher Dirkey wrote: On Thu, Mar 31, 2011 at 12:21 AM, Martin wrote: > On 30/03/2011 22:47, Zaher Dirkey wrote: > >> I found many of {$IFDEF SYN_LAZARUS} in SynEdit, my ask is SynEdit used >> outside Lazarus (like Delphi for example)? >> > they are a relict from another time.... > > They were once meant to mark all places were SynEdit in Lazarus changed > from the original synedit. > But they do no longer work. > > Only the SYN_LAZARUS version compiles, without it it will not even > compile. > I started remove them a year or 2 back, but never finished.... > > Martin > > Can i remove it, and send the patch? yes, but... do it in small bits, because I still need/want to review. And I am a bit low on time... Also, if you do any other cleanup: do it in separate patches please Obviously the functionality need no review, just checking for typos, or flipping the if and else part, etc (big operations like this, almost always introduce an error somewhere) otherwise I had them all removed already Also I want to check any bigger block (several lines / if still existing), if the code still serves as inspirations. But small bits, are fine. If you want to clean up a particular bit, in order to start reading into the code, thats cool... --- Actually, just thinking about, could be easiest to run a perl script over it..... Martin -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Hi, i started to cleanup

http://bugs.freepascal.org/view.php?id=19215

Please check this lines in SynTextDrawer

procedure TheFontStock.SetStyle(Value: TFontStyles);
// ASSERT(idx <= High(TheStockFontPatterns)); //Check this line

SY
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110422/13e55aa3/attachment.html>

Martin
to Zaher Dirkey
Show quoted text 13 lines
http://bugs.freepascal.org/view.php?id=19215 Please check this lines in SynTextDrawer procedure TheFontStock.SetStyle(Value: TFontStyles); // ASSERT(idx <= High(TheStockFontPatterns)); //Check this line SY Zaher Dirkey

I will look at it in due course.

In case... your clean up may be so you can add features later; and seeing you gone for TextDrawer first.

If you want to add features around drawing, here are a few of my ideas (all without any idea when..., just distant ideas)

1) Introduction of a TSynCanvas
- More or less to wrap the TSynEdit.Handle
- The class could be known by other classes in SynEdit (without circle references) and would be used for any Invalidate, invalidateLines, invalidateRect request.
- Maybe also for painting, so painting is in an event, and the handle is passed in by the caller.
Also painting is done from other classes, more below

2) Introduction of a TSynViewPort (or TsynEditViewPort) represents the textarea (as opposed to gutter).
SynEdit takes care of the layout (eg Gutter AlLeft, ViewPort alClient...), and the classes are responsible for the painting, (using TsynCanvas, and the arguments to the paint event)

TSynViewPort will also be responsible to store TopLine, LeftChar, LinesInWindow, CharsInWindow
TSynViewPort would still use TextDrawer, but some stuff may move...

----
Ideally this would even allow to have none LCL versions, like fpgui, msegui, or delphi... => but that is a long way

You are af course invited to bring up your ideas too.

Zaher Dirkey
to Martin
Martin wrote 24 lines
> http://bugs.freepascal.org/view.php?id=19215 > > Please check this lines in SynTextDrawer > > procedure TheFontStock.SetStyle(Value: TFontStyles); > > // ASSERT(idx <= High(TheStockFontPatterns)); //Check this line > > > SY > Zaher Dirkey > > I will look at it in due course. In case... your clean up may be so you can add features later; and seeing you gone for TextDrawer first. If you want to add features around drawing, here are a few of my ideas (all without any idea when..., just distant ideas)

The real reason to choose TextDrawer it is simple to start, and i have problem with my highlighter printing the text, my bug not catches yet.

Show quoted text 27 lines
1) Introduction of a TSynCanvas - More or less to wrap the TSynEdit.Handle - The class could be known by other classes in SynEdit (without circle references) and would be used for any Invalidate, invalidateLines, invalidateRect request. - Maybe also for painting, so painting is in an event, and the handle is passed in by the caller. Also painting is done from other classes, more below 2) Introduction of a TSynViewPort (or TsynEditViewPort) represents the textarea (as opposed to gutter). SynEdit takes care of the layout (eg Gutter AlLeft, ViewPort alClient...), and the classes are responsible for the painting, (using TsynCanvas, and the arguments to the paint event) TSynViewPort will also be responsible to store TopLine, LeftChar, LinesInWindow, CharsInWindow TSynViewPort would still use TextDrawer, but some stuff may move... ---- Ideally this would even allow to have none LCL versions, like fpgui, msegui, or delphi... => but that is a long way You are af course invited to bring up your ideas too.

It is need more understand the SynEdit and more discusses, I also have some feature like to have it in the SynEdit.

Thanks

Zaher Dirkey -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20110422/6ddc72bc/attachment.html>