[Y-devel] shapes?
Chris Amshey ychris at amshey.net
Tue Feb 24 18:22:21 GMT 2004
On Tue, Feb 24, 2004 at 12:18:12PM -0500, Aaron wrote:
> I don't think anybody has started work on, or thought about shapes, but
> what about them? I've been poking around trying to figure out how I
> would implement an ellipse/oval(that and line and rectangle are the base
> shapes in most places), but I'm having a little bit of trouble seeing
> where exactly I would fit the pieces together. For example, where
> exactly would I have the work of putting each pixel on the screen? I
> think the painter, but I haven't quite gotten how to specifically
> extend/implement/use it to have it put stuff up on the screen. I would
> like some guidence from those of you who have been poking around in the
> source and are more familiar with the APIs and such.
>
> Aaron
It depends on what level you're looking at working in. Basically,
Painter does the actual job of putting pixels on the screen, and
theme modules call Painter (I don't think anybody else should be
painting... if anyone else paints, themes can't implement appearance).
So, if you want to create a theme where you have circular buttons, you
could implement a circle or poly as a series of calls to
painterDrawHLine, but if you want (and I think this is what you mean)
to provide the world with circles or polys, you would implement
PainterDrawCircle or painterDrawPoly.
(okay, fontRenderString takes position and painter arguments from the
theme module, tortures the data a bit, and then calls painter with a
bitmap, but I think simple geometric primitives belong in painter. Maybe
other things will call painter eventually, but they need to have some
reason to warrant their own 'class' and not want to be a method of
painter.)
--Chris
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved