Commit 1913a4fbaeb5ff11c8d8d47d750d9f0566445b99
1 parent
64255706
Exists in
master
and in
1 other branch
Trying to fix fedora 32 builds.
Showing
4 changed files
with
41 additions
and
42 deletions
Show diff stats
src/include/internals.h
| @@ -123,7 +123,7 @@ | @@ -123,7 +123,7 @@ | ||
| 123 | 123 | ||
| 124 | /*--[ Constants ]------------------------------------------------------------------------------------*/ | 124 | /*--[ Constants ]------------------------------------------------------------------------------------*/ |
| 125 | 125 | ||
| 126 | - G_GNUC_INTERNAL const gchar * v3270_default_colors; | 126 | + G_GNUC_INTERNAL const gchar * v3270_get_default_colors(); |
| 127 | 127 | ||
| 128 | /*--[ Internal methods ]-----------------------------------------------------------------------------*/ | 128 | /*--[ Internal methods ]-----------------------------------------------------------------------------*/ |
| 129 | 129 |
src/terminal/colors.c
| @@ -33,53 +33,52 @@ | @@ -33,53 +33,52 @@ | ||
| 33 | #include <lib3270.h> | 33 | #include <lib3270.h> |
| 34 | #include <lib3270/log.h> | 34 | #include <lib3270/log.h> |
| 35 | 35 | ||
| 36 | -/*--[ Globals ]--------------------------------------------------------------------------------------*/ | ||
| 37 | - | ||
| 38 | -const gchar * v3270_default_colors = | ||
| 39 | - "#000000," // V3270_COLOR_BACKGROUND | ||
| 40 | - "#7890F0," // V3270_COLOR_BLUE | ||
| 41 | - "#FF0000," // V3270_COLOR_RED | ||
| 42 | - "#FF00FF," // V3270_COLOR_PINK | ||
| 43 | - "#00FF00," // V3270_COLOR_GREEN | ||
| 44 | - "#00FFFF," // V3270_COLOR_TURQUOISE | ||
| 45 | - "#FFFF00," // V3270_COLOR_YELLOW | ||
| 46 | - "#FFFFFF," // V3270_COLOR_WHITE | ||
| 47 | - "#000000," // V3270_COLOR_BLACK | ||
| 48 | - "#000080," // V3270_COLOR_DARK_BLUE | ||
| 49 | - "#FFA200," // V3270_COLOR_ORANGE | ||
| 50 | - "#800080," // V3270_COLOR_PURPLE | ||
| 51 | - "#008000," // V3270_COLOR_DARK_GREEN | ||
| 52 | - "#008080," // V3270_COLOR_DARK_TURQUOISE | ||
| 53 | - "#A0A000," // V3270_COLOR_MUSTARD | ||
| 54 | - "#C0C0C0," // V3270_COLOR_GRAY | ||
| 55 | - | ||
| 56 | - "#00FF00," // V3270_COLOR_FIELD_DEFAULT | ||
| 57 | - "#FF0000," // V3270_COLOR_FIELD_INTENSIFIED | ||
| 58 | - "#00FFFF," // V3270_COLOR_FIELD_PROTECTED | ||
| 59 | - "#FFFFFF," // V3270_COLOR_FIELD_PROTECTED_INTENSIFIED | ||
| 60 | - | ||
| 61 | - "#404040," // V3270_COLOR_SELECTED_BG | ||
| 62 | - "#FFFFFF," // V3270_COLOR_SELECTED_FG, | ||
| 63 | - | ||
| 64 | - "#00FF00," // V3270_COLOR_CROSS_HAIR | ||
| 65 | - | ||
| 66 | - "#000000," // V3270_COLOR_OIA_BACKGROUND | ||
| 67 | - "#00FF00," // V3270_COLOR_OIA | ||
| 68 | - "#7890F0," // V3270_COLOR_OIA_SEPARATOR | ||
| 69 | - "#FFFFFF," // V3270_COLOR_OIA_STATUS_OK | ||
| 70 | - "#FFFF00," // V3270_COLOR_OIA_STATUS_WARNING | ||
| 71 | - "#FFFF00"; // V3270_COLOR_OIA_STATUS_INVALID | ||
| 72 | - | ||
| 73 | - | ||
| 74 | /*--[ Implement ]------------------------------------------------------------------------------------*/ | 36 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
| 75 | 37 | ||
| 38 | +const gchar * v3270_get_default_colors() { | ||
| 39 | + | ||
| 40 | + return "#000000," // V3270_COLOR_BACKGROUND | ||
| 41 | + "#7890F0," // V3270_COLOR_BLUE | ||
| 42 | + "#FF0000," // V3270_COLOR_RED | ||
| 43 | + "#FF00FF," // V3270_COLOR_PINK | ||
| 44 | + "#00FF00," // V3270_COLOR_GREEN | ||
| 45 | + "#00FFFF," // V3270_COLOR_TURQUOISE | ||
| 46 | + "#FFFF00," // V3270_COLOR_YELLOW | ||
| 47 | + "#FFFFFF," // V3270_COLOR_WHITE | ||
| 48 | + "#000000," // V3270_COLOR_BLACK | ||
| 49 | + "#000080," // V3270_COLOR_DARK_BLUE | ||
| 50 | + "#FFA200," // V3270_COLOR_ORANGE | ||
| 51 | + "#800080," // V3270_COLOR_PURPLE | ||
| 52 | + "#008000," // V3270_COLOR_DARK_GREEN | ||
| 53 | + "#008080," // V3270_COLOR_DARK_TURQUOISE | ||
| 54 | + "#A0A000," // V3270_COLOR_MUSTARD | ||
| 55 | + "#C0C0C0," // V3270_COLOR_GRAY | ||
| 56 | + | ||
| 57 | + "#00FF00," // V3270_COLOR_FIELD_DEFAULT | ||
| 58 | + "#FF0000," // V3270_COLOR_FIELD_INTENSIFIED | ||
| 59 | + "#00FFFF," // V3270_COLOR_FIELD_PROTECTED | ||
| 60 | + "#FFFFFF," // V3270_COLOR_FIELD_PROTECTED_INTENSIFIED | ||
| 61 | + | ||
| 62 | + "#404040," // V3270_COLOR_SELECTED_BG | ||
| 63 | + "#FFFFFF," // V3270_COLOR_SELECTED_FG, | ||
| 64 | + | ||
| 65 | + "#00FF00," // V3270_COLOR_CROSS_HAIR | ||
| 66 | + | ||
| 67 | + "#000000," // V3270_COLOR_OIA_BACKGROUND | ||
| 68 | + "#00FF00," // V3270_COLOR_OIA | ||
| 69 | + "#7890F0," // V3270_COLOR_OIA_SEPARATOR | ||
| 70 | + "#FFFFFF," // V3270_COLOR_OIA_STATUS_OK | ||
| 71 | + "#FFFF00," // V3270_COLOR_OIA_STATUS_WARNING | ||
| 72 | + "#FFFF00"; // V3270_COLOR_OIA_STATUS_INVALID | ||
| 73 | +} | ||
| 74 | + | ||
| 76 | LIB3270_EXPORT void v3270_set_colors(GtkWidget *widget, const gchar *colors) | 75 | LIB3270_EXPORT void v3270_set_colors(GtkWidget *widget, const gchar *colors) |
| 77 | { | 76 | { |
| 78 | g_return_if_fail(GTK_IS_V3270(widget)); | 77 | g_return_if_fail(GTK_IS_V3270(widget)); |
| 79 | 78 | ||
| 80 | if(!colors) | 79 | if(!colors) |
| 81 | { | 80 | { |
| 82 | - colors = v3270_default_colors; | 81 | + colors = v3270_get_default_colors(); |
| 83 | } | 82 | } |
| 84 | 83 | ||
| 85 | v3270_set_color_table(GTK_V3270(widget)->color,colors); | 84 | v3270_set_color_table(GTK_V3270(widget)->color,colors); |
src/terminal/properties/init.c
| @@ -214,7 +214,7 @@ | @@ -214,7 +214,7 @@ | ||
| 214 | "colors", | 214 | "colors", |
| 215 | "colors", | 215 | "colors", |
| 216 | _("The terminal colors"), | 216 | _("The terminal colors"), |
| 217 | - v3270_default_colors, | 217 | + v3270_get_default_colors(), |
| 218 | G_PARAM_READABLE|G_PARAM_WRITABLE | 218 | G_PARAM_READABLE|G_PARAM_WRITABLE |
| 219 | ); | 219 | ); |
| 220 | 220 |
src/terminal/widget.c
| @@ -532,7 +532,7 @@ static void v3270_init(v3270 *widget) | @@ -532,7 +532,7 @@ static void v3270_init(v3270 *widget) | ||
| 532 | 532 | ||
| 533 | // Set defaults | 533 | // Set defaults |
| 534 | v3270_font_info_init(&widget->font); | 534 | v3270_font_info_init(&widget->font); |
| 535 | - v3270_set_color_table(widget->color,v3270_default_colors); | 535 | + v3270_set_color_table(widget->color,v3270_get_default_colors()); |
| 536 | 536 | ||
| 537 | for(ix = 0; ix < G_N_ELEMENTS(widget->responses); ix++) | 537 | for(ix = 0; ix < G_N_ELEMENTS(widget->responses); ix++) |
| 538 | widget->responses[ix] = GTK_RESPONSE_NONE; | 538 | widget->responses[ix] = GTK_RESPONSE_NONE; |