Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / February 2005



Tip: Looking for answers? Try searching our database.

ProjBldr Apple sample code no go in CW

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith Wiley - 19 Feb 2005 23:50 GMT
I am trying to build ATSUICurveAccessDemo.  The sample project from Apple
is a project builder project and it builds fine.  I tried to construct a
Carbon project in CW 8.3 and I can't get it to build.  I have had to make
numerous changes to the code, primarly including obvious headers like
stdlib.h and others, to get most of it to compile, but I can't finish it
because a number of ATS routines and constants simply aren't there.
Namely, I can't get it to recognize kATSDeletedGlyphcode or
ATSLayoutRecord.

Why does this work in project builder?  How do I convert it to CW?  The
code I want to adapt this to a huge well established CW project.  It's 1.5
years old.  I can't even consider moving the entire project over to
Project Builder just for this.  Besides, isn't Xcode supposed to replace
Project Builder?  I really need to get ATS working in CW.

What's the trick?

Thanks.

________________________________________________________________________
Keith Wiley         kwiley@cs.unm.edu         http://www.unm.edu/~keithw

"Yet mark his perfect self-contentment, and hence learn his lesson,
that to be self-contented is to be vile and ignorant, and that to
aspire is better than to be blindly and impotently happy."
                                           --  Edwin A. Abbott, Flatland
________________________________________________________________________
David Phillip Oster - 20 Feb 2005 06:00 GMT
> I am trying to build ATSUICurveAccessDemo.  The sample project from Apple
> is a project builder project and it builds fine.  I tried to construct a
[quoted text clipped - 12 lines]
>
> What's the trick?

Sounds like you are using the obsolete "Universal" headers, instead of
searching for the correct header in /System/Library/Frameworks/.

Thanks for the interesting challenge. I was able to get
ATSUICurveAccessDemo up and running in Codewarrior 8.3 in under 5
minutes.

Here's the recipe:

Download the XCode source from apple at:
<http://developer.apple.com/samplecode/ATSUICurveAccessDemo/ATSUICurveAcc
essDemo.html>

Build it.

In Codewarrior's File Menu, make a New Project, Mac OS C, Mach-O with
nibs.

Move the project file into the ATSUICurveAccessDemo folder and throw the
rest of the Metrowerks generated files away.

Open the Metrowerks project, and delete the contents of tSources and
Resources groups. Drag all the C files in the ATSUICurveAccessDemo
folder into the Sources group, and drag the English.lproj folder into
the Resources group.

In the project's settings' dialog box, C/C++ language pane, change the
header file from MSL MacHeadersMach-O.h to My MacHeadersMach-O.h. Here
is My MacHeadersMach-O.h:

------------------------
// My MacHeadersMach-O.h
#define __dead2
#define __pure2
#include <MSL MacHeadersMach-O.h>
------------------------

Now, add the missing "pascal" keyword to the declaration and definition
of the quadratic and cubic callbacks.
(for example, line 188 of "cubic.c".)

Lastly, replace the incompatible (on Panther) crt1.o file in the Library
group with mwcrt1.o and console.stubs.c (search for them in the
Codewarrior folder)

Done.

If you want to access the ATSUI system calls from CFM, then you may have
to directly access the Mach-O shared library and extract function
pointers from it. You didn't say whether you program was CFM or Mach-O.

Signature

David Phillip Oster

Keith Wiley - 20 Feb 2005 20:59 GMT
> In Codewarrior's File Menu, make a New Project, Mac OS C, Mach-O with
> nibs.

I don't want Mach-O though.  The project I'm incorporating this into is
Carbon.

> If you want to access the ATSUI system calls from CFM, then you may have
> to directly access the Mach-O shared library and extract function
> pointers from it. You didn't say whether you program was CFM or Mach-O.

I'm not sure what CFM stands for but I do need this to work on Carbon, not
Mach-O.  I got it to work by commenting out all the Quartz calls.  That
prevents me from actually using Quartz to generate the curves, but I
didn't need that anyway, I just needed the spline control points.  I'm
hoping there's a better way though that would allow me to do both as
needed.

