mab@ecmwf.co.uk (Baudouin Raoult) (04/24/91)
I am writing a printer driver, and I'd like to know if it is possible to create a Color TPrPort. In a printer driver, you allocate a TPrPort, which starts with a GrafPort, and give it to the application. The application then just draws into this port. But a GrafPort (b & w) is not a CGrafPort (color) and QDProcs ( b & w ) are not CQDProcs (color). Can you print using color QD ???? -- This is the definition of the TPrPort TPrPort = RECORD {This is the "PrPeek" record.} GPort: GrafPort; {The Printer's graf port.} GProcs: QDProcs; {..and its procs} lGParam1: LongInt; {16 bytes for private parameter storage.} lGParam2: LongInt; lGParam3: LongInt; lGParam4: LongInt; fOurPtr: Boolean; {Whether the PrPort allocation was done by us.} fOurBits: Boolean; {Whether the BitMap allocation was done by us.} END; --- This is how it must be for color. TPrPort = RECORD {This is the "PrPeek" record.} GPort: CGrafPort; {The Printer's COLOR graf port.} GProcs: CQDProcs; {..and its COLOR procs} lGParam1: LongInt; {16 bytes for private parameter storage.} lGParam2: LongInt; lGParam3: LongInt; lGParam4: LongInt; fOurPtr: Boolean; {Whether the PrPort allocation was done by us.} fOurBits: Boolean; {Whether the BitMap allocation was done by us.} END; -- --------------------------------------------------- Baudouin Raoult. European Center for Medium Range Weather Forecast Reading, UK ---------------------------------------------------
kaufman@neon.Stanford.EDU (Marc T. Kaufman) (04/27/91)
In article <1991Apr24.090146.15878@ecmwf.co.uk> mab@ecmwf.co.uk (Baudouin Raoult) writes: > I am writing a printer driver, and I'd like to know >if it is possible to create a Color TPrPort. >In a printer driver, you allocate a TPrPort, which starts >with a GrafPort, and give it to the application. >The application then just draws into this port. >But a GrafPort (b & w) is not a CGrafPort (color) and >QDProcs ( b & w ) are not CQDProcs (color). Yes, you can give back the kind of port you want. But since there are more bytes in a TPrPort+CQDProcs than in a TPrPort its probably best to ignore any TPrPort space given to you by the application and just return your own. I only know of one (1) application that even tried to give me port space. > Can you print using color QD ???? Certainly. After all, its YOUR driver... and your bottlenecks. Marc Kaufman (kaufman@Neon.stanford.edu)