# HG changeset patch # User Mark Doliner # Date 1094916336 0 # Node ID f1f239fa8973caaa7dcc43dc4c6e19f3086fd701 # Parent a38881ec9c0fd6abe45b730f0698d7fdb1c42d31 [gaim-migrate @ 10930] Superimpose the version number on the logo from Gary "What's superimposed...?" committer: Tailor Script diff -r a38881ec9c0f -r f1f239fa8973 src/gtkimhtml.c --- a/src/gtkimhtml.c Sat Sep 11 05:41:50 2004 +0000 +++ b/src/gtkimhtml.c Sat Sep 11 15:25:36 2004 +0000 @@ -366,11 +366,9 @@ g_free(tmp); return FALSE; - } font_metrics = pango_font_get_metrics(font, NULL); - pango_layout_get_pixel_size(layout, &scr_w, NULL); gap = PANGO_PIXELS((pango_font_metrics_get_ascent(font_metrics) + @@ -618,7 +616,7 @@ GtkTextIter start, end; GtkTextMark *sel = gtk_text_buffer_get_selection_bound(imhtml->text_buffer); GtkTextMark *ins = gtk_text_buffer_get_insert(imhtml->text_buffer); - + gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &start, sel); gtk_text_buffer_get_iter_at_mark(imhtml->text_buffer, &end, ins); primary = gtk_widget_get_clipboard(GTK_WIDGET(imhtml), GDK_SELECTION_PRIMARY) == clipboard; @@ -629,7 +627,7 @@ GString *str = g_string_new(NULL); if (primary) { text = gtk_imhtml_get_markup_range(imhtml, &start, &end); - } else + } else text = imhtml->clipboard_html_string; /* Mozilla asks that we start our text/html with the Unicode byte order mark */ diff -r a38881ec9c0f -r f1f239fa8973 src/status.c --- a/src/status.c Sat Sep 11 05:41:50 2004 +0000 +++ b/src/status.c Sat Sep 11 15:25:36 2004 +0000 @@ -649,7 +649,7 @@ temp_status = (GaimStatus *)g_hash_table_lookup( presence->status_table, gaim_status_type_get_id(temp_type)); - + if (gaim_status_is_active(temp_status)) { /* diff -r a38881ec9c0f -r f1f239fa8973 src/stock.c --- a/src/stock.c Sat Sep 11 05:41:50 2004 +0000 +++ b/src/stock.c Sat Sep 11 15:25:36 2004 +0000 @@ -121,6 +121,42 @@ return filename; } +static void +gaim_gtk_stock_versionize(GdkPixbuf **original, GtkWidget *widget) { + GdkPixmap *pixmap; + GtkStyle *style; + PangoContext *context; + PangoLayout *layout; + gchar *markup; + gint width, height; + gint lwidth = 0, lheight = 0; + + style = gtk_widget_get_style(widget); + + gdk_pixbuf_render_pixmap_and_mask(*original, &pixmap, NULL, 255); + width = gdk_pixbuf_get_width(*original); + height = gdk_pixbuf_get_height(*original); + g_object_unref(G_OBJECT(*original)); + + context = gtk_widget_get_pango_context(widget); + layout = pango_layout_new(context); + + markup = g_strdup_printf("%s", VERSION); + pango_layout_set_font_description(layout, style->font_desc); + pango_layout_set_markup(layout, markup, strlen(markup)); + g_free(markup); + + pango_layout_get_pixel_size(layout, &lwidth, &lheight); + gdk_draw_layout(GDK_DRAWABLE(pixmap), style->bg_gc[GTK_STATE_NORMAL], + width - (lwidth + 3), height - (lheight + 1), layout); + g_object_unref(G_OBJECT(layout)); + + *original = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL, + 0, 0, 0, 0, + width, height); + g_object_unref(G_OBJECT(pixmap)); +} + void gaim_gtk_stock_init(void) { @@ -166,6 +202,9 @@ g_free(filename); + if (!strcmp(stock_icons[i].name, GAIM_STOCK_LOGO)) + gaim_gtk_stock_versionize(&pixbuf, win); + iconset = gtk_icon_set_new_from_pixbuf(pixbuf); g_object_unref(G_OBJECT(pixbuf));