<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 6 April 2013 00:02, William Fraser <span dir="ltr"><<a href="mailto:william.fraser@virgin.net" target="_blank">william.fraser@virgin.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>I attached an int to each scintilla object to keep track of what's been assigned in my markers plugin. The only problem was that some markers are used by scintilla, so any plugin would have to make note of which ones were being used by the editor (with the problem that you would have to update plugins if editor changed) or, you would have to submit code to scintilla so that it also used the uniform resource allocation.</div>
</div></blockquote><div><br></div><div style>Hi William,</div><div style><br></div><div style>Which plugin is that?  And how do you know that say the bookmarks plugin isn't using that marker already?  Thats the sort of problem this is to solve.</div>
<div style><br></div><div style>Cheers</div><div style>Lex</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br><br>-------- Original Message --------<div>
<div class="h5"><br>Lex Trotman <<a href="mailto:elextr@gmail.com" target="_blank">elextr@gmail.com</a>> wrote:<br><br><div><blockquote style="margin:0pt 0pt 0pt 0.2ex;border-left:1px solid rgb(204,204,204);padding-left:0.8ex">

<div dir="ltr">Update:<div><br></div><div>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><br></div><div>Cheers</div><div>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><font color="#888888"><br>Lex</font></span></div></div>
</blockquote></div><br></div>
</blockquote></div></div></div></div>
<br>_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" target="_blank">https://lists.geany.org/cgi-bin/mailman/listinfo/devel</a><br>
<br></blockquote></div><br></div></div>