[easytag/wip/application-window: 7/45] Avoid use of deprecated foreground-gdk property



commit ef139130cb7aa9ec0e1e4c547e8e1d3c18a12612
Author: David King <amigadave amigadave com>
Date:   Fri Jul 4 21:59:18 2014 +0100

    Avoid use of deprecated foreground-gdk property
    
    Use new foreground-rgba property instead.

 src/browser.c |   14 ++++++------
 src/cddb.c    |    6 +++-
 src/et_core.c |    4 +--
 src/et_core.h |    4 +--
 src/misc.c    |   62 ++++++++++++++++++++++++++++----------------------------
 5 files changed, 44 insertions(+), 46 deletions(-)
---
diff --git a/src/browser.c b/src/browser.c
index 760c1b9..b5fb0d7 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -3363,7 +3363,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
                                         "text",           ARTIST_NAME,
                                         "weight",         ARTIST_FONT_WEIGHT,
                                         "style",          ARTIST_FONT_STYLE,
-                                        "foreground-gdk", ARTIST_ROW_FOREGROUND,
+                                        "foreground-rgba", ARTIST_ROW_FOREGROUND,
                                         NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(BrowserArtistList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -3378,7 +3378,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
                                         "text",           ARTIST_NUM_ALBUMS,
                                         "weight",         ARTIST_FONT_WEIGHT,
                                         "style",          ARTIST_FONT_STYLE,
-                                        "foreground-gdk", ARTIST_ROW_FOREGROUND,
+                                        "foreground-rgba", ARTIST_ROW_FOREGROUND,
                                         NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(BrowserArtistList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -3393,7 +3393,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
                                         "text",           ARTIST_NUM_FILES,
                                         "weight",         ARTIST_FONT_WEIGHT,
                                         "style",          ARTIST_FONT_STYLE,
-                                        "foreground-gdk", ARTIST_ROW_FOREGROUND,
+                                        "foreground-rgba", ARTIST_ROW_FOREGROUND,
                                         NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(BrowserArtistList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -3444,7 +3444,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
                                         "text",           ALBUM_NAME,
                                         "weight",         ALBUM_FONT_WEIGHT,
                                         "style",          ALBUM_FONT_STYLE,
-                                        "foreground-gdk", ALBUM_ROW_FOREGROUND,
+                                        "foreground-rgba", ALBUM_ROW_FOREGROUND,
                                         NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(BrowserAlbumList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -3459,7 +3459,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
                                         "text",           ALBUM_NUM_FILES,
                                         "weight",         ALBUM_FONT_WEIGHT,
                                         "style",          ALBUM_FONT_STYLE,
-                                        "foreground-gdk", ALBUM_ROW_FOREGROUND,
+                                        "foreground-rgba", ALBUM_ROW_FOREGROUND,
                                         NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(BrowserAlbumList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -3510,7 +3510,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
                                         G_TYPE_BOOLEAN, /* File OtherDir. */
                                         G_TYPE_INT, /* Font weight. */
                                         GDK_TYPE_RGBA, /* Row background. */
-                                        GDK_TYPE_COLOR); /* Row foreground. */
+                                        GDK_TYPE_RGBA); /* Row foreground. */
 
     BrowserList = gtk_tree_view_new_with_model(GTK_TREE_MODEL(fileListModel));
     g_object_unref (fileListModel);
@@ -3532,7 +3532,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
                                             "weight", LIST_FONT_WEIGHT,
                                             "background-rgba",
                                             LIST_ROW_BACKGROUND,
-                                            "foreground-gdk",
+                                            "foreground-rgba",
                                             LIST_ROW_FOREGROUND, NULL);
         gtk_tree_view_column_set_resizable (column, TRUE);
         gtk_tree_view_append_column (GTK_TREE_VIEW (BrowserList), column);
diff --git a/src/cddb.c b/src/cddb.c
index e90daa7..a267c19 100644
--- a/src/cddb.c
+++ b/src/cddb.c
@@ -707,7 +707,7 @@ void Open_Cddb_Window (void)
                                                       "text",           CDDB_ALBUM_LIST_ALBUM,
                                                       "weight",         CDDB_ALBUM_LIST_FONT_WEIGHT,
                                                       "style",          CDDB_ALBUM_LIST_FONT_STYLE,
-                                                      "foreground-gdk", CDDB_ALBUM_LIST_FOREGROUND_COLOR,
+                                                      "foreground-rgba", CDDB_ALBUM_LIST_FOREGROUND_COLOR,
                                                       NULL);
     gtk_tree_view_column_set_resizable(column, TRUE);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -718,7 +718,7 @@ void Open_Cddb_Window (void)
                                                       "text",           CDDB_ALBUM_LIST_CATEGORY,
                                                       "weight",         CDDB_ALBUM_LIST_FONT_WEIGHT,
                                                       "style",          CDDB_ALBUM_LIST_FONT_STYLE,
-                                                      "foreground-gdk", CDDB_ALBUM_LIST_FOREGROUND_COLOR,
+                                                      "foreground-rgba", CDDB_ALBUM_LIST_FOREGROUND_COLOR,
                                                       NULL);
     gtk_tree_view_column_set_resizable(column, TRUE);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -3793,6 +3793,7 @@ Cddb_Album_List_Set_Row_Appearance (GtkTreeIter *row)
         {
             if (cddbalbum->other_version == TRUE)
             {
+                const GdkRGBA LIGHT_RED = { 1.0, 0.5, 0.5, 1.0};
                 gtk_list_store_set(CddbAlbumListModel, row,
                                    CDDB_ALBUM_LIST_FONT_STYLE,       PANGO_STYLE_NORMAL,
                                    CDDB_ALBUM_LIST_FONT_WEIGHT,      PANGO_WEIGHT_NORMAL,
@@ -3817,6 +3818,7 @@ Cddb_Album_List_Set_Row_Appearance (GtkTreeIter *row)
                                    CDDB_ALBUM_LIST_FOREGROUND_COLOR, NULL,-1);
             } else
             {
+                const GdkRGBA GREY = { 0.664, 0.664, 0.664, 1.0 };
                 gtk_list_store_set(CddbAlbumListModel, row,
                                    CDDB_ALBUM_LIST_FONT_STYLE,       PANGO_STYLE_NORMAL,
                                    CDDB_ALBUM_LIST_FONT_WEIGHT,      PANGO_WEIGHT_NORMAL,
diff --git a/src/et_core.c b/src/et_core.c
index e3b1f7e..e86fcba 100644
--- a/src/et_core.c
+++ b/src/et_core.c
@@ -122,9 +122,7 @@ const gsize ET_FILE_DESCRIPTION_SIZE = G_N_ELEMENTS (ETFileDescription) - 1;
 /*
  * Colors Used
  */
-GdkColor RED        = {0, 0xffff, 0x0000, 0x0000};
-GdkColor LIGHT_RED  = {0, 0xffff, 0x8888, 0x8888};
-GdkColor GREY       = {0, 0xaa00, 0xaa00, 0xaa00};
+GdkRGBA RED = {1.0, 0.0, 0.0, 1.0 };
 
 
 /**************
diff --git a/src/et_core.h b/src/et_core.h
index 16e4985..101c9cb 100644
--- a/src/et_core.h
+++ b/src/et_core.h
@@ -32,9 +32,7 @@ G_BEGIN_DECLS
 /*
  * Colors Used (see declaration into et_core.c)
  */
-extern GdkColor RED;
-extern GdkColor LIGHT_RED;
-extern GdkColor GREY;
+extern GdkRGBA RED;
 
 
 /*
diff --git a/src/misc.c b/src/misc.c
index fdf3057..aa0b9de 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -2028,21 +2028,21 @@ void Open_Search_File_Window (void)
                                                G_TYPE_INT, /* Font Weight for URL */
                                                G_TYPE_INT, /* Font Weight for Encoded by */
 
-                                               GDK_TYPE_COLOR, /* Color Weight for Filename */
-                                               GDK_TYPE_COLOR, /* Color Weight for Title */
-                                               GDK_TYPE_COLOR, /* Color Weight for Artist */
-                                               GDK_TYPE_COLOR, /* Color Weight for Album Artist */
-                                                                                          GDK_TYPE_COLOR, /* 
Color Weight for Album */
-                                               GDK_TYPE_COLOR, /* Color Weight for Disc Number */
-                                               GDK_TYPE_COLOR, /* Color Weight for Year */
-                                               GDK_TYPE_COLOR, /* Color Weight for Track + Track Total */
-                                               GDK_TYPE_COLOR, /* Color Weight for Genre */
-                                               GDK_TYPE_COLOR, /* Color Weight for Comment */
-                                               GDK_TYPE_COLOR, /* Color Weight for Composer */
-                                               GDK_TYPE_COLOR, /* Color Weight for Orig. Artist */
-                                               GDK_TYPE_COLOR, /* Color Weight for Copyright */
-                                               GDK_TYPE_COLOR, /* Color Weight for URL */
-                                               GDK_TYPE_COLOR, /* Color Weight for Encoded by */
+                                               GDK_TYPE_RGBA, /* Color Weight for Filename */
+                                               GDK_TYPE_RGBA, /* Color Weight for Title */
+                                               GDK_TYPE_RGBA, /* Color Weight for Artist */
+                                               GDK_TYPE_RGBA, /* Color Weight for Album Artist */
+                                               GDK_TYPE_RGBA, /* Color Weight for Album */
+                                               GDK_TYPE_RGBA, /* Color Weight for Disc Number */
+                                               GDK_TYPE_RGBA, /* Color Weight for Year */
+                                               GDK_TYPE_RGBA, /* Color Weight for Track + Track Total */
+                                               GDK_TYPE_RGBA, /* Color Weight for Genre */
+                                               GDK_TYPE_RGBA, /* Color Weight for Comment */
+                                               GDK_TYPE_RGBA, /* Color Weight for Composer */
+                                               GDK_TYPE_RGBA, /* Color Weight for Orig. Artist */
+                                               GDK_TYPE_RGBA, /* Color Weight for Copyright */
+                                               GDK_TYPE_RGBA, /* Color Weight for URL */
+                                               GDK_TYPE_RGBA, /* Color Weight for Encoded by */
 
                                                G_TYPE_POINTER);
     SearchResultList = gtk_tree_view_new_with_model(GTK_TREE_MODEL(SearchResultListModel));
@@ -2052,7 +2052,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[0]), renderer,
                                                       "text",           SEARCH_RESULT_FILENAME,
                                                       "weight",         SEARCH_RESULT_FILENAME_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_FILENAME_FOREGROUND,
+                                                      "foreground-rgba", SEARCH_RESULT_FILENAME_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2061,7 +2061,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[1]), renderer,
                                                       "text",           SEARCH_RESULT_TITLE,
                                                       "weight",         SEARCH_RESULT_TITLE_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_TITLE_FOREGROUND,
