GNOME Bugzilla – Bug 132525
GtkSourceMarker cant be wrapped by bindings because it has no gtype
Last modified: 2014-02-15 12:53:14 UTC
GtkSourceMarker has no unique GType. As a result, a binding cannot accurately bind to it, because it will guess that it is a TextIter. As a consequence, in languages that do checked casts, you end up with an exception. This is due to the following C code: 33 GType 34 gtk_source_marker_get_type (void) 35 { 36 static GType our_type = 0; 37 38 /* this function's solely purpose is to allow us to later 39 * derive GtkSourceMarker from other base object and not break 40 * ABI compatibility (since this way the type is resolved at 41 * runtime) */ 42 if (!our_type) { 43 gustavo 1.2 our_type = GTK_TYPE_TEXT_MARK; By returning GTK_TYPE_TEXT_MARK, the binding is not able to tell the true type of the object.
As discussed on IRC, my propossed solution is to have GtkSourceMarker aggregate a GtkTextMark and not try to derive from it. This is not the ideal solution, but it's the only thing we can do about this until the we can create custom marks in a GtkTextBuffer. Unless anybody has a better idea, I'll implement this in the Gnome 2.8 timeframe.
Actually, if we complete bug 132821 (making SourceMarkers line based), we could just mark all the SourceMarker related items depreciated, and ignore the matter. This would keep A[P/B]I for existing C programs.
Lowering severity since this can be worked around.
This should be fixable since GtkTextMark is now a GObject.
We have a type and everything now.