gEDA-dev: PCB HID

Steve Meier smeier at alchemyresearch.com
Mon Apr 2 19:15:09 EDT 2007


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?


Steve M.


>From line.c

/*
---------------------------------------------------------------------------
 * lowlevel drawing routine for lines
 */
static void
DrawLineLowLevel (LineTypePtr Line, Boolean HaveGathered)
{
  if (Gathering && !HaveGathered)
    {
      AddPart (Line);
      return;
    }

  gui->set_line_cap (Output.fgGC, Trace_Cap);
  if (TEST_FLAG (THINDRAWFLAG, PCB))
    gui->set_line_width (Output.fgGC, 1);
  else
    gui->set_line_width (Output.fgGC, Line->Thickness);

  gui->draw_line (Output.fgGC,
		  Line->Point1.X, Line->Point1.Y,
		  Line->Point2.X, Line->Point2.Y);
}




On Mon, 2007-04-02 at 18:16 -0400, DJ Delorie wrote:
> > I was looking at the PCB hid code. Is the purpose of the graphics
> > context to support different ways of say drawing a line.
> 
> The purpose is to hide hid-specific representations of, for example,
> line width or pixel color.  The hid structure itself has the callbacks
> for *how* to draw, the GC is more concerned with *what* to draw.  It's
> very similar to the purpose of the GC used by X or Gtk.
> 
> > One way for a window on the screen, a second for say postscrip output a
> > third for a png file?
> 
> Right.  That's why, for example, in draw.c near the bottom, we have to
> save the gui's GC's and build export-specific GCs.
> 
> 
> _______________________________________________
> 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