Re: [Gimp-developer] PF_ENUM, SF_ENUM, dynamically defined enums for plugins

2022-08-15 Thread Jehan Pagès via gimp-developer-list
Hi all! On Mon, Aug 15, 2022 at 12:25 AM Ofnuts via gimp-developer-list < gimp-developer-list@gnome.org> wrote: > I'm not convinced this needs to be an enum. The basic problem it to > show a list of strings, and return the index of the selected one. The > contents of the list can be quite

Re: [Gimp-developer] PF_ENUM, SF_ENUM, dynamically defined enums for plugins

2022-08-15 Thread Lloyd Konneker via gimp-developer-list
Yes, the proposal seems to have been shot down already. I don't think it will work. See a discussion https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/709 I paraphrase here and might not be accurately describing things The primary goal is to let plugin authors refer to enums

Re: [Gimp-developer] PF_ENUM, SF_ENUM, dynamically defined enums for plugins

2022-08-15 Thread Ofnuts via gimp-developer-list
Not really. With the current interface, I manage it that way: I have these two functions: def createOpts(name,pairs):     optsclass=namedtuple(name+'Type',[symbol for symbol,label in pairs]+['labels','labelTuples'])     opts=optsclass(*(     range(len(pairs))   

Re: [Gimp-developer] PF_ENUM, SF_ENUM, dynamically defined enums for plugins

2022-08-14 Thread Nathan Summers via gimp-developer-list
On Sun, Aug 14, 2022, 6:25 PM Ofnuts via gimp-developer-list < gimp-developer-list@gnome.org> wrote: > I'm not convinced this needs to be an enum. The basic problem it to > show a list of strings, and return the index of the selected one. The > contents of the list can be quite dynamic. As far

Re: [Gimp-developer] PF_ENUM, SF_ENUM, dynamically defined enums for plugins

2022-08-14 Thread Ofnuts via gimp-developer-list
I'm not convinced this needs to be an enum. The basic problem it to show  a list of strings, and return the index of the selected one.  The contents of the list can be quite dynamic. As far as I can tell, in 2.10 they aren't cached in pluginrc. In 3.0, the query/init methods of the plugin suggest

Re: [Gimp-developer] PF_ENUM, SF_ENUM, dynamically defined enums for plugins

2022-08-12 Thread Lloyd Konneker via gimp-developer-list
I continued to prototype this. Proved that a plugin can cross the wire to GIMP with gimp_procedure_add_enum. It creates a dynamic GEnum on both sides of the wire. But it revealed these problems: 1. GIMP crashes when it starts the second time after installation, I suppose when it is reading

Re: [Gimp-developer] PF_ENUM, SF_ENUM, dynamically defined enums for plugins

2022-08-09 Thread Lloyd Konneker via gimp-developer-list
More information since my last email I prototyped this. Using GTypeModule, a dynamically loaded module which declares dynamic types. So far, I seem to be able to create a dynamic GEnum on the plugin side.But I think it crashes on the GIMP side of the wire.That is, the plugin creates a

[Gimp-developer] PF_ENUM, SF_ENUM, dynamically defined enums for plugins

2022-08-08 Thread Lloyd Konneker via gimp-developer-list
This is a continuation of a thread on this list: https://mail.gnome.org/archives/gimp-developer-list/2022-July/msg00016.html. The thread diverged to a discussion about future PF_OPTION implementation in GIMP 3. Here are my preliminary thoughts. A PF_OPTION, in the old PyGimp, or a SF_OPTION, in