gEDA-dev: PCB HID
Steve Meier
smeier at alchemyresearch.com
Mon Apr 2 19:55:57 EDT 2007
I think this is what I was thinking...
PCB data structures and code to manipulate these structures
GUI data structures and code
GUI decides it wants to draw the list of lines so it tells the PCB code
to draw lines. The GUI should already know the context of why a
particular drawing is happening.
But, what if you wanted to support multi-threaded actions. The gui would
tell pcb to go draw its lines for a postscript file and halfway through
the lines a second thread decides to tell pcb to start drawing its line
for a screen update. Now, for the next gui->draw_line(x1, y1, x2, y2)
that comes along was that ment for the postscript file or for the screen
update? If multi-threaded isn't going to be allowed then the gc could be
kept away from the pcb functions. Am I missing something here is there
another reason?
The abstraction for pcb seems to be spread out between the files
directly in the src directory and those in the src/hid path. I suspect
because of making the hid around a lot of existing code.
For example here in the low level line draw we expect the line to know
if it is ment to be drawn thin or not. Seems to me again that has more
to do with the context of what is happening at the gui level. Presumably
the thin line means that the line is in a buffer being draged around.
But why should the line care?
OK, speaking of context, I am trying to figure out how I want my version
of libgeda to seperate out these issues. I am thinking of having the
library make use of a HID.
So I could see say gschem doing somthing like
s_page_draw(PAGE *this_page, hidGC *gc) {
GList *obj_list_el;
obj_list_el = g_list_first(this_page->complex_objs);
OBJECT *curr_complex;
while (obj_list_el) {
curr_complex = (OBJECT *)obj_list_el->data;
o_complex_draw(curr_complex, gc);
obj_list_el = g_list_next(obj_list_el);
}
}
now this still passes along a gc but the gc should decide wether skinny
should override the expected values.
Steve M.
On Mon, 2007-04-02 at 19:29 -0400, DJ Delorie wrote:
> > So, if I was asking a line to go draw yourself why do I have to expect
> > that line to have an understanding of the graphics context. Idealy,
> > shouldn't the gui know the context?
>
> The GUI only knows the context because the core tells it which context
> to use. There are usually a handful of contexts in use at any given
> time.
>
> The abstraction is not at the PCB level. It's a little lower; the GUI
> knows how to draw a graphics line, not a PCB line. So, you don't say
> "draw this line" you say "draw a blue line, 4 pcb units wide, from A
> to B, with round ends".
>
>
> _______________________________________________
> geda-dev mailing list
> geda-dev at moria.seul.org
> http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev
More information about the geda-dev
mailing list