gEDA-dev: [pcb] multiple hids in one .so
Igor2
igor2 at inno.bme.hu
Mon Oct 2 00:36:35 EDT 2006
On Sun, 1 Oct 2006, DJ Delorie wrote:
>
>> For the scriptable plugin HID I'm working on, it's a required feature to
>> be able to register multiple HIDs from the same .so file. However, when my
>> general function get_exporter_options() is called back, I have no chance
>> to find out which HID triggered the request.
>
>What you'll have to do is have each hid call a wrapper that passes the
>extra parameter you need.
Sorry, I don't get this. Let's say I'm writing a .so that has multiple
exporter HIDs. If I get it right, my .so registers all HIDs, then when the
user selects one of the exporters I provided, the first call from the GUI
hid to my hid will be get_exporter_options(). Unless I write as many
get_exporter_options() as many HIDs I register, I have no chance to find
out which exporter the GUI HID wants.
Of course in the scriptable case, where I want arbitrary number of scripts
register their HIDs using a single .so, it's not an option to have a
prewritten get_exporter_options() for each script, as I don't even know
how many scripts I would have.
>
>> It would be nice if this function could have the HID * or even
>> better if a cookie. Like the HID structure could contain a void
>> *cookie field which is NULL in case of normal/current HIDS but I
>> could fill it in when creating dynamic HIDs and use it from
>> callbacks like get_exporter_options().
>
>What you really want is for HIDs to be C++ objects ;-)
Hah, never :) If I'm not wrong what get_exporter_options() is for, a
simple cookie would solve my problem. Correct me if I'm wrong :)
More information about the geda-dev
mailing list