August 07, 2006
Hello everyone,

as promised, I have put a first attempt at D-FLTK onto our Subversion system. The test application "hello" runs already on OS X.

Everyone interested, please feel free to download, play, improve and comment! You can send patches to me directly. You can also join the general fltk newsgroup and discuss D-FLTK there (until the C++ folks complain about too much traffic ;-)

Anyway, I hop ya'll enjoy and don't get scared by my "D" style.


Here's how you get the source:


svn co http://svn.easysw.com/public/fltk/fltk/branches/branch-D-1.1 d-fltk-1.1.x


All "D" sources are in - um - "D". The rest of the FLTK archive is intact to make it easy to compare "D" and "C++" code.

Matthias
August 07, 2006
MatthiasM wrote:

> as promised, I have put a first attempt at D-FLTK onto our Subversion system. The test application "hello" runs already on OS X.

Looking good! Ran into some minor problems with GDC 0.19:
fl/mac.d:295: shadowing declaration fl.mac.Fl_X.make.w is deprecated
fl/mac.d:1253: shadowing declaration fl.mac.do_queued_events.ret is deprecated

But they were easy enough to work around by renaming them:
http://www.algonet.se/~afb/d/fltk-mac-5282.patch


No way to quit the app but to force-quit it, but looks OK:
http://www.algonet.se/~afb/d/hello-fltk-mac.png

Great work anyway! And since it is LGPL, you can take Mac code
from the similarly licensed GTK and wxWidgets projects as needed.


BTW; Don't you want to version it "Carbon" rather than "Apple" ?
And I'd put the headers in std.c.macosx instead of std.c.osx...

And there are some Makefiles snippets in wxD, if you want to make
application bundles - rather than play around with resource forks.

--anders
August 07, 2006
Anders F Björklund wrote:
> MatthiasM wrote:
> 
>> as promised, I have put a first attempt at D-FLTK onto our Subversion system. The test application "hello" runs already on OS X.
> 
> Looking good! Ran into some minor problems with GDC 0.19:
> fl/mac.d:295: shadowing declaration fl.mac.Fl_X.make.w is deprecated
> fl/mac.d:1253: shadowing declaration fl.mac.do_queued_events.ret is deprecated

Thanks. I am still using 0.18. I will probably be able to upgrade tonight.

> No way to quit the app but to force-quit it, but looks OK:

True. The internal messaging in FLTK is yet to be implemented. No OS dependent code though, makes porting easy and quick.

> Great work anyway! And since it is LGPL, you can take Mac code
> from the similarly licensed GTK and wxWidgets projects as needed.

Yes, the OS X code is anything but nice. It was already a pretty brute force port from MacOS8 (!). As soon as the FLTK code itself is ported (1:1 right now), I will start improving the OS X implementation.

> BTW; Don't you want to version it "Carbon" rather than "Apple" ?
> And I'd put the headers in std.c.macosx instead of std.c.osx...

Good point.

> And there are some Makefiles snippets in wxD, if you want to make
> application bundles - rather than play around with resource forks.

Thanks. I have not spent any time whatsoever on Makefiles. Hoping that someone who is smarter than myself can do a Makefile that would work on all platforms.

Thanks for testing!

Matthias
August 07, 2006
MatthiasM wrote:
> Anders F Björklund wrote:
>> MatthiasM wrote:
>>
>>> as promised, I have put a first attempt at D-FLTK onto our Subversion system. The test application "hello" runs already on OS X.
>>
>> Looking good! Ran into some minor problems with GDC 0.19:
>> fl/mac.d:295: shadowing declaration fl.mac.Fl_X.make.w is deprecated
>> fl/mac.d:1253: shadowing declaration fl.mac.do_queued_events.ret is deprecated
> 
> Thanks. I am still using 0.18. I will probably be able to upgrade tonight.
> 
>> No way to quit the app but to force-quit it, but looks OK:
> 
> True. The internal messaging in FLTK is yet to be implemented. No OS dependent code though, makes porting easy and quick.
> 
>> Great work anyway! And since it is LGPL, you can take Mac code
>> from the similarly licensed GTK and wxWidgets projects as needed.
> 
> Yes, the OS X code is anything but nice. It was already a pretty brute force port from MacOS8 (!). As soon as the FLTK code itself is ported (1:1 right now), I will start improving the OS X implementation.
> 
>> BTW; Don't you want to version it "Carbon" rather than "Apple" ?
>> And I'd put the headers in std.c.macosx instead of std.c.osx...
> 
> Good point.
> 
>> And there are some Makefiles snippets in wxD, if you want to make
>> application bundles - rather than play around with resource forks.
> 
> Thanks. I have not spent any time whatsoever on Makefiles. Hoping that someone who is smarter than myself can do a Makefile that would work on all platforms.
> 
> Thanks for testing!
> 
> Matthias

Have you checked out build? http://www.dsource.org/projects/build
August 07, 2006
clayasaurus wrote:

