aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-gui-utils.c
blob: 3ce7110fff05229a5f5c5274b2c9248b91b66933 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * GUI utility functions
 *
 * Author:
 *   Miguel de Icaza (miguel@helixcode.com)
 *
 * (C) 1999 Miguel de Icaza
 * (C) 2000 Helix Code, Inc.
 */
#include <config.h>
#include <gtk/gtksignal.h>
#include <gnome.h>
#include "e-gui-utils.h"
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk-pixbuf/gnome-canvas-pixbuf.h>

GtkWidget *e_create_image_widget(gchar *name,
                 gchar *string1, gchar *string2,
                 gint int1, gint int2)
{
    char *filename;
    GdkPixbuf *pixbuf;
    double width, height;
    GtkWidget *canvas, *alignment;
    if (string1) {
        if (*string1 == '/')
            filename = g_strdup(string1);
        else
            filename = g_concat_dir_and_file(EVOLUTION_IMAGES, string1);
        pixbuf = gdk_pixbuf_new_from_file(filename);
        width = gdk_pixbuf_get_width(pixbuf);
        height = gdk_pixbuf_get_height(pixbuf);

        canvas = gnome_canvas_new_aa();
        GTK_OBJECT_UNSET_FLAGS(GTK_WIDGET(canvas), GTK_CAN_FOCUS);
        gnome_canvas_item_new(gnome_canvas_root(GNOME_CANVAS(canvas)),
                      gnome_canvas_pixbuf_get_type(),
                      "pixbuf", pixbuf,
                      NULL);

        alignment = gtk_widget_new(gtk_alignment_get_type(),
                       "child", canvas,
                       "xalign", (double) 0,
                       "yalign", (double) 0,
                       "xscale", (double) 0,
                       "yscale", (double) 0,
                       NULL);
    
        gtk_widget_set_usize(canvas, width, height);

        gdk_pixbuf_unref(pixbuf);

        gtk_widget_show(canvas);
        gtk_widget_show(alignment);
        g_free(filename);

        return alignment;
    } else
        return NULL;
}
class='deletions'>-1/+0 * 2011-09-01 astro/gkrellmoon: Abandonwarebapt2011-09-011-1/+0 * Remove some expired portsbapt2011-08-111-1/+0 * Removing old ruby stuffbapt2011-08-031-1/+0 * Remove ports BROKEN for more than 6 monthsbapt2011-08-021-2/+0 * Bye bye abandonwares (part 5)bapt2011-08-011-1/+0 * Bye bye abandonwares (part 4)bapt2011-08-011-3/+0 * Bye bye abandonwares (part 2)bapt2011-08-011-1/+0 * Remove Java 1.4 ports, they were already disconnected from bsd.java.mkrene2011-07-211-4/+0 * Remove expired ports:rene2011-07-211-4/+0 * - Add note about net/vmware-vsphere-cliswills2011-07-111-0/+2 * Remove expired ports:rene2011-07-031-3/+0 * 2011-07-01 math/femlab: No more distfile, looks like abandonwaremiwi2011-07-021-2/+0 * Remove expired port:rene2011-06-291-4/+0 * Bye Byemiwi2011-06-251-1/+0 * Free open-source disk encryption softwarewxs2011-06-111-0/+3 * Remove expired ports:rene2011-06-021-2/+0 * - Rename devel/jude-community to devel/astah-communitytota2011-05-091-1/+1 * - Updated to 3.0.0.b30 [1]glarkin2011-05-041-0/+1 * Removed kxl related portsbapt2011-05-031-2/+0 * Remove unmaintained expired ports from develbapt2011-05-021-4/+0 * Remove unmaintained expired ports from graphicsbapt2011-05-021-2/+0 * remove unmaintained expired ports from javabapt2011-05-021-2/+0 * remove unmaintained expired ports from miscbapt2011-05-021-2/+0 * remove unmaintained expired ports from multimediabapt2011-05-021-1/+0 * remove unmaintained expired ports from netbapt2011-05-021-3/+0 * Remove unmaintained expired ports from securitybapt2011-05-021-1/+0 * Remove unmaintained expired ports from sysutilsbapt2011-05-021-4/+0 * Remove most expired ports:rene2011-04-191-5/+0 * 2011-04-11 devel/thistest: development has ceased; website disappearedbapt2011-04-121-1/+0 * Garbage collect expired portsrene2011-04-051-1/+0 * 2011-03-31 java/netbeans3: old, unmaintainedbapt2011-03-311-3/+0 * - Cleanup expired entriessunpoet2011-03-191-56/+12 * - Update sysutils/megacli entrysunpoet2011-03-191-1/+2 * - Move all 13 ports out of mbone categorypav2011-03-071-1/+1 * Remove expired ports:rene2011-02-251-2/+0 * Remove expired ports:rene2011-02-221-2/+0 * Update javamail to 1.4.4 release, now open sourced!ale2011-02-161-1/+0 * Add entry for madfufw, firmware files don't allow redistributionarved2011-02-031-0/+1 * Also remoce Code2000 from LEGAL.thierry2011-01-251-2/+0 * Clean up after "rmport -a":rene2011-01-011-1/+0 * Add an entry for dmd as upstream prefers that binaries not tested by themself...bapt2010-11-291-0/+2 * Add java/jta.ale2010-11-241-0/+1 * Remove expired ports:garga2010-11-081-7/+0 * HE-AAC+ Codec as Shared Libraryamdmi32010-09-231-0/+2 * - Update audio/linux-nerodigitalaudio -> linux-neroaaccodecpgollucci2010-09-221-1/+1 * Add entry for math/giacxcas: French documentation is for non commercial use onlymakc2010-09-211-0/+1 * audio/audacious-crossfade||2010-09-08|Broken for 6+ months, unmaintainedpgollucci2010-09-081-5/+0 * As previously advertised, remove the remaining ports that have nodougb2010-09-051-26/+0 * - Add math/tetgen entry, which is free for research and non-commercial uses,lwhsu2010-08-041-0/+1 * Remove expired aacclibapt2010-08-031-2/+0 * Add graphics/libecwj2 that implements support for the JPEG2000 andosa2010-08-031-0/+1 * emulators/linux_base-gentoo-stage1||2010-06-08|Expired: please use emulators/...gabor2010-06-081-3/+0 * - Add a note for multimedia/mp4splitwen2010-05-271-0/+1 * - Update legal for www/mod_smooth_streamingpgollucci2010-05-261-0/+1 * Remove devel/perforce from LEGALrene2010-05-211-1/+0 * Add a note for www/thundercachegarga2010-03-191-0/+4 * - multimedia/linux-huludesktop is non-redistributable, for non-commercial, anditetcu2010-03-131-1/+4 * - Add entry for graphics/yedmiwi2010-02-121-0/+1 * - Added entry for new port net/rsmbglarkin2010-02-021-0/+4 * Remove wifimgr. Restrictions no longer apply.ehaupt2009-11-241-1/+0 * Add an entry for net-mgmt/wifimgrehaupt2009-11-231-0/+1 * - Add a entry for net/wowzamediaserverpromiwi2009-10-111-0/+1 * Add entry for audio/linuxsampler - license prohibits commercial use.trasz2009-09-151-0/+1 * Add a note about emulators/linux-systemsimcell:bsam2009-08-041-0/+2 * Remove entry for security/altivore.shaun2009-07-201-1/+0 * - textproc/scim-kmfl-sil-ipa-unicode5 is now X11 licensed.wxs2009-07-161-8/+0 * 2009-07-07 audio/gai-album: abandoned project, does not buildmiwi2009-07-071-2/+0 * Add tarsnap 1.0.24, the client code to the tarsnap secure online backupcperciva2009-07-051-0/+1 * - Remove security/metasploit. It is now BSD licensed and freely distributable.wxs2009-06-161-1/+0 * Remove expired ports in audio:erwin2009-06-131-12/+0 * Petite Chez Scheme is a complete Scheme system that is fully compatiblebeat2009-05-221-0/+1 * Update p4v to 2008.2.200026.scf2009-05-211-1/+1 * A Command Line Interface for the MegaRAID SAS family of RAID controllers,pgollucci2009-05-201-0/+1 * - Add restriction of www/mod_h264_streaminglwhsu2009-05-191-0/+1 * - Add lang/fsharppgj2009-05-101-0/+2 * - Restore festival+OGImiwi2009-05-051-0/+3 * 2009-04-28 audio/festival+OGI: unmaintained, does not work with current versi...miwi2009-05-051-3/+0 * - Mark as RESTRICTED. The License is limited to non-commercial use.araujo2009-04-081-0/+3 * 2009-03-22 mbone/nte: tcl8.0 support is going to be droppedmiwi2009-03-241-1/+0 * 2009-01-19 games/emacs-chess: has been broken for more than 6 monthsmiwi2009-02-041-1/+0 * LSI Logic MegaRAID SAS MegaCLI Releasepgollucci2009-01-191-0/+1 * Add audio/xmms-wavpack: Intended to be "free", but no actual licensingnaddy2009-01-121-0/+1 * Add entry for archivers/kziplioux2009-01-091-0/+1 * - Add chinese/CNS11643-fontchinsan2009-01-031-0/+2 * - Add entry for games/linux-sofmiwi2008-12-261-0/+1 * 2008-10-19 x11-wm/flwm: Project is dead, and uses obsolete version of fltkmiwi2008-12-081-1/+0 * Add entry for ksh93 ports.wxs2008-11-051-0/+1 * - Remove checkpassword entry since DJB's license had changed.garga2008-07-281-1/+0 * - Update for ssamtsepav2008-07-271-1/+1 * GSView is covered by the AFPL license.ale2008-07-211-0/+1 * - Add entry for games/linux-ssamtfemiwi2008-07-201-0/+1 * - Add entry for games/linux-unrealgoldmiwi2008-07-201-0/+1 * - Add entry for games/linux-etqw-demo-servermiwi2008-07-201-1/+2 * - Add games/linux-etqw-serve - Redistribution is limitedmiwi2008-07-201-0/+1 * Update the licensing conditions of Aqua Data Studio.thierry2008-04-201-3/+4 * Add an entry for databases/sqldeveloper.thierry2008-04-061-3/+5 * - csound has been liberatedpav2008-04-041-5/+0 * - Add entry for benchmarks/nttcpjadawin2008-03-311-0/+1 * - Remove duplicate entryjadawin2008-03-191-1/+0 * - Add entry for biology/clustalwjadawin2008-03-191-0/+2 * - Add entry for ventrilo-serverpav2008-03-131-0/+4 * Usual round of cleanups:danfe2008-03-011-160/+203 * 2007-12-12 net-im/wildfire: Use net-im/openfire instead of this portmiwi2008-02-281-2/+0 * 2007-10-31 www/vtiger4: This version is no longer supported by the developersmiwi2008-02-281-1/+0 * Add a note about vpncehaupt2008-02-281-0/+1 * - Add entry for science/dtiquerytabthorpe2008-02-251-0/+1 * Add LEGAL entry for komodo-editarved2008-02-141-0/+1 * - Add an entry for math/rapidtabthorpe2008-02-091-0/+1 * Add en entry for multimedia/vtkmpeg2encode.thierry2008-01-101-0/+3 * - Add RESTRICTED as the license doesn't allow binary redistributionlme2008-01-011-0/+1 * - Add entry for devel/thistest.alepulver2007-12-251-0/+1 * Command Line Interface for the Adaptec SCSI RAID family of RAID controllers,pav2007-12-201-0/+1 * Nero Digital Audio Reference MPEG-4 & 3GPP Audio Encoder.pav2007-12-151-0/+1 * Add netscape navigator and messenger.sat2007-12-151-0/+2 * Remove qmail since license has changed.garga2007-12-121-2/+0 * Add entries about ports/java/linux-sun-jre15 and ports/java/linux-sun-jre16.jkim2007-10-271-0/+4 * Add an entry about ports/textproc/scim-kmfl-sil-ipa-unicode5garga2007-10-251-0/+5 * Remove expired leaf ports:vd2007-10-121-1/+0 * - Add entry about games/linux-nerogameacm2007-10-061-0/+2 * - Add entry for emulators/win4bsd.alepulver2007-10-031-0/+1 * 2007-01-04 print/clibpdf: distfile and homepage disappearedtabthorpe2007-10-011-8/+0 * Remove print/ghostscript-afpl as it has been replaced by print/ghostscript-gplrafan2007-09-241-1/+0 * Add an entry about net-mgmt/send: Not redistributable, license agreement requ...edwin2007-09-231-0/+1 * 2007-08-22 java/jdk11-doc: Obsolete version of jdkmiwi2007-09-191-2/+0 * 2007-09-15 x11-wm/obtuner: broken with recent Openbox and the project is not ...miwi2007-09-181-2/+0 * - Update to 3.0.6miwi2007-09-141-1/+0 * - Add games/linux-savage-samuraiwars entryacm2007-09-101-1/+3 * - Update to 3.7.3trasz2007-09-061-1/+0 * Command-line encoder that outputs aacPlus v2 files (ie. Advanced Audio Coding +pav2007-07-291-0/+1 * - security/metasploit is updated to 3.0rafan2007-07-231-1/+1 * - Add entry for audio/libamrwb (No redistribution allowed).miwi2007-06-071-1/+2 * - Add entry for audio/libamrnb (No redistribution allowed).miwi2007-06-071-0/+1 * Add notes about:miwi2007-06-051-0/+3 * Add dlv to LEGAL, no information about redistributionarved2007-06-021-0/+1 * The port must be downloaded from the WWW and a Serial Number must be purchased.bsam2007-05-261-0/+2 * - Update to latest stable version (is minor than the port version so usealepulver2007-05-031-1/+0 * Redistribution of the VST PlugIns SDK is not allowed.trasz2007-04-151-0/+1 * - Add entry for java/dbvismiwi2007-04-131-0/+1 * - Remove www/urchin5 is marked for removal.miwi2007-04-111-2/+0 * Add a note about sysutils/seatools.bsam2007-04-091-0/+1 * - Remove entry for games/mararhon2-data: merged into games/alephone-data.alepulver2007-03-311-7/+4 * - Add entry for jaca/netbeans5miwi2007-03-201-0/+1 * Add science/gamess as No Redistribution.maho2007-03-131-0/+1 * Add GotoBLAS.maho2007-03-131-0/+1 * Remove expired ports:gabor2007-03-091-4/+0 * - Fix whitespacesmiwi2007-03-091-7/+7 * - Add entry for security/f-protdmiwi2007-03-091-0/+2 * Add www/groupoffice (Free for personal use only)nox2007-02-211-0/+2 * - Add entries for "lang/xds" and "lang/xds-c".alepulver2007-02-171-0/+2 * Remove expired leaf port:vd2007-02-121-2/+0 * - Add entry for graphics/tonicpoint-viewermiwi2007-02-071-0/+1 * Remove kqemu, it is now opensource (GPL version 2)nox2007-02-07