Re: UrShape definition Part II



Hi again.

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 
The lowest denominator. Object is what I'll resort to if someone
dislikes the limitations of Elements.

      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)
I don't think that this fits into my UrShape idea. 

      Element -- rectangularoid object, whose position is independent of
others (indeed, that's what Custom Shapes use)
In my scope, this will do. It's too late at night for me to think of
everyone's scope, but if someone screams before the stuff goes
implementation... ;)

then, a bunch of other ancestors for particular behaviours (zig-zag,
orthogonal, beziergons, etc.)
I see.

/* urshape.h : defining the generic UrShape */
looks good so far.
Thanks.

  /* 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;

?
Well, you got me. I just copied it from the DOM Level 1 specs. And
your implementation looks far better than mine, so let's say this is
the new proposal. I'm not that familar with Glib, but I'm at this
moment browsing their cvs...

What could help us greatly would be access to a small CVS
subdirectory within the dia tree. How about /dia/objects/urshape/ ?

-- Cyrille
cu Andre
-- 
/* urshape.h : defining the generic UrShape */
#ifndef URSHAPE_H
#define URSHAPE_H

#include "element.h"
/* What else has to be included? */

struct _UrShape {
  Element element;      /* Inheritance (C sometimes sucks ;) */
  int max_children;     /* The maximal amount of children UrShapes */
  int last_children;    /* optional, but an int never hurts ;) */
  /* The miniDOM. Thanx to Cyrille, now it _is_ mini. */
  UrShape *parent_shape;
  GList *self; /* this->self->data == this */
  GList *children; /* (this->children->data->parent_shape == this || 
                       this->children == NULL) */
};

typedef struct _UrShape UrShape;

#endif





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