[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gEDA-dev: PCB: external HID?



Hi!

I'm thinking about writing a HID that would GPMI (^5) to provide run-time
scripting for PCB (^4). Following this mailing list for some weeks
already, I suspect such a patch would never get into the official release
(^1). Instead, I'm more thinking in distributing it as a separate project,
an external HID. If the user wants it, he grabs it, compiles it and uses
it, without recompiling, reinstalling or touching PCB binaries and/or
source (^3).

Browsing hid.h suggests that such an external HID is possible, maybe with
a very small modification to pcb itself, maybe without changing
the code at all. However, I have no experience with HID, so I think I
should ask some questions first:

1. gui/printer/exporter; the .h says the HID needs to choose exactly one
of these. Is it possible to have an external HID that registers 3
different HID structures so it may have gui, printer and exporter parts?

2. The .h mentions that there can be only one printer HID at a time. What
about the gui HID? Comment above hid_find_gui() suggests there can be only
one. If so, is there a plan to change this? (It's not necessary for my
project, I think (^2))

3. HID initialization: main() calls hid_init() which then runs
hid_*_init(). These HID-specific init routines do all the registration. Do
I get it right, is it this simple or are there any tricks I missed?

4. Does the order of calling hid_*_init() functions matter?

5. Are there special requirements for a HID, like for blocking the
process for arbitrary time, using the IO or anything? In other words, are
there some thumb rules set up to avoid HIDs to interfere?

6. Is there a peroidoc entry point that PCB calls from time to time? If
not, is there at least an entry point that is 'called often enough' to use
as a base of an 1 sec resolution timer in a HID?

7. And of course, the administrative part: would gEDA developers like
and/or support the project? 

Notes:
[1] see also: dependency panic :) And it seems even m4 would go off. I
guess gEDA is heading to target the worst kind of windows users who don't
want any 'complication', even if this kills some flexibility. What I want
to do is all about flexibility and would bring tons of dependencies, this
why I think it would never make it into the  CVS, not even as a
compile-time-optional stuff.

[2] I could write the external HID to take over the gui hid if needed
and then directly call back the original gui HID, some sort of 'hooking'
the gui events. However, being able to have multiple gui HIDs seems to be
nicer.

[3] If the answer is yes for question 3 and 4 above, the external HID can
be a simple .so which has a special 'constructor' part that runs before
main(). This one would register itself in the HID system, just as it was
celled from hid_init() - the only difference would be that it's called
before hid_init() so it's the first HID registered. The .so can be forced
to load with PCB using a shell script wrapper that exports
LD_PRELOAD. Yeah, a but hacky, but this way no patch would be needed in
PCB.

[4] It would be nice to do the panelize and other automated things
*inside* PCB, would save some time. Also I could easily add some sort of
socket-communication so other processes could drive PCB trough this HID in
a way that I don't need to worry about dependencies as the whole thing is
external, still I don't need to maintain huge patches and recompile PCB
all the time.

[5] GPMI is a project I'm working on for more than 1.5 years by now. It's
a generic modularization tool, but what's more interesting for PCB (which
won't be modularized using GPMI) is that GPMI, as a lib, supports many
different scripting languages trough a single interface. Also it allows
one to replace a script with compiled C code if he finds out the script is
too slow. As it is a lib, adding a new script language doesn't require the
original app to be recompiled.


Regards,

Igor2



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