Recent

Author Topic: Wrapper to access Direct2D as usual Canvas?  (Read 997 times)

Alextp

  • Hero Member
  • *****
  • Posts: 714
    • UVviewsoft
Wrapper to access Direct2D as usual Canvas?
« on: October 05, 2018, 01:20:53 pm »
Does such wrapper exist: so I can apply it to CudaText, which paints complex picture on TCanvas, and it will give fake TCanvas, to use Direct2D on Windows?
(it must support TextOut, LineTo, FillRect, Rectangle...)

RAW

  • Hero Member
  • *****
  • Posts: 679
Re: Wrapper to access Direct2D as usual Canvas?
« Reply #1 on: October 20, 2018, 11:40:27 pm »
Maybe you can check the source code from Delphi 2010 and up ...  :)
Isn't there a D2D Canvas implemented ???
Windows 7 Pro (x64 Sp1) And Windows XP Pro (x86 Sp3) - LAZARUS 1.8.4 FPC 3.0.4 // 1.7 FPC 3.1.1

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6612
Re: Wrapper to access Direct2D as usual Canvas?
« Reply #2 on: October 21, 2018, 12:23:19 pm »
Well, looking at the delphi source disqualifies you for submitting anything to FPC and Lazarus, so let's not do that :-)

440bx

  • Sr. Member
  • ****
  • Posts: 379
Re: Wrapper to access Direct2D as usual Canvas?
« Reply #3 on: October 21, 2018, 02:31:20 pm »
Well, looking at the delphi source disqualifies you for submitting anything to FPC and Lazarus, so let's not do that :-)
Really ?... just looking at the source is enough to disqualify an individual from contributing to FPC and Lazarus ?...
I understand that no one wants a copy of a Delphi implementation of something to find its way into FPC or Lazarus but, learning from other code seem kosher as long as the new code isn't a copy of whatever the person learned from.

Where does the FPC/Lazarus team draw the line on that ?

I'm looking forward to being more informed on this.  Thanks.



Thaddy

  • Hero Member
  • *****
  • Posts: 7178
Re: Wrapper to access Direct2D as usual Canvas?
« Reply #4 on: October 21, 2018, 02:59:09 pm »
Really ?... just looking at the source is enough to disqualify an individual from contributing to FPC and Lazarus ?...

Yes. The unit header for e.g XE2 reads as follows:
Code: Pascal  [Select]
  1. {*******************************************************}
  2. {                                                       }
  3. {            Delphi Visual Component Library            }
  4. {                                                       }
  5. { Copyright(c) 1995-2011 Embarcadero Technologies, Inc. }
  6. {                                                       }
  7. {*******************************************************}
  8.  
  9. unit Vcl.Direct2D;
Which means I can not touch it, because I obviously have the sourcecode....
What can be done is clean-room reverse engineering its functionality.
In the past a lot of time and effort has gone into ensuring that FPC or Lazarus weren't in breach of copyright and loads of code have been re-implemented from scratch for that reason.

There are some Delphi's that contain an option to treat it as GPL (not this unit!), but even that is incompatible with LGPL+linker exception as used in both FPC libraries and Lazarus libraries. This requires you also to recompile the particular code with the GPL=true constant set from source.

Note that if you own - like me - a version of Delphi that comes with sourcecode, here XE2, this particular unit can be made to compile with FPC for personal use... O:-) 8-)

So the issue is not to provide the functionality, but providing the functionality without having seen the Delphi sourcecode. Which means writing it from documentation instead. Which many of us did (not me, I do not have a clean room - actually I have but that are the parts of the house the rest of the family have access to-. But I can spot the use of Delphi code and will report it on Mantis if I see it.)

And before you claim otherwise: this is a clear and stated policy by the developer teams. It is also conforming to international standards and laws. I remember this was a very long and intensive discussion and subsequent repair effort.

I am in no doubt core team can provide you with links and history.

Note that FPC can compile - apart from the system unit - the complete sourcecode of Delphi 5-6-7 rtl and most of VCL, as well as most of 2005-2010 with minor Delphi bug fixes. (read typo's, missing ';''s)
That makes the risks rather high that there is a copyright infringement in submitted code.

And that is what Marco is referring to.
« Last Edit: October 21, 2018, 04:02:02 pm by Thaddy »
inline variables like in D10.3 are a bit like Brexit: if you are given the wrong information it sounds like a good idea. Every kid loves candy, but it makes you fat and your teeth will disappear.