From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Koppelman Newsgroups: gmane.emacs.devel Subject: Re: Should we relax requirement from gtk 2.6 to gtk 2.4. Date: Thu, 06 Sep 2007 10:52:45 -0500 Message-ID: References: <46DF97DD.6040607@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1189094002 26305 80.91.229.12 (6 Sep 2007 15:53:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Sep 2007 15:53:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Jan =?utf-8?Q?Dj=C3=A4rv?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 06 17:53:22 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ITJfR-0007Zr-52 for ged-emacs-devel@m.gmane.org; Thu, 06 Sep 2007 17:53:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ITJfN-0004nd-93 for ged-emacs-devel@m.gmane.org; Thu, 06 Sep 2007 11:53:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ITJfK-0004m7-49 for emacs-devel@gnu.org; Thu, 06 Sep 2007 11:53:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ITJfI-0004kk-Eh for emacs-devel@gnu.org; Thu, 06 Sep 2007 11:53:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ITJfI-0004kh-6J for emacs-devel@gnu.org; Thu, 06 Sep 2007 11:53:08 -0400 Original-Received: from ecelsrv1.ece.lsu.edu ([130.39.223.98]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ITJfH-00057d-J8 for emacs-devel@gnu.org; Thu, 06 Sep 2007 11:53:07 -0400 Original-Received: from localhost (unknown [127.0.0.1]) by ecelsrv1.ece.lsu.edu (Postfix) with ESMTP id B1631283AA; Thu, 6 Sep 2007 15:53:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at ece.lsu.edu Original-Received: from ecelsrv1.ece.lsu.edu ([127.0.0.1]) by localhost (ecelsrv1.ece.lsu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IXNTW2GJpUmM; Thu, 6 Sep 2007 10:52:46 -0500 (CDT) Original-Received: from nested (nested.ece.lsu.edu [130.39.222.143]) by ecelsrv1.ece.lsu.edu (Postfix) with ESMTP id 4A522283A7; Thu, 6 Sep 2007 10:52:46 -0500 (CDT) Original-Received: from nested (localhost.localdomain [127.0.0.1]) by nested (8.13.1/8.13.1) with ESMTP id l86FqkD2024277; Thu, 6 Sep 2007 10:52:46 -0500 Original-Received: (from koppel@localhost) by nested (8.13.1/8.13.1/Submit) id l86Fqjev024274; Thu, 6 Sep 2007 10:52:45 -0500 In-Reply-To: <46DF97DD.6040607@swipnet.se> ("Jan =?utf-8?Q?Dj=C3=A4rv=22's?= message of "Thu\, 06 Sep 2007 08\:02\:05 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:77989 Archived-At: > AFAIK, there are no 2.4-compatible functions to do just that. Do you kno= w any? gtk_icon_theme_load_icon and gtk_image_new_from_pixbuf. The patch below shows how they might be used. The code compiles but I don't know if it works because for some reason no icons are being found (in code upstream of the changes). --- gtkutil.c 05 Sep 2007 09:17:48 -0500 1.115 +++ gtkutil.c 06 Sep 2007 10:46:25 -0500=09 @@ -3814,6 +3814,8 @@ update_frame_tool_bar (f) GtkStockItem stock_item; char *stock_name =3D NULL; char *icon_name =3D NULL; + GdkScreen* const screen =3D gtk_widget_get_screen(GTK_WIDGET(wtoolba= r)); + GtkIconTheme* const icon_theme =3D gtk_icon_theme_get_for_screen(scr= een); Lisp_Object rtl; GtkWidget *wbutton =3D NULL; GtkWidget *weventbox; @@ -3844,9 +3846,6 @@ update_frame_tool_bar (f) stock_name =3D SSDATA (stock); if (stock_name[0] =3D=3D 'n' && stock_name[1] =3D=3D ':') { - GdkScreen *screen =3D gtk_widget_get_screen (GTK_WIDGET (wto= olbar)); - GtkIconTheme *icon_theme =3D gtk_icon_theme_get_for_screen (= screen); - icon_name =3D stock_name + 2; stock_name =3D NULL; stock =3D Qnil; @@ -3932,7 +3931,10 @@ update_frame_tool_bar (f) } else if (icon_name)=20 { - w =3D gtk_image_new_from_icon_name (icon_name, icon_size); + GdkPixbuf* const pixbuf =3D + gtk_icon_theme_load_icon(icon_theme,icon_name,icon_size,0,= NULL); + + w =3D gtk_image_new_from_pixbuf(pixbuf); g_object_set_data_full (G_OBJECT (w), XG_TOOL_BAR_ICON_NAME, (gpointer) xstrdup (icon_name), (GDestroyNotify) xfree); @@ -4029,8 +4031,9 @@ update_frame_tool_bar (f) else if (icon_name && (! old_icon_name || strcmp (old_icon_name, icon_name) != =3D 0)) { - gtk_image_set_from_icon_name (GTK_IMAGE (wimage), - icon_name, icon_size); + GdkPixbuf* const pixbuf =3D + gtk_icon_theme_load_icon(icon_theme,icon_name,icon_size,0,= NULL); + gtk_image_set_from_pixbuf(GTK_IMAGE (wimage), pixbuf ); g_object_set_data_full (G_OBJECT (wimage), XG_TOOL_BAR_ICON_= NAME, (gpointer) xstrdup (icon_name), (GDestroyNotify) xfree); Jan Dj=C3=A4rv writes: > David Koppelman skrev: >> Recently Emacs changed the gtk version from 2.4? to 2.6, perhaps to >> accommodate a use of gtk_image_new_from_icon_name and >> gtk_image_set_from_icon_name. If that's all, then perhaps it would be >> better to use 2.4-compatible functions to do the same thing. > > AFAIK, there are no 2.4-compatible functions to do just that. Do you kno= w any? > > Jan D. > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel