Re: [Geany-Devel] How can a plugin invoke menu items/geany actions?

2017-12-20 Thread Lars Paulsen

@Lex, @Matthew: thanks for the quick response.


On 20.12.2017 23:46, Matthew Brush wrote:

On 2017-12-20 01:37 PM, Lars Paulsen wrote:

Hi All,

I would like to start actions in geany from inside a geany plugin?

E.g. start the Color Chooser as if it was selected from the geany 
tools menu.
I tried to call the callback function directly but that gives an 
linker error for geany plugins (just logical).


Can I fire/send an event/message to make it being started? How do I 
do that?




If you happen to find one that's not available as a keybinding 
command, you can also use `ui_lookup_widget()` to get a handle on the 
menu item and then activate it through code (ie. 
`gtk_actionable_activate()` or something). This is kind of brittle, 
but it does work.


Regards,
Matthew Brush

___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel


___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel


Re: [Geany-Devel] [RFC]: Adding Filetype Extensions

2017-12-20 Thread Lex Trotman
On 21 December 2017 at 09:09, Matthew Brush  wrote:
> Hi,
>
> There are quite a few Issues/Pull Requests on Github about adding more
> extensions to `filetype_extensions.conf` so various types of files are
> detected/colourized/symbolized properly out of the box.
>
> IMO, we need a policy/guidance on what is acceptable.

Agreed, I have been taking the most conservative approach since its
harder to remove things once added, than it is to add them later if we
change our minds.  Having an actual policy would be a good thing,
though it probably would still involve some judgement.

> The way I see it there
> are a few ways we could handle it:
>
> 1) Add all filetype extensions possible as long as there's proof somewhere
> they actually exist/are used.
>
> 2) Add only popular, generic ones, for example JSON or YAML or actual
> programming languages supported by Geany.

This would be my proposed approach, add extensions that correspond to
actual filetypes, but NOT add every extension for every JS framework
to the JS filetype and every extension of every Python framework to
the Python filetype etc.  And of course once one is added they all
have to be added or the project is choosing winners amongst other
projects.

Languages that are actually subsets of others, eg JSON for JS and
Cython for Python are ok to just add to filetype.extensions.

But adding extensions for languages that only approximately correspond
to the filetype they are added to, is just making a promise that Geany
can't keep, and will only likely lead to user disappointment.  That
also applies to new versions of languages that are not mostly backward
compatible with the version currently in Geany.

Anything else should make a custom filetype.

>
> 3) Don't add anymore except when adding entirely new filetype support; the
> `filetype_extensions.conf` file is user-editable precisely for this reason.

Users of frameworks should be encouraged to make custom filetypes that
fall back to the right base filetype, add extra wordlists, and are
supported with tags for their APIs and maintained on the wiki by an
expert in them.  Users who install those custom filetypes can then add
them to their personal filetypes.extensions without every Geany user
who has no need of them having to pay the cost.

Also the framework expert mostly isn't the Geany devs, so getting bug
reports on Geany github is really wasting the posters time, hence the
suggestion of the wiki, or maybe a separate repo like themes/plugins.

>
> I don't really have an opinion on this, but it would be helpful to have some
> kind of consensus/policy on it, for the purposes of triaging Issues and Pull
> Requests on Github.

+1  Thanks for raising it.

Cheers
Lex

>
> Regards,
> Matthew Brush
> ___
> Devel mailing list
> Devel@lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel
___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel


[Geany-Devel] [RFC]: Adding Filetype Extensions

2017-12-20 Thread Matthew Brush

Hi,

There are quite a few Issues/Pull Requests on Github about adding more 
extensions to `filetype_extensions.conf` so various types of files are 
detected/colourized/symbolized properly out of the box.


IMO, we need a policy/guidance on what is acceptable. The way I see it 
there are a few ways we could handle it:


1) Add all filetype extensions possible as long as there's proof 
somewhere they actually exist/are used.


2) Add only popular, generic ones, for example JSON or YAML or actual 
programming languages supported by Geany.


3) Don't add anymore except when adding entirely new filetype support; 
the `filetype_extensions.conf` file is user-editable precisely for this 
reason.


I don't really have an opinion on this, but it would be helpful to have 
some kind of consensus/policy on it, for the purposes of triaging Issues 
and Pull Requests on Github.


Regards,
Matthew Brush
___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel


Re: [Geany-Devel] How can a plugin invoke menu items/geany actions?

2017-12-20 Thread Matthew Brush

On 2017-12-20 01:37 PM, Lars Paulsen wrote:

Hi All,

I would like to start actions in geany from inside a geany plugin?

E.g. start the Color Chooser as if it was selected from the geany tools 
menu.
I tried to call the callback function directly but that gives an linker 
error for geany plugins (just logical).


Can I fire/send an event/message to make it being started? How do I do 
that?




If you happen to find one that's not available as a keybinding command, 
you can also use `ui_lookup_widget()` to get a handle on the menu item 
and then activate it through code (ie. `gtk_actionable_activate()` or 
something). This is kind of brittle, but it does work.


Regards,
Matthew Brush

___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel


Re: [Geany-Devel] How can a plugin invoke menu items/geany actions?

2017-12-20 Thread Lex Trotman
On 21 December 2017 at 07:37, Lars Paulsen  wrote:
> Hi All,
>
> I would like to start actions in geany from inside a geany plugin?
>
> E.g. start the Color Chooser as if it was selected from the geany tools
> menu.
> I tried to call the callback function directly but that gives an linker
> error for geany plugins (just logical).
>
> Can I fire/send an event/message to make it being started? How do I do that?

https://www.geany.org/manual/reference/keybindings_8h.html#a9b9034dde2091a8d2653d99fcb270a93

>
> Best Regards,
> Lars
>
> ___
> Devel mailing list
> Devel@lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel
___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel


[Geany-Devel] How can a plugin invoke menu items/geany actions?

2017-12-20 Thread Lars Paulsen

Hi All,

I would like to start actions in geany from inside a geany plugin?

E.g. start the Color Chooser as if it was selected from the geany tools 
menu.
I tried to call the callback function directly but that gives an linker 
error for geany plugins (just logical).


Can I fire/send an event/message to make it being started? How do I do that?

Best Regards,
Lars

___
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel