<div dir="ltr"><br><div class="gmail_extra"><br>[...]<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
But it seems a pity to have to duplicate the glib interface for each<br>
structure that offers the facility, can we just return the GData and let<br>
the plugins use the normal g_datalist functions?<br>
<br>
</div></blockquote>
[...]<br></blockquote><div><br></div><div>To summarise the answer to the question Matthew gave on IRC, no, we don't have to duplicate the glib interface but it makes it easier to clean up after plugins if we do.  And its unlikely that many other structs will need it.</div>
<div><br></div><div>Ok, if thats the case then its reasonable to duplicate the (fairly small) g_datalist interface for the few structs that need the functionality.</div><div><br></div><div>[...]</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

We could just use the usual idiom (in G*) and use objects that have destruction signals and reference counting and such stuff that is useful for this type of scenario. IMO it'd be more useful to just treat GeanyDocuments like other stuff, and maybe having an _is_open() or _is_closed() function or something to see if the document you have a reference on is still open (if you didn't want to connect to its open/close signals it could emit).</blockquote>
<div><br></div><div>No problem to replace is_valid with an is_open function that can hide the implementation.  But whichever implementation is used, it is going to have to be able to identify if a pointer is no longer to an open document.  The current implementation sort of does that by keeping the document objects around so the test of the boolean is_valid is always legal.  Comparing the pointer against the list of open documents is a (slower) alternative.  It could also be implemented in some other way.</div>
<div><br></div><div>Cheers</div><div>Lex</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
Cheers,<br>
Matthew Brush<br>
<br>
______________________________<u></u>_________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org" target="_blank">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" target="_blank">https://lists.geany.org/cgi-<u></u>bin/mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br></div></div>