diff options
author | marcus <marcus@FreeBSD.org> | 2004-09-02 12:08:52 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2004-09-02 12:08:52 +0800 |
commit | 6f79579a268fd05bd78c7ebf67d86cc93d891444 (patch) | |
tree | 0404fffe158378d3c3c4b6b9ca1b953b61233c8c | |
parent | 8a829e63b83c1512cebabb2074744f0b35fff4df (diff) | |
download | freebsd-ports-gnome-6f79579a268fd05bd78c7ebf67d86cc93d891444.tar.gz freebsd-ports-gnome-6f79579a268fd05bd78c7ebf67d86cc93d891444.tar.zst freebsd-ports-gnome-6f79579a268fd05bd78c7ebf67d86cc93d891444.zip |
Fix build on 4.X.
Reported by: Brett Schroeder <brett@brettschroeder.name>
-rw-r--r-- | sysutils/cog/files/patch-src_gtkrc-util.c | 88 | ||||
-rw-r--r-- | sysutils/cog/files/patch-src_setup-gnomeui.c | 26 | ||||
-rw-r--r-- | sysutils/cog/files/patch-src_setup-themecolors.c | 206 |
3 files changed, 320 insertions, 0 deletions
diff --git a/sysutils/cog/files/patch-src_gtkrc-util.c b/sysutils/cog/files/patch-src_gtkrc-util.c new file mode 100644 index 000000000000..ffbdd332fb4b --- /dev/null +++ b/sysutils/cog/files/patch-src_gtkrc-util.c @@ -0,0 +1,88 @@ +--- src/gtkrc-util.c.orig Thu Sep 2 00:03:32 2004 ++++ src/gtkrc-util.c Thu Sep 2 00:05:38 2004 +@@ -128,10 +128,11 @@ + int get_scrollbar_slider_length (char *scrollbar_fname) + { + GString * temp_string; +- temp_string = g_string_new(NULL); + int retval = 15; ++ FILE *fp; ++ temp_string = g_string_new(NULL); + +- FILE *fp = fopen (scrollbar_fname, "r"); ++ fp = fopen (scrollbar_fname, "r"); + if (fp == NULL) + { + return retval; +@@ -167,10 +168,11 @@ + + gboolean get_scrollbar_has_backward_stepper (char *scrollbar_fname){ + GString * temp_string; +- temp_string = g_string_new(NULL); + gboolean retval = TRUE; ++ FILE *fp; ++ temp_string = g_string_new(NULL); + +- FILE *fp = fopen (scrollbar_fname, "r"); ++ fp = fopen (scrollbar_fname, "r"); + if (fp == NULL) + { + return retval; +@@ -211,10 +213,11 @@ + gboolean get_scrollbar_has_secondary_backward_stepper (char *scrollbar_fname) + { + GString * temp_string; +- temp_string = g_string_new(NULL); + gboolean retval = FALSE; ++ FILE *fp; ++ temp_string = g_string_new(NULL); + +- FILE *fp = fopen (scrollbar_fname, "r"); ++ fp = fopen (scrollbar_fname, "r"); + if (fp == NULL) + { + return retval; +@@ -301,10 +304,11 @@ + gboolean get_enable_colors (char *gtkrc_fname) + { + GString * temp_string; +- temp_string = g_string_new(NULL); + gboolean retval = FALSE; ++ FILE *fp; ++ temp_string = g_string_new(NULL); + +- FILE *fp = fopen (gtkrc_fname, "r"); ++ fp = fopen (gtkrc_fname, "r"); + if (fp == NULL) + { + return FALSE; +@@ -342,10 +346,11 @@ + char *get_widget_color (char *widget_fname, char *color_name) + { + GString * temp_string; +- temp_string = g_string_new(NULL); + char retval[7] = "#ffffff"; ++ FILE *fp; ++ temp_string = g_string_new(NULL); + +- FILE *fp = fopen (widget_fname, "r"); ++ fp = fopen (widget_fname, "r"); + if (fp == NULL) + { + return g_string_new(retval)->str; +@@ -356,13 +361,14 @@ + c = getc(fp); + while(c!=EOF) + { ++ GString *match_string; + while(c!=EOF && c!='\n') + { + temp_string = g_string_append_c(temp_string, c); + c = getc(fp); + } + temp_string = g_string_new(g_strstrip(temp_string->str)); +- GString *match_string = g_string_new(color_name); ++ match_string = g_string_new(color_name); + match_string = g_string_append(match_string, " = *"); + + if (g_pattern_match_simple(match_string->str, temp_string->str)) diff --git a/sysutils/cog/files/patch-src_setup-gnomeui.c b/sysutils/cog/files/patch-src_setup-gnomeui.c new file mode 100644 index 000000000000..bd378d2eae15 --- /dev/null +++ b/sysutils/cog/files/patch-src_setup-gnomeui.c @@ -0,0 +1,26 @@ +--- src/setup-gnomeui.c.orig Wed Sep 1 23:12:01 2004 ++++ src/setup-gnomeui.c Wed Sep 1 23:52:18 2004 +@@ -49,6 +49,9 @@ + { + GtkWidget *w; + gchar *gconf_key; ++ GString *homedir; ++ GString *gtkrc20; ++ GString *gtkrc20scrollbar; + + gconf_key = "/desktop/gnome/interface/menubar_detachable"; + w = glade_xml_get_widget (main_window_xml, "menubars_detach_checkbutton"); +@@ -121,10 +124,10 @@ + } + + +- GString *homedir = g_string_new(getenv("HOME")); +- GString *gtkrc20 = g_string_new(g_string_append(homedir, "/.gtkrc-2.0")->str); + homedir = g_string_new(getenv("HOME")); +- GString *gtkrc20scrollbar = g_string_new(g_string_append(homedir, "/.gtkrc-2.0-scrollbar_cog")->str); ++ gtkrc20 = g_string_new(g_string_append(homedir, "/.gtkrc-2.0")->str); ++ homedir = g_string_new(getenv("HOME")); ++ gtkrc20scrollbar = g_string_new(g_string_append(homedir, "/.gtkrc-2.0-scrollbar_cog")->str); + + modify_gtkrc(gtkrc20->str, get_enable_colors(gtkrc20->str)); + diff --git a/sysutils/cog/files/patch-src_setup-themecolors.c b/sysutils/cog/files/patch-src_setup-themecolors.c new file mode 100644 index 000000000000..cef051c100bb --- /dev/null +++ b/sysutils/cog/files/patch-src_setup-themecolors.c @@ -0,0 +1,206 @@ +--- src/setup-themecolors.c.orig Wed Sep 1 23:53:45 2004 ++++ src/setup-themecolors.c Thu Sep 2 00:02:11 2004 +@@ -33,133 +33,143 @@ + GtkWidget *cw; + char hex[7]; + GString *glade_name; ++ GString *bg_normal, *bg_active, *bg_prelight, *bg_selected, *bg_insensitive; ++ GString *fg_normal, *fg_active, *fg_prelight, *fg_selected, *fg_insensitive; ++ GString *base_normal, *base_active, *base_prelight, *base_selected, ++ *base_insensitive; ++ GString *text_normal, *text_active, *text_prelight, *text_selected, ++ *text_insensitive; ++ GString *homedir; ++ GString *gtkrc20widget; ++ GtkWidget *w1; ++ gboolean b1; + + glade_name = g_string_append(g_string_new("bg[NORMAL]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *bg_normal = g_string_prepend(g_string_new(hex), "#"); ++ bg_normal = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("bg[ACTIVE]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *bg_active = g_string_prepend(g_string_new(hex), "#"); ++ bg_active = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("bg[PRELIGHT]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *bg_prelight = g_string_prepend(g_string_new(hex), "#"); ++ bg_prelight = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("bg[SELECTED]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *bg_selected = g_string_prepend(g_string_new(hex), "#"); ++ bg_selected = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("bg[INSENSITIVE]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *bg_insensitive = g_string_prepend(g_string_new(hex), "#"); ++ bg_insensitive = g_string_prepend(g_string_new(hex), "#"); + + + glade_name = g_string_append(g_string_new("fg[NORMAL]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *fg_normal = g_string_prepend(g_string_new(hex), "#"); ++ fg_normal = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("fg[ACTIVE]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *fg_active = g_string_prepend(g_string_new(hex), "#"); ++ fg_active = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("fg[PRELIGHT]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *fg_prelight = g_string_prepend(g_string_new(hex), "#"); ++ fg_prelight = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("fg[SELECTED]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *fg_selected = g_string_prepend(g_string_new(hex), "#"); ++ fg_selected = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("fg[INSENSITIVE]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *fg_insensitive = g_string_prepend(g_string_new(hex), "#"); ++ fg_insensitive = g_string_prepend(g_string_new(hex), "#"); + + + glade_name = g_string_append(g_string_new("base[NORMAL]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *base_normal = g_string_prepend(g_string_new(hex), "#"); ++ base_normal = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("base[ACTIVE]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *base_active = g_string_prepend(g_string_new(hex), "#"); ++ base_active = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("base[PRELIGHT]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *base_prelight = g_string_prepend(g_string_new(hex), "#"); ++ base_prelight = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("base[SELECTED]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *base_selected = g_string_prepend(g_string_new(hex), "#"); ++ base_selected = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("base[INSENSITIVE]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *base_insensitive = g_string_prepend(g_string_new(hex), "#"); ++ base_insensitive = g_string_prepend(g_string_new(hex), "#"); + + + glade_name = g_string_append(g_string_new("text[NORMAL]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *text_normal = g_string_prepend(g_string_new(hex), "#"); ++ text_normal = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("text[ACTIVE]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *text_active = g_string_prepend(g_string_new(hex), "#"); ++ text_active = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("text[PRELIGHT]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *text_prelight = g_string_prepend(g_string_new(hex), "#"); ++ text_prelight = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("text[SELECTED]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *text_selected = g_string_prepend(g_string_new(hex), "#"); ++ text_selected = g_string_prepend(g_string_new(hex), "#"); + + glade_name = g_string_append(g_string_new("text[INSENSITIVE]"), "_colorbutton"); + cw = glade_xml_get_widget (main_window_xml, glade_name->str); + gtk_color_button_get_color(GTK_COLOR_BUTTON(cw), &color); + sprintf(hex, "%02x%02x%02x", color.red/256, color.green/256, color.blue/256); +- GString *text_insensitive = g_string_prepend(g_string_new(hex), "#"); ++ text_insensitive = g_string_prepend(g_string_new(hex), "#"); + + +- GString *homedir = g_string_new(getenv("HOME")); +- GString *gtkrc20widget = g_string_new(g_string_append(homedir, "/.gtkrc-2.0-widget_cog")->str); ++ homedir = g_string_new(getenv("HOME")); ++ gtkrc20widget = g_string_new(g_string_append(homedir, "/.gtkrc-2.0-widget_cog")->str); + + write_widget_gtkrc(gtkrc20widget->str, + fg_normal->str, fg_active->str, fg_prelight->str, fg_selected->str, fg_insensitive->str, +@@ -167,8 +177,8 @@ + base_normal->str, base_active->str, base_prelight->str, base_selected->str, base_insensitive->str, + text_normal->str, text_active->str, text_prelight->str, text_selected->str, text_insensitive->str); + +- GtkWidget *w1 = glade_xml_get_widget (main_window_xml, "enable_themecolors_checkbutton"); +- gboolean b1 = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(w1)); ++ w1 = glade_xml_get_widget (main_window_xml, "enable_themecolors_checkbutton"); ++ b1 = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(w1)); + if (b1) + { + gtkrc_apply_changes(); +@@ -192,18 +202,21 @@ + { + GtkWidget *w; + GString *glade_name = g_string_append(g_string_new(name), "_colorbutton"); ++ GdkColor color; ++ GString *homedir; ++ GString *gtkrc20widget; ++ char *parse_str; + w = glade_xml_get_widget (main_window_xml, glade_name->str); + + g_signal_connect (G_OBJECT (w), "color-set", + G_CALLBACK (color_set_callback), + name); +- /* Set correct initial value of widget */ +- GdkColor color; + +- GString *homedir = g_string_new(getenv("HOME")); +- GString *gtkrc20widget = g_string_new(g_string_append(homedir, "/.gtkrc-2.0-widget_cog")->str); ++ /* Set correct initial value of widget */ ++ homedir = g_string_new(getenv("HOME")); ++ gtkrc20widget = g_string_new(g_string_append(homedir, "/.gtkrc-2.0-widget_cog")->str); + +- char *parse_str = get_widget_color(gtkrc20widget->str, name); ++ parse_str = get_widget_color(gtkrc20widget->str, name); + gdk_color_parse(parse_str, &color); + gtk_color_button_set_color (GTK_COLOR_BUTTON(w), &color); + } |