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

Re: UrShape definition Part IV: Full header (?)



Le lun, jui 02, 2001, ? 09:28:47 +0200, Andre Kloss a écrit:

> void element_update_handles(Element *elem);
> /* What does this do? */

position the sizing handles (green and orange ones, black also IIRC) at the
corners of the bounding box.

> void element_update_boundingbox(Element *elem);
> /* What does that do? */

Force a recompute of the bounding box using the ElementBBExtra information
(mostly to account for line widths), given the position and size of the
element.

> void element_init(Element *elem, int num_handles, 
>                   int num_connections);
> void element_destroy(Element *elem);
> void element_copy(Element *from, Element *to);
> void element_move_handle(Element *elem, HandleId id,
>                          Point *to, HandleMoveReason reason);
> /* Here goes much functionality. How to implement standard
>    behaviour? (As described in Part III) */

Hmmm. Basically, you call this when you don't do special handling (no more
information in brain cache, please grep in Element objects)

> void element_move_handle_aspect(Element *elem, HandleId id,
>                                 Point *to, real aspect_ratio);
> /* Why this? Does this differ from move_handle? Do we need it? */

some handles aren't related to the object size. Some handles in the GRAFCET
Step are of that kind. Others are related to the object size and can modify
the aspect ratio. The object may prevent or constrain the aspect ratio.
(ditto brain cache) 

> 
> void element_save(Element *elem, ObjectNode obj_node);
> void element_load(Element *elem, ObjectNode obj_node);
> /* This certainly belongs to the parser, right? It seems that this
>    relies on DOM to work. How to integrate SAX here? */

Basically, new-style element-derived objects don't use this anymore. They
just use object_save_using_properties() (ditto for load), and give
ELEMENT_COMMON_PROPERTIES as the first property descriptor (see GRAFCET Step
again).

Old style objects called that in their foo_save(), before saving the other
properties.

One thing you could do, would be to convert the information you gather from
XML and build property descriptors from there. Or simply don't interact with
the stdprop library, and either do it "like the old way" (with DOM or SAX
code) or do it a new way (it's okay, since it'll be essentially library
code).

	-- Cyrille

> /* urshape.h : defining the generic UrShape */
> #ifndef URSHAPE_H
> #define URSHAPE_H
> 
> #include "element.h"
> /* What else has to be included? */
> 
> typedef enum _UrContainerType UrContainerType;
> typedef struct _UrContainer UrContainer;
> typedef struct _UrShape UrShape;
> 
> enum _UrContainerType {
>   SINGLE,
>   HORIZANTAL_ARRAY,
>   VERTICAL_ARRAY,
>   TABLE
> };
> 
> struct _UrContainer {
>   Point relative_position;
>   UrContainerType type; /* This will define behaviour */
>   GList *rows;		/* The left border of rows */
>   GList *columns;	/* The upper border of columns */
> }
> 
> struct _UrShape {
>   Element element;      /* Inheritance (C sometimes sucks ;) */
> 
>   /* UrShape container stuff */
>   UrContainer *embedding; /* NULL if free, 
>                              "parent's" container else */
>   int row,column; /* For all but SINGLE, it'll be nice to know in what
>                      row/column the UrShape is embedded. */
>   GList *childrenContainers; /* The containers I have */
> 
>   UrShape *parent_shape;
>   GList *self; /* this->self->data == this */
>   GList *children; /* (this->children->data->parent_shape == this ||
>                        this->children == NULL) */
> };

looks fine..

-- 
Grumpf.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] Mail converted by Mofo Magic and the Flying D

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

GuideSMACK