/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * GUI utility functions * * Authors: * Miguel de Icaza (miguel@ximian.com) * Chris Toshok (toshok@ximian.com) * * Copyright (C) 1999 Miguel de Icaza * Copyright (C) 2000-2003 Ximian, Inc. */ #include #include #include "e-gui-utils.h" #include #include #include #include #include #include #include #include #ifdef HAVE_LIBGNOMEUI_GNOME_ICON_LOOKUP_H #include #else #include "art/empty.xpm" #endif GtkWidget *e_create_image_widget(gchar *name, gchar *string1, gchar *string2, gint int1, gint int2) { char *filename; GtkWidget *alignment = NULL; if (string1) { GtkWidget *w; if (*string1 == '/') filename = g_strdup(string1); else filename = g_build_filename (EVOLUTION_IMAGES, string1, NULL); w = gtk_image_new_from_file (filename); alignment = gtk_widget_new(gtk_alignment_get_type(), "child", w, "xalign", (double) 0, "yalign", (double) 0, "xscale", (double) 0, "yscale", (double) 0, NULL); gtk_widget_show_all (alignment); g_free (filename); } return alignment; } GtkWidget * e_button_new_with_stock_icon (const char *label_str, const char *stockid) { GtkWidget *button, *hbox, *label, *align, *image; button = gtk_button_new (); label = gtk_label_new_with_mnemonic (label_str); gtk_label_set_mnemonic_widget (GTK_LABEL (label), button); image = gtk_image_new_from_stock (stockid, GTK_ICON_SIZE_BUTTON); hbox = gtk_hbox_new (FALSE, 2); align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_container_add (GTK_CONTAINER (button), align); gtk_container_add (GTK_CONTAINER (align), hbox); gtk_widget_show_all (align); return button; } /** * e_icon_for_mime_type: * @mime_type: a MIME type * @size_hint: the size the caller plans to display the icon at * * Tries to find an icon representing @mime_type that will display * nicely at @size_hint by @size_hint pixels. The returned icon * may or may not actually be that size. * * Return value: a pixbuf, which the caller must unref when it is done **/ GdkPixbuf * e_icon_for_mime_type (const char *mime_type, int size_hint) { char *icon_name, *icon_path = NULL; GdkPixbuf *pixbuf = NULL; #ifdef HAVE_LIBGNOMEUI_GNOME_ICON_LOOKUP_H static GnomeIconTheme *icon_theme = NULL; /* Try the icon theme. (GNOME 2.2 or Sun GNOME 2.0). * This will also look in GNOME VFS. */ if (!icon_theme) icon_theme = gnome_icon_theme_new (); icon_name = gnome_icon_lookup (icon_theme, NULL, NULL, NULL, NULL, mime_type, 0, NULL); if (icon_name) { icon_path = gnome_icon_theme_lookup_icon ( icon_theme, icon_name, size_hint, NULL, NULL); g_free (icon_name); } #else const char *vfs_icon_name; /* Try gnome-vfs. (gnome-vfs.mime itself doesn't offer much, * but other software packages may define icons for * themselves. */ vfs_icon_name = gnome_vfs_mime_get_icon (mime_type); if (vfs_icon_name) { icon_path = gnome_program_locate_file ( NULL, GNOME_FILE_DOMAIN_PIXMAP, vfs_icon_name, TRUE, NULL); } if (!icon_path) { char *p; /* Try gnome-mime-data. */ icon_name = g_strdup_printf ("document-icons/gnome-%s.png", mime_type); p = strrchr (icon_name, '/'); if (p) *p = '-'; icon_path = gnome_program_locate_file ( NULL, GNOME_FILE_DOMAIN_PIXMAP, icon_name, TRUE, NULL); g_free (icon_name); } if (!icon_path) { /* Use the generic document icon. */ icon_path = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_PIXMAP, "document-icons/i-regular.png", TRUE, NULL); if (!icon_path) { g_warning ("Could not get any icon for %s!",mime_type); return gdk_pixbuf_new_from_xpm_data((const char **)empty_xpm); } } #endif if (icon_path == NULL) return NULL; pixbuf = gdk_pixbuf_new_from_file (icon_path, NULL); g_free (icon_path); return pixbuf; } n value='gnome-3.32'>gnome-3.32 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
path: root/print
Commit message (Expand)AuthorAgeFilesLines
* Present KDE SC 4.4.4 for FreeBSD.makc2010-06-022-2/+2
* Update to 1.1.24edwin2010-06-013-14/+4
* update xfce to 4.6.2oliver2010-05-311-1/+2
* Bounce PORTREVISION for gettext-related ports. Have fun, ya'll.ade2010-05-3123-18/+23
* - drop USE_GNUSTEP_PREFIXdinoex2010-05-302-31/+30
* - Update to 2.4lwhsu2010-05-263-6/+27
* - Pass maintainership to haskell@FreeBSD.org:jacula2010-05-262-2/+2
* Disable the cups driver when either WITHOUT_CUPS=true orhrs2010-05-262-7/+19
* - Make the driver selection stricter and redefine DEVICE_DEVSn in thehrs2010-05-255-135/+296
* - Revert back previous changes and fix buildmiwi2010-05-241-5/+1
* Reset perky@FreeBSD.org due to maintainer-timeouts and no responselinimon2010-05-241-1/+1
* - Fix plist substitutionpav2010-05-241-1/+1
* - Attempt to fix plistpav2010-05-241-1/+1
* - Add missing dependencymiwi2010-05-221-2/+9
* - Update to 2.3.12miwi2010-05-212-5/+5
* Update to 2.1.8 release.ale2010-05-202-4/+4
* - Update MASTER_SITESwen2010-05-192-5/+4
* - Fix dos2unix corruption of gz filespav2010-05-171-0/+1
* - Update to 3.10.5pav2010-05-173-7/+15
* - Move print/hplip3 to print/hplippav2010-05-1727-3194/+1152
* - Chase freetype2 update to 2.3.12sylvio2010-05-172-4/+4
* - Update to 3.6.9sylvio2010-05-173-5/+21
* Add possibility to choose the samba port to depend on.stefan2010-05-161-1/+2
* Fix configure args [1]makc2010-05-162-15/+21
* - Fix plist for NOPORTDOCS case (some docs get installed regardless)pav2010-05-161-4/+4
* - Explicitly build with LANG=C since gcj does not handle all host charsets.gerald2010-05-161-1/+1
* - Fix issue regarding net-snmppav2010-05-142-29/+44
* Fix depends, so it builds.kwm2010-05-131-0/+3
* Introduce a new (and hopefully better) ports infrastructure for Haskell Cabalpgj2010-05-134-205/+34
* Fix master site.kwm2010-05-121-1/+1
* - Mark BROKEN on 6.x. gcjh45 core dumps on 6.x with no immediately obviousglarkin2010-05-121-1/+7
* - The FreeBSD KDE team is pleased to announce KDE SC 4.4.3 for FreeBSDfluffy2010-05-112-18/+8
* - Use gcc >= 4.5 instead of gcc == 4.5 to buildglarkin2010-05-111-1/+1
* Presenting GNOME 2.30.1 for FreeBSD. The offical release notes for thiskwm2010-05-1122-118/+184
* - Update to 2.9miwi2010-05-092-8/+7
* - Update to 20100501sylvio2010-05-086-119/+22
* - Fix python version in plist, detection of sane and etcpav2010-05-044-2/+25
* - Build pdftk with gcj45 instead of gcj42glarkin2010-05-0416-16/+480
* - Update print/libotf to 0.9.11wen2010-05-033-6/+12
* Fix problems caused by the recent bumps in port revisionpgj2010-04-281-0/+1
* - Update to 5.9.13.araujo2010-04-212-4/+4
* Update to 3.10.2makc2010-04-216-132/+122
* - Update to 0.9awen2010-04-202-6/+5
* Switch to use newer GMP version.ale2010-04-192-3/+4
* Update to 9.3.2.hrs2010-04-182-5/+4
* - Update to 1.2.8sylvio2010-04-182-5/+4
* - Fix pkg-plist (do not install bytecode program).stas2010-04-111-0/+1
* Fix "-sDEVICE=ijs -sIjsServer=hpijs" issue.hrs2010-04-112-2/+3
* - Mark BROKEN: does not configurepav2010-04-101-0/+2
* Update to 2.1.7 release.ale2010-04-092-9/+4
* - Update to 1.9.stas2010-04-095-45/+47
* - update to 1.4.3dinoex2010-04-084-21/+154
* - bump 1.4.3dinoex2010-04-071-2/+1
* - Update to v0.7.4brix2010-04-042-4/+4
* Chase the ftp/curl shlib version bump.roam2010-04-031-1/+2
* * Update to 8.71.[1] Changes include:hrs2010-04-036-17/+62
* - Fix of buildsylvio2010-03-312-8/+8
* - Update to 0.5.4wen2010-03-312-5/+4
* - Update to 1.3.3.14sylvio2010-03-316-400/+466
* - fix build for png-1.4.1dinoex2010-03-291-0/+20
* - fix build for png-1.4.1dinoex2010-03-291-0/+53
* - fix build for png-1.4.1dinoex2010-03-292-0/+86
* - Add instrutcions for USB printers on FreeBSD 8dinoex2010-03-291-0/+7
* Update to 20100328 (version that fixes recent libpng change).matusita2010-03-293-16/+6
* - fix build for png-1.4.1dinoex2010-03-291-0/+11
* - fix build for png-1.4.1dinoex2010-03-282-0/+22
* Fix maintainer email address.makc2010-03-281-1/+1
* - fix build on CURRENTdinoex2010-03-281-0/+1
* - remove BROKENdinoex2010-03-281-2/+0
* - update to 1.4.1dinoex2010-03-28186-195/+203
* For those ports that have been fully adapted to USE_RC_SUBR remove thedougb2010-03-271-1/+0
* Begin the process of deprecating sysutils/rc_subr bydougb2010-03-275-5/+5
* - Chase x11-toolkits/fltk updategahr2010-03-242-2/+2
* - Update to 5.9.11.araujo2010-03-232-4/+4
* - Update to 1.1.23+nmu2sylvio2010-03-202-4/+4
* - Fix dependency line (cupsd is in ${LOCALBASE}/sbin)gahr2010-03-151-2/+2