Commit 26ff334a71b62e1eaab41fada8595b9973bb9789
1 parent
aedb9f0e
Exists in
master
and in
5 other branches
Objeto GdkColor foi "deprecado" substituindo por GdkRGBA
Showing
8 changed files
with
126 additions
and
110 deletions
Show diff stats
src/include/pw3270/v3270.h
@@ -46,6 +46,18 @@ | @@ -46,6 +46,18 @@ | ||
46 | #define GTK_IS_V3270_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_V3270)) | 46 | #define GTK_IS_V3270_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_V3270)) |
47 | #define GTK_V3270_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_V3270, v3270Class)) | 47 | #define GTK_V3270_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_V3270, v3270Class)) |
48 | 48 | ||
49 | +#if ! GTK_CHECK_VERSION(3,0,0) | ||
50 | + #define GdkRGBA GdkColor | ||
51 | + #define gdk_cairo_set_source_rgba(cr,cl) gdk_cairo_set_source_color(cr,cl) | ||
52 | + #define gdk_rgba_to_string(c) gdk_color_to_string(c) | ||
53 | + #define gdk_rgba_equal(a,b) gdk_color_equal(a,b) | ||
54 | + #define gdk_rgba_to_string(c) gdk_color_to_string(c) | ||
55 | + #define gtk_color_selection_set_current_rgba(w,c) gtk_color_selection_set_current_color(w,c) | ||
56 | + #define gtk_color_selection_get_current_rgba(w,c) gtk_color_selection_get_current_color(w,c) | ||
57 | + #define gtk_color_selection_set_previous_rgba(w,c) gtk_color_selection_set_previous_color(w,c) | ||
58 | + #define gtk_color_selection_set_current_rgba(w,c) gtk_color_selection_set_current_color(w,c) | ||
59 | +#endif // !GTK(3,0,0) | ||
60 | + | ||
49 | 61 | ||
50 | typedef struct _v3270 v3270; | 62 | typedef struct _v3270 v3270; |
51 | typedef struct _v3270Class v3270Class; | 63 | typedef struct _v3270Class v3270Class; |
@@ -178,12 +190,12 @@ | @@ -178,12 +190,12 @@ | ||
178 | 190 | ||
179 | // Colors | 191 | // Colors |
180 | LIB3270_EXPORT void v3270_set_colors(GtkWidget *widget, const gchar *); | 192 | LIB3270_EXPORT void v3270_set_colors(GtkWidget *widget, const gchar *); |
181 | - LIB3270_EXPORT void v3270_set_color_table(GdkColor *table, const gchar *colors); | ||
182 | - LIB3270_EXPORT const GdkColor * v3270_get_color_table(GtkWidget *widget); | ||
183 | - LIB3270_EXPORT void v3270_set_mono_color_table(GdkColor *table, const gchar *fg, const gchar *bg); | ||
184 | - LIB3270_EXPORT void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, guint height, GdkRectangle *rect, GdkColor *color); | ||
185 | - LIB3270_EXPORT void v3270_set_color(GtkWidget *widget, enum V3270_COLOR id, GdkColor *color); | ||
186 | - LIB3270_EXPORT GdkColor * v3270_get_color(GtkWidget *widget, enum V3270_COLOR id); | 193 | + LIB3270_EXPORT void v3270_set_color_table(GdkRGBA *table, const gchar *colors); |
194 | + LIB3270_EXPORT const GdkRGBA * v3270_get_color_table(GtkWidget *widget); | ||
195 | + LIB3270_EXPORT void v3270_set_mono_color_table(GdkRGBA *table, const gchar *fg, const gchar *bg); | ||
196 | + LIB3270_EXPORT void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, guint height, GdkRectangle *rect, GdkRGBA *color); | ||
197 | + LIB3270_EXPORT void v3270_set_color(GtkWidget *widget, enum V3270_COLOR id, GdkRGBA *color); | ||
198 | + LIB3270_EXPORT GdkRGBA * v3270_get_color(GtkWidget *widget, enum V3270_COLOR id); | ||
187 | 199 | ||
188 | // Misc | 200 | // Misc |
189 | LIB3270_EXPORT GtkIMContext * v3270_get_im_context(GtkWidget *widget); | 201 | LIB3270_EXPORT GtkIMContext * v3270_get_im_context(GtkWidget *widget); |
src/pw3270/colors.c
@@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
32 | 32 | ||
33 | /*--[ Implement ]------------------------------------------------------------------------------------*/ | 33 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
34 | 34 | ||
35 | -static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | 35 | +static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkRGBA *clr) |
36 | { | 36 | { |
37 | #define V3270_COLOR_BASE V3270_COLOR_GRAY+1 | 37 | #define V3270_COLOR_BASE V3270_COLOR_GRAY+1 |
38 | 38 | ||
@@ -54,7 +54,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -54,7 +54,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
54 | 54 | ||
55 | case V3270_COLOR_BASE: // All colors, update it | 55 | case V3270_COLOR_BASE: // All colors, update it |
56 | for(f=0;f<V3270_COLOR_BASE;f++) | 56 | for(f=0;f<V3270_COLOR_BASE;f++) |
57 | - gdk_color_parse(str[f],clr+f); | 57 | + gdk_rgba_parse(clr+f,str[f]); |
58 | break; | 58 | break; |
59 | 59 | ||
60 | default: | 60 | default: |
@@ -62,8 +62,8 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -62,8 +62,8 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
62 | // Unexpected size, load new colors over the defaults | 62 | // Unexpected size, load new colors over the defaults |
63 | g_warning("base color list in %s has %d elements, should have %d",group,g_strv_length(str),V3270_COLOR_GRAY); | 63 | g_warning("base color list in %s has %d elements, should have %d",group,g_strv_length(str),V3270_COLOR_GRAY); |
64 | 64 | ||
65 | - gdk_color_parse(str[0],clr); | ||
66 | - gdk_color_parse(str[1],clr+1); | 65 | + gdk_rgba_parse(clr,str[0]); |
66 | + gdk_rgba_parse(clr+1,str[1]); | ||
67 | 67 | ||
68 | for(f=2;f<V3270_COLOR_BASE;f++) | 68 | for(f=2;f<V3270_COLOR_BASE;f++) |
69 | clr[f] = clr[1]; | 69 | clr[f] = clr[1]; |
@@ -71,7 +71,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -71,7 +71,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
71 | clr[V3270_COLOR_BLACK] = *clr; | 71 | clr[V3270_COLOR_BLACK] = *clr; |
72 | 72 | ||
73 | for(f=2;f<MIN(g_strv_length(str),V3270_COLOR_BASE-1);f++) | 73 | for(f=2;f<MIN(g_strv_length(str),V3270_COLOR_BASE-1);f++) |
74 | - gdk_color_parse(str[f],clr+f); | 74 | + gdk_rgba_parse(clr+f,str[f]); |
75 | 75 | ||
76 | } | 76 | } |
77 | g_strfreev(str); | 77 | g_strfreev(str); |
@@ -81,8 +81,8 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -81,8 +81,8 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
81 | { | 81 | { |
82 | g_warning("Color scheme [%s] has no \"base\" entry, using green on black",group); | 82 | g_warning("Color scheme [%s] has no \"base\" entry, using green on black",group); |
83 | 83 | ||
84 | - gdk_color_parse("black",clr); | ||
85 | - gdk_color_parse("green",clr+1); | 84 | + gdk_rgba_parse(clr,"black"); |
85 | + gdk_rgba_parse(clr+1,"green"); | ||
86 | 86 | ||
87 | for(f=2;f<V3270_COLOR_BASE;f++) | 87 | for(f=2;f<V3270_COLOR_BASE;f++) |
88 | clr[f] = clr[1]; | 88 | clr[f] = clr[1]; |
@@ -101,7 +101,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -101,7 +101,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
101 | gchar **str = g_strsplit(val,",",5); | 101 | gchar **str = g_strsplit(val,",",5); |
102 | 102 | ||
103 | for(f=0;f< MIN(g_strv_length(str),4); f++) | 103 | for(f=0;f< MIN(g_strv_length(str),4); f++) |
104 | - gdk_color_parse(str[f],clr+V3270_COLOR_FIELD+f); | 104 | + gdk_rgba_parse(clr+V3270_COLOR_FIELD+f,str[f]); |
105 | 105 | ||
106 | g_strfreev(str); | 106 | g_strfreev(str); |
107 | } | 107 | } |
@@ -115,7 +115,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -115,7 +115,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
115 | gchar **str = g_strsplit(val,",",3); | 115 | gchar **str = g_strsplit(val,",",3); |
116 | 116 | ||
117 | for(f=0;f< MIN(g_strv_length(str),2); f++) | 117 | for(f=0;f< MIN(g_strv_length(str),2); f++) |
118 | - gdk_color_parse(str[f],clr+V3270_COLOR_SELECTED_BG+f); | 118 | + gdk_rgba_parse(clr+V3270_COLOR_SELECTED_BG+f,str[f]); |
119 | 119 | ||
120 | g_strfreev(str); | 120 | g_strfreev(str); |
121 | } | 121 | } |
@@ -143,13 +143,13 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -143,13 +143,13 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
143 | if(g_strv_length(str) == 5) | 143 | if(g_strv_length(str) == 5) |
144 | { | 144 | { |
145 | for(f=0;f < 5; f++) | 145 | for(f=0;f < 5; f++) |
146 | - gdk_color_parse(str[f],clr+V3270_COLOR_OIA_BACKGROUND+f); | 146 | + gdk_rgba_parse(clr+V3270_COLOR_OIA_BACKGROUND+f,str[f]); |
147 | clr[V3270_COLOR_OIA_STATUS_INVALID] = clr[V3270_COLOR_OIA_STATUS_WARNING]; | 147 | clr[V3270_COLOR_OIA_STATUS_INVALID] = clr[V3270_COLOR_OIA_STATUS_WARNING]; |
148 | } | 148 | } |
149 | else | 149 | else |
150 | { | 150 | { |
151 | for(f=0;f< MIN(g_strv_length(str),6); f++) | 151 | for(f=0;f< MIN(g_strv_length(str),6); f++) |
152 | - gdk_color_parse(str[f],clr+V3270_COLOR_OIA_BACKGROUND+f); | 152 | + gdk_rgba_parse(clr+V3270_COLOR_OIA_BACKGROUND+f,str[f]); |
153 | } | 153 | } |
154 | 154 | ||
155 | g_strfreev(str); | 155 | g_strfreev(str); |
@@ -160,7 +160,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -160,7 +160,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
160 | 160 | ||
161 | val = g_key_file_get_string(conf,group,"cross-hair",NULL); | 161 | val = g_key_file_get_string(conf,group,"cross-hair",NULL); |
162 | if(val) | 162 | if(val) |
163 | - gdk_color_parse(val,clr+V3270_COLOR_CROSS_HAIR); | 163 | + gdk_rgba_parse(clr+V3270_COLOR_CROSS_HAIR,val); |
164 | 164 | ||
165 | } | 165 | } |
166 | 166 | ||
@@ -168,7 +168,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -168,7 +168,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
168 | { | 168 | { |
169 | GtkWidget * terminal = (GtkWidget *) g_object_get_data(G_OBJECT(combo),"terminal_widget"); | 169 | GtkWidget * terminal = (GtkWidget *) g_object_get_data(G_OBJECT(combo),"terminal_widget"); |
170 | GtkWidget * colorsel = (GtkWidget *) g_object_get_data(G_OBJECT(combo),"color_selection_widget"); | 170 | GtkWidget * colorsel = (GtkWidget *) g_object_get_data(G_OBJECT(combo),"color_selection_widget"); |
171 | - GdkColor * clr = NULL; | 171 | + GdkRGBA * clr = NULL; |
172 | GValue value = { 0, }; | 172 | GValue value = { 0, }; |
173 | GtkTreeIter iter; | 173 | GtkTreeIter iter; |
174 | 174 | ||
@@ -196,18 +196,18 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -196,18 +196,18 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
196 | // Update color selection widget | 196 | // Update color selection widget |
197 | int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(colorsel),"colorid")); | 197 | int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(colorsel),"colorid")); |
198 | if(id >= 0 && id < V3270_COLOR_COUNT) | 198 | if(id >= 0 && id < V3270_COLOR_COUNT) |
199 | - gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(colorsel),clr+id); | 199 | + gtk_color_selection_set_current_rgba(GTK_COLOR_SELECTION(colorsel),clr+id); |
200 | } | 200 | } |
201 | 201 | ||
202 | } | 202 | } |
203 | 203 | ||
204 | - static gboolean compare_colors(const GdkColor *colora, const GdkColor *colorb) | 204 | + static gboolean compare_colors(const GdkRGBA *colora, const GdkRGBA *colorb) |
205 | { | 205 | { |
206 | int f; | 206 | int f; |
207 | 207 | ||
208 | for(f=0;f<V3270_COLOR_COUNT;f++) | 208 | for(f=0;f<V3270_COLOR_COUNT;f++) |
209 | { | 209 | { |
210 | - if(!gdk_color_equal(colora+f,colorb+f)) | 210 | + if(!gdk_rgba_equal(colora+f,colorb+f)) |
211 | return FALSE; | 211 | return FALSE; |
212 | } | 212 | } |
213 | 213 | ||
@@ -222,7 +222,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -222,7 +222,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
222 | * @return Combobox widget with colors.conf loaded and set | 222 | * @return Combobox widget with colors.conf loaded and set |
223 | * | 223 | * |
224 | */ | 224 | */ |
225 | - GtkWidget * color_scheme_new(const GdkColor *current) | 225 | + GtkWidget * color_scheme_new(const GdkRGBA *current) |
226 | { | 226 | { |
227 | gchar * filename = build_data_filename("colors.conf",NULL); | 227 | gchar * filename = build_data_filename("colors.conf",NULL); |
228 | GtkTreeModel * model = (GtkTreeModel *) gtk_list_store_new(2,G_TYPE_STRING,G_TYPE_POINTER); | 228 | GtkTreeModel * model = (GtkTreeModel *) gtk_list_store_new(2,G_TYPE_STRING,G_TYPE_POINTER); |
@@ -254,7 +254,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -254,7 +254,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
254 | { | 254 | { |
255 | gsize len = 0; | 255 | gsize len = 0; |
256 | gchar **group = g_key_file_get_groups(conf,&len); | 256 | gchar **group = g_key_file_get_groups(conf,&len); |
257 | - GdkColor * table = g_new0(GdkColor,(len*V3270_COLOR_COUNT)); | 257 | + GdkRGBA * table = g_new0(GdkRGBA,(len*V3270_COLOR_COUNT)); |
258 | int pos = 0; | 258 | int pos = 0; |
259 | int g; | 259 | int g; |
260 | gboolean found = FALSE; | 260 | gboolean found = FALSE; |
@@ -266,7 +266,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -266,7 +266,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
266 | for(g=0;g<len;g++) | 266 | for(g=0;g<len;g++) |
267 | { | 267 | { |
268 | // Setup colors for current entry | 268 | // Setup colors for current entry |
269 | - GdkColor * clr = table+pos; | 269 | + GdkRGBA * clr = table+pos; |
270 | const gchar * label = g_key_file_get_locale_string(conf,group[g],"label",NULL,NULL); | 270 | const gchar * label = g_key_file_get_locale_string(conf,group[g],"label",NULL,NULL); |
271 | 271 | ||
272 | load_color_scheme(conf,group[g],clr); | 272 | load_color_scheme(conf,group[g],clr); |
@@ -296,7 +296,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -296,7 +296,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
296 | { | 296 | { |
297 | // Custom color table, save it as a new dropdown entry. | 297 | // Custom color table, save it as a new dropdown entry. |
298 | 298 | ||
299 | - GdkColor * clr = g_new0(GdkColor,V3270_COLOR_COUNT); | 299 | + GdkRGBA * clr = g_new0(GdkRGBA,V3270_COLOR_COUNT); |
300 | int f; | 300 | int f; |
301 | 301 | ||
302 | for(f=0;f<V3270_COLOR_COUNT;f++) | 302 | for(f=0;f<V3270_COLOR_COUNT;f++) |
@@ -330,13 +330,13 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -330,13 +330,13 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
330 | 330 | ||
331 | static void color_changed(GtkColorSelection *colorselection, GtkWidget *widget) | 331 | static void color_changed(GtkColorSelection *colorselection, GtkWidget *widget) |
332 | { | 332 | { |
333 | - GdkColor clr; | 333 | + GdkRGBA clr; |
334 | int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(colorselection),"colorid")); | 334 | int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(colorselection),"colorid")); |
335 | 335 | ||
336 | if(id < 0 || id >= V3270_COLOR_COUNT) | 336 | if(id < 0 || id >= V3270_COLOR_COUNT) |
337 | return; | 337 | return; |
338 | 338 | ||
339 | - gtk_color_selection_get_current_color(colorselection,&clr); | 339 | + gtk_color_selection_get_current_rgba(colorselection,&clr); |
340 | v3270_set_color(widget,id,&clr); | 340 | v3270_set_color(widget,id,&clr); |
341 | v3270_reload(widget); | 341 | v3270_reload(widget); |
342 | gtk_widget_queue_draw(widget); | 342 | gtk_widget_queue_draw(widget); |
@@ -345,11 +345,11 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -345,11 +345,11 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
345 | static void color_selected(GtkTreeSelection *selection, GtkWidget *color) | 345 | static void color_selected(GtkTreeSelection *selection, GtkWidget *color) |
346 | { | 346 | { |
347 | GtkWidget * widget = g_object_get_data(G_OBJECT(selection),"v3270"); | 347 | GtkWidget * widget = g_object_get_data(G_OBJECT(selection),"v3270"); |
348 | - GdkColor * saved = g_object_get_data(G_OBJECT(selection),"lastcolors"); | 348 | + GdkRGBA * saved = g_object_get_data(G_OBJECT(selection),"lastcolors"); |
349 | GValue value = { 0, }; | 349 | GValue value = { 0, }; |
350 | GtkTreeModel * model; | 350 | GtkTreeModel * model; |
351 | GtkTreeIter iter; | 351 | GtkTreeIter iter; |
352 | - GdkColor * clr; | 352 | + GdkRGBA * clr; |
353 | int id; | 353 | int id; |
354 | 354 | ||
355 | gtk_widget_set_sensitive(color,FALSE); | 355 | gtk_widget_set_sensitive(color,FALSE); |
@@ -367,8 +367,8 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -367,8 +367,8 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
367 | g_object_set_data(G_OBJECT(color),"colorid",GINT_TO_POINTER(id)); | 367 | g_object_set_data(G_OBJECT(color),"colorid",GINT_TO_POINTER(id)); |
368 | clr = v3270_get_color(widget,id); | 368 | clr = v3270_get_color(widget,id); |
369 | 369 | ||
370 | - gtk_color_selection_set_previous_color(GTK_COLOR_SELECTION(color),saved+id); | ||
371 | - gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(color),clr); | 370 | + gtk_color_selection_set_previous_rgba(GTK_COLOR_SELECTION(color),saved+id); |
371 | + gtk_color_selection_set_current_rgba(GTK_COLOR_SELECTION(color),clr); | ||
372 | 372 | ||
373 | gtk_widget_set_sensitive(color,TRUE); | 373 | gtk_widget_set_sensitive(color,TRUE); |
374 | } | 374 | } |
@@ -442,7 +442,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -442,7 +442,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
442 | 442 | ||
443 | GtkWidget * tree; | 443 | GtkWidget * tree; |
444 | GtkWidget * color; | 444 | GtkWidget * color; |
445 | - GdkColor saved[V3270_COLOR_COUNT]; | 445 | + GdkRGBA saved[V3270_COLOR_COUNT]; |
446 | 446 | ||
447 | // Color dialog setup | 447 | // Color dialog setup |
448 | { | 448 | { |
@@ -539,7 +539,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | @@ -539,7 +539,7 @@ static void load_color_scheme(GKeyFile *conf, const gchar *group, GdkColor *clr) | ||
539 | { | 539 | { |
540 | if(f) | 540 | if(f) |
541 | g_string_append_c(str,','); | 541 | g_string_append_c(str,','); |
542 | - g_string_append_printf(str,"%s",gdk_color_to_string(v3270_get_color(widget,f))); | 542 | + g_string_append_printf(str,"%s",gdk_rgba_to_string(v3270_get_color(widget,f))); |
543 | } | 543 | } |
544 | set_string_to_config("terminal","colors","%s",str->str); | 544 | set_string_to_config("terminal","colors","%s",str->str); |
545 | g_string_free(str,TRUE); | 545 | g_string_free(str,TRUE); |
src/pw3270/globals.h
@@ -60,7 +60,7 @@ | @@ -60,7 +60,7 @@ | ||
60 | G_GNUC_INTERNAL GtkWidget * create_main_window(const gchar *uri); | 60 | G_GNUC_INTERNAL GtkWidget * create_main_window(const gchar *uri); |
61 | G_GNUC_INTERNAL void setup_font_list(GtkWidget *widget, GtkWidget *obj); | 61 | G_GNUC_INTERNAL void setup_font_list(GtkWidget *widget, GtkWidget *obj); |
62 | G_GNUC_INTERNAL void load_color_schemes(GtkWidget *widget, gchar *active); | 62 | G_GNUC_INTERNAL void load_color_schemes(GtkWidget *widget, gchar *active); |
63 | - G_GNUC_INTERNAL GtkWidget * color_scheme_new(const GdkColor *current); | 63 | + G_GNUC_INTERNAL GtkWidget * color_scheme_new(const GdkRGBA *current); |
64 | G_GNUC_INTERNAL LIB3270_OPTION pw3270_options_by_hosttype(const gchar *systype); | 64 | G_GNUC_INTERNAL LIB3270_OPTION pw3270_options_by_hosttype(const gchar *systype); |
65 | G_GNUC_INTERNAL void run_security_dialog(GtkWidget *widget); | 65 | G_GNUC_INTERNAL void run_security_dialog(GtkWidget *widget); |
66 | 66 |
src/pw3270/print.c
@@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
47 | 47 | ||
48 | typedef struct _print_info | 48 | typedef struct _print_info |
49 | { | 49 | { |
50 | - GdkColor color[V3270_COLOR_COUNT]; | 50 | + GdkRGBA color[V3270_COLOR_COUNT]; |
51 | int show_selection : 1; | 51 | int show_selection : 1; |
52 | PW3270_SRC src; | 52 | PW3270_SRC src; |
53 | 53 | ||
@@ -160,7 +160,7 @@ | @@ -160,7 +160,7 @@ | ||
160 | rect.width = info->extents.max_x_advance; | 160 | rect.width = info->extents.max_x_advance; |
161 | 161 | ||
162 | // Clear page | 162 | // Clear page |
163 | - gdk_cairo_set_source_color(cr,info->color+V3270_COLOR_BACKGROUND); | 163 | + gdk_cairo_set_source_rgba(cr,info->color+V3270_COLOR_BACKGROUND); |
164 | cairo_rectangle(cr, info->left-2, 0, (rect.width*info->cols)+4, (rect.height*info->rows)+4); | 164 | cairo_rectangle(cr, info->left-2, 0, (rect.width*info->cols)+4, (rect.height*info->rows)+4); |
165 | cairo_fill(cr); | 165 | cairo_fill(cr); |
166 | cairo_stroke(cr); | 166 | cairo_stroke(cr); |
@@ -517,7 +517,7 @@ static gchar * enum_to_string(GType type, guint enum_value) | @@ -517,7 +517,7 @@ static gchar * enum_to_string(GType type, guint enum_value) | ||
517 | static void custom_widget_apply(GtkPrintOperation *prt, GtkWidget *widget, PRINT_INFO *info) | 517 | static void custom_widget_apply(GtkPrintOperation *prt, GtkWidget *widget, PRINT_INFO *info) |
518 | { | 518 | { |
519 | GtkWidget * combo = g_object_get_data(G_OBJECT(widget),"combo"); | 519 | GtkWidget * combo = g_object_get_data(G_OBJECT(widget),"combo"); |
520 | - GdkColor * clr = g_object_get_data(G_OBJECT(combo),"selected"); | 520 | + GdkRGBA * clr = g_object_get_data(G_OBJECT(combo),"selected"); |
521 | 521 | ||
522 | trace("%s starts combo=%p clr=%p widget=%p",__FUNCTION__,combo,clr,widget); | 522 | trace("%s starts combo=%p clr=%p widget=%p",__FUNCTION__,combo,clr,widget); |
523 | 523 | ||
@@ -533,7 +533,7 @@ static gchar * enum_to_string(GType type, guint enum_value) | @@ -533,7 +533,7 @@ static gchar * enum_to_string(GType type, guint enum_value) | ||
533 | info->color[f] = clr[f]; | 533 | info->color[f] = clr[f]; |
534 | if(f) | 534 | if(f) |
535 | g_string_append_c(str,','); | 535 | g_string_append_c(str,','); |
536 | - g_string_append_printf(str,"%s",gdk_color_to_string(clr+f)); | 536 | + g_string_append_printf(str,"%s",gdk_rgba_to_string(clr+f)); |
537 | } | 537 | } |
538 | set_string_to_config("print","colors","%s",str->str); | 538 | set_string_to_config("print","colors","%s",str->str); |
539 | g_string_free(str,TRUE); | 539 | g_string_free(str,TRUE); |
src/pw3270/v3270/draw.c
@@ -49,7 +49,7 @@ gboolean v3270_draw(GtkWidget * widget, cairo_t * cr) | @@ -49,7 +49,7 @@ gboolean v3270_draw(GtkWidget * widget, cairo_t * cr) | ||
49 | GtkAllocation allocation; | 49 | GtkAllocation allocation; |
50 | gtk_widget_get_allocation(widget, &allocation); | 50 | gtk_widget_get_allocation(widget, &allocation); |
51 | 51 | ||
52 | - gdk_cairo_set_source_color(cr,terminal->color+V3270_COLOR_CROSS_HAIR); | 52 | + gdk_cairo_set_source_rgba(cr,terminal->color+V3270_COLOR_CROSS_HAIR); |
53 | 53 | ||
54 | cairo_rectangle(cr, 0,terminal->cursor.rect.y+terminal->metrics.height,allocation.width,1); | 54 | cairo_rectangle(cr, 0,terminal->cursor.rect.y+terminal->metrics.height,allocation.width,1); |
55 | cairo_fill(cr); | 55 | cairo_fill(cr); |
@@ -94,7 +94,7 @@ gboolean v3270_expose(GtkWidget *widget, GdkEventExpose *event) | @@ -94,7 +94,7 @@ gboolean v3270_expose(GtkWidget *widget, GdkEventExpose *event) | ||
94 | #endif // GTk3 | 94 | #endif // GTk3 |
95 | 95 | ||
96 | 96 | ||
97 | -static void get_element_colors(unsigned short attr, GdkColor **fg, GdkColor **bg, GdkColor *color) | 97 | +static void get_element_colors(unsigned short attr, GdkRGBA **fg, GdkRGBA **bg, GdkRGBA *color) |
98 | { | 98 | { |
99 | if(attr & LIB3270_ATTR_SELECTED) | 99 | if(attr & LIB3270_ATTR_SELECTED) |
100 | { | 100 | { |
@@ -112,10 +112,10 @@ static void get_element_colors(unsigned short attr, GdkColor **fg, GdkColor **bg | @@ -112,10 +112,10 @@ static void get_element_colors(unsigned short attr, GdkColor **fg, GdkColor **bg | ||
112 | } | 112 | } |
113 | } | 113 | } |
114 | 114 | ||
115 | -void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, guint height, GdkRectangle *rect, GdkColor *color) | 115 | +void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, guint height, GdkRectangle *rect, GdkRGBA *color) |
116 | { | 116 | { |
117 | - GdkColor *fg; | ||
118 | - GdkColor *bg; | 117 | + GdkRGBA *fg; |
118 | + GdkRGBA *bg; | ||
119 | 119 | ||
120 | get_element_colors(attr,&fg,&bg,color); | 120 | get_element_colors(attr,&fg,&bg,color); |
121 | v3270_draw_char(cr,chr,attr,session,height,rect,fg,bg); | 121 | v3270_draw_char(cr,chr,attr,session,height,rect,fg,bg); |
@@ -132,7 +132,7 @@ void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H32 | @@ -132,7 +132,7 @@ void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H32 | ||
132 | if(sl < 1) | 132 | if(sl < 1) |
133 | sl = 1; | 133 | sl = 1; |
134 | 134 | ||
135 | - gdk_cairo_set_source_color(cr,fg); | 135 | + gdk_cairo_set_source_rgba(cr,fg); |
136 | 136 | ||
137 | cairo_rectangle(cr,rect->x,rect->y+sl+extents.ascent+(extents.descent/2),rect->width,sl); | 137 | cairo_rectangle(cr,rect->x,rect->y+sl+extents.ascent+(extents.descent/2),rect->width,sl); |
138 | cairo_fill(cr); | 138 | cairo_fill(cr); |
@@ -143,15 +143,15 @@ void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H32 | @@ -143,15 +143,15 @@ void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H32 | ||
143 | 143 | ||
144 | } | 144 | } |
145 | 145 | ||
146 | -void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, guint height, GdkRectangle *rect, GdkColor *fg, GdkColor *bg) | 146 | +void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, guint height, GdkRectangle *rect, GdkRGBA *fg, GdkRGBA *bg) |
147 | { | 147 | { |
148 | // Clear element area | 148 | // Clear element area |
149 | - gdk_cairo_set_source_color(cr,bg); | 149 | + gdk_cairo_set_source_rgba(cr,bg); |
150 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); | 150 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); |
151 | cairo_fill(cr); | 151 | cairo_fill(cr); |
152 | 152 | ||
153 | // Set foreground color | 153 | // Set foreground color |
154 | - gdk_cairo_set_source_color(cr,fg); | 154 | + gdk_cairo_set_source_rgba(cr,fg); |
155 | 155 | ||
156 | // Draw char | 156 | // Draw char |
157 | if( (attr & LIB3270_ATTR_MARKER) && lib3270_get_toggle(session,LIB3270_TOGGLE_VIEW_FIELD) ) | 157 | if( (attr & LIB3270_ATTR_MARKER) && lib3270_get_toggle(session,LIB3270_TOGGLE_VIEW_FIELD) ) |
@@ -329,7 +329,7 @@ void v3270_reload(GtkWidget *widget) | @@ -329,7 +329,7 @@ void v3270_reload(GtkWidget *widget) | ||
329 | cr = cairo_create(terminal->surface); | 329 | cr = cairo_create(terminal->surface); |
330 | v3270_update_font_metrics(terminal, cr, width, height); | 330 | v3270_update_font_metrics(terminal, cr, width, height); |
331 | 331 | ||
332 | - gdk_cairo_set_source_color(cr,terminal->color+V3270_COLOR_BACKGROUND); | 332 | + gdk_cairo_set_source_rgba(cr,terminal->color+V3270_COLOR_BACKGROUND); |
333 | cairo_rectangle(cr, 0, 0, width, height); | 333 | cairo_rectangle(cr, 0, 0, width, height); |
334 | cairo_fill(cr); | 334 | cairo_fill(cr); |
335 | cairo_stroke(cr); | 335 | cairo_stroke(cr); |
@@ -422,8 +422,8 @@ void v3270_update_cursor_surface(v3270 *widget,unsigned char chr,unsigned short | @@ -422,8 +422,8 @@ void v3270_update_cursor_surface(v3270 *widget,unsigned char chr,unsigned short | ||
422 | { | 422 | { |
423 | GdkRectangle rect = widget->cursor.rect; | 423 | GdkRectangle rect = widget->cursor.rect; |
424 | cairo_t * cr = cairo_create(widget->cursor.surface); | 424 | cairo_t * cr = cairo_create(widget->cursor.surface); |
425 | - GdkColor * fg; | ||
426 | - GdkColor * bg; | 425 | + GdkRGBA * fg; |
426 | + GdkRGBA * bg; | ||
427 | 427 | ||
428 | get_element_colors(attr,&fg,&bg,widget->color); | 428 | get_element_colors(attr,&fg,&bg,widget->color); |
429 | 429 |
src/pw3270/v3270/oia.c
@@ -70,7 +70,7 @@ static void short2string(char *ptr, unsigned short vlr, size_t sz) | @@ -70,7 +70,7 @@ static void short2string(char *ptr, unsigned short vlr, size_t sz) | ||
70 | 70 | ||
71 | 71 | ||
72 | #ifdef HAVE_LIBM | 72 | #ifdef HAVE_LIBM |
73 | -static gint draw_spinner(cairo_t *cr, GdkRectangle *r, GdkColor *color, gint step) | 73 | +static gint draw_spinner(cairo_t *cr, GdkRectangle *r, GdkRGBA *color, gint step) |
74 | { | 74 | { |
75 | static const guint num_steps = 10; | 75 | static const guint num_steps = 10; |
76 | 76 | ||
@@ -123,7 +123,7 @@ static gint draw_spinner(cairo_t *cr, GdkRectangle *r, GdkColor *color, gint ste | @@ -123,7 +123,7 @@ static gint draw_spinner(cairo_t *cr, GdkRectangle *r, GdkColor *color, gint ste | ||
123 | } | 123 | } |
124 | #endif // HAVE_LIBM | 124 | #endif // HAVE_LIBM |
125 | 125 | ||
126 | -static void setup_cursor_position(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkColor *color) | 126 | +static void setup_cursor_position(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkRGBA *color) |
127 | { | 127 | { |
128 | rect->width = metrics->width * 8; | 128 | rect->width = metrics->width * 8; |
129 | rect->x -= rect->width; | 129 | rect->x -= rect->width; |
@@ -135,7 +135,7 @@ static void setup_cursor_position(GdkRectangle *rect, struct v3270_metrics *metr | @@ -135,7 +135,7 @@ static void setup_cursor_position(GdkRectangle *rect, struct v3270_metrics *metr | ||
135 | } | 135 | } |
136 | } | 136 | } |
137 | 137 | ||
138 | -static void setup_timer_position(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkColor *color) | 138 | +static void setup_timer_position(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkRGBA *color) |
139 | { | 139 | { |
140 | char buffer[7]; | 140 | char buffer[7]; |
141 | cairo_text_extents_t extents; | 141 | cairo_text_extents_t extents; |
@@ -150,14 +150,14 @@ static void setup_timer_position(GdkRectangle *rect, struct v3270_metrics *metri | @@ -150,14 +150,14 @@ static void setup_timer_position(GdkRectangle *rect, struct v3270_metrics *metri | ||
150 | rect->x -= rect->width; | 150 | rect->x -= rect->width; |
151 | } | 151 | } |
152 | 152 | ||
153 | -static void setup_spinner_position(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkColor *color) | 153 | +static void setup_spinner_position(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkRGBA *color) |
154 | { | 154 | { |
155 | rect->width = rect->height; | 155 | rect->width = rect->height; |
156 | rect->x -= rect->width; | 156 | rect->x -= rect->width; |
157 | // draw_spinner(cr,rect,color,0); | 157 | // draw_spinner(cr,rect,color,0); |
158 | } | 158 | } |
159 | 159 | ||
160 | -static void setup_luname_position(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkColor *color) | 160 | +static void setup_luname_position(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkRGBA *color) |
161 | { | 161 | { |
162 | const char *luname = lib3270_get_luname(host); | 162 | const char *luname = lib3270_get_luname(host); |
163 | 163 | ||
@@ -171,7 +171,7 @@ static void setup_luname_position(GdkRectangle *rect, struct v3270_metrics *metr | @@ -171,7 +171,7 @@ static void setup_luname_position(GdkRectangle *rect, struct v3270_metrics *metr | ||
171 | #ifdef DEBUG | 171 | #ifdef DEBUG |
172 | cairo_set_source_rgb(cr,0.1,0.1,0.1); | 172 | cairo_set_source_rgb(cr,0.1,0.1,0.1); |
173 | #else | 173 | #else |
174 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_BACKGROUND); | 174 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_BACKGROUND); |
175 | #endif | 175 | #endif |
176 | 176 | ||
177 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); | 177 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); |
@@ -180,7 +180,7 @@ static void setup_luname_position(GdkRectangle *rect, struct v3270_metrics *metr | @@ -180,7 +180,7 @@ static void setup_luname_position(GdkRectangle *rect, struct v3270_metrics *metr | ||
180 | if(luname) | 180 | if(luname) |
181 | { | 181 | { |
182 | cairo_move_to(cr,rect->x,rect->y+metrics->height); | 182 | cairo_move_to(cr,rect->x,rect->y+metrics->height); |
183 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_LUNAME); | 183 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_LUNAME); |
184 | cairo_show_text(cr,luname); | 184 | cairo_show_text(cr,luname); |
185 | cairo_stroke(cr); | 185 | cairo_stroke(cr); |
186 | } | 186 | } |
@@ -189,7 +189,7 @@ static void setup_luname_position(GdkRectangle *rect, struct v3270_metrics *metr | @@ -189,7 +189,7 @@ static void setup_luname_position(GdkRectangle *rect, struct v3270_metrics *metr | ||
189 | 189 | ||
190 | } | 190 | } |
191 | 191 | ||
192 | -static void setup_single_char_right(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkColor *color) | 192 | +static void setup_single_char_right(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkRGBA *color) |
193 | { | 193 | { |
194 | rect->x -= rect->width; | 194 | rect->x -= rect->width; |
195 | 195 | ||
@@ -201,7 +201,7 @@ static void setup_single_char_right(GdkRectangle *rect, struct v3270_metrics *me | @@ -201,7 +201,7 @@ static void setup_single_char_right(GdkRectangle *rect, struct v3270_metrics *me | ||
201 | 201 | ||
202 | } | 202 | } |
203 | 203 | ||
204 | -static void setup_insert_position(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkColor *color) | 204 | +static void setup_insert_position(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkRGBA *color) |
205 | { | 205 | { |
206 | if(rect->width > rect->height) | 206 | if(rect->width > rect->height) |
207 | { | 207 | { |
@@ -225,7 +225,7 @@ static void setup_insert_position(GdkRectangle *rect, struct v3270_metrics *metr | @@ -225,7 +225,7 @@ static void setup_insert_position(GdkRectangle *rect, struct v3270_metrics *metr | ||
225 | 225 | ||
226 | 226 | ||
227 | 227 | ||
228 | -static void setup_double_char_position(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkColor *color) | 228 | +static void setup_double_char_position(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkRGBA *color) |
229 | { | 229 | { |
230 | rect->width <<= 1; | 230 | rect->width <<= 1; |
231 | rect->x -= rect->width; | 231 | rect->x -= rect->width; |
@@ -238,12 +238,12 @@ static void setup_double_char_position(GdkRectangle *rect, struct v3270_metrics | @@ -238,12 +238,12 @@ static void setup_double_char_position(GdkRectangle *rect, struct v3270_metrics | ||
238 | 238 | ||
239 | } | 239 | } |
240 | 240 | ||
241 | -static void draw_undera(cairo_t *cr, H3270 *host, struct v3270_metrics *metrics, GdkColor *color, GdkRectangle *rect) | 241 | +static void draw_undera(cairo_t *cr, H3270 *host, struct v3270_metrics *metrics, GdkRGBA *color, GdkRectangle *rect) |
242 | { | 242 | { |
243 | #ifdef DEBUG | 243 | #ifdef DEBUG |
244 | cairo_set_source_rgb(cr,0.1,0.1,0.1); | 244 | cairo_set_source_rgb(cr,0.1,0.1,0.1); |
245 | #else | 245 | #else |
246 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_BACKGROUND); | 246 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_BACKGROUND); |
247 | #endif | 247 | #endif |
248 | 248 | ||
249 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); | 249 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); |
@@ -255,11 +255,11 @@ static void draw_undera(cairo_t *cr, H3270 *host, struct v3270_metrics *metrics, | @@ -255,11 +255,11 @@ static void draw_undera(cairo_t *cr, H3270 *host, struct v3270_metrics *metrics, | ||
255 | cairo_text_extents_t extents; | 255 | cairo_text_extents_t extents; |
256 | int x,y; | 256 | int x,y; |
257 | 257 | ||
258 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_BACKGROUND); | 258 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_BACKGROUND); |
259 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); | 259 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); |
260 | cairo_fill(cr); | 260 | cairo_fill(cr); |
261 | 261 | ||
262 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_FOREGROUND); | 262 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_FOREGROUND); |
263 | 263 | ||
264 | cairo_text_extents(cr,chr,&extents); | 264 | cairo_text_extents(cr,chr,&extents); |
265 | 265 | ||
@@ -286,15 +286,15 @@ static void draw_centered_text(cairo_t *cr, struct v3270_metrics *metrics, int x | @@ -286,15 +286,15 @@ static void draw_centered_text(cairo_t *cr, struct v3270_metrics *metrics, int x | ||
286 | cairo_show_text(cr,str); | 286 | cairo_show_text(cr,str); |
287 | } | 287 | } |
288 | 288 | ||
289 | -void v3270_draw_connection(cairo_t *cr, H3270 *host, struct v3270_metrics *metrics, GdkColor *color, const GdkRectangle *rect) | 289 | +void v3270_draw_connection(cairo_t *cr, H3270 *host, struct v3270_metrics *metrics, GdkRGBA *color, const GdkRectangle *rect) |
290 | { | 290 | { |
291 | const gchar *str; | 291 | const gchar *str; |
292 | 292 | ||
293 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_BACKGROUND); | 293 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_BACKGROUND); |
294 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); | 294 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); |
295 | cairo_fill(cr); | 295 | cairo_fill(cr); |
296 | 296 | ||
297 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_FOREGROUND); | 297 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_FOREGROUND); |
298 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); | 298 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); |
299 | cairo_stroke(cr); | 299 | cairo_stroke(cr); |
300 | 300 | ||
@@ -337,12 +337,12 @@ static void draw_xbm(cairo_t *cr, GdkRectangle *rect, int width, int height, uns | @@ -337,12 +337,12 @@ static void draw_xbm(cairo_t *cr, GdkRectangle *rect, int width, int height, uns | ||
337 | cairo_restore(cr); | 337 | cairo_restore(cr); |
338 | } | 338 | } |
339 | 339 | ||
340 | -void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metrics, GdkColor *color, GdkRectangle *rect) | 340 | +void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metrics, GdkRGBA *color, GdkRectangle *rect) |
341 | { | 341 | { |
342 | #ifdef DEBUG | 342 | #ifdef DEBUG |
343 | cairo_set_source_rgb(cr,0.1,0.1,0.1); | 343 | cairo_set_source_rgb(cr,0.1,0.1,0.1); |
344 | #else | 344 | #else |
345 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_BACKGROUND); | 345 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_BACKGROUND); |
346 | #endif | 346 | #endif |
347 | 347 | ||
348 | cairo_translate(cr, rect->x, rect->y); | 348 | cairo_translate(cr, rect->x, rect->y); |
@@ -352,24 +352,24 @@ void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metri | @@ -352,24 +352,24 @@ void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metri | ||
352 | switch(lib3270_get_secure(host)) | 352 | switch(lib3270_get_secure(host)) |
353 | { | 353 | { |
354 | case LIB3270_SSL_UNSECURE: /**< No secure connection */ | 354 | case LIB3270_SSL_UNSECURE: /**< No secure connection */ |
355 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_FOREGROUND); | 355 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_FOREGROUND); |
356 | draw_xbm(cr,rect,unlocked_width,unlocked_height,unlocked_bits); | 356 | draw_xbm(cr,rect,unlocked_width,unlocked_height,unlocked_bits); |
357 | break; | 357 | break; |
358 | 358 | ||
359 | case LIB3270_SSL_NEGOTIATING: /**< Negotiating SSL */ | 359 | case LIB3270_SSL_NEGOTIATING: /**< Negotiating SSL */ |
360 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_STATUS_WARNING); | 360 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_STATUS_WARNING); |
361 | draw_xbm(cr,rect,negotiated_width,negotiated_height,negotiated_bits); | 361 | draw_xbm(cr,rect,negotiated_width,negotiated_height,negotiated_bits); |
362 | break; | 362 | break; |
363 | 363 | ||
364 | case LIB3270_SSL_NEGOTIATED: /**< Connection secure, no CA or self-signed */ | 364 | case LIB3270_SSL_NEGOTIATED: /**< Connection secure, no CA or self-signed */ |
365 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_STATUS_OK); | 365 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_STATUS_OK); |
366 | draw_xbm(cr,rect,locked_width,locked_height,locked_bits); | 366 | draw_xbm(cr,rect,locked_width,locked_height,locked_bits); |
367 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_STATUS_WARNING); | 367 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_STATUS_WARNING); |
368 | draw_xbm(cr,rect,warning_width,warning_height,warning_bits); | 368 | draw_xbm(cr,rect,warning_width,warning_height,warning_bits); |
369 | break; | 369 | break; |
370 | 370 | ||
371 | case LIB3270_SSL_SECURE: /**< Connection secure with CA check */ | 371 | case LIB3270_SSL_SECURE: /**< Connection secure with CA check */ |
372 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_STATUS_OK); | 372 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_STATUS_OK); |
373 | draw_xbm(cr,rect,locked_width,locked_height,locked_bits); | 373 | draw_xbm(cr,rect,locked_width,locked_height,locked_bits); |
374 | break; | 374 | break; |
375 | 375 | ||
@@ -381,7 +381,7 @@ void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metri | @@ -381,7 +381,7 @@ void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metri | ||
381 | 381 | ||
382 | } | 382 | } |
383 | 383 | ||
384 | -static void draw_status_message(cairo_t *cr, LIB3270_MESSAGE id, struct v3270_metrics *metrics, GdkColor *color, GdkRectangle *rect) | 384 | +static void draw_status_message(cairo_t *cr, LIB3270_MESSAGE id, struct v3270_metrics *metrics, GdkRGBA *color, GdkRectangle *rect) |
385 | { | 385 | { |
386 | #ifdef DEBUG | 386 | #ifdef DEBUG |
387 | #define OIA_MESSAGE(x,c,y) { #x, c, y } | 387 | #define OIA_MESSAGE(x,c,y) { #x, c, y } |
@@ -477,14 +477,14 @@ static void draw_status_message(cairo_t *cr, LIB3270_MESSAGE id, struct v3270_me | @@ -477,14 +477,14 @@ static void draw_status_message(cairo_t *cr, LIB3270_MESSAGE id, struct v3270_me | ||
477 | 477 | ||
478 | if(msg) | 478 | if(msg) |
479 | { | 479 | { |
480 | - gdk_cairo_set_source_color(cr,color+message[id].color); | 480 | + gdk_cairo_set_source_rgba(cr,color+message[id].color); |
481 | cairo_move_to(cr,rect->x,rect->y+metrics->height); | 481 | cairo_move_to(cr,rect->x,rect->y+metrics->height); |
482 | cairo_show_text(cr,gettext(msg)); | 482 | cairo_show_text(cr,gettext(msg)); |
483 | } | 483 | } |
484 | 484 | ||
485 | } | 485 | } |
486 | 486 | ||
487 | -static void draw_insert(cairo_t *cr, H3270 *host, GdkColor *color, GdkRectangle *rect) | 487 | +static void draw_insert(cairo_t *cr, H3270 *host, GdkRGBA *color, GdkRectangle *rect) |
488 | { | 488 | { |
489 | if(lib3270_get_toggle(host,LIB3270_TOGGLE_INSERT)) | 489 | if(lib3270_get_toggle(host,LIB3270_TOGGLE_INSERT)) |
490 | { | 490 | { |
@@ -493,7 +493,7 @@ static void draw_insert(cairo_t *cr, H3270 *host, GdkColor *color, GdkRectangle | @@ -493,7 +493,7 @@ static void draw_insert(cairo_t *cr, H3270 *host, GdkColor *color, GdkRectangle | ||
493 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); | 493 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); |
494 | cairo_clip(cr); | 494 | cairo_clip(cr); |
495 | 495 | ||
496 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_FOREGROUND); | 496 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_FOREGROUND); |
497 | 497 | ||
498 | cairo_move_to(cr,rect->x,y); | 498 | cairo_move_to(cr,rect->x,y); |
499 | cairo_rel_line_to(cr,rect->width/2,-(rect->height/1.7)); | 499 | cairo_rel_line_to(cr,rect->width/2,-(rect->height/1.7)); |
@@ -503,12 +503,12 @@ static void draw_insert(cairo_t *cr, H3270 *host, GdkColor *color, GdkRectangle | @@ -503,12 +503,12 @@ static void draw_insert(cairo_t *cr, H3270 *host, GdkColor *color, GdkRectangle | ||
503 | 503 | ||
504 | } | 504 | } |
505 | 505 | ||
506 | -void v3270_draw_oia(cairo_t *cr, H3270 *host, int row, int cols, struct v3270_metrics *metrics, GdkColor *color, GdkRectangle *rect) | 506 | +void v3270_draw_oia(cairo_t *cr, H3270 *host, int row, int cols, struct v3270_metrics *metrics, GdkRGBA *color, GdkRectangle *rect) |
507 | { | 507 | { |
508 | static const struct _right_fields | 508 | static const struct _right_fields |
509 | { | 509 | { |
510 | V3270_OIA_FIELD id; | 510 | V3270_OIA_FIELD id; |
511 | - void (*draw)(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkColor *color); | 511 | + void (*draw)(GdkRectangle *rect, struct v3270_metrics *metrics, cairo_t *cr, H3270 *host, int cols, GdkRGBA *color); |
512 | } right[] = | 512 | } right[] = |
513 | { | 513 | { |
514 | { V3270_OIA_CURSOR_POSITION, setup_cursor_position }, | 514 | { V3270_OIA_CURSOR_POSITION, setup_cursor_position }, |
@@ -532,13 +532,13 @@ void v3270_draw_oia(cairo_t *cr, H3270 *host, int row, int cols, struct v3270_me | @@ -532,13 +532,13 @@ void v3270_draw_oia(cairo_t *cr, H3270 *host, int row, int cols, struct v3270_me | ||
532 | int lCol = metrics->left+1; | 532 | int lCol = metrics->left+1; |
533 | 533 | ||
534 | row += OIA_TOP_MARGIN; | 534 | row += OIA_TOP_MARGIN; |
535 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_SEPARATOR); | 535 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_SEPARATOR); |
536 | cairo_rectangle(cr, metrics->left, row, cols*metrics->width, 1); | 536 | cairo_rectangle(cr, metrics->left, row, cols*metrics->width, 1); |
537 | cairo_fill(cr); | 537 | cairo_fill(cr); |
538 | 538 | ||
539 | row += 2; | 539 | row += 2; |
540 | 540 | ||
541 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_BACKGROUND); | 541 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_BACKGROUND); |
542 | cairo_rectangle(cr, metrics->left, row, cols*metrics->width, metrics->spacing); | 542 | cairo_rectangle(cr, metrics->left, row, cols*metrics->width, metrics->spacing); |
543 | cairo_fill(cr); | 543 | cairo_fill(cr); |
544 | 544 | ||
@@ -551,12 +551,12 @@ void v3270_draw_oia(cairo_t *cr, H3270 *host, int row, int cols, struct v3270_me | @@ -551,12 +551,12 @@ void v3270_draw_oia(cairo_t *cr, H3270 *host, int row, int cols, struct v3270_me | ||
551 | r->y = row; | 551 | r->y = row; |
552 | r->width = metrics->width; | 552 | r->width = metrics->width; |
553 | r->height = metrics->spacing; | 553 | r->height = metrics->spacing; |
554 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_FOREGROUND); | 554 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_FOREGROUND); |
555 | right[f].draw(r,metrics,cr,host,cols,color); | 555 | right[f].draw(r,metrics,cr,host,cols,color); |
556 | rCol = r->x - (metrics->width/3); | 556 | rCol = r->x - (metrics->width/3); |
557 | } | 557 | } |
558 | 558 | ||
559 | - gdk_cairo_set_source_color(cr,color+V3270_COLOR_OIA_FOREGROUND); | 559 | + gdk_cairo_set_source_rgba(cr,color+V3270_COLOR_OIA_FOREGROUND); |
560 | 560 | ||
561 | draw_centered_text(cr,metrics,lCol,row,"4"); | 561 | draw_centered_text(cr,metrics,lCol,row,"4"); |
562 | 562 | ||
@@ -630,13 +630,13 @@ static cairo_t * set_update_region(v3270 * terminal, GdkRectangle **r, V3270_OIA | @@ -630,13 +630,13 @@ static cairo_t * set_update_region(v3270 * terminal, GdkRectangle **r, V3270_OIA | ||
630 | #ifdef DEBUG | 630 | #ifdef DEBUG |
631 | cairo_set_source_rgb(cr,0.1,0.1,0.1); | 631 | cairo_set_source_rgb(cr,0.1,0.1,0.1); |
632 | #else | 632 | #else |
633 | - gdk_cairo_set_source_color(cr,terminal->color+V3270_COLOR_OIA_BACKGROUND); | 633 | + gdk_cairo_set_source_rgba(cr,terminal->color+V3270_COLOR_OIA_BACKGROUND); |
634 | #endif | 634 | #endif |
635 | 635 | ||
636 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); | 636 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); |
637 | cairo_fill(cr); | 637 | cairo_fill(cr); |
638 | 638 | ||
639 | - gdk_cairo_set_source_color(cr,terminal->color+V3270_COLOR_OIA_FOREGROUND); | 639 | + gdk_cairo_set_source_rgba(cr,terminal->color+V3270_COLOR_OIA_FOREGROUND); |
640 | 640 | ||
641 | return cr; | 641 | return cr; |
642 | } | 642 | } |
@@ -655,7 +655,7 @@ void v3270_update_luname(GtkWidget *widget,const gchar *name) | @@ -655,7 +655,7 @@ void v3270_update_luname(GtkWidget *widget,const gchar *name) | ||
655 | if(name) | 655 | if(name) |
656 | { | 656 | { |
657 | cairo_move_to(cr,rect->x,rect->y+terminal->metrics.height); | 657 | cairo_move_to(cr,rect->x,rect->y+terminal->metrics.height); |
658 | - gdk_cairo_set_source_color(cr,terminal->color+V3270_COLOR_OIA_LUNAME); | 658 | + gdk_cairo_set_source_rgba(cr,terminal->color+V3270_COLOR_OIA_LUNAME); |
659 | cairo_show_text(cr,name); | 659 | cairo_show_text(cr,name); |
660 | cairo_stroke(cr); | 660 | cairo_stroke(cr); |
661 | } | 661 | } |
@@ -793,7 +793,7 @@ static void release_timer(struct timer_info *info) | @@ -793,7 +793,7 @@ static void release_timer(struct timer_info *info) | ||
793 | #ifdef DEBUG | 793 | #ifdef DEBUG |
794 | cairo_set_source_rgb(cr,0.1,0.1,0.1); | 794 | cairo_set_source_rgb(cr,0.1,0.1,0.1); |
795 | #else | 795 | #else |
796 | - gdk_cairo_set_source_color(cr,info->terminal->color+V3270_COLOR_OIA_BACKGROUND); | 796 | + gdk_cairo_set_source_rgba(cr,info->terminal->color+V3270_COLOR_OIA_BACKGROUND); |
797 | #endif | 797 | #endif |
798 | 798 | ||
799 | for(f=0;f<G_N_ELEMENTS(id);f++) | 799 | for(f=0;f<G_N_ELEMENTS(id);f++) |
@@ -928,13 +928,13 @@ static gboolean update_timer(struct timer_info *info) | @@ -928,13 +928,13 @@ static gboolean update_timer(struct timer_info *info) | ||
928 | #ifdef DEBUG | 928 | #ifdef DEBUG |
929 | cairo_set_source_rgb(cr,0.1,0.1,0.1); | 929 | cairo_set_source_rgb(cr,0.1,0.1,0.1); |
930 | #else | 930 | #else |
931 | - gdk_cairo_set_source_color(cr,info->terminal->color+V3270_COLOR_OIA_BACKGROUND); | 931 | + gdk_cairo_set_source_rgba(cr,info->terminal->color+V3270_COLOR_OIA_BACKGROUND); |
932 | #endif | 932 | #endif |
933 | 933 | ||
934 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); | 934 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); |
935 | cairo_fill(cr); | 935 | cairo_fill(cr); |
936 | 936 | ||
937 | - gdk_cairo_set_source_color(cr,info->terminal->color+V3270_COLOR_OIA_FOREGROUND); | 937 | + gdk_cairo_set_source_rgba(cr,info->terminal->color+V3270_COLOR_OIA_FOREGROUND); |
938 | 938 | ||
939 | short2string(buffer,seconds/60,2); | 939 | short2string(buffer,seconds/60,2); |
940 | buffer[2] = ':'; | 940 | buffer[2] = ':'; |
@@ -956,12 +956,12 @@ static gboolean update_timer(struct timer_info *info) | @@ -956,12 +956,12 @@ static gboolean update_timer(struct timer_info *info) | ||
956 | #ifdef DEBUG | 956 | #ifdef DEBUG |
957 | cairo_set_source_rgb(cr,0.1,0.1,0.1); | 957 | cairo_set_source_rgb(cr,0.1,0.1,0.1); |
958 | #else | 958 | #else |
959 | - gdk_cairo_set_source_color(cr,info->terminal->color+V3270_COLOR_OIA_BACKGROUND); | 959 | + gdk_cairo_set_source_rgba(cr,info->terminal->color+V3270_COLOR_OIA_BACKGROUND); |
960 | #endif | 960 | #endif |
961 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); | 961 | cairo_rectangle(cr, rect->x, rect->y, rect->width, rect->height); |
962 | cairo_fill(cr); | 962 | cairo_fill(cr); |
963 | 963 | ||
964 | - gdk_cairo_set_source_color(cr,info->terminal->color+V3270_COLOR_OIA_FOREGROUND); | 964 | + gdk_cairo_set_source_rgba(cr,info->terminal->color+V3270_COLOR_OIA_FOREGROUND); |
965 | 965 | ||
966 | info->step = draw_spinner(cr, rect, info->terminal->color, info->step); | 966 | info->step = draw_spinner(cr, rect, info->terminal->color, info->step); |
967 | gtk_widget_queue_draw_area(GTK_WIDGET(info->terminal),rect->x,rect->y,rect->width,rect->height); | 967 | gtk_widget_queue_draw_area(GTK_WIDGET(info->terminal),rect->x,rect->y,rect->width,rect->height); |
src/pw3270/v3270/private.h
@@ -176,7 +176,7 @@ G_BEGIN_DECLS | @@ -176,7 +176,7 @@ G_BEGIN_DECLS | ||
176 | gint minimum_height; | 176 | gint minimum_height; |
177 | 177 | ||
178 | // Colors | 178 | // Colors |
179 | - GdkColor color[V3270_COLOR_COUNT]; /**< Terminal widget colors */ | 179 | + GdkRGBA color[V3270_COLOR_COUNT]; /**< Terminal widget colors */ |
180 | 180 | ||
181 | // Regions | 181 | // Regions |
182 | GdkRectangle oia_rect[V3270_OIA_FIELD_COUNT]; | 182 | GdkRectangle oia_rect[V3270_OIA_FIELD_COUNT]; |
@@ -219,7 +219,7 @@ G_BEGIN_DECLS | @@ -219,7 +219,7 @@ G_BEGIN_DECLS | ||
219 | const GtkWidgetClass * v3270_get_parent_class(void); | 219 | const GtkWidgetClass * v3270_get_parent_class(void); |
220 | 220 | ||
221 | gboolean v3270_draw(GtkWidget * widget, cairo_t * cr); | 221 | gboolean v3270_draw(GtkWidget * widget, cairo_t * cr); |
222 | -void v3270_draw_oia(cairo_t *cr, H3270 *host, int row, int cols, struct v3270_metrics *metrics, GdkColor *color, GdkRectangle *rect); | 222 | +void v3270_draw_oia(cairo_t *cr, H3270 *host, int row, int cols, struct v3270_metrics *metrics, GdkRGBA *color, GdkRectangle *rect); |
223 | void v3270_update_mouse_pointer(GtkWidget *widget); | 223 | void v3270_update_mouse_pointer(GtkWidget *widget); |
224 | 224 | ||
225 | #if ! GTK_CHECK_VERSION(2,18,0) | 225 | #if ! GTK_CHECK_VERSION(2,18,0) |
@@ -241,7 +241,9 @@ void v3270_update_mouse_pointer(GtkWidget *widget); | @@ -241,7 +241,9 @@ void v3270_update_mouse_pointer(GtkWidget *widget); | ||
241 | 241 | ||
242 | 242 | ||
243 | #if ! GTK_CHECK_VERSION(3,0,0) | 243 | #if ! GTK_CHECK_VERSION(3,0,0) |
244 | - gboolean v3270_expose(GtkWidget * widget, GdkEventExpose *event); | 244 | + |
245 | +#define GdkRGBA | ||
246 | +gboolean v3270_expose(GtkWidget * widget, GdkEventExpose *event); | ||
245 | #endif // GTK 3 | 247 | #endif // GTK 3 |
246 | 248 | ||
247 | void v3270_draw_shift_status(v3270 *terminal); | 249 | void v3270_draw_shift_status(v3270 *terminal); |
@@ -254,13 +256,13 @@ void v3270_update_cursor_surface(v3270 *widget,unsigned char chr,unsigned sho | @@ -254,13 +256,13 @@ void v3270_update_cursor_surface(v3270 *widget,unsigned char chr,unsigned sho | ||
254 | 256 | ||
255 | void v3270_register_io_handlers(v3270Class *cls); | 257 | void v3270_register_io_handlers(v3270Class *cls); |
256 | 258 | ||
257 | -void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, guint height, GdkRectangle *rect, GdkColor *fg, GdkColor *bg); | 259 | +void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, guint height, GdkRectangle *rect, GdkRGBA *fg, GdkRGBA *bg); |
258 | 260 | ||
259 | void v3270_start_timer(GtkWidget *terminal); | 261 | void v3270_start_timer(GtkWidget *terminal); |
260 | void v3270_stop_timer(GtkWidget *terminal); | 262 | void v3270_stop_timer(GtkWidget *terminal); |
261 | 263 | ||
262 | -void v3270_draw_connection(cairo_t *cr, H3270 *host, struct v3270_metrics *metrics, GdkColor *color, const GdkRectangle *rect); | ||
263 | -void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metrics, GdkColor *color, GdkRectangle *rect); | 264 | +void v3270_draw_connection(cairo_t *cr, H3270 *host, struct v3270_metrics *metrics, GdkRGBA *color, const GdkRectangle *rect); |
265 | +void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, struct v3270_metrics *metrics, GdkRGBA *color, GdkRectangle *rect); | ||
264 | 266 | ||
265 | void v3270_update_char(H3270 *session, int addr, unsigned char chr, unsigned short attr, unsigned char cursor); | 267 | void v3270_update_char(H3270 *session, int addr, unsigned char chr, unsigned short attr, unsigned char cursor); |
266 | 268 |
src/pw3270/v3270/widget.c
@@ -1227,7 +1227,7 @@ void v3270_set_colors(GtkWidget *widget, const gchar *colors) | @@ -1227,7 +1227,7 @@ void v3270_set_colors(GtkWidget *widget, const gchar *colors) | ||
1227 | 1227 | ||
1228 | } | 1228 | } |
1229 | 1229 | ||
1230 | -void v3270_set_color(GtkWidget *widget, enum V3270_COLOR id, GdkColor *color) | 1230 | +void v3270_set_color(GtkWidget *widget, enum V3270_COLOR id, GdkRGBA *color) |
1231 | { | 1231 | { |
1232 | g_return_if_fail(GTK_IS_V3270(widget)); | 1232 | g_return_if_fail(GTK_IS_V3270(widget)); |
1233 | 1233 | ||
@@ -1238,24 +1238,24 @@ void v3270_set_color(GtkWidget *widget, enum V3270_COLOR id, GdkColor *color) | @@ -1238,24 +1238,24 @@ void v3270_set_color(GtkWidget *widget, enum V3270_COLOR id, GdkColor *color) | ||
1238 | #endif // !GTK(3,0,0) | 1238 | #endif // !GTK(3,0,0) |
1239 | 1239 | ||
1240 | } | 1240 | } |
1241 | -GdkColor * v3270_get_color(GtkWidget *widget, enum V3270_COLOR id) | 1241 | +GdkRGBA * v3270_get_color(GtkWidget *widget, enum V3270_COLOR id) |
1242 | { | 1242 | { |
1243 | g_return_val_if_fail(GTK_IS_V3270(widget),NULL); | 1243 | g_return_val_if_fail(GTK_IS_V3270(widget),NULL); |
1244 | return GTK_V3270(widget)->color+id; | 1244 | return GTK_V3270(widget)->color+id; |
1245 | } | 1245 | } |
1246 | 1246 | ||
1247 | -const GdkColor * v3270_get_color_table(GtkWidget *widget) | 1247 | +const GdkRGBA * v3270_get_color_table(GtkWidget *widget) |
1248 | { | 1248 | { |
1249 | g_return_val_if_fail(GTK_IS_V3270(widget),NULL); | 1249 | g_return_val_if_fail(GTK_IS_V3270(widget),NULL); |
1250 | return GTK_V3270(widget)->color; | 1250 | return GTK_V3270(widget)->color; |
1251 | } | 1251 | } |
1252 | 1252 | ||
1253 | -void v3270_set_mono_color_table(GdkColor *clr, const gchar *fg, const gchar *bg) | 1253 | +void v3270_set_mono_color_table(GdkRGBA *clr, const gchar *fg, const gchar *bg) |
1254 | { | 1254 | { |
1255 | int f; | 1255 | int f; |
1256 | 1256 | ||
1257 | - gdk_color_parse(bg,clr); | ||
1258 | - gdk_color_parse(fg,clr+1); | 1257 | + gdk_rgba_parse(clr,bg); |
1258 | + gdk_rgba_parse(clr+1,fg); | ||
1259 | 1259 | ||
1260 | for(f=2;f<V3270_COLOR_COUNT;f++) | 1260 | for(f=2;f<V3270_COLOR_COUNT;f++) |
1261 | clr[f] = clr[1]; | 1261 | clr[f] = clr[1]; |
@@ -1268,12 +1268,14 @@ void v3270_set_mono_color_table(GdkColor *clr, const gchar *fg, const gchar *bg) | @@ -1268,12 +1268,14 @@ void v3270_set_mono_color_table(GdkColor *clr, const gchar *fg, const gchar *bg) | ||
1268 | 1268 | ||
1269 | } | 1269 | } |
1270 | 1270 | ||
1271 | -void v3270_set_color_table(GdkColor *table, const gchar *colors) | 1271 | +void v3270_set_color_table(GdkRGBA *table, const gchar *colors) |
1272 | { | 1272 | { |
1273 | gchar **clr; | 1273 | gchar **clr; |
1274 | guint cnt; | 1274 | guint cnt; |
1275 | int f; | 1275 | int f; |
1276 | 1276 | ||
1277 | + trace("colors=[%s]",colors); | ||
1278 | + | ||
1277 | clr = g_strsplit(colors,",",V3270_COLOR_COUNT+1); | 1279 | clr = g_strsplit(colors,",",V3270_COLOR_COUNT+1); |
1278 | cnt = g_strv_length(clr); | 1280 | cnt = g_strv_length(clr); |
1279 | 1281 | ||
@@ -1281,13 +1283,13 @@ void v3270_set_color_table(GdkColor *table, const gchar *colors) | @@ -1281,13 +1283,13 @@ void v3270_set_color_table(GdkColor *table, const gchar *colors) | ||
1281 | { | 1283 | { |
1282 | case 28: // Version 4 string | 1284 | case 28: // Version 4 string |
1283 | for(f=0;f < 28;f++) | 1285 | for(f=0;f < 28;f++) |
1284 | - gdk_color_parse(clr[f],table+f); | 1286 | + gdk_rgba_parse(table+f,clr[f]); |
1285 | table[V3270_COLOR_OIA_STATUS_INVALID] = table[V3270_COLOR_OIA_STATUS_WARNING]; | 1287 | table[V3270_COLOR_OIA_STATUS_INVALID] = table[V3270_COLOR_OIA_STATUS_WARNING]; |
1286 | break; | 1288 | break; |
1287 | 1289 | ||
1288 | case V3270_COLOR_COUNT: // Complete string | 1290 | case V3270_COLOR_COUNT: // Complete string |
1289 | for(f=0;f < V3270_COLOR_COUNT;f++) | 1291 | for(f=0;f < V3270_COLOR_COUNT;f++) |
1290 | - gdk_color_parse(clr[f],table+f); | 1292 | + gdk_rgba_parse(table+f,clr[f]); |
1291 | break; | 1293 | break; |
1292 | 1294 | ||
1293 | default: | 1295 | default: |
@@ -1295,10 +1297,10 @@ void v3270_set_color_table(GdkColor *table, const gchar *colors) | @@ -1295,10 +1297,10 @@ void v3270_set_color_table(GdkColor *table, const gchar *colors) | ||
1295 | g_warning("Color table has %d elements; should be %d.",cnt,V3270_COLOR_COUNT); | 1297 | g_warning("Color table has %d elements; should be %d.",cnt,V3270_COLOR_COUNT); |
1296 | 1298 | ||
1297 | for(f=0;f < cnt;f++) | 1299 | for(f=0;f < cnt;f++) |
1298 | - gdk_color_parse(clr[f],table+f); | 1300 | + gdk_rgba_parse(table+f,clr[f]); |
1299 | 1301 | ||
1300 | for(f=cnt; f < V3270_COLOR_COUNT;f++) | 1302 | for(f=cnt; f < V3270_COLOR_COUNT;f++) |
1301 | - gdk_color_parse(clr[cnt-1],table+f); | 1303 | + gdk_rgba_parse(table+f,clr[cnt-1]); |
1302 | 1304 | ||
1303 | clr[V3270_COLOR_OIA_BACKGROUND] = clr[0]; | 1305 | clr[V3270_COLOR_OIA_BACKGROUND] = clr[0]; |
1304 | clr[V3270_COLOR_SELECTED_BG] = clr[0]; | 1306 | clr[V3270_COLOR_SELECTED_BG] = clr[0]; |