<div dir="ltr">Update:<div><br></div><div style>Matthew has pointed out on IRC that the markers and indicators are per scintilla object, not global.  He has a suggested alternative API which he will post after its tested.</div>
<div style><br></div><div style>Cheers</div><div style>Lex</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 5 April 2013 13:09, Lex Trotman <span dir="ltr"><<a href="mailto:elextr@gmail.com" target="_blank">elextr@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">There are several plugins that share limited resources, such as scintilla markers and indicators.<div><br>
</div><div>At the moment there is no coordination for using those resources so plugins can interfere with one another and possibly with Geany.</div>
<div><br></div><div>The only common thing between plugins and Geany is Geany, so this is a proposal to add a resources management interface to Geany.</div><div><br></div><div>The proposed interface is below, I have tried to make it so it is easy to expand to resources that are not integers (markers and indicators are all integers)</div>

<div><br></div><div>enum resource_type { GEANY_RESOURCE_MARKER, GEANY_RESOURCE_INDICATOR };</div><div>gboolean alloc_int_resource( enum resource_type, int* resource_num );</div><div>void free_int_resource( int resource_num );</div>

<div><br></div><div>This allows extra resources to be added without ABI changes (so long as they are added to the end of the enum).</div><div><br></div><div>If (when) other types of resource need managing then extra functions can be added again without breaking the ABI.</div>

<div><br></div><div>Automatic release is not suggested because that prevents use of RAII and similar management schemes in C++ or GC for other plugin languages.  For plain C plugins just call free_int_resource in the plugin_cleanup function.</div>

<div><br></div><div>Any simpler, more flexible suggestions?</div><div><br></div><div>Cheers<span class="HOEnZb"><font color="#888888"><br>Lex</font></span></div></div>
</blockquote></div><br></div>