Compare commits
446 Commits
wip/connec
...
2.14
Author | SHA1 | Date | |
---|---|---|---|
b304cfe850 | |||
ef1aad01bf | |||
8e60546aea | |||
29591e2b67 | |||
7da0a3aa2c | |||
6a7a134170 | |||
60c9263d49 | |||
4ab756af7b | |||
92f58b4420 | |||
b9d1efc2c2 | |||
79f7ff888f | |||
3588c519c3 | |||
ce528b6af8 | |||
a26cc20d21 | |||
3099c652bb | |||
edc7ad83e3 | |||
996b29ccca | |||
6a8b7013af | |||
8665501c77 | |||
7659caada1 | |||
fd47adf595 | |||
cadc51ede9 | |||
57478b6575 | |||
5c5aacd9da | |||
93cc105a40 | |||
33300630a3 | |||
fd2167d856 | |||
08fb808ea4 | |||
c70c1e1896 | |||
5cd70622aa | |||
5ca767f7f8 | |||
111441302c | |||
ed6f544572 | |||
ee85129a9b | |||
93f926bf12 | |||
da56297c5a | |||
5d8b4719a8 | |||
8a875afad0 | |||
dc483b2342 | |||
28a3d42ad1 | |||
eb942fc274 | |||
27acca0f5b | |||
ececf2f640 | |||
d72249d91f | |||
2286990a6f | |||
6ec523423a | |||
77c8fe1421 | |||
740352ceab | |||
541b9ca744 | |||
e9b9ff9f38 | |||
9b8a7eaa01 | |||
cdefb8e2d6 | |||
16ee8eb233 | |||
f6333b592b | |||
6e4fc09ce0 | |||
8aa3b03261 | |||
23c7e7c3da | |||
7510ab36b7 | |||
d3f1ab7813 | |||
4cdf6460b6 | |||
5d3bf39103 | |||
234fe86987 | |||
6ca7f84d02 | |||
7b359875d8 | |||
4a228d1efe | |||
ee8926503c | |||
7d7be83216 | |||
0058587958 | |||
228e08543a | |||
38f8cc8e0c | |||
3e53635dfb | |||
47b653cc7c | |||
c6d9e26e2b | |||
a3db4e5773 | |||
1452e803fb | |||
6f8b8c3d3c | |||
8ddd5e3778 | |||
4188f26ab9 | |||
07f1fc60da | |||
0c494a9c24 | |||
053003f490 | |||
4a09ce6fc3 | |||
f4a592c4f0 | |||
a388d0c553 | |||
1e5180a148 | |||
18b741804c | |||
d935197895 | |||
b29a046b55 | |||
d99cd18fb9 | |||
281038e725 | |||
da0635c960 | |||
c6f3fbd15c | |||
0dccd8d373 | |||
ad359d7a04 | |||
2965fbcc87 | |||
98ca4e98d5 | |||
8f2429a2d2 | |||
de157fcffd | |||
e68976ab39 | |||
806a0da258 | |||
99e16110bc | |||
2d184c0967 | |||
ce91bebc39 | |||
27fd9b3fd6 | |||
f8467473dd | |||
2dfe5357a9 | |||
67adfa6f54 | |||
0e5eda7de8 | |||
628100c19f | |||
2edf50d4dd | |||
2dd5f8788c | |||
76430228e1 | |||
fc2fe7fd28 | |||
5d72755027 | |||
92496b183e | |||
88cb0c9d20 | |||
ec94565cb9 | |||
552b2b1315 | |||
a524adc698 | |||
eccd0d05b5 | |||
be6473227b | |||
2f0239eb18 | |||
99bdc4f251 | |||
30a223a6cb | |||
7d78c6bca0 | |||
b1e963f563 | |||
525a3bcc02 | |||
2376b7fb6a | |||
eddaf8c396 | |||
dfaf0e31c7 | |||
63e9c72114 | |||
2c80cb7efd | |||
4c178782a7 | |||
aa7080f8fe | |||
d583ca7d92 | |||
1b760dd22b | |||
02c92599fa | |||
26acd02e9f | |||
e7da3a052d | |||
b6426a1e9f | |||
f2d93f5abe | |||
9ab03c5d23 | |||
3118df2042 | |||
c7849a8921 | |||
13f6d9265a | |||
241dd69b08 | |||
539949973c | |||
e7c88e0f83 | |||
85bdb06cad | |||
a0e80ebda2 | |||
1186236ac1 | |||
217fa9d0f9 | |||
6c8b6ce23f | |||
3f279971c5 | |||
e7101ebcae | |||
f64d1c847a | |||
116a394ef6 | |||
ebc40fe9c7 | |||
c0aa47c7a1 | |||
f38261f666 | |||
2a81b98e7b | |||
bb8f0beabe | |||
adea019820 | |||
50e2c6b3c7 | |||
7db74ec205 | |||
492c209d07 | |||
29b5785bb4 | |||
7329dbdc57 | |||
bfe0af69fa | |||
c81c89dc80 | |||
31dd020114 | |||
321587c73b | |||
dba19a961b | |||
65abf5c532 | |||
c79ce843f4 | |||
49758cafba | |||
15600f405f | |||
910851e04d | |||
d1bd441a9a | |||
737f87fa16 | |||
4658c5d4e5 | |||
332f2e65b9 | |||
3131661f9e | |||
ec4d3de9d2 | |||
439ff094ce | |||
7281da8b2c | |||
dc09f2c75d | |||
97d4afc4fb | |||
19187dbacd | |||
9d74ceedfd | |||
034624983b | |||
74f014bd8c | |||
aabcf6f9f4 | |||
ac986bb3a4 | |||
03767ee0f9 | |||
ba87247781 | |||
f845af0370 | |||
9ca1606e2a | |||
9c049271e7 | |||
e647cd00c6 | |||
91df075d62 | |||
6168507272 | |||
9fbd23b06f | |||
9e11280e52 | |||
77dccacd02 | |||
0667519d17 | |||
fbacb82191 | |||
6b2cc1d28b | |||
a970c1ae2e | |||
6a0e131b88 | |||
215a164e57 | |||
9e4c2ddc47 | |||
bcbe42dd7a | |||
25e197a6c8 | |||
7dca220486 | |||
111ba3750f | |||
16ba39d9fa | |||
4ed1acfd52 | |||
a1d2272dc0 | |||
c12f33aa4c | |||
a031a24cfd | |||
c698e13c0d | |||
10e429b85d | |||
6554a8d63c | |||
d32aa65bc7 | |||
3c329727c7 | |||
e223840fa6 | |||
ca6411c591 | |||
823ef320a5 | |||
fe9da9314c | |||
1c73f84f3a | |||
d995272922 | |||
5b097f560d | |||
f06a38c384 | |||
44aa999598 | |||
54c6418d61 | |||
bd358dd570 | |||
529ae4cc89 | |||
5b05271e4c | |||
d11b7f258c | |||
0694cb9045 | |||
8099f23bdf | |||
a3e1a287ac | |||
f501e948ae | |||
ba6a1190cd | |||
4abcd53044 | |||
2fe52bbf58 | |||
5998696c2a | |||
bc9a59d264 | |||
5699bf9e65 | |||
c4c1c64f00 | |||
fb7f27fcdd | |||
2e2b895ebe | |||
2e478f1b5a | |||
a77c6df7e2 | |||
19c4adf8ba | |||
1f48f9dd6f | |||
b7373f4ddc | |||
9402a31111 | |||
58fb36ee34 | |||
f656569eb9 | |||
0635e91dd6 | |||
5f2d6a3c11 | |||
356241bdfb | |||
dce6a7612a | |||
60b3b43f3e | |||
6cbcc73a79 | |||
edcd9af47f | |||
dd080fa6f3 | |||
bcb4eec754 | |||
795e97f428 | |||
77ac0863f8 | |||
963ba2bf2d | |||
c280029436 | |||
47b357b2e1 | |||
c1a94e2879 | |||
c874a9525c | |||
fc20786a5e | |||
d48f31191f | |||
7c078db879 | |||
ebb0fd6905 | |||
ed029357d1 | |||
10fa3b1878 | |||
98b0186feb | |||
35254fa6eb | |||
6706b23a0b | |||
df36f88e88 | |||
94a7fbae02 | |||
bae1ebce2f | |||
50463ca832 | |||
0826e7d353 | |||
aab881fda2 | |||
05385f2479 | |||
650bddcfd1 | |||
089fe95a42 | |||
4362085847 | |||
6b62c4738d | |||
8da205b0a8 | |||
981d55e84c | |||
35d238ad3a | |||
2c8729becd | |||
35f97b65c1 | |||
a2c2abd60a | |||
7a85c9160d | |||
4e061a43b3 | |||
5c534ac344 | |||
ea9e8d353b | |||
f14ad5e9dd | |||
2226363fd0 | |||
5dafa60433 | |||
971e5cf4fe | |||
edd57fdc86 | |||
eab580408c | |||
26d3461f46 | |||
295061f461 | |||
0bd15d435a | |||
c8539b93fe | |||
1e914347d7 | |||
66eebea2c3 | |||
9e2d5dae5e | |||
b8e7dfa4ba | |||
1d8dd50455 | |||
7f1ee9dad0 | |||
be5e2b9566 | |||
e40fbee772 | |||
7247c24e98 | |||
f7e3d3f32c | |||
671a838b52 | |||
6ca29b2eb4 | |||
15efdd5f2b | |||
599f5c7b29 | |||
fad8f93ad8 | |||
78486b49d5 | |||
9c5f577002 | |||
dbad9285b8 | |||
73636a00b5 | |||
e7003ef9c6 | |||
9664b1b7e3 | |||
422cce6f70 | |||
afd2135393 | |||
94ef0fd294 | |||
ebe1f824a7 | |||
f7bea16e37 | |||
ff9c0dbd5e | |||
29321c8660 | |||
0b40146b85 | |||
9b2c560519 | |||
3675302930 | |||
925570aab1 | |||
498f53b96a | |||
5263887ac3 | |||
73d865b243 | |||
a3c257bdb4 | |||
6ad9419693 | |||
c5aa91a836 | |||
b10f94d5f6 | |||
9a98de1f65 | |||
7363bc03f2 | |||
78e51a4f3f | |||
174db0eb7f | |||
f64b61a1b9 | |||
a8392c7f95 | |||
72d7f64f8b | |||
c86389f99b | |||
66f2f3a84a | |||
f8c7ea3672 | |||
e313a82ab4 | |||
9024a5c71b | |||
f03b6314b4 | |||
ae2e5ab092 | |||
167eb11ea7 | |||
1cc06f9301 | |||
455fa24d63 | |||
dc69f24ae5 | |||
b4906f3d23 | |||
4e338a2b70 | |||
98fefcd162 | |||
fb422732f2 | |||
36a8ba126c | |||
658f30ec43 | |||
749e5b20da | |||
d78db5070a | |||
a5584c6b57 | |||
97bf0de016 | |||
b6c4cfa2a3 | |||
ec12871e60 | |||
0a29313fff | |||
b009084a52 | |||
7e7e87600e | |||
c36d4859d7 | |||
c1d06c7d63 | |||
5e3355a6c3 | |||
363321dc33 | |||
4d44c17939 | |||
5b24c60def | |||
96026b82c7 | |||
e42da22716 | |||
0a8248578f | |||
c87f559334 | |||
8ca96d7ea3 | |||
bbb81af550 | |||
a22816fbbd | |||
b6877ccf5c | |||
7063406d6c | |||
9858784eb6 | |||
7e4a585611 | |||
5a87d814cf | |||
ac54a2ed45 | |||
296fbaf94f | |||
75c022c49f | |||
f4f27e438b | |||
a216ed1df9 | |||
afee9fd42b | |||
60fa7efbc8 | |||
dc9a7d3a59 | |||
1d83610341 | |||
5dde0d7c6d | |||
9968bb31a4 | |||
5fe2dda146 | |||
85fd6f525e | |||
e5b65bbd69 | |||
a838cd9c07 | |||
02470dffa5 | |||
c5bbf75f5e | |||
b783c827c8 | |||
d1897c1602 | |||
6f8a6e66cc | |||
5749c53484 | |||
5569205d15 | |||
2e76a4e477 | |||
ee17ec6b4f | |||
5a56f9ea01 | |||
e400ed2855 | |||
1d316710ed | |||
aab243592f | |||
13db2011e3 | |||
7739c99f3f | |||
99f74e8d94 | |||
5ca87b3c8d | |||
62df565190 | |||
4f08b0b386 | |||
5b8cc683f3 | |||
e758da5d28 | |||
16d1fccf61 | |||
9e9ed54bfa | |||
aece18dfd5 |
19
.editorconfig
Normal file
@ -0,0 +1,19 @@
|
||||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
[*.{c,cpp,h,hpp,m}]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
|
||||
[*.cs]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
|
||||
[{meson.build,meson_options.txt}]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
78
.gitignore
vendored
@ -1,79 +1,12 @@
|
||||
# git ignore file
|
||||
# Unix generated files
|
||||
.deps/
|
||||
.libs/
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
autom4te.cache/
|
||||
compile
|
||||
ar-lib
|
||||
confdefs.h
|
||||
conftest
|
||||
conftest.c
|
||||
conftest.err
|
||||
config.guess
|
||||
config.h.in
|
||||
config.h.in~
|
||||
config.h
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
config-win32.h
|
||||
configure
|
||||
configure.tmp
|
||||
depcomp
|
||||
/build
|
||||
builddir/
|
||||
doxygen*.tmp
|
||||
html/
|
||||
install-sh
|
||||
intl/
|
||||
libtool
|
||||
ltmain.sh
|
||||
m4/
|
||||
missing
|
||||
plugins/perl/irc.pm.h
|
||||
plugins/perl/xchat.pm.h
|
||||
plugins/perl/hexchat.pm.h
|
||||
po/Makefile.in.in
|
||||
po/POTFILES
|
||||
po/remove-potcdate.sed
|
||||
po/stamp-*
|
||||
osx/Info.plist
|
||||
data/man/hexchat.1
|
||||
data/pkgconfig/hexchat-plugin.pc
|
||||
data/misc/hexchat.appdata.xml
|
||||
data/misc/hexchat.desktop
|
||||
data/misc/htm.desktop
|
||||
src/common/dbus/example
|
||||
src/common/dbus/org.hexchat.service.service
|
||||
src/common/dbus/remote-object-glue.h
|
||||
src/common/make-te
|
||||
src/common/marshal.*
|
||||
src/common/textenums.h
|
||||
src/common/textevents.h
|
||||
src/fe-gtk/hexchat
|
||||
src/fe-gtk/hexchat.rc
|
||||
src/fe-text/hexchat-text
|
||||
src/htm/Main.resources
|
||||
src/htm/thememan.exe
|
||||
src/htm/thememan.exe.config
|
||||
src/htm/thememan.exe.mdb
|
||||
src/htm/thememan
|
||||
stamp-h1
|
||||
*.a
|
||||
*.o
|
||||
*.la
|
||||
*.lo
|
||||
*.gmo
|
||||
*.mo
|
||||
*.po~
|
||||
*.pot
|
||||
*.patch
|
||||
src/**/*.plist
|
||||
tags
|
||||
# Win32 generated files
|
||||
plugins/wmpa/wmpa_h.h
|
||||
plugins/wmpa/wmpa_i.c
|
||||
src/fe-gtk/resources.c
|
||||
src/htm/obj/*
|
||||
win32/ipch/*
|
||||
win32/ext/perl/perl-x86-cache
|
||||
@ -87,9 +20,10 @@ resource.h
|
||||
*.suo
|
||||
*.user
|
||||
*.exe
|
||||
#OSX
|
||||
# OSX
|
||||
osx/HexChat.app
|
||||
osx/.HexChat.app
|
||||
po/.intltool-merge-cache
|
||||
*.zip
|
||||
*.dmg
|
||||
*.VC.db
|
||||
*.VC.opendb
|
||||
|
10
.mailmap
Normal file
@ -0,0 +1,10 @@
|
||||
Berke Viktor <github.bviktor@outlook.com> <berkeviktor@aol.com>
|
||||
Berke Viktor <github.bviktor@outlook.com> <bviktor@hexchat.org>
|
||||
Berke Viktor <github.bviktor@outlook.com> <bviktor@outlook.com>
|
||||
Berke Viktor <github.bviktor@outlook.com> berkeviktor@aol.com
|
||||
Patrick Griffis <tingping@tingping.se> TingPing <tingping@fedoraproject.org>
|
||||
Patrick Griffis <tingping@tingping.se> TingPing <tingping@tingping.se>
|
||||
Patrick Griffis <tingping@tingping.se> TingPing <tngpng@gmail.com>
|
||||
Patrick Griffis <tingping@tingping.se> TingPing <TingPing@users.noreply.github.com>
|
||||
Arnav Singh <arnavion@gmail.com> Arnavion
|
||||
Eustachy Kapusta <Eustachy.kapusta@gmail.com> tomek
|
23
.travis.yml
@ -1,13 +1,16 @@
|
||||
language: c
|
||||
compiler: clang
|
||||
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 --enable-static-analysis
|
||||
- make V=1 -j$(nproc)
|
||||
sudo: required
|
||||
services: docker
|
||||
before_install:
|
||||
- docker pull ubuntu:16.04
|
||||
- docker run --privileged --cidfile=/tmp/cid ubuntu:16.04 /bin/sh -c 'apt-get update && apt-get install -y meson/xenial-backports libcanberra-dev libdbus-glib-1-dev libglib2.0-dev libgtk2.0-dev libluajit-5.1-dev libnotify-dev libpci-dev libperl-dev libproxy-dev libssl-dev python3-dev mono-devel desktop-file-utils'
|
||||
- docker commit `cat /tmp/cid` hexchat/ubuntu-ci
|
||||
- rm -f /tmp/cid
|
||||
install:
|
||||
- docker run -d --privileged --cidfile=/tmp/cid --volume=${PWD}:/opt/hexchat hexchat/ubuntu-ci /bin/systemd --system
|
||||
script:
|
||||
- docker exec `cat /tmp/cid` /bin/sh -c 'meson /opt/hexchat /opt/hexchat-build -Dwith-text=true -Dwith-theme-manager=true && ninja -C /opt/hexchat-build install && ninja -C /opt/hexchat-build test'
|
||||
after_script:
|
||||
- docker kill `cat /tmp/cid`
|
||||
notifications:
|
||||
irc:
|
||||
channels: "chat.freenode.net#hexchat-devel"
|
||||
|
@ -1,8 +0,0 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = po src plugins data
|
||||
|
||||
EXTRA_DIST = autogen.sh data
|
||||
|
22
autogen.sh
@ -1,22 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
srcdir=`dirname $0`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
|
||||
NOCONFIGURE=1
|
||||
PKG_NAME="hexchat"
|
||||
|
||||
(test -f $srcdir/src/common/hexchat.c) || {
|
||||
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
|
||||
echo " top-level $PKG_NAME directory"
|
||||
exit 1
|
||||
}
|
||||
|
||||
which gnome-autogen.sh || {
|
||||
echo "You need to install gnome-common"
|
||||
exit 1
|
||||
}
|
||||
|
||||
. gnome-autogen.sh
|
||||
|
839
configure.ac
@ -1,839 +0,0 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT([HexChat],[2.11.0])
|
||||
|
||||
AC_PREREQ([2.60])
|
||||
AC_COPYRIGHT([Copyright (C) 1998-2010 Peter Zelezny])
|
||||
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_SRCDIR([configure.ac])
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AM_INIT_AUTOMAKE([1.11 dist-bzip2 subdir-objects no-define foreign])
|
||||
AM_SILENT_RULES([yes])
|
||||
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
AM_MAINTAINER_MODE
|
||||
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)
|
||||
|
||||
dnl -----------------------------------------------------------
|
||||
dnl Language Support
|
||||
dnl -----------------------------------------------------------
|
||||
GETTEXT_PACKAGE=hexchat
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
|
||||
IT_PROG_INTLTOOL([0.40.0])
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
|
||||
dnl displaced from acconfig.h
|
||||
AH_VERBATIM([OLD_PERL],[#undef OLD_PERL])
|
||||
AH_VERBATIM([PREFIX],[#undef PREFIX])
|
||||
AH_VERBATIM([HEXCHATLIBDIR],[#undef HEXCHATLIBDIR])
|
||||
AH_VERBATIM([HEXCHATSHAREDIR],[#undef HEXCHATSHAREDIR])
|
||||
AH_VERBATIM([USE_LIBPROXY],[#undef USE_LIBPROXY])
|
||||
AH_VERBATIM([HAVE_ISO_CODES],[#undef HAVE_ISO_CODES])
|
||||
AH_VERBATIM([HAVE_GTK_MAC],[#undef HAVE_GTK_MAC])
|
||||
AH_VERBATIM([USE_LIBNOTIFY],[#undef USE_LIBNOTIFY])
|
||||
AH_VERBATIM([USE_LIBCANBERRA],[#undef USE_LIBCANBERRA])
|
||||
AH_VERBATIM([USE_OPENSSL],[#undef USE_OPENSSL])
|
||||
AH_VERBATIM([USE_PLUGIN],[#undef USE_PLUGIN])
|
||||
AH_VERBATIM([USE_SIGACTION],[#undef USE_SIGACTION])
|
||||
AH_VERBATIM([USING_FREEBSD],[#undef USING_FREEBSD])
|
||||
AH_VERBATIM([USING_LINUX],[#undef USING_LINUX])
|
||||
AH_VERBATIM([socklen_t],[#undef socklen_t])
|
||||
AH_VERBATIM([USE_DBUS],[#undef USE_DBUS])
|
||||
|
||||
AC_PATH_PROG(sedpath, sed)
|
||||
if test "_$sedpath" = _; then
|
||||
AC_MSG_ERROR(Cannot find sed: I need it!)
|
||||
fi
|
||||
|
||||
AC_PATH_PROG(unamepath, uname)
|
||||
if test "_$unamepath" = _; then
|
||||
system="unknown"
|
||||
else
|
||||
AC_MSG_CHECKING(system type)
|
||||
system=`$unamepath -s`
|
||||
AC_MSG_RESULT($system)
|
||||
if test "$system" = "Linux"; then
|
||||
AC_DEFINE(USING_LINUX)
|
||||
fi
|
||||
if test "$system" = "FreeBSD"; then
|
||||
AC_DEFINE(USING_FREEBSD)
|
||||
fi
|
||||
fi
|
||||
|
||||
platform_win32=no
|
||||
case $host_os in
|
||||
*mingw*|*cygwin*|*msys*)
|
||||
platform_win32=yes;;
|
||||
*);;
|
||||
esac
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** configure switches ***********************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
AC_ARG_ENABLE(openssl,
|
||||
[AS_HELP_STRING([--enable-openssl[=PATH]],[enable use of openSSL])],
|
||||
openssl=$enableval, openssl=yes)
|
||||
|
||||
AC_ARG_ENABLE(gtkfe,
|
||||
[AS_HELP_STRING([--disable-gtkfe],[disable building gtk frontend])],
|
||||
gtkfe=$enableval, gtkfe=yes)
|
||||
|
||||
AC_ARG_ENABLE(textfe,
|
||||
[AS_HELP_STRING([--enable-textfe],[build the text frontend (default: no)])],
|
||||
textfe=$enableval, textfe=no)
|
||||
|
||||
AC_ARG_ENABLE(python,
|
||||
[AS_HELP_STRING([--enable-python=pythonversion],[build the python plugin; possible values: "python2", "python3" or specific such as "python3.3" (default on, python2)])],
|
||||
python=$enableval, python=python2)
|
||||
AS_IF([test "x$python" = "xyes"], [python=python2])
|
||||
|
||||
AC_ARG_ENABLE(perl,
|
||||
[AS_HELP_STRING([--disable-perl],[don\'t build the perl plugin])],
|
||||
perl=$enableval, perl=yes)
|
||||
|
||||
AC_ARG_ENABLE(perl_old,
|
||||
[AS_HELP_STRING([--disable-perl_old],[no backwards compatibility for perl plugin])],
|
||||
perl_old=$enableval, perl_old=yes)
|
||||
|
||||
AC_ARG_ENABLE(plugin,
|
||||
[AS_HELP_STRING([--disable-plugin],[disable plugin support])],
|
||||
plugin=$enableval, plugin=yes)
|
||||
|
||||
AC_ARG_ENABLE(checksum,
|
||||
[AS_HELP_STRING([--disable-checksum],[disable the Checksum plugin])],
|
||||
checksum=$enableval, checksum=yes)
|
||||
|
||||
AC_ARG_ENABLE(doat,
|
||||
[AS_HELP_STRING([--disable-doat],[disable the Do At plugin])],
|
||||
doat=$enableval, doat=yes)
|
||||
|
||||
AC_ARG_ENABLE(fishlim,
|
||||
[AS_HELP_STRING([--disable-fishlim],[disable the FiSHLiM plugin])],
|
||||
fishlim=$enableval, fishlim=yes)
|
||||
|
||||
AC_ARG_ENABLE(sysinfo,
|
||||
[AS_HELP_STRING([--disable-sysinfo],[disable the SysInfo plugin])],
|
||||
sysinfo=$enableval, sysinfo=yes)
|
||||
|
||||
AC_ARG_ENABLE(dbus,
|
||||
[AS_HELP_STRING([--disable-dbus],[disable DBUS support])],
|
||||
dbus=$enableval, dbus=yes)
|
||||
|
||||
AC_ARG_ENABLE(libnotify,
|
||||
[AS_HELP_STRING([--disable-libnotify],[disable libnotify support])],
|
||||
libnotify=$enableval, libnotify=yes)
|
||||
|
||||
AC_ARG_ENABLE(libcanberra,
|
||||
[AS_HELP_STRING([--disable-libcanberra],[disable libcanberra support])],
|
||||
libcanberra=$enableval, libcanberra=yes)
|
||||
|
||||
AC_ARG_ENABLE(libproxy,
|
||||
[AS_HELP_STRING([--disable-libproxy],[disable libproxy support (default: auto)])],
|
||||
libproxy=$enableval, libproxy=auto)
|
||||
|
||||
AC_ARG_ENABLE(isocodes,
|
||||
[AS_HELP_STRING([--disable-isocodes],[disable iso-codes with spell-check])],
|
||||
isocodes=$enableval, isocodes=yes)
|
||||
|
||||
AC_ARG_ENABLE(minimal-flags,
|
||||
[AS_HELP_STRING([--enable-minimal-flags],[only add those CFLAGS that are really needed or not intrusive (default: no)])],
|
||||
minimalflags=$enableval, minimalflags=no)
|
||||
|
||||
AC_ARG_ENABLE(static-analysis,
|
||||
[AS_HELP_STRING([--enable-static-analysis],[if using clang run static analysis during build (default: no)])],
|
||||
analyze=$enableval, analyze=no)
|
||||
|
||||
AC_ARG_WITH(theme-manager,
|
||||
[AS_HELP_STRING([--with-theme-manager],[compile theme manager (needs monodevelop, default: off)])],
|
||||
theme_manager=$withval, theme_manager=no)
|
||||
|
||||
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** THEME-MANAGER ****************************************************
|
||||
dnl *********************************************************************
|
||||
if test "x$theme_manager" != "xno" ; then
|
||||
if test "x$MDTOOL" = "xno"; then
|
||||
AC_MSG_ERROR([No "mdtool" found, you need to install monodevelop!])
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** GLIB *************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
AM_PATH_GLIB_2_0([2.32.0], [], [AC_MSG_ERROR([Glib not found!])], [gmodule gobject gio])
|
||||
COMMON_CFLAGS="$GLIB_CFLAGS -DG_DISABLE_SINGLE_INCLUDES"
|
||||
COMMON_LIBS="$GLIB_LIBS"
|
||||
AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_32], [Dont warn using older APIs])
|
||||
AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_32], [Prevents using newer APIs])
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** GTK **************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
# we might get undefined macro without this test
|
||||
if test "$gtkfe" = yes ; then
|
||||
AM_PATH_GTK_2_0(2.24.0, havegtk=yes, havegtk=no)
|
||||
|
||||
if test "$havegtk" = no; then
|
||||
gtkfe=no
|
||||
echo
|
||||
echo Cannot find GTK\! Not building GTK FrontEnd.
|
||||
echo
|
||||
fi
|
||||
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"
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** MAC_INTEGRATION **************************************************
|
||||
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, [
|
||||
GUI_LIBS="$GUI_LIBS $GTK_MAC_LIBS"
|
||||
GUI_CFLAGS="$GUI_CFLAGS $GTK_MAC_CFLAGS"
|
||||
AC_DEFINE(HAVE_GTK_MAC)
|
||||
])
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** PERL *************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$perl" = yes; then
|
||||
AC_MSG_CHECKING(for plugin interface used by Perl)
|
||||
if test "$plugin" = yes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_PATH_PROG(perlpath, perl)
|
||||
AC_MSG_CHECKING(for Perl compile flags)
|
||||
PERL_CFLAGS=`$perlpath -MExtUtils::Embed -e ccopts 2>/dev/null`
|
||||
if test "_$PERL_CFLAGS" = _ ; then
|
||||
AC_MSG_RESULT([not found, building without perl.])
|
||||
perl=no
|
||||
else
|
||||
PERL_LDFLAGS=`$perlpath -MExtUtils::Embed -e ldopts |$sedpath 's/-lgdbm //'`
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-ldb //'`
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lndbm //'`
|
||||
if test "$system" = "Linux"; then
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lnsl //'`
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lposix //'`
|
||||
fi
|
||||
PERL_LDFLAGS=`echo $PERL_LDFLAGS |$sedpath 's/-lc //'`
|
||||
AC_MSG_RESULT(ok)
|
||||
|
||||
AC_MSG_CHECKING(for perl >= 5.8.0)
|
||||
PERL_VER=`$perlpath -e 'print $]>= 5.008?"yes":"no"'`
|
||||
if test "$PERL_VER" = "yes"; then
|
||||
original_cflags="$CFLAGS"
|
||||
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)
|
||||
CFLAGS="$original_cflags"
|
||||
LDFLAGS="$original_ldflags"
|
||||
if test x$perl_is_usable = xno ; then
|
||||
AC_MSG_RESULT(no)
|
||||
perl=no
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_CHECKING(if perl plugin will be backward compatible)
|
||||
if test "$perl_old" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(OLD_PERL)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
echo "perl version too old, building without perl."
|
||||
perl=no
|
||||
fi
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Perl])
|
||||
perl=no
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** PYTHON ***********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "x$python" != xno ; then
|
||||
AC_MSG_CHECKING(for plugin interface used by Python)
|
||||
if test "$plugin" = yes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
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])
|
||||
;;
|
||||
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
|
||||
;;
|
||||
dnl add broken versions here
|
||||
python2.5|python2.6|python3.1|python3.2)
|
||||
AC_MSG_WARN(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"!)])
|
||||
;;
|
||||
*)
|
||||
AC_MSG_WARN(Unsupported Python ${python}!)
|
||||
esac
|
||||
AC_MSG_CHECKING(Python version)
|
||||
|
||||
if test "$PY_VER"; then
|
||||
AC_MSG_RESULT($PY_VER)
|
||||
python="python-${PY_VER}"
|
||||
else
|
||||
AC_MSG_RESULT(Not found)
|
||||
python=no
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Python])
|
||||
python=no
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** IPv6 *************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
dnl purely for Solaris
|
||||
AC_CHECK_FUNC(select, ,
|
||||
AC_CHECK_LIB(socket, select, ,
|
||||
AC_CHECK_LIB(nsl, select, ,
|
||||
AC_CHECK_LIB(inet, select, ,
|
||||
AC_CHECK_LIB(cposix, select, ,
|
||||
AC_CHECK_LIB(net, select, ,
|
||||
AC_MSG_WARN(i can not find select. you might need to help me)))))))
|
||||
AC_CHECK_LIB(socket, select)
|
||||
|
||||
AC_CHECK_FUNCS(getaddrinfo, have_getaddrinfo=yes)
|
||||
AC_MSG_CHECKING(whether IPv6 is supported)
|
||||
if test "$have_getaddrinfo" = yes; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_MSG_ERROR(ipv6 support not found!)
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** OPENSSL **********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
retry=no
|
||||
if test "$openssl" != no; then
|
||||
PKG_CHECK_MODULES(OPENSSL, [openssl], [
|
||||
AC_DEFINE(USE_OPENSSL)
|
||||
openssl=yes
|
||||
COMMON_LIBS="$COMMON_LIBS $OPENSSL_LIBS"
|
||||
COMMON_CFLAGS="$COMMON_CFLAGS $OPENSSL_CFLAGS"
|
||||
], [
|
||||
retry=yes
|
||||
])
|
||||
fi
|
||||
|
||||
if test "$retry" = "yes"; then
|
||||
unset openssl_path ac_cv_lib_ssl_SSL_new ac_cv_header_openssl_ssl_h
|
||||
if test "$openssl" != yes; then
|
||||
openssl_path=$openssl
|
||||
fi
|
||||
openssl=no
|
||||
OPENSSL_LIBS="-lcrypto"
|
||||
if test -n "$openssl_path"; then
|
||||
OPENSSL_LIBS="-L$openssl_path/lib $OPENSSL_LIBS"
|
||||
fi
|
||||
SAVED_LIBS=$LIBS
|
||||
LIBS="$LIBS $OPENSSL_LIBS"
|
||||
AC_CHECK_LIB(ssl, SSL_new, [
|
||||
if test -n "$openssl_path"; then
|
||||
OPENSSL_CFLAGS="-I$openssl_path/include"
|
||||
fi
|
||||
SAVED_CFLAGS=$CFLAGS
|
||||
CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
|
||||
AC_CHECK_HEADERS(openssl/ssl.h, [
|
||||
openssl=yes
|
||||
AC_DEFINE(USE_OPENSSL)
|
||||
OPENSSL_LIBS="$OPENSSL_LIBS -lssl"
|
||||
|
||||
COMMON_LIBS="$COMMON_LIBS $OPENSSL_LIBS"
|
||||
COMMON_CFLAGS="$COMMON_CFLAGS $OPENSSL_CFLAGS"
|
||||
])
|
||||
CFLAGS=$SAVED_CFLAGS
|
||||
])
|
||||
LIBS=$SAVED_LIBS
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** LIBPROXY *********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "x$libproxy" = "xyes" -o "x$libproxy" = "xauto" ; then
|
||||
PKG_CHECK_MODULES([LIBPROXY], [libproxy-1.0], [
|
||||
COMMON_LIBS="$COMMON_LIBS $LIBPROXY_LIBS"
|
||||
COMMON_CFLAGS="$COMMON_CFLAGS $LIBPROXY_CFLAGS"
|
||||
AC_DEFINE(USE_LIBPROXY)
|
||||
libproxy=yes
|
||||
], [
|
||||
if test "x$libproxy" = "xyes" ; then
|
||||
AC_MSG_ERROR(Cannot find libproxy!)
|
||||
fi
|
||||
libproxy=no
|
||||
])
|
||||
else
|
||||
libproxy=no
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** PLUGIN ***********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$plugin" = yes; then
|
||||
AC_DEFINE(USE_PLUGIN)
|
||||
PLUGIN_LDFLAGS="-avoid-version"
|
||||
if test "$platform_win32" = yes; then
|
||||
PLUGIN_LDFLAGS="$PLUGIN_LDFLAGS -no-undefined"
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** Checksum *********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$checksum" != "no"; then
|
||||
checksum=no
|
||||
AC_MSG_CHECKING(for plugin interface used by Checksum)
|
||||
if test "$plugin" = yes; then
|
||||
checksum=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** DO AT ************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$doat" != "no"; then
|
||||
AC_MSG_CHECKING(for plugin interface used by Do At)
|
||||
doat=no
|
||||
if test "$plugin" = yes; then
|
||||
doat=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Do At])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** FiSHLiM **********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$fishlim" != "no"; then
|
||||
fishlim=no
|
||||
AC_MSG_CHECKING(for plugin interface used by FiSHLiM)
|
||||
if test "$plugin" = yes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_MSG_CHECKING(for OpenSSL used by FiSHLiM)
|
||||
if test "$openssl" = yes; then
|
||||
fishlim=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([OpenSSL cannot be found, use the --enable-openssl option])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** SYSINFO **********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "$sysinfo" != "no"; then
|
||||
AC_MSG_CHECKING(for plugin interface used by SysInfo)
|
||||
if test "$plugin" = yes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
PKG_CHECK_MODULES(LIBPCI, libpci >= 3.0.0, [sysinfo=yes], [sysinfo=no])
|
||||
else
|
||||
AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for SysInfo])
|
||||
sysinfo=no
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl #######################################################################
|
||||
dnl # Check for DBUS libraries
|
||||
dnl #######################################################################
|
||||
|
||||
if test "x$dbus" = "xyes" ; then
|
||||
PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.60 dbus-glib-1 >= 0.60 gthread-2.0], dbus=yes, [
|
||||
dbus=no
|
||||
])
|
||||
AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool, no)
|
||||
if test "x$DBUS_BINDING_TOOL" = "xno" || test "x$dbus" = "xno" ; then
|
||||
dbus="no"
|
||||
else
|
||||
COMMON_LIBS="$COMMON_LIBS $DBUS_LIBS"
|
||||
COMMON_CFLAGS="$COMMON_CFLAGS $DBUS_CFLAGS"
|
||||
AC_DEFINE(USE_DBUS)
|
||||
|
||||
AS_AC_EXPAND(DBUS_SERVICES_DIR, "$datadir/dbus-1/services")
|
||||
AC_SUBST(DBUS_SERVICES_DIR)
|
||||
AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for DBUS is])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** LIBNOTIFY ********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "x$libnotify" = "xyes" ; then
|
||||
PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= 0.4, [], [
|
||||
libnotify=no
|
||||
])
|
||||
if test "$libnotify" != "no" ; then
|
||||
GUI_LIBS="$GUI_LIBS $LIBNOTIFY_LIBS"
|
||||
GUI_CFLAGS="$GUI_CFLAGS $LIBNOTIFY_CFLAGS"
|
||||
AC_DEFINE(USE_LIBNOTIFY)
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** LIBCANBERRA ******************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "x$libcanberra" = "xyes" ; then
|
||||
PKG_CHECK_MODULES(LIBCANBERRA, libcanberra >= 0.22, [], [
|
||||
libcanberra=no
|
||||
])
|
||||
if test "$libcanberra" != "no" ; then
|
||||
COMMON_LIBS="$COMMON_LIBS $LIBCANBERRA_LIBS"
|
||||
COMMON_CFLAGS="$COMMON_CFLAGS $LIBCANBERRA_CFLAGS"
|
||||
AC_DEFINE(USE_LIBCANBERRA)
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** SPELL ************************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "x$isocodes" = "xyes" ; then
|
||||
PKG_CHECK_MODULES(ISOCODES, "iso-codes", [
|
||||
iso_codes_prefix=`$PKG_CONFIG --variable=prefix iso-codes 2>/dev/null || echo /usr`
|
||||
AC_MSG_NOTICE([iso-codes prefix: $iso_codes_prefix])
|
||||
AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX], ["$iso_codes_prefix"], [ISO codes prefix])
|
||||
AC_DEFINE_UNQUOTED([ISO_CODES_LOCALEDIR], ["$iso_codes_prefix/share/locale"], [ISO codes locale dir])
|
||||
AC_DEFINE([HAVE_ISO_CODES], [1], [iso-codes available])
|
||||
], [
|
||||
isocodes=no
|
||||
AC_MSG_WARN(iso-codes not found!)
|
||||
])
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** Static Analysis **************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
if test "x$analyze" = "xyes"; then
|
||||
if test "$CC" != "clang"; then
|
||||
AC_MSG_WARN(CC is not clang for static analysis)
|
||||
analyze=no
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** CONDITIONALS *****************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
|
||||
AM_CONDITIONAL(USE_LIBNOTIFY, test "x$libnotify" = "xyes")
|
||||
AM_CONDITIONAL(USE_LIBCANBERRA, test "x$libcanberra" = "xyes")
|
||||
AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes")
|
||||
AM_CONDITIONAL(DO_GTK, test "x$gtkfe" = "xyes")
|
||||
AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
|
||||
AM_CONDITIONAL(DO_PYTHON, test "x$python" != "xno")
|
||||
AM_CONDITIONAL(DO_PLUGIN, test "x$plugin" = "xyes")
|
||||
AM_CONDITIONAL(DO_CHECKSUM, test "x$checksum" = "xyes")
|
||||
AM_CONDITIONAL(DO_DOAT, test "x$doat" = "xyes")
|
||||
AM_CONDITIONAL(DO_FISHLIM, test "x$fishlim" = "xyes")
|
||||
AM_CONDITIONAL(DO_SYSINFO, test "x$sysinfo" = "xyes")
|
||||
AM_CONDITIONAL(DO_STATIC_ANALYSIS, test "x$analyze" = "xyes")
|
||||
AM_CONDITIONAL(USE_DBUS, test "x$dbus" = "xyes")
|
||||
AM_CONDITIONAL(HAVE_ISO_CODES, test "x$isocodes" = "xyes")
|
||||
AM_CONDITIONAL(WITH_TM, test "x$theme_manager" != "xno")
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** GCC FLAGS ********************************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
dnl Only use -Wall and -pipe if we have gcc
|
||||
if test "x$GCC" = "xyes"; then
|
||||
if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
|
||||
CFLAGS="$CFLAGS -Wall"
|
||||
fi
|
||||
dnl these flags might be unwanted
|
||||
if test x$minimalflags != xyes; then
|
||||
if test "$system" = "Linux" -o "$system" = "FreeBSD"; then
|
||||
if test -z "`echo "$CFLAGS" | grep "\-pipe" 2> /dev/null`" ; then
|
||||
CFLAGS="$CFLAGS -pipe"
|
||||
fi
|
||||
fi
|
||||
if test -z "`echo "$CFLAGS" | grep "\-g " 2> /dev/null`" ; then
|
||||
CFLAGS="$CFLAGS -g"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl does this compiler support -Wno-pointer-sign ?
|
||||
AC_MSG_CHECKING([if $CC accepts -Wno-pointer-sign ])
|
||||
|
||||
safe_CFLAGS=$CFLAGS
|
||||
CFLAGS="-Wno-pointer-sign"
|
||||
|
||||
AC_TRY_COMPILE(, [
|
||||
return 0;
|
||||
],
|
||||
[
|
||||
no_pointer_sign=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
no_pointer_sign=no
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
CFLAGS=$safe_CFLAGS
|
||||
|
||||
if test x$no_pointer_sign = xyes; then
|
||||
CFLAGS="$CFLAGS -Wno-pointer-sign"
|
||||
fi
|
||||
|
||||
dnl does this compiler support -funsigned-char ?
|
||||
AC_MSG_CHECKING([if $CC accepts -funsigned-char ])
|
||||
|
||||
safe_CFLAGS=$CFLAGS
|
||||
CFLAGS="-funsigned-char"
|
||||
|
||||
AC_TRY_COMPILE(, [
|
||||
return 0;
|
||||
],
|
||||
[
|
||||
unsigned_char=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
unsigned_char=no
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
CFLAGS=$safe_CFLAGS
|
||||
|
||||
if test x$unsigned_char = xyes; then
|
||||
CFLAGS="$CFLAGS -funsigned-char"
|
||||
fi
|
||||
|
||||
dnl does this compiler support -Wno-unused-result ?
|
||||
AC_MSG_CHECKING([if $CC accepts -Wno-unused-result ])
|
||||
|
||||
safe_CFLAGS=$CFLAGS
|
||||
CFLAGS="-Wno-unused-result"
|
||||
|
||||
AC_TRY_COMPILE(, [
|
||||
return 0;
|
||||
],
|
||||
[
|
||||
no_unused_result=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
no_unused_result=no
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
CFLAGS=$safe_CFLAGS
|
||||
|
||||
if test x$no_unused_result = xyes; then
|
||||
CFLAGS="$CFLAGS -Wno-unused-result"
|
||||
fi
|
||||
|
||||
dnl *********************************************************************
|
||||
dnl ** FUNCTIONS/LIBS/CFLAGS ********************************************
|
||||
dnl *********************************************************************
|
||||
|
||||
AC_MSG_CHECKING(for modern sigaction)
|
||||
dnl libc5 on linux and FreeBSD 3.x doesn\'t have siginfo_t
|
||||
dnl and the sa_sigation field.
|
||||
AC_TRY_COMPILE(
|
||||
[#include <signal.h>],
|
||||
[struct sigaction act;
|
||||
siginfo_t *si;
|
||||
act.sa_sigaction = 0;],
|
||||
[
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_SIGACTION)
|
||||
],
|
||||
AC_MSG_RESULT(no))
|
||||
|
||||
AC_CHECK_FUNCS(memrchr)
|
||||
|
||||
AC_CHECK_FUNC(gethostbyname, ,
|
||||
AC_CHECK_LIB(resolv, gethostbyname, ,
|
||||
AC_CHECK_LIB(nsl, gethostbyname)))
|
||||
|
||||
AC_CHECK_FUNC(gethostname, , AC_CHECK_LIB(nsl, gethostname))
|
||||
|
||||
dnl necessary for IRIX
|
||||
AC_CHECK_HEADERS(strings.h)
|
||||
|
||||
dnl Check for type in sys/socket.h - from Squid source (GPL)
|
||||
AC_CACHE_CHECK(for socklen_t, ac_cv_type_socklen_t, [
|
||||
AC_EGREP_CPP([socklen_t[^a-zA-Z_0-9]], [#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#if STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#endif],
|
||||
ac_cv_type_socklen_t=yes,
|
||||
ac_cv_type_socklen_t=no)
|
||||
])
|
||||
if test $ac_cv_type_socklen_t = no; then
|
||||
AC_DEFINE(socklen_t, int)
|
||||
fi
|
||||
|
||||
dnl Mac OS X and Darwin use lookupd, which caches DNS queries by default
|
||||
AC_EGREP_CPP(lookupd, dnl
|
||||
[#if (defined(__APPLE__) && defined(__MACH__))
|
||||
lookupd
|
||||
#endif], AC_DEFINE([LOOKUPD],1,[Define to 1 if the system uses lookupd]))
|
||||
|
||||
dnl freebsd needs this
|
||||
LIBS="$LIBS $INTLLIBS"
|
||||
CFLAGS="$CFLAGS $CPPFLAGS"
|
||||
|
||||
GUI_LIBS="$GUI_LIBS $COMMON_LIBS"
|
||||
|
||||
dnl make these visible to all Makefiles
|
||||
AC_SUBST(GUI_LIBS)
|
||||
AC_SUBST(GUI_CFLAGS)
|
||||
AC_SUBST(COMMON_LIBS)
|
||||
AC_SUBST(COMMON_CFLAGS)
|
||||
AC_SUBST(PERL_CFLAGS)
|
||||
AC_SUBST(PERL_LDFLAGS)
|
||||
AC_SUBST(PY_CFLAGS)
|
||||
AC_SUBST(PY_LIBS)
|
||||
AC_SUBST(DBUS_CFLAGS)
|
||||
AC_SUBST(DBUS_LIBS)
|
||||
AC_SUBST(OPENSSL_LIBS)
|
||||
AC_SUBST(OPENSSL_CFLAGS)
|
||||
AC_SUBST(PLUGIN_LDFLAGS)
|
||||
|
||||
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], AC_SUBST([pkgconfigdir], ${libdir}/pkgconfig))
|
||||
|
||||
dnl for plugin.c and pixmaps.c
|
||||
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
||||
test "x$exec_prefix" = xNONE && exec_prefix="$prefix"
|
||||
|
||||
AC_DEFINE_UNQUOTED(PREFIX, "${prefix}")
|
||||
|
||||
AS_AC_EXPAND(HEXCHATLIBDIR, "${libdir}/hexchat/plugins")
|
||||
AC_DEFINE_UNQUOTED(HEXCHATLIBDIR, "$HEXCHATLIBDIR")
|
||||
|
||||
AS_AC_EXPAND(HEXCHATSHAREDIR, "$datadir")
|
||||
AC_DEFINE_UNQUOTED(HEXCHATSHAREDIR, "$HEXCHATSHAREDIR")
|
||||
|
||||
dnl for plugins/xxx/Makefile.am
|
||||
hexchatlibdir=${libdir}/hexchat/plugins
|
||||
AC_SUBST(hexchatlibdir)
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
data/Makefile
|
||||
data/icons/Makefile
|
||||
data/misc/Makefile
|
||||
data/man/Makefile
|
||||
data/man/hexchat.1
|
||||
data/pkgconfig/Makefile
|
||||
data/pkgconfig/hexchat-plugin.pc
|
||||
src/Makefile
|
||||
src/common/Makefile
|
||||
src/common/dbus/Makefile
|
||||
src/fe-text/Makefile
|
||||
src/fe-gtk/Makefile
|
||||
src/htm/Makefile
|
||||
src/htm/thememan
|
||||
osx/Info.plist
|
||||
plugins/Makefile
|
||||
plugins/python/Makefile
|
||||
plugins/perl/Makefile
|
||||
plugins/checksum/Makefile
|
||||
plugins/doat/Makefile
|
||||
plugins/fishlim/Makefile
|
||||
plugins/sysinfo/Makefile
|
||||
po/Makefile.in
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
echo
|
||||
echo HexChat $VERSION
|
||||
echo
|
||||
echo GTK+ interface ........ : $gtkfe
|
||||
echo Text interface ........ : $textfe
|
||||
echo Theme manager ......... : $theme_manager
|
||||
echo
|
||||
echo OpenSSL support ....... : $openssl
|
||||
echo D-Bus support ......... : $dbus
|
||||
echo libnotify support ..... : $libnotify
|
||||
echo libcanberra support ... : $libcanberra
|
||||
echo Plugin interface ...... : $plugin
|
||||
echo libproxy support ...... : $libproxy
|
||||
echo
|
||||
echo Perl .................. : $perl
|
||||
echo Python ................ : $python
|
||||
echo
|
||||
echo Checksum .............. : $checksum
|
||||
echo Do At ................. : $doat
|
||||
echo FiSHLiM ............... : $fishlim
|
||||
echo SysInfo ............... : $sysinfo
|
||||
echo
|
||||
echo The binary will be installed in $prefix/bin
|
||||
echo
|
||||
|
||||
if test "$gtkfe" = no; then
|
||||
echo Warning: The GTK \(GUI\) frontend will not be built.
|
||||
echo
|
||||
fi
|
||||
|
||||
echo configure complete, now type \'make\' and pray.
|
||||
echo
|
@ -1,5 +0,0 @@
|
||||
SUBDIRS = pkgconfig man
|
||||
|
||||
if DO_GTK
|
||||
SUBDIRS += icons misc
|
||||
endif
|
@ -1,23 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/icons">
|
||||
<file alias="hexchat.png" preprocess="to-pixdata" compressed="true">icons/hexchat.png</file>
|
||||
<file alias="book.png" preprocess="to-pixdata" compressed="true">icons/book.png</file>
|
||||
<file alias="hexchat.png" preprocess="to-pixdata">icons/hexchat.png</file>
|
||||
<file alias="book.png" preprocess="to-pixdata">icons/book.png</file>
|
||||
|
||||
<file alias="ulist_voice.png" preprocess="to-pixdata" compressed="true">icons/ulist_voice.png</file>
|
||||
<file alias="ulist_halfop.png" preprocess="to-pixdata" compressed="true">icons/ulist_halfop.png</file>
|
||||
<file alias="ulist_op.png" preprocess="to-pixdata" compressed="true">icons/ulist_op.png</file>
|
||||
<file alias="ulist_owner.png" preprocess="to-pixdata" compressed="true">icons/ulist_owner.png</file>
|
||||
<file alias="ulist_founder.png" preprocess="to-pixdata" compressed="true">icons/ulist_founder.png</file>
|
||||
<file alias="ulist_netop.png" preprocess="to-pixdata" compressed="true">icons/ulist_netop.png</file>
|
||||
<file alias="ulist_voice.png" preprocess="to-pixdata">icons/ulist_voice.png</file>
|
||||
<file alias="ulist_halfop.png" preprocess="to-pixdata">icons/ulist_halfop.png</file>
|
||||
<file alias="ulist_op.png" preprocess="to-pixdata">icons/ulist_op.png</file>
|
||||
<file alias="ulist_owner.png" preprocess="to-pixdata">icons/ulist_owner.png</file>
|
||||
<file alias="ulist_founder.png" preprocess="to-pixdata">icons/ulist_founder.png</file>
|
||||
<file alias="ulist_netop.png" preprocess="to-pixdata">icons/ulist_netop.png</file>
|
||||
|
||||
<file alias="tray_fileoffer.png" preprocess="to-pixdata" compressed="true">icons/tray_fileoffer.png</file>
|
||||
<file alias="tray_highlight.png" preprocess="to-pixdata" compressed="true">icons/tray_highlight.png</file>
|
||||
<file alias="tray_message.png" preprocess="to-pixdata" compressed="true">icons/tray_message.png</file>
|
||||
<file alias="tray_normal.png" preprocess="to-pixdata">icons/hexchat.png</file>
|
||||
<file alias="tray_fileoffer.png" preprocess="to-pixdata">icons/tray_fileoffer.png</file>
|
||||
<file alias="tray_highlight.png" preprocess="to-pixdata">icons/tray_highlight.png</file>
|
||||
<file alias="tray_message.png" preprocess="to-pixdata">icons/tray_message.png</file>
|
||||
|
||||
<file alias="tree_channel.png" preprocess="to-pixdata">icons/tree_channel.png</file>
|
||||
<file alias="tree_dialog.png" preprocess="to-pixdata" compressed="true">icons/tree_dialog.png</file>
|
||||
<file alias="tree_server.png" preprocess="to-pixdata" compressed="true">icons/tree_server.png</file>
|
||||
<file alias="tree_util.png" preprocess="to-pixdata" compressed="true">icons/tree_util.png</file>
|
||||
<file alias="tree_dialog.png" preprocess="to-pixdata">icons/tree_dialog.png</file>
|
||||
<file alias="tree_server.png" preprocess="to-pixdata">icons/tree_server.png</file>
|
||||
<file alias="tree_util.png" preprocess="to-pixdata">icons/tree_util.png</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
@ -1,13 +0,0 @@
|
||||
icon_DATA = hexchat.png
|
||||
icondir = $(datadir)/icons/hicolor/48x48/apps
|
||||
|
||||
hicolor_DATA = hexchat.svg
|
||||
hicolordir = $(datadir)/icons/hicolor/scalable/apps
|
||||
|
||||
UPDATE_ICON_CACHE = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor || :
|
||||
|
||||
install-data-hook:
|
||||
$(UPDATE_ICON_CACHE);
|
||||
|
||||
uninstall-hook:
|
||||
$(UPDATE_ICON_CACHE);
|
@ -1,745 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
sodipodi:docname="hexchat.svg"
|
||||
version="1.0"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:version="0.32"
|
||||
id="svg2"
|
||||
height="64"
|
||||
width="64">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
id="linearGradient2289">
|
||||
<stop
|
||||
style="stop-color:#ff2600;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop2291" />
|
||||
<stop
|
||||
style="stop-color:#ffd600;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop2293" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient1335"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.545166,0,0,0.544959,0.186963,35.29511)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="72.348671"
|
||||
y2="20.59322" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient1337"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.545166,0,0,0.544959,0.186963,35.29511)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="16.88862"
|
||||
y2="19.001091" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient1317"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.052758,-16.66733)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="72.348671"
|
||||
y2="20.59322" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient1319"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.052758,-16.66733)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="16.88862"
|
||||
y2="19.001091" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient1320"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.172329,-1.111016)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="72.348671"
|
||||
y2="20.59322" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient1322"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.172329,-1.111016)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="16.88862"
|
||||
y2="19.001091" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient2997"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-160.10656,-7.1914058)"
|
||||
x1="130.2673"
|
||||
y1="78.743134"
|
||||
x2="129.2081"
|
||||
y2="25.771122" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient3011"
|
||||
x1="34.62241"
|
||||
y1="53.508884"
|
||||
x2="34.466503"
|
||||
y2="5.4893961"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient3030"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="34.62241"
|
||||
y1="53.508884"
|
||||
x2="34.466503"
|
||||
y2="5.4893961" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient3070"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="34.62241"
|
||||
y1="53.508884"
|
||||
x2="34.466503"
|
||||
y2="5.4893961"
|
||||
gradientTransform="matrix(0.99894925,0,0,0.97549134,-3.1829063,4.465557)" />
|
||||
<filter
|
||||
id="filter3281"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood3283"
|
||||
flood-opacity="0.33"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite3285"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3287"
|
||||
in="composite"
|
||||
stdDeviation="2"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3289"
|
||||
dx="4"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3291"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<filter
|
||||
id="filter3293"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood3295"
|
||||
flood-opacity="0.33"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite3297"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3299"
|
||||
in="composite"
|
||||
stdDeviation="2"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3301"
|
||||
dx="4"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3303"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient4089"
|
||||
x1="99.348503"
|
||||
y1="59.934135"
|
||||
x2="100.40916"
|
||||
y2="10.613438"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient4093"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="99.348503"
|
||||
y1="59.934135"
|
||||
x2="100.40916"
|
||||
y2="10.613438" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient4096"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="99.348503"
|
||||
y1="59.934135"
|
||||
x2="100.40916"
|
||||
y2="10.613438" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient4098"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="99.348503"
|
||||
y1="59.934135"
|
||||
x2="100.40916"
|
||||
y2="10.613438"
|
||||
gradientTransform="translate(-70.003571,-2.298097)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
id="linearGradient4101"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.94969205,0,0,0.89326813,1.6716955,2.7025635)"
|
||||
x1="31.372862"
|
||||
y1="60.111893"
|
||||
x2="31.559002"
|
||||
y2="5.6897221" />
|
||||
<filter
|
||||
id="filter4111"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood4113"
|
||||
flood-opacity="0.33"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite4115"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur4117"
|
||||
in="composite"
|
||||
stdDeviation="2"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset4119"
|
||||
dx="4"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite4121"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<filter
|
||||
id="filter4123"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood4125"
|
||||
flood-opacity="0.33"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite4127"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur4129"
|
||||
in="composite"
|
||||
stdDeviation="2"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset4131"
|
||||
dx="4"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite4133"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<linearGradient
|
||||
y2="19.001091"
|
||||
x2="16.88862"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.172329,-1.111016)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1330"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="20.59322"
|
||||
x2="72.348671"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.172329,-1.111016)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1328"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="19.001091"
|
||||
x2="16.88862"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.172329,-1.111016)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1322-5"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="20.59322"
|
||||
x2="72.348671"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.172329,-1.111016)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1320-4"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="19.001091"
|
||||
x2="16.88862"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.052758,-16.66733)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1319-2"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="20.59322"
|
||||
x2="72.348671"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.052758,-16.66733)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1317-8"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="19.001091"
|
||||
x2="16.88862"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.545166,0,0,0.544959,0.186963,35.29511)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1337-8"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="20.59322"
|
||||
x2="72.348671"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.545166,0,0,0.544959,0.186963,35.29511)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1335-4"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient2289-4">
|
||||
<stop
|
||||
id="stop2291-0"
|
||||
offset="0"
|
||||
style="stop-color:#ff2600;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop2293-9"
|
||||
offset="1"
|
||||
style="stop-color:#ffd600;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
id="linearGradient3133"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.51445624,0,0,0.53856587,7.3477348,6.9450134)"
|
||||
x1="46.881573"
|
||||
y1="91.824585"
|
||||
x2="47.225189"
|
||||
y2="1.5596932" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
id="linearGradient3136"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.51445624,0,0,0.53856587,-120.3871,-29.360443)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="72.348671"
|
||||
y2="20.59322" />
|
||||
<filter
|
||||
id="filter3138"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood3140"
|
||||
flood-opacity="0.33"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite3142"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3144"
|
||||
in="composite"
|
||||
stdDeviation="2"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3146"
|
||||
dx="4"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3148"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<filter
|
||||
id="filter3670"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood3672"
|
||||
flood-opacity="0.2"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite3674"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3676"
|
||||
in="composite"
|
||||
stdDeviation="1.5"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3678"
|
||||
dx="0"
|
||||
dy="4"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3680"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="fbSourceGraphic" />
|
||||
<feColorMatrix
|
||||
result="fbSourceGraphicAlpha"
|
||||
in="fbSourceGraphic"
|
||||
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
|
||||
id="feColorMatrix3682" />
|
||||
<feFlood
|
||||
id="feFlood3684"
|
||||
flood-opacity="0.2"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood"
|
||||
in="fbSourceGraphic" />
|
||||
<feComposite
|
||||
id="feComposite3686"
|
||||
in2="fbSourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3688"
|
||||
in="composite"
|
||||
stdDeviation="1.5"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3690"
|
||||
dx="0"
|
||||
dy="2"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3692"
|
||||
in2="offset"
|
||||
in="fbSourceGraphic"
|
||||
operator="over"
|
||||
result="fbSourceGraphic" />
|
||||
<feColorMatrix
|
||||
result="fbSourceGraphicAlpha"
|
||||
in="fbSourceGraphic"
|
||||
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
|
||||
id="feColorMatrix3706" />
|
||||
<feFlood
|
||||
id="feFlood3708"
|
||||
flood-opacity="0.2"
|
||||
flood-color="rgb(255,255,255)"
|
||||
result="flood"
|
||||
in="fbSourceGraphic" />
|
||||
<feComposite
|
||||
id="feComposite3710"
|
||||
in2="fbSourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3712"
|
||||
in="composite"
|
||||
stdDeviation="1"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3714"
|
||||
dx="0"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3716"
|
||||
in2="offset"
|
||||
in="fbSourceGraphic"
|
||||
operator="over"
|
||||
result="fbSourceGraphic" />
|
||||
<feColorMatrix
|
||||
result="fbSourceGraphicAlpha"
|
||||
in="fbSourceGraphic"
|
||||
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
|
||||
id="feColorMatrix3123" />
|
||||
<feFlood
|
||||
id="feFlood3125"
|
||||
flood-opacity="0.2"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood"
|
||||
in="fbSourceGraphic" />
|
||||
<feComposite
|
||||
id="feComposite3127"
|
||||
in2="fbSourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3129"
|
||||
in="composite"
|
||||
stdDeviation="1"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3131"
|
||||
dx="0"
|
||||
dy="2"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3133"
|
||||
in2="offset"
|
||||
in="fbSourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<filter
|
||||
id="filter3135"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood3137"
|
||||
flood-opacity="0.2"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite3139"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3141"
|
||||
in="composite"
|
||||
stdDeviation="1"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3143"
|
||||
dx="0"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3145"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<filter
|
||||
id="filter3183"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood3185"
|
||||
flood-opacity="0.3"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite3187"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3189"
|
||||
in="composite"
|
||||
stdDeviation="2"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3191"
|
||||
dx="0"
|
||||
dy="2"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3193"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="7.9999999"
|
||||
inkscape:cx="61.011203"
|
||||
inkscape:cy="36.086679"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1270"
|
||||
inkscape:window-height="837"
|
||||
inkscape:window-x="287"
|
||||
inkscape:window-y="27"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:window-maximized="0">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid3001" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata7">
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
height="64"
|
||||
width="64">
|
||||
<metadata>
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<cc:Work>
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Guglielmi David</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
|
||||
<cc:license rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
|
||||
<dc:rights>
|
||||
<cc:Agent>
|
||||
<dc:title>Peter Zelezny</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:rights>
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title>Samuel Messner</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/Notice" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/ShareAlike" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/SourceCode" />
|
||||
<cc:License rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
|
||||
<cc:requires rdf:resource="http://web.resource.org/cc/Notice" />
|
||||
<cc:requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
|
||||
<cc:requires rdf:resource="http://web.resource.org/cc/SourceCode" />
|
||||
<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
id="g3663">
|
||||
<path
|
||||
style="fill:#000000;fill-opacity:1;"
|
||||
d="m 31.404792,8.7464684 c -6.271873,0.05843 -12.553,0.431777 -13.735377,1.075609 C 15.304661,11.109737 4.1505773,29.32852 4.1783444,31.859522 c 0.02777,2.531005 11.5871596,20.543967 13.9796816,21.787309 2.392519,1.243342 25.106,1.037521 27.470753,-0.250141 C 47.993531,52.109028 59.147618,33.890246 59.119851,31.359242 59.092081,28.828238 47.532689,10.790262 45.140167,9.5469214 43.943907,8.9252504 37.676665,8.6880384 31.404792,8.7464684 z m 0.05429,4.5275596 c 4.90437,-0.047 9.786849,0.175368 10.722281,0.67538 1.870861,1.000021 10.917726,15.499216 10.939439,17.534904 C 53.142512,33.52 44.410541,48.158649 42.561393,49.194315 40.712245,50.229983 22.960549,50.419464 21.089689,49.419444 19.218826,48.419423 10.199106,33.920226 10.177392,31.884537 10.155682,29.84885 18.860508,15.185189 20.709656,14.14952 c 0.924575,-0.517833 5.845056,-0.828498 10.749425,-0.875492 z"
|
||||
id="path4107"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
transform="matrix(0.97890109,0,0,0.98965389,0.52623659,-1.3159842)"
|
||||
style="fill:#000000;fill-opacity:1;"
|
||||
d="M 31.801142,5.3887159 C 24.358829,5.4607629 16.905535,5.9211193 15.502506,6.7149966 12.696449,8.3027513 -0.53918189,30.767467 -0.50623228,33.888328 -0.47328049,37.00919 13.243292,59.220118 16.0823,60.753225 18.921305,62.286332 45.873514,62.032541 48.67957,60.444787 51.485627,58.857032 64.721258,36.392315 64.688309,33.271454 64.655357,30.150593 50.938784,7.9088218 48.099776,6.3757155 46.680274,5.6091623 39.243454,5.3166688 31.801142,5.3887159 z m 0.06442,5.5827171 c 5.81961,-0.05795 11.613244,0.216241 12.723243,0.83278 2.219996,1.233079 12.955163,19.111349 12.980929,21.621461 0.02577,2.51011 -10.335747,20.560333 -12.529979,21.837366 -2.19423,1.277031 -23.2587,1.510671 -25.478697,0.277592 C 17.341063,54.307554 6.638107,36.429283 6.6123418,33.919173 6.5865755,31.409062 16.915878,13.327995 19.110109,12.050964 20.207224,11.412447 26.045952,11.02938 31.865563,10.971433 z"
|
||||
id="path4103"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
inkscape:transform-center-y="2.25"
|
||||
inkscape:transform-center-x="2.25"
|
||||
style="fill:url(#linearGradient3133);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.31593215000000008;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;"
|
||||
d="m 10.723737,18.285684 7.623916,-7.935243 13.238019,13.886676 12.492701,-13.886676 8.576909,7.935243 -14.294847,14.878584 13.341856,11.902864 -6.670928,6.94334 L 31.585672,39.351071 18.573785,52.010472 11.676724,45.086347 24.065591,33.164268 10.723737,18.285684 z"
|
||||
id="path2297"
|
||||
sodipodi:nodetypes="ccccccccccccc"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3305"
|
||||
d="M 31.293607,6.0952825 C 24.436514,6.1604875 17.569304,6.5771256 16.276601,7.2956116 13.691196,8.7325834 1.4963386,29.063913 1.5266972,31.888398 1.5570579,34.712884 14.195039,54.814527 16.810803,56.20204 19.426566,57.589553 44.25941,57.359866 46.844814,55.922894 49.430219,54.485922 61.625078,34.154591 61.594719,31.330106 61.564358,28.505621 48.926376,8.3760634 46.310612,6.9885506 45.002731,6.294794 38.150699,6.0300774 31.293607,6.0952825 z m 0.05936,5.0525485 c 5.36199,-0.05245 10.700046,0.195704 11.722761,0.753694 2.045429,1.115978 11.936445,17.296419 11.960184,19.568154 0.02374,2.271736 -9.523004,18.6078 -11.544693,19.763557 -2.02169,1.155758 -21.429773,1.36721 -23.475201,0.251232 C 17.970585,50.368491 8.1092472,34.188049 8.085508,31.916313 8.061768,29.644577 17.578834,13.2806 19.600523,12.124842 c 1.010846,-0.577879 6.39045,-0.924567 11.75244,-0.977011 z"
|
||||
style="fill:url(#linearGradient4101);fill-opacity:1;" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3077"
|
||||
d="M 14.640198,55.682743 C 9.6971439,47.360612 2.8950957,35.733851 2.9419881,35.686959 c 0.031272,-0.03127 0.5023581,0.289334 1.0468575,0.712459 0.5444994,0.423125 1.0414462,0.769317 1.1043264,0.769317 0.06288,0 2.6329414,4.276521 5.711247,9.50338 l 5.59692,9.503379 2.159128,0.007 2.159126,0.007 -0.34365,-0.584653 C 20.186937,55.28323 17.303514,50.518786 13.968339,45.017137 10.633164,39.515488 7.9043842,34.929294 7.9043842,34.825595 c 0,-0.103699 0.2455542,-0.59277 0.545676,-1.086823 0.3001218,-0.494053 0.545676,-0.941721 0.545676,-0.994816 0,-0.05309 -0.2788317,-0.09654 -0.619626,-0.09654 -0.8505388,0 -1.0953557,-0.488405 -1.0953557,-2.185211 0,-1.90734 -0.048411,-1.868066 2.30512,-1.870072 l 1.9823345,-0.0017 1.052375,-1.721616 c 0.578806,-0.94689 1.052375,-1.785869 1.052375,-1.8644 0,-0.07853 -0.829918,-0.162484 -1.844262,-0.186561 l -1.8442631,-0.04378 4.4809551,-7.327649 4.480953,-7.32765 12.466741,-0.0399 12.466738,-0.0399 0.517892,0.854518 0.517892,0.854518 2.335995,0.04287 2.335994,0.04287 2.742626,4.521316 c 1.508447,2.486723 4.136212,6.819001 5.839482,9.627283 1.703268,2.808283 3.157599,5.105969 3.231846,5.105969 0.256907,0 0.13186,-0.393635 -0.411085,-1.294044 -0.299901,-0.497351 -0.545275,-0.935841 -0.545275,-0.974422 0,-0.03858 0.310833,-0.07015 0.69074,-0.07015 0.575204,0 0.699074,-0.05324 0.740561,-0.318272 0.03599,-0.229934 0.273254,0.06215 0.854835,1.052375 0.702767,1.196557 0.780303,1.410253 0.610448,1.682462 -0.107012,0.171499 -0.377881,0.627528 -0.601929,1.013399 l -0.407361,0.701583 0.533953,0.857491 c 0.293674,0.47162 0.535536,0.950306 0.537472,1.063747 0.0019,0.113441 -3.098537,5.322698 -6.889942,11.576127 l -6.893462,11.36987 -16.876654,0 -16.876655,0 -1.226996,-2.065773 z"
|
||||
style="fill:none;" />
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="hexchatGradient" x1="0" y1="1" x2="0" y2="0">
|
||||
<stop id="hgRedStop" offset="0" style="stop-color: #FF2600; stop-opacity: 1;" />
|
||||
<stop id="hgYellowStop" offset="1" style="stop-color: #FFD600; stop-opacity: 1;" />
|
||||
</linearGradient>
|
||||
<filter inkscape:collect="always" id="dropshadow">
|
||||
<feGaussianBlur inkscape:collect="always" stdDeviation="1.9736701" id="dropshadowGaussian" />
|
||||
</filter>
|
||||
</defs>
|
||||
<path
|
||||
style="fill: #000000; fill-opacity: 1;"
|
||||
d="m 31.62506,4.4248023 c -7.285288,0.0713 -14.595323,0.526836 -15.96875,1.3125 C 12.909458,7.3086297 -0.0321942,29.523731 6.0185229e-5,32.612303 0.0323162,35.700876 13.470952,57.688808 16.25006,59.206053 c 2.779105,1.517245 29.159399,1.258827 31.90625,-0.3125 2.746852,-1.571328 15.688504,-23.786428 15.65625,-26.875 C 63.7803,28.929981 50.372918,6.9107967 47.59381,5.3935523 46.204258,4.6349293 38.910347,4.3535003 31.62506,4.4248023 z m -0.1875,9.2500007 c 3.386631,-0.03246 6.676687,0.05409 8.75,0.28125 l -8.71875,9.71875 -9.0625,-9.5 c 2.055746,-0.283043 5.521157,-0.466366 9.03125,-0.5 z m 17.34375,9.84375 c 2.298293,3.744897 4.302354,7.392556 4.3125,8.34375 0.01126,1.055883 -2.358157,5.507241 -4.875,9.6875 l -9.03125,-8.03125 z m -34.46875,0.25 8.75,9.75 -8.1875,7.875 c -2.482342,-3.992634 -4.707927,-8.110307 -4.71875,-9.125 -0.01021,-0.95736 1.927117,-4.687748 4.15625,-8.5 z m 17.15625,16.90625 9.8125,9.21875 c -4.111037,0.67314 -16.108253,0.781873 -19.46875,0.125 z"
|
||||
id="outline"
|
||||
sodipodi:nodetypes="ssssssssscccscsccccccsccccc" />
|
||||
<path
|
||||
style="fill: url(#hexchatGradient); fill-opacity: 1;"
|
||||
d="m 31.25006,6.4873027 c -6.857093,0.06521 -13.707297,0.469014 -15,1.1875 -2.585405,1.4369712 -14.780358,21.7692653 -14.75,24.5937503 0.03036,2.824486 12.665486,22.924987 15.28125,24.3125 2.615763,1.387513 27.445846,1.186972 30.03125,-0.25 2.585405,-1.436972 14.780359,-21.769265 14.75,-24.59375 C 61.5322,28.912818 48.897074,8.7810649 46.28131,7.3935527 44.973429,6.6997957 38.107152,6.4220967 31.25006,6.4873027 z m 0.0625,5.0625003 c 5.36199,-0.05245 10.696035,0.19201 11.71875,0.75 0.06132,0.03346 0.143803,0.127745 0.21875,0.1875 l -11.28125,12.59375 -0.5,0.53125 -0.46875,-0.53125 -11.75,-12.3125 c 0.10903,-0.09884 0.228263,-0.201843 0.3125,-0.25 1.010846,-0.577879 6.38801,-0.916306 11.75,-0.96875 z m 18.0625,9.46875 c 2.883844,4.661341 5.612556,9.652893 5.625,10.84375 0.01348,1.290331 -3.064699,7.087557 -6.09375,12.09375 l -11.09375,-9.90625 -0.53125,-0.46875 0.5,-0.46875 11.59375,-12.09375 z m -35.78125,0.03125 10.84375,12.0625 0.4375,0.46875 -0.46875,0.4375 -10.28125,9.90625 c -3.04689,-4.86606 -6.049362,-10.36778 -6.0625,-11.625 -0.01271,-1.216102 2.689239,-6.451996 5.53125,-11.25 z m 17.875,17.78125 0.4375,0.4375 12.34375,11.59375 c -0.318014,0.365376 -0.587006,0.638955 -0.78125,0.75 -2.02169,1.155758 -21.423322,1.397228 -23.46875,0.28125 -0.228202,-0.124506 -0.601742,-0.47821 -1,-0.9375 l 12,-11.6875 0.46875,-0.4375 z"
|
||||
id="coloredX" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 126 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.4 KiB |
@ -1,746 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
sodipodi:docname="hexchat.svg"
|
||||
version="1.0"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:version="0.32"
|
||||
id="svg2"
|
||||
height="64"
|
||||
width="64">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
id="linearGradient2289">
|
||||
<stop
|
||||
style="stop-color:#ff2600;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop2291" />
|
||||
<stop
|
||||
style="stop-color:#ffd600;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop2293" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient1335"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.545166,0,0,0.544959,0.186963,35.29511)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="72.348671"
|
||||
y2="20.59322" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient1337"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.545166,0,0,0.544959,0.186963,35.29511)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="16.88862"
|
||||
y2="19.001091" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient1317"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.052758,-16.66733)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="72.348671"
|
||||
y2="20.59322" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient1319"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.052758,-16.66733)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="16.88862"
|
||||
y2="19.001091" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient1320"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.172329,-1.111016)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="72.348671"
|
||||
y2="20.59322" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient1322"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.172329,-1.111016)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="16.88862"
|
||||
y2="19.001091" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient2997"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-160.10656,-7.1914058)"
|
||||
x1="130.2673"
|
||||
y1="78.743134"
|
||||
x2="129.2081"
|
||||
y2="25.771122" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient3011"
|
||||
x1="34.62241"
|
||||
y1="53.508884"
|
||||
x2="34.466503"
|
||||
y2="5.4893961"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient3030"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="34.62241"
|
||||
y1="53.508884"
|
||||
x2="34.466503"
|
||||
y2="5.4893961" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient3070"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="34.62241"
|
||||
y1="53.508884"
|
||||
x2="34.466503"
|
||||
y2="5.4893961"
|
||||
gradientTransform="matrix(0.99894925,0,0,0.97549134,-3.1829063,4.465557)" />
|
||||
<filter
|
||||
id="filter3281"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood3283"
|
||||
flood-opacity="0.33"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite3285"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3287"
|
||||
in="composite"
|
||||
stdDeviation="2"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3289"
|
||||
dx="4"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3291"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<filter
|
||||
id="filter3293"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood3295"
|
||||
flood-opacity="0.33"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite3297"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3299"
|
||||
in="composite"
|
||||
stdDeviation="2"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3301"
|
||||
dx="4"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3303"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient4089"
|
||||
x1="99.348503"
|
||||
y1="59.934135"
|
||||
x2="100.40916"
|
||||
y2="10.613438"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient4093"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="99.348503"
|
||||
y1="59.934135"
|
||||
x2="100.40916"
|
||||
y2="10.613438" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient4096"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="99.348503"
|
||||
y1="59.934135"
|
||||
x2="100.40916"
|
||||
y2="10.613438" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289"
|
||||
id="linearGradient4098"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="99.348503"
|
||||
y1="59.934135"
|
||||
x2="100.40916"
|
||||
y2="10.613438"
|
||||
gradientTransform="translate(-70.003571,-2.298097)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
id="linearGradient4101"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.94969205,0,0,0.89326813,1.6716955,2.7025635)"
|
||||
x1="31.372862"
|
||||
y1="60.111893"
|
||||
x2="31.559002"
|
||||
y2="5.6897221" />
|
||||
<filter
|
||||
id="filter4111"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood4113"
|
||||
flood-opacity="0.33"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite4115"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur4117"
|
||||
in="composite"
|
||||
stdDeviation="2"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset4119"
|
||||
dx="4"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite4121"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<filter
|
||||
id="filter4123"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood4125"
|
||||
flood-opacity="0.33"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite4127"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur4129"
|
||||
in="composite"
|
||||
stdDeviation="2"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset4131"
|
||||
dx="4"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite4133"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<linearGradient
|
||||
y2="19.001091"
|
||||
x2="16.88862"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.172329,-1.111016)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1330"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="20.59322"
|
||||
x2="72.348671"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.172329,-1.111016)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1328"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="19.001091"
|
||||
x2="16.88862"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.172329,-1.111016)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1322-5"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="20.59322"
|
||||
x2="72.348671"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.172329,-1.111016)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1320-4"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="19.001091"
|
||||
x2="16.88862"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.052758,-16.66733)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1319-2"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="20.59322"
|
||||
x2="72.348671"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.735969,0,0,0.735801,-2.052758,-16.66733)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1317-8"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="19.001091"
|
||||
x2="16.88862"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.545166,0,0,0.544959,0.186963,35.29511)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1337-8"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
y2="20.59322"
|
||||
x2="72.348671"
|
||||
y1="77.796608"
|
||||
x1="16.88862"
|
||||
gradientTransform="matrix(0.545166,0,0,0.544959,0.186963,35.29511)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient1335-4"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient2289-4">
|
||||
<stop
|
||||
id="stop2291-0"
|
||||
offset="0"
|
||||
style="stop-color:#ff2600;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop2293-9"
|
||||
offset="1"
|
||||
style="stop-color:#ffd600;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
id="linearGradient3133"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.51445624,0,0,0.53856587,7.3477348,6.9450134)"
|
||||
x1="46.881573"
|
||||
y1="91.824585"
|
||||
x2="47.225189"
|
||||
y2="1.5596932" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient2289-4"
|
||||
id="linearGradient3136"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.51445624,0,0,0.53856587,-120.3871,-29.360443)"
|
||||
x1="16.88862"
|
||||
y1="77.796608"
|
||||
x2="72.348671"
|
||||
y2="20.59322" />
|
||||
<filter
|
||||
id="filter3138"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood3140"
|
||||
flood-opacity="0.33"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite3142"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3144"
|
||||
in="composite"
|
||||
stdDeviation="2"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3146"
|
||||
dx="4"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3148"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<filter
|
||||
id="filter3670"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood3672"
|
||||
flood-opacity="0.2"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite3674"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3676"
|
||||
in="composite"
|
||||
stdDeviation="1.5"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3678"
|
||||
dx="0"
|
||||
dy="4"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3680"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="fbSourceGraphic" />
|
||||
<feColorMatrix
|
||||
result="fbSourceGraphicAlpha"
|
||||
in="fbSourceGraphic"
|
||||
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
|
||||
id="feColorMatrix3682" />
|
||||
<feFlood
|
||||
id="feFlood3684"
|
||||
flood-opacity="0.2"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood"
|
||||
in="fbSourceGraphic" />
|
||||
<feComposite
|
||||
id="feComposite3686"
|
||||
in2="fbSourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3688"
|
||||
in="composite"
|
||||
stdDeviation="1.5"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3690"
|
||||
dx="0"
|
||||
dy="2"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3692"
|
||||
in2="offset"
|
||||
in="fbSourceGraphic"
|
||||
operator="over"
|
||||
result="fbSourceGraphic" />
|
||||
<feColorMatrix
|
||||
result="fbSourceGraphicAlpha"
|
||||
in="fbSourceGraphic"
|
||||
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
|
||||
id="feColorMatrix3706" />
|
||||
<feFlood
|
||||
id="feFlood3708"
|
||||
flood-opacity="0.2"
|
||||
flood-color="rgb(255,255,255)"
|
||||
result="flood"
|
||||
in="fbSourceGraphic" />
|
||||
<feComposite
|
||||
id="feComposite3710"
|
||||
in2="fbSourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3712"
|
||||
in="composite"
|
||||
stdDeviation="1"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3714"
|
||||
dx="0"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3716"
|
||||
in2="offset"
|
||||
in="fbSourceGraphic"
|
||||
operator="over"
|
||||
result="fbSourceGraphic" />
|
||||
<feColorMatrix
|
||||
result="fbSourceGraphicAlpha"
|
||||
in="fbSourceGraphic"
|
||||
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
|
||||
id="feColorMatrix3123" />
|
||||
<feFlood
|
||||
id="feFlood3125"
|
||||
flood-opacity="0.2"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood"
|
||||
in="fbSourceGraphic" />
|
||||
<feComposite
|
||||
id="feComposite3127"
|
||||
in2="fbSourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3129"
|
||||
in="composite"
|
||||
stdDeviation="1"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3131"
|
||||
dx="0"
|
||||
dy="2"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3133"
|
||||
in2="offset"
|
||||
in="fbSourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<filter
|
||||
id="filter3135"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood3137"
|
||||
flood-opacity="0.2"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite3139"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3141"
|
||||
in="composite"
|
||||
stdDeviation="1"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3143"
|
||||
dx="0"
|
||||
dy="1"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3145"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<filter
|
||||
id="filter3183"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow">
|
||||
<feFlood
|
||||
id="feFlood3185"
|
||||
flood-opacity="0.3"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite3187"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur3189"
|
||||
in="composite"
|
||||
stdDeviation="2"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset3191"
|
||||
dx="0"
|
||||
dy="2"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite3193"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="7.9999999"
|
||||
inkscape:cx="60.761203"
|
||||
inkscape:cy="36.086679"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1270"
|
||||
inkscape:window-height="837"
|
||||
inkscape:window-x="287"
|
||||
inkscape:window-y="27"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:window-maximized="0">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid3001" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata7">
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
height="64"
|
||||
width="64">
|
||||
<metadata>
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<cc:Work>
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Guglielmi David</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
|
||||
<cc:license rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
|
||||
<dc:rights>
|
||||
<cc:Agent>
|
||||
<dc:title>Peter Zelezny</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:rights>
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title>Samuel Messner</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/Notice" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/ShareAlike" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/SourceCode" />
|
||||
<cc:License rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
|
||||
<cc:requires rdf:resource="http://web.resource.org/cc/Notice" />
|
||||
<cc:requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
|
||||
<cc:requires rdf:resource="http://web.resource.org/cc/SourceCode" />
|
||||
<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Calque 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<g
|
||||
id="g3663"
|
||||
style="filter:url(#filter3183)">
|
||||
<path
|
||||
style="fill:#000000;fill-opacity:1;"
|
||||
d="m 31.404792,8.7464684 c -6.271873,0.05843 -12.553,0.431777 -13.735377,1.075609 C 15.304661,11.109737 4.1505773,29.32852 4.1783444,31.859522 c 0.02777,2.531005 11.5871596,20.543967 13.9796816,21.787309 2.392519,1.243342 25.106,1.037521 27.470753,-0.250141 C 47.993531,52.109028 59.147618,33.890246 59.119851,31.359242 59.092081,28.828238 47.532689,10.790262 45.140167,9.5469214 43.943907,8.9252504 37.676665,8.6880384 31.404792,8.7464684 z m 0.05429,4.5275596 c 4.90437,-0.047 9.786849,0.175368 10.722281,0.67538 1.870861,1.000021 10.917726,15.499216 10.939439,17.534904 C 53.142512,33.52 44.410541,48.158649 42.561393,49.194315 40.712245,50.229983 22.960549,50.419464 21.089689,49.419444 19.218826,48.419423 10.199106,33.920226 10.177392,31.884537 10.155682,29.84885 18.860508,15.185189 20.709656,14.14952 c 0.924575,-0.517833 5.845056,-0.828498 10.749425,-0.875492 z"
|
||||
id="path4107"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
transform="matrix(0.97890109,0,0,0.98965389,0.52623659,-1.3159842)"
|
||||
style="fill:#000000;fill-opacity:1;"
|
||||
d="M 31.801142,5.3887159 C 24.358829,5.4607629 16.905535,5.9211193 15.502506,6.7149966 12.696449,8.3027513 -0.53918189,30.767467 -0.50623228,33.888328 -0.47328049,37.00919 13.243292,59.220118 16.0823,60.753225 18.921305,62.286332 45.873514,62.032541 48.67957,60.444787 51.485627,58.857032 64.721258,36.392315 64.688309,33.271454 64.655357,30.150593 50.938784,7.9088218 48.099776,6.3757155 46.680274,5.6091623 39.243454,5.3166688 31.801142,5.3887159 z m 0.06442,5.5827171 c 5.81961,-0.05795 11.613244,0.216241 12.723243,0.83278 2.219996,1.233079 12.955163,19.111349 12.980929,21.621461 0.02577,2.51011 -10.335747,20.560333 -12.529979,21.837366 -2.19423,1.277031 -23.2587,1.510671 -25.478697,0.277592 C 17.341063,54.307554 6.638107,36.429283 6.6123418,33.919173 6.5865755,31.409062 16.915878,13.327995 19.110109,12.050964 20.207224,11.412447 26.045952,11.02938 31.865563,10.971433 z"
|
||||
id="path4103"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
inkscape:transform-center-y="2.25"
|
||||
inkscape:transform-center-x="2.25"
|
||||
style="fill:url(#linearGradient3133);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.31593215000000008;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;"
|
||||
d="m 10.723737,18.285684 7.623916,-7.935243 13.238019,13.886676 12.492701,-13.886676 8.576909,7.935243 -14.294847,14.878584 13.341856,11.902864 -6.670928,6.94334 L 31.585672,39.351071 18.573785,52.010472 11.676724,45.086347 24.065591,33.164268 10.723737,18.285684 z"
|
||||
id="path2297"
|
||||
sodipodi:nodetypes="ccccccccccccc"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3305"
|
||||
d="M 31.293607,6.0952825 C 24.436514,6.1604875 17.569304,6.5771256 16.276601,7.2956116 13.691196,8.7325834 1.4963386,29.063913 1.5266972,31.888398 1.5570579,34.712884 14.195039,54.814527 16.810803,56.20204 19.426566,57.589553 44.25941,57.359866 46.844814,55.922894 49.430219,54.485922 61.625078,34.154591 61.594719,31.330106 61.564358,28.505621 48.926376,8.3760634 46.310612,6.9885506 45.002731,6.294794 38.150699,6.0300774 31.293607,6.0952825 z m 0.05936,5.0525485 c 5.36199,-0.05245 10.700046,0.195704 11.722761,0.753694 2.045429,1.115978 11.936445,17.296419 11.960184,19.568154 0.02374,2.271736 -9.523004,18.6078 -11.544693,19.763557 -2.02169,1.155758 -21.429773,1.36721 -23.475201,0.251232 C 17.970585,50.368491 8.1092472,34.188049 8.085508,31.916313 8.061768,29.644577 17.578834,13.2806 19.600523,12.124842 c 1.010846,-0.577879 6.39045,-0.924567 11.75244,-0.977011 z"
|
||||
style="fill:url(#linearGradient4101);fill-opacity:1;" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3077"
|
||||
d="M 14.640198,55.682743 C 9.6971439,47.360612 2.8950957,35.733851 2.9419881,35.686959 c 0.031272,-0.03127 0.5023581,0.289334 1.0468575,0.712459 0.5444994,0.423125 1.0414462,0.769317 1.1043264,0.769317 0.06288,0 2.6329414,4.276521 5.711247,9.50338 l 5.59692,9.503379 2.159128,0.007 2.159126,0.007 -0.34365,-0.584653 C 20.186937,55.28323 17.303514,50.518786 13.968339,45.017137 10.633164,39.515488 7.9043842,34.929294 7.9043842,34.825595 c 0,-0.103699 0.2455542,-0.59277 0.545676,-1.086823 0.3001218,-0.494053 0.545676,-0.941721 0.545676,-0.994816 0,-0.05309 -0.2788317,-0.09654 -0.619626,-0.09654 -0.8505388,0 -1.0953557,-0.488405 -1.0953557,-2.185211 0,-1.90734 -0.048411,-1.868066 2.30512,-1.870072 l 1.9823345,-0.0017 1.052375,-1.721616 c 0.578806,-0.94689 1.052375,-1.785869 1.052375,-1.8644 0,-0.07853 -0.829918,-0.162484 -1.844262,-0.186561 l -1.8442631,-0.04378 4.4809551,-7.327649 4.480953,-7.32765 12.466741,-0.0399 12.466738,-0.0399 0.517892,0.854518 0.517892,0.854518 2.335995,0.04287 2.335994,0.04287 2.742626,4.521316 c 1.508447,2.486723 4.136212,6.819001 5.839482,9.627283 1.703268,2.808283 3.157599,5.105969 3.231846,5.105969 0.256907,0 0.13186,-0.393635 -0.411085,-1.294044 -0.299901,-0.497351 -0.545275,-0.935841 -0.545275,-0.974422 0,-0.03858 0.310833,-0.07015 0.69074,-0.07015 0.575204,0 0.699074,-0.05324 0.740561,-0.318272 0.03599,-0.229934 0.273254,0.06215 0.854835,1.052375 0.702767,1.196557 0.780303,1.410253 0.610448,1.682462 -0.107012,0.171499 -0.377881,0.627528 -0.601929,1.013399 l -0.407361,0.701583 0.533953,0.857491 c 0.293674,0.47162 0.535536,0.950306 0.537472,1.063747 0.0019,0.113441 -3.098537,5.322698 -6.889942,11.576127 l -6.893462,11.36987 -16.876654,0 -16.876655,0 -1.226996,-2.065773 z"
|
||||
style="fill:none;" />
|
||||
</g>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="hexchatGradient" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop id="hgYellowStop" offset="0" style="stop-color: #FFD600" />
|
||||
<stop id="hgRedStop" offset="1" style="stop-color: #FF2600" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<use xlink:href="#outline" style="opacity:0.15" transform="translate(0,2)" id="shadow" />
|
||||
<path
|
||||
style="fill:#000000; fill-opacity: 1;"
|
||||
d="M 31.71875,4.1088109 C 24.433462,4.1801109 17.123427,4.6356469 15.75,5.4213109 13.003148,6.9926379 0.06149557,29.207739 0.09374996,32.296311 0.12600597,35.384884 13.564642,57.372816 16.34375,58.890061 19.122855,60.407306 45.503149,60.148888 48.25,58.577561 50.996852,57.006233 63.938504,34.791133 63.90625,31.702561 63.87399,28.613989 50.466608,6.5948049 47.6875,5.0775609 46.297948,4.3189379 39.004037,4.0375089 31.71875,4.1088109 Z m -0.1875,9.2500001 c 3.386631,-0.03246 6.676687,0.05409 8.75,0.28125 l -8.71875,9.71875 -9.0625,-9.5 c 2.055746,-0.283043 5.521157,-0.466366 9.03125,-0.5 z m 17.34375,9.84375 c 2.298293,3.744897 4.302354,7.392556 4.3125,8.34375 0.01126,1.055883 -2.358157,5.507241 -4.875,9.6875 l -9.03125,-8.03125 z m -34.46875,0.25 8.75,9.75 -8.1875,7.875 c -2.482342,-3.992634 -4.707927,-8.110307 -4.71875,-9.125 -0.01021,-0.95736 1.927117,-4.687748 4.15625,-8.5 z m 17.15625,16.90625 9.8125,9.21875 c -4.111037,0.67314 -16.108253,0.781873 -19.46875,0.125 z"
|
||||
id="outline" />
|
||||
<path
|
||||
style="fill:url(#hexchatGradient); fill-opacity: 1;"
|
||||
d="m 31.34375,6.1713109 c -6.857093,0.06521 -13.707297,0.469014 -15,1.1875 C 13.758345,8.7957819 1.5633917,29.128076 1.5937497,31.952561 c 0.03036,2.824486 12.6654863,22.924987 15.2812503,24.3125 2.615763,1.387513 27.445846,1.186972 30.03125,-0.25 2.585405,-1.436972 14.780359,-21.769265 14.75,-24.59375 C 61.62589,28.596826 48.990764,8.4650729 46.375,7.0775609 45.067119,6.3838039 38.200842,6.1061049 31.34375,6.1713109 Z m 0.0625,5.0625001 c 5.36199,-0.05245 10.696035,0.19201 11.71875,0.75 0.06132,0.03346 0.143803,0.127745 0.21875,0.1875 l -11.28125,12.59375 -0.5,0.53125 -0.46875,-0.53125 -11.75,-12.3125 c 0.10903,-0.09884 0.228263,-0.201843 0.3125,-0.25 1.010846,-0.577879 6.38801,-0.916306 11.75,-0.96875 z m 18.0625,9.46875 c 2.883844,4.661341 5.612556,9.652893 5.625,10.84375 0.01348,1.290331 -3.064699,7.087557 -6.09375,12.09375 l -11.09375,-9.90625 -0.53125,-0.46875 0.5,-0.46875 11.59375,-12.09375 z m -35.78125,0.03125 10.84375,12.0625 0.4375,0.46875 -0.46875,0.4375 -10.28125,9.90625 c -3.04689,-4.86606 -6.0493623,-10.36778 -6.0625003,-11.625 -0.01271,-1.216102 2.6892393,-6.451996 5.5312503,-11.25 z m 17.875,17.78125 0.4375,0.4375 12.34375,11.59375 c -0.318014,0.365376 -0.587006,0.638955 -0.78125,0.75 -2.02169,1.155758 -21.423322,1.397228 -23.46875,0.28125 -0.228202,-0.124506 -0.601742,-0.47821 -1,-0.9375 l 12,-11.6875 0.46875,-0.4375 z"
|
||||
id="coloredX" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 4.4 KiB |
9
data/icons/meson.build
Normal file
@ -0,0 +1,9 @@
|
||||
icondir = join_paths(get_option('datadir'), 'icons/hicolor')
|
||||
install_data(
|
||||
'hexchat.png',
|
||||
install_dir: join_paths(icondir, '48x48/apps')
|
||||
)
|
||||
install_data(
|
||||
'hexchat.svg',
|
||||
install_dir: join_paths(icondir, 'scalable/apps')
|
||||
)
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 2.1 KiB |
@ -1,3 +0,0 @@
|
||||
man_MANS = hexchat.1
|
||||
|
||||
EXTRA_DIST = hexchat.1.in
|
10
data/man/meson.build
Normal file
@ -0,0 +1,10 @@
|
||||
man_conf = configuration_data()
|
||||
man_conf.set('VERSION', meson.project_version())
|
||||
|
||||
configure_file(
|
||||
input: 'hexchat.1.in',
|
||||
output: 'hexchat.1',
|
||||
configuration: man_conf,
|
||||
install: true,
|
||||
install_dir: join_paths(get_option('mandir'), 'man1')
|
||||
)
|
11
data/meson.build
Normal file
@ -0,0 +1,11 @@
|
||||
if get_option('with-plugin')
|
||||
subdir('pkgconfig')
|
||||
endif
|
||||
|
||||
if get_option('with-gtk')
|
||||
subdir('icons')
|
||||
subdir('misc')
|
||||
subdir('man')
|
||||
elif get_option('with-theme-manager')
|
||||
subdir('misc')
|
||||
endif
|
@ -1,29 +0,0 @@
|
||||
appdata_in_files = hexchat.appdata.xml.in
|
||||
appdata_DATA = $(appdata_in_files:.xml.in=.xml)
|
||||
appdatadir = $(datadir)/appdata
|
||||
@INTLTOOL_XML_RULE@
|
||||
|
||||
data_desktopdir = $(datadir)/applications
|
||||
data_desktop_in_files = hexchat.desktop.in
|
||||
|
||||
if WITH_TM
|
||||
data_desktop_in_files += htm.desktop.in
|
||||
mime_DATA = htm-mime.xml
|
||||
mimedir = $(datadir)/mime/packages
|
||||
endif
|
||||
|
||||
data_desktop_DATA = $(data_desktop_in_files:.desktop.in=.desktop)
|
||||
@INTLTOOL_DESKTOP_RULE@
|
||||
|
||||
UPDATE_MIME_DATABASE = update-mime-database "$(datadir)/mime" || :
|
||||
UPDATE_DESKTOP_DATABASE = update-desktop-database -q "$(datadir)/applications" || :
|
||||
|
||||
install-data-hook:
|
||||
$(UPDATE_MIME_DATABASE);
|
||||
$(UPDATE_DESKTOP_DATABASE);
|
||||
|
||||
uninstall-hook:
|
||||
$(UPDATE_MIME_DATABASE);
|
||||
$(UPDATE_DESKTOP_DATABASE);
|
||||
|
||||
CLEANFILES = $(appdata_DATA) $(data_desktop_DATA)
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<application>
|
||||
<id type="desktop">hexchat.desktop</id>
|
||||
<licence>CC0</licence>
|
||||
<description>
|
||||
<_p>HexChat is an easy to use yet extensible IRC Client. It allows you to securely join multiple networks and talk to users privately or in channels using a customizable interface. You can even transfer files.</_p>
|
||||
<_p>HexChat supports features such as: DCC, SASL, proxies, spellcheck, alerts, logging, custom themes, and Python/Perl scripts.</_p>
|
||||
</description>
|
||||
<url type="homepage">http://hexchat.github.io</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">http://i.imgur.com/XBbQKXf.png</screenshot>
|
||||
</screenshots>
|
||||
<updatecontact>tingping_at_fedoraproject.org</updatecontact>
|
||||
</application>
|
||||
|
11
data/misc/io.github.Hexchat.Plugin.metainfo.xml.in
Normal file
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="addon">
|
||||
<id>io.github.Hexchat.Plugin.@NAME@</id>
|
||||
<extends>io.github.Hexchat.desktop</extends>
|
||||
<name>@NAME@ Plugin</name>
|
||||
<summary>@SUMMARY@</summary>
|
||||
<url type="homepage">https://hexchat.github.io/</url>
|
||||
<project_license>@LICENSE@</project_license>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<update_contact>tingping_AT_fedoraproject.org</update_contact>
|
||||
</component>
|
@ -1,5 +1,5 @@
|
||||
[Desktop Entry]
|
||||
_Name=HexChat Theme Manager
|
||||
Name=HexChat Theme Manager
|
||||
Exec=thememan %f
|
||||
Icon=hexchat
|
||||
Terminal=false
|
118
data/misc/io.github.Hexchat.appdata.xml.in
Normal file
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>io.github.Hexchat.desktop</id>
|
||||
<name>HexChat</name>
|
||||
<developer_name>HexChat</developer_name>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-2.0+</project_license>
|
||||
<translation type="gettext">hexchat</translation>
|
||||
<summary>IRC Client</summary>
|
||||
<description>
|
||||
<p>HexChat is an easy to use yet extensible IRC Client. It allows you to securely join multiple networks and talk to users privately or in channels using a customizable interface. You can even transfer files.</p>
|
||||
<p>HexChat supports features such as: DCC, SASL, proxies, spellcheck, alerts, logging, custom themes, and Python/Perl scripts.</p>
|
||||
</description>
|
||||
<url type="homepage">http://hexchat.github.io</url>
|
||||
<url type="bugtracker">https://github.com/hexchat/hexchat</url>
|
||||
<url type="donation">https://goo.gl/jESZvU</url>
|
||||
<url type="help">https://hexchat.readthedocs.io/en/latest/</url>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>http://i.imgur.com/tLMguQz.png</image>
|
||||
<caption>Main Chat Window</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<provides>
|
||||
<!-- Renamed from this -->
|
||||
<id>hexchat.desktop</id>
|
||||
</provides>
|
||||
<releases>
|
||||
<release date="2019-12-20" version="2.14.3">
|
||||
<description>
|
||||
<p>This is a bug-fix release:</p>
|
||||
<ul>
|
||||
<li>Fix various incorrect parsing of IRC messages relating to trailing parameters</li>
|
||||
<li>Fix SASL negotiation combined with multi-line cap</li>
|
||||
<li>Fix input box theming with Yaru theme</li>
|
||||
<li>python: Work around Python 3.7 regression causing crash on unload</li>
|
||||
<li>sysinfo: Add support for /etc/os-release</li>
|
||||
<li>sysinfo: Ignore irrelevant mounts when calculating storage size</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release date="2018-08-29" version="2.14.2">
|
||||
<description>
|
||||
<p>This is a minor release:</p>
|
||||
<ul>
|
||||
<li>Remove shift+click to close tab binding</li>
|
||||
<li>Always unminimize when opening from tray</li>
|
||||
<li>Fix some translations containing invalid text events</li>
|
||||
<li>Fix sending server passwords starting with ":"</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release date="2018-03-13" version="2.14.1">
|
||||
<description>
|
||||
<p>This is a very minor bug-fix release:</p>
|
||||
<ul>
|
||||
<li>Fix performance regression</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release date="2018-03-10" version="2.14.0">
|
||||
<description>
|
||||
<p>This is largely a bug fix release though it has some large behind the scenes changes:</p>
|
||||
<ul>
|
||||
<li>Rename data files to use *io.github.Hexchat* name</li>
|
||||
<li>Add option (irc_reconnect_rejoin) to disable auto-rejoin on reconnect</li>
|
||||
<li>Add ability to set custom tray icon separate of app icon</li>
|
||||
<li>Fix Enchant 2.0+ support</li>
|
||||
<li>Fix input box theming with Adwaita-dark</li>
|
||||
<li>Fix custom sounds not respecting omit if away option</li>
|
||||
<li>Fix detecting if a tray doesn't exist on x11</li>
|
||||
<li>Fix cutting off ctcp text after ending \01</li>
|
||||
<li>Fix /ignore not accepting full hosts</li>
|
||||
<li>Fix characters getting cut off when their width changes</li>
|
||||
<li>Fix various possible crashes</li>
|
||||
<li>Change preference window to be scroll-able</li>
|
||||
<li>Remove ctrl+w binding by default</li>
|
||||
<li>doat: Fix channels with / in them</li>
|
||||
<li>fishlim: Fix key exchange</li>
|
||||
<li>fishlim: Fix building against LibreSSL</li>
|
||||
<li>sysinfo: Fix pci.ids file not being found on some distros</li>
|
||||
<li>sysinfo: Make libpci optional</li>
|
||||
<li>lua: Avoid loading the same script multiple times</li>
|
||||
<li>Update translations</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release date="2016-12-10" version="2.12.4">
|
||||
<description>
|
||||
<p>This is another bug fix release:</p>
|
||||
<ul>
|
||||
<li>Fix issue with timers causing ping timeouts</li>
|
||||
<li>Fix building against OpenSSL 1.1</li>
|
||||
<li>Fix /exec output printing invalid utf8</li>
|
||||
<li>Replace doat plugin with an internal command</li>
|
||||
<li>Change how tab colors interact with plugins</li>
|
||||
<li>Enable filtering the beep character by default</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
<release date="2016-10-22" version="2.12.3">
|
||||
<description>
|
||||
<p>This is a minor bug fix release just cleaning up a few issues:</p>
|
||||
<ul>
|
||||
<li>Fix crash with bad translations</li>
|
||||
<li>Add new mhop command</li>
|
||||
<li>Change ping timeout to 60 by default</li>
|
||||
</ul>
|
||||
</description>
|
||||
</release>
|
||||
</releases>
|
||||
<kudos>
|
||||
<kudo>UserDocs</kudo>
|
||||
<kudo>HiDpiIcon</kudo>
|
||||
<kudo>Notifications</kudo>
|
||||
</kudos>
|
||||
<update_contact>tingping_at_fedoraproject.org</update_contact>
|
||||
</component>
|
@ -1,18 +1,19 @@
|
||||
[Desktop Entry]
|
||||
_Name=HexChat
|
||||
_GenericName=IRC Client
|
||||
_Comment=Chat with other people online
|
||||
_Keywords=IM;Chat;
|
||||
Exec=hexchat %U
|
||||
Name=HexChat
|
||||
GenericName=IRC Client
|
||||
Comment=Chat with other people online
|
||||
Keywords=IM;Chat;
|
||||
Exec=@exec_command@
|
||||
Icon=hexchat
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=GTK;Network;IRCClient;
|
||||
StartupNotify=true
|
||||
StartupWMClass=Hexchat
|
||||
X-GNOME-UsesNotifications=true
|
||||
MimeType=x-scheme-handler/irc;x-scheme-handler/ircs;
|
||||
Actions=SafeMode;
|
||||
|
||||
[Desktop Action SafeMode]
|
||||
_Name=Open Safe Mode
|
||||
Name=Open Safe Mode
|
||||
Exec=hexchat --no-auto --no-plugins
|
127
data/misc/meson.build
Normal file
@ -0,0 +1,127 @@
|
||||
appdir = join_paths(get_option('datadir'), 'applications')
|
||||
metainfodir = join_paths(get_option('datadir'), 'metainfo')
|
||||
desktop_utils = find_program('desktop-file-validate', required: false)
|
||||
|
||||
if get_option('with-gtk')
|
||||
if get_option('with-appdata')
|
||||
hexchat_appdata = i18n.merge_file(
|
||||
input: 'io.github.Hexchat.appdata.xml.in',
|
||||
output: 'io.github.Hexchat.appdata.xml',
|
||||
po_dir: '../../po',
|
||||
install: true,
|
||||
install_dir: metainfodir
|
||||
)
|
||||
|
||||
appstream_util = find_program('appstream-util', required: false)
|
||||
if appstream_util.found()
|
||||
test('Validate io.github.Hexchat.appdata.xml', appstream_util,
|
||||
args: ['validate-relax', hexchat_appdata]
|
||||
)
|
||||
endif
|
||||
endif
|
||||
|
||||
desktop_conf = configuration_data()
|
||||
if get_option('with-dbus')
|
||||
desktop_conf.set('exec_command', 'hexchat --existing %U')
|
||||
else
|
||||
desktop_conf.set('exec_command', 'hexchat %U')
|
||||
endif
|
||||
|
||||
desktop_file = configure_file(
|
||||
input: 'io.github.Hexchat.desktop.in.in',
|
||||
output: 'io.github.Hexchat.desktop.in',
|
||||
configuration: desktop_conf
|
||||
)
|
||||
|
||||
hexchat_desktop = i18n.merge_file(
|
||||
input: desktop_file,
|
||||
output: 'io.github.Hexchat.desktop',
|
||||
po_dir: '../../po',
|
||||
type: 'desktop',
|
||||
install: true,
|
||||
install_dir: appdir
|
||||
)
|
||||
|
||||
if desktop_utils.found()
|
||||
test('Validate io.github.Hexchat.desktop', desktop_utils,
|
||||
args: [hexchat_desktop]
|
||||
)
|
||||
endif
|
||||
endif
|
||||
|
||||
if get_option('with-theme-manager')
|
||||
htm_desktop = i18n.merge_file(
|
||||
input: 'io.github.Hexchat.ThemeManager.desktop.in',
|
||||
output: 'io.github.Hexchat.ThemeManager.desktop',
|
||||
po_dir: '../../po',
|
||||
type: 'desktop',
|
||||
install: true,
|
||||
install_dir: appdir
|
||||
)
|
||||
|
||||
if desktop_utils.found()
|
||||
test('Validate io.github.Hexchat.ThemeManager.desktop', desktop_utils,
|
||||
args: [htm_desktop]
|
||||
)
|
||||
endif
|
||||
|
||||
install_data('io.github.Hexchat.ThemeManager.xml',
|
||||
install_dir: join_paths(get_option('datadir'), 'mime/packages')
|
||||
)
|
||||
endif
|
||||
|
||||
if get_option('with-plugin') and get_option('with-appdata')
|
||||
plugin_metainfo = []
|
||||
|
||||
# FIXME: These should all get translated somewhere
|
||||
if get_option('with-checksum')
|
||||
plugin_metainfo += [
|
||||
['Checksum', 'Calculates a checksum for all sent and recieved DCC files', 'MIT']
|
||||
]
|
||||
endif
|
||||
|
||||
if get_option('with-fishlim')
|
||||
plugin_metainfo += [
|
||||
['Fishlim', 'Allows setting a key for encrypted conversations', 'MIT AND GPL-2.0+']
|
||||
]
|
||||
endif
|
||||
|
||||
if get_option('with-lua') != 'false'
|
||||
plugin_metainfo += [
|
||||
['Lua', 'Provides a scripting interface in Lua', 'MIT']
|
||||
]
|
||||
endif
|
||||
|
||||
if get_option('with-perl') != 'false'
|
||||
plugin_metainfo += [
|
||||
['Perl', 'Provides a scripting interface in Perl', 'GPL-2.0+']
|
||||
]
|
||||
endif
|
||||
|
||||
if get_option('with-python') != 'false'
|
||||
plugin_metainfo += [
|
||||
['Python', 'Provides a scripting interface in Python', 'GPL-2.0+']
|
||||
]
|
||||
endif
|
||||
|
||||
if get_option('with-sysinfo')
|
||||
plugin_metainfo += [
|
||||
['Sysinfo', 'Adds command to display system information', 'GPL-2.0+']
|
||||
]
|
||||
endif
|
||||
|
||||
foreach metainfo : plugin_metainfo
|
||||
name = metainfo[0]
|
||||
conf = configuration_data()
|
||||
conf.set('NAME', name)
|
||||
conf.set('SUMMARY', metainfo[1])
|
||||
conf.set('LICENSE', metainfo[2])
|
||||
|
||||
configure_file(
|
||||
input: 'io.github.Hexchat.Plugin.metainfo.xml.in',
|
||||
output: 'io.github.Hexchat.Plugin.@0@.metainfo.xml'.format(name),
|
||||
configuration: conf,
|
||||
install_dir: get_option('install-plugin-metainfo') ? metainfodir : '',
|
||||
)
|
||||
endforeach
|
||||
endif
|
@ -1,4 +0,0 @@
|
||||
pkgcfgdir = $(pkgconfigdir)
|
||||
pkgcfg_DATA = hexchat-plugin.pc
|
||||
|
||||
EXTRA_DIST = hexchat-plugin.pc.in
|
14
data/pkgconfig/meson.build
Normal file
@ -0,0 +1,14 @@
|
||||
pkg_conf = configuration_data()
|
||||
prefix = get_option('prefix')
|
||||
pkg_conf.set('prefix', prefix)
|
||||
pkg_conf.set('VERSION', meson.project_version())
|
||||
pkg_conf.set('hexchatlibdir', join_paths('${prefix}', plugindir))
|
||||
pkg_conf.set('includedir', join_paths('${prefix}', get_option('includedir')))
|
||||
|
||||
configure_file(
|
||||
input: 'hexchat-plugin.pc.in',
|
||||
output: 'hexchat-plugin.pc',
|
||||
configuration: pkg_conf,
|
||||
install: true,
|
||||
install_dir: join_paths(get_option('libdir'), 'pkgconfig'),
|
||||
)
|
14
fedora-mingw64.ini
Normal file
@ -0,0 +1,14 @@
|
||||
; dnf install mingw64-{gtk,openssl}
|
||||
|
||||
[binaries]
|
||||
c = '/usr/bin/x86_64-w64-mingw32-gcc'
|
||||
cpp = '/usr/bin/x86_64-w64-mingw32-g++'
|
||||
ar = '/usr/bin/x86_64-w64-mingw32-gcc-ar'
|
||||
strip = '/usr/bin/x86_64-w64-mingw32-strip'
|
||||
pkgconfig = '/usr/bin/x86_64-w64-mingw32-pkg-config'
|
||||
|
||||
[host_machine]
|
||||
system = 'windows'
|
||||
cpu_family = 'x86_64'
|
||||
cpu = 'x86_64'
|
||||
endian = 'little'
|
@ -1,40 +0,0 @@
|
||||
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
|
||||
dnl
|
||||
dnl example
|
||||
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
|
||||
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
|
||||
|
||||
AC_DEFUN([AS_AC_EXPAND],
|
||||
[
|
||||
EXP_VAR=[$1]
|
||||
FROM_VAR=[$2]
|
||||
|
||||
dnl first expand prefix and exec_prefix if necessary
|
||||
prefix_save=$prefix
|
||||
exec_prefix_save=$exec_prefix
|
||||
|
||||
dnl if no prefix given, then use /usr/local, the default prefix
|
||||
if test "x$prefix" = "xNONE"; then
|
||||
prefix=$ac_default_prefix
|
||||
fi
|
||||
dnl if no exec_prefix given, then use prefix
|
||||
if test "x$exec_prefix" = "xNONE"; then
|
||||
exec_prefix=$prefix
|
||||
fi
|
||||
|
||||
full_var="$FROM_VAR"
|
||||
dnl loop until it doesn't change anymore
|
||||
while true; do
|
||||
new_full_var="`eval echo $full_var`"
|
||||
if test "x$new_full_var" = "x$full_var"; then break; fi
|
||||
full_var=$new_full_var
|
||||
done
|
||||
|
||||
dnl clean up
|
||||
full_var=$new_full_var
|
||||
AC_SUBST([$1], "$full_var")
|
||||
|
||||
dnl restore prefix and exec_prefix
|
||||
prefix=$prefix_save
|
||||
exec_prefix=$exec_prefix_save
|
||||
])
|
@ -1,8 +0,0 @@
|
||||
analysis_verbose = $(analysis_verbose_$(V))
|
||||
analysis_verbose_ = $(analysis_verbose_$(AM_DEFAULT_VERBOSITY))
|
||||
analysis_verbose_0 = @echo " CCSA " $@; $(COMPILE) --analyze $< -o $@;
|
||||
analysis_verbose_1 = $(COMPILE) --analyze $< -o $@;
|
||||
|
||||
%.plist: %.c
|
||||
$(analysis_verbose)
|
||||
|
160
meson.build
Normal file
@ -0,0 +1,160 @@
|
||||
project('hexchat', 'c',
|
||||
version: '2.14.3',
|
||||
meson_version: '>= 0.40.0',
|
||||
default_options: [
|
||||
'c_std=gnu89',
|
||||
'buildtype=debugoptimized',
|
||||
'warning_level=1',
|
||||
]
|
||||
)
|
||||
|
||||
i18n = import('i18n')
|
||||
gnome = import('gnome')
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
|
||||
libgio_dep = dependency('gio-2.0', version: '>= 2.34.0')
|
||||
libgmodule_dep = dependency('gmodule-2.0')
|
||||
global_deps = []
|
||||
if cc.get_id() == 'msvc'
|
||||
libssl_dep = cc.find_library('libeay32')
|
||||
else
|
||||
libssl_dep = dependency('openssl', version: '>= 0.9.8',
|
||||
required: get_option('with-ssl'))
|
||||
endif
|
||||
|
||||
config_h = configuration_data()
|
||||
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
|
||||
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
|
||||
config_h.set_quoted('GETTEXT_PACKAGE', 'hexchat')
|
||||
config_h.set_quoted('LOCALEDIR', join_paths(get_option('prefix'),
|
||||
get_option('datadir'), 'locale'))
|
||||
config_h.set10('ENABLE_NLS', true)
|
||||
|
||||
# Optional features
|
||||
config_h.set('USE_OPENSSL', get_option('with-ssl'))
|
||||
config_h.set('USE_LIBPROXY', get_option('with-libproxy'))
|
||||
config_h.set('USE_LIBCANBERRA', get_option('with-libcanberra'))
|
||||
config_h.set('USE_DBUS', get_option('with-dbus'))
|
||||
config_h.set('USE_PLUGIN', get_option('with-plugin'))
|
||||
|
||||
config_h.set('G_DISABLE_SINGLE_INCLUDES', true)
|
||||
config_h.set('GTK_DISABLE_DEPRECATED', true)
|
||||
config_h.set('GTK_DISABLE_SINGLE_INCLUDES', true)
|
||||
config_h.set('GDK_PIXBUF_DISABLE_SINGLE_INCLUDES', true)
|
||||
config_h.set('GLIB_VERSION_MAX_ALLOWED', 'GLIB_VERSION_2_34')
|
||||
config_h.set('GLIB_VERSION_MIN_REQUIRED', 'GLIB_VERSION_2_34')
|
||||
|
||||
# Detected features
|
||||
config_h.set('HAVE_MEMRCHR', cc.has_function('memrchr'))
|
||||
config_h.set('HAVE_STRINGS_H', cc.has_header('strings.h'))
|
||||
|
||||
if libssl_dep.found()
|
||||
config_h.set('HAVE_X509_GET_SIGNATURE_NID',
|
||||
cc.has_function('X509_get_signature_nid', dependencies: libssl_dep)
|
||||
)
|
||||
config_h.set('HAVE_SSL_CTX_GET_SSL_METHOD',
|
||||
cc.has_function('SSL_CTX_get_ssl_method', dependencies: libssl_dep)
|
||||
)
|
||||
config_h.set('HAVE_DH_SET0_PQG',
|
||||
cc.has_function('DH_set0_pqg', dependencies: libssl_dep)
|
||||
)
|
||||
config_h.set('HAVE_DH_GET0_KEY',
|
||||
cc.has_function('DH_get0_key', dependencies: libssl_dep)
|
||||
)
|
||||
config_h.set('HAVE_DH_SET0_KEY',
|
||||
cc.has_function('DH_set0_key', dependencies: libssl_dep)
|
||||
)
|
||||
config_h.set('HAVE_ERR_REMOVE_THREAD_STATE',
|
||||
cc.has_function('ERR_remove_thread_state', dependencies: libssl_dep)
|
||||
)
|
||||
config_h.set('HAVE_ASN1_STRING_GET0_DATA',
|
||||
cc.has_function('ASN1_STRING_get0_data', dependencies: libssl_dep)
|
||||
)
|
||||
endif
|
||||
|
||||
configure_file(output: 'config.h', configuration: config_h)
|
||||
config_h_include = include_directories('.')
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
add_project_arguments(
|
||||
'-DWIN32',
|
||||
'-DNTDDI_VERSION=NTDDI_WIN7',
|
||||
'-D_WIN32_WINNT=_WIN32_WINNT_WIN7',
|
||||
language: 'c')
|
||||
endif
|
||||
|
||||
|
||||
global_cflags = []
|
||||
test_cflags = [
|
||||
'-funsigned-char',
|
||||
'-Wno-conversion',
|
||||
'-Wno-pointer-sign',
|
||||
'-Wno-padded',
|
||||
'-Wno-unused-parameter',
|
||||
'-Wno-missing-prototypes',
|
||||
'-Winline',
|
||||
'-Wstrict-prototypes',
|
||||
'-Werror=implicit-function-declaration',
|
||||
'-Werror=pointer-arith',
|
||||
'-Werror=init-self',
|
||||
['-Werror=format-security', '-Werror=format=1'],
|
||||
'-Werror=missing-include-dirs',
|
||||
'-Werror=date-time',
|
||||
]
|
||||
foreach cflag : test_cflags
|
||||
if cc.has_multi_arguments(cflag)
|
||||
global_cflags += cflag
|
||||
endif
|
||||
endforeach
|
||||
if get_option('buildtype') != 'plain'
|
||||
if cc.has_argument('-fstack-protector-strong') and cc.links('''
|
||||
int main (void) {
|
||||
char buffer[16];
|
||||
strcpy(buffer, "foo");
|
||||
return 0;
|
||||
}
|
||||
''', args: '-fstack-protector-all')
|
||||
global_cflags += '-fstack-protector-strong'
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
global_deps += cc.find_library('ssp')
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
add_project_arguments(global_cflags, language: 'c')
|
||||
|
||||
|
||||
global_ldflags = []
|
||||
test_ldflags = [
|
||||
'-Wl,-z,relro',
|
||||
'-Wl,-z,now',
|
||||
# mingw
|
||||
'-Wl,--dynamicbase',
|
||||
'-Wl,--nxcompat',
|
||||
]
|
||||
foreach ldflag : test_ldflags
|
||||
if meson.version().version_compare('>= 0.46.0')
|
||||
has_arg = cc.has_link_argument(ldflag)
|
||||
else
|
||||
has_arg = cc.has_argument(ldflag)
|
||||
endif
|
||||
|
||||
if has_arg and cc.links('int main (void) { return 0; }', args: ldflag)
|
||||
global_ldflags += ldflag
|
||||
endif
|
||||
endforeach
|
||||
add_project_link_arguments(global_ldflags, language: 'c')
|
||||
|
||||
subdir('src')
|
||||
if get_option('with-plugin')
|
||||
subdir('plugins')
|
||||
endif
|
||||
if cc.get_id() != 'msvc'
|
||||
subdir('data')
|
||||
subdir('po') # FIXME: build xgettext
|
||||
|
||||
meson.add_install_script('meson_post_install.py',
|
||||
'@0@'.format(get_option('with-theme-manager'))
|
||||
)
|
||||
endif
|
68
meson_options.txt
Normal file
@ -0,0 +1,68 @@
|
||||
option('with-gtk', type: 'boolean',
|
||||
description: 'Main graphical interface'
|
||||
)
|
||||
option('with-text', type: 'boolean', value: false,
|
||||
description: 'Text interface (not generally useful)'
|
||||
)
|
||||
option('with-ssl', type: 'boolean',
|
||||
description: 'Support for TLS connections, requires openssl'
|
||||
)
|
||||
option('with-plugin', type: 'boolean',
|
||||
description: 'Support for loadable plugins'
|
||||
)
|
||||
option('with-dbus', type: 'boolean',
|
||||
description: 'Support used for single-instance and scripting interface, Unix only'
|
||||
)
|
||||
option('with-libproxy', type: 'boolean',
|
||||
description: 'Support for getting proxy information, Unix only'
|
||||
)
|
||||
option('with-libnotify', type: 'boolean',
|
||||
description: 'Support for freedesktop notifications, Unix only'
|
||||
)
|
||||
option('with-libcanberra', type: 'boolean',
|
||||
description: 'Support for sound alerts, Unix only'
|
||||
)
|
||||
option('with-theme-manager', type: 'boolean', value: false,
|
||||
description: 'Utility to help manage themes, requires mono/.net'
|
||||
)
|
||||
option('dbus-service-use-appid', type: 'boolean', value: false,
|
||||
description: 'Rename dbus service to match app-id, required for Flatpak'
|
||||
)
|
||||
option('with-appdata', type: 'boolean',
|
||||
description: 'Install appdata files for app stores'
|
||||
)
|
||||
|
||||
# Plugins
|
||||
option('with-checksum', type: 'boolean',
|
||||
description: 'DCC checksum plugin'
|
||||
)
|
||||
option('with-exec', type: 'boolean',
|
||||
description: '/exec plugin, Windows only'
|
||||
)
|
||||
option('with-fishlim', type: 'boolean',
|
||||
description: 'Fish encryption plugin, requires openssl'
|
||||
)
|
||||
option('with-lua', type: 'string', value: 'luajit',
|
||||
description: 'Lua scripting plugin, value is pkg-config name to use or "false"'
|
||||
)
|
||||
option('with-perl', type: 'string', value: 'perl',
|
||||
description: 'Perl scripting plugin, value is path to perl executable or "false"'
|
||||
)
|
||||
option('with-python', type: 'string', value: 'python3',
|
||||
description: 'Python scripting plugin. value is pkg-config name to use or "false"'
|
||||
)
|
||||
option('with-sysinfo', type: 'boolean',
|
||||
description: 'System information plugin, requires libpci on Unix'
|
||||
)
|
||||
option('with-upd', type: 'boolean',
|
||||
description: 'Update plugin, Windows only'
|
||||
)
|
||||
option('with-winamp', type: 'boolean',
|
||||
description: 'Winamp plugin, Windows only'
|
||||
)
|
||||
option('install-plugin-metainfo', type: 'boolean', value: false,
|
||||
description: 'Installs metainfo files for enabled plugins, useful when distros create split packages'
|
||||
)
|
||||
option('with-perl-legacy-api', type: 'boolean', value: false,
|
||||
description: 'Enables the legacy IRC perl module for compatibility with old scripts'
|
||||
)
|
24
meson_post_install.py
Normal file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
|
||||
datadir = os.path.join(prefix, 'share')
|
||||
with_thememan = sys.argv[1] == 'true'
|
||||
|
||||
# Packaging tools define DESTDIR and this isn't needed for them
|
||||
if 'DESTDIR' not in os.environ:
|
||||
print('Updating icon cache...')
|
||||
subprocess.call(['gtk-update-icon-cache', '-qtf',
|
||||
os.path.join(datadir, 'icons', 'hicolor')])
|
||||
|
||||
print('Updating desktop database...')
|
||||
subprocess.call(['update-desktop-database', '-q',
|
||||
os.path.join(datadir, 'applications')])
|
||||
|
||||
if with_thememan:
|
||||
print('Updating mime database...')
|
||||
subprocess.call(['update-mime-database',
|
||||
os.path.join(datadir, 'mime')])
|
@ -1,38 +0,0 @@
|
||||
# Makefile stub for creating standalone plugin distributions.
|
||||
|
||||
plugin_dist: pg_dist pg_dist/config.status
|
||||
pgi=`cd $(srcdir)/.. && pwd`; cd pg_dist; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) PLUGIN_INCLUDES=-I$$pgi distcheck dist
|
||||
|
||||
pg_dist: pg_distdir pg_dist/configure.in pg_dist/install-sh
|
||||
cd pg_dist \
|
||||
&& libtoolize --copy --force --automake \
|
||||
&& automake --copy --add-missing --foreign \
|
||||
&& autoconf -l ../$(top_srcdir)
|
||||
|
||||
pg_distdir: $(DISTFILES)
|
||||
test -d pg_dist || mkdir pg_dist
|
||||
for dfile in $(DISTFILES); do \
|
||||
test -f $$dfile && cp $$dfile pg_dist \
|
||||
|| test -f $(srcdir)/$$dfile && cp $(srcdir)/$$dfile pg_dist; done
|
||||
sed '/Make.plugin/d' < $(srcdir)/Makefile.am > pg_dist/Makefile.am
|
||||
|
||||
pg_dist/configure.in: $(srcdir)/../plugin-conf.in
|
||||
rm -f pg_dist/configure.in
|
||||
test -f $(srcdir)/config.stub \
|
||||
&& cat $(srcdir)/config.stub > pg_dist/configure.in || true
|
||||
cat $(srcdir)/../plugin-conf.in | \
|
||||
sed 's%@PLUGIN_VERSION@%$(PLUGIN_VERSION)%; \
|
||||
s%@PLUGIN@%$(PLUGIN)%' >> pg_dist/configure.in
|
||||
|
||||
pg_dist/install-sh: pg_distdir
|
||||
cp $(top_srcdir)/install-sh pg_dist
|
||||
|
||||
pg_dist/config.status: pg_dist/configure
|
||||
cd pg_dist \
|
||||
&& test -f config.status && $(SHELL) ./config.status --recheck \
|
||||
|| $(SHELL) ./configure --enable-maintainer-mode
|
||||
|
||||
DISTCLEANFILES = pg_dist/* pg_dist
|
||||
|
||||
#
|
@ -1,25 +0,0 @@
|
||||
if DO_PYTHON
|
||||
pythondir = python
|
||||
endif
|
||||
|
||||
if DO_PERL
|
||||
perldir = perl
|
||||
endif
|
||||
|
||||
if DO_DOAT
|
||||
doatdir = doat
|
||||
endif
|
||||
|
||||
if DO_FISHLIM
|
||||
fishlimdir = fishlim
|
||||
endif
|
||||
|
||||
if DO_CHECKSUM
|
||||
checksumdir = checksum
|
||||
endif
|
||||
|
||||
if DO_SYSINFO
|
||||
sysinfodir = sysinfo
|
||||
endif
|
||||
|
||||
SUBDIRS = $(pythondir) $(perldir) $(checksumdir) $(doatdir) $(fishlimdir) $(sysinfodir)
|
@ -1,7 +0,0 @@
|
||||
libdir = $(hexchatlibdir)
|
||||
|
||||
lib_LTLIBRARIES = checksum.la
|
||||
checksum_la_SOURCES = checksum.c
|
||||
checksum_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
|
||||
checksum_la_LIBADD = $(GLIB_LIBS)
|
||||
checksum_la_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)/src/common
|
@ -58,7 +58,7 @@ set_limit (char *size)
|
||||
}
|
||||
|
||||
static int
|
||||
get_limit ()
|
||||
get_limit (void)
|
||||
{
|
||||
int size = hexchat_pluginpref_get_int (ph, "limit");
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Configuration">
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
@ -19,57 +20,19 @@
|
||||
<RootNamespace>checksum</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
<PropertyGroup>
|
||||
<TargetName>hcchecksum</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>hcchecksum</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
<OutDir>$(HexChatRel)plugins\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CHECKSUM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>checksum.def</ModuleDefinitionFile>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
@ -77,19 +40,10 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;CHECKSUM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>checksum.def</ModuleDefinitionFile>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
@ -102,6 +56,4 @@
|
||||
<None Include="checksum.def" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
6
plugins/checksum/meson.build
Normal file
@ -0,0 +1,6 @@
|
||||
shared_module('checksum', 'checksum.c',
|
||||
dependencies: [libgio_dep, hexchat_plugin_dep],
|
||||
install: true,
|
||||
install_dir: plugindir,
|
||||
name_prefix: '',
|
||||
)
|
@ -1,8 +0,0 @@
|
||||
libdir = $(hexchatlibdir)
|
||||
|
||||
lib_LTLIBRARIES = doat.la
|
||||
doat_la_SOURCES = doat.c
|
||||
doat_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
|
||||
doat_la_LIBADD = $(GLIB_LIBS)
|
||||
doat_la_CFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir)/src/common
|
||||
|
@ -1,92 +0,0 @@
|
||||
/* This program is free software. It comes without any warranty, to
|
||||
* the extent permitted by applicable law. You can redistribute it
|
||||
* and/or modify it under the terms of the Do What The Fuck You Want
|
||||
* To Public License, Version 2, as published by Sam Hocevar. See
|
||||
* http://sam.zoy.org/wtfpl/COPYING or http://lwsitu.com/xchat/COPYING
|
||||
* for more details. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <glib.h>
|
||||
#include "hexchat-plugin.h"
|
||||
|
||||
static hexchat_plugin *ph;
|
||||
|
||||
static int
|
||||
parse_command( char *word[], char *word_eol[], void *userdata ) {
|
||||
char *channel = NULL, *server = NULL, *token = NULL;
|
||||
/* char *save_ptr1 = NULL;*/
|
||||
char *str1 = NULL;
|
||||
char *delimiter = NULL;
|
||||
|
||||
hexchat_context *ctx = NULL;
|
||||
|
||||
if( word[2] != NULL && word[3] != NULL ) {
|
||||
for( str1 = word[2]; ; str1 = NULL ) {
|
||||
/* token = strtok_r( str1, ",", &save_ptr1 );*/
|
||||
token = strtok( str1, "," );
|
||||
/* printf( "token: %s\n", token );*/
|
||||
|
||||
if( token == NULL ) {
|
||||
break;
|
||||
}
|
||||
|
||||
channel = g_strdup( token );
|
||||
|
||||
delimiter = strchr( channel, '/' );
|
||||
|
||||
server = NULL;
|
||||
if( delimiter != NULL ) {
|
||||
*delimiter = '\0';
|
||||
|
||||
if( strlen( delimiter + 1 ) > 0 ) {
|
||||
server = g_strdup( delimiter + 1 );
|
||||
}
|
||||
}
|
||||
|
||||
/* /Network form */
|
||||
if( strlen( channel ) == 0 ) {
|
||||
g_free( channel );
|
||||
channel = NULL;
|
||||
}
|
||||
|
||||
/* printf( "channel[%s] server[%s]\n", channel, server );*/
|
||||
|
||||
if( (ctx = hexchat_find_context( ph, server, channel ) ) != NULL ) {
|
||||
if( hexchat_set_context( ph, ctx ) ) {
|
||||
hexchat_command( ph, word_eol[3] );
|
||||
}
|
||||
}
|
||||
|
||||
g_free( channel );
|
||||
g_free( server );
|
||||
}
|
||||
}
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
}
|
||||
|
||||
int
|
||||
hexchat_plugin_init( hexchat_plugin * plugin_handle, char **plugin_name,
|
||||
char **plugin_desc, char **plugin_version, char *arg ) {
|
||||
|
||||
ph = plugin_handle;
|
||||
*plugin_name = "Do At";
|
||||
*plugin_version = "1.0001";
|
||||
*plugin_desc = "Perform an arbitrary command on multiple channels";
|
||||
|
||||
hexchat_hook_command( ph, "doat", HEXCHAT_PRI_NORM, parse_command, "DOAT [channel,list,/network] [command], perform a command on multiple contexts", NULL );
|
||||
|
||||
hexchat_print (ph, "Do At plugin loaded\n");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
hexchat_plugin_deinit (void)
|
||||
{
|
||||
hexchat_print (ph, "Do At plugin unloaded\n");
|
||||
return 1;
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
EXPORTS
|
||||
hexchat_plugin_init
|
||||
hexchat_plugin_deinit
|
@ -1,107 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Configuration">
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{4980AF24-9D42-427D-A8E6-0DF3B97C455D}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>doat</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>hcdoat</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>hcdoat</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;DOAT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>doat.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;DOAT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>doat.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="doat.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="doat.def" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Configuration">
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
@ -19,75 +20,28 @@
|
||||
<RootNamespace>exec</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
<PropertyGroup>
|
||||
<TargetName>hcexec</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>hcexec</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
<OutDir>$(HexChatRel)plugins\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;EXEC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>exec.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;EXEC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>exec.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
@ -98,6 +52,4 @@
|
||||
<ClCompile Include="exec.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
5
plugins/exec/meson.build
Normal file
@ -0,0 +1,5 @@
|
||||
shared_module('exec', 'exec.c',
|
||||
dependencies: hexchat_plugin_dep,
|
||||
install: true,
|
||||
install_dir: plugindir
|
||||
)
|
@ -1,16 +0,0 @@
|
||||
|
||||
Install dependencies (on Debian/Ubuntu):
|
||||
|
||||
sudo apt-get install build-essential libglib2.0-dev libssl-dev
|
||||
|
||||
|
||||
Build the plugin with:
|
||||
|
||||
make
|
||||
|
||||
|
||||
Install with:
|
||||
|
||||
sudo make install
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
EXTRA_DIST = INSTALL LICENSE
|
||||
|
||||
libdir = $(hexchatlibdir)
|
||||
|
||||
lib_LTLIBRARIES = fishlim.la
|
||||
fishlim_la_SOURCES = fish.c irc.c keystore.c plugin_hexchat.c
|
||||
fishlim_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
|
||||
fishlim_la_LIBADD = $(GLIB_LIBS) $(OPENSSL_LIBS)
|
||||
fishlim_la_CFLAGS = $(GLIB_CFLAGS) $(OPENSSL_CFLAGS) -I$(top_srcdir)/src/common
|
238
plugins/fishlim/dh1080.c
Normal file
@ -0,0 +1,238 @@
|
||||
/* HexChat
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* For Diffie-Hellman key-exchange a 1080bit germain prime is used, the
|
||||
* generator g=2 renders a field Fp from 1 to p-1. Therefore breaking it
|
||||
* means to solve a discrete logarithm problem with no less than 1080bit.
|
||||
*
|
||||
* Base64 format is used to send the public keys over IRC.
|
||||
*
|
||||
* The calculated secret key is hashed with SHA-256, the result is converted
|
||||
* to base64 for final use with blowfish.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "dh1080.h"
|
||||
|
||||
#include <openssl/bn.h>
|
||||
#include <openssl/dh.h>
|
||||
#include <openssl/sha.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
|
||||
#define DH1080_PRIME_BITS 1080
|
||||
#define DH1080_PRIME_BYTES 135
|
||||
#define SHA256_DIGEST_LENGTH 32
|
||||
#define B64ABC "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
|
||||
#define MEMZERO(x) memset(x, 0x00, sizeof(x))
|
||||
|
||||
/* All clients must use the same prime number to be able to keyx */
|
||||
static const guchar prime1080[DH1080_PRIME_BYTES] =
|
||||
{
|
||||
0xFB, 0xE1, 0x02, 0x2E, 0x23, 0xD2, 0x13, 0xE8, 0xAC, 0xFA, 0x9A, 0xE8, 0xB9, 0xDF, 0xAD, 0xA3, 0xEA,
|
||||
0x6B, 0x7A, 0xC7, 0xA7, 0xB7, 0xE9, 0x5A, 0xB5, 0xEB, 0x2D, 0xF8, 0x58, 0x92, 0x1F, 0xEA, 0xDE, 0x95,
|
||||
0xE6, 0xAC, 0x7B, 0xE7, 0xDE, 0x6A, 0xDB, 0xAB, 0x8A, 0x78, 0x3E, 0x7A, 0xF7, 0xA7, 0xFA, 0x6A, 0x2B,
|
||||
0x7B, 0xEB, 0x1E, 0x72, 0xEA, 0xE2, 0xB7, 0x2F, 0x9F, 0xA2, 0xBF, 0xB2, 0xA2, 0xEF, 0xBE, 0xFA, 0xC8,
|
||||
0x68, 0xBA, 0xDB, 0x3E, 0x82, 0x8F, 0xA8, 0xBA, 0xDF, 0xAD, 0xA3, 0xE4, 0xCC, 0x1B, 0xE7, 0xE8, 0xAF,
|
||||
0xE8, 0x5E, 0x96, 0x98, 0xA7, 0x83, 0xEB, 0x68, 0xFA, 0x07, 0xA7, 0x7A, 0xB6, 0xAD, 0x7B, 0xEB, 0x61,
|
||||
0x8A, 0xCF, 0x9C, 0xA2, 0x89, 0x7E, 0xB2, 0x8A, 0x61, 0x89, 0xEF, 0xA0, 0x7A, 0xB9, 0x9A, 0x8A, 0x7F,
|
||||
0xA9, 0xAE, 0x29, 0x9E, 0xFA, 0x7B, 0xA6, 0x6D, 0xEA, 0xFE, 0xFB, 0xEF, 0xBF, 0x0B, 0x7D, 0x8B
|
||||
};
|
||||
|
||||
static DH *g_dh;
|
||||
|
||||
int
|
||||
dh1080_init (void)
|
||||
{
|
||||
g_return_val_if_fail (g_dh == NULL, 0);
|
||||
|
||||
if ((g_dh = DH_new()))
|
||||
{
|
||||
int codes;
|
||||
BIGNUM *p, *g;
|
||||
|
||||
p = BN_bin2bn (prime1080, DH1080_PRIME_BYTES, NULL);
|
||||
g = BN_new ();
|
||||
|
||||
if (p == NULL || g == NULL)
|
||||
return 1;
|
||||
|
||||
BN_set_word (g, 2);
|
||||
|
||||
#ifndef HAVE_DH_SET0_PQG
|
||||
g_dh->p = p;
|
||||
g_dh->g = g;
|
||||
#else
|
||||
if (!DH_set0_pqg (g_dh, p, NULL, g))
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
if (DH_check (g_dh, &codes))
|
||||
return codes == 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
dh1080_deinit (void)
|
||||
{
|
||||
g_clear_pointer (&g_dh, DH_free);
|
||||
}
|
||||
|
||||
static inline int
|
||||
DH_verifyPubKey (BIGNUM *pk)
|
||||
{
|
||||
int codes;
|
||||
return DH_check_pub_key (g_dh, pk, &codes) && codes == 0;
|
||||
}
|
||||
|
||||
static guchar *
|
||||
dh1080_decode_b64 (const char *data, gsize *out_len)
|
||||
{
|
||||
GString *str = g_string_new (data);
|
||||
guchar *ret;
|
||||
|
||||
if (str->len % 4 == 1 && str->str[str->len - 1] == 'A')
|
||||
g_string_truncate (str, str->len - 1);
|
||||
|
||||
while (str->len % 4 != 0)
|
||||
g_string_append_c (str, '=');
|
||||
|
||||
ret = g_base64_decode_inplace (str->str, out_len);
|
||||
g_string_free (str, FALSE);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *
|
||||
dh1080_encode_b64 (const guchar *data, gsize data_len)
|
||||
{
|
||||
char *ret = g_base64_encode (data, data_len);
|
||||
char *p;
|
||||
|
||||
if (!(p = strchr (ret, '=')))
|
||||
{
|
||||
char *new_ret = g_new(char, strlen(ret) + 2);
|
||||
strcpy (new_ret, ret);
|
||||
strcat (new_ret, "A");
|
||||
g_free (ret);
|
||||
ret = new_ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
dh1080_generate_key (char **priv_key, char **pub_key)
|
||||
{
|
||||
guchar buf[DH1080_PRIME_BYTES];
|
||||
int len;
|
||||
DH *dh;
|
||||
const BIGNUM *dh_priv_key, *dh_pub_key;
|
||||
|
||||
g_assert (priv_key != NULL);
|
||||
g_assert (pub_key != NULL);
|
||||
|
||||
dh = DHparams_dup (g_dh);
|
||||
if (!dh)
|
||||
return 0;
|
||||
|
||||
if (!DH_generate_key (dh))
|
||||
{
|
||||
DH_free (dh);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef HAVE_DH_GET0_KEY
|
||||
dh_pub_key = dh->pub_key;
|
||||
dh_priv_key = dh->priv_key;
|
||||
#else
|
||||
DH_get0_key (dh, &dh_pub_key, &dh_priv_key);
|
||||
#endif
|
||||
|
||||
MEMZERO (buf);
|
||||
len = BN_bn2bin (dh_priv_key, buf);
|
||||
*priv_key = dh1080_encode_b64 (buf, len);
|
||||
|
||||
MEMZERO (buf);
|
||||
len = BN_bn2bin (dh_pub_key, buf);
|
||||
*pub_key = dh1080_encode_b64 (buf, len);
|
||||
|
||||
OPENSSL_cleanse (buf, sizeof (buf));
|
||||
DH_free (dh);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
dh1080_compute_key (const char *priv_key, const char *pub_key, char **secret_key)
|
||||
{
|
||||
char *pub_key_data;
|
||||
gsize pub_key_len;
|
||||
BIGNUM *pk;
|
||||
DH *dh;
|
||||
#ifdef HAVE_DH_SET0_KEY
|
||||
BIGNUM *temp_pub_key = BN_new();
|
||||
#endif
|
||||
|
||||
g_assert (secret_key != NULL);
|
||||
|
||||
/* Verify base64 strings */
|
||||
if (strspn (priv_key, B64ABC) != strlen (priv_key)
|
||||
|| strspn (pub_key, B64ABC) != strlen (pub_key))
|
||||
return 0;
|
||||
|
||||
dh = DHparams_dup (g_dh);
|
||||
|
||||
pub_key_data = dh1080_decode_b64 (pub_key, &pub_key_len);
|
||||
pk = BN_bin2bn (pub_key_data, pub_key_len, NULL);
|
||||
|
||||
if (DH_verifyPubKey (pk))
|
||||
{
|
||||
guchar shared_key[DH1080_PRIME_BYTES] = { 0 };
|
||||
guchar sha256[SHA256_DIGEST_LENGTH] = { 0 };
|
||||
char *priv_key_data;
|
||||
gsize priv_key_len;
|
||||
int shared_len;
|
||||
BIGNUM *priv_key_num;
|
||||
|
||||
priv_key_data = dh1080_decode_b64 (priv_key, &priv_key_len);
|
||||
priv_key_num = BN_bin2bn(priv_key_data, priv_key_len, NULL);
|
||||
#ifndef HAVE_DH_SET0_KEY
|
||||
dh->priv_key = priv_key_num;
|
||||
#else
|
||||
DH_set0_key (dh, temp_pub_key, priv_key_num);
|
||||
#endif
|
||||
|
||||
shared_len = DH_compute_key (shared_key, pk, dh);
|
||||
SHA256(shared_key, shared_len, sha256);
|
||||
*secret_key = dh1080_encode_b64 (sha256, sizeof(sha256));
|
||||
|
||||
OPENSSL_cleanse (priv_key_data, priv_key_len);
|
||||
g_free (priv_key_data);
|
||||
}
|
||||
|
||||
BN_free (pk);
|
||||
DH_free (dh);
|
||||
g_free (pub_key_data);
|
||||
return 1;
|
||||
}
|
24
plugins/fishlim/dh1080.h
Normal file
@ -0,0 +1,24 @@
|
||||
/* HexChat
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
int dh1080_generate_key (char **, char **);
|
||||
int dh1080_compute_key (const char *, const char *, char **);
|
||||
int dh1080_init (void);
|
||||
void dh1080_deinit (void);
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Configuration">
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
@ -19,57 +20,19 @@
|
||||
<RootNamespace>fishlim</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
<PropertyGroup>
|
||||
<TargetName>hcfishlim</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>hcfishlim</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
<OutDir>$(HexChatRel)plugins\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;FISHLIM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>fishlim.def</ModuleDefinitionFile>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
@ -77,19 +40,10 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;FISHLIM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>fishlim.def</ModuleDefinitionFile>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
@ -99,19 +53,18 @@
|
||||
<None Include="fishlim.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="bool.h" />
|
||||
<ClInclude Include="dh1080.h" />
|
||||
<ClInclude Include="fish.h" />
|
||||
<ClInclude Include="irc.h" />
|
||||
<ClInclude Include="keystore.h" />
|
||||
<ClInclude Include="plugin_hexchat.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dh1080.c" />
|
||||
<ClCompile Include="fish.c" />
|
||||
<ClCompile Include="irc.c" />
|
||||
<ClCompile Include="keystore.c" />
|
||||
<ClCompile Include="plugin_hexchat.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
@ -50,7 +50,9 @@ gboolean irc_parse_message(const char *words[],
|
||||
if (command) *command = words[w];
|
||||
w++;
|
||||
|
||||
*parameters_offset = w;
|
||||
if (parameters_offset)
|
||||
*parameters_offset = w;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ static char *keystore_password = NULL;
|
||||
/**
|
||||
* Opens the key store file: ~/.config/hexchat/addon_fishlim.conf
|
||||
*/
|
||||
static GKeyFile *getConfigFile() {
|
||||
static GKeyFile *getConfigFile(void) {
|
||||
gchar *filename = get_config_filename();
|
||||
|
||||
GKeyFile *keyfile = g_key_file_new();
|
||||
@ -55,7 +55,7 @@ static GKeyFile *getConfigFile() {
|
||||
/**
|
||||
* Returns the key store password, or the default.
|
||||
*/
|
||||
static const char *get_keystore_password() {
|
||||
static const char *get_keystore_password(void) {
|
||||
return (keystore_password != NULL ?
|
||||
keystore_password :
|
||||
/* Silly default value... */
|
||||
@ -63,6 +63,22 @@ static const char *get_keystore_password() {
|
||||
}
|
||||
|
||||
|
||||
static char *escape_nickname(const char *nick) {
|
||||
char *escaped = g_strdup(nick);
|
||||
char *p = escaped;
|
||||
|
||||
while (*p) {
|
||||
if (*p == '[')
|
||||
*p = '~';
|
||||
else if (*p == ']')
|
||||
*p = '!';
|
||||
|
||||
++p;
|
||||
}
|
||||
|
||||
return escaped;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a value for a nick/channel from addon_fishlim.conf. Unlike
|
||||
* g_key_file_get_string, this function is case insensitive.
|
||||
@ -90,9 +106,13 @@ static gchar *get_nick_value(GKeyFile *keyfile, const char *nick, const char *it
|
||||
char *keystore_get_key(const char *nick) {
|
||||
/* Get the key */
|
||||
GKeyFile *keyfile = getConfigFile();
|
||||
gchar *value = get_nick_value(keyfile, nick, "key");
|
||||
char *escaped_nick = escape_nickname(nick);
|
||||
gchar *value = get_nick_value(keyfile, escaped_nick, "key");
|
||||
g_key_file_free(keyfile);
|
||||
if (!value) return NULL;
|
||||
g_free(escaped_nick);
|
||||
|
||||
if (!value)
|
||||
return NULL;
|
||||
|
||||
if (strncmp(value, "+OK ", 4) != 0) {
|
||||
/* Key is stored in plaintext */
|
||||
@ -157,7 +177,9 @@ static gboolean save_keystore(GKeyFile *keyfile) {
|
||||
#if !GLIB_CHECK_VERSION(2,40,0)
|
||||
ok = keyfile_save_to_file (keyfile, filename);
|
||||
#else
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS /* Hide false positive */
|
||||
ok = g_key_file_save_to_file (keyfile, filename, NULL);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
#endif
|
||||
g_free (filename);
|
||||
|
||||
@ -173,9 +195,10 @@ gboolean keystore_store_key(const char *nick, const char *key) {
|
||||
char *wrapped;
|
||||
gboolean ok = FALSE;
|
||||
GKeyFile *keyfile = getConfigFile();
|
||||
|
||||
char *escaped_nick = escape_nickname(nick);
|
||||
|
||||
/* Remove old key */
|
||||
delete_nick(keyfile, nick);
|
||||
delete_nick(keyfile, escaped_nick);
|
||||
|
||||
/* Add new key */
|
||||
password = get_keystore_password();
|
||||
@ -189,11 +212,11 @@ gboolean keystore_store_key(const char *nick, const char *key) {
|
||||
g_free(encrypted);
|
||||
|
||||
/* Store encrypted in file */
|
||||
g_key_file_set_string(keyfile, nick, "key", wrapped);
|
||||
g_key_file_set_string(keyfile, escaped_nick, "key", wrapped);
|
||||
g_free(wrapped);
|
||||
} else {
|
||||
/* Store unencrypted in file */
|
||||
g_key_file_set_string(keyfile, nick, "key", key);
|
||||
g_key_file_set_string(keyfile, escaped_nick, "key", key);
|
||||
}
|
||||
|
||||
/* Save key store file */
|
||||
@ -201,6 +224,7 @@ gboolean keystore_store_key(const char *nick, const char *key) {
|
||||
|
||||
end:
|
||||
g_key_file_free(keyfile);
|
||||
g_free(escaped_nick);
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -209,13 +233,15 @@ gboolean keystore_store_key(const char *nick, const char *key) {
|
||||
*/
|
||||
gboolean keystore_delete_nick(const char *nick) {
|
||||
GKeyFile *keyfile = getConfigFile();
|
||||
char *escaped_nick = escape_nickname(nick);
|
||||
|
||||
/* Delete entry */
|
||||
gboolean ok = delete_nick(keyfile, nick);
|
||||
gboolean ok = delete_nick(keyfile, escaped_nick);
|
||||
|
||||
/* Save */
|
||||
if (ok) save_keystore(keyfile);
|
||||
|
||||
g_key_file_free(keyfile);
|
||||
g_free(escaped_nick);
|
||||
return ok;
|
||||
}
|
||||
|
18
plugins/fishlim/meson.build
Normal file
@ -0,0 +1,18 @@
|
||||
if not libssl_dep.found()
|
||||
error('fish plugin requires openssl')
|
||||
endif
|
||||
|
||||
fishlim_sources = [
|
||||
'dh1080.c',
|
||||
'fish.c',
|
||||
'irc.c',
|
||||
'keystore.c',
|
||||
'plugin_hexchat.c'
|
||||
]
|
||||
|
||||
shared_module('fishlim', fishlim_sources,
|
||||
dependencies: [libgio_dep, hexchat_plugin_dep, libssl_dep],
|
||||
install: true,
|
||||
install_dir: plugindir,
|
||||
name_prefix: '',
|
||||
)
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
|
||||
Copyright (c) 2010-2011 Samuel Lidén Borell <samuel@kodafritt.se>
|
||||
Copyright (c) 2015 <the.cypher@gmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -32,23 +33,30 @@
|
||||
#define HEXCHAT_MAX_WORDS 32
|
||||
|
||||
#include "fish.h"
|
||||
#include "dh1080.h"
|
||||
#include "keystore.h"
|
||||
#include "irc.h"
|
||||
|
||||
static const char plugin_name[] = "FiSHLiM";
|
||||
static const char plugin_desc[] = "Encryption plugin for the FiSH protocol. Less is More!";
|
||||
static const char plugin_version[] = "0.0.17";
|
||||
static const char plugin_version[] = "0.1.0";
|
||||
|
||||
static const char usage_setkey[] = "Usage: SETKEY [<nick or #channel>] <password>, sets the key for a channel or nick";
|
||||
static const char usage_delkey[] = "Usage: DELKEY <nick or #channel>, deletes the key for a channel or nick";
|
||||
static const char usage_keyx[] = "Usage: KEYX [<nick>], performs DH1080 key-exchange with <nick>";
|
||||
static const char usage_topic[] = "Usage: TOPIC+ <topic>, sets a new encrypted topic for the current channel";
|
||||
static const char usage_notice[] = "Usage: NOTICE+ <nick or #channel> <notice>";
|
||||
static const char usage_msg[] = "Usage: MSG+ <nick or #channel> <message>";
|
||||
|
||||
|
||||
static hexchat_plugin *ph;
|
||||
static GHashTable *pending_exchanges;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the path to the key store file.
|
||||
*/
|
||||
gchar *get_config_filename() {
|
||||
gchar *get_config_filename(void) {
|
||||
char *filename_fs, *filename_utf8;
|
||||
|
||||
filename_utf8 = g_build_filename(hexchat_get_info(ph, "configdir"), "addon_fishlim.conf", NULL);
|
||||
@ -58,6 +66,38 @@ gchar *get_config_filename() {
|
||||
return filename_fs;
|
||||
}
|
||||
|
||||
static inline gboolean irc_is_query (const char *name) {
|
||||
const char *chantypes = hexchat_list_str (ph, NULL, "chantypes");
|
||||
|
||||
return strchr (chantypes, name[0]) == NULL;
|
||||
}
|
||||
|
||||
static hexchat_context *find_context_on_network (const char *name) {
|
||||
hexchat_list *channels;
|
||||
hexchat_context *ret = NULL;
|
||||
int id;
|
||||
|
||||
if (hexchat_get_prefs(ph, "id", NULL, &id) != 2)
|
||||
return NULL;
|
||||
|
||||
channels = hexchat_list_get(ph, "channels");
|
||||
if (!channels)
|
||||
return NULL;
|
||||
|
||||
while (hexchat_list_next(ph, channels)) {
|
||||
int chan_id = hexchat_list_int(ph, channels, "id");
|
||||
const char *chan_name = hexchat_list_str(ph, channels, "channel");
|
||||
|
||||
if (chan_id == id && chan_name && hexchat_nickcmp (ph, chan_name, name) == 0) {
|
||||
ret = (hexchat_context*)hexchat_list_str(ph, channels, "context");
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
hexchat_list_free(ph, channels);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int irc_nick_cmp(const char *a, const char *b) {
|
||||
return hexchat_nickcmp (ph, a, b);
|
||||
}
|
||||
@ -163,11 +203,11 @@ static int handle_incoming(char *word[], char *word_eol[], hexchat_event_attrs *
|
||||
/* Prefix with colon, which gets stripped out otherwise */
|
||||
g_string_append_c (message, ':');
|
||||
}
|
||||
|
||||
|
||||
if (prefix_char) {
|
||||
g_string_append_c (message, prefix_char);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
/* Add unencrypted data (for example, a prefix from a bouncer or bot) */
|
||||
peice = word[uw];
|
||||
@ -176,7 +216,7 @@ static int handle_incoming(char *word[], char *word_eol[], hexchat_event_attrs *
|
||||
g_string_append (message, peice);
|
||||
}
|
||||
g_free(decrypted);
|
||||
|
||||
|
||||
/* Simulate unencrypted message */
|
||||
/* hexchat_printf(ph, "simulating: %s\n", message->str); */
|
||||
hexchat_command(ph, message->str);
|
||||
@ -184,26 +224,103 @@ static int handle_incoming(char *word[], char *word_eol[], hexchat_event_attrs *
|
||||
g_string_free (message, TRUE);
|
||||
g_free(sender_nick);
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
|
||||
|
||||
decrypt_error:
|
||||
g_free(decrypted);
|
||||
g_free(sender_nick);
|
||||
return HEXCHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
static int handle_keyx_notice(char *word[], char *word_eol[], void *userdata) {
|
||||
const char *dh_message = word[4];
|
||||
const char *dh_pubkey = word[5];
|
||||
hexchat_context *query_ctx;
|
||||
const char *prefix;
|
||||
gboolean cbc;
|
||||
char *sender, *secret_key, *priv_key = NULL;
|
||||
|
||||
if (!*dh_message || !*dh_pubkey || strlen(dh_pubkey) != 181)
|
||||
return HEXCHAT_EAT_NONE;
|
||||
|
||||
if (!irc_parse_message((const char**)word, &prefix, NULL, NULL) || !prefix)
|
||||
return HEXCHAT_EAT_NONE;
|
||||
|
||||
sender = irc_prefix_get_nick(prefix);
|
||||
query_ctx = find_context_on_network(sender);
|
||||
if (query_ctx)
|
||||
hexchat_set_context(ph, query_ctx);
|
||||
|
||||
dh_message++; /* : prefix */
|
||||
if (*dh_message == '+' || *dh_message == '-')
|
||||
dh_message++; /* identify-msg */
|
||||
|
||||
cbc = g_strcmp0 (word[6], "CBC") == 0;
|
||||
|
||||
if (!strcmp(dh_message, "DH1080_INIT")) {
|
||||
char *pub_key;
|
||||
|
||||
if (cbc) {
|
||||
hexchat_print(ph, "Received key exchange for CBC mode which is not supported.");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
hexchat_printf(ph, "Received public key from %s, sending mine...", sender);
|
||||
if (dh1080_generate_key(&priv_key, &pub_key)) {
|
||||
hexchat_commandf(ph, "quote NOTICE %s :DH1080_FINISH %s", sender, pub_key);
|
||||
g_free(pub_key);
|
||||
} else {
|
||||
hexchat_print(ph, "Failed to generate keys");
|
||||
goto cleanup;
|
||||
}
|
||||
} else if (!strcmp (dh_message, "DH1080_FINISH")) {
|
||||
char *sender_lower = g_ascii_strdown(sender, -1);
|
||||
/* FIXME: Properly respect irc casing */
|
||||
priv_key = g_hash_table_lookup(pending_exchanges, sender_lower);
|
||||
g_hash_table_steal(pending_exchanges, sender_lower);
|
||||
g_free(sender_lower);
|
||||
|
||||
if (cbc) {
|
||||
hexchat_print(ph, "Received key exchange for CBC mode which is not supported.");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!priv_key) {
|
||||
hexchat_printf(ph, "Received a key exchange response for unknown user: %s", sender);
|
||||
goto cleanup;
|
||||
}
|
||||
} else {
|
||||
/* Regular notice */
|
||||
g_free(sender);
|
||||
return HEXCHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
if (dh1080_compute_key(priv_key, dh_pubkey, &secret_key)) {
|
||||
keystore_store_key(sender, secret_key);
|
||||
hexchat_printf(ph, "Stored new key for %s", sender);
|
||||
g_free(secret_key);
|
||||
} else {
|
||||
hexchat_print(ph, "Failed to create secret key!");
|
||||
}
|
||||
|
||||
cleanup:
|
||||
g_free(sender);
|
||||
g_free(priv_key);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Command handler for /setkey
|
||||
*/
|
||||
static int handle_setkey(char *word[], char *word_eol[], void *userdata) {
|
||||
const char *nick;
|
||||
const char *key;
|
||||
|
||||
|
||||
/* Check syntax */
|
||||
if (*word[2] == '\0') {
|
||||
hexchat_printf(ph, "%s\n", usage_setkey);
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
}
|
||||
|
||||
|
||||
if (*word[3] == '\0') {
|
||||
/* /setkey password */
|
||||
nick = hexchat_get_info(ph, "channel");
|
||||
@ -213,14 +330,14 @@ static int handle_setkey(char *word[], char *word_eol[], void *userdata) {
|
||||
nick = word[2];
|
||||
key = word_eol[3];
|
||||
}
|
||||
|
||||
|
||||
/* Set password */
|
||||
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");
|
||||
}
|
||||
|
||||
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
}
|
||||
|
||||
@ -229,25 +346,174 @@ static int handle_setkey(char *word[], char *word_eol[], void *userdata) {
|
||||
*/
|
||||
static int handle_delkey(char *word[], char *word_eol[], void *userdata) {
|
||||
const char *nick;
|
||||
|
||||
|
||||
/* Check syntax */
|
||||
if (*word[2] == '\0' || *word[3] != '\0') {
|
||||
hexchat_printf(ph, "%s\n", usage_delkey);
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
}
|
||||
|
||||
|
||||
nick = g_strstrip (word_eol[2]);
|
||||
|
||||
|
||||
/* Delete the given nick from the key store */
|
||||
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");
|
||||
}
|
||||
|
||||
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
}
|
||||
|
||||
static int handle_keyx(char *word[], char *word_eol[], void *userdata) {
|
||||
const char *target = word[2];
|
||||
hexchat_context *query_ctx = NULL;
|
||||
char *pub_key, *priv_key;
|
||||
int ctx_type;
|
||||
|
||||
if (*target)
|
||||
query_ctx = find_context_on_network(target);
|
||||
else {
|
||||
target = hexchat_get_info(ph, "channel");
|
||||
query_ctx = hexchat_get_context (ph);
|
||||
}
|
||||
|
||||
if (query_ctx) {
|
||||
hexchat_set_context(ph, query_ctx);
|
||||
ctx_type = hexchat_list_int(ph, NULL, "type");
|
||||
}
|
||||
|
||||
if ((query_ctx && ctx_type != 3) || (!query_ctx && !irc_is_query(target))) {
|
||||
hexchat_print(ph, "You can only exchange keys with individuals");
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
if (dh1080_generate_key(&priv_key, &pub_key)) {
|
||||
g_hash_table_replace (pending_exchanges, g_ascii_strdown(target, -1), priv_key);
|
||||
|
||||
hexchat_commandf(ph, "quote NOTICE %s :DH1080_INIT %s", target, pub_key);
|
||||
hexchat_printf(ph, "Sent public key to %s, waiting for reply...", target);
|
||||
|
||||
g_free(pub_key);
|
||||
} else {
|
||||
hexchat_print(ph, "Failed to generate keys");
|
||||
}
|
||||
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Command handler for /topic+
|
||||
*/
|
||||
static int handle_crypt_topic(char *word[], char *word_eol[], void *userdata) {
|
||||
const char *target;
|
||||
const char *topic = word_eol[2];
|
||||
char *buf;
|
||||
|
||||
if (!*topic) {
|
||||
hexchat_print(ph, usage_topic);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
if (hexchat_list_int(ph, NULL, "type") != 2) {
|
||||
hexchat_printf(ph, "Please change to the channel window where you want to set the topic!");
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
target = hexchat_get_info(ph, "channel");
|
||||
buf = fish_encrypt_for_nick(target, topic);
|
||||
if (buf == NULL) {
|
||||
hexchat_printf(ph, "/topic+ error, no key found for %s", target);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
hexchat_commandf(ph, "TOPIC %s +OK %s", target, buf);
|
||||
g_free(buf);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Command handler for /notice+
|
||||
*/
|
||||
static int handle_crypt_notice(char *word[], char *word_eol[], void *userdata)
|
||||
{
|
||||
const char *target = word[2];
|
||||
const char *notice = word_eol[3];
|
||||
char *buf;
|
||||
|
||||
if (!*target || !*notice) {
|
||||
hexchat_print(ph, usage_notice);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
buf = fish_encrypt_for_nick(target, notice);
|
||||
if (buf == NULL) {
|
||||
hexchat_printf(ph, "/notice+ error, no key found for %s.", target);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
hexchat_commandf(ph, "quote NOTICE %s :+OK %s", target, buf);
|
||||
hexchat_emit_print(ph, "Notice Sent", target, notice);
|
||||
g_free(buf);
|
||||
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Command handler for /msg+
|
||||
*/
|
||||
static int handle_crypt_msg(char *word[], char *word_eol[], void *userdata)
|
||||
{
|
||||
const char *target = word[2];
|
||||
const char *message = word_eol[3];
|
||||
hexchat_context *query_ctx;
|
||||
char *buf;
|
||||
|
||||
if (!*target || !*message) {
|
||||
hexchat_print(ph, usage_msg);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
buf = fish_encrypt_for_nick(target, message);
|
||||
if (buf == NULL) {
|
||||
hexchat_printf(ph, "/msg+ error, no key found for %s", target);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
hexchat_commandf(ph, "PRIVMSG %s :+OK %s", target, buf);
|
||||
|
||||
query_ctx = find_context_on_network(target);
|
||||
if (query_ctx) {
|
||||
hexchat_set_context(ph, query_ctx);
|
||||
|
||||
/* FIXME: Mode char */
|
||||
hexchat_emit_print(ph, "Your Message", hexchat_get_info(ph, "nick"),
|
||||
message, "", "");
|
||||
}
|
||||
else {
|
||||
hexchat_emit_print(ph, "Message Send", target, message);
|
||||
}
|
||||
|
||||
g_free(buf);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
static int handle_crypt_me(char *word[], char *word_eol[], void *userdata) {
|
||||
const char *channel = hexchat_get_info(ph, "channel");
|
||||
char *buf;
|
||||
|
||||
buf = fish_encrypt_for_nick(channel, word_eol[2]);
|
||||
if (!buf)
|
||||
return HEXCHAT_EAT_NONE;
|
||||
|
||||
hexchat_commandf(ph, "PRIVMSG %s :\001ACTION +OK %s \001", channel, buf);
|
||||
hexchat_emit_print(ph, "Your Action", hexchat_get_info(ph, "nick"),
|
||||
word_eol[2], NULL);
|
||||
|
||||
g_free(buf);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the plugin name version information.
|
||||
*/
|
||||
@ -267,30 +533,44 @@ int hexchat_plugin_init(hexchat_plugin *plugin_handle,
|
||||
const char **version,
|
||||
char *arg) {
|
||||
ph = plugin_handle;
|
||||
|
||||
|
||||
/* Send our info to HexChat */
|
||||
*name = plugin_name;
|
||||
*desc = plugin_desc;
|
||||
*version = plugin_version;
|
||||
|
||||
|
||||
/* Register commands */
|
||||
hexchat_hook_command(ph, "SETKEY", HEXCHAT_PRI_NORM, handle_setkey, usage_setkey, NULL);
|
||||
hexchat_hook_command(ph, "DELKEY", HEXCHAT_PRI_NORM, handle_delkey, usage_delkey, NULL);
|
||||
|
||||
hexchat_hook_command(ph, "KEYX", HEXCHAT_PRI_NORM, handle_keyx, usage_keyx, NULL);
|
||||
hexchat_hook_command(ph, "TOPIC+", HEXCHAT_PRI_NORM, handle_crypt_topic, usage_topic, NULL);
|
||||
hexchat_hook_command(ph, "NOTICE+", HEXCHAT_PRI_NORM, handle_crypt_notice, usage_notice, NULL);
|
||||
hexchat_hook_command(ph, "MSG+", HEXCHAT_PRI_NORM, handle_crypt_msg, usage_msg, NULL);
|
||||
hexchat_hook_command(ph, "ME", HEXCHAT_PRI_NORM, handle_crypt_me, NULL, NULL);
|
||||
|
||||
/* Add handlers */
|
||||
hexchat_hook_command(ph, "", HEXCHAT_PRI_NORM, handle_outgoing, NULL, NULL);
|
||||
hexchat_hook_server(ph, "NOTICE", HEXCHAT_PRI_HIGHEST, handle_keyx_notice, NULL);
|
||||
hexchat_hook_server_attrs(ph, "NOTICE", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
||||
hexchat_hook_server_attrs(ph, "PRIVMSG", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
||||
/* hexchat_hook_server(ph, "RAW LINE", HEXCHAT_PRI_NORM, handle_debug, NULL); */
|
||||
hexchat_hook_server_attrs(ph, "TOPIC", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
||||
hexchat_hook_server_attrs(ph, "332", HEXCHAT_PRI_NORM, handle_incoming, NULL);
|
||||
|
||||
|
||||
if (!dh1080_init())
|
||||
return 0;
|
||||
|
||||
pending_exchanges = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
|
||||
|
||||
hexchat_printf(ph, "%s plugin loaded\n", plugin_name);
|
||||
/* Return success */
|
||||
return 1;
|
||||
}
|
||||
|
||||
int hexchat_plugin_deinit(void) {
|
||||
g_clear_pointer(&pending_exchanges, g_hash_table_destroy);
|
||||
dh1080_deinit();
|
||||
|
||||
hexchat_printf(ph, "%s plugin unloaded\n", plugin_name);
|
||||
return 1;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
#ifndef PLUGIN_HEXCHAT_H
|
||||
#define PLUGIN_HEXCHAT_H
|
||||
|
||||
gchar *get_config_filename();
|
||||
gchar *get_config_filename(void);
|
||||
int irc_nick_cmp (const char *, const char *);
|
||||
|
||||
#endif
|
||||
|
@ -1,94 +0,0 @@
|
||||
/*
|
||||
|
||||
Copyright (c) 2010 Samuel Lidén Borell <samuel@kodafritt.se>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "fish.h"
|
||||
|
||||
// We can't use the HexChat plugin API from here...
|
||||
gchar *get_config_filename() {
|
||||
const gchar *homedir = g_get_home_dir();
|
||||
return g_build_filename(homedir, ".config", "hexchat", "blow.ini", NULL);
|
||||
}
|
||||
|
||||
|
||||
static int decrypt(int nick_count, char *nicks[]) {
|
||||
char encrypted[8192];
|
||||
while (fgets(encrypted, sizeof(encrypted), stdin)) {
|
||||
char *msg;
|
||||
for (int i = 0; i < nick_count; i++) {
|
||||
msg = fish_decrypt_from_nick(nicks[i], encrypted);
|
||||
if (msg) goto success;
|
||||
}
|
||||
fprintf(stderr, "None of the recipients were found in the key store!\n");
|
||||
return 1;
|
||||
success:
|
||||
fprintf(stderr, "Decrypted text >>>%s<<<\n", msg);
|
||||
g_free(msg);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int encrypt(int nick_count, char *nicks[]) {
|
||||
char message[8192];
|
||||
while (fgets(message, sizeof(message), stdin)) {
|
||||
// Remove newline character
|
||||
char *newline = strchr(message, '\n');
|
||||
if (newline) *newline = '\0';
|
||||
|
||||
bool error = false;
|
||||
for (int i = 0; i < nick_count; i++) {
|
||||
char *encrypted = fish_encrypt_for_nick(nicks[i], message);
|
||||
if (encrypted) {
|
||||
fprintf(stderr, "Encrypted [%s]: >>>%s<<<\n", nicks[i], encrypted);
|
||||
g_free(encrypted);
|
||||
} else {
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (error) {
|
||||
fprintf(stderr, "Some of the recipients were't found in the key store!\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "usage: %s [-e] nick...\n", argv[0]);
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "-e") == 0) {
|
||||
return encrypt(argc-2, &argv[2]);
|
||||
} else {
|
||||
return decrypt(argc-1, &argv[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
1765
plugins/lua/lua.c
Normal file
54
plugins/lua/lua.vcxproj
Normal file
@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Configuration">
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{4C0F3940-2EEE-4646-82F7-6CE75B9A72F4}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>lua</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
<PropertyGroup>
|
||||
<TargetName>$(LuaOutput)</TargetName>
|
||||
<OutDir>$(HexChatRel)plugins\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(Glib);$(LuaInclude);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>"$(LuaLib).lib";$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(Glib);$(LuaInclude);..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>"$(LuaLib).lib";$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lua.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
14
plugins/lua/lua.vcxproj.filters
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{f4eaf231-f095-42d3-8427-b2b6006cacb1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{0166c0f9-7968-4a09-9ef5-a5179c7746eb}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="lua.c" />
|
||||
</ItemGroup>
|
||||
</Project>
|
12
plugins/lua/meson.build
Normal file
@ -0,0 +1,12 @@
|
||||
if cc.get_id() == 'msvc'
|
||||
lua_dep = cc.find_library('lua51')
|
||||
else
|
||||
lua_dep = dependency(get_option('with-lua'))
|
||||
endif
|
||||
|
||||
shared_module('lua', 'lua.c',
|
||||
dependencies: [libgio_dep, hexchat_plugin_dep, lua_dep],
|
||||
install: true,
|
||||
install_dir: plugindir,
|
||||
name_prefix: '',
|
||||
)
|
39
plugins/meson.build
Normal file
@ -0,0 +1,39 @@
|
||||
plugindir = join_paths(get_option('libdir'), 'hexchat/plugins')
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
if get_option('with-exec')
|
||||
subdir('exec')
|
||||
endif
|
||||
|
||||
if get_option('with-upd')
|
||||
subdir('upd')
|
||||
endif
|
||||
|
||||
if get_option('with-winamp')
|
||||
subdir('winamp')
|
||||
endif
|
||||
endif
|
||||
|
||||
if get_option('with-checksum')
|
||||
subdir('checksum')
|
||||
endif
|
||||
|
||||
if get_option('with-fishlim')
|
||||
subdir('fishlim')
|
||||
endif
|
||||
|
||||
if get_option('with-lua') != 'false'
|
||||
subdir('lua')
|
||||
endif
|
||||
|
||||
if get_option('with-perl') != 'false'
|
||||
subdir('perl')
|
||||
endif
|
||||
|
||||
if get_option('with-python') != 'false'
|
||||
subdir('python')
|
||||
endif
|
||||
|
||||
if get_option('with-sysinfo')
|
||||
subdir('sysinfo')
|
||||
endif
|
@ -1,156 +0,0 @@
|
||||
/*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
char *split(char *text, char separator)
|
||||
{
|
||||
int pos = -1;
|
||||
size_t i;
|
||||
for (i = 0; i < strlen(text); i++)
|
||||
{
|
||||
if (text[i] == separator) {
|
||||
pos = i;
|
||||
i = strlen(text) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (pos == -1)
|
||||
{
|
||||
return text;
|
||||
}
|
||||
|
||||
text[pos] = 0;
|
||||
return &(text[pos + 1]);
|
||||
}
|
||||
|
||||
int endsWith(char *text, char *suffix){
|
||||
char *tmp=strstr(text,suffix);
|
||||
if (tmp==NULL) return 0;
|
||||
if (strlen(tmp)==strlen(suffix)) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int inStr(char *s1, size_t sl1, char *s2)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < sl1 - strlen(s2); i++)
|
||||
{
|
||||
size_t j;
|
||||
for (j = 0; j < strlen(s2); j++)
|
||||
{
|
||||
if (s1[i + j] != s2[j])
|
||||
{
|
||||
j = strlen(s2) + 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (j == strlen(s2))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static char *subString(char *text, int first, int length, int spcKill){
|
||||
//if (DEBUG==1) putlog("creating substring");
|
||||
char *ret = g_new (char, length + 1);
|
||||
int i;
|
||||
ret[length]=0;
|
||||
for (i=0;i<length;i++){
|
||||
ret[i]=text[i+first];
|
||||
//if (ret[i]==0) ret[i]='0';
|
||||
}
|
||||
if (spcKill==1){
|
||||
for (i=length-1;i>=0;i--){
|
||||
if (ret[i]==32) ret[i]=0;
|
||||
else i=-1;
|
||||
}
|
||||
}
|
||||
//if (DEBUG==1) putlog("substring created");
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *substring(char *text, int first, int length){return subString(text,first,length,0);}
|
||||
|
||||
|
||||
char *readLine(FILE *f){
|
||||
//if (DEBUG==1) putlog("reading line from file");
|
||||
char *buffer = g_new (char, 1024);
|
||||
int pos=0;
|
||||
int cc=0;
|
||||
while((cc!=EOF)&&(pos<1024)&&(cc!=10)){
|
||||
cc=fgetc(f);
|
||||
if ((cc!=10)&&(cc!=13)){
|
||||
if (cc==EOF) buffer[pos]=0;
|
||||
else buffer[pos]=(char)cc;pos++;
|
||||
}
|
||||
}
|
||||
if (buffer[pos]==EOF) hexchat_printf(ph,"EOF: %i\n",pos);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
char *toUpper(char *text)
|
||||
{
|
||||
char *ret = (char*) calloc(strlen(text) + 1, sizeof(char));
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < strlen(text); i++)
|
||||
{
|
||||
ret[i] = toupper(text[i]);
|
||||
}
|
||||
|
||||
ret[strlen(text)] = 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *str3cat(char *s1, char *s2, char *s3){
|
||||
//if (DEBUG==1) putlog("cating 3 strings");
|
||||
char *ret=(char*)calloc(strlen(s1)+strlen(s2)+strlen(s3)+1,sizeof(char));
|
||||
strcpy(ret,s1);strcat(ret,s2);strcat(ret,s3);
|
||||
ret[strlen(s1)+strlen(s2)+strlen(s3)]=0;
|
||||
//if (DEBUG==1) putlog("strings cated");
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *replace(char *text, char *from, char *to){
|
||||
//if (DEBUG==1) putlog("replacing");
|
||||
char *ret=(char*)calloc( strlen(text)+(strlen(to)-strlen(from)),sizeof(char));
|
||||
char *left;
|
||||
char *right;
|
||||
int pos=inStr(text,strlen(text),from);
|
||||
if (pos!=-1){
|
||||
left=substring(text,0,pos);
|
||||
right=substring(text,pos+strlen(from),strlen(text)-(pos+strlen(from)));
|
||||
ret=str3cat(left,to,right);
|
||||
return replace(ret,from,to);
|
||||
}
|
||||
//if (DEBUG==1) putlog("replaced");
|
||||
return text;
|
||||
}
|
||||
|
||||
char *intReplaceF(char *text, char *from, int to, char *form){
|
||||
//if (DEBUG==1) putlog("replaceF");
|
||||
char *buffer=(char*) calloc(16,sizeof(char));
|
||||
sprintf(buffer,form,to);
|
||||
//if (DEBUG==1) putlog("replaceF done");
|
||||
return replace(text,from,buffer);
|
||||
}
|
||||
|
||||
char *intReplace(char *text, char *from, int to){return intReplaceF(text,from,to,"%i");}
|
@ -1,330 +0,0 @@
|
||||
/*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
//#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
//#include "functions.c"
|
||||
|
||||
struct tagInfo{
|
||||
int mode;
|
||||
int cbr;
|
||||
int bitrate;
|
||||
unsigned int freq;
|
||||
char *artist;
|
||||
char *title;
|
||||
char *album;
|
||||
char *comment;
|
||||
char *genre;
|
||||
//int genre;
|
||||
//int track;
|
||||
};
|
||||
|
||||
static int RATES[2][3][15]={
|
||||
{//mpeg2
|
||||
{-1,8,16,24,32,64,80,56,64,128,160,112,128,256,320},//layer3 (V2)
|
||||
{-1,32,48,56,64,80,96,112,128,160,192,224,256,320,384},//layer2 (V2)
|
||||
{-1,32,64,96,128,160,192,224,256,288,320,352,384,416,448},//layer1 (V2)
|
||||
},
|
||||
{//mpeg1
|
||||
{-1,32,40,48,56,64,80,96,112,128,160,192,224,256,320},//layer3 (V1)
|
||||
{-1,32,48,56,64,80,96,112,128,160,192,224,256,320,384},//layer2 (V1)
|
||||
{-1,32,64,96,128,160,192,224,256,288,320,352,384,416,448},//layer1 (V1)
|
||||
}};
|
||||
static int FREQS[2][4]={{22050,24000,16000,-1},{44100,48000,32000,-1}};
|
||||
//static double FRATES[]={38.5,32.5,27.8,0.0};
|
||||
|
||||
static char GENRES[][50]={"Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal",
|
||||
"New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock","Techno","Industrial",
|
||||
"Alternative","Ska","Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk",
|
||||
"Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise",
|
||||
"AlternRock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic",
|
||||
"Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta",
|
||||
"Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychadelic","Rave","Showtunes",
|
||||
"Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical","Rock & Roll","Hard Rock",
|
||||
|
||||
//################## END OF OFFICIAL ID3 TAGS, WINAMP TAGS BELOW ########################################
|
||||
|
||||
"Folk","Folk/Rock","National Folk","Swing","Fast Fusion","Bebob","Latin","Revival","Celtic","Bluegrass",
|
||||
"Avantgarde","Gothic Rock","Progressive Rock","Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus","Easy Listening","Acoustic",
|
||||
"Humour","Speech","Chanson","Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove",
|
||||
"Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad","Poweer Ballad","Rhytmic Soul","Freestyle",
|
||||
"Duet","Punk Rock","Drum Solo","A Capela","Euro-House","Dance Hall",
|
||||
|
||||
//################## FOUND AT http://en.wikipedia.org/wiki/ID3 ###########################################
|
||||
|
||||
"Goa","Drum & Bass","Club-House","Hardcore",
|
||||
"Terror","Indie","BritPop","Negerpunk","Polsk Punk","Beat","Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover",
|
||||
"Contemporary Christian","Christian Rock","Merengue","Salsa","Thrash Metal","Anime","JPop","Synthpop"
|
||||
|
||||
};
|
||||
|
||||
static char MODES [][13]={"Stereo","Joint-Stereo","Dual-Channel","Mono"};
|
||||
|
||||
int iPow(int x, int y){return (int)(pow((double)x,(double) y));}
|
||||
|
||||
int str2int(char *text)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
size_t i;
|
||||
for (i = 1; i <= strlen(text); i++)
|
||||
{
|
||||
if ((text[strlen(text) - i] > 57) || (text[strlen(text) - i] < 48))
|
||||
{
|
||||
hexchat_printf(ph, "invalid char in string: %i", (int) text[strlen(text) - i]);
|
||||
return 255;
|
||||
}
|
||||
|
||||
ret += ((int) text[strlen(text) - i] - 48)*iPow(10, i - 1);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *tagExtract(char *tag, int tagLen, char* info){
|
||||
//if (DEBUG==1) putlog("extracting tag");
|
||||
int pos, len, i;
|
||||
pos=inStr(tag,tagLen,info);
|
||||
//hexchat_printf(ph,"pos=%i",pos);
|
||||
if (pos==-1) return "";//NULL;
|
||||
//printf("position of %s = %i\n",info,pos);
|
||||
len=0;
|
||||
//for (i=pos;i<pos+10;i++)printf("tag[%i]=%i \n",i,tag[i]);
|
||||
for (i=0;i<4;i++) {
|
||||
len+=tag[pos+strlen(info)+i]*iPow(255,3-i);
|
||||
}
|
||||
//printf("Tag-Length: %i\n",len);
|
||||
if (strcmp("COMM",info)!=0) return substring(tag,pos+7+strlen(info),len-1);//11
|
||||
return substring(tag,pos+7+strlen(info),len-1);//11
|
||||
//char *ct=substring(tag,pos+7+strlen(info),len-1);//11
|
||||
//return substring(ct,strlen(ct)+1,len-1-strlen(ct)); //<-- do not understand, what i did here :(
|
||||
|
||||
}
|
||||
|
||||
struct tagInfo readID3V1(char *file){
|
||||
//if (DEBUG==1) putlog("reading ID3V1");
|
||||
FILE *f;
|
||||
struct tagInfo ret;
|
||||
int res, i, c, val;
|
||||
char *tag;
|
||||
char *id;
|
||||
char *tmp;
|
||||
tag = (char*) malloc(sizeof(char)*129);
|
||||
ret.artist=NULL;
|
||||
f=fopen(file,"rb");
|
||||
if (f==NULL){
|
||||
hexchat_print(ph,"file not found while trying to read id3v1");
|
||||
//if (DEBUG==1) putlog("file not found while trying to read id3v1");
|
||||
return ret;
|
||||
}
|
||||
//int offset=getSize(file)-128;
|
||||
res=fseek(f,-128,SEEK_END);
|
||||
if (res!=0) {printf("seek failed\n");fclose(f);return ret;}
|
||||
//long int pos=ftell(f);
|
||||
//printf("position= %li\n",pos);
|
||||
for (i=0;i<128;i++) {
|
||||
c=fgetc(f);
|
||||
if (c==EOF) {hexchat_printf(ph,"read ID3V1 failed\n");fclose(f);return ret;}
|
||||
tag[i]=(char)c;
|
||||
}
|
||||
fclose(f);
|
||||
//printf("tag readed: \n");
|
||||
id=substring(tag,0,3);
|
||||
//printf("header: %s\n",id);
|
||||
if (strcmp(id,"TAG")!=0){hexchat_printf(ph,"no id3 v1 found\n");return ret;}
|
||||
ret.title=subString(tag,3,30,1);
|
||||
ret.artist=subString(tag,33,30,1);
|
||||
ret.album=subString(tag,63,30,1);
|
||||
ret.comment=subString(tag,97,30,1);
|
||||
tmp=substring(tag,127,1);
|
||||
//ret.genre=substring(tag,127,1);
|
||||
|
||||
val=(int)tmp[0];
|
||||
if (val<0)val+=256;
|
||||
//hexchat_printf(ph, "tmp[0]=%i (%i)",val,tmp[0]);
|
||||
if ((val<148)&&(val>=0))
|
||||
ret.genre=GENRES[val];//#############changed
|
||||
else {
|
||||
ret.genre="unknown";
|
||||
//hexchat_printf(ph, "tmp[0]=%i (%i)",val,tmp[0]);
|
||||
}
|
||||
//hexchat_printf(ph, "tmp: \"%s\" -> %i",tmp,tmp[0]);
|
||||
//hexchat_printf(ph,"genre \"%s\"",ret.genre);
|
||||
//if (DEBUG==1) putlog("id3v1 extracted");
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *extractID3Genre(char *tag)
|
||||
{
|
||||
if (tag[strlen(tag) - 1] == ')')
|
||||
{
|
||||
tag[strlen(tag) - 1] = 0;
|
||||
tag = &tag[1];
|
||||
return GENRES[str2int(tag)];
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < strlen(tag); i++)
|
||||
{
|
||||
if (tag[i] == ')')
|
||||
{
|
||||
tag = &tag[i] + 1;
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "[152] failed";
|
||||
}
|
||||
|
||||
struct tagInfo readID3V2(char *file){
|
||||
//if (DEBUG==1) putlog("reading id3v2");
|
||||
FILE *f;
|
||||
int i, c, len;
|
||||
char header[10];
|
||||
char *tag;
|
||||
struct tagInfo ret;
|
||||
|
||||
f = fopen(file,"rb");
|
||||
//hexchat_printf(ph,"file :%s",file);
|
||||
if (f==NULL)
|
||||
{
|
||||
hexchat_print(ph,"file not found whilt trying to read ID3V2");
|
||||
//if (DEBUG==1)putlog("file not found while trying to read ID3V2");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret.artist=NULL;
|
||||
for (i=0;i<10;i++){
|
||||
c=fgetc(f);
|
||||
if (c==EOF){
|
||||
fclose(f);
|
||||
//putlog("found eof while reading id3v2");
|
||||
return ret;
|
||||
}
|
||||
header[i]=(char)c;
|
||||
}
|
||||
if (strstr(header,"ID3")==header){
|
||||
//hexchat_printf(ph,"found id3v2\n");
|
||||
len=0;
|
||||
for (i=6;i<10;i++) len+=(int)header[i]*iPow(256,9-i);
|
||||
|
||||
//char *tag=(char*)malloc(sizeof(char)*len);
|
||||
tag=(char*) calloc(len,sizeof(char)); //malloc(sizeof(char)*len);
|
||||
for (i=0;i<len;i++){c=fgetc(f);tag[i]=(char)c;}
|
||||
//hexchat_printf(ph,"tag length: %i\n",len);
|
||||
//hexchat_printf(ph,"tag: %s\n",tag);
|
||||
fclose(f);
|
||||
ret.comment=tagExtract(tag,len,"COMM");
|
||||
//hexchat_printf(ph,"Comment: %s\n",ret.comment);
|
||||
ret.genre=tagExtract(tag,len,"TCON");
|
||||
//if (strcmp(ret.genre,"(127)")==0) ret.genre="unknown";
|
||||
//hexchat_printf(ph, "ret.genre = %s",ret.genre);
|
||||
if ((ret.genre!=NULL)&&(ret.genre[0]=='(')) ret.genre=extractID3Genre(ret.genre);
|
||||
//hexchat_printf(ph,"genre: %s\n",ret.genre);
|
||||
ret.title=tagExtract(tag,len,"TIT2");
|
||||
//hexchat_printf(ph,"Title: %s\n",ret.title);
|
||||
ret.album=tagExtract(tag,len,"TALB");
|
||||
//hexchat_printf(ph,"Album: %s\n",ret.album);
|
||||
ret.artist=tagExtract(tag,len,"TPE1");
|
||||
//hexchat_printf(ph,"Artist: %s\n",ret.artist);
|
||||
}
|
||||
else{fclose(f);printf("no id3v2 tag found\n"); return ret;}
|
||||
//printf("id2v2 done\n");
|
||||
//if (DEBUG==1) putlog("id3v2 readed");
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct tagInfo readHeader(char *file){
|
||||
//if (DEBUG==1) putlog("reading header");
|
||||
FILE *f;
|
||||
//int buffer[5120];
|
||||
int versionB, layerB, bitrateB, freqB, modeB;
|
||||
int header[4];
|
||||
int count=0;
|
||||
int cc=0;
|
||||
struct tagInfo info;
|
||||
info.artist=NULL;
|
||||
|
||||
f = fopen(file,"rb");
|
||||
if (f==NULL)
|
||||
{
|
||||
hexchat_print(ph,"file not found while trying to read mp3 header");
|
||||
//if (DEBUG==1) putlog("file not found while trying to read mp3 header");
|
||||
return info;
|
||||
}
|
||||
//struct tagInfo tagv2
|
||||
|
||||
info=readID3V2(file);
|
||||
//struct tagInfo tagv1;//=readID3V1(file);
|
||||
//if (tagv2.artist!=NULL){info=tagv2;}
|
||||
//else {
|
||||
if (info.artist==NULL){
|
||||
//printf("searching for id3v1\n");
|
||||
//tagv1=readID3V1(file);
|
||||
info=readID3V1(file); //#####################
|
||||
}
|
||||
/*
|
||||
if (tagv1.artist!=NULL){
|
||||
//printf("Artist: %s\nTitle: %s\nAlbum: %s\nComment: %s\nGenre: %s\n",tagv1.artist,tagv1.title,tagv1.album,tagv1.comment,tagv1.genre);
|
||||
info=tagv1;
|
||||
}
|
||||
*/
|
||||
while ((count<5120)&&(cc!=EOF)&&(cc!=255)) {cc=fgetc(f);count++;}
|
||||
if ((cc==EOF)||(count==5119)) printf("no header found\n");
|
||||
else {
|
||||
//printf("located header at %i\n",count);
|
||||
header[0]=255;
|
||||
for (count=1;count<4;count++){
|
||||
header[count]=fgetc(f);
|
||||
//printf("header[%i]=%i\n",count,header[count]);
|
||||
}
|
||||
versionB=(header[1]&8)>>3;
|
||||
layerB=(header[1]&6)>>1;
|
||||
bitrateB=(header[2]&240)>>4; //4
|
||||
freqB=(header[2]&12)>>2;//2
|
||||
modeB=(header[3]&192)>>6;//6
|
||||
//printf("Mpeg: %i\nLayer: %i\nBitrate: %i\nFreq: %i\nMode: %i\n",versionB, layerB, bitrateB, freqB, modeB);
|
||||
//int Bitrate=RATES[versionB][layerB-1][bitrateB];
|
||||
//int Freq=FREQS[versionB][freqB];
|
||||
info.bitrate=RATES[versionB][layerB-1][bitrateB];
|
||||
info.freq=FREQS[versionB][freqB];
|
||||
info.mode=modeB;
|
||||
}
|
||||
fclose(f);
|
||||
//if (DEBUG==1) putlog("header readed");
|
||||
return info;
|
||||
}
|
||||
/*
|
||||
static void printMp3Info(char *file){
|
||||
//printf("\nScanning Mp3-File for Informations: %s\n",file);
|
||||
//printf("size:\t%10d byte\n",getSize(file));
|
||||
struct tagInfo info =readHeader(file);
|
||||
printf("%s | %10d",file,getSize(file));
|
||||
if (info.bitrate>0){
|
||||
//printf("Bitrate: %i\nFreq: %i\nMode: %s\n",info.bitrate,info.freq,MODES[info.mode]);
|
||||
printf(" | %i kbps | %i kHz | %s",info.bitrate,info.freq,MODES[info.mode]);
|
||||
//if (info.artist!=NULL) printf("\nArtist: %s\nTitle: %s\nAlbum: %s\nComment: %s\nGenre: %s\n",info.artist,info.title,info.album,info.comment,info.genre);
|
||||
if (info.artist!=NULL) {
|
||||
printf("| %s | %s | %s | %s | %s",info.artist,info.title,info.album,info.comment,info.genre);
|
||||
//printf("| %s ",info.title);//,info.title,info.album,info.comment,info.genre
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
*/
|
@ -1,160 +0,0 @@
|
||||
/*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
//static int DEBUG=0;
|
||||
static char *VERSION="0.0.6";
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include "hexchat-plugin.h"
|
||||
static hexchat_plugin *ph;
|
||||
|
||||
#include "functions.c"
|
||||
#include "mp3Info.c"
|
||||
#include "oggInfo.c"
|
||||
#include "theme.c"
|
||||
|
||||
static int print_themes (char *word[], char *word_eol[], void *userdata){
|
||||
printThemes();
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
static int mpc_themeReload(char *word[], char *word_eol[], void *userdata){
|
||||
themeInit();
|
||||
loadThemes();
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
static int mpc_tell(char *word[], char *word_eol[], void *userdata){
|
||||
char *tTitle, *zero, *oggLine, *line;
|
||||
struct tagInfo info;
|
||||
HWND hwnd = FindWindow("MediaPlayerClassicW",NULL);
|
||||
if (hwnd==0) {hexchat_print(ph, randomLine(notRunTheme));return HEXCHAT_EAT_ALL;}
|
||||
|
||||
tTitle = g_new(char, 1024);
|
||||
GetWindowText(hwnd, tTitle, 1024);
|
||||
zero = strstr (tTitle, " - Media Player Classic");
|
||||
if (zero != NULL)
|
||||
{
|
||||
zero[0] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_free(tTitle);
|
||||
hexchat_print(ph, "pattern not found");
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
if ((tTitle[1]==':')&&(tTitle[2]=='\\')){
|
||||
//hexchat_print(ph,"seams to be full path");
|
||||
if (endsWith(tTitle,".mp3")==1){
|
||||
//hexchat_print(ph,"seams to be a mp3 file");
|
||||
info = readHeader(tTitle);
|
||||
|
||||
if ((info.artist!=NULL)&&(strcmp(info.artist,"")!=0)){
|
||||
char *mode=MODES[info.mode];
|
||||
//hexchat_printf(ph,"mode: %s\n",mode);
|
||||
char *mp3Line=randomLine(mp3Theme);
|
||||
mp3Line=replace(mp3Line,"%art",info.artist);
|
||||
mp3Line=replace(mp3Line,"%tit",info.title);
|
||||
mp3Line=replace(mp3Line,"%alb",info.album);
|
||||
mp3Line=replace(mp3Line,"%com",info.comment);
|
||||
mp3Line=replace(mp3Line,"%gen",info.genre);
|
||||
//mp3Line=replace(mp3Line,"%time",pos);
|
||||
//mp3Line=replace(mp3Line,"%length",len);
|
||||
//mp3Line=replace(mp3Line,"%ver",waVers);
|
||||
//mp3Line=intReplace(mp3Line,"%br",br);
|
||||
//mp3Line=intReplace(mp3Line,"%frq",frq);
|
||||
|
||||
mp3Line=intReplace(mp3Line,"%br",info.bitrate);
|
||||
mp3Line=intReplace(mp3Line,"%frq",info.freq);
|
||||
mp3Line=replace(mp3Line,"%mode",mode);
|
||||
//mp3Line=replace(mp3Line,"%size",size);
|
||||
//mp3Line=intReplace(mp3Line,"%perc",perc);
|
||||
//mp3Line=replace(mp3Line,"%plTitle",title);
|
||||
mp3Line=replace(mp3Line,"%file",tTitle);
|
||||
g_free(tTitle);
|
||||
hexchat_command(ph, mp3Line);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
}
|
||||
if (endsWith(tTitle,".ogg")==1){
|
||||
hexchat_printf(ph,"Ogg detected\n");
|
||||
info = getOggHeader(tTitle);
|
||||
if (info.artist!=NULL){
|
||||
char *cbr;
|
||||
if (info.cbr==1) cbr="CBR"; else cbr="VBR";
|
||||
oggLine=randomLine(oggTheme);
|
||||
//if (cue==1) oggLine=cueLine;
|
||||
//hexchat_printf(ph,"ogg-line: %s\n",oggLine);
|
||||
oggLine=replace(oggLine,"%art",info.artist);
|
||||
oggLine=replace(oggLine,"%tit",info.title);
|
||||
oggLine=replace(oggLine,"%alb",info.album);
|
||||
oggLine=replace(oggLine,"%com",info.comment);
|
||||
oggLine=replace(oggLine,"%gen",info.genre);
|
||||
//oggLine=replace(oggLine,"%time",pos);
|
||||
//oggLine=replace(oggLine,"%length",len);
|
||||
//oggLine=replace(oggLine,"%ver",waVers);
|
||||
oggLine=intReplace(oggLine,"%chan",info.mode);
|
||||
oggLine=replace(oggLine,"%cbr",cbr);
|
||||
oggLine=intReplace(oggLine,"%br",info.bitrate/1000);//br);
|
||||
oggLine=intReplace(oggLine,"%frq",info.freq);
|
||||
//oggLine=replace(oggLine,"%size",size);
|
||||
//oggLine=intReplace(oggLine,"%perc",perc);
|
||||
//oggLine=replace(oggLine,"%plTitle",title);
|
||||
oggLine=replace(oggLine,"%file",tTitle);
|
||||
g_free(tTitle);
|
||||
hexchat_command(ph, oggLine);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
}
|
||||
}
|
||||
line=randomLine(titleTheme);
|
||||
line=replace(line,"%title", tTitle);
|
||||
g_free(tTitle);
|
||||
hexchat_command(ph, line);
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
int hexchat_plugin_init(hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg){
|
||||
ph = plugin_handle;
|
||||
*plugin_name = "mpcInfo";
|
||||
*plugin_desc = "Information-Script for Media Player Classic";
|
||||
*plugin_version=VERSION;
|
||||
|
||||
hexchat_hook_command(ph, "mpc", HEXCHAT_PRI_NORM, mpc_tell,"no help text", 0);
|
||||
hexchat_hook_command(ph, "mpc_themes", HEXCHAT_PRI_NORM, print_themes,"no help text", 0);
|
||||
hexchat_hook_command(ph, "mpc_reloadthemes", HEXCHAT_PRI_NORM, mpc_themeReload,"no help text", 0);
|
||||
hexchat_command (ph, "MENU -ishare\\music.png ADD \"Window/Display Current Song (MPC)\" \"MPC\"");
|
||||
|
||||
themeInit();
|
||||
loadThemes();
|
||||
hexchat_printf(ph, "%s plugin loaded\n", *plugin_name);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
hexchat_plugin_deinit (void)
|
||||
{
|
||||
hexchat_command (ph, "MENU DEL \"Window/Display Current Song (MPC)\"");
|
||||
hexchat_print (ph, "mpcInfo plugin unloaded\n");
|
||||
return 1;
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
EXPORTS
|
||||
hexchat_plugin_init
|
||||
hexchat_plugin_deinit
|
@ -1,107 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Configuration">
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{B0E36D93-CA2A-49FE-9EB9-9C96C6016EEC}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>mpcinfo</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>hcmpcinfo</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>hcmpcinfo</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MPCINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>mpcinfo.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;MPCINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>mpcinfo.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="mpcinfo.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="mpcInfo.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -1,23 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="mpcinfo.def">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="mpcInfo.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,126 +0,0 @@
|
||||
/*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
static int getOggInt(char *buff, int beg, int bytes){
|
||||
//if (DEBUG==1) putlog("getOggInt");
|
||||
int ret=0;
|
||||
int i;
|
||||
for (i=0;i<bytes;i++){
|
||||
if (buff[i+beg]>=0) ret+=buff[i+beg]*iPow(256,i);else ret+=(256+buff[i+beg])*iPow(256,i);
|
||||
//printf("[%i]=%i\n",i,buff[i+beg]);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *upperStr(char *text)
|
||||
{
|
||||
char *ret = (char*) malloc(sizeof(char)*(strlen(text) + 1));
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < strlen(text); i++)
|
||||
{
|
||||
ret[i] = toupper(text[i]);
|
||||
}
|
||||
|
||||
ret[strlen(text)] = 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct tagInfo getOggHeader(char *file){
|
||||
//if (DEBUG==1) putlog("reading ogg header");
|
||||
char header[4096];
|
||||
int i, c;
|
||||
int h1pos, h3pos, maxBr, nomBr, minBr, pos, count, tagLen;
|
||||
char *sub;
|
||||
char *name;
|
||||
char *val;
|
||||
char *HEADLOC1, *HEADLOC3, *HEADLOC5;
|
||||
FILE *f;
|
||||
struct tagInfo info;
|
||||
|
||||
info.artist=NULL;
|
||||
f = fopen(file,"rb");
|
||||
if (f==NULL){
|
||||
hexchat_print(ph,"file not found while trying to read ogg header");
|
||||
//if (DEBUG==1) putlog("file not found while trying to read ogg header");
|
||||
return info;
|
||||
}
|
||||
|
||||
for (i=0;i<4095;i++) {c=fgetc(f);header[i]=(char)c;}
|
||||
fclose(f);
|
||||
HEADLOC1="_vorbis";
|
||||
HEADLOC1[0]=1;
|
||||
HEADLOC3="_vorbis";
|
||||
HEADLOC3[0]=3;
|
||||
HEADLOC5="_vorbis";
|
||||
HEADLOC5[0]=5;
|
||||
h1pos=inStr(header,4096,HEADLOC1);
|
||||
h3pos=inStr(header,4096,HEADLOC3);
|
||||
//int h5pos=inStr(header,4096,HEADLOC5); //not needed
|
||||
|
||||
//printf("loc1: %i\n",h1pos);printf("loc3: %i\n",h3pos);printf("loc5: %i\n",h5pos);
|
||||
maxBr=getOggInt(header,h1pos+7+9,4);
|
||||
nomBr=getOggInt(header,h1pos+7+13,4);
|
||||
minBr=getOggInt(header,h1pos+7+17,4);
|
||||
info.freq=getOggInt(header,h1pos+7+5,4);
|
||||
info.mode=header[h1pos+7+4];
|
||||
info.bitrate=nomBr;
|
||||
if (((maxBr==nomBr)&&(nomBr=minBr))||((minBr==0)&&(maxBr==0))||((minBr=-1)&&(maxBr=-1)) )info.cbr=1;else info.cbr=0;
|
||||
printf("bitrates: %i|%i|%i\n",maxBr,nomBr,minBr);
|
||||
printf("freq: %u\n",info.freq);
|
||||
pos=h3pos+7;
|
||||
pos+=getOggInt(header,pos,4)+4;
|
||||
count=getOggInt(header,pos,4);
|
||||
//printf("tags: %i\n",count);
|
||||
pos+=4;
|
||||
|
||||
info.artist=NULL;info.title=NULL;info.album=NULL;info.comment=NULL;info.genre=NULL;
|
||||
for (i=0;i<count;i++){
|
||||
tagLen=getOggInt(header,pos,4);
|
||||
//printf("taglength: %i\n",tagLen);
|
||||
sub=substring(header,pos+4,tagLen);
|
||||
name=upperStr(substring(sub,0,inStr(sub,tagLen,"=")));
|
||||
val=substring(sub,inStr(sub,tagLen,"=")+1,tagLen-inStr(sub,tagLen,"=")-1);
|
||||
//printf("Tag: %s\n",sub);
|
||||
//printf("Name: %s\n",name);
|
||||
//printf("value: %s\n",val);
|
||||
if (strcmp(name,"ARTIST")==0) info.artist=val;
|
||||
if (strcmp(name,"TITLE")==0) info.title=val;
|
||||
if (strcmp(name,"ALBUM")==0) info.album=val;
|
||||
if (strcmp(name,"GENRE")==0) info.genre=val;
|
||||
if (strcmp(name,"COMMENT")==0) info.comment=val;
|
||||
pos+=4+tagLen;
|
||||
}
|
||||
if (info.artist==NULL) info.artist="";
|
||||
if (info.album==NULL) info.album ="";
|
||||
if (info.title==NULL) info.title="";
|
||||
if (info.genre==NULL) info.genre="";
|
||||
if (info.comment==NULL) info.comment="";
|
||||
|
||||
printf("Artist: %s\nTitle: %s\nAlbum: %s\n",info.artist,info.title, info.album);
|
||||
printf("Genre: %s\nComment: %s\nMode: %i\nCBR: %i\n",info.genre,info.comment,info.mode,info.cbr);
|
||||
//if (DEBUG==1) putlog("ogg header readed");
|
||||
return info;
|
||||
}
|
||||
|
||||
/*
|
||||
void printOggInfo(char *file){
|
||||
printf("Scanning Ogg-File for Informations: %s\n",file);
|
||||
printf("size:\t%10d byte\n",getSize(file));
|
||||
struct tagInfo info = getOggHeader(file);
|
||||
}
|
||||
*/
|
@ -1,144 +0,0 @@
|
||||
/*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <time.h>
|
||||
|
||||
struct theme{
|
||||
int size;
|
||||
char **line;
|
||||
};
|
||||
|
||||
static struct theme notRunTheme;
|
||||
static struct theme titleTheme;
|
||||
static struct theme mp3Theme;
|
||||
static struct theme oggTheme;
|
||||
|
||||
|
||||
void themeInit(){
|
||||
//if (DEBUG==1) putlog("init theme");
|
||||
/*mp3Theme.size=0;oggTheme.size=0;cueTheme.size=0;streamTheme.size=0;etcTheme.size=0;
|
||||
stopTheme.size=0;pauseTheme.size=0;*/
|
||||
|
||||
notRunTheme.size=0;titleTheme.size=0;
|
||||
srand((unsigned int)time((time_t *)NULL));
|
||||
//if (DEBUG==1) putlog("theme init done");
|
||||
}
|
||||
|
||||
void printTheme(struct theme data){
|
||||
int i;
|
||||
for (i=0;i<data.size;i++) hexchat_printf(ph,"line[%i]=%s\n",i,data.line[i]);
|
||||
}
|
||||
|
||||
void printThemes(){
|
||||
hexchat_printf(ph,"\nNotRun-Theme:\n");printTheme(notRunTheme);
|
||||
hexchat_printf(ph,"\nMP3-Theme:\n");printTheme(mp3Theme);
|
||||
hexchat_printf(ph,"\nOGG-Theme:\n");printTheme(oggTheme);
|
||||
hexchat_printf(ph,"\nTitle-Theme:\n");printTheme(titleTheme);
|
||||
}
|
||||
|
||||
void cbFix(char *line)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < strlen(line); i++)
|
||||
{
|
||||
size_t j;
|
||||
|
||||
if (line[i] == '%')
|
||||
{
|
||||
if ((line[i + 1] == 'C') || (line[i + 1] == 'B') || (line[i + 1] == 'U') || (line[i + 1] == 'O') || (line[i + 1] == 'R'))
|
||||
{
|
||||
if (line[i + 1] == 'C') line[i] = 3;
|
||||
if (line[i + 1] == 'B') line[i] = 2;
|
||||
if (line[i + 1] == 'U') line[i] = 37;
|
||||
if (line[i + 1] == 'O') line[i] = 17;
|
||||
if (line[i + 1] == 'R') line[i] = 26;
|
||||
|
||||
for (j = i + 1; j < strlen(line) - 1; j++)
|
||||
{
|
||||
line[j] = line[j + 1];
|
||||
}
|
||||
|
||||
line[strlen(line) - 1] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct theme themeAdd(struct theme data, char *info){
|
||||
//if (DEBUG==1) putlog("adding theme");
|
||||
struct theme ret;
|
||||
char **newLine=(char **)calloc(data.size+1,sizeof(char*));
|
||||
int i;
|
||||
for (i=0;i<data.size;i++) newLine[i]=data.line[i];
|
||||
cbFix(info);
|
||||
newLine[data.size]=info;
|
||||
ret.line=newLine;ret.size=data.size+1;
|
||||
//if (DEBUG==1) putlog("theme added");
|
||||
return ret;
|
||||
}
|
||||
|
||||
void loadThemes(){
|
||||
char *hDir, *hFile, *line, *val;
|
||||
FILE *f;
|
||||
hexchat_print(ph,"loading themes\n");
|
||||
hDir=(char*)calloc(1024,sizeof(char));
|
||||
strcpy(hDir,hexchat_get_info(ph,"configdir"));
|
||||
hFile=str3cat(hDir,"\\","mpcInfo.theme.txt");
|
||||
f = fopen(hFile,"r");
|
||||
if(f==NULL)
|
||||
{
|
||||
hexchat_print(ph,"no theme in homedir, checking global theme");
|
||||
f=fopen("mpcInfo.theme.txt","r");
|
||||
}
|
||||
//hexchat_printf(ph,"file_desc: %p\n",f);
|
||||
if (f==NULL) hexchat_print(ph, "no theme found, using hardcoded\n");
|
||||
else {
|
||||
if (f > 0)
|
||||
{
|
||||
line=" ";
|
||||
} else
|
||||
{
|
||||
line="\0";
|
||||
}
|
||||
|
||||
while (line[0]!=0)
|
||||
{
|
||||
line=readLine(f);
|
||||
val=split(line,'=');
|
||||
printf("line: %s\n",line);
|
||||
printf("val: %s\n",val);
|
||||
if (strcmp(toUpper(line),"OFF_LINE")==0) notRunTheme=themeAdd(notRunTheme,val);
|
||||
if (strcmp(toUpper(line),"TITLE_LINE")==0) titleTheme=themeAdd(titleTheme,val);
|
||||
if (strcmp(toUpper(line),"MP3_LINE")==0) mp3Theme=themeAdd(mp3Theme,val);
|
||||
if (strcmp(toUpper(line),"OGG_LINE")==0) mp3Theme=themeAdd(oggTheme,val);
|
||||
}
|
||||
fclose(f);
|
||||
hexchat_print(ph, "theme loaded successfull\n");
|
||||
}
|
||||
if (notRunTheme.size==0) notRunTheme=themeAdd(notRunTheme,"Media Player Classic not running");
|
||||
if (titleTheme.size==0) titleTheme=themeAdd(titleTheme,"say Playing %title in Media Player Classic");
|
||||
if (mp3Theme.size==0) mp3Theme=themeAdd(mp3Theme,"me listens to %art with %tit from %alb [%gen|%br kbps|%frq kHz|%mode] in Media Player Classic ");
|
||||
if (oggTheme.size==0) oggTheme=themeAdd(oggTheme,"me listens to %art with %tit from %alb [%gen|%br kbps|%frq kHz|%chan channels] in Media Player Classic ");
|
||||
//mp3Theme=themeAdd(mp3Theme,"me listens to %art with %tit from %alb [%time|%length|%perc%|%br kbps|%frq kHz|%mode] in Media Player Classic ");
|
||||
}
|
||||
|
||||
int rnd(int max){
|
||||
return rand()%max;
|
||||
}
|
||||
|
||||
char *randomLine(struct theme data){
|
||||
return data.line[rnd(data.size)];
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
|
||||
EXTRA_DIST=generate_header 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
|
||||
|
||||
libdir = $(hexchatlibdir)
|
||||
|
||||
lib_LTLIBRARIES = perl.la
|
||||
perl_la_SOURCES = perl.c
|
||||
perl_la_LDFLAGS = $(PERL_LDFLAGS) $(PLUGIN_LDFLAGS) -module
|
||||
perl_la_LIBADD = $(PERL_LIBS) $(GLIB_LIBS)
|
||||
perl_la_CFLAGS = $(PERL_CFLAGS) $(GLIB_CFLAGS) -I$(top_srcdir)/src/common
|
||||
|
||||
BUILT_SOURCES = hexchat.pm.h irc.pm.h
|
||||
CLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
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
|
29
plugins/perl/generate_header.py
Executable file
@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
from os.path import basename
|
||||
|
||||
out_file = sys.argv[1]
|
||||
in_files = sys.argv[2:]
|
||||
|
||||
|
||||
def escape_perl(file):
|
||||
ret = ''
|
||||
for line in file:
|
||||
# Escape " and \, strip empty space, shove in C strings.
|
||||
ret += '"' + line.strip().replace('\\', '\\\\').replace('"', '\\"') + '\\n"\n'
|
||||
return ret
|
||||
|
||||
|
||||
with open(out_file, 'w') as o:
|
||||
o.write('"BEGIN {\\n"\n')
|
||||
for in_file in in_files:
|
||||
o.write("\"$INC{{'{}'}} = 'Compiled into the plugin.';\\n\"\n".format(basename(in_file)))
|
||||
o.write('"}\\n"\n')
|
||||
|
||||
for in_file in in_files:
|
||||
o.write('"{\\n"\n')
|
||||
o.write('"#line 1 \\"{}\\"\\n"\n'.format(basename(in_file)))
|
||||
with open(in_file) as i:
|
||||
o.write(escape_perl(i))
|
||||
o.write('"}\\n"\n')
|
@ -51,7 +51,7 @@ sub get_context;
|
||||
sub HexChat::Internal::context_info;
|
||||
sub HexChat::Internal::print;
|
||||
|
||||
#keep compability with Xchat scripts
|
||||
#keep compatibility with Xchat scripts
|
||||
sub EAT_XCHAT ();
|
||||
BEGIN {
|
||||
*Xchat:: = *HexChat::;
|
||||
|
91
plugins/perl/meson.build
Normal file
@ -0,0 +1,91 @@
|
||||
generate_perl_header = find_program('generate_header.py')
|
||||
|
||||
hexchat_perl_module = custom_target('hexchat-perl-header',
|
||||
input: [
|
||||
'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',
|
||||
],
|
||||
output: 'hexchat.pm.h',
|
||||
command: [generate_perl_header, '@OUTPUT@', '@INPUT@']
|
||||
)
|
||||
|
||||
perl_cflags = []
|
||||
irc_perl_module = []
|
||||
|
||||
if get_option('with-perl-legacy-api')
|
||||
irc_perl_module = custom_target('irc-perl-header',
|
||||
input: 'lib/IRC.pm',
|
||||
output: 'irc.pm.h',
|
||||
command: [generate_perl_header, '@OUTPUT@', '@INPUT@']
|
||||
)
|
||||
perl_cflags += '-DOLD_PERL'
|
||||
endif
|
||||
|
||||
perl = find_program(get_option('with-perl'))
|
||||
|
||||
ret = run_command([perl, '-MExtUtils::Embed', '-e', 'ccopts'])
|
||||
if ret.returncode() != 0
|
||||
error('perl: Failed to get cflags')
|
||||
endif
|
||||
foreach flag : ret.stdout().strip().split(' ')
|
||||
if flag.startswith('-I') or flag.startswith('-D')
|
||||
perl_cflags += flag
|
||||
endif
|
||||
endforeach
|
||||
|
||||
ret = run_command([perl, '-MExtUtils::Embed', '-e', 'ldopts'])
|
||||
if ret.returncode() != 0
|
||||
error('perl: Failed to get ldflags')
|
||||
endif
|
||||
perl_ldflags = []
|
||||
perl_rpath = ''
|
||||
foreach flag : ret.stdout().strip().split(' ')
|
||||
if flag.startswith('-L') or flag.startswith('-l')
|
||||
perl_ldflags += flag
|
||||
endif
|
||||
if flag.startswith('-Wl,-rpath,')
|
||||
# Install rpath
|
||||
split = flag.split(',')
|
||||
perl_rpath = split[split.length() - 1]
|
||||
|
||||
# For in tree
|
||||
perl_ldflags += flag
|
||||
endif
|
||||
endforeach
|
||||
|
||||
perl_cflags += [
|
||||
# Perl has its own 'config.h' that we must override
|
||||
# TODO: Just rename ours to something more unique.
|
||||
'-include', meson.build_root() + '/config.h'
|
||||
]
|
||||
|
||||
if not cc.links('''
|
||||
#define PERL_NO_INLINE_FUNCTIONS
|
||||
#include <EXTERN.h>
|
||||
#include <perl.h>
|
||||
|
||||
int main(void) {
|
||||
PerlInterpreter *my_perl = perl_alloc();
|
||||
return 0;
|
||||
}
|
||||
''', args: perl_cflags + perl_ldflags)
|
||||
error('found perl not suitable for plugin')
|
||||
endif
|
||||
|
||||
perl_dep = declare_dependency(
|
||||
compile_args: perl_cflags,
|
||||
link_args: perl_ldflags
|
||||
)
|
||||
|
||||
shared_module('perl',
|
||||
sources: ['perl.c', hexchat_perl_module, irc_perl_module],
|
||||
dependencies: [libgio_dep, hexchat_plugin_dep, perl_dep],
|
||||
install: true,
|
||||
install_dir: plugindir,
|
||||
install_rpath: perl_rpath,
|
||||
name_prefix: '',
|
||||
)
|
@ -29,6 +29,7 @@
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#include <stdbool.h>
|
||||
#else
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
@ -207,8 +208,6 @@ get_filename (char *word[], char *word_eol[])
|
||||
int len;
|
||||
char *file;
|
||||
|
||||
len = strlen (word[2]);
|
||||
|
||||
/* if called as /load "filename.pl" the only difference between word and
|
||||
* word_eol will be the two quotes
|
||||
*/
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Configuration">
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
@ -19,58 +20,20 @@
|
||||
<RootNamespace>perl520</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>$(PerlOutput)</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>$(PerlOutput)</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
<PropertyGroup>
|
||||
<TargetName>hcperl</TargetName>
|
||||
<OutDir>$(HexChatRel)plugins\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..;$(PerlPath)\lib\CORE;$(IntDir);..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;HAS_BOOL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);..\..\src\common;$(HexChatLib);$(PerlPath)\lib\CORE;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>$(OutDir);$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>$(IntDir);$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(PerlLib).lib;$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>perl.def</ModuleDefinitionFile>
|
||||
<DelayLoadDLLs>$(PerlLib).dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
@ -78,7 +41,7 @@
|
||||
<PreBuildEvent>
|
||||
<Command>"$(GendefPath)\gendef" "$(PerlPath)\bin\$(PerlLib).dll"
|
||||
move $(PerlLib).def "$(IntDir)"
|
||||
lib /nologo /machine:x86 "/def:$(IntDir)$(PerlLib).def" "/out:$(OutDir)\$(PerlLib).lib"
|
||||
lib /nologo /machine:x86 "/def:$(IntDir)$(PerlLib).def" "/out:$(IntDir)\$(PerlLib).lib"
|
||||
"$(PerlPath)\bin\perl.exe" generate_header
|
||||
move irc.pm.h "$(IntDir)"
|
||||
move hexchat.pm.h "$(IntDir)"</Command>
|
||||
@ -86,20 +49,11 @@ move hexchat.pm.h "$(IntDir)"</Command>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)..;$(PerlPath)\lib\CORE;$(IntDir);..\..\src\common;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PERL520_EXPORTS;HAS_BOOL;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);..\..\src\common;$(HexChatLib);$(PerlPath)\lib\CORE;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<AdditionalLibraryDirectories>$(OutDir);$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>$(IntDir);$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(PerlLib).lib;$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>perl.def</ModuleDefinitionFile>
|
||||
<DelayLoadDLLs>$(PerlLib).dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
@ -107,7 +61,7 @@ move hexchat.pm.h "$(IntDir)"</Command>
|
||||
<PreBuildEvent>
|
||||
<Command>"$(GendefPath)\gendef" "$(PerlPath)\bin\$(PerlLib).dll"
|
||||
move $(PerlLib).def "$(IntDir)"
|
||||
lib /nologo /machine:x64 "/def:$(IntDir)$(PerlLib).def" "/out:$(OutDir)\$(PerlLib).lib"
|
||||
lib /nologo /machine:x64 "/def:$(IntDir)$(PerlLib).def" "/out:$(IntDir)\$(PerlLib).lib"
|
||||
"$(PerlPath)\bin\perl.exe" generate_header
|
||||
move irc.pm.h "$(IntDir)"
|
||||
move hexchat.pm.h "$(IntDir)"</Command>
|
||||
@ -120,6 +74,4 @@ move hexchat.pm.h "$(IntDir)"</Command>
|
||||
<ClCompile Include="perl.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
@ -1,19 +0,0 @@
|
||||
AC_INIT(@PLUGIN@-config.h.in)
|
||||
AM_CONFIG_HEADER(@PLUGIN@-config.h)
|
||||
AM_INIT_AUTOMAKE(hexchat-@PLUGIN@, @PLUGIN_VERSION@)
|
||||
AM_MAINTAINER_MODE
|
||||
AM_DISABLE_STATIC
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
AC_ARG_WITH(plugin-includes,
|
||||
[ --with-plugin-includes directory containing hexchat-plugin.h],
|
||||
PLUGIN_INCLUDES=$enableval)
|
||||
|
||||
AC_SUBST(PLUGIN_INCLUDES)
|
||||
|
||||
hexchatlibdir=${libdir}/hexchat
|
||||
AC_SUBST(hexchatlibdir)
|
||||
|
||||
AC_OUTPUT(
|
||||
Makefile
|
||||
)
|
@ -1,8 +0,0 @@
|
||||
libdir = $(hexchatlibdir)
|
||||
|
||||
lib_LTLIBRARIES = python.la
|
||||
python_la_SOURCES = python.c
|
||||
python_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
|
||||
python_la_LIBADD = $(PY_LIBS) $(GLIB_LIBS)
|
||||
python_la_CFLAGS = $(PY_CFLAGS) $(GLIB_CFLAGS) -I$(top_srcdir)/src/common
|
||||
|
13
plugins/python/meson.build
Normal file
@ -0,0 +1,13 @@
|
||||
python_opt = get_option('with-python')
|
||||
if python_opt.startswith('python3')
|
||||
python_dep = dependency(python_opt, version: '>= 3.3')
|
||||
else
|
||||
python_dep = dependency(python_opt, version: '>= 2.7')
|
||||
endif
|
||||
|
||||
shared_module('python', 'python.c',
|
||||
dependencies: [libgio_dep, hexchat_plugin_dep, python_dep],
|
||||
install: true,
|
||||
install_dir: plugindir,
|
||||
name_prefix: '',
|
||||
)
|
@ -69,6 +69,8 @@
|
||||
#include "hexchat-plugin.h"
|
||||
#undef _POSIX_C_SOURCE /* Avoid warnings from /usr/include/features.h */
|
||||
#undef _XOPEN_SOURCE
|
||||
#undef HAVE_MEMRCHR /* Avoid redefinition in Python.h */
|
||||
#undef HAVE_STRINGS_H
|
||||
#include <Python.h>
|
||||
#include <structmember.h>
|
||||
#include <pythread.h>
|
||||
@ -273,7 +275,7 @@ typedef struct {
|
||||
|
||||
static PyObject *Util_BuildList(char *word[]);
|
||||
static PyObject *Util_BuildEOLList(char *word[]);
|
||||
static void Util_Autoload();
|
||||
static void Util_Autoload(void);
|
||||
static char *Util_Expand(char *filename);
|
||||
|
||||
static int Callback_Server(char *word[], char *word_eol[], hexchat_event_attrs *attrs, void *userdata);
|
||||
@ -283,7 +285,7 @@ static int Callback_Print(char *word[], void *userdata);
|
||||
static int Callback_Timer(void *userdata);
|
||||
static int Callback_ThreadTimer(void *userdata);
|
||||
|
||||
static PyObject *XChatOut_New();
|
||||
static PyObject *XChatOut_New(void);
|
||||
static PyObject *XChatOut_write(PyObject *self, PyObject *args);
|
||||
static void XChatOut_dealloc(PyObject *self);
|
||||
|
||||
@ -300,7 +302,7 @@ static PyObject *Context_FromContext(hexchat_context *context);
|
||||
static PyObject *Context_FromServerAndChannel(char *server, char *channel);
|
||||
|
||||
static PyObject *Plugin_New(char *filename, PyObject *xcoobj);
|
||||
static PyObject *Plugin_GetCurrent();
|
||||
static PyObject *Plugin_GetCurrent(void);
|
||||
static PluginObject *Plugin_ByString(char *str);
|
||||
static Hook *Plugin_AddHook(int type, PyObject *plugin, PyObject *callback,
|
||||
PyObject *userdata, char *name, void *data);
|
||||
@ -336,11 +338,11 @@ static PyObject *Module_hexchat_pluginpref_list(PyObject *self, PyObject *args);
|
||||
static void IInterp_Exec(char *command);
|
||||
static int IInterp_Cmd(char *word[], char *word_eol[], void *userdata);
|
||||
|
||||
static void Command_PyList();
|
||||
static void Command_PyList(void);
|
||||
static void Command_PyLoad(char *filename);
|
||||
static void Command_PyUnload(char *name);
|
||||
static void Command_PyReload(char *name);
|
||||
static void Command_PyAbout();
|
||||
static void Command_PyAbout(void);
|
||||
static int Command_Py(char *word[], char *word_eol[], void *userdata);
|
||||
|
||||
/* ===================================================================== */
|
||||
@ -568,7 +570,7 @@ Callback_Server(char *word[], char *word_eol[], hexchat_event_attrs *attrs, void
|
||||
PyObject *retobj;
|
||||
PyObject *word_list, *word_eol_list;
|
||||
PyObject *attributes;
|
||||
int ret = 0;
|
||||
int ret = HEXCHAT_EAT_NONE;
|
||||
PyObject *plugin;
|
||||
|
||||
plugin = hook->plugin;
|
||||
@ -577,13 +579,13 @@ Callback_Server(char *word[], char *word_eol[], hexchat_event_attrs *attrs, void
|
||||
word_list = Util_BuildList(word);
|
||||
if (word_list == NULL) {
|
||||
END_PLUGIN(plugin);
|
||||
return 0;
|
||||
return HEXCHAT_EAT_NONE;
|
||||
}
|
||||
word_eol_list = Util_BuildList(word_eol);
|
||||
if (word_eol_list == NULL) {
|
||||
Py_DECREF(word_list);
|
||||
END_PLUGIN(plugin);
|
||||
return 0;
|
||||
return HEXCHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
attributes = Attribute_New(attrs);
|
||||
@ -619,7 +621,7 @@ Callback_Command(char *word[], char *word_eol[], void *userdata)
|
||||
Hook *hook = (Hook *) userdata;
|
||||
PyObject *retobj;
|
||||
PyObject *word_list, *word_eol_list;
|
||||
int ret = 0;
|
||||
int ret = HEXCHAT_EAT_NONE;
|
||||
PyObject *plugin;
|
||||
|
||||
plugin = hook->plugin;
|
||||
@ -628,13 +630,13 @@ Callback_Command(char *word[], char *word_eol[], void *userdata)
|
||||
word_list = Util_BuildList(word);
|
||||
if (word_list == NULL) {
|
||||
END_PLUGIN(plugin);
|
||||
return 0;
|
||||
return HEXCHAT_EAT_NONE;
|
||||
}
|
||||
word_eol_list = Util_BuildList(word_eol);
|
||||
if (word_eol_list == NULL) {
|
||||
Py_DECREF(word_list);
|
||||
END_PLUGIN(plugin);
|
||||
return 0;
|
||||
return HEXCHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
retobj = PyObject_CallFunction(hook->callback, "(OOO)", word_list,
|
||||
@ -665,7 +667,7 @@ Callback_Print_Attrs(char *word[], hexchat_event_attrs *attrs, void *userdata)
|
||||
PyObject *word_list;
|
||||
PyObject *word_eol_list;
|
||||
PyObject *attributes;
|
||||
int ret = 0;
|
||||
int ret = HEXCHAT_EAT_NONE;
|
||||
PyObject *plugin;
|
||||
|
||||
plugin = hook->plugin;
|
||||
@ -674,13 +676,13 @@ Callback_Print_Attrs(char *word[], hexchat_event_attrs *attrs, void *userdata)
|
||||
word_list = Util_BuildList(word);
|
||||
if (word_list == NULL) {
|
||||
END_PLUGIN(plugin);
|
||||
return 0;
|
||||
return HEXCHAT_EAT_NONE;
|
||||
}
|
||||
word_eol_list = Util_BuildEOLList(word);
|
||||
if (word_eol_list == NULL) {
|
||||
Py_DECREF(word_list);
|
||||
END_PLUGIN(plugin);
|
||||
return 0;
|
||||
return HEXCHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
attributes = Attribute_New(attrs);
|
||||
@ -714,7 +716,7 @@ Callback_Print(char *word[], void *userdata)
|
||||
PyObject *retobj;
|
||||
PyObject *word_list;
|
||||
PyObject *word_eol_list;
|
||||
int ret = 0;
|
||||
int ret = HEXCHAT_EAT_NONE;
|
||||
PyObject *plugin;
|
||||
|
||||
plugin = hook->plugin;
|
||||
@ -723,13 +725,13 @@ Callback_Print(char *word[], void *userdata)
|
||||
word_list = Util_BuildList(word);
|
||||
if (word_list == NULL) {
|
||||
END_PLUGIN(plugin);
|
||||
return 0;
|
||||
return HEXCHAT_EAT_NONE;
|
||||
}
|
||||
word_eol_list = Util_BuildEOLList(word);
|
||||
if (word_eol_list == NULL) {
|
||||
Py_DECREF(word_list);
|
||||
END_PLUGIN(plugin);
|
||||
return 0;
|
||||
return HEXCHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
retobj = PyObject_CallFunction(hook->callback, "(OOO)", word_list,
|
||||
@ -1530,7 +1532,7 @@ Plugin_New(char *filename, PyObject *xcoobj)
|
||||
if (filename) {
|
||||
#ifdef WIN32
|
||||
char *file;
|
||||
if (!g_file_get_contents_utf8(filename, &file, NULL, NULL)) {
|
||||
if (!g_file_get_contents(filename, &file, NULL, NULL)) {
|
||||
hexchat_printf(ph, "Can't open file %s: %s\n",
|
||||
filename, strerror(errno));
|
||||
goto error;
|
||||
@ -1726,7 +1728,7 @@ Module_hexchat_get_info(PyObject *self, PyObject *args)
|
||||
if (info == NULL) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
if (strcmp (name, "gtkwin_ptr") == 0)
|
||||
if (strcmp (name, "gtkwin_ptr") == 0 || strcmp (name, "win_ptr") == 0)
|
||||
return PyUnicode_FromFormat("%p", info); /* format as pointer */
|
||||
else
|
||||
return PyUnicode_FromString(info);
|
||||
@ -1849,7 +1851,7 @@ Module_hexchat_pluginpref_get(PyObject *self, PyObject *args)
|
||||
BEGIN_XCHAT_CALLS(NONE);
|
||||
retint = hexchat_pluginpref_get_int(prefph, var);
|
||||
END_XCHAT_CALLS();
|
||||
if ((retint == 0) && (strcmp(retstr, "0") != 0))
|
||||
if ((retint == -1) && (strcmp(retstr, "-1") != 0))
|
||||
ret = PyUnicode_FromString(retstr);
|
||||
else
|
||||
ret = PyLong_FromLong(retint);
|
||||
@ -2508,9 +2510,9 @@ IInterp_Cmd(char *word[], char *word_eol[], void *userdata)
|
||||
if (channel && channel[0] == '>' && strcmp(channel, ">>python<<") == 0) {
|
||||
hexchat_printf(ph, ">>> %s\n", word_eol[1]);
|
||||
IInterp_Exec(word_eol[1]);
|
||||
return 1;
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
}
|
||||
return 0;
|
||||
return HEXCHAT_EAT_NONE;
|
||||
}
|
||||
|
||||
|
||||
@ -2518,7 +2520,7 @@ IInterp_Cmd(char *word[], char *word_eol[], void *userdata)
|
||||
/* Python command handling */
|
||||
|
||||
static void
|
||||
Command_PyList()
|
||||
Command_PyList(void)
|
||||
{
|
||||
GSList *list;
|
||||
list = plugin_list;
|
||||
@ -2585,7 +2587,7 @@ Command_PyReload(char *name)
|
||||
}
|
||||
|
||||
static void
|
||||
Command_PyAbout()
|
||||
Command_PyAbout(void)
|
||||
{
|
||||
hexchat_print(ph, about);
|
||||
}
|
||||
@ -2777,7 +2779,7 @@ hexchat_plugin_init(hexchat_plugin *plugin_handle,
|
||||
}
|
||||
|
||||
int
|
||||
hexchat_plugin_deinit()
|
||||
hexchat_plugin_deinit(void)
|
||||
{
|
||||
GSList *list;
|
||||
|
||||
@ -2804,6 +2806,9 @@ hexchat_plugin_deinit()
|
||||
xchatout_buffer = NULL;
|
||||
|
||||
if (interp_plugin) {
|
||||
PyThreadState *tstate = ((PluginObject*)interp_plugin)->tstate;
|
||||
PyThreadState_Swap(tstate);
|
||||
Py_EndInterpreter(tstate);
|
||||
Py_DECREF(interp_plugin);
|
||||
interp_plugin = NULL;
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Configuration">
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
@ -19,80 +20,33 @@
|
||||
<RootNamespace>python2</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
<PropertyGroup>
|
||||
<TargetName>$(Python2Output)</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>$(Python2Output)</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
<OutDir>$(HexChatRel)plugins\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(Glib);$(Python2Path)\include;..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>$(Glib);$(Python2Path)\include;..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>python.def</ModuleDefinitionFile>
|
||||
<AdditionalDependencies>"$(Python2Lib).lib";$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;$(OutDir);$(Python2Path)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;$(Python2Path)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(Glib);$(Python2Path)\include;..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>$(Glib);$(Python2Path)\include;..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>python.def</ModuleDefinitionFile>
|
||||
<AdditionalDependencies>"$(Python2Lib).lib";$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;$(OutDir);$(Python2Path)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;$(Python2Path)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
@ -102,6 +56,4 @@
|
||||
<ClCompile Include="python.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Configuration">
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
@ -19,80 +20,33 @@
|
||||
<RootNamespace>python3</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
<PropertyGroup>
|
||||
<TargetName>$(Python3Output)</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>$(Python3Output)</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
<OutDir>$(HexChatRel)plugins\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(Glib);$(Python3Path)\include;..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>$(Glib);$(Python3Path)\include;..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>python.def</ModuleDefinitionFile>
|
||||
<AdditionalDependencies>"$(Python3Lib).lib";$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;$(OutDir);$(Python3Path)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;$(Python3Path)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;PYTHON_EXPORTS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(Glib);$(Python3Path)\include;..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>$(Glib);$(Python3Path)\include;..\..\src\common;$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>python.def</ModuleDefinitionFile>
|
||||
<AdditionalDependencies>"$(Python3Lib).lib";$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;$(OutDir);$(Python3Path)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;$(Python3Path)\libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
@ -102,6 +56,4 @@
|
||||
<ClCompile Include="python.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
@ -1,7 +0,0 @@
|
||||
libdir = $(hexchatlibdir)
|
||||
|
||||
lib_LTLIBRARIES = sysinfo.la
|
||||
sysinfo_la_SOURCES = match.c parse.c pci.c xsys.c
|
||||
sysinfo_la_LDFLAGS = $(PLUGIN_LDFLAGS) -module
|
||||
sysinfo_la_LIBADD = $(LIBPCI_LIBS) $(GLIB_LIBS)
|
||||
sysinfo_la_CFLAGS = $(LIBPCI_CFLAGS) $(GLIB_CFLAGS) -I$(srcdir)/../../src/common
|
90
plugins/sysinfo/format.c
Normal file
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* SysInfo - sysinfo plugin for HexChat
|
||||
* Copyright (c) 2015 Patrick Griffis.
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
char *
|
||||
sysinfo_format_uptime (gint64 uptime)
|
||||
{
|
||||
char buffer[128];
|
||||
|
||||
gint64 weeks = uptime / 604800;
|
||||
int days = (uptime / 86400) % 7;
|
||||
int hours = (uptime / 3600) % 24;
|
||||
int minutes = (uptime / 60) % 60;
|
||||
int seconds = uptime % 60;
|
||||
|
||||
if (weeks != 0)
|
||||
{
|
||||
g_snprintf (buffer, sizeof(buffer), "%" G_GINT64_FORMAT "w %dd %dh %dm %ds", weeks, days, hours, minutes, seconds);
|
||||
}
|
||||
else if (days != 0)
|
||||
{
|
||||
g_snprintf (buffer, sizeof(buffer), "%dd %dh %dm %ds", days, hours, minutes, seconds);
|
||||
}
|
||||
else if (hours != 0)
|
||||
{
|
||||
g_snprintf (buffer, sizeof(buffer), "%dh %dm %ds", hours, minutes, seconds);
|
||||
}
|
||||
else if (minutes != 0)
|
||||
{
|
||||
g_snprintf (buffer, sizeof(buffer), "%dm %ds", minutes, seconds);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_snprintf (buffer, sizeof(buffer), "%ds", seconds);
|
||||
}
|
||||
|
||||
return g_strdup (buffer);
|
||||
}
|
||||
|
||||
char *
|
||||
sysinfo_format_memory (guint64 totalmem, guint64 freemem)
|
||||
{
|
||||
char *total_fmt, *free_fmt, *ret;
|
||||
|
||||
total_fmt = g_format_size_full (totalmem, G_FORMAT_SIZE_IEC_UNITS);
|
||||
free_fmt = g_format_size_full (freemem, G_FORMAT_SIZE_IEC_UNITS);
|
||||
ret = g_strdup_printf ("%s Total (%s Free)", total_fmt, free_fmt);
|
||||
|
||||
g_free (total_fmt);
|
||||
g_free (free_fmt);
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *
|
||||
sysinfo_format_disk (guint64 total, guint64 free)
|
||||
{
|
||||
char *total_fmt, *free_fmt, *used_fmt, *ret;
|
||||
GFormatSizeFlags format_flags = G_FORMAT_SIZE_DEFAULT;
|
||||
|
||||
#ifdef WIN32 /* Windows uses IEC size (with SI format) */
|
||||
format_flags = G_FORMAT_SIZE_IEC_UNITS;
|
||||
#endif
|
||||
|
||||
total_fmt = g_format_size_full (total, format_flags);
|
||||
free_fmt = g_format_size_full (free, format_flags);
|
||||
used_fmt = g_format_size_full (total - free, format_flags);
|
||||
ret = g_strdup_printf ("%s / %s (%s Free)", used_fmt, total_fmt, free_fmt);
|
||||
|
||||
g_free (total_fmt);
|
||||
g_free (free_fmt);
|
||||
g_free (used_fmt);
|
||||
return ret;
|
||||
}
|
28
plugins/sysinfo/format.h
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* SysInfo - sysinfo plugin for HexChat
|
||||
* Copyright (c) 2015 Patrick Griffis.
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FORMAT_H
|
||||
#define FORMAT_H
|
||||
|
||||
char *sysinfo_format_uptime(gint64 uptime);
|
||||
char *sysinfo_format_memory(guint64 totalmem, guint64 freemem);
|
||||
char *sysinfo_format_disk(guint64 total, guint64 free);
|
||||
|
||||
#endif
|
@ -1,228 +0,0 @@
|
||||
/*
|
||||
* match.c - matching functions for X-Sys
|
||||
* Copyright (C) 2005, 2006, 2007 Tony Vroon
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <glib.h>
|
||||
#include "xsys.h"
|
||||
|
||||
float percentage(unsigned long long *free, unsigned long long *total)
|
||||
{
|
||||
unsigned long long result = (*free) * (unsigned long long)1000 / (*total);
|
||||
return result / 10.0;
|
||||
}
|
||||
|
||||
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 = g_new(char, bsize);
|
||||
if (total_space == 0)
|
||||
{
|
||||
g_snprintf(result, bsize, "%s: none", desc);
|
||||
return result;
|
||||
}
|
||||
quantity = quantities;
|
||||
while (total_space > 1023 && *(quantity + 1))
|
||||
{
|
||||
quantity++;
|
||||
free_space = free_space / 1024;
|
||||
total_space = total_space / 1024;
|
||||
}
|
||||
if (sysinfo_get_percent () != 0)
|
||||
g_snprintf(result, bsize, "%s: %.1f%s, %.1f%% free",
|
||||
desc, total_space, *quantity,
|
||||
percentage(free_k, total_k));
|
||||
else
|
||||
g_snprintf(result, bsize, "%s: %.1f%s/%.1f%s free",
|
||||
desc, free_space, *quantity, total_space, *quantity);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void remove_leading_whitespace(char *buffer)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (buffer == NULL)
|
||||
return;
|
||||
|
||||
for (p = buffer; *p && isspace (*p); p++)
|
||||
;
|
||||
|
||||
memmove (buffer, p, strlen (p) + 1);
|
||||
}
|
||||
|
||||
char *decruft_filename(char *buffer)
|
||||
{
|
||||
char *match, *match_end;
|
||||
|
||||
while ((match = strstr(buffer, "%20")))
|
||||
{
|
||||
match_end = match + 3;
|
||||
*match++ = ' ';
|
||||
while (*match_end)
|
||||
*match++ = *match_end++;
|
||||
*match = 0;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
void find_match_char(char *buffer, char *match, char *result)
|
||||
{
|
||||
char *position;
|
||||
remove_leading_whitespace(buffer);
|
||||
if(strstr(buffer, match) == strstr(buffer, buffer))
|
||||
{
|
||||
position = strpbrk(buffer, delims);
|
||||
if (position != NULL) {
|
||||
position += 1;
|
||||
strcpy(result, position);
|
||||
position = strstr(result, "\n");
|
||||
*(position) = '\0';
|
||||
remove_leading_whitespace(result);
|
||||
}
|
||||
else
|
||||
strcpy(result, "\0");
|
||||
}
|
||||
}
|
||||
|
||||
void find_match_double(char *buffer, char *match, double *result)
|
||||
{
|
||||
char *position;
|
||||
remove_leading_whitespace(buffer);
|
||||
if(strstr(buffer, match) == strstr(buffer, buffer))
|
||||
{
|
||||
position = strpbrk(buffer, delims);
|
||||
if (position != NULL) {
|
||||
position += 1;
|
||||
*result = strtod(position, NULL);
|
||||
}
|
||||
else
|
||||
*result = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void find_match_double_hex(char *buffer, char *match, double *result)
|
||||
{
|
||||
char *position;
|
||||
remove_leading_whitespace(buffer);
|
||||
if(strstr(buffer, match) == strstr(buffer, buffer))
|
||||
{
|
||||
position = strpbrk(buffer, delims);
|
||||
if (position != NULL) {
|
||||
memcpy(position,"0x",2);
|
||||
*result = strtod(position,NULL);
|
||||
}
|
||||
else
|
||||
*result = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void find_match_int(char *buffer, char *match, unsigned int *result)
|
||||
{
|
||||
char *position;
|
||||
remove_leading_whitespace(buffer);
|
||||
if(strstr(buffer, match) == strstr(buffer, buffer))
|
||||
{
|
||||
position = strpbrk(buffer, delims);
|
||||
if (position != NULL) {
|
||||
position += 1;
|
||||
*result = atoi(position);
|
||||
}
|
||||
else
|
||||
*result = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void find_match_ll(char *buffer, char *match, unsigned long long *result)
|
||||
{
|
||||
char *position;
|
||||
remove_leading_whitespace(buffer);
|
||||
if(strstr(buffer, match) == strstr(buffer, buffer))
|
||||
{
|
||||
position = strpbrk(buffer, delims);
|
||||
if (position != NULL) {
|
||||
position += 1;
|
||||
*result = strtoll(position, NULL, 10);
|
||||
}
|
||||
else
|
||||
*result = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void format_output(const char *arg, char *string, char *format)
|
||||
{
|
||||
char *pos1, *pos2, buffer[bsize];
|
||||
pos1 = &format[0];
|
||||
strncpy(buffer, string, bsize);
|
||||
string[0] = '\0';
|
||||
|
||||
while((pos2 = strstr(pos1, "%")) != NULL)
|
||||
{
|
||||
strncat(string, pos1, (size_t)(pos2-pos1));
|
||||
if(*(pos2+1) == '1')
|
||||
strcat(string, arg);
|
||||
else if(*(pos2+1) == '2')
|
||||
strcat(string, buffer);
|
||||
else if(*(pos2+1) == 'C' || *(pos2+1) == 'c')
|
||||
strcat(string, "\003");
|
||||
else if(*(pos2+1) == 'B' || *(pos2+1) == 'b')
|
||||
strcat(string, "\002");
|
||||
else if(*(pos2+1) == 'R' || *(pos2+1) == 'r')
|
||||
strcat(string, "\026");
|
||||
else if(*(pos2+1) == 'O' || *(pos2+1) == 'o')
|
||||
strcat(string, "\017");
|
||||
else if(*(pos2+1) == 'U' || *(pos2+1) == 'u')
|
||||
strcat(string, "\037");
|
||||
else if(*(pos2+1) == '%')
|
||||
strcat(string, "%");
|
||||
pos1=pos2+2;
|
||||
}
|
||||
|
||||
strcat(string, pos1);
|
||||
}
|
||||
|
||||
void flat_format_output(const char *arg, char *string, char *format)
|
||||
{
|
||||
char *pos1, *pos2, buffer[bsize];
|
||||
pos1 = &format[0];
|
||||
strncpy(buffer, string, bsize);
|
||||
string[0] = '\0';
|
||||
|
||||
while((pos2 = strstr(pos1, "%")) != NULL)
|
||||
{
|
||||
strncat(string, pos1, (size_t)(pos2-pos1));
|
||||
if(*(pos2+1) == '1')
|
||||
strcat(string, arg);
|
||||
else if(*(pos2+1) == '2')
|
||||
strcat(string, buffer);
|
||||
else if(*(pos2+1) == '%')
|
||||
strcat(string, "%");
|
||||
pos1=pos2+2;
|
||||
}
|
||||
|
||||
strcat(string, pos1);
|
||||
}
|
60
plugins/sysinfo/meson.build
Normal file
@ -0,0 +1,60 @@
|
||||
sysinfo_sources = [
|
||||
'format.c',
|
||||
'sysinfo.c',
|
||||
]
|
||||
|
||||
sysinfo_deps = [
|
||||
libgio_dep,
|
||||
hexchat_plugin_dep,
|
||||
common_sysinfo_deps,
|
||||
]
|
||||
|
||||
sysinfo_includes = []
|
||||
sysinfo_cargs = []
|
||||
|
||||
system = host_machine.system()
|
||||
if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system == 'darwin'
|
||||
sysinfo_includes += 'shared'
|
||||
sysinfo_sources += [
|
||||
'shared/df.c'
|
||||
]
|
||||
|
||||
if system == 'linux' or system == 'gnu' or system.startswith('gnu/')
|
||||
libpci = dependency('libpci', required: false, method: 'pkg-config')
|
||||
if libpci.found()
|
||||
sysinfo_deps += libpci
|
||||
sysinfo_cargs += '-DHAVE_LIBPCI'
|
||||
sysinfo_sources += 'unix/pci.c'
|
||||
|
||||
picidsdir = libpci.get_pkgconfig_variable('idsdir')
|
||||
pciids = join_paths(picidsdir, 'pci.ids')
|
||||
sysinfo_cargs += '-DPCIIDS_FILE="@0@"'.format(pciids)
|
||||
endif
|
||||
sysinfo_includes += 'unix'
|
||||
sysinfo_sources += [
|
||||
'unix/backend.c',
|
||||
'unix/match.c',
|
||||
'unix/parse.c',
|
||||
]
|
||||
elif system == 'darwin'
|
||||
add_languages('objc')
|
||||
sysinfo_sources += 'osx/backend.m'
|
||||
endif
|
||||
|
||||
elif system == 'windows'
|
||||
sysinfo_sources += [
|
||||
'win32/backend.c',
|
||||
'../../src/common/sysinfo/win32/backend.c'
|
||||
]
|
||||
else
|
||||
error('sysinfo: Unknown system?')
|
||||
endif
|
||||
|
||||
shared_module('sysinfo', sysinfo_sources,
|
||||
dependencies: sysinfo_deps,
|
||||
include_directories: include_directories(sysinfo_includes),
|
||||
c_args: sysinfo_cargs,
|
||||
install: true,
|
||||
install_dir: plugindir,
|
||||
name_prefix: '',
|
||||
)
|
275
plugins/sysinfo/osx/backend.m
Normal file
@ -0,0 +1,275 @@
|
||||
/*
|
||||
* SysInfo - sysinfo plugin for HexChat
|
||||
* Copyright (c) 2015 Patrick Griffis.
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/*
|
||||
* Some snippets based upon Textual's System Profiler plugin.
|
||||
* https://github.com/Codeux-Software/Textual
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#include <sys/sysctl.h>
|
||||
#include <mach/mach.h>
|
||||
#include <mach/mach_host.h>
|
||||
#include <mach/host_info.h>
|
||||
#include <mach/mach_vm.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "format.h"
|
||||
#include "df.h"
|
||||
|
||||
static char *
|
||||
get_os (void)
|
||||
{
|
||||
NSDictionary *systemversion = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"];
|
||||
NSString *build = [systemversion objectForKey:@"ProductBuildVersion"];
|
||||
if (!build)
|
||||
return NULL;
|
||||
NSString *version = [systemversion objectForKey:@"ProductUserVisibleVersion"];
|
||||
if (!version)
|
||||
{
|
||||
[build release];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
NSDictionary *profiler = [NSDictionary dictionaryWithContentsOfFile:[@"~/Library/Preferences/com.apple.SystemProfiler.plist" stringByExpandingTildeInPath]];
|
||||
NSDictionary *names = [profiler objectForKey:@"OS Names"];
|
||||
NSString *os_name = nil;
|
||||
|
||||
for (NSString *name in names)
|
||||
{
|
||||
if ([name hasPrefix:build])
|
||||
{
|
||||
os_name = [names objectForKey:name];
|
||||
break;
|
||||
}
|
||||
}
|
||||
[build release];
|
||||
|
||||
if (!os_name)
|
||||
{
|
||||
[version release];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *ret = g_strdup_printf ("%s %s", [os_name UTF8String], [version UTF8String]);
|
||||
[version release];
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *
|
||||
get_os_fallback (void)
|
||||
{
|
||||
#if !defined (MAC_OS_X_VERSION_10_9) || MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_9
|
||||
SInt32 ver_major = 0,
|
||||
ver_minor = 0,
|
||||
ver_patch = 0;
|
||||
|
||||
Gestalt (gestaltSystemVersionMajor, &ver_major);
|
||||
Gestalt (gestaltSystemVersionMinor, &ver_minor);
|
||||
Gestalt (gestaltSystemVersionBugFix, &ver_patch);
|
||||
|
||||
return g_strdup_printf ("OS X %d.%d.%d", ver_major, ver_minor, ver_patch);
|
||||
#else
|
||||
NSProcessInfo *info = [NSProcessInfo processInfo];
|
||||
NSOperatingSystemVersion version = [info operatingSystemVersion];
|
||||
|
||||
return g_strdup_printf ("OS X %ld.%ld.%ld", version.majorVersion, version.minorVersion, version.patchVersion);
|
||||
#endif
|
||||
}
|
||||
char *
|
||||
sysinfo_backend_get_os(void)
|
||||
{
|
||||
static char *os_str = NULL;
|
||||
if (!os_str)
|
||||
{
|
||||
os_str = get_os();
|
||||
if (!os_str)
|
||||
os_str = get_os_fallback();
|
||||
}
|
||||
return g_strdup (os_str);
|
||||
}
|
||||
|
||||
char *
|
||||
sysinfo_backend_get_disk(void)
|
||||
{
|
||||
gint64 total, free_space;
|
||||
|
||||
if (xs_parse_df (&total, &free_space))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return sysinfo_format_disk (total, free_space);
|
||||
}
|
||||
|
||||
static guint64
|
||||
get_free_memory (void)
|
||||
{
|
||||
mach_msg_type_number_t infoCount = (sizeof(vm_statistics_data_t) / sizeof(natural_t));
|
||||
|
||||
vm_size_t pagesize;
|
||||
vm_statistics_data_t vm_stat;
|
||||
|
||||
host_page_size(mach_host_self(), &pagesize);
|
||||
|
||||
if (host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&vm_stat, &infoCount) == KERN_SUCCESS)
|
||||
return ((vm_stat.inactive_count + vm_stat.free_count) * pagesize);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *
|
||||
sysinfo_backend_get_memory(void)
|
||||
{
|
||||
NSProcessInfo *info = [NSProcessInfo processInfo];
|
||||
guint64 totalmem, freemem;
|
||||
|
||||
totalmem = [info physicalMemory];
|
||||
|
||||
if ((freemem = get_free_memory()) == 0)
|
||||
return NULL;
|
||||
|
||||
return sysinfo_format_memory (totalmem, freemem);
|
||||
}
|
||||
|
||||
char *
|
||||
sysinfo_backend_get_cpu(void)
|
||||
{
|
||||
guint64 cpu_clock_uint = 0;
|
||||
double cpu_clock;
|
||||
char cpu_string[256];
|
||||
gsize len;
|
||||
gboolean giga = FALSE;
|
||||
|
||||
len = sizeof(cpu_string);
|
||||
if (sysctlbyname ("machdep.cpu.brand_string", cpu_string, &len, NULL, 0) != 0)
|
||||
return NULL;
|
||||
cpu_string[sizeof(cpu_string) - 1] = '\0';
|
||||
|
||||
len = sizeof(cpu_clock_uint);
|
||||
if (sysctlbyname("hw.cpufrequency", &cpu_clock_uint, &len, NULL, 0) < 0)
|
||||
return NULL;
|
||||
|
||||
cpu_clock = cpu_clock_uint / 1000000;
|
||||
if (cpu_clock > 1000)
|
||||
{
|
||||
cpu_clock /= 1000;
|
||||
giga = TRUE;
|
||||
}
|
||||
|
||||
if (giga)
|
||||
return g_strdup_printf ("%s (%.2fGHz)", cpu_string, cpu_clock);
|
||||
else
|
||||
return g_strdup_printf ("%s (%.0fMHz)", cpu_string, cpu_clock);
|
||||
}
|
||||
|
||||
static char *
|
||||
get_gpu(void)
|
||||
{
|
||||
CFMutableDictionaryRef pciDevices = IOServiceMatching("IOPCIDevice");
|
||||
io_iterator_t entry_iterator, serviceObject;
|
||||
|
||||
if (IOServiceGetMatchingServices(kIOMasterPortDefault, pciDevices, &entry_iterator) != kIOReturnSuccess)
|
||||
return NULL;
|
||||
|
||||
GString *gpu_list = g_string_new(NULL);
|
||||
while ((serviceObject = IOIteratorNext(entry_iterator)))
|
||||
{
|
||||
CFMutableDictionaryRef serviceDictionary;
|
||||
|
||||
kern_return_t status = IORegistryEntryCreateCFProperties(serviceObject, &serviceDictionary,
|
||||
kCFAllocatorDefault, kNilOptions);
|
||||
|
||||
if (status != kIOReturnSuccess)
|
||||
{
|
||||
IOObjectRelease(serviceObject);
|
||||
continue;
|
||||
}
|
||||
|
||||
const void *class = CFDictionaryGetValue(serviceDictionary, @"class-code");
|
||||
if (!class || *(guint32*)CFDataGetBytePtr(class) != 0x30000) /* DISPLAY_VGA */
|
||||
{
|
||||
CFRelease(serviceDictionary);
|
||||
continue;
|
||||
}
|
||||
|
||||
const void *model = CFDictionaryGetValue(serviceDictionary, @"model");
|
||||
if (model)
|
||||
{
|
||||
if (CFGetTypeID(model) == CFDataGetTypeID() && CFDataGetLength(model) > 1)
|
||||
{
|
||||
if (gpu_list->len != 0)
|
||||
g_string_append (gpu_list, ", ");
|
||||
g_string_append_len (gpu_list, (const char*)CFDataGetBytePtr(model), CFDataGetLength(model) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
CFRelease(serviceDictionary);
|
||||
}
|
||||
|
||||
if (gpu_list->len == 0)
|
||||
{
|
||||
g_string_free (gpu_list, TRUE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* The string may contain nul-chars we must replace */
|
||||
int i;
|
||||
for (i = 0; i < gpu_list->len; i++)
|
||||
{
|
||||
if (gpu_list->str[i] == '\0')
|
||||
gpu_list->str[i] = ' ';
|
||||
}
|
||||
|
||||
return g_string_free (gpu_list, FALSE);
|
||||
}
|
||||
|
||||
char *
|
||||
sysinfo_backend_get_gpu(void)
|
||||
{
|
||||
static char *gpu_str = NULL;
|
||||
if (!gpu_str)
|
||||
gpu_str = get_gpu();
|
||||
|
||||
return g_strdup (gpu_str);
|
||||
}
|
||||
|
||||
char *
|
||||
sysinfo_backend_get_sound(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
sysinfo_backend_get_uptime(void)
|
||||
{
|
||||
NSProcessInfo *info = [NSProcessInfo processInfo];
|
||||
double uptime = [info systemUptime];
|
||||
|
||||
return sysinfo_format_uptime ((gint64)uptime);
|
||||
}
|
||||
|
||||
char *
|
||||
sysinfo_backend_get_network(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
@ -1,158 +0,0 @@
|
||||
/*
|
||||
* pci.c - PCI functions for X-Sys
|
||||
* Copyright (C) 1997-1999 Martin Mares <mj@atrey.karlin.mff.cuni.cz> [PCI routines from lspci]
|
||||
* Copyright (C) 2000 Tom Rini <trini@kernel.crashing.org> [XorgAutoConfig pci.c, based on lspci]
|
||||
* Copyright (C) 2005, 2006 Tony Vroon
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <pci/pci.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include "xsys.h"
|
||||
|
||||
static struct pci_filter filter; /* Device filter */
|
||||
static struct pci_access *pacc;
|
||||
int bus, dev, func; /* Location of the card */
|
||||
|
||||
struct device {
|
||||
struct device *next;
|
||||
struct pci_dev *dev;
|
||||
unsigned int config_cnt;
|
||||
u8 config[256];
|
||||
};
|
||||
|
||||
static struct device *first_dev;
|
||||
|
||||
static struct device *scan_device(struct pci_dev *p)
|
||||
{
|
||||
int how_much = 64;
|
||||
struct device *d;
|
||||
|
||||
if (!pci_filter_match(&filter, p))
|
||||
return NULL;
|
||||
d = g_new0 (struct device, 1);
|
||||
d->dev = p;
|
||||
if (!pci_read_block(p, 0, d->config, how_much))
|
||||
exit(1);
|
||||
if (how_much < 128 && (d->config[PCI_HEADER_TYPE] & 0x7f) == PCI_HEADER_TYPE_CARDBUS) {
|
||||
/* For cardbus bridges, we need to fetch 64 bytes more to get the full standard header... */
|
||||
if (!pci_read_block(p, 64, d->config+64, 64))
|
||||
exit(1);
|
||||
how_much = 128;
|
||||
}
|
||||
d->config_cnt = how_much;
|
||||
pci_setup_cache(p, d->config, d->config_cnt);
|
||||
pci_fill_info(p, PCI_FILL_IDENT);
|
||||
return d;
|
||||
}
|
||||
|
||||
static void scan_devices(void)
|
||||
{
|
||||
struct device *d;
|
||||
struct pci_dev *p;
|
||||
|
||||
pci_scan_bus(pacc);
|
||||
for(p=pacc->devices; p; p=p->next)
|
||||
if ((d = scan_device(p))) {
|
||||
d->next = first_dev;
|
||||
first_dev = d;
|
||||
}
|
||||
}
|
||||
|
||||
static u16 get_conf_word(struct device *d, unsigned int pos)
|
||||
{
|
||||
return d->config[pos] | (d->config[pos+1] << 8);
|
||||
}
|
||||
|
||||
int pci_find_by_class(u16 *class, char *vendor, char *device)
|
||||
{
|
||||
struct device *d;
|
||||
struct pci_dev *p;
|
||||
int nomatch = 1;
|
||||
|
||||
pacc = pci_alloc();
|
||||
pci_filter_init(pacc, &filter);
|
||||
pci_init(pacc);
|
||||
scan_devices();
|
||||
|
||||
for(d=first_dev; d; d=d->next) {
|
||||
p = d->dev;
|
||||
/* Acquire vendor & device ID if the class matches */
|
||||
if(get_conf_word(d, PCI_CLASS_DEVICE) == *class) {
|
||||
nomatch = 0;
|
||||
g_snprintf(vendor,7,"%04x",p->vendor_id);
|
||||
g_snprintf(device,7,"%04x",p->device_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pci_cleanup(pacc);
|
||||
return nomatch;
|
||||
}
|
||||
|
||||
void pci_find_fullname(char *fullname, char *vendor, char *device)
|
||||
{
|
||||
char buffer[bsize];
|
||||
char vendorname[bsize/2] = "";
|
||||
char devicename[bsize/2] = "";
|
||||
char *position;
|
||||
int cardfound = 0;
|
||||
FILE *fp;
|
||||
|
||||
sysinfo_get_pciids (buffer);
|
||||
fp = fopen (buffer, "r");
|
||||
|
||||
if(fp == NULL) {
|
||||
g_snprintf(fullname, bsize, "%s:%s", vendor, device);
|
||||
sysinfo_print_error ("pci.ids file not found! You might want to adjust your pciids setting with /SYSINFO SET pciids (you can query its current value with /SYSINFO LIST).\n");
|
||||
return;
|
||||
}
|
||||
|
||||
while(fgets(buffer, bsize, fp) != NULL) {
|
||||
if (!isspace(buffer[0]) && strstr(buffer, vendor) != NULL) {
|
||||
position = strstr(buffer, vendor);
|
||||
position += 6;
|
||||
strncpy(vendorname, position, bsize/2);
|
||||
position = strstr(vendorname, "\n");
|
||||
*(position) = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
while(fgets(buffer, bsize, fp) != NULL) {
|
||||
if(strstr(buffer, device) != NULL) {
|
||||
position = strstr(buffer, device);
|
||||
position += 6;
|
||||
strncpy(devicename, position, bsize/2);
|
||||
position = strstr(devicename, " (");
|
||||
if (position == NULL)
|
||||
position = strstr(devicename, "\n");
|
||||
*(position) = '\0';
|
||||
cardfound = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (cardfound == 1)
|
||||
g_snprintf(fullname, bsize, "%s %s", vendorname, devicename);
|
||||
else
|
||||
g_snprintf(fullname, bsize, "%s:%s", vendor, device);
|
||||
fclose(fp);
|
||||
}
|
53
plugins/sysinfo/shared/df.c
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include "sysinfo.h"
|
||||
|
||||
int xs_parse_df(gint64 *out_total, gint64 *out_free)
|
||||
{
|
||||
FILE *pipe;
|
||||
char buffer[bsize];
|
||||
|
||||
pipe = popen("df -k -l -P --exclude-type=squashfs --exclude-type=devtmpfs --exclude-type=tmpfs", "r");
|
||||
if(pipe==NULL)
|
||||
return 1;
|
||||
|
||||
*out_total = *out_free = 0;
|
||||
|
||||
while(fgets(buffer, bsize, pipe) != NULL)
|
||||
{
|
||||
long long int avail, total;
|
||||
|
||||
/* Filesystem 1024-blocks Used Available Capacity Mounted-on */
|
||||
if (sscanf (buffer, "%*s %lld %*s %lld %*s %*s", &total, &avail) == 2)
|
||||
{
|
||||
*out_total += total;
|
||||
*out_free += avail;
|
||||
}
|
||||
}
|
||||
|
||||
/* Convert to bytes */
|
||||
*out_total *= 1000;
|
||||
*out_free *= 1000;
|
||||
|
||||
pclose(pipe);
|
||||
return 0;
|
||||
}
|
23
plugins/sysinfo/shared/df.h
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SYSINFO_SHARED_H
|
||||
#define SYSINFO_SHARED_H
|
||||
|
||||
int xs_parse_df(gint64 *total_bytes, gint64 *free_bytes);
|
||||
|
||||
#endif
|
33
plugins/sysinfo/sysinfo-backend.h
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* SysInfo - sysinfo plugin for HexChat
|
||||
* Copyright (c) 2015 Patrick Griffis.
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SYSINFO_BACKEND_H
|
||||
#define SYSINFO_BACKEND_H
|
||||
|
||||
char *sysinfo_backend_get_os(void);
|
||||
char *sysinfo_backend_get_disk(void);
|
||||
char *sysinfo_backend_get_memory(void);
|
||||
char *sysinfo_backend_get_cpu(void);
|
||||
char *sysinfo_backend_get_gpu(void);
|
||||
char *sysinfo_backend_get_sound(void);
|
||||
char *sysinfo_backend_get_uptime(void);
|
||||
char *sysinfo_backend_get_network(void);
|
||||
|
||||
#endif
|
249
plugins/sysinfo/sysinfo.c
Normal file
@ -0,0 +1,249 @@
|
||||
/*
|
||||
* SysInfo - sysinfo plugin for HexChat
|
||||
* Copyright (c) 2012 Berke Viktor.
|
||||
*
|
||||
* xsys.c - main functions for X-Sys 2
|
||||
* by mikeshoup
|
||||
* Copyright (C) 2003, 2004, 2005 Michael Shoup
|
||||
* Copyright (C) 2005, 2006, 2007 Tony Vroon
|
||||
*
|
||||
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include "hexchat-plugin.h"
|
||||
#include "sysinfo-backend.h"
|
||||
#include "sysinfo.h"
|
||||
|
||||
#define _(x) hexchat_gettext(ph,x)
|
||||
#define DEFAULT_ANNOUNCE TRUE
|
||||
|
||||
static hexchat_plugin *ph;
|
||||
|
||||
static char name[] = "Sysinfo";
|
||||
static char desc[] = "Display info about your hardware and OS";
|
||||
static char version[] = "1.0";
|
||||
static char sysinfo_help[] = "SysInfo Usage:\n /SYSINFO [-e|-o] [CLIENT|OS|CPU|RAM|DISK|VGA|SOUND|ETHERNET|UPTIME], print various details about your system or print a summary without arguments\n /SYSINFO SET <variable>\n";
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const char *name; /* Lower case name used for prefs */
|
||||
const char *title; /* Used for the end formatting */
|
||||
char *(*callback) (void);
|
||||
gboolean def; /* Hide by default? */
|
||||
} hwinfo;
|
||||
|
||||
static char *
|
||||
get_client (void)
|
||||
{
|
||||
return g_strdup_printf ("HexChat %s", hexchat_get_info(ph, "version"));
|
||||
}
|
||||
|
||||
static hwinfo hwinfos[] = {
|
||||
{"client", "Client", get_client},
|
||||
{"os", "OS", sysinfo_backend_get_os},
|
||||
{"cpu", "CPU", sysinfo_backend_get_cpu},
|
||||
{"memory", "Memory", sysinfo_backend_get_memory},
|
||||
{"storage", "Storage", sysinfo_backend_get_disk},
|
||||
{"vga", "VGA", sysinfo_backend_get_gpu},
|
||||
{"sound", "Sound", sysinfo_backend_get_sound, TRUE},
|
||||
{"ethernet", "Ethernet", sysinfo_backend_get_network, TRUE},
|
||||
{"uptime", "Uptime", sysinfo_backend_get_uptime},
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
||||
static gboolean sysinfo_get_bool_pref (const char *pref, gboolean def);
|
||||
|
||||
static gboolean
|
||||
should_show_info (hwinfo info)
|
||||
{
|
||||
char hide_pref[32];
|
||||
|
||||
g_snprintf (hide_pref, sizeof(hide_pref), "hide_%s", info.name);
|
||||
return !sysinfo_get_bool_pref (hide_pref, info.def);
|
||||
}
|
||||
|
||||
static void
|
||||
print_summary (gboolean announce)
|
||||
{
|
||||
char **strings = g_new0 (char*, G_N_ELEMENTS(hwinfos));
|
||||
int i, x;
|
||||
char *output;
|
||||
|
||||
for (i = 0, x = 0; hwinfos[i].name != NULL; i++)
|
||||
{
|
||||
if (should_show_info (hwinfos[i]))
|
||||
{
|
||||
char *str = hwinfos[i].callback();
|
||||
if (str)
|
||||
{
|
||||
strings[x++] = g_strdup_printf ("\002%s\002: %s", hwinfos[i].title, str);
|
||||
g_free (str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
output = g_strjoinv (" \002\342\200\242\002 ", strings);
|
||||
hexchat_commandf (ph, "%s %s", announce ? "SAY" : "ECHO", output);
|
||||
|
||||
g_strfreev (strings);
|
||||
g_free (output);
|
||||
}
|
||||
|
||||
static void
|
||||
print_info (char *info, gboolean announce)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; hwinfos[i].name != NULL; i++)
|
||||
{
|
||||
if (!g_ascii_strcasecmp (info, hwinfos[i].name))
|
||||
{
|
||||
char *str = hwinfos[i].callback();
|
||||
if (str)
|
||||
{
|
||||
hexchat_commandf (ph, "%s \002%s\002: %s", announce ? "SAY" : "ECHO",
|
||||
hwinfos[i].title, str);
|
||||
g_free (str);
|
||||
}
|
||||
else
|
||||
hexchat_print (ph, _("Sysinfo: Failed to get info. Either not supported or error."));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
hexchat_print (ph, _("Sysinfo: No info by that name\n"));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
sysinfo_get_bool_pref (const char *pref, gboolean def)
|
||||
{
|
||||
int value = hexchat_pluginpref_get_int (ph, pref);
|
||||
|
||||
if (value != -1)
|
||||
return value;
|
||||
|
||||
return def;
|
||||
}
|
||||
|
||||
static void
|
||||
sysinfo_set_pref_real (const char *pref, char *value, gboolean def)
|
||||
{
|
||||
if (value && value[0])
|
||||
{
|
||||
guint64 i = g_ascii_strtoull (value, NULL, 0);
|
||||
hexchat_pluginpref_set_int (ph, pref, i != 0);
|
||||
hexchat_printf (ph, _("Sysinfo: %s is set to: %d\n"), pref, i != 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
hexchat_printf (ph, _("Sysinfo: %s is set to: %d\n"), pref,
|
||||
sysinfo_get_bool_pref(pref, def));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sysinfo_set_pref (char *key, char *value)
|
||||
{
|
||||
if (!key || !key[0])
|
||||
{
|
||||
hexchat_print (ph, _("Sysinfo: Valid settings are: announce and hide_* for each piece of information. e.g. hide_os. Without a value it will show current (or default) setting.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcmp (key, "announce"))
|
||||
{
|
||||
sysinfo_set_pref_real (key, value, DEFAULT_ANNOUNCE);
|
||||
return;
|
||||
}
|
||||
else if (g_str_has_prefix (key, "hide_"))
|
||||
{
|
||||
int i;
|
||||
for (i = 0; hwinfos[i].name != NULL; i++)
|
||||
{
|
||||
if (!strcmp (key + 5, hwinfos[i].name))
|
||||
{
|
||||
sysinfo_set_pref_real (key, value, hwinfos[i].def);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hexchat_print (ph, _("Sysinfo: Invalid variable name\n"));
|
||||
}
|
||||
|
||||
static int
|
||||
sysinfo_cb (char *word[], char *word_eol[], void *userdata)
|
||||
{
|
||||
gboolean announce = sysinfo_get_bool_pref("announce", DEFAULT_ANNOUNCE);
|
||||
int offset = 0, channel_type;
|
||||
char *cmd;
|
||||
|
||||
/* Allow overriding global announce setting */
|
||||
if (!strcmp ("-e", word[2]))
|
||||
{
|
||||
announce = FALSE;
|
||||
offset++;
|
||||
}
|
||||
else if (!strcmp ("-o", word[2]))
|
||||
{
|
||||
announce = TRUE;
|
||||
offset++;
|
||||
}
|
||||
|
||||
/* Cannot send to server tab */
|
||||
channel_type = hexchat_list_int (ph, NULL, "type");
|
||||
if (channel_type != 2 /* SESS_CHANNEL */ && channel_type != 3 /* SESS_DIALOG */)
|
||||
announce = FALSE;
|
||||
|
||||
cmd = word[2+offset];
|
||||
if (!g_ascii_strcasecmp ("SET", cmd))
|
||||
sysinfo_set_pref (word[3+offset], word_eol[4+offset]);
|
||||
else if (!cmd || !cmd[0])
|
||||
print_summary (announce);
|
||||
else
|
||||
print_info (cmd, announce);
|
||||
|
||||
return HEXCHAT_EAT_ALL;
|
||||
}
|
||||
|
||||
int
|
||||
hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
|
||||
{
|
||||
ph = plugin_handle;
|
||||
*plugin_name = name;
|
||||
*plugin_desc = desc;
|
||||
*plugin_version = version;
|
||||
|
||||
hexchat_hook_command (ph, "SYSINFO", HEXCHAT_PRI_NORM, sysinfo_cb, sysinfo_help, NULL);
|
||||
|
||||
hexchat_command (ph, "MENU ADD \"Window/Send System Info\" \"SYSINFO\"");
|
||||
hexchat_printf (ph, _("%s plugin loaded\n"), name);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
hexchat_plugin_deinit (void)
|
||||
{
|
||||
hexchat_command (ph, "MENU DEL \"Window/Display System Info\"");
|
||||
hexchat_printf (ph, _("%s plugin unloaded\n"), name);
|
||||
return 1;
|
||||
}
|
@ -1,416 +0,0 @@
|
||||
/* HexChat
|
||||
* Copyright (c) 2011-2012 Berke Viktor.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include <comutil.h>
|
||||
#include <wbemidl.h>
|
||||
|
||||
#include "hexchat-plugin.h"
|
||||
|
||||
static hexchat_plugin *ph; /* plugin handle */
|
||||
static char name[] = "SysInfo";
|
||||
static char desc[] = "Display info about your hardware and OS";
|
||||
static char version[] = "1.1";
|
||||
static char helptext[] = "USAGE: /sysinfo - Sends info about your hardware and OS to current channel.";
|
||||
static int firstRun;
|
||||
static char *wmiOs;
|
||||
static char *wmiCpu;
|
||||
static char *wmiVga;
|
||||
|
||||
static int
|
||||
getCpuArch (void)
|
||||
{
|
||||
OSVERSIONINFOEX osvi;
|
||||
SYSTEM_INFO si;
|
||||
|
||||
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
|
||||
GetVersionEx ((LPOSVERSIONINFOW) &osvi);
|
||||
|
||||
GetSystemInfo (&si);
|
||||
|
||||
if (si.wProcessorArchitecture == 9)
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 86;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* use WMI instead, wProcessorArchitecture displays current binary arch instead of OS arch anyway */
|
||||
static char *
|
||||
getOsName (void)
|
||||
{
|
||||
static char winver[32];
|
||||
double mhz;
|
||||
OSVERSIONINFOEX osvi;
|
||||
SYSTEM_INFO si;
|
||||
|
||||
osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
|
||||
GetVersionEx ((LPOSVERSIONINFOW) &osvi);
|
||||
|
||||
GetSystemInfo (&si);
|
||||
|
||||
strcpy (winver, "Windows ");
|
||||
|
||||
switch (osvi.dwMajorVersion)
|
||||
{
|
||||
case 5:
|
||||
switch (osvi.dwMinorVersion)
|
||||
{
|
||||
case 1:
|
||||
strcat (winver, "XP");
|
||||
break;
|
||||
case 2:
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION)
|
||||
{
|
||||
strcat (winver, "XP x64 Edition");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetSystemMetrics(SM_SERVERR2) == 0)
|
||||
{
|
||||
strcat (winver, "Server 2003");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat (winver, "Server 2003 R2");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
switch (osvi.dwMinorVersion)
|
||||
{
|
||||
case 0:
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION)
|
||||
{
|
||||
strcat (winver, "Vista");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat (winver, "Server 2008");
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION)
|
||||
{
|
||||
strcat (winver, "7");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat (winver, "Server 2008 R2");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (osvi.wProductType == VER_NT_WORKSTATION)
|
||||
{
|
||||
strcat (winver, "8");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat (winver, "8 Server");
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (si.wProcessorArchitecture == 9)
|
||||
{
|
||||
strcat (winver, " (x64)");
|
||||
}
|
||||
else
|
||||
{
|
||||
strcat (winver, " (x86)");
|
||||
}
|
||||
|
||||
return winver;
|
||||
}
|
||||
|
||||
/* x86-only, SDK-only, use WMI instead */
|
||||
static char *
|
||||
getCpuName (void)
|
||||
{
|
||||
/* Get extended ids. */
|
||||
unsigned int nExIds;
|
||||
unsigned int i;
|
||||
int CPUInfo[4] = {-1};
|
||||
static char CPUBrandString[128];
|
||||
|
||||
__cpuid (CPUInfo, 0x80000000);
|
||||
nExIds = CPUInfo[0];
|
||||
|
||||
/* Get the information associated with each extended ID. */
|
||||
for (i=0x80000000; i <= nExIds; ++i)
|
||||
{
|
||||
__cpuid (CPUInfo, i);
|
||||
|
||||
if (i == 0x80000002)
|
||||
{
|
||||
memcpy (CPUBrandString, CPUInfo, sizeof (CPUInfo));
|
||||
}
|
||||
else if (i == 0x80000003)
|
||||
{
|
||||
memcpy( CPUBrandString + 16, CPUInfo, sizeof (CPUInfo));
|
||||
}
|
||||
else if (i == 0x80000004)
|
||||
{
|
||||
memcpy (CPUBrandString + 32, CPUInfo, sizeof (CPUInfo));
|
||||
}
|
||||
}
|
||||
|
||||
return CPUBrandString;
|
||||
}
|
||||
#endif
|
||||
|
||||
static char *
|
||||
getCpuMhz (void)
|
||||
{
|
||||
HKEY hKey;
|
||||
int result;
|
||||
int data;
|
||||
int dataSize;
|
||||
double cpuspeed;
|
||||
static char buffer[16];
|
||||
const char *cpuspeedstr;
|
||||
|
||||
if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, TEXT("Hardware\\Description\\System\\CentralProcessor\\0"), 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
dataSize = sizeof (data);
|
||||
result = RegQueryValueEx (hKey, TEXT("~MHz"), 0, 0, (LPBYTE)&data, (LPDWORD)&dataSize);
|
||||
RegCloseKey (hKey);
|
||||
if (result == ERROR_SUCCESS)
|
||||
{
|
||||
cpuspeed = ( data > 1000 ) ? data / 1000 : data;
|
||||
cpuspeedstr = ( data > 1000 ) ? "GHz" : "MHz";
|
||||
sprintf (buffer, "%.2f %s", cpuspeed, cpuspeedstr);
|
||||
}
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static char *
|
||||
getMemoryInfo (void)
|
||||
{
|
||||
static char buffer[32];
|
||||
MEMORYSTATUSEX meminfo;
|
||||
|
||||
meminfo.dwLength = sizeof (meminfo);
|
||||
GlobalMemoryStatusEx (&meminfo);
|
||||
|
||||
sprintf (buffer, "%I64d MB Total (%I64d MB Free)", meminfo.ullTotalPhys / 1024 / 1024, meminfo.ullAvailPhys / 1024 / 1024);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static char *
|
||||
getWmiInfo (int mode)
|
||||
{
|
||||
/* for more details about this wonderful API, see
|
||||
http://msdn.microsoft.com/en-us/site/aa394138
|
||||
http://msdn.microsoft.com/en-us/site/aa390423
|
||||
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394138%28v=vs.85%29.aspx
|
||||
http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/d6420012-e432-4964-8506-6f6b65e5a451
|
||||
*/
|
||||
|
||||
char *buffer = (char *) malloc (128);
|
||||
HRESULT hres;
|
||||
HRESULT hr;
|
||||
IWbemLocator *pLoc = NULL;
|
||||
IWbemServices *pSvc = NULL;
|
||||
IEnumWbemClassObject *pEnumerator = NULL;
|
||||
IWbemClassObject *pclsObj;
|
||||
ULONG uReturn = 0;
|
||||
|
||||
hres = CoInitializeEx (0, COINIT_APARTMENTTHREADED | COINIT_SPEED_OVER_MEMORY);
|
||||
|
||||
if (FAILED (hres))
|
||||
{
|
||||
strcpy (buffer, "Error Code 0");
|
||||
return buffer;
|
||||
}
|
||||
|
||||
hres = CoInitializeSecurity (NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL);
|
||||
|
||||
/* mysteriously failing after the first execution, but only when used as a plugin, skip it */
|
||||
/*if (FAILED (hres))
|
||||
{
|
||||
CoUninitialize ();
|
||||
strcpy (buffer, "Error Code 1");
|
||||
return buffer;
|
||||
}*/
|
||||
|
||||
hres = CoCreateInstance (CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID *) &pLoc);
|
||||
|
||||
if (FAILED (hres))
|
||||
{
|
||||
CoUninitialize ();
|
||||
strcpy (buffer, "Error Code 2");
|
||||
return buffer;
|
||||
}
|
||||
|
||||
hres = pLoc->ConnectServer (_bstr_t (L"root\\CIMV2"), NULL, NULL, 0, NULL, 0, 0, &pSvc);
|
||||
|
||||
if (FAILED (hres))
|
||||
{
|
||||
pLoc->Release ();
|
||||
CoUninitialize ();
|
||||
strcpy (buffer, "Error Code 3");
|
||||
return buffer;
|
||||
}
|
||||
|
||||
hres = CoSetProxyBlanket (pSvc, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL, RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE);
|
||||
|
||||
if (FAILED (hres))
|
||||
{
|
||||
pSvc->Release ();
|
||||
pLoc->Release ();
|
||||
CoUninitialize ();
|
||||
strcpy (buffer, "Error Code 4");
|
||||
return buffer;
|
||||
}
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case 0:
|
||||
hres = pSvc->ExecQuery (_bstr_t ("WQL"), _bstr_t ("SELECT * FROM Win32_OperatingSystem"), WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &pEnumerator);
|
||||
break;
|
||||
case 1:
|
||||
hres = pSvc->ExecQuery (_bstr_t ("WQL"), _bstr_t ("SELECT * FROM Win32_Processor"), WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &pEnumerator);
|
||||
break;
|
||||
case 2:
|
||||
hres = pSvc->ExecQuery (_bstr_t ("WQL"), _bstr_t ("SELECT * FROM Win32_VideoController"), WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &pEnumerator);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (FAILED (hres))
|
||||
{
|
||||
pSvc->Release ();
|
||||
pLoc->Release ();
|
||||
CoUninitialize ();
|
||||
strcpy (buffer, "Error Code 5");
|
||||
return buffer;
|
||||
}
|
||||
|
||||
while (pEnumerator)
|
||||
{
|
||||
hr = pEnumerator->Next (WBEM_INFINITE, 1, &pclsObj, &uReturn);
|
||||
if (0 == uReturn)
|
||||
{
|
||||
break;
|
||||
}
|
||||
VARIANT vtProp;
|
||||
switch (mode)
|
||||
{
|
||||
case 0:
|
||||
hr = pclsObj->Get (L"Caption", 0, &vtProp, 0, 0);
|
||||
break;
|
||||
case 1:
|
||||
hr = pclsObj->Get (L"Name", 0, &vtProp, 0, 0);
|
||||
break;
|
||||
case 2:
|
||||
hr = pclsObj->Get (L"Name", 0, &vtProp, 0, 0);
|
||||
break;
|
||||
}
|
||||
WideCharToMultiByte (CP_ACP, 0, vtProp.bstrVal, -1, buffer, SysStringLen (vtProp.bstrVal)+1, NULL, NULL);
|
||||
VariantClear (&vtProp);
|
||||
}
|
||||
|
||||
pSvc->Release ();
|
||||
pLoc->Release ();
|
||||
pEnumerator->Release ();
|
||||
pclsObj->Release ();
|
||||
CoUninitialize ();
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static int
|
||||
printInfo (char *word[], char *word_eol[], void *user_data)
|
||||
{
|
||||
/* query WMI info only at the first time SysInfo is called, then cache it to save time */
|
||||
if (firstRun)
|
||||
{
|
||||
hexchat_printf (ph, "%s first execution, querying and caching WMI info...\n", name);
|
||||
wmiOs = getWmiInfo (0);
|
||||
wmiCpu = getWmiInfo (1);
|
||||
wmiVga = getWmiInfo (2);
|
||||
firstRun = 0;
|
||||
}
|
||||
if (hexchat_list_int (ph, NULL, "type") >= 2)
|
||||
{
|
||||
/* uptime will work correctly for up to 50 days, should be enough */
|
||||
hexchat_commandf (ph, "ME ** SysInfo ** Client: HexChat %s (x%d) ** OS: %s ** CPU: %s (%s) ** RAM: %s ** VGA: %s ** Uptime: %.2f Hours **",
|
||||
hexchat_get_info (ph, "version"),
|
||||
getCpuArch (),
|
||||
wmiOs,
|
||||
wmiCpu,
|
||||
getCpuMhz (),
|
||||
getMemoryInfo (),
|
||||
wmiVga, (float) GetTickCount() / 1000 / 60 / 60);
|
||||
}
|
||||
else
|
||||
{
|
||||
hexchat_printf (ph, " * Client: HexChat %s (x%d)\n", hexchat_get_info (ph, "version"), getCpuArch ());
|
||||
hexchat_printf (ph, " * OS: %s\n", wmiOs);
|
||||
hexchat_printf (ph, " * CPU: %s (%s)\n", wmiCpu, getCpuMhz ());
|
||||
hexchat_printf (ph, " * RAM: %s\n", getMemoryInfo ());
|
||||
hexchat_printf (ph, " * VGA: %s\n", wmiVga);
|
||||
hexchat_printf (ph, " * Uptime: %.2f Hours\n", (float) GetTickCount() / 1000 / 60 / 60);
|
||||
}
|
||||
|
||||
return HEXCHAT_EAT_HEXCHAT;
|
||||
}
|
||||
|
||||
int
|
||||
hexchat_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
|
||||
{
|
||||
ph = plugin_handle;
|
||||
|
||||
*plugin_name = name;
|
||||
*plugin_desc = desc;
|
||||
*plugin_version = version;
|
||||
|
||||
firstRun = 1;
|
||||
|
||||
hexchat_hook_command (ph, "SYSINFO", HEXCHAT_PRI_NORM, printInfo, helptext, NULL);
|
||||
hexchat_command (ph, "MENU -ishare\\system.png ADD \"Window/Send System Info\" \"SYSINFO\"");
|
||||
|
||||
hexchat_printf (ph, "%s plugin loaded\n", name);
|
||||
|
||||
return 1; /* return 1 for success */
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
hexchat_plugin_deinit (void)
|
||||
{
|
||||
hexchat_command (ph, "MENU DEL \"Window/Display System Info\"");
|
||||
hexchat_printf (ph, "%s plugin unloaded\n", name);
|
||||
return 1;
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
/*
|
||||
* xsys.h - X-Sys general parameters header
|
||||
* Copyright (C) 2005 Gustavo Zacarias
|
||||
* Copyright (C) 2006, 2007 Tony Vroon
|
||||
* SysInfo - sysinfo plugin for HexChat
|
||||
* Copyright (c) 2015 Patrick Griffis.
|
||||
*
|
||||
* 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
|
||||
@ -19,14 +18,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _XSYS_H_
|
||||
#define _XSYS_H_
|
||||
#ifndef SYSINFO_H
|
||||
#define SYSINFO_H
|
||||
|
||||
#define bsize 1024
|
||||
#define delims ":="
|
||||
|
||||
int sysinfo_get_percent ();
|
||||
void sysinfo_get_pciids (char *dest);
|
||||
void sysinfo_print_error (const char* msg);
|
||||
|
||||
#endif
|
@ -1,7 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Configuration">
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
@ -19,91 +21,51 @@
|
||||
<RootNamespace>sysinfo</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\win32\hexchat.props" />
|
||||
<PropertyGroup>
|
||||
<TargetName>hcsysinfo</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>hcsysinfo</TargetName>
|
||||
<OutDir>$(HexChatBin)</OutDir>
|
||||
<IntDir>$(HexChatObj)$(ProjectName)\</IntDir>
|
||||
<OutDir>$(HexChatRel)plugins\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SYSINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;$(DepsRoot)\include;$(Glib);$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>sysinfo.def</ModuleDefinitionFile>
|
||||
<AdditionalDependencies>wbemuuid.lib;comsupp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(HexChatLib)common.lib;wbemuuid.lib;comsupp.lib;$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>comsupp.lib</IgnoreSpecificDefaultLibraries>
|
||||
<ModuleDefinitionFile>sysinfo.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;SYSINFO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalIncludeDirectories>..\..\src\common;$(DepsRoot)\include;$(Glib);$(HexChatLib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<ModuleDefinitionFile>sysinfo.def</ModuleDefinitionFile>
|
||||
<AdditionalDependencies>wbemuuid.lib;comsupp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>$(HexChatLib)common.lib;wbemuuid.lib;comsupp.lib;$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>comsupp.lib</IgnoreSpecificDefaultLibraries>
|
||||
<ModuleDefinitionFile>sysinfo.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="sysinfo.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="sysinfo.cpp" />
|
||||
<ClCompile Include="format.c" />
|
||||
<ClCompile Include="sysinfo.c" />
|
||||
<ClCompile Include="win32\backend.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="format.h" />
|
||||
<ClInclude Include="sysinfo-backend.h" />
|
||||
<ClInclude Include="sysinfo.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -9,6 +9,9 @@
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{c873eb6b-aca6-434d-8ec9-199838b80838}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="sysinfo.def">
|
||||
@ -16,8 +19,25 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="sysinfo.cpp">
|
||||
<ClCompile Include="sysinfo.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="win32\backend.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="format.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="sysinfo.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="sysinfo-backend.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="format.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|