Thanks.

________________________________________________________________________
Keith Wiley         kwiley@cs.unm.edu         http://www.unm.edu/~keithw

"Yet mark his perfect self-contentment, and hence learn his lesson,
that to be self-contented is to be vile and ignorant, and that to
aspire is better than to be blindly and impotently happy."
                                           --  Edwin A. Abbott, Flatland
________________________________________________________________________
James W. Walker - 20 Feb 2005 22:29 GMT
> I don't want Mach-O though.  The project I'm incorporating this into is
> Carbon.

That statement does not make sense.  Carbon is either CFM or Mach-O.
If you mean that you need to run on OS 9, then you need to build as
CFM.
David Phillip Oster - 21 Feb 2005 00:46 GMT
> I don't want Mach-O though.  The project I'm incorporating this into is
> Carbon.

Carbon can be either Mach-O or CFM (Code Fragment Manager). Assuming you
meant that you don't want Mach-O, the following sample code form Apple
shows how a CFM program can at run time, attach to a framework like
Carbon.Framework, and extract function pointers from it and call it:

http://developer.apple.com/samplecode/CallMachOFramework/CallMachOFramewo
rk.html

Signature

David Phillip Oster

Keith Wiley - 21 Feb 2005 17:34 GMT
Thank you very much.  I have always had a hard time figuring out what
Mach-O is all about.  I always assume my projects are Carbon, as opposed
to Mach-O because that's how CW makes it look.  When you make a new
project is asks if it is Mach-O or Carbon, as if the two are exclusive.  I
guess I interpretted that wrong.

Thanks.

>> I don't want Mach-O though.  The project I'm incorporating this into is
>> Carbon.
[quoted text clipped - 9 lines]
> --
> David Phillip Oster

________________________________________________________________________
Keith Wiley         kwiley@cs.unm.edu         http://www.unm.edu/~keithw

"Yet mark his perfect self-contentment, and hence learn his lesson,
that to be self-contented is to be vile and ignorant, and that to
aspire is better than to be blindly and impotently happy."
                                           --  Edwin A. Abbott, Flatland
________________________________________________________________________
David Phillip Oster - 22 Feb 2005 05:10 GMT
> Thank you very much.  I have always had a hard time figuring out what
> Mach-O is all about.  I always assume my projects are Carbon, as opposed
[quoted text clipped - 3 lines]
>
> Thanks.

You are welcome. This has been a tough time of adjustment for us all.

Compare the incredibly rich Interface Builder for Cocoa with anything
else.

Then try to make a Cocoa program with any complexity to its model
recordable.

Signature

David Phillip Oster

Miro Jurisic - 21 Feb 2005 01:42 GMT
> I don't want Mach-O though.  The project I'm incorporating this into is
> Carbon.

Unless you want to ship on Mac OS 9, you want Mach-O. Carbon and Mach-O are not
mutually exclusive.

meeroh

Signature

If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

Keith Wiley - 21 Feb 2005 17:35 GMT
I really have no need of OS 9 compatibility.  My mistake appears to be
that when I make a new CW project I generally choose Carbon instead of
Mach-O, and since they are exclusive options for making a new project, I
thought they were exclusive kinds of projects.  I guess I should just be
making Mach-O projects from now on.

Thanks.

>> I don't want Mach-O though.  The project I'm incorporating this into is
>> Carbon.
[quoted text clipped - 7 lines]
> If this message helped you, consider buying an item
> from my wish list: <http://web.meeroh.org/wishlist>

________________________________________________________________________
Keith Wiley         kwiley@cs.unm.edu         http://www.unm.edu/~keithw

"Yet mark his perfect self-contentment, and hence learn his lesson,
that to be self-contented is to be vile and ignorant, and that to
aspire is better than to be blindly and impotently happy."
                                           --  Edwin A. Abbott, Flatland
________________________________________________________________________
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.