Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Window Backgrounds (again)



On Jul 30, 2004, at 1:36 PM, Jack Brindle wrote:

> OK, so after going through many header files and on-line docs, my
> understanding of things is this...
>
> Windows are QuickDraw-based entities. They have a GrafPtr with info
> that describes their characteristics.

This is only partially true. A window does have a GrafPort associated
with it (actually a CGrafPtr or GWorldPtr, not a GrafPtr). The GrafPtr
doesn't describe the window's characteristics, rather the window's
characteristics define the parameters for the GrafPtr.

> Controls take on the background color of their parent, all the way
> back to the window. This is true for both compositing as well as
> non-compositing windows. When they are redrawn, they search back
> through the "stack" to find this color. If a parent control has its
> "special background" bit set, it stops there and uses the background
> from that control (this mechanism is still magic to me). Otherwise it
> will go all the way back to the window for the color.

Hmm... I don't know that I would put quite that way.

In a non compositing window, many of the system controls will take it
upon themselves to erase their backgrounds when they draw. To do that
they will call up the parent chain looking for a control that knows
what the background should be. The guy that knows what the background
should be will draw it's background.

In a compositing window, controls never erase. Instead the controls
are drawn in back-to-front order and the same effect as the erase comes
about from a painters algorithm where one control draws over the
control behind it.

It's all about the erasing. Controls in compositing windows erase
things and cause difficulties. Controls in compositing windows
shouldn't erase, only invalidate and draw.

> No, how do background procs work, and are they still useful in Panther?

A background proc in a non-compositing window should behave the same as
it always has. Basically that means that it behaves badly :-)

> At this point, my low-level set background of the window code uses a
> combination of QuickDraw and Quartz code. This tells me that you
> really cannot create Quartz-only Carbon apps.

You can create applications for which it is possible to have all of
your window's contents drawn through Quartz.

However with the way things currently stand there are some operations
that you have to go through QuickDraw calls to accomplish. In Panther
the HIView system still makes extensive use of QuickDraws regions and
the only way to create QuickDraw regions is through QuickDraw :-)

Tiger looks to mitigate that dependency somewhat by allowing an
application to use HIShape, but currently the only way to create an
"interesting" HIShape is to start with a QuickDraw Regions so you're
still not free and clear :-).

From the standpoint that you have to use QuickDraw to supply regions
then yes it is true that you cannot create a Carbon application on
Panther that doesn't use QuickDraw. But you can create an application
that doesn't use QuickDraw to change any of the pixels in your window.

Does that make sense?

--
Macintosh Software Engineering Consulting Services
Visit my resume at <http://homepage.mac.com/easco/RSTResume.html>

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.


References: 
 >Window Backgrounds (again) (From: Jack Brindle <email@hidden>)
 >Re: Window Backgrounds (again) (From: David McLeod <email@hidden>)
 >Re: Window Backgrounds (again) (From: Jack Brindle <email@hidden>)
 >Re: Window Backgrounds (again) (From: David McLeod <email@hidden>)
 >Re: Window Backgrounds (again) (From: Jack Brindle <email@hidden>)
 >Re: Window Backgrounds (again) (From: Scott Thompson <email@hidden>)
 >Re: Window Backgrounds (again) (From: Jack Brindle <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.