diff options
author | Alexander Larsson <alexl@redhat.com> | 2015-11-09 22:18:05 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2015-11-10 08:39:47 +0100 |
commit | 0af457639dc5eb14a060183fbd3051870055c9ab (patch) | |
tree | f30bf4841ece0b752e9dd93a1ee553a62d41fec3 /gtk/gtktextview.h | |
parent | b0a6af3783a8dd50781ca921de81d3879aafbb00 (diff) | |
download | gtk+-0af457639dc5eb14a060183fbd3051870055c9ab.tar.gz |
TextView: Use saner coordinate space in draw_layer.
When I added the draw_layer vfunc it accidentally got passed a cairo_t
that was configured with to draw in the viewport coordinate space (rather
than the buffer coordinate space). This makes things unnecessary complex,
because you have to convert between the two.
The pixel cache is shared between the text and the layers, so there is
no way to use draw_layer to get a stationary overlay effect. Thus it makes
much more sense for the draw_layer vfunc to draw in the buffer space.
Just changing this would break ABI for existing code, so this is fixed
by adding new layer types and deprecating the old ones.
Also, we use the new layer types to fix gtk3-widget-factory.
https://bugzilla.gnome.org/show_bug.cgi?id=757856
Diffstat (limited to 'gtk/gtktextview.h')
-rw-r--r-- | gtk/gtktextview.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gtk/gtktextview.h b/gtk/gtktextview.h index 41a54ba406..203fcfba1f 100644 --- a/gtk/gtktextview.h +++ b/gtk/gtktextview.h @@ -69,8 +69,10 @@ typedef enum /** * GtkTextViewLayer: - * @GTK_TEXT_VIEW_LAYER_BELOW: The layer rendered below the text (but above the background). - * @GTK_TEXT_VIEW_LAYER_ABOVE: The layer rendered above the text. + * @GTK_TEXT_VIEW_LAYER_BELOW: Old deprecated layer, use %GTK_TEXT_VIEW_LAYER_BELOW_TEXT instead + * @GTK_TEXT_VIEW_LAYER_ABOVE: Old deprecated layer, use %GTK_TEXT_VIEW_LAYER_ABOVE_TEXT instead + * @GTK_TEXT_VIEW_LAYER_BELOW_TEXT: The layer rendered below the text (but above the background). Since: 3.20 + * @GTK_TEXT_VIEW_LAYER_ABOVE_TEXT: The layer rendered above the text. Since: 3.20 * * Used to reference the layers of #GtkTextView for the purpose of customized * drawing with the ::draw_layer vfunc. @@ -78,7 +80,9 @@ typedef enum typedef enum { GTK_TEXT_VIEW_LAYER_BELOW, - GTK_TEXT_VIEW_LAYER_ABOVE + GTK_TEXT_VIEW_LAYER_ABOVE, + GTK_TEXT_VIEW_LAYER_BELOW_TEXT, + GTK_TEXT_VIEW_LAYER_ABOVE_TEXT } GtkTextViewLayer; /** @@ -149,7 +153,10 @@ struct _GtkTextView * @draw_layer: The draw_layer vfunc is called before and after the text * view is drawing its own text. Applications can override this vfunc * in a subclass to draw customized content underneath or above the - * text. Since: 3.14 + * text. In the %GTK_TEXT_VIEW_LAYER_BELOW_TEXT and %GTK_TEXT_VIEW_LAYER_ABOVE_TEXT + * the drawing is done in the buffer coordinate space, but the older (deprecated) + * layers %GTK_TEXT_VIEW_LAYER_BELOW and %GTK_TEXT_VIEW_LAYER_ABOVE work in viewport + * coordinates, which makes them unnecessarily hard to use. Since: 3.14 * @extend_selection: The class handler for the #GtkTextView::extend-selection * signal. Since 3.16 */ |