+                                                      "foreground-rgba", SEARCH_RESULT_TITLE_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2070,7 +2070,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[2]), renderer,
                                                       "text",           SEARCH_RESULT_ARTIST,
                                                       "weight",         SEARCH_RESULT_ARTIST_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_ARTIST_FOREGROUND,
+                                                      "foreground-rgba", SEARCH_RESULT_ARTIST_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2079,7 +2079,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[3]), renderer,
                                                       "text",           SEARCH_RESULT_ALBUM_ARTIST,
                                                       "weight",         SEARCH_RESULT_ALBUM_ARTIST_WEIGHT,
-                                                      "foreground-gdk", 
SEARCH_RESULT_ALBUM_ARTIST_FOREGROUND,
+                                                      "foreground-rgba", 
SEARCH_RESULT_ALBUM_ARTIST_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2088,7 +2088,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[4]), renderer,
                                                       "text",           SEARCH_RESULT_ALBUM,
                                                       "weight",         SEARCH_RESULT_ALBUM_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_ALBUM_FOREGROUND,
+                                                      "foreground-rgba", SEARCH_RESULT_ALBUM_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2097,7 +2097,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[5]), renderer,
                                                       "text",           SEARCH_RESULT_DISC_NUMBER,
                                                       "weight",         SEARCH_RESULT_DISC_NUMBER_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_DISC_NUMBER_FOREGROUND,
