diff options
author | Matthias Clasen <mclasen@redhat.com> | 2017-11-29 23:22:13 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-11-29 23:22:13 -0500 |
commit | 0b39631464bf2300d25bb9e112089c556dc08f42 (patch) | |
tree | 9791da489f51954c39fa1150b2735fc08cb073eb /testsuite | |
parent | 3d4743ee62673415d3872d215fa472e883f5158f (diff) | |
download | gtk+-0b39631464bf2300d25bb9e112089c556dc08f42.tar.gz |
textview: Replace pixbufs by textures
This affects a few apis, such as gtk_text_iter_get_pixbuf,
gtk_text_buffer_insert_pixbuf and GtkTextBuffer::insert-pixbuf,
which have all been replaced by texture equivalents.
Update all callers.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gtk/textbuffer.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/testsuite/gtk/textbuffer.c b/testsuite/gtk/textbuffer.c index f7b2651c6b..4f8cefed4a 100644 --- a/testsuite/gtk/textbuffer.c +++ b/testsuite/gtk/textbuffer.c @@ -638,6 +638,7 @@ fill_buffer (GtkTextBuffer *buffer) GtkTextIter iter; GtkTextIter iter2; GdkPixbuf *pixbuf; + GdkTexture *texture; int i; color.red = 0.0; @@ -675,8 +676,9 @@ fill_buffer (GtkTextBuffer *buffer) NULL); pixbuf = gdk_pixbuf_new_from_xpm_data (book_closed_xpm); + texture = gdk_texture_new_for_pixbuf (pixbuf); - g_assert (pixbuf != NULL); + g_assert (texture != NULL); for (i = 0; i < 10; i++) { @@ -684,11 +686,11 @@ fill_buffer (GtkTextBuffer *buffer) gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0); - gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf); + gtk_text_buffer_insert_texture (buffer, &iter, texture); gtk_text_buffer_get_iter_at_offset (buffer, &iter, 1); - gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf); + gtk_text_buffer_insert_texture (buffer, &iter, texture); str = g_strdup_printf ("%d Hello World!\nwoo woo woo woo woo woo woo woo\n", i); @@ -704,20 +706,20 @@ fill_buffer (GtkTextBuffer *buffer) "Spanish (Espa\303\261ol) \302\241Hola! / French (Fran\303\247ais) Bonjour, Salut / German (Deutsch S\303\274d) Gr\303\274\303\237 Gott (testing Latin-1 chars encoded in UTF8)\nThai (we can't display this, just making sure we don't crash) (\340\270\240\340\270\262\340\270\251\340\270\262\340\271\204\340\270\227\340\270\242) \340\270\252\340\270\247\340\270\261\340\270\252\340\270\224\340\270\265\340\270\204\340\270\243\340\270\261\340\270\232, \340\270\252\340\270\247\340\270\261\340\270\252\340\270\224\340\270\265\340\270\204\340\271\210\340\270\260\n", -1); - gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf); - gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf); + gtk_text_buffer_insert_texture (buffer, &iter, texture); + gtk_text_buffer_insert_texture (buffer, &iter, texture); gtk_text_buffer_get_iter_at_offset (buffer, &iter, 4); - gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf); + gtk_text_buffer_insert_texture (buffer, &iter, texture); gtk_text_buffer_get_iter_at_offset (buffer, &iter, 7); - gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf); + gtk_text_buffer_insert_texture (buffer, &iter, texture); gtk_text_buffer_get_iter_at_offset (buffer, &iter, 8); - gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf); + gtk_text_buffer_insert_texture (buffer, &iter, texture); gtk_text_buffer_get_iter_at_line_offset (buffer, &iter, 0, 8); iter2 = iter; @@ -787,6 +789,7 @@ fill_buffer (GtkTextBuffer *buffer) gtk_text_buffer_apply_tag (buffer, tag, &iter, &iter2); g_object_unref (pixbuf); + g_object_unref (texture); } |