After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 132525 - GtkSourceMarker cant be wrapped by bindings because it has no gtype
GtkSourceMarker cant be wrapped by bindings because it has no gtype
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
0.7.x
Other All
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2004-01-26 06:09 UTC by Ben Maurer
Modified: 2014-02-15 12:53 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10



Description Ben Maurer 2004-01-26 06:09:11 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.
Comment 1 Gustavo Giráldez 2004-01-28 23:22:47 UTC
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.
Comment 2 Ben Maurer 2004-01-30 01:13:55 UTC
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.
Comment 3 Gustavo Giráldez 2004-02-21 18:50:30 UTC
Lowering severity since this can be worked around.
Comment 4 Paolo Maggi 2007-08-28 09:45:16 UTC
This should be fixable since GtkTextMark is now a GObject.
Comment 5 Yevgen Muntyan 2008-06-20 02:10:32 UTC
We have a type and everything now.