+                                                      "foreground-rgba", 
SEARCH_RESULT_DISC_NUMBER_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2106,7 +2106,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[6]), renderer,
                                                       "text",           SEARCH_RESULT_YEAR,
                                                       "weight",         SEARCH_RESULT_YEAR_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_YEAR_FOREGROUND,
+                                                      "foreground-rgba", SEARCH_RESULT_YEAR_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2115,7 +2115,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[7]), renderer,
                                                       "text",           SEARCH_RESULT_TRACK,
                                                       "weight",         SEARCH_RESULT_TRACK_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_TRACK_FOREGROUND,
+                                                      "foreground-rgba", SEARCH_RESULT_TRACK_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2124,7 +2124,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[8]), renderer,
                                                       "text",           SEARCH_RESULT_GENRE,
                                                       "weight",         SEARCH_RESULT_GENRE_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_GENRE_FOREGROUND,
+                                                      "foreground-rgba", SEARCH_RESULT_GENRE_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2133,7 +2133,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[9]), renderer,
                                                       "text",           SEARCH_RESULT_COMMENT,
                                                       "weight",         SEARCH_RESULT_COMMENT_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_COMMENT_FOREGROUND,
+                                                      "foreground-rgba", SEARCH_RESULT_COMMENT_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2142,7 +2142,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[10]), renderer,
                                                       "text",           SEARCH_RESULT_COMPOSER,
                                                       "weight",         SEARCH_RESULT_COMPOSER_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_COMPOSER_FOREGROUND,