>>> And there are some Makefiles snippets in wxD, if you want to make
>>> application bundles - rather than play around with resource forks.
>>
>> Thanks. I have not spent any time whatsoever on Makefiles. Hoping that someone who is smarter than myself can do a Makefile that would work on all platforms.
> 
> Have you checked out build? http://www.dsource.org/projects/build

It's not so much the tool used (Make vs. Build), as it is two ways
of packaging software for the inheritely "dual" Mac OS X platform.

You can either do it the Mac OS way (with resources), or you can
do it the NeXT way (with bundles), the system supports both ways.


I wrote in some more detail about it on the CodeBlocks wiki:
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Mac_OS_X#Bundle_application_for_Mac

You need to do either, after compiling a binary/exe ("as usual").
Otherwise applications will launch in the background, no events.

--anders
August 07, 2006
clayasaurus wrote:
> MatthiasM wrote:
>> Anders F Björklund wrote:
>>> MatthiasM wrote:
>>>
>>>> as promised, I have put a first attempt at D-FLTK onto our Subversion system. The test application "hello" runs already on OS X.
>>>
>>> Looking good! Ran into some minor problems with GDC 0.19:
>>> fl/mac.d:295: shadowing declaration fl.mac.Fl_X.make.w is deprecated
>>> fl/mac.d:1253: shadowing declaration fl.mac.do_queued_events.ret is deprecated
>>
>> Thanks. I am still using 0.18. I will probably be able to upgrade tonight.
>>
>>> No way to quit the app but to force-quit it, but looks OK:
>>
>> True. The internal messaging in FLTK is yet to be implemented. No OS dependent code though, makes porting easy and quick.
>>
>>> Great work anyway! And since it is LGPL, you can take Mac code
>>> from the similarly licensed GTK and wxWidgets projects as needed.
>>
>> Yes, the OS X code is anything but nice. It was already a pretty brute force port from MacOS8 (!). As soon as the FLTK code itself is ported (1:1 right now), I will start improving the OS X implementation.
>>
>>> BTW; Don't you want to version it "Carbon" rather than "Apple" ?
>>> And I'd put the headers in std.c.macosx instead of std.c.osx...
>>
>> Good point.
>>
>>> And there are some Makefiles snippets in wxD, if you want to make
>>> application bundles - rather than play around with resource forks.
>>
>> Thanks. I have not spent any time whatsoever on Makefiles. Hoping that someone who is smarter than myself can do a Makefile that would work on all platforms.
>>
>> Thanks for testing!
>>
>> Matthias
> 
> Have you checked out build? http://www.dsource.org/projects/build

IMHO, build is great and all, but I think we're better off w/ Make to start with because it doesn't require another download, etc. It'd be a pity to have to support more than one build method at this early stage (Make should do the job fine) I think.
August 07, 2006
MatthiasM escribió:
> 
> Hello everyone,
> 
> as promised, I have put a first attempt at D-FLTK onto our Subversion system. The test application "hello" runs already on OS X.
> 
> Everyone interested, please feel free to download, play, improve and comment! You can send patches to me directly. You can also join the general fltk newsgroup and discuss D-FLTK there (until the C++ folks complain about too much traffic ;-)
> 
> Anyway, I hop ya'll enjoy and don't get scared by my "D" style.
> 
> 
> Here's how you get the source:
> 
> 
> svn co http://svn.easysw.com/public/fltk/fltk/branches/branch-D-1.1 d-fltk-1.1.x
> 
> 
> All "D" sources are in - um - "D". The rest of the FLTK archive is intact to make it easy to compare "D" and "C++" code.
> 
> Matthias

I gave it a try, and it worked, although I had to add "-fdeprecated" to the Makefile compile rule (are you using gdc 0.19?)

You should add "module" lines to the std/c/osx/* files. Also, when they're complete (if they're not already), you could ask Walter or David for inclusion in Phobos/GPhobos.

Finally, you have code like this:

version (Apple) {
  public import fl.mac;
}

version (X11) {
  public import fl.x11;
}

version (Win32) {
  public import fl.win32;
}

(I intentionally uncommented a couple of lines). I think it would be better if you added "else" clauses:

version (Apple) {
  public import fl.mac;
}
else version (X11) {
  public import fl.x11;
}
else version (Win32) {
  public import fl.win32;
}

Just in case.

Keep up this work because it's looking good.

-- 
Carlos Santander Bernal
August 07, 2006
Well, as you know, i am in D world for a long time... That is the reason i am quiet in FLTK world. I am working on some D-based projects...

I would gladly work on d-native FLTK, naturaly. :) We might move it to separate repository on fltk.org, or alternatively, on fltk.net . As you know, i have SVN server for years on my server.

Kind regards.

Dejan
August 07, 2006
I share this opinion. Everyone has GNU Make.

> IMHO, build is great and all, but I think we're better off w/ Make to start with because it doesn't require another download, etc. It'd be a pity to have to support more than one build method at this early stage (Make should do the job fine) I think.
August 07, 2006
On Mon, 07 Aug 2006 22:24:57 +0200, Dejan Lekic wrote:

> I share this opinion. Everyone has GNU Make.

I don't.

-- 
Derek Parnell
Melbourne, Australia
"Down with mediocrity!"