View previous topic :: View next topic |
Author |
Message |
lws
Joined: 30 Jul 2005 Posts: 5
|
Posted: Sun Jul 31, 2005 1:20 pm Post subject: MacOS X Carbon Headers |
|
|
I, and a few other, mac developers think it would be easier if we could all work on adding Carbon library functions to some D imports. We would like to be able to have an SVN repository so that we can all update. That way as we need new functions, we can easily add them to the imports so others can use them. Eventually we might have something usable!
If we could use dsource.org as an svn repository for this relatively small project, that would be nice. |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Sun Jul 31, 2005 10:40 pm Post subject: Re: MacOS X Carbon Headers |
|
|
lws wrote: | I, and a few other, mac developers think it would be easier if we could all work on adding Carbon library functions to some D imports. |
I'm guessing this was the group you were refering to: http://www.digitalmars.com/drn-bin/wwwnews?D.gnu/1394
Sounds like a good idea. I'm sure Brad will set you up when he gets a chance. |
|
Back to top |
|
|
brad Site Admin
Joined: 22 Feb 2004 Posts: 490 Location: Atlanta, GA USA
|
Posted: Mon Aug 01, 2005 7:32 am Post subject: |
|
|
Let me know what a project name and a short description would be and I'll get you set up.
BA |
|
Back to top |
|
|
lws
Joined: 30 Jul 2005 Posts: 5
|
Posted: Mon Aug 01, 2005 6:09 pm Post subject: |
|
|
Not sure about project name. I'd eventually hope this would be merged with phobos as: std.macosx.carbon (like std.windows)
How about CarbonHeaders?
Description:
This project aims at being a community effort to create function declarations for all of MacOS X's Carbon framework. If you decide to use these imports and find a function you want to use but isn't included, let us know. |
|
Back to top |
|
|
brad Site Admin
Joined: 22 Feb 2004 Posts: 490 Location: Atlanta, GA USA
|
Posted: Tue Aug 02, 2005 10:33 pm Post subject: |
|
|
Keep cranking on your code. I will get this set up for you, but I'm not able to get any free time until the weekend... Sorry for the delay.
BA |
|
Back to top |
|
|
Eljay
Joined: 10 Sep 2005 Posts: 2 Location: Chanhassen, Minnesota
|
Posted: Sat Sep 10, 2005 1:26 pm Post subject: |
|
|
std.macosx.carbon
Sounds like a good project!
So far, I've just been adding functions and data structures as I've needed them to Anders carbon.d source. Which I used as a starting point & helped me start to learn D Programming Language.
Hmm, I think a thin OO veneer over Carbon in D would be useful. Diamond would be perfect name for such a thing. Nothing heavy weight (like Power Plant). Merely objectify Carbon API and convert OSStatus and OSErr result codes into exceptions. A project for another day.
--Eljay
PS: Thanks Anders both for carbon.d and for helping me get XCode 2.1 set up correctly to compile and link D source. Above and beyond the call! |
|
Back to top |
|
|
Eljay
Joined: 10 Sep 2005 Posts: 2 Location: Chanhassen, Minnesota
|
Posted: Sat Sep 10, 2005 1:35 pm Post subject: |
|
|
Here's a useful trick to make a file that encompasses all the headers brought in by carbon/carbon.h
echo '#include "carbon/carbon.h"' > view_carbon.cpp
(a one liner source file)
g++ -c -H view_carbon.cpp 2>all_carbon_headers
rm view_carbon.cpp view_carbon.o
(don't need these any more)
vi all_carbon_headers
(remove the leading '^[.]* ' via...
s/^[.]* //
)
sort -u all_carbon_headers -o all_carbon_headers
(more manageable size)
Now if you want to use it to search for, say, ConvertUTCToLocalDateTime ...
grep -w ConvertUTCToLocalDateTime $(<all_carbon_headers)
If there are too many headers (there aren't on my system), may have to do this...
xargs <all_carbon_headers grep -w ConvertUTCToLocalDateTime
Voila. |
|
Back to top |
|
|
|