Re: UrShape definition Part II



Le mer, jun 27, 2001, à 08:14:43 +0200, Andre Kloss a écrit:

OTOH, every UrShape (if UrShape are really seen as objects by the
core) should have at least an Object as their first member
(usually named obj if it's an Object, elem if it's an Element, and
so on).
In my opinion it will rather be an element (post if you disagree).

It's really up to you. Basically, you have these ancestors:
        Object -- when nothing else fits 
        Connection -- objects which connect others by something resembling a
line (the actual position of the object depends on the where the end points
are connected to)
        Element -- rectangularoid object, whose position is independent of
others (indeed, that's what Custom Shapes use)

then, a bunch of other ancestors for particular behaviours (zig-zag,
orthogonal, beziergons, etc.)
        
/* urshape.h : defining the generic UrShape */

looks good so far.

  /* The miniDOM stuff */

Hmmm... basically, what you call miniDOM is a tree of lists, isn't it ?
How about
    UrShape *parent_shape;
    GList *self; /* this->self->data == this */
    GList *children; 
instead of 
  UrShape *parent_shape;
  UrShape*[] children_shapes;
  UrShape *first_child_shape;
  UrShape *last_child_shape;
  UrShape *previous_shape;
  UrShape *next_shape;

?

        -- Cyrille

-- 
Grumpf.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]