[futurebasic] Re: [FB] Full Carbon printing demo

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2004 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Sat, 24 Jan 2004 06:49:26 -0500
In this thread, Robert Purves explained:

>In the Carbon printing demo, kPMGraphicsContextQuickdraw (not
>  kPMGraphicsContextQuickdraw$) plays a brief but important role:
>
>// set up the printing port (graphics context)
>err = fn PMSessionGetGraphicsContext( printSession, ¬
>      kPMGraphicsContextQuickdraw, @printingContext )
>
>
>kPMGraphicsContextQuickdraw is defined by Apple as a C macro:
>   #define kPMGraphicsContextQuickdraw
>CFSTR("com.apple.graphicscontext.quickdraw")
>
>Since FB does not support such definitions, kPMGraphicsContextQuickdraw
>is implemented in the FB headers as a global variable initialized to
>the correct CFString value. It has no leading underscore and no
>trailing "$", and is not a Pascal string.


Robert,

Thanks for the explanation. I was attempting to compile the code
straight off the Associate server with the underscore-circumsized
version and missed that. I knew the macro definition was wrong
and totally forgot the global declaration.

When I see a "k<CAP>" anything, it's Pavlovian. Wonder how hard
it would be to modify FB to handle C macros in their native state?

Ken

p.s. I hope Rich Love understands that there are many ways to obtain
a handle to text. I used a container because it's easy to load and
to understand, and because FB handles all the associated memory
management when you get its handle. You need to remember to clear
the container contents yourself