summary refs log tree commit diff stats
path: root/plugins/perl/perl.c
AgeCommit message (Expand)Author
2016-10-11perl: Remove dead assignmentIgor
2016-09-07perl: Fixed Windows build with VS2015u3.Arnavion
2014-12-28Use glib for allocations in all pluginsTingPing
2014-12-17More consistently include config.hTingPing
2014-12-14perl: Fixed warning about implicitly casting the time_t returned from hexchat...Arnavion
2014-12-04Fix some obvious type warnings.Arnavion
2014-06-04win32: Use config.h instead of config-win32.hTingPing
2014-03-11Fix miscapitalizationEustachy Kapusta
2014-02-12Fix some leaksTingPing
2013-10-13Perl: fixed crash when a script exits abnormallyFarow
2013-10-12Rename Strawberry to Hexchat in Perl error messageEustachy Kapusta
2013-10-07Rebrand Perl plugin to HexChat,Farow
2013-10-05some Typos causing lintian moaning: {R,r}eciev.. -> {R,r}eceiv..Alf Gaida
2013-09-27Update link to site in perl pluginEustachy Kapusta
2013-08-04Add reload command for plugins and add to guiTingPing
2013-04-23Add '(void)' to fix perl.c unused-value warning messageRichardHitt
2013-03-24TypoTingPing
2013-03-24Update missing perl note.TingPing
2013-03-19Update Perl download linksBerke Viktor
2013-03-16Backport XChat r1523Berke Viktor
2012-12-23fix incorrect FSF addressDan Mashal
2012-11-12Update Perl error message according to recent changesBerke Viktor
2012-11-11RebrandingBerke Viktor
2012-11-04Use configdir instead of *xchatdir*Berke Viktor
2012-10-30Some final rebrandingBerke Viktor
2012-10-30Rebrand get_info(xchatdir) but remain compatible for Perl and PythonBerke Viktor
2012-10-30Some remaining fixesBerke Viktor
2012-10-30Rebranding for the rest of plugin*Berke Viktor
2012-10-30Rebranding for XCHAT_EAT_*Berke Viktor
2012-10-30Rebranding for XCHAT_FD_*Berke Viktor
2012-10-30Rebranding for XCHAT_PRI_*Berke Viktor
2012-10-27Ignore generated config.h properly on UnixBerke Viktor
2012-10-24A lot more rebrandingBerke Viktor
2012-07-26Auto-load user plugins and scripts from <config>/addonsBerke Viktor
2012-07-21Use <configdir>/scripts to (auto)load Lua/Perl/Python/Tcl scriptsBerke Viktor
2012-07-20Some more rebrandingBerke Viktor
2012-07-19more branding changesxhmikosr
2012-07-13Dirent is no longer required for PerlBerke Viktor
2012-07-13Update XChat to r1514Berke Viktor
2012-07-13Update XChat to r1511Berke Viktor
2012-06-10More solution fixes and add language interfacesBerke Viktor
2011-12-11some more multiplatform supportBerke Viktor
2011-12-11initial patches for linux compatibilityBerke Viktor
2011-11-23Merge branch 'master' into wdkBerke Viktor
2011-11-23update xchat to r1498Berke Viktor
2011-07-28instruct users to download strawberry perl instead of activeperlberkeviktor@aol.com
2011-02-28add wdk changes to named branchberkeviktor@aol.com
2011-02-24add xchat r1489berkeviktor@aol.com
und-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/* X-Chat
 * Copyright (C) 1998 Peter Zelezny.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 */

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "fe-gtk.h"
#include "../common/xchat.h"
#include "../common/fe.h"

#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk-pixbuf/gdk-pixdata.h>
#include <gtk/gtkstock.h>

#include "../pixmaps/inline_pngs.h"

GdkPixbuf *pix_xchat;
GdkPixbuf *pix_book;

GdkPixbuf *pix_purple;
GdkPixbuf *pix_red;
GdkPixbuf *pix_op;
GdkPixbuf *pix_hop;
GdkPixbuf *pix_voice;

GdkPixbuf *pix_tray_msg;
GdkPixbuf *pix_tray_hilight;
GdkPixbuf *pix_tray_file;

GdkPixbuf *pix_channel;
GdkPixbuf *pix_dialog;
GdkPixbuf *pix_server;
GdkPixbuf *pix_util;


static GdkPixmap *
pixmap_load_from_file_real (char *file)
{
	GdkPixbuf *img;
	GdkPixmap *pixmap;

	img = gdk_pixbuf_new_from_file (file, 0);
	if (!img)
		return NULL;
	gdk_pixbuf_render_pixmap_and_mask (img, &pixmap, NULL, 128);
	gdk_pixbuf_unref (img);

	return pixmap;
}

GdkPixmap *
pixmap_load_from_file (char *filename)
{
	char buf[256];
	GdkPixmap *pix;

	if (filename[0] == '\0')
		return NULL;

	pix = pixmap_load_from_file_real (filename);
	if (pix == NULL)
	{
		strcpy (buf, "Cannot open:\n\n");
		strncpy (buf + 14, filename, sizeof (buf) - 14);
		buf[sizeof (buf) - 1] = 0;
		fe_message (buf, FE_MSG_ERROR);
	}

	return pix;
}

#define LOADPIX(vv,pp,ff) \
	vv = gdk_pixbuf_new_from_file (HEXCHATSHAREDIR"/hexchat/"ff, 0); \
	if (!vv) \
		vv = gdk_pixbuf_new_from_inline (-1, pp, FALSE, 0);

#define LOADPIX_DISKONLY(vv,ff) \
	vv = gdk_pixbuf_new_from_file (HEXCHATSHAREDIR"/hexchat/"ff, 0);

#define EXT ".png"

void
pixmaps_init (void)
{
	pix_book = gdk_pixbuf_new_from_inline (-1, bookpng, FALSE, 0);

	/* used in About window, tray icon and WindowManager icon. */
	LOADPIX (pix_xchat, hexchatpng, "hexchat"EXT);

	/* userlist icons, with inlined defaults */
	LOADPIX (pix_hop, hoppng, "hop"EXT);
	LOADPIX (pix_purple, purplepng, "purple"EXT);
	LOADPIX (pix_red, redpng, "red"EXT);
	LOADPIX (pix_op, oppng, "op"EXT);
	LOADPIX (pix_voice, voicepng, "voice"EXT);

	/* tray icons, with inlined defaults */
	LOADPIX (pix_tray_msg, traymsgpng, "message"EXT);
	LOADPIX (pix_tray_hilight, trayhilightpng, "highlight"EXT);
	LOADPIX (pix_tray_file, trayfilepng, "fileoffer"EXT);

	/* treeview icons, no defaults, load from disk only */
	LOADPIX_DISKONLY (pix_channel,	"channel"EXT);
	LOADPIX_DISKONLY (pix_dialog,		"dialog"EXT);
	LOADPIX_DISKONLY (pix_server,		"server"EXT);
	LOADPIX_DISKONLY (pix_util,		"util"EXT);
}