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

Re: gEDA-user: Re: dxf?



On Thu, 8 Feb 2007 john@xxxxxxxxxxxxxx wrote:

>Igor2 wrote:
>I'll need to find some way in the
>> HID API to provide interface for the user to run scripts (like tiling
>> scripts). For exporting it's easy, the export dialog is extensible. I
>> think there should be a similar Import interfce and a 3rd one, which I
>> can't find a good name for, to run plugin functions that would not
>> import/export but would change the PCB itself.
>
>Of course.  I tested some of the first efforts you made.

Yeah, I remember (thanx again), that was the pre-plugin ages. Now we have
a proper way doing all this.

>You have a hook in the source code now so you can use
>the GPMI library, right?  To me it seems the import interface
>is just the idea of the outward acting HID API functions.  Once we get the
>inward acting ones done, they would not have to be just one way... We could call 
>it the external in out interface or some such language.  You are wanting
>a no compile way to hook in -- that's great!  Perhaps a c coded plugin could do 
>the interfacing to GPMI?  It would not be a very specific plugin, just a 
>presenting of the internal function names so external scripts could use them by 
>name and parameter list as in a subroutine call.

Yes, but actually it can be written more in a more elegant way. The plugin
needs to be only a thin wrapper that loads GPMI and the specific module
for the language you have your script in, then the script itself could
load small packges to access internal functions. I planned to have about
6-8 such packages, like one for manipulating the drawing, another related
to hid-registering and so on. This means a script doesn't need to load
tons of bloat it will never use.

>Does GPMI convert all the many ways in scripts to define a subroutine call to 
>one form?  If so, that one form could be what the "scriptio" plugin transforms 
>into a HID API function call.

GPMI has an unified interface towards the scripts which covers calling
package functions from the script (which then can directly call pcb
internals) and delivering events to the script(s) (which actually may
result in function calls in the script, depending on hwo the script bound
the events). All this doesn't need any modification in the host app, if we
have the plugin support which we already have.

The only thing that needs modifications in PCB itself is the
GUI: currently I see no proper solution for displaying simple dialog boxes
similar to the exporter. Of course when I write a script for tiling I
could pretend that it's an exporter, register an exporting hid but then
instead of writing a file just call PCB interlans trough the interfacing
packages to modify the layout data, but it would just be an ugly hack :)

>I will help some more with testing.  I gave DJ's plugin code examples a look, ( 
>    *  RenumberBlock  * Teardrops ), and they are maybe obvious to him, but the 
>c language without comments was opaque to me...  I will welcome a script interface.
>

Ok, if we can meet on irc this weekend, and we could work out some way to
share the tasks. I think togehter we could make it all work in less time.




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