[geany/geany] 407cb3: GTK: Add some documentation on accessible object reference ownerships
Colomban Wendling
git-noreply at xxxxx
Tue Dec 20 20:45:29 UTC 2016
Branch: refs/heads/master
Author: Colomban Wendling <ban at herbesfolles.org>
Committer: Colomban Wendling <ban at herbesfolles.org>
Date: Tue, 20 Dec 2016 20:45:29 UTC
Commit: 407cb36cebdc58231c08fbc7f7bb535fcdc0e465
https://github.com/geany/geany/commit/407cb36cebdc58231c08fbc7f7bb535fcdc0e465
Log Message:
-----------
GTK: Add some documentation on accessible object reference ownerships
Modified Paths:
--------------
scintilla/gtk/ScintillaGTKAccessible.cxx
scintilla/gtk/ScintillaGTKAccessible.h
Modified: scintilla/gtk/ScintillaGTKAccessible.cxx
22 lines changed, 22 insertions(+), 0 deletions(-)
===================================================================
@@ -3,6 +3,28 @@
/* Copyright 2016 by Colomban Wendling <colomban at geany.org>
* The License.txt file describes the conditions under which this software may be distributed. */
+// REFERENCES BETWEEN THE DIFFERENT OBJECTS
+//
+// ScintillaGTKAccessible is the actual implementation, as a C++ class.
+// ScintillaObjectAccessible is the GObject derived from AtkObject that
+// implements the various ATK interfaces, through ScintillaGTKAccessible.
+// This follows the same pattern as ScintillaGTK and ScintillaObject.
+//
+// ScintillaGTK owns a strong reference to the ScintillaObjectAccessible, and
+// is both responsible for creating and destroying that object.
+//
+// ScintillaObjectAccessible owns a strong reference to ScintillaGTKAccessible,
+// and is responsible for creating and destroying that object.
+//
+// ScintillaGTKAccessible has weak references to both the ScintillaGTK and
+// the ScintillaObjectAccessible objects associated, but does not own any
+// strong references to those objects.
+//
+// The chain of ownership is as follows:
+// ScintillaGTK -> ScintillaObjectAccessible -> ScintillaGTKAccessible
+
+// DETAILS ON THE GOBJECT TYPE IMPLEMENTATION
+//
// On GTK < 3.2, we need to use the AtkObjectFactory. We need to query
// the factory to see what type we should derive from, thus making use of
// dynamic inheritance. It's tricky, but it works so long as it's done
Modified: scintilla/gtk/ScintillaGTKAccessible.h
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -16,6 +16,7 @@ namespace Scintilla {
class ScintillaGTKAccessible {
private:
+ // weak references to related objects
GtkAccessible *accessible;
ScintillaGTK *sci;
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Commits
mailing list