+                                                      "foreground-rgba", SEARCH_RESULT_COMPOSER_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2151,7 +2151,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[11]), renderer,
                                                       "text",           SEARCH_RESULT_ORIG_ARTIST,
                                                       "weight",         SEARCH_RESULT_ORIG_ARTIST_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_ORIG_ARTIST_FOREGROUND,
+                                                      "foreground-rgba", 
SEARCH_RESULT_ORIG_ARTIST_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2160,7 +2160,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[12]), renderer,
                                                       "text",           SEARCH_RESULT_COPYRIGHT,
                                                       "weight",         SEARCH_RESULT_COPYRIGHT_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_COPYRIGHT_FOREGROUND,
+                                                      "foreground-rgba", SEARCH_RESULT_COPYRIGHT_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2169,7 +2169,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[13]), renderer,
                                                       "text",           SEARCH_RESULT_URL,
                                                       "weight",         SEARCH_RESULT_URL_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_URL_FOREGROUND,
+                                                      "foreground-rgba", SEARCH_RESULT_URL_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2178,7 +2178,7 @@ void Open_Search_File_Window (void)
     column = gtk_tree_view_column_new_with_attributes(_(SearchResultList_Titles[14]), renderer,
                                                       "text",           SEARCH_RESULT_ENCODED_BY,
                                                       "weight",         SEARCH_RESULT_ENCODED_BY_WEIGHT,
-                                                      "foreground-gdk", SEARCH_RESULT_ENCODED_BY_FOREGROUND,
+                                                      "foreground-rgba", SEARCH_RESULT_ENCODED_BY_FOREGROUND,
                                                       NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(SearchResultList), column);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
@@ -2457,7 +2457,7 @@ Add_Row_To_Search_Result_List (ET_File *ETFile, const gchar *string_to_search)
                                         PANGO_WEIGHT_NORMAL, PANGO_WEIGHT_NORMAL,
                                         PANGO_WEIGHT_NORMAL, PANGO_WEIGHT_NORMAL,
                                         PANGO_WEIGHT_NORMAL};
-    GdkColor *SearchResultList_Color[15] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    GdkRGBA *SearchResultList_Color[15] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                             NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                             NULL};
     gchar *track, *track_total;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]