Compare commits

..

2 Commits

Author SHA1 Message Date
TingPing 218ad519e9 Initial work replacing dnd's gdk drawing with cairo 2014-06-04 17:49:15 -04:00
TingPing 7769de4018 xtext: Use cairo to draw everything 2014-06-04 16:17:29 -04:00
64 changed files with 1026 additions and 1230 deletions
-1
View File
@@ -7,7 +7,6 @@ Makefile.in
aclocal.m4
autom4te.cache/
compile
ar-lib
confdefs.h
conftest
conftest.c
+2 -7
View File
@@ -1,19 +1,14 @@
language: c
compiler:
- gcc
- clang
compiler: gcc
before_script:
- sudo apt-get update
- sudo apt-get build-dep -qq xchat
- sudo apt-get install -qq libnotify-dev libproxy-dev libpci-dev libcanberra-dev monodevelop gnome-common
script:
- ./autogen.sh
- ./configure --enable-textfe --with-theme-manager
- make V=1 -j$(nproc)
- make V=1
notifications:
irc:
channels: "chat.freenode.net#hexchat-devel"
template: "Build #%{build_number} (%{commit}) by %{author}: %{message}"
on_success: change
matrix:
fast_finish: true
+13 -27
View File
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT([HexChat],[2.11.0])
AC_INIT([HexChat],[2.10.0])
AC_PREREQ([2.60])
AC_COPYRIGHT([Copyright (C) 1998-2010 Peter Zelezny])
@@ -19,7 +19,6 @@ AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CPP
AM_PROG_AS
AM_PROG_AR
AM_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_PATH_PROG(MDTOOL, mdtool, no)
@@ -208,7 +207,7 @@ if test "$gtkfe" = yes ; then
fi
GUI_LIBS="$GUI_LIBS $GTK_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $GTK_CFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_DEPRECATED"
GUI_CFLAGS="$GUI_CFLAGS $GTK_CFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED"
dnl *********************************************************************
dnl ** MAC_INTEGRATION **************************************************
@@ -216,7 +215,7 @@ dnl *********************************************************************
_gdk_tgt=`$PKG_CONFIG --variable=target gdk-2.0`
if test "x$_gdk_tgt" = xquartz; then
PKG_CHECK_MODULES(GTK_MAC, gtk-mac-integration-gtk2, [
PKG_CHECK_MODULES(GTK_MAC, gtk-mac-integration, [
GUI_LIBS="$GUI_LIBS $GTK_MAC_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $GTK_MAC_CFLAGS"
AC_DEFINE(HAVE_GTK_MAC)
@@ -255,11 +254,8 @@ if test "$perl" = yes; then
original_ldflags="$LDFLAGS"
CFLAGS="$PERL_CFLAGS"
LDFLAGS="$PERL_LDFLAGS"
AC_TRY_LINK([
#define PERL_NO_INLINE_FUNCTIONS
#include <EXTERN.h>
#include <perl.h>
], [], perl_is_usable=yes, perl_is_usable=no)
AC_TRY_LINK([#include <EXTERN.h>
#include <perl.h>], [], perl_is_usable=yes, perl_is_usable=no)
CFLAGS="$original_cflags"
LDFLAGS="$original_ldflags"
if test x$perl_is_usable = xno ; then
@@ -298,30 +294,19 @@ if test "x$python" != xno ; then
case $python in
dnl set python2 default here
python2)
PKG_CHECK_MODULES([PY], [python-2.7],
[PY_VER="`$PKG_CONFIG --modversion python-2.7`"],
[true])
;;
PKG_CHECK_MODULES([PY], [python-2.7], [], [AC_MSG_WARN(Cannot find python-2.7!)])
PY_VER="`$PKG_CONFIG --modversion python-2.7`";;
dnl set python3 default here
python3)
PKG_CHECK_MODULES([PY], [python-3.4],
[PY_VER="`$PKG_CONFIG --modversion python-3.4`"],
[true])
if test "$PY_VER" = "" ; then
PKG_CHECK_MODULES([PY], [python-3.3],
[PY_VER="`$PKG_CONFIG --modversion python-3.3`"],
[true])
fi
;;
PKG_CHECK_MODULES([PY], [python-3.3], [], [AC_MSG_WARN(Cannot find python-3.3!)])
PY_VER="`$PKG_CONFIG --modversion python-3.3`";;
dnl add broken versions here
python2.5|python2.6|python3.1|python3.2)
AC_MSG_WARN(Unsupported Python version ${python}!);;
AC_MSG_ERROR(Unsupported Python version ${python}!);;
python*)
python="python-${python#python}" # stay posix compliant
PKG_CHECK_MODULES([PY], [${python}],
[PY_VER="`$PKG_CONFIG --modversion ${python}`"],
[AC_MSG_WARN(Cannot find "${python}.pc"!)])
;;
PKG_CHECK_MODULES([PY], [${python}], [], [AC_MSG_WARN(Cannot find "${python}.pc"!)])
PY_VER="`$PKG_CONFIG --modversion ${python}`";;
*)
AC_MSG_WARN(Unsupported Python ${python}!)
esac
@@ -858,6 +843,7 @@ echo D-Bus support ......... : $dbus
echo libnotify support ..... : $libnotify
echo libcanberra support ... : $libcanberra
echo Plugin interface ...... : $plugin
echo NLS/gettext ........... : $USE_NLS
echo IPv6 support .......... : $ipv6
echo MS Proxy NTLM \(ISA\) ... : $have_ntlm
echo libproxy support ...... : $libproxy
+20 -5
View File
@@ -2,8 +2,7 @@
<app-bundle>
<meta>
<prefix name="default">/usr/local</prefix>
<prefix name="enchant">/usr/local/opt/enchant-applespell</prefix>
<prefix name="default">${env:JHBUILD_PREFIX}</prefix>
<destination overwrite="yes">${project}</destination>
<run-install-name-tool/>
@@ -22,12 +21,25 @@
</binary>
<binary>
${prefix:enchant}/lib/libenchant.dylib
${prefix}/lib/libenchant.dylib
</binary>
<binary>
${prefix:enchant}/lib/enchant/libenchant_applespell.so
${prefix}/lib/enchant/libenchant_applespell.so
</binary>
<binary dest="${bundle}/Contents/MacOS">
${prefix}/bin/python
</binary>
<binary>
${prefix}/lib/libpython2.7.dylib
</binary>
<data>
${prefix}/lib/python2.7/
</data>
<data>
${prefix}/include/python2.7/pyconfig.h
</data>
<binary>
${prefix}/lib/${gtkdir}/modules/*.so
</binary>
@@ -47,7 +59,7 @@
${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/
</binary>
<data>
${prefix}/share/themes/Mac/gtk-2.0-key/gtkrc
${prefix}/share/themes/Mac/
</data>
<translations name="gtk20">
@@ -65,4 +77,7 @@
${project}/hexchat.icns
</data>
<!-- icon-theme icons="none">
</icon-theme -->
</app-bundle>
+4
View File
@@ -36,6 +36,10 @@ export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
export PANGO_LIBDIR="$bundle_lib"
export PANGO_SYSCONFDIR="$bundle_etc"
export PYTHON="$bundle_contents/MacOS/python"
export PYTHONHOME="$bundle_res"
export PYTHONPATH="$bundle_lib/python2.7:$bundle_lib/python2.7/site-packages"
export OPENSSL_CONF="/System/Library/OpenSSL/openssl.cnf"
export HEXCHAT_LIBDIR="$bundle_lib/hexchat/plugins"
+16 -1
View File
@@ -1,9 +1,24 @@
#!/bin/sh
if [ -z "$JHBUILD_PREFIX" ]; then
echo "You must run this within a jhbuild shell."
exit 1
fi
if [ ! -f $JHBUILD_PREFIX/bin/python ]; then
echo "You must install python with jhbuild."
exit 1
fi
rm -rf HexChat.app
rm -f *.app.zip
python $HOME/.local/bin/gtk-mac-bundler hexchat.bundle
$JHBUILD_PREFIX/bin/python $HOME/.local/bin/gtk-mac-bundler hexchat.bundle
# These take up a lot of space in the bundle
echo "Cleaning up python files"
find ./HexChat.app/Contents/Resources/lib/python2.7 -name "*.pyc" -delete
find ./HexChat.app/Contents/Resources/lib/python2.7 -name "*.pyo" -delete
echo "Compressing bundle"
#hdiutil create -format UDBZ -srcdir HexChat.app -quiet HexChat-2.9.6.1-$(git rev-parse --short master).dmg
+2 -2
View File
@@ -221,7 +221,7 @@ static int handle_setkey(char *word[], char *word_eol[], void *userdata) {
if (keystore_store_key(nick, key)) {
hexchat_printf(ph, "Stored key for %s\n", nick);
} else {
hexchat_printf(ph, "\00305Failed to store key in addon_fishlim.conf\n");
hexchat_printf(ph, "\00305Failed to store key in addon_fishlim.conf\n", nick, key);
}
return HEXCHAT_EAT_HEXCHAT;
@@ -245,7 +245,7 @@ static int handle_delkey(char *word[], char *word_eol[], void *userdata) {
if (keystore_delete_nick(nick)) {
hexchat_printf(ph, "Deleted key for %s\n", nick);
} else {
hexchat_printf(ph, "\00305Failed to delete key in addon_fishlim.conf!\n");
hexchat_printf(ph, "\00305Failed to delete key in addon_fishlim.conf!\n", nick);
}
return HEXCHAT_EAT_HEXCHAT;
+1 -1
View File
@@ -15,4 +15,4 @@ CLEANFILES = hexchat.pm.h irc.pm.h
hexchat.pm.h irc.pm.h: lib/HexChat.pm lib/Xchat.pm lib/HexChat/Embed.pm \
lib/HexChat/List/Network.pm lib/HexChat/List/Network/Entry.pm \
lib/HexChat/List/Network/AutoJoin.pm lib/IRC.pm
cd $(srcdir); perl generate_header
perl generate_header
+3 -5
View File
@@ -414,9 +414,6 @@ Util_BuildEOLList(char *word[])
PyObject *list;
int listsize = 31;
int i;
char *accum = NULL;
char *last = NULL;
/* Find the last valid array member; there may be intermediate NULLs that
* would otherwise cause us to drop some members. */
while (listsize > 0 &&
@@ -427,9 +424,10 @@ Util_BuildEOLList(char *word[])
PyErr_Print();
return NULL;
}
char *accum = NULL;
char *last = NULL;
for (i = listsize; i > 0; i--) {
char *part = word[i];
PyObject *uni_part;
if (accum == NULL) {
accum = g_strdup (part);
} else if (part != NULL && part[0] != 0) {
@@ -445,7 +443,7 @@ Util_BuildEOLList(char *word[])
return NULL;
}
}
uni_part = PyUnicode_FromString(accum);
PyObject *uni_part = PyUnicode_FromString(accum);
PyList_SetItem(list, i - 1, uni_part);
}
+1 -2
View File
@@ -53,9 +53,8 @@ void get_hwmon_chip_name(char *name)
void get_hwmon_temp(unsigned int *value, unsigned int *sensor)
{
char buffer[bsize];
FILE *fp;
snprintf(buffer, bsize, "/sys/class/hwmon/hwmon0/device/temp%i_input", *sensor);
fp = fopen(buffer, "r");
FILE *fp = fopen(buffer, "r");
if(fp != NULL) {
if(fgets(buffer, bsize, fp) != NULL)
*value = atoi(buffer);
+1 -1
View File
@@ -32,12 +32,12 @@ float percentage(unsigned long long *free, unsigned long long *total)
char *pretty_freespace(const char *desc, unsigned long long *free_k, unsigned long long *total_k)
{
char *quantities[] = { "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", 0 };
char *result, **quantity;
double free_space, total_space;
free_space = *free_k;
total_space = *total_k;
result = malloc(bsize * sizeof(char));
char *quantities[] = { "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", 0 };
if (total_space == 0)
{
snprintf(result, bsize, "%s: none", desc);
-1
View File
@@ -34,7 +34,6 @@
#include "match.h"
#include "hwmon.h"
#include "xsys.h"
#include "parse.h"
int xs_parse_cpu(char *model, char *vendor, double *freq, char *cache, unsigned int *count)
{
+1 -2
View File
@@ -115,10 +115,9 @@ void pci_find_fullname(char *fullname, char *vendor, char *device)
char devicename[bsize/2] = "";
char *position;
int cardfound = 0;
FILE *fp;
sysinfo_get_pciids (buffer);
fp = fopen (buffer, "r");
FILE *fp = fopen (buffer, "r");
if(fp == NULL) {
snprintf(fullname, bsize, "%s:%s", vendor, device);
+3 -3
View File
@@ -750,7 +750,7 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
if (!g_ascii_strcasecmp ("HELP", word[2+offset]))
{
hexchat_printf (ph, "%s", sysinfo_help);
hexchat_printf (ph, sysinfo_help);
return HEXCHAT_EAT_ALL;
}
else if (!g_ascii_strcasecmp ("LIST", word[2+offset]))
@@ -870,7 +870,7 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
}
else
{
hexchat_printf (ph, "%s", sysinfo_help);
hexchat_printf (ph, sysinfo_help);
return HEXCHAT_EAT_ALL;
}
}
@@ -878,11 +878,11 @@ sysinfo_cb (char *word[], char *word_eol[], void *userdata)
int
hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
{
char buffer[bsize];
ph = plugin_handle;
*plugin_name = name;
*plugin_desc = desc;
*plugin_version = version;
char buffer[bsize];
hexchat_hook_command (ph, "SYSINFO", HEXCHAT_PRI_NORM, sysinfo_cb, sysinfo_help, NULL);
hexchat_hook_command (ph, "NETDATA", HEXCHAT_PRI_NORM, netdata_cb, NULL, NULL);
+2 -2
View File
@@ -128,7 +128,7 @@ print_version (char *word[], char *word_eol[], void *userdata)
if (!g_ascii_strcasecmp ("HELP", word[2]))
{
hexchat_printf (ph, "%s", upd_help);
hexchat_printf (ph, upd_help);
return HEXCHAT_EAT_HEXCHAT;
}
else if (!g_ascii_strcasecmp ("SET", word[2]))
@@ -200,7 +200,7 @@ print_version (char *word[], char *word_eol[], void *userdata)
}
else
{
hexchat_printf (ph, "%s", upd_help);
hexchat_printf (ph, upd_help);
return HEXCHAT_EAT_HEXCHAT;
}
}
-1
View File
@@ -10,7 +10,6 @@ src/common/inbound.c
src/common/notify.c
src/common/outbound.c
src/common/plugin.c
src/common/plugin-timer.c
src/common/server.c
src/common/servlist.c
src/common/textevents.h
+1 -1
View File
@@ -1,4 +1,4 @@
# HexChat [![Build Status](http://img.shields.io/travis/hexchat/hexchat.svg?style=flat)](https://travis-ci.org/hexchat/hexchat) [![Build Status](http://img.shields.io/jenkins/s/http/nekomimi.cloudapp.net:8080/hexchat.svg?style=flat)](http://nekomimi.cloudapp.net:8080/job/hexchat/)
# HexChat [![Build Status](https://travis-ci.org/hexchat/hexchat.png)](https://travis-ci.org/hexchat/hexchat) [![Build Status](http://nekomimi.cloudapp.net:8080/job/hexchat/badge/icon)](http://nekomimi.cloudapp.net:8080/job/hexchat/) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/hexchat/hexchat/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
HexChat is an IRC client for Windows and UNIX-like operating systems.
See [IRCHelp.org](http://irchelp.org) for information about IRC in general.
+7 -7
View File
@@ -2,7 +2,7 @@
noinst_LIBRARIES = libhexchatcommon.a
AM_CPPFLAGS = $(COMMON_CFLAGS) -I$(top_srcdir)
AM_CPPFLAGS = $(COMMON_CFLAGS)
EXTRA_DIST = \
cfgfiles.h \
@@ -69,14 +69,14 @@ libhexchatcommon_a_CFLAGS = $(LIBPROXY_CFLAGS)
textenums.h: textevents.h
textevents.h: $(srcdir)/textevents.in make-te
$(AM_V_GEN) ./make-te < $< > $@ 2> textenums.h
textevents.h: textevents.in make-te
$(AM_V_GEN) ./make-te < textevents.in > textevents.h 2> textenums.h
marshal.h: $(srcdir)/marshalers.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_hexchat_marshal --header $< > $@
marshal.h: marshalers.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_hexchat_marshal --header $(srcdir)/marshalers.list > $@
marshal.c: $(srcdir)/marshalers.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_hexchat_marshal --body $< > $@
marshal.c: marshalers.list
$(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=_hexchat_marshal --body $(srcdir)/marshalers.list > $@
BUILT_SOURCES = textenums.h textevents.h marshal.c marshal.h
+10 -4
View File
@@ -57,6 +57,10 @@ list_addentry (GSList ** list, char *cmd, char *name)
size_t name_len;
size_t cmd_len = 1;
/* remove <2.8.0 stuff */
if (!strcmp (cmd, "away") && !strcmp (name, "BACK"))
return;
if (cmd)
cmd_len = strlen (cmd) + 1;
name_len = strlen (name) + 1;
@@ -309,10 +313,13 @@ get_xdir (void)
if (portable_mode () || SHGetKnownFolderPath (&FOLDERID_RoamingAppData, 0, NULL, &roaming_path_wide) != S_OK)
{
char *path;
char file[MAX_PATH];
HMODULE hModule;
path = g_win32_get_package_installation_directory_of_module (NULL);
if (path)
hModule = GetModuleHandle (NULL);
if (GetModuleFileName (hModule, file, sizeof(file)))
{
path = g_path_get_dirname (file);
xdir = g_build_filename (path, "config", NULL);
g_free (path);
}
@@ -778,7 +785,6 @@ load_default_config(void)
prefs.hex_input_tray_hilight = 1;
prefs.hex_input_tray_priv = 1;
prefs.hex_irc_cap_server_time = 1;
prefs.hex_irc_logging = 1;
prefs.hex_irc_who_join = 1; /* Can kick with inordinate amount of channels, required for some of our features though, TODO: add cap like away check? */
prefs.hex_irc_whois_front = 1;
prefs.hex_net_auto_reconnect = 1;
@@ -1311,7 +1317,7 @@ cmd_set (struct session *sess, char *tbuf, char *word[], char *word_eol[])
}
int
hexchat_open_file (const char *file, int flags, int mode, int xof_flags)
hexchat_open_file (char *file, int flags, int mode, int xof_flags)
{
char *buf;
int fd;
+1 -1
View File
@@ -48,7 +48,7 @@ void list_loadconf (char *file, GSList ** list, char *defaultconf);
int list_delentry (GSList ** list, char *name);
void list_addentry (GSList ** list, char *cmd, char *name);
int cmd_set (session *sess, char *tbuf, char *word[], char *word_eol[]);
int hexchat_open_file (const char *file, int flags, int mode, int xof_flags);
int hexchat_open_file (char *file, int flags, int mode, int xof_flags);
FILE *hexchat_fopen_file (const char *file, const char *mode, int xof_flags);
#define XOF_DOMODE 1
+2 -2
View File
@@ -125,7 +125,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
@@ -142,7 +142,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
+1 -1
View File
@@ -15,7 +15,7 @@ BUILT_SOURCES = \
CLEANFILES = $(BUILT_SOURCES)
AM_CPPFLAGS = $(COMMON_CFLAGS) $(DBUS_CFLAGS) -I$(top_srcdir)/src/common
AM_CPPFLAGS = $(COMMON_CFLAGS) $(DBUS_CFLAGS)
noinst_PROGRAMS = example
example_SOURCES = example.c
+2 -2
View File
@@ -22,8 +22,8 @@
#define GLIB_DISABLE_DEPRECATION_WARNINGS
#include <dbus/dbus-glib.h>
#include "dbus-client.h"
#include "hexchat.h"
#include "hexchatc.h"
#include "../hexchat.h"
#include "../hexchatc.h"
#define DBUS_SERVICE "org.hexchat.service"
#define DBUS_REMOTE "/org/hexchat/Remote"
+1 -2
View File
@@ -25,8 +25,7 @@
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <glib/gi18n.h>
#include "hexchat-plugin.h"
#include "dbus-plugin.h"
#include "../hexchat-plugin.h"
#define PNAME _("remote access")
#define PDESC _("plugin for remote access using DBUS")
+1 -1
View File
@@ -33,7 +33,7 @@ guint command_id;
guint server_id;
static void
write_error (const char *message,
write_error (char *message,
GError **error)
{
if (error == NULL || *error == NULL) {
+4 -20
View File
@@ -88,19 +88,11 @@ struct _hexchat_plugin
void (*hexchat_print) (hexchat_plugin *ph,
const char *text);
void (*hexchat_printf) (hexchat_plugin *ph,
const char *format, ...)
#ifdef __GNUC__
__attribute__((format(printf, 2, 3)))
#endif
;
const char *format, ...);
void (*hexchat_command) (hexchat_plugin *ph,
const char *command);
void (*hexchat_commandf) (hexchat_plugin *ph,
const char *format, ...)
#ifdef __GNUC__
__attribute__((format(printf, 2, 3)))
#endif
;
const char *format, ...);
int (*hexchat_nickcmp) (hexchat_plugin *ph,
const char *s1,
const char *s2);
@@ -262,11 +254,7 @@ hexchat_print (hexchat_plugin *ph,
void
hexchat_printf (hexchat_plugin *ph,
const char *format, ...)
#ifdef __GNUC__
__attribute__((format(printf, 2, 3)))
#endif
;
const char *format, ...);
void
hexchat_command (hexchat_plugin *ph,
@@ -274,11 +262,7 @@ hexchat_command (hexchat_plugin *ph,
void
hexchat_commandf (hexchat_plugin *ph,
const char *format, ...)
#ifdef __GNUC__
__attribute__((format(printf, 2, 3)))
#endif
;
const char *format, ...);
int
hexchat_nickcmp (hexchat_plugin *ph,
+18
View File
@@ -55,6 +55,11 @@
#include <glib-object.h> /* for g_type_init() */
#endif
#ifdef USE_OPENSSL
#include <openssl/ssl.h> /* SSL_() */
#include "ssl.h"
#endif
#ifdef USE_MSPROXY
#include "msproxy.h"
#endif
@@ -113,6 +118,10 @@ struct session *current_tab;
struct session *current_sess = 0;
struct hexchatprefs prefs;
#ifdef USE_OPENSSL
SSL_CTX *ctx = NULL;
#endif
#ifdef USE_LIBPROXY
pxProxyFactory *libproxy_factory;
#endif
@@ -1105,6 +1114,15 @@ main (int argc, char *argv[])
px_proxy_factory_free(libproxy_factory);
#endif
#ifdef USE_OPENSSL
if (ctx)
_SSL_context_free (ctx);
#endif
#ifdef USE_DEBUG
hexchat_mem_list ();
#endif
#ifdef WIN32
WSACleanup ();
#endif
+28 -3
View File
@@ -17,11 +17,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "../../config.h"
#include <glib.h>
#include <glib/gstdio.h>
#include <glib/gi18n.h>
#include <time.h> /* need time_t */
@@ -45,6 +44,17 @@
#define vsnprintf _vsnprintf
#endif
#ifdef USE_DEBUG
#define malloc(n) hexchat_malloc(n, __FILE__, __LINE__)
#define realloc(n, m) hexchat_realloc(n, m, __FILE__, __LINE__)
#define free(n) hexchat_dfree(n, __FILE__, __LINE__)
#define strdup(n) hexchat_strdup(n, __FILE__, __LINE__)
void *hexchat_malloc (int size, char *file, int line);
void *hexchat_strdup (char *str, char *file, int line);
void hexchat_dfree (void *buf, char *file, int line);
void *hexchat_realloc (char *old, int len, char *file, int line);
#endif
#ifdef SOCKS
#ifdef __sgi
#include <sys/time.h>
@@ -66,7 +76,9 @@
#endif
/* force a 32bit CMP.L */
#define CMPL(a, c0, c1, c2, c3) (a == (guint32)(c0 | (c1 << 8) | (c2 << 16) | (c3 << 24)))
#define WORDL(c0, c1, c2, c3) (guint32)(c0 | (c1 << 8) | (c2 << 16) | (c3 << 24))
#define WORDW(c0, c1) (guint16)(c0 | (c1 << 8))
#ifdef WIN32 /* for win32 */
#define OFLAGS O_BINARY
@@ -93,6 +105,20 @@
#define USERNAMELEN 10
#define HIDDEN_CHAR 8 /* invisible character for xtext */
#if defined(ENABLE_NLS) && !defined(_)
# include <libintl.h>
# define _(x) gettext(x)
# ifdef gettext_noop
# define N_(String) gettext_noop (String)
# else
# define N_(String) (String)
# endif
#endif
#if !defined(_)
# define N_(String) (String)
# define _(x) (x)
#endif
struct nbexec
{
int myfd;
@@ -502,7 +528,6 @@ typedef struct server
struct msproxy_state_t msp_state;
int id; /* unique ID number (for plugin API) */
#ifdef USE_OPENSSL
SSL_CTX *ctx;
SSL *ssl;
int ssl_do_connect_tag;
#else
+1 -1
View File
@@ -42,7 +42,7 @@
#include <string.h>
#include <stdlib.h>
int main(void)
int main()
{
char name[512];
char num[512];
+31 -37
View File
@@ -293,20 +293,26 @@ notify_set_offline_list (server * serv, char *users, int quiet,
struct notify_per_server *servnot;
char nick[NICKLEN];
char *token, *chr;
int pos;
token = strtok (users, ",");
while (token != NULL)
{
chr = strchr (token, '!');
if (chr != NULL)
*chr = '\0';
if (!chr)
goto end;
g_strlcpy (nick, token, sizeof(nick));
pos = chr - token;
if (pos + 1 >= sizeof(nick))
goto end;
memset (nick, 0, sizeof(nick));
strncpy (nick, token, pos);
servnot = notify_find (serv, nick);
if (servnot)
notify_announce_offline (serv, servnot, nick, quiet, tags_data);
end:
token = strtok (NULL, ",");
}
}
@@ -318,20 +324,26 @@ notify_set_online_list (server * serv, char *users,
struct notify_per_server *servnot;
char nick[NICKLEN];
char *token, *chr;
int pos;
token = strtok (users, ",");
while (token != NULL)
{
chr = strchr (token, '!');
if (chr != NULL)
*chr = '\0';
if (!chr)
goto end;
g_strlcpy (nick, token, sizeof(nick));
pos = chr - token;
if (pos + 1 >= sizeof(nick))
goto end;
memset (nick, 0, sizeof(nick));
strncpy (nick, token, pos);
servnot = notify_find (serv, nick);
if (servnot)
notify_announce_online (serv, servnot, nick, tags_data);
end:
token = strtok (NULL, ",");
}
}
@@ -398,52 +410,34 @@ void
notify_send_watches (server * serv)
{
struct notify *notify;
const int format_len = serv->supports_monitor ? 1 : 2; /* just , for monitor or + and space for watch */
GSList *list;
GSList *point;
GSList *send_list = NULL;
int len = 0;
int len;
/* Only get the list for this network */
list = notify_list;
len = 0;
point = list = notify_list;
while (list)
{
notify = list->data;
if (notify_do_network (notify, serv))
{
send_list = g_slist_append (send_list, notify);
len += strlen (notify->name) + serv->supports_monitor ? 1 : 2; /* just , for monitor or + and space for watch */;
if (len > 500)
{
notify_flush_watches (serv, point, list);
len = strlen (notify->name) + serv->supports_monitor ? 1 : 2;
point = list;
}
}
list = list->next;
}
/* Now send that list in batches */
point = list = send_list;
while (list)
{
notify = list->data;
len += strlen (notify->name) + format_len;
if (len > 500)
{
/* Too long send existing list */
notify_flush_watches (serv, point, list);
len = strlen (notify->name) + format_len;
point = list; /* We left off here */
}
list = g_slist_next (list);
}
if (len) /* We had leftovers under 500, send them all */
{
if (point)
notify_flush_watches (serv, point, NULL);
}
g_slist_free (send_list);
}
/* called when receiving a ISON 303 - should this func go? */
void
+9 -2
View File
@@ -56,6 +56,9 @@
#include "outbound.h"
#include "chanopt.h"
#ifdef USE_DEBUG
extern int current_mem_usage;
#endif
#define TBUFSIZE 4096
static void help (session *sess, char *tbuf, char *helpcmd, int quiet);
@@ -919,6 +922,10 @@ cmd_debug (struct session *sess, char *tbuf, char *word[], char *word_eol[])
"current_tab: %p\n\n",
sess->server->front_session, current_tab);
PrintText (sess, tbuf);
#ifdef USE_DEBUG
sprintf (tbuf, "current mem: %d\n\n", current_mem_usage);
PrintText (sess, tbuf);
#endif /* !MEMORY_DEBUG */
return TRUE;
}
@@ -3713,8 +3720,8 @@ userlist_cb (struct User *user, session *sess)
else
lt = time (0) - user->lasttalk;
PrintTextf (sess,
"\00306%s\t\00314[\00310%-38s\00314] \017ov\0033=\017%d%d away=%u lt\0033=\017%ld\n",
user->nick, user->hostname, user->op, user->voice, user->away, (long)lt);
"\00306%s\t\00314[\00310%-38s\00314] \017ov\0033=\017%d%d away=%u lt\0033=\017%d\n",
user->nick, user->hostname, user->op, user->voice, user->away, lt);
return TRUE;
}
+7 -9
View File
@@ -26,8 +26,6 @@
#define g_ascii_strcasecmp stricmp
#endif
#define _(x) hexchat_gettext(ph,x)
static hexchat_plugin *ph; /* plugin handle */
static GSList *timer_list = NULL;
@@ -70,13 +68,13 @@ timer_del_ref (int ref, int quiet)
{
timer_del (tim);
if (!quiet)
hexchat_printf (ph, _("Timer %d deleted.\n"), ref);
hexchat_printf (ph, "Timer %d deleted.\n", ref);
return;
}
list = list->next;
}
if (!quiet)
hexchat_print (ph, _("No such ref number found.\n"));
hexchat_print (ph, "No such ref number found.\n");
}
static int
@@ -140,17 +138,17 @@ timer_showlist (void)
if (timer_list == NULL)
{
hexchat_print (ph, _("No timers installed.\n"));
hexchat_print (ph, _(HELP));
hexchat_print (ph, "No timers installed.\n");
hexchat_print (ph, HELP);
return;
}
/* 00000 00000000 0000000 abc */
hexchat_print (ph, _("\026 Ref# Seconds Repeat Command \026\n"));
hexchat_print (ph, "\026 Ref# Seconds Repeat Command \026\n");
list = timer_list;
while (list)
{
tim = list->data;
hexchat_printf (ph, _("%5d %8.1f %7d %s\n"), tim->ref, tim->timeout,
hexchat_printf (ph, "%5d %8.1f %7d %s\n", tim->ref, tim->timeout,
tim->repeat, tim->command);
list = list->next;
}
@@ -223,7 +221,7 @@ hexchat_plugin_init
*plugin_desc = "IrcII style /TIMER command";
*plugin_version = "";
hexchat_hook_command (ph, "TIMER", HEXCHAT_PRI_NORM, timer_cb, _(HELP), 0);
hexchat_hook_command (ph, "TIMER", HEXCHAT_PRI_NORM, timer_cb, HELP, 0);
return 1; /* return 1 for success */
}
+51 -46
View File
@@ -1751,7 +1751,6 @@ hexchat_pluginpref_set_str_real (hexchat_plugin *pl, const char *var, const char
int prevSetting;
char *confname;
char *confname_tmp;
char *escaped_value;
char *buffer;
char *buffer_tmp;
char line_buffer[512]; /* the same as in cfg_put_str */
@@ -1777,9 +1776,7 @@ hexchat_pluginpref_set_str_real (hexchat_plugin *pl, const char *var, const char
{
if (mode)
{
escaped_value = g_strescape (value, NULL);
buffer = g_strdup_printf ("%s = %s\n", var, escaped_value);
g_free (escaped_value);
buffer = g_strdup_printf ("%s = %s\n", var, value);
write (fhOut, buffer, strlen (buffer));
g_free (buffer);
close (fhOut);
@@ -1827,9 +1824,7 @@ hexchat_pluginpref_set_str_real (hexchat_plugin *pl, const char *var, const char
{
if (mode) /* overwrite the existing matching setting if we are in save mode */
{
escaped_value = g_strescape (value, NULL);
buffer = g_strdup_printf ("%s = %s\n", var, escaped_value);
g_free (escaped_value);
buffer = g_strdup_printf ("%s = %s\n", var, value);
}
else /* erase the setting in delete mode */
{
@@ -1853,9 +1848,7 @@ hexchat_pluginpref_set_str_real (hexchat_plugin *pl, const char *var, const char
if (!prevSetting && mode) /* var doesn't exist currently, append if we're in save mode */
{
escaped_value = g_strescape (value, NULL);
buffer = g_strdup_printf ("%s = %s\n", var, escaped_value);
g_free (escaped_value);
buffer = g_strdup_printf ("%s = %s\n", var, value);
write (fhOut, buffer, strlen (buffer));
g_free (buffer);
}
@@ -1892,44 +1885,56 @@ hexchat_pluginpref_set_str (hexchat_plugin *pl, const char *var, const char *val
return hexchat_pluginpref_set_str_real (pl, var, value, 1);
}
static int
hexchat_pluginpref_get_str_real (hexchat_plugin *pl, const char *var, char *dest, int dest_len)
{
char *confname, *canon, *cfg, *unescaped_value;
char buf[512];
canon = g_strdup (pl->name);
canonalize_key (canon);
confname = g_strdup_printf ("%s%caddon_%s.conf", get_xdir(), G_DIR_SEPARATOR, canon);
g_free (canon);
if (!g_file_get_contents (confname, &cfg, NULL, NULL))
{
g_free (confname);
return 0;
}
g_free (confname);
if (!cfg_get_str (cfg, var, buf, sizeof(buf)))
{
g_free (cfg);
return 0;
}
unescaped_value = g_strcompress (buf);
g_strlcpy (dest, unescaped_value, dest_len);
g_free (unescaped_value);
g_free (cfg);
return 1;
}
int
hexchat_pluginpref_get_str (hexchat_plugin *pl, const char *var, char *dest)
{
/* All users of this must ensure dest is >= 512... */
return hexchat_pluginpref_get_str_real (pl, var, dest, 512);
int fh;
int l;
char confname[64];
char *canon;
char *cfg;
struct stat st;
canon = g_strdup (pl->name);
canonalize_key (canon);
sprintf (confname, "addon_%s.conf", canon);
g_free (canon);
/* partly borrowed from palette.c */
fh = hexchat_open_file (confname, O_RDONLY, 0, 0);
if (fh == -1)
{
return 0;
}
fstat (fh, &st);
cfg = malloc (st.st_size + 1);
if (!cfg)
{
close (fh);
return 0;
}
cfg[0] = '\0';
l = read (fh, cfg, st.st_size);
if (l >= 0)
{
cfg[l] = '\0';
}
if (!cfg_get_str (cfg, var, dest, 512)) /* dest_len is the same as buffer size in set */
{
free (cfg);
close (fh);
return 0;
}
free (cfg);
close (fh);
return 1;
}
int
@@ -1946,7 +1951,7 @@ hexchat_pluginpref_get_int (hexchat_plugin *pl, const char *var)
{
char buffer[12];
if (hexchat_pluginpref_get_str_real (pl, var, buffer, sizeof(buffer)))
if (hexchat_pluginpref_get_str (pl, var, buffer))
{
return atoi (buffer);
}
+11 -28
View File
@@ -76,6 +76,7 @@
#endif
#ifdef USE_OPENSSL
extern SSL_CTX *ctx; /* hexchat.c */
/* local variables */
static struct session *g_sess = NULL;
#endif
@@ -272,7 +273,7 @@ tcp_send (server *serv, char *buf)
}*/
void
tcp_sendf (server *serv, const char *fmt, ...)
tcp_sendf (server *serv, char *fmt, ...)
{
va_list args;
/* keep this buffer in BSS. Converting UTF-8 to ISO-8859-x might make the
@@ -723,22 +724,9 @@ ssl_do_connect (server * serv)
switch (verify_error)
{
case X509_V_OK:
{
X509 *cert = SSL_get_peer_certificate (serv->ssl);
int hostname_err;
if ((hostname_err = _SSL_check_hostname(cert, serv->hostname)) != 0)
{
snprintf (buf, sizeof (buf), "* Verify E: Failed to validate hostname? (%d)%s",
hostname_err, serv->accept_invalid_cert ? " -- Ignored" : "");
if (serv->accept_invalid_cert)
EMIT_SIGNAL (XP_TE_SSLMESSAGE, serv->server_session, buf, NULL, NULL, NULL, 0);
else
goto conn_fail;
}
break;
}
/* snprintf (buf, sizeof (buf), "* Verify OK (?)"); */
/* EMIT_SIGNAL (XP_TE_SSLMESSAGE, serv->server_session, buf, NULL, NULL, NULL, 0); */
break;
case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:
case X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE:
case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
@@ -757,7 +745,6 @@ ssl_do_connect (server * serv)
snprintf (buf, sizeof (buf), "%s.? (%d)",
X509_verify_cert_error_string (verify_error),
verify_error);
conn_fail:
EMIT_SIGNAL (XP_TE_CONNFAIL, serv->server_session, buf, NULL, NULL,
NULL, 0);
@@ -874,8 +861,8 @@ server_connect_success (server *serv)
/* it'll be a memory leak, if connection isn't terminated by
server_cleanup() */
serv->ssl = _SSL_socket (serv->ctx, serv->sok);
if ((err = _SSL_set_verify (serv->ctx, ssl_cb_verify, NULL)))
serv->ssl = _SSL_socket (ctx, serv->sok);
if ((err = _SSL_set_verify (ctx, ssl_cb_verify, NULL)))
{
EMIT_SIGNAL (XP_TE_CONNFAIL, serv->server_session, err, NULL,
NULL, NULL, 0);
@@ -1679,9 +1666,9 @@ server_connect (server *serv, char *hostname, int port, int no_login)
session *sess = serv->server_session;
#ifdef USE_OPENSSL
if (!serv->ctx && serv->use_ssl)
if (!ctx && serv->use_ssl)
{
if (!(serv->ctx = _SSL_context_init (ssl_cb_info, FALSE)))
if (!(ctx = _SSL_context_init (ssl_cb_info, FALSE)))
{
fprintf (stderr, "_SSL_context_init failed\n");
exit (1);
@@ -1724,18 +1711,18 @@ server_connect (server *serv, char *hostname, int port, int no_login)
/* first try network specific cert/key */
cert_file = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "certs" G_DIR_SEPARATOR_S "%s.pem",
get_xdir (), server_get_network (serv, TRUE));
if (SSL_CTX_use_certificate_file (serv->ctx, cert_file, SSL_FILETYPE_PEM) == 1)
if (SSL_CTX_use_certificate_file (ctx, cert_file, SSL_FILETYPE_PEM) == 1)
{
if (SSL_CTX_use_PrivateKey_file (serv->ctx, cert_file, SSL_FILETYPE_PEM) == 1)
if (SSL_CTX_use_PrivateKey_file (ctx, cert_file, SSL_FILETYPE_PEM) == 1)
serv->have_cert = TRUE;
}
else
{
/* if that doesn't exist, try <config>/certs/client.pem */
cert_file = g_build_filename (get_xdir (), "certs", "client.pem", NULL);
if (SSL_CTX_use_certificate_file (serv->ctx, cert_file, SSL_FILETYPE_PEM) == 1)
if (SSL_CTX_use_certificate_file (ctx, cert_file, SSL_FILETYPE_PEM) == 1)
{
if (SSL_CTX_use_PrivateKey_file (serv->ctx, cert_file, SSL_FILETYPE_PEM) == 1)
if (SSL_CTX_use_PrivateKey_file (ctx, cert_file, SSL_FILETYPE_PEM) == 1)
serv->have_cert = TRUE;
}
}
@@ -2060,10 +2047,6 @@ server_free (server *serv)
free (serv->encoding);
if (serv->favlist)
g_slist_free_full (serv->favlist, (GDestroyNotify) servlist_favchan_free);
#ifdef USE_OPENSSL
if (serv->ctx)
_SSL_context_free (serv->ctx);
#endif
fe_server_callback (serv);
+1 -1
View File
@@ -25,7 +25,7 @@ extern GSList *serv_list;
/* eventually need to keep the tcp_* functions isolated to server.c */
int tcp_send_len (server *serv, char *buf, int len);
int tcp_send (server *serv, char *buf);
void tcp_sendf (server *serv, const char *fmt, ...) G_GNUC_PRINTF (2, 3);
void tcp_sendf (server *serv, char *fmt, ...);
int tcp_send_real (void *ssl, int sok, char *encoding, int using_irc, char *buf, int len);
server *server_new (void);
+1 -17
View File
@@ -75,16 +75,12 @@ static const struct defaultserver def[] =
#endif
#ifdef USE_OPENSSL
{0, "irc.data.lt/+6668"},
{0, "irc.omnitel.net/+6668"},
{0, "irc.ktu.lt/+6668"},
{0, "irc.kis.lt/+6668"},
{0, "irc.vub.lt/+6668"},
{0, "irc-ssl.omnitel.net/+6668"},
#endif
{0, "irc.data.lt"},
{0, "irc.omnitel.net"},
{0, "irc.ktu.lt"},
{0, "irc.kis.lt"},
{0, "irc.vub.lt"},
{"AlphaChat", 0, 0, 0, LOGIN_SASL},
{0, "irc.alphachat.net"},
@@ -245,12 +241,6 @@ static const struct defaultserver def[] =
{"GameSurge", 0},
{0, "irc.gamesurge.net"},
{"GeeksIRC", 0, 0, 0, LOGIN_SASL},
#ifdef USE_OPENSSL
{0, "irc.geeksirc.net/+6697"},
#endif
{0, "irc.geeksirc.net"},
{"GeekShed", 0},
{0, "irc.geekshed.net"},
@@ -280,12 +270,6 @@ static const struct defaultserver def[] =
#endif
{0, "irc.interlinked.me"},
{"IRC4Fun", 0, 0, 0, LOGIN_SASL},
#ifdef USE_OPENSSL
{0, "irc.irc4fun.net/+6697"},
#endif
{0, "irc.irc4fun.net"},
{"IRCHighWay", 0},
#ifdef USE_OPENSSL
{0, "irc.irchighway.net/+9999"},
+11 -222
View File
@@ -25,7 +25,6 @@
#include "inet.h" /* make it first to avoid macro redefinitions */
#include <openssl/ssl.h> /* SSL_() */
#include <openssl/err.h> /* ERR_() */
#include <openssl/x509v3.h>
#ifdef WIN32
#include <openssl/rand.h> /* RAND_seed() */
#endif
@@ -34,14 +33,10 @@
#include <string.h> /* strncpy() */
#include "ssl.h" /* struct cert_info */
#ifndef HAVE_SNPRINTF
#include <glib.h>
#include <glib/gprintf.h>
#include <gio/gio.h>
#include "util.h"
/* If openssl was built without ec */
#ifndef SSL_OP_SINGLE_ECDH_USE
#define SSL_OP_SINGLE_ECDH_USE 0
#define snprintf g_snprintf
#endif
/* globals */
@@ -60,7 +55,7 @@ __SSL_fill_err_buf (char *funcname)
err = ERR_get_error ();
ERR_error_string (err, buf);
g_snprintf (err_buf, sizeof (err_buf), "%s: %s (%d)\n", funcname, buf, err);
snprintf (err_buf, sizeof (err_buf), "%s: %s (%d)\n", funcname, buf, err);
}
@@ -89,11 +84,6 @@ _SSL_context_init (void (*info_cb_func), int server)
SSL_CTX_set_session_cache_mode (ctx, SSL_SESS_CACHE_BOTH);
SSL_CTX_set_timeout (ctx, 300);
SSL_CTX_set_options (ctx, SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3
|SSL_OP_NO_COMPRESSION
|SSL_OP_SINGLE_DH_USE|SSL_OP_SINGLE_ECDH_USE
|SSL_OP_NO_TICKET
|SSL_OP_CIPHER_SERVER_PREFERENCE);
/* used in SSL_connect(), SSL_accept() */
SSL_CTX_set_info_callback (ctx, info_cb_func);
@@ -121,8 +111,8 @@ ASN1_TIME_snprintf (char *buf, int buf_len, ASN1_TIME * tm)
buf[0] = 0;
if (expires != NULL)
{
/* expires is not \0 terminated */
safe_strcpy (buf, expires, MIN(24, buf_len));
memset (buf, 0, buf_len);
strncpy (buf, expires, 24);
}
BIO_free (inMem);
}
@@ -184,17 +174,17 @@ _SSL_get_cert_info (struct cert_info *cert_info, SSL * ssl)
peer_pkey = X509_get_pubkey (peer_cert);
safe_strcpy (cert_info->algorithm,
strncpy (cert_info->algorithm,
(alg == NID_undef) ? "Unknown" : OBJ_nid2ln (alg),
sizeof (cert_info->algorithm));
cert_info->algorithm_bits = EVP_PKEY_bits (peer_pkey);
safe_strcpy (cert_info->sign_algorithm,
strncpy (cert_info->sign_algorithm,
(sign_alg == NID_undef) ? "Unknown" : OBJ_nid2ln (sign_alg),
sizeof (cert_info->sign_algorithm));
/* EVP_PKEY_bits(ca_pkey)); */
cert_info->sign_algorithm_bits = 0;
safe_strcpy (cert_info->notbefore, notBefore, sizeof (cert_info->notbefore));
safe_strcpy (cert_info->notafter, notAfter, sizeof (cert_info->notafter));
strncpy (cert_info->notbefore, notBefore, sizeof (cert_info->notbefore));
strncpy (cert_info->notafter, notAfter, sizeof (cert_info->notafter));
EVP_PKEY_free (peer_pkey);
@@ -223,9 +213,9 @@ _SSL_get_cipher_info (SSL * ssl)
c = SSL_get_current_cipher (ssl);
safe_strcpy (chiper_info.version, SSL_CIPHER_get_version (c),
strncpy (chiper_info.version, SSL_CIPHER_get_version (c),
sizeof (chiper_info.version));
safe_strcpy (chiper_info.chiper, SSL_CIPHER_get_name (c),
strncpy (chiper_info.chiper, SSL_CIPHER_get_name (c),
sizeof (chiper_info.chiper));
SSL_CIPHER_get_bits (c, &chiper_info.chiper_bits);
@@ -341,204 +331,3 @@ _SSL_close (SSL * ssl)
SSL_free (ssl);
ERR_remove_state (0); /* free state buffer */
}
/* Hostname validation code based on OpenBSD's libtls. */
static int
_SSL_match_hostname (const char *cert_hostname, const char *hostname)
{
const char *cert_domain, *domain, *next_dot;
if (g_ascii_strcasecmp (cert_hostname, hostname) == 0)
return 0;
/* Wildcard match? */
if (cert_hostname[0] == '*')
{
/*
* Valid wildcards:
* - "*.domain.tld"
* - "*.sub.domain.tld"
* - etc.
* Reject "*.tld".
* No attempt to prevent the use of eg. "*.co.uk".
*/
cert_domain = &cert_hostname[1];
/* Disallow "*" */
if (cert_domain[0] == '\0')
return -1;
/* Disallow "*foo" */
if (cert_domain[0] != '.')
return -1;
/* Disallow "*.." */
if (cert_domain[1] == '.')
return -1;
next_dot = strchr (&cert_domain[1], '.');
/* Disallow "*.bar" */
if (next_dot == NULL)
return -1;
/* Disallow "*.bar.." */
if (next_dot[1] == '.')
return -1;
domain = strchr (hostname, '.');
/* No wildcard match against a hostname with no domain part. */
if (domain == NULL || strlen(domain) == 1)
return -1;
if (g_ascii_strcasecmp (cert_domain, domain) == 0)
return 0;
}
return -1;
}
static int
_SSL_check_subject_altname (X509 *cert, const char *host)
{
STACK_OF(GENERAL_NAME) *altname_stack = NULL;
GInetAddress *addr;
GSocketFamily family;
int type = GEN_DNS;
int count, i;
int rv = -1;
altname_stack = X509_get_ext_d2i (cert, NID_subject_alt_name, NULL, NULL);
if (altname_stack == NULL)
return -1;
addr = g_inet_address_new_from_string (host);
if (addr != NULL)
{
family = g_inet_address_get_family (addr);
if (family == G_SOCKET_FAMILY_IPV4 || family == G_SOCKET_FAMILY_IPV6)
type = GEN_IPADD;
}
count = sk_GENERAL_NAME_num(altname_stack);
for (i = 0; i < count; i++)
{
GENERAL_NAME *altname;
altname = sk_GENERAL_NAME_value (altname_stack, i);
if (altname->type != type)
continue;
if (type == GEN_DNS)
{
unsigned char *data;
int format;
format = ASN1_STRING_type (altname->d.dNSName);
if (format == V_ASN1_IA5STRING)
{
data = ASN1_STRING_data (altname->d.dNSName);
if (ASN1_STRING_length (altname->d.dNSName) != (int)strlen(data))
{
g_warning("NUL byte in subjectAltName, probably a malicious certificate.\n");
rv = -2;
break;
}
if (_SSL_match_hostname (data, host) == 0)
{
rv = 0;
break;
}
}
else
g_warning ("unhandled subjectAltName dNSName encoding (%d)\n", format);
}
else if (type == GEN_IPADD)
{
unsigned char *data;
const guint8 *addr_bytes;
int datalen, addr_len;
datalen = ASN1_STRING_length (altname->d.iPAddress);
data = ASN1_STRING_data (altname->d.iPAddress);
addr_bytes = g_inet_address_to_bytes (addr);
addr_len = (int)g_inet_address_get_native_size (addr);
if (datalen == addr_len && memcmp (data, addr_bytes, addr_len) == 0)
{
rv = 0;
break;
}
}
}
if (addr != NULL)
g_object_unref (addr);
sk_GENERAL_NAME_free (altname_stack);
return rv;
}
static int
_SSL_check_common_name (X509 *cert, const char *host)
{
X509_NAME *name;
char *common_name = NULL;
int common_name_len;
int rv = -1;
GInetAddress *addr;
name = X509_get_subject_name (cert);
if (name == NULL)
return -1;
common_name_len = X509_NAME_get_text_by_NID (name, NID_commonName, NULL, 0);
if (common_name_len < 0)
return -1;
common_name = calloc (common_name_len + 1, 1);
if (common_name == NULL)
return -1;
X509_NAME_get_text_by_NID (name, NID_commonName, common_name, common_name_len + 1);
/* NUL bytes in CN? */
if (common_name_len != (int)strlen(common_name))
{
g_warning ("NUL byte in Common Name field, probably a malicious certificate.\n");
rv = -2;
goto out;
}
if ((addr = g_inet_address_new_from_string (host)) != NULL)
{
/*
* We don't want to attempt wildcard matching against IP
* addresses, so perform a simple comparison here.
*/
if (g_strcmp0 (common_name, host) == 0)
rv = 0;
else
rv = -1;
g_object_unref (addr);
}
else if (_SSL_match_hostname (common_name, host) == 0)
rv = 0;
out:
free(common_name);
return rv;
}
int
_SSL_check_hostname (X509 *cert, const char *host)
{
int rv;
rv = _SSL_check_subject_altname (cert, host);
if (rv == 0 || rv == -2)
return rv;
return _SSL_check_common_name (cert, host);
}
+2 -2
View File
@@ -37,7 +37,7 @@ struct cert_info {
struct chiper_info {
char version[16];
char chiper[48];
char chiper[24];
int chiper_bits;
};
@@ -52,7 +52,7 @@ char *_SSL_set_verify (SSL_CTX *ctx, void *(verify_callback), char *cacert);
int SSL_get_fd(SSL *);
*/
void _SSL_close (SSL * ssl);
int _SSL_check_hostname(X509 *cert, const char *host);
int _SSL_get_cert_info (struct cert_info *cert_info, SSL * ssl);
struct chiper_info *_SSL_get_cipher_info (SSL * ssl);
+3 -10
View File
@@ -927,7 +927,7 @@ PrintText (session *sess, char *text)
}
void
PrintTextf (session *sess, const char *format, ...)
PrintTextf (session *sess, char *format, ...)
{
va_list args;
char *buf;
@@ -941,7 +941,7 @@ PrintTextf (session *sess, const char *format, ...)
}
void
PrintTextTimeStampf (session *sess, time_t timestamp, const char *format, ...)
PrintTextTimeStampf (session *sess, time_t timestamp, char *format, ...)
{
va_list args;
char *buf;
@@ -2300,14 +2300,7 @@ sound_play (const char *file, gboolean quiet)
if (g_access (wavfile, R_OK) == 0)
{
#ifdef WIN32
gunichar2 *wavfile_utf16 = g_utf8_to_utf16 (wavfile, -1, NULL, NULL, NULL);
if (wavfile_utf16 != NULL)
{
PlaySoundW (wavfile_utf16, NULL, SND_NODEFAULT | SND_FILENAME | SND_ASYNC);
g_free (wavfile_utf16);
}
PlaySound (wavfile, NULL, SND_NODEFAULT|SND_FILENAME|SND_ASYNC);
#else
#ifdef USE_LIBCANBERRA
if (ca_con == NULL)
+2 -2
View File
@@ -43,8 +43,8 @@ void scrollback_load (session *sess);
int text_word_check (char *word, int len);
void PrintText (session *sess, char *text);
void PrintTextTimeStamp (session *sess, char *text, time_t timestamp);
void PrintTextf (session *sess, const char *format, ...) G_GNUC_PRINTF (2, 3);
void PrintTextTimeStampf (session *sess, time_t timestamp, const char *format, ...) G_GNUC_PRINTF (3, 4);
void PrintTextf (session *sess, char *format, ...);
void PrintTextTimeStampf (session *sess, time_t timestamp, char *format, ...);
void log_close (session *sess);
void log_open_or_close (session *sess);
void load_text_events (void);
+4 -4
View File
@@ -415,8 +415,8 @@ regex_match (const GRegex *re, const char *word, int *start, int *end)
}
/* Miscellaneous description --- */
#define DOMAIN "[_\\pL\\pN][-_\\pL\\pN]*(\\.[-_\\pL\\pN]+)*"
#define TLD "\\.[\\pL][-\\pL\\pN]*[\\pL]"
#define DOMAIN "[a-z0-9][-a-z0-9]*(\\.[-a-z0-9]+)*"
#define TLD "\\.[a-z][-a-z0-9]*[a-z]"
#define IPADDR "[0-9]{1,3}(\\.[0-9]{1,3}){3}"
#define IPV6GROUP "([0-9a-f]{0,4})"
#define IPV6ADDR "((" IPV6GROUP "(:" IPV6GROUP "){7})" \
@@ -429,7 +429,7 @@ regex_match (const GRegex *re, const char *word, int *start, int *end)
#define OPT_PORT "(" PORT ")?"
static GRegex *
make_re (const char *grist)
make_re (char *grist)
{
GRegex *ret;
GError *err = NULL;
@@ -610,7 +610,7 @@ re_url (void)
}
/* EMAIL description --- */
#define EMAIL "[a-z][._%+-a-z0-9]+@" "(" HOST_URL ")"
#define EMAIL "[a-z][-_a-z0-9]+@" "(" HOST_URL ")"
static const GRegex *
re_email (void)
+208 -28
View File
@@ -71,6 +71,187 @@
#define snprintf g_snprintf
#endif
#ifdef USE_DEBUG
#undef free
#undef malloc
#undef realloc
#undef strdup
int current_mem_usage;
struct mem_block
{
char *file;
void *buf;
int size;
int line;
int total;
struct mem_block *next;
};
struct mem_block *mroot = NULL;
void *
hexchat_malloc (int size, char *file, int line)
{
void *ret;
struct mem_block *new;
current_mem_usage += size;
ret = malloc (size);
if (!ret)
{
printf ("Out of memory! (%d)\n", current_mem_usage);
exit (255);
}
new = malloc (sizeof (struct mem_block));
new->buf = ret;
new->size = size;
new->next = mroot;
new->line = line;
new->file = strdup (file);
mroot = new;
printf ("%s:%d Malloc'ed %d bytes, now \033[35m%d\033[m\n", file, line,
size, current_mem_usage);
return ret;
}
void *
hexchat_realloc (char *old, int len, char *file, int line)
{
char *ret;
ret = hexchat_malloc (len, file, line);
if (ret)
{
strcpy (ret, old);
hexchat_dfree (old, file, line);
}
return ret;
}
void *
hexchat_strdup (char *str, char *file, int line)
{
void *ret;
struct mem_block *new;
int size;
size = strlen (str) + 1;
current_mem_usage += size;
ret = malloc (size);
if (!ret)
{
printf ("Out of memory! (%d)\n", current_mem_usage);
exit (255);
}
strcpy (ret, str);
new = malloc (sizeof (struct mem_block));
new->buf = ret;
new->size = size;
new->next = mroot;
new->line = line;
new->file = strdup (file);
mroot = new;
printf ("%s:%d strdup (\"%-.40s\") size: %d, total: \033[35m%d\033[m\n",
file, line, str, size, current_mem_usage);
return ret;
}
void
hexchat_mem_list (void)
{
struct mem_block *cur, *p;
GSList *totals = 0;
GSList *list;
cur = mroot;
while (cur)
{
list = totals;
while (list)
{
p = list->data;
if (p->line == cur->line &&
strcmp (p->file, cur->file) == 0)
{
p->total += p->size;
break;
}
list = list->next;
}
if (!list)
{
cur->total = cur->size;
totals = g_slist_prepend (totals, cur);
}
cur = cur->next;
}
fprintf (stderr, "file line size num total\n");
list = totals;
while (list)
{
cur = list->data;
fprintf (stderr, "%-15.15s %6d %6d %6d %6d\n", cur->file, cur->line,
cur->size, cur->total/cur->size, cur->total);
list = list->next;
}
}
void
hexchat_dfree (void *buf, char *file, int line)
{
struct mem_block *cur, *last;
if (buf == NULL)
{
printf ("%s:%d \033[33mTried to free NULL\033[m\n", file, line);
return;
}
last = NULL;
cur = mroot;
while (cur)
{
if (buf == cur->buf)
break;
last = cur;
cur = cur->next;
}
if (cur == NULL)
{
printf ("%s:%d \033[31mTried to free unknown block %lx!\033[m\n",
file, line, (unsigned long) buf);
/* abort(); */
free (buf);
return;
}
current_mem_usage -= cur->size;
printf ("%s:%d Free'ed %d bytes, usage now \033[35m%d\033[m\n",
file, line, cur->size, current_mem_usage);
if (last)
last->next = cur->next;
else
mroot = cur->next;
free (cur->file);
free (cur);
}
#define malloc(n) hexchat_malloc(n, __FILE__, __LINE__)
#define realloc(n, m) hexchat_realloc(n, m, __FILE__, __LINE__)
#define free(n) hexchat_dfree(n, __FILE__, __LINE__)
#define strdup(n) hexchat_strdup(n, __FILE__, __LINE__)
#endif /* MEMORY_DEBUG */
char *
file_part (char *file)
{
@@ -249,33 +430,33 @@ char *
expand_homedir (char *file)
{
#ifndef WIN32
char *user;
char *ret, *user;
struct passwd *pw;
if (file[0] == '~')
if (*file == '~')
{
if (file[1] == '\0' || file[1] == '/')
return g_strconcat (g_get_home_dir (), &file[1], NULL);
char *slash_pos;
user = g_strdup(file);
slash_pos = strchr(user, '/');
if (slash_pos != NULL)
*slash_pos = '\0';
pw = getpwnam(user + 1);
g_free(user);
if (pw == NULL)
return g_strdup(file);
slash_pos = strchr(file, '/');
if (slash_pos == NULL)
return g_strdup (pw->pw_dir);
if (file[1] != '\0' && file[1] != '/')
{
user = strdup(file);
if (strchr(user,'/') != NULL)
*(strchr(user,'/')) = '\0';
if ((pw = getpwnam(user + 1)) == NULL)
{
free(user);
return strdup(file);
}
free(user);
user = strchr(file, '/') != NULL ? strchr(file,'/') : file;
ret = malloc(strlen(user) + strlen(pw->pw_dir) + 1);
strcpy(ret, pw->pw_dir);
strcat(ret, user);
}
else
return g_strconcat (pw->pw_dir, slash_pos, NULL);
{
ret = malloc (strlen (file) + strlen (g_get_home_dir ()) + 1);
sprintf (ret, "%s%s", g_get_home_dir (), file + 1);
}
return ret;
}
#endif
return g_strdup (file);
@@ -1526,7 +1707,7 @@ canonalize_key (char *key)
}
int
portable_mode (void)
portable_mode ()
{
#ifdef WIN32
if ((_access( "portable-mode", 0 )) != -1)
@@ -1543,12 +1724,11 @@ portable_mode (void)
}
int
unity_mode (void)
unity_mode ()
{
#ifdef G_OS_UNIX
const char *env = g_getenv("XDG_CURRENT_DESKTOP");
if (env && (strcmp (env, "Unity") == 0
|| strcmp (env, "Pantheon") == 0))
if (env && strcmp (env, "Unity") == 0)
return 1;
#endif
return 0;
@@ -1671,7 +1851,7 @@ encode_sasl_pass_blowfish (char *user, char *pass, char *data)
memset (encrypted_pass, 0, pass_len);
plain_pass = (char*)malloc (pass_len);
memset (plain_pass, 0, pass_len);
memcpy (plain_pass, pass, strlen(pass));
memcpy (plain_pass, pass, pass_len);
out_ptr = (char*)encrypted_pass;
in_ptr = (char*)plain_pass;
+2 -2
View File
@@ -73,8 +73,8 @@ guint32 str_hash (const char *key);
guint32 str_ihash (const unsigned char *key);
void safe_strcpy (char *dest, const char *src, int bytes_left);
void canonalize_key (char *key);
int portable_mode (void);
int unity_mode (void);
int portable_mode ();
int unity_mode ();
char *encode_sasl_pass_plain (char *user, char *pass);
char *encode_sasl_pass_blowfish (char *user, char *pass, char *data);
char *encode_sasl_pass_aes (char *user, char *pass, char *data);
+2 -3
View File
@@ -31,7 +31,6 @@ hexchat_SOURCES = ascii.c banlist.c chanlist.c chanview.c custom-list.c \
maingui.c notifygui.c palette.c pixmaps.c plugin-tray.c $(plugingui_c) \
rawlog.c resources.c servlistgui.c setup.c $(iso_codes_c) \
sexy-spell-entry.c textgui.c urlgrab.c userlistgui.c xtext.c
hexchat_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_builddir)/src/common
resources.c: $(top_srcdir)/data/hexchat.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(top_srcdir)/data --generate-dependencies $(top_srcdir)/data/hexchat.gresource.xml)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(top_srcdir)/data --generate-source $<
resources.c: ../../data/hexchat.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=../../data --generate-dependencies ../../data/hexchat.gresource.xml)
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=../../data --generate-source $<
+7 -7
View File
@@ -239,9 +239,6 @@ banlist_sensitize (banlist_info *banl)
int checkable, i;
gboolean is_op = FALSE;
if (banl->sess->me == NULL)
return;
/* FIXME: More access levels than these can unban */
if (banl->sess->me->op || banl->sess->me->hop)
is_op = TRUE;
@@ -286,7 +283,7 @@ banlist_sensitize (banlist_info *banl)
else
{
gtk_widget_set_sensitive (banl->but_clear, FALSE);
gtk_widget_set_sensitive (banl->but_crop, banl->line_ct == banl->select_ct? FALSE: TRUE);
gtk_widget_set_sensitive (banl->but_crop, TRUE);
gtk_widget_set_sensitive (banl->but_remove, TRUE);
}
}
@@ -413,7 +410,7 @@ banlist_select_changed (GtkWidget *item, banlist_info *banl)
else
{
list = gtk_tree_selection_get_selected_rows (GTK_TREE_SELECTION (item), NULL);
banl->select_ct = g_list_length (list);
banl->select_ct = list? 1: 0;
g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
g_list_free (list);
}
@@ -429,6 +426,7 @@ banlist_do_refresh (banlist_info *banl)
session *sess = banl->sess;
char tbuf[256];
int i;
char *tbufp;
banlist_sensitize (banl);
@@ -446,12 +444,14 @@ banlist_do_refresh (banlist_info *banl)
banl->pending = banl->checked;
if (banl->pending)
{
tbufp = tbuf + g_snprintf (tbuf, sizeof tbuf, "quote mode %s +", sess->channel);
for (i = 0; i < MODE_CT; i++)
if (banl->pending & 1<<i)
{
g_snprintf (tbuf, sizeof tbuf, "quote mode %s +%c", sess->channel, modes[i].letter);
handle_command (sess, tbuf, FALSE);
*tbufp++ = modes[i].letter;
}
*tbufp = 0;
handle_command (sess, tbuf, FALSE);
}
}
else
+1
View File
@@ -53,6 +53,7 @@ typedef struct banlist_info_s {
int current; /* index of currently processing mode */
int line_ct; /* count of presented lines */
int select_ct; /* count of selected lines */
/* Not really; 1 if any are selected otherwise 0 */
GtkWidget *window;
GtkWidget *treeview;
GtkWidget *checkboxes[MODE_CT];
+1 -2
View File
@@ -62,13 +62,12 @@ cv_tabs_sizerequest (GtkWidget *viewport, GtkRequisition *requisition, chanview
static void
cv_tabs_sizealloc (GtkWidget *widget, GtkAllocation *allocation, chanview *cv)
{
GdkWindow *parent_win;
GtkAdjustment *adj;
GtkWidget *inner;
gint viewport_size;
inner = ((tabview *)cv)->inner;
parent_win = gtk_widget_get_window (gtk_widget_get_parent (inner));
GdkWindow *parent_win = gtk_widget_get_window (gtk_widget_get_parent (inner));
if (cv->vertical)
{
+34 -75
View File
@@ -57,7 +57,7 @@
#include <canberra.h>
#endif
GdkPixmap *channelwin_pix;
GdkPixbuf *channelwin_pix;
#ifdef USE_LIBCANBERRA
static ca_context *ca_con;
@@ -296,7 +296,7 @@ fe_init (void)
#ifdef HAVE_GTK_MAC
gtkosx_application_set_dock_icon_pixbuf (osx_app, pix_hexchat);
#endif
channelwin_pix = pixmap_load_from_file (prefs.hex_text_background);
channelwin_pix = gdk_pixbuf_new_from_file (prefs.hex_text_background, NULL);
input_style = create_input_style (gtk_style_new ());
}
@@ -656,11 +656,10 @@ void
fe_beep (session *sess)
{
#ifdef WIN32
/* Play the "Instant Message Notification" system sound
*/
if (!PlaySoundW (L"Notification.IM", NULL, SND_ALIAS | SND_ASYNC))
if (!PlaySound ("Notification.IM", NULL, SND_ALIAS|SND_ASYNC))
{
/* The user does not have the "Instant Message Notification" sound set. Fall back to system beep.
/* This is really just a fallback attempt, may or may not work on new Windows releases, especially on x64.
* You should set up the "Instant Message Notification" system sound instead, supported on Vista and up.
*/
Beep (1000, 50);
}
@@ -984,84 +983,23 @@ fe_set_inputbox_contents (session *sess, char *text)
}
}
#ifdef __APPLE__
static char *
url_escape_hostname (const char *url)
{
char *host_start, *host_end, *ret, *hostname;
host_start = strstr (url, "://");
if (host_start != NULL)
{
*host_start = '\0';
host_start += 3;
host_end = strchr (host_start, '/');
if (host_end != NULL)
{
*host_end = '\0';
host_end++;
}
hostname = g_hostname_to_ascii (host_start);
if (host_end != NULL)
ret = g_strdup_printf ("%s://%s/%s", url, hostname, host_end);
else
ret = g_strdup_printf ("%s://%s", url, hostname);
g_free (hostname);
return ret;
}
return g_strdup (url);
}
static void
osx_show_uri (const char *url)
{
char *escaped_url, *encoded_url, *open, *cmd;
escaped_url = url_escape_hostname (url);
encoded_url = g_filename_from_utf8 (escaped_url, -1, NULL, NULL, NULL);
if (encoded_url)
{
open = g_find_program_in_path ("open");
cmd = g_strjoin (" ", open, encoded_url, NULL);
hexchat_exec (cmd);
g_free (encoded_url);
g_free (cmd);
}
g_free (escaped_url);
}
#endif
static void
fe_open_url_inner (const char *url)
{
#ifdef WIN32
gunichar2 *url_utf16 = g_utf8_to_utf16 (url, -1, NULL, NULL, NULL);
if (url_utf16 == NULL)
{
return;
}
ShellExecuteW (0, L"open", url_utf16, NULL, NULL, SW_SHOWNORMAL);
g_free (url_utf16);
#elif defined(__APPLE__)
osx_show_uri (url);
ShellExecute (0, "open", url, NULL, NULL, SW_SHOWNORMAL);
#elif defined __APPLE__
/* on Mac you can just 'open http://foo.bar/' */
gchar open[512];
g_snprintf (open, sizeof(open), "%s %s", g_find_program_in_path ("open"), url, NULL);
hexchat_exec (open);
#else
gtk_show_uri (NULL, url, GDK_CURRENT_TIME, NULL);
#endif
}
void
fe_open_url (const char *url)
static void
fe_open_url_locale (const char *url)
{
int url_type = url_check_word (url);
char *uri;
@@ -1103,6 +1041,27 @@ fe_open_url (const char *url)
}
}
void
fe_open_url (const char *url)
{
char *loc;
if (prefs.utf8_locale)
{
fe_open_url_locale (url);
return;
}
/* the OS expects it in "locale" encoding. This makes it work on
unix systems that use ISO-8859-x and Win32. */
loc = g_locale_from_utf8 (url, -1, 0, 0, 0);
if (loc)
{
fe_open_url_locale (loc);
g_free (loc);
}
}
void
fe_server_event (server *serv, int type, int arg)
{
+16 -2
View File
@@ -28,7 +28,21 @@
#include <sys/types.h>
#endif
#include <glib/gi18n.h>
#if defined(ENABLE_NLS) && !defined(_)
# include <libintl.h>
# define _(x) gettext(x)
# ifdef gettext_noop
# define N_(String) gettext_noop (String)
# else
# define N_(String) (String)
# endif
#endif
#if !defined(ENABLE_NLS) && defined(_)
# undef _
# define N_(String) (String)
# define _(x) (x)
#endif
#include <gtk/gtk.h>
#ifdef HAVE_GTK_MAC
@@ -179,7 +193,7 @@ typedef struct session_gui
} session_gui;
extern GdkPixmap *channelwin_pix;
extern GdkPixbuf *channelwin_pix;
extern GdkPixmap *dialogwin_pix;
#define SPELL_ENTRY_GET_TEXT(e) ((char *)(gtk_entry_get_text (GTK_ENTRY(e))))
+2 -2
View File
@@ -60,7 +60,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
@@ -81,7 +81,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4244;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
+21 -51
View File
@@ -66,71 +66,50 @@ gtkutil_file_req_destroy (GtkWidget * wid, struct file_req *freq)
}
static void
gtkutil_check_file (char *filename, struct file_req *freq)
gtkutil_check_file (char *file, struct file_req *freq)
{
struct stat st;
int axs = FALSE;
char temp[256];
GFile *file = g_file_new_for_path (filename);
path_part (file, temp, sizeof (temp));
/* check if the file is readable or writable */
if (freq->flags & FRF_WRITE)
{
GFile *parent = g_file_get_parent (file);
GFileInfo *fi = g_file_query_info (parent, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
if (fi != NULL)
if (access (temp, W_OK) == 0)
axs = TRUE;
} else
{
if (g_file_info_get_attribute_boolean (fi, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE))
if (stat (file, &st) != -1)
{
if (!S_ISDIR (st.st_mode) || (freq->flags & FRF_CHOOSEFOLDER))
axs = TRUE;
}
g_object_unref (fi);
}
g_object_unref (parent);
}
else
{
GFileInfo *fi = g_file_query_info (file, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
if (fi != NULL)
{
if (g_file_info_get_file_type (fi) != G_FILE_TYPE_DIRECTORY || (freq->flags & FRF_CHOOSEFOLDER))
{
axs = TRUE;
}
g_object_unref (fi);
}
}
g_object_unref (file);
if (axs)
{
char *filename_utf8 = g_filename_to_utf8 (filename, -1, NULL, NULL, NULL);
if (filename_utf8 != NULL)
char *utf8_file;
/* convert to UTF8. It might be converted back to locale by
server.c's g_convert */
utf8_file = hexchat_filename_to_utf8 (file, -1, NULL, NULL, NULL);
if (utf8_file)
{
freq->callback (freq->userdata, filename_utf8);
g_free (filename_utf8);
}
else
freq->callback (freq->userdata, utf8_file);
g_free (utf8_file);
} else
{
fe_message ("Filename encoding is corrupt.", FE_MSG_ERROR);
}
}
else
} else
{
if (freq->flags & FRF_WRITE)
{
fe_message (_("Cannot write to that file."), FE_MSG_ERROR);
}
else
{
fe_message (_("Cannot read that file."), FE_MSG_ERROR);
}
}
}
static void
gtkutil_file_req_done (GtkWidget * wid, struct file_req *freq)
@@ -149,21 +128,12 @@ gtkutil_file_req_done (GtkWidget * wid, struct file_req *freq)
}
if (files)
g_slist_free (files);
}
else
} else
{
if (freq->flags & FRF_CHOOSEFOLDER)
{
gchar *filename = gtk_file_chooser_get_current_folder (fs);
gtkutil_check_file (filename, freq);
g_free (filename);
}
gtkutil_check_file (gtk_file_chooser_get_current_folder (fs), freq);
else
{
gchar *filename = gtk_file_chooser_get_filename (fs);
gtkutil_check_file (gtk_file_chooser_get_filename (fs), freq);
g_free (filename);
}
}
/* this should call the "destroy" cb, where we free(freq) */
+13 -42
View File
@@ -441,8 +441,7 @@ mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata
{
if ((event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) &&
(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) &&
prefs.hex_gui_tray_minimize && prefs.hex_gui_tray &&
!unity_mode ())
prefs.hex_gui_tray_minimize && !unity_mode ())
{
tray_toggle_visibility (TRUE);
gtk_window_deiconify (wid);
@@ -3843,18 +3842,17 @@ mg_drag_drop_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, guint
gboolean
mg_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, guint time, gpointer scbar)
{
GdkGC *gc;
GdkColor col;
GdkGCValues val;
cairo_t *cr;
int half, width, height;
int ox, oy;
GdkDrawable *draw;
GtkAllocation allocation;
/* ignore file drops */
if (!mg_is_gui_target (context))
return FALSE;
gtk_widget_set_app_paintable (widget, TRUE);
if (scbar) /* scrollbar */
{
gtk_widget_get_allocation (widget, &allocation);
@@ -3862,55 +3860,28 @@ mg_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, gui
oy = allocation.y;
width = allocation.width;
height = allocation.height;
draw = gtk_widget_get_window (widget);
}
else
{
ox = oy = 0;
width = gdk_window_get_width (gtk_widget_get_window (widget));
height = gdk_window_get_height (gtk_widget_get_window (widget));
draw = gtk_widget_get_window (widget);
}
val.subwindow_mode = GDK_INCLUDE_INFERIORS;
val.graphics_exposures = 0;
val.function = GDK_XOR;
gc = gdk_gc_new_with_values (gtk_widget_get_window (widget), &val, GDK_GC_EXPOSURES | GDK_GC_SUBWINDOW | GDK_GC_FUNCTION);
col.red = rand() % 0xffff;
col.green = rand() % 0xffff;
col.blue = rand() % 0xffff;
gdk_colormap_alloc_color (gtk_widget_get_colormap (widget), &col, FALSE, TRUE);
gdk_gc_set_foreground (gc, &col);
cr = gdk_cairo_create (gtk_widget_get_window (widget));
cairo_set_source_rgb (cr, 0, 0, 1.0);
cairo_set_line_width (cr, 0.1);
half = height / 2;
#if 0
/* are both tree/userlist on the same side? */
paned = (GtkPaned *)widget->parent->parent;
if (paned->child1 != NULL && paned->child2 != NULL)
{
gdk_draw_rectangle (draw, gc, 0, 1, 2, width - 3, height - 4);
gdk_draw_rectangle (draw, gc, 0, 0, 1, width - 1, height - 2);
g_object_unref (gc);
return TRUE;
}
#endif
if (y < half)
{
gdk_draw_rectangle (draw, gc, FALSE, 1 + ox, 2 + oy, width - 3, half - 4);
gdk_draw_rectangle (draw, gc, FALSE, 0 + ox, 1 + oy, width - 1, half - 2);
gtk_widget_queue_draw_area (widget, ox, half + oy, width, height - half);
}
cairo_rectangle (cr, ox, oy, width, half);
else
{
gdk_draw_rectangle (draw, gc, FALSE, 0 + ox, half + 1 + oy, width - 1, half - 2);
gdk_draw_rectangle (draw, gc, FALSE, 1 + ox, half + 2 + oy, width - 3, half - 4);
gtk_widget_queue_draw_area (widget, ox, oy, width, half);
}
cairo_rectangle (cr, ox, half + oy, width, half);
g_object_unref (gc);
cairo_stroke (cr);
cairo_destroy (cr);
gtk_widget_queue_draw_area (widget, ox, oy, width, height);
return TRUE;
}
+1 -2
View File
@@ -186,10 +186,9 @@ fe_tray_set_balloon (const char *title, const char *text)
if (!notify_is_initted())
{
GList* server_caps;
notify_init(PACKAGE_NAME);
server_caps = notify_get_server_caps ();
GList* server_caps = notify_get_server_caps ();
if (g_list_find_custom (server_caps, "body-markup", (GCompareFunc)strcmp))
{
notify_text_strip_flags |= STRIP_ESCMARKUP;
+3 -4
View File
@@ -1526,14 +1526,13 @@ servlist_logintypecombo_cb (GtkComboBox *cb, gpointer *userdata)
index = gtk_combo_box_get_active (cb); /* starts at 0, returns -1 for invalid selections */
if (index == -1)
return; /* Invalid */
if (index != -1)
{
/* The selection is valid. It can be 0, which is the default type, but we need to allow
* that so that you can revert from other types. servlist_save() will dump 0 anyway.
*/
selected_net->logintype = login_types_conf[index];
}
if (login_types_conf[index] == LOGIN_CUSTOM)
{
gtk_notebook_set_current_page (GTK_NOTEBOOK (userdata), 2); /* FIXME avoid hardcoding? */
+2 -2
View File
@@ -2032,7 +2032,7 @@ setup_apply_real (int new_pix, int do_ulist, int do_layout)
{
if (channelwin_pix)
g_object_unref (channelwin_pix);
channelwin_pix = pixmap_load_from_file (prefs.hex_text_background);
channelwin_pix = gdk_pixbuf_new_from_file (prefs.hex_text_background, NULL);
}
input_style = create_input_style (input_style);
@@ -2168,7 +2168,7 @@ setup_apply (struct hexchatprefs *pr)
" restart to take full effect."), FE_MSG_WARN);
#ifndef WIN32
if (prefs.hex_dcc_auto_recv == 2) /* Auto */
if (prefs.hex_dcc_auto_recv)
{
if (!strcmp ((char *)g_get_home_dir (), prefs.hex_dcc_dir))
{
+9 -17
View File
@@ -1112,40 +1112,32 @@ entry_strsplit_utf8(GtkEntry *entry, gchar ***set, gint **starts, gint **ends)
const PangoLogAttr *log_attrs;
const gchar *text;
gint n_attrs, n_strings, i, j;
PangoLogAttr a;
layout = gtk_entry_get_layout(GTK_ENTRY(entry));
text = gtk_entry_get_text(GTK_ENTRY(entry));
log_attrs = pango_layout_get_log_attrs_readonly (layout, &n_attrs);
/* Find how many words we have */
for (i = 0, n_strings = 0; i < n_attrs; i++)
{
a = log_attrs[i];
if (a.is_word_start && a.is_word_boundary)
n_strings = 0;
for (i = 0; i < n_attrs; i++)
if (log_attrs[i].is_word_start)
n_strings++;
}
*set = g_new0(gchar *, n_strings + 1);
*starts = g_new0(gint, n_strings);
*ends = g_new0(gint, n_strings);
/* Copy out strings */
for (i = 0, j = 0; i < n_attrs; i++)
{
a = log_attrs[i];
if (a.is_word_start && a.is_word_boundary)
{
for (i = 0, j = 0; i < n_attrs; i++) {
if (log_attrs[i].is_word_start) {
gint cend, bytes;
gchar *start;
/* Find the end of this string */
for (cend = i; cend < n_attrs; cend++)
{
a = log_attrs[cend];
if (a.is_word_end && a.is_word_boundary)
break;
}
cend = i;
while ((!log_attrs[cend].is_word_end || !log_attrs[cend].is_word_boundary)
&& !log_attrs[cend].is_white)
cend++;
/* Copy sub-string */
start = g_utf8_offset_to_pointer(text, i);
+287 -436
View File
File diff suppressed because it is too large Load Diff
+5 -14
View File
@@ -129,8 +129,7 @@ struct _GtkXText
xtext_buffer *selection_buffer;
GtkAdjustment *adj;
GdkPixmap *pixmap; /* 0 = use palette[19] */
GdkDrawable *draw_buf; /* points to ->window */
GdkPixbuf *pixbuf; /* 0 = use palette[19] */
GdkCursor *hand_cursor;
GdkCursor *resize_cursor;
@@ -141,12 +140,8 @@ struct _GtkXText
int last_win_h;
int last_win_w;
GdkGC *bgc; /* backing pixmap */
GdkGC *fgc; /* text foreground color */
GdkGC *light_gc; /* sep bar */
GdkGC *dark_gc;
GdkGC *thin_gc;
GdkGC *marker_gc;
GdkColor bgc; /* text background color */
GdkColor fgc; /* text foreground color */
GdkColor palette[XTEXT_COLS];
gint io_tag; /* for delayed refresh events */
@@ -196,9 +191,6 @@ struct _GtkXText
int jump_out_offset; /* point at which to stop rendering */
int jump_in_offset; /* "" start rendering */
int ts_x; /* ts origin for ->bgc GC */
int ts_y;
int clip_x; /* clipping (x directions) */
int clip_x2; /* from x to x2 */
@@ -216,8 +208,7 @@ struct _GtkXText
/* various state information */
unsigned int moving_separator:1;
unsigned int word_select:1;
unsigned int line_select:1;
unsigned int word_or_line_select:1;
unsigned int button_down:1;
unsigned int hilighting:1;
unsigned int dont_render:1;
@@ -258,7 +249,7 @@ void gtk_xtext_append_indent (xtext_buffer *buf,
unsigned char *right_text, int right_len,
time_t stamp);
int gtk_xtext_set_font (GtkXText *xtext, char *name);
void gtk_xtext_set_background (GtkXText * xtext, GdkPixmap * pixmap);
void gtk_xtext_set_background (GtkXText * xtext, GdkPixbuf * pixbuf);
void gtk_xtext_set_palette (GtkXText * xtext, GdkColor palette[]);
void gtk_xtext_clear (xtext_buffer *buf, int lines);
void gtk_xtext_save (GtkXText * xtext, int fh);
+2 -2
View File
@@ -62,7 +62,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
@@ -81,7 +81,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_CONSOLE;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)..;$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
+5
View File
@@ -80,6 +80,11 @@
</ItemDefinitionGroup>
<ItemGroup>
<None Include="changelog.url" />
<None Include="etc\download.png" />
<None Include="etc\gtk-2.0\gtkrc" />
<None Include="etc\gtkpref.png" />
<None Include="etc\music.png" />
<None Include="etc\system.png" />
<None Include="readme.url" />
<None Include="share\xml\iso-codes\iso_3166.xml" />
<None Include="share\xml\iso-codes\iso_639.xml" />
+69
View File
@@ -0,0 +1,69 @@
gtk-icon-sizes = "gtk-menu=13,13:gtk-small-toolbar=16,16:gtk-large-toolbar=24,24:gtk-dnd=32,32"
gtk-toolbar-icon-size = small-toolbar
# disable images in buttons. i've only seen ugly delphi apps use this feature.
gtk-button-images = 0
# enable/disable images in menus. most "stock" microsoft apps don't use these, except sparingly.
# the office apps use them heavily, though.
gtk-menu-images = 1
# use the win32 button ordering instead of the GNOME HIG one, where applicable
gtk-alternative-button-order = 1
# use the win32 sort indicators direction, as in Explorer
gtk-alternative-sort-arrows = 1
# Windows users don't expect the PC Speaker beeping at them when they backspace in an empty textview and stuff like that
gtk-error-bell = 0
# hide mnemonic underlines until the Alt key is pressed
gtk-auto-mnemonics = 1
style "msw-default"
{
GtkWidget::interior-focus = 1
GtkOptionMenu::indicator-size = { 9, 5 }
GtkOptionMenu::indicator-spacing = { 7, 5, 2, 2 }
GtkSpinButton::shadow-type = in
# Owen and I disagree that these should be themable
#GtkUIManager::add-tearoffs = 0
#GtkComboBox::add-tearoffs = 0
GtkComboBox::appears-as-list = 1
GtkComboBox::focus-on-click = 0
GOComboBox::add_tearoffs = 0
GtkTreeView::allow-rules = 0
GtkTreeView::expander-size = 12
GtkExpander::expander-size = 12
GtkScrolledWindow::scrollbar_spacing = 1
GtkSeparatorMenuItem::horizontal-padding = 2
engine "wimp"
{
}
}
class "*" style "msw-default"
binding "ms-windows-tree-view"
{
bind "Right" { "expand-collapse-cursor-row" (1,1,0) }
bind "Left" { "expand-collapse-cursor-row" (1,0,0) }
}
class "GtkTreeView" binding "ms-windows-tree-view"
style "msw-combobox-thickness" = "msw-default"
{
xthickness = 0
ythickness = 0
}
widget_class "*TreeView*ComboBox*" style "msw-combobox-thickness"
widget_class "*ComboBox*GtkFrame*" style "msw-combobox-thickness"
+8 -5
View File
@@ -30,9 +30,9 @@
<Python3Path>$(YourPython3Path)\$(PlatformName)</Python3Path>
<Python3Lib>python34</Python3Lib>
<Python3Output>hcpython3</Python3Output>
<Glib>$(DepsRoot)\include\glib-2.0;$(DepsRoot)\lib\glib-2.0\include</Glib>
<Glib>$(DepsRoot)\include\glib-2.0;$(DepsRoot)\lib\glib-2.0\include;$(DepsRoot)\include\libxml2</Glib>
<Gtk>$(DepsRoot)\include\gtk-2.0;$(DepsRoot)\lib\gtk-2.0\include;$(DepsRoot)\include\atk-1.0;$(DepsRoot)\include\cairo;$(DepsRoot)\include\pango-1.0;$(DepsRoot)\include\gdk-pixbuf-2.0</Gtk>
<DepLibs>gtk-win32-2.0.lib;gdk-win32-2.0.lib;atk-1.0.lib;gio-2.0.lib;gdk_pixbuf-2.0.lib;pangowin32-1.0.lib;pangocairo-1.0.lib;pango-1.0.lib;cairo.lib;gobject-2.0.lib;gmodule-2.0.lib;glib-2.0.lib;libintl.lib;libeay32.lib;ssleay32.lib;wininet.lib;winmm.lib;ws2_32.lib</DepLibs>
<DepLibs>gtk-win32-2.0.lib;gdk-win32-2.0.lib;atk-1.0.lib;gio-2.0.lib;gdk_pixbuf-2.0.lib;pangowin32-1.0.lib;pangocairo-1.0.lib;pango-1.0.lib;cairo.lib;gobject-2.0.lib;gmodule-2.0.lib;glib-2.0.lib;libintl.lib;libxml2.lib;libeay32.lib;ssleay32.lib;wininet.lib;winmm.lib;ws2_32.lib</DepLibs>
<DataDir>$(SolutionDir)..\data\\</DataDir>
<HexChatBuild>$(SolutionDir)..\..\hexchat-build</HexChatBuild>
<HexChatBin>$(HexChatBuild)\$(PlatformName)\bin\</HexChatBin>
@@ -51,6 +51,7 @@ copy "$(HexChatBin)hexchat-text.exe" "$(HexChatRel)"
copy "$(HexChatBin)thememan.exe" "$(HexChatRel)"
copy "$(DepsRoot)\bin\atk-1.0.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\cairo.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\fontconfig.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\gdk_pixbuf-2.0.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\gdk-win32-2.0.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\gio-2.0.dll" "$(HexChatRel)"
@@ -65,19 +66,21 @@ copy "$(DepsRoot)\bin\libeay32.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\libenchant.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\libintl.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\libpng16.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\libxml2.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\pango-1.0.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\pangocairo-1.0.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\pangoft2-1.0.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\pangowin32-1.0.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\pixman-1.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\ssleay32.dll" "$(HexChatRel)"
copy "$(DepsRoot)\bin\zlib1.dll" "$(HexChatRel)"
xcopy /q /s /i "$(DepsRoot)\lib\gtk-2.0\i686-pc-vs10\engines" "$(HexChatRel)\lib\gtk-2.0\i686-pc-vs10\engines"
xcopy /q /s /i etc "$(HexChatRel)\etc"
xcopy /q /s /i share "$(HexChatRel)\share"
xcopy /q /s /i "..\..\COPYING" "$(HexChatRel)\share\doc\hexchat\"
xcopy /q /s /i "$(DepsRoot)\share\doc" "$(HexChatRel)\share\doc"
xcopy /q /s /i "$(DepsRoot)\share\themes\MS-Windows" "$(HexChatRel)\share\themes\MS-Windows"
xcopy /q /s /i "..\..\COPYING" "$(HexChatRel)\"
xcopy /q /s /i "$(DepsRoot)\lib\enchant\libenchant_myspell.dll" "$(HexChatRel)\lib\enchant\"
xcopy /q /s /i "$(HexChatBin)hcchecksum.dll" "$(HexChatRel)\plugins\"
copy "$(HexChatBin)hcdns.dll" "$(HexChatRel)\plugins"
copy "$(HexChatBin)hcdoat.dll" "$(HexChatRel)\plugins"
copy "$(HexChatBin)hcexec.dll" "$(HexChatRel)\plugins"
copy "$(HexChatBin)hcfishlim.dll" "$(HexChatRel)\plugins"
+13 -12
View File
@@ -16,7 +16,7 @@ AppPublisherURL=http://hexchat.github.io
AppCopyright=Copyright (C) 1998-2010 Peter Zelezny
AppSupportURL=https://github.com/hexchat/hexchat/issues
AppUpdatesURL=http://hexchat.github.io/downloads.html
LicenseFile=share\doc\hexchat\COPYING
LicenseFile=COPYING
UninstallDisplayIcon={app}\hexchat.exe
UninstallDisplayName=HexChat
#if APPARCH == "x64"
@@ -46,7 +46,7 @@ ArchitecturesInstallIn64BitMode=x64
#else
ArchitecturesAllowed=x86 x64
#endif
MinVersion=6.1
MinVersion=6.0
WizardImageFile={#PROJECTDIR}wizardimage.bmp
WizardSmallImageFile={#PROJECTDIR}wizardsmallimage.bmp
SetupIconFile={#PROJECTDIR}..\..\data\icons\hexchat.ico
@@ -58,6 +58,7 @@ Name: "custom"; Description: "Custom Installation"; Flags: iscustom
[Components]
Name: "libs"; Description: "HexChat"; Types: normal minimal custom; Flags: fixed
Name: "gtktheme"; Description: "GTK+ Theme (Native Windows look)"; Types: normal minimal custom; Flags: disablenouninstallwarning
Name: "xctext"; Description: "HexChat-Text"; Types: custom; Flags: disablenouninstallwarning
Name: "xtm"; Description: "HexChat Theme Manager"; Types: normal custom; Flags: disablenouninstallwarning
Name: "translations"; Description: "Translations"; Types: normal custom; Flags: disablenouninstallwarning
@@ -110,13 +111,14 @@ Source: "portable-mode"; DestDir: "{app}"; Tasks: portable
Source: "changelog.url"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "readme.url"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "cert.pem"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "etc\gtk-2.0\gtkrc"; DestDir: "{app}\etc\gtk-2.0"; Flags: ignoreversion; Components: gtktheme
Source: "share\xml\*"; DestDir: "{app}\share\xml"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs
Source: "share\doc\*"; DestDir: "{app}\share\doc"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs
Source: "share\themes\MS-Windows\*"; DestDir: "{app}\share\themes\MS-Windows"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: libs
Source: "COPYING"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "share\locale\*"; DestDir: "{app}\share\locale"; Flags: ignoreversion createallsubdirs recursesubdirs; Components: translations
Source: "atk-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "cairo.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "fontconfig.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "gdk_pixbuf-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "gdk-win32-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "gio-2.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
@@ -131,8 +133,10 @@ Source: "libeay32.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "libenchant.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "libintl.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "libpng16.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "libxml2.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "pango-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "pangocairo-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "pangoft2-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "pangowin32-1.0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "pixman-1.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
Source: "ssleay32.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: libs
@@ -249,13 +253,13 @@ begin
#if APPARCH == "x64"
REDIST := 'http://dl.hexchat.net/misc/vcredist_2013_x64.exe';
PERL := 'http://dl.hexchat.net/misc/perl/Perl%205.20.0%20x64.msi';
PY2 := 'http://python.org/ftp/python/2.7.8/python-2.7.8.amd64.msi';
PY3 := 'http://python.org/ftp/python/3.4.1/python-3.4.1.amd64.msi';
PY2 := 'http://python.org/ftp/python/2.7.6/python-2.7.6.amd64.msi';
PY3 := 'http://python.org/ftp/python/3.4.0/python-3.4.0.amd64.msi';
#else
REDIST := 'http://dl.hexchat.net/misc/vcredist_2013_x86.exe';
PERL := 'http://dl.hexchat.net/misc/perl/Perl%205.20.0%20x86.msi';
PY2 := 'http://python.org/ftp/python/2.7.8/python-2.7.8.msi';
PY3 := 'http://python.org/ftp/python/3.4.1/python-3.4.1.msi';
PY2 := 'http://python.org/ftp/python/2.7.6/python-2.7.6.msi';
PY3 := 'http://python.org/ftp/python/3.4.0/python-3.4.0.msi';
#endif
DOTNET := 'http://dl.hexchat.net/misc/dotnet_40.exe';
SPELL := 'http://dl.hexchat.net/hexchat/HexChat%20Spelling%20Dictionaries%20r2.exe';
@@ -269,8 +273,6 @@ begin
if IsComponentSelected('spell') and not CheckSpellInstall() then
idpAddFile(SPELL, ExpandConstant('{tmp}\spelling-dicts.exe'));
if not WizardSilent() then
begin
if IsComponentSelected('langs\perl') and not CheckDLL('perl520.dll') then
idpAddFile(PERL, ExpandConstant('{tmp}\perl.msi'));
@@ -282,7 +284,6 @@ begin
end;
end;
end;
end;
/////////////////////////////////////////////////////////////////////
// Disable portable-mode if installing to program files
@@ -355,7 +356,7 @@ begin
sUnInstallString := GetUninstallString();
if sUnInstallString <> '' then begin
sUnInstallString := RemoveQuotes(sUnInstallString);
if Exec(sUnInstallString, '/VERYSILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
Result := 3
else
Result := 2;
+1 -1
View File
@@ -1 +1 @@
2.10.1
2.10.0