Widget changed, so add it to the highlighing list */
| 873 | |
| 874 | /* Widget changed, so add it to the highlighing list */ |
| 875 | static void |
| 876 | ghack_highlight_widget(GtkWidget *widget, GtkStyle *oldStyle, |
| 877 | GtkStyle *newStyle) |
| 878 | { |
| 879 | Highlight *highlt; |
| 880 | GList *item; |
| 881 | |
| 882 | /* Check if this widget is already in the queue. If so then |
| 883 | * remove it, so we will only have the new entry in the queue */ |
| 884 | for (item = g_list_first(s_HighLightList); item;) { |
| 885 | highlt = (Highlight *) item->data; |
| 886 | if (highlt) { |
| 887 | if (highlt->widget == widget) { |
| 888 | s_HighLightList = g_list_remove_link(s_HighLightList, item); |
| 889 | g_free(highlt); |
| 890 | g_list_free_1(item); |
| 891 | break; |
| 892 | } |
| 893 | } |
| 894 | if (item) |
| 895 | item = item->next; |
| 896 | else |
| 897 | break; |
| 898 | } |
| 899 | |
| 900 | /* Ok, now highlight this widget and add it into the fade |
| 901 | * highlighting queue */ |
| 902 | highlt = g_new(Highlight, 1); |
| 903 | highlt->nTurnsLeft = NUM_TURNS_HIGHLIGHTED; |
| 904 | highlt->oldStyle = oldStyle; |
| 905 | highlt->widget = widget; |
| 906 | s_HighLightList = g_list_prepend(s_HighLightList, highlt); |
| 907 | gtk_widget_set_style(GTK_WIDGET(widget), newStyle); |
| 908 | } |
no outgoing calls
no test coverage detected