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

Re: gEDA-user: [pcb] HIDs and plugins



> I'm interested in learning the plugin and HID writing parts of the pcb code.

For the HID interface, it's all in src/hid.h and I tried to comment it
sufficiently so that others could use it as a guide.  Since I'm not
the only one who's written HIDs, I think it's working.

For plugins, you only need to know the name of the hook function
(hid_<foo>_init where <foo> is the name of the shared object, or
pcb_plugin_init()) which is called when the plugin is loaded.  *That*
function cal call whatever register functions it needs to to add its
actions to the main list.  My RenumberBlock() plugin is a pretty
simple example:

http://www.delorie.com/pcb/renumberblock.c

Plugins can register HIDs, actions, or flags.

Use a HID if you want to export the PCB to something; the PS, EPS,
PNG, Gerber, PS, Gtk, and Lesstif exporters are all HIDs.  HIDs let
you react to drawing requests from the core drawing code.  You can
roll your own if you want (the HID asks for the redraw, but doesn't
have to).

Use an action for things you want to bind to menu buttons, mouse
actions, or key shortcuts.  For example, my teardrops plugin registers
the Teardrops() action.

> What stops that now is that a via has a drill hole, and a pad
> doesn't connect two layers.

Sounds like a job for blind/buried vias, but regular vias would work
if PCB just knew to skip the hole.

The other thing we don't have is HID filters.  For example, thindraw
should be done as a HID filter - something that sits between the core
and the GUI.  Now imagine a "conductive trace" HID filter that sits
between the core and the gerber exporter.


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user