Commit 1974bba97d6cecfc80d64bf3cc8470957371027e
1 parent
b97b5d0f
Exists in
master
and in
1 other branch
Objeto GdkColor foi "deprecado" substituindo por GdkRGBA
Showing
4 changed files
with
75 additions
and
71 deletions
Show diff stats
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 |
| @@ -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); |
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 |
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]; |