Hi all,
I'm thinking about how to use the complex place list for component
placement and object moving, copying, rotating and so on...

Currently, the selection list is a doubly-linked list of selected
objects. The selection struct is:

struct st_selection {
  OBJECT *selected_object;

  SELECTION *prev;
  SELECTION *next;
};
(aside thought: why don't use a glib's GList here?)

The complex place list is a list of objects, without any other struct:

struct st_object {
  /* Lot of hidden variables */
  OBJECT *prev;
  OBJECT *next;
}

When placing new components, they are just linked in the complex place
list.
If we want to use them for component actions, we need to link the
selected objects using the prev and next pointers of the object struct,
thus changing the complex order in the main object list. This is a
problem because when moving the selection (for example), the selected
objects have to be removed from the main object list and placed into the
complex place list (and there are other things to take into account when
unlinking objects from the main object list).

I think the easiest solution here is to convert the complex place list
into a doubly-linked list, possibly using glib's GList lists.
This way an object list can be built without changing the main object
list.
When moving the selection, instead of moving the components from the
main list to the complex place list, the complex place list could be a
list of pointers to the objects of the main list, and o_redraw* changed
so they don't redraw the selected components at the original position if
gschem is inside a move/rotate/.. command.

Thoughts?

Carlos

Reply via email to