aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColomban Wendling <ban@herbesfolles.org>2016-10-24 12:22:26 +0200
committerColomban Wendling <ban@herbesfolles.org>2016-10-24 12:22:26 +0200
commitd3f7382feed4805fda56b5f5803b5e917d1e292f (patch)
tree8b478feb480a5e9d048fd124bc40aa69717119d5
parent5de956723f737fa65b7bb453d7ad71cc914d8d50 (diff)
downloadscintilla-mirror-d3f7382feed4805fda56b5f5803b5e917d1e292f.tar.gz
GTK: Add some documentation on accessible object reference ownerships
-rw-r--r--gtk/ScintillaGTKAccessible.cxx22
-rw-r--r--gtk/ScintillaGTKAccessible.h1
2 files changed, 23 insertions, 0 deletions
diff --git a/gtk/ScintillaGTKAccessible.cxx b/gtk/ScintillaGTKAccessible.cxx
index e1f450467..30679ccae 100644
--- a/gtk/ScintillaGTKAccessible.cxx
+++ b/gtk/ScintillaGTKAccessible.cxx
@@ -3,6 +3,28 @@
/* Copyright 2016 by Colomban Wendling <colomban@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
diff --git a/gtk/ScintillaGTKAccessible.h b/gtk/ScintillaGTKAccessible.h
index 5614c88e2..93883025d 100644
--- a/gtk/ScintillaGTKAccessible.h
+++ b/gtk/ScintillaGTKAccessible.h
@@ -16,6 +16,7 @@ namespace Scintilla {
class ScintillaGTKAccessible {
private:
+ // weak references to related objects
GtkAccessible *accessible;
ScintillaGTK *sci;