[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pablo-devel] I did take a look at the code:
From: |
Abhishek Nayani |
Subject: |
Re: [Pablo-devel] I did take a look at the code: |
Date: |
Tue, 13 Nov 2001 11:54:11 +0530 |
Hi again,
I thought about ur 3 Q, placing the frames in sorted order in the
ptrlist
itself. I was going to introduce a new class called the Compositor , and add
a member element in Frame class:
class Frame {
.............
.............
Compositor *compositor;
};
The Compositor class is a separate class tree implementing the strategy
pattern, ie the subclasses will be implementing different glyph handling
algos. For example, take TextFrame, it has to layout its glyphs according to
different algos, so we will be having LeftJustificationCompositor,
RightJustificationCompositor, TexCompositor, SimpleCompositor etc...
Depending on the option selected, the frame will be using the corresponding
compositor object. so whenever a new glyph is added, it just adds it to the
list and calls compositor->compose(...). The compositor will depending on the
algo used, modify the list appropriately.
So the idea is to use the same class to handle the frames in the page.
That
is whenever a new frame is created, it is added to the list and given given
to the compositor. It would sort the list according to the increasing order
of z in the Point3D struct. So the drawContents func has to just iterate over
the list and call the corresponding draw funcs.
This separates the algorithms used from the document structure and can
be
changed independently of the frame class.
Bye,
Abhi.
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com