DISCLAIMER: I'm not a license specialist, and my reply is in no way
authoritative, but I hope it may help...

Sparkaround wrote:

> If I create a widget Test_Text_Display which is subclassed from
> Fl_Text_Display, will it constitute a derivative work as fltk's Software
> License?

Subclassing, as it is usually done, is not a derivative work in
FLTK's licensing.

However, copying code is generally not allowed, otherwise it *will*
be a derivative work, and IMHO all the (L)GPL rules apply (your own
code will also need the (L)GPL license).

However, see below...

> The implementation of Test_Text_Display may like this:
> class My_Text:public My_Text_Display
> {
>   public:
>    ...
>    void draw();//modified
>    void draw_string(...);//modified

This (above) may be problematic.

>    void old_draw(...);//only copy code
>    void draw_text(...);//only copy code
>    void draw_vline(...);//only copy code

Don't *copy* code (see below).

>    ...
> };
>
> void Test_Text_Display::draw()
> {
>    ...
>    old_draw();
>    ...
> }

No problem, if "..." is your own code.
old_draw() could be replaced with Fl_Text_Display::draw().

> void Test_Text_Display::old_draw()
> {
> //full copy of Fl_Text_Display::draw() in Fl_Text_Display.cxx
> }

Don't do that. You don't need old_draw(), because you can call
Fl_Text_Display::draw() as mentioned above.

> void Test_Text_Display::draw_text()
> {
> //full copy of Fl_Text_Display::draw_text().
> //The same code as the one in Fl_Text_Display.cxx.
> }
> void Test_Text_Display::draw_vline(...)
> {
> //full copy from fltk's source code without modification as above
> }

You don't need this. It's there already by inheritance.

> void Test_Text_Display::draw_string(...)
> {
> //part of copy of the original Fl_Text_Display::draw_string(...).
> //Do some modification, such as remove "clear_rect"
> ...
> }
>
> That is to say, draw_string() was modified based on the original one in
> Fl_Text_Display.cxx , and all functions that call draw_string from the
> original draw() was copied from Fl_Text_display to Test_Text_Display
> without modification.

That would IMHO classify your code as a derivative work. You copied
and modified FLTK code. But there is maybe another way.

> I noticed that there is an exception in fltk's Software License:
> "2.Widgets that are subclassed from FLTK widgets do not constitute a
> derivative work."
>
> Does implementation of Test_Text_Display like above constitute a
> derivative work?

IMHO, yes.

However, again IMHO(!), you could also modify the FLTK library itself
and link your application with this modified library. In this case
you would have to provide the FLTK source code modifications to your
users (or customers), but the modified library would still be LGPL.
Then you can link your application with this modified library.

But again, I'm not a license specialist and not a lawyer. This may well
be wrong.

Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to