[gtk+] tests textbuffer: don't use GdkColor (deprecated)
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] tests textbuffer: don't use GdkColor (deprecated)
- Date: Wed, 20 Aug 2014 15:47:17 +0000 (UTC)
commit 7bc819e88d8880487653740f55e9bf072d5de36e
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Aug 20 17:13:46 2014 +0200
tests textbuffer: don't use GdkColor (deprecated)
testsuite/gtk/textbuffer.c | 46 +++++++++++++++++++++++--------------------
1 files changed, 25 insertions(+), 21 deletions(-)
---
diff --git a/testsuite/gtk/textbuffer.c b/testsuite/gtk/textbuffer.c
index 50f50ac..3d8d872 100644
--- a/testsuite/gtk/textbuffer.c
+++ b/testsuite/gtk/textbuffer.c
@@ -633,37 +633,44 @@ static void
fill_buffer (GtkTextBuffer *buffer)
{
GtkTextTag *tag;
- GdkColor color, color2;
+ GdkRGBA color;
+ GdkRGBA color2;
GtkTextIter iter;
GtkTextIter iter2;
GdkPixbuf *pixbuf;
int i;
- color.red = color.green = 0;
- color.blue = 0xffff;
- color2.red = 0xfff;
- color2.blue = 0x0;
- color2.green = 0;
-
+ color.red = 0.0;
+ color.green = 0.0;
+ color.blue = 1.0;
+ color.alpha = 1.0;
+
+ color2.red = 1.0;
+ color2.green = 0.0;
+ color2.blue = 0.0;
+ color2.alpha = 1.0;
+
gtk_text_buffer_create_tag (buffer, "fg_blue",
- "foreground_gdk", &color,
- "background_gdk", &color2,
+ "foreground_rgba", &color,
+ "background_rgba", &color2,
"font", "-*-courier-bold-r-*-*-30-*-*-*-*-*-*-*",
NULL);
- color.blue = color.green = 0;
- color.red = 0xffff;
-
+ color.red = 1.0;
+ color.green = 0.0;
+ color.blue = 0.0;
+
gtk_text_buffer_create_tag (buffer, "fg_red",
"rise", -4,
- "foreground_gdk", &color,
+ "foreground_rgba", &color,
NULL);
- color.blue = color.red = 0;
- color.green = 0xffff;
-
+ color.red = 0.0;
+ color.green = 1.0;
+ color.blue = 0.0;
+
gtk_text_buffer_create_tag (buffer, "bg_green",
- "background_gdk", &color,
+ "background_rgba", &color,
"font", "-*-courier-bold-r-*-*-10-*-*-*-*-*-*-*",
NULL);
@@ -671,8 +678,7 @@ fill_buffer (GtkTextBuffer *buffer)
g_assert (pixbuf != NULL);
- i = 0;
- while (i < 10)
+ for (i = 0; i < 10; i++)
{
gchar *str;
@@ -752,8 +758,6 @@ fill_buffer (GtkTextBuffer *buffer)
gtk_text_buffer_remove_tag_by_name (buffer, "fg_red", &iter, &iter2);
gtk_text_buffer_remove_tag_by_name (buffer, "fg_blue", &iter, &iter2);
-
- ++i;
}
/* Put in tags that are just at the beginning, and just near the end,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]