diff options
Diffstat (limited to 'src')
145 files changed, 2699 insertions, 2463 deletions
diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 3be3b1c6..f4418a75 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -31,7 +31,6 @@ EXTRA_DIST = \ servlist.h \ ssl.h \ ssl.c \ - strlutil.c \ text.h \ textenums.h \ textevents.h \ @@ -52,10 +51,14 @@ libhexchatcommon_a_LIBADD = \ endif SUBDIRS = $(dbusdir) . +if DO_PLUGIN +include_HEADERS = hexchat-plugin.h +endif + libhexchatcommon_a_SOURCES = cfgfiles.c chanopt.c ctcp.c dcc.c hexchat.c \ history.c ignore.c inbound.c modes.c msproxy.c network.c notify.c \ outbound.c plugin.c plugin-timer.c proto-irc.c server.c servlist.c \ - $(ssl_c) strlutil.c text.c tree.c url.c userlist.c util.c + $(ssl_c) text.c tree.c url.c userlist.c util.c libhexchatcommon_a_CFLAGS = $(LIBPROXY_CFLAGS) textenums.h: textevents.h diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c index 9aac5a4f..cca2267a 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c @@ -450,7 +450,6 @@ const struct prefs vars[] = {"gui_tab_icons", P_OFFINT (hex_gui_tab_icons), TYPE_BOOL}, {"gui_tab_layout", P_OFFINT (hex_gui_tab_layout), TYPE_INT}, {"gui_tab_newtofront", P_OFFINT (hex_gui_tab_newtofront), TYPE_INT}, - {"gui_tab_notices", P_OFFINT (hex_gui_tab_notices), TYPE_BOOL}, {"gui_tab_pos", P_OFFINT (hex_gui_tab_pos), TYPE_INT}, {"gui_tab_server", P_OFFINT (hex_gui_tab_server), TYPE_BOOL}, {"gui_tab_small", P_OFFINT (hex_gui_tab_small), TYPE_INT}, @@ -466,6 +465,7 @@ const struct prefs vars[] = {"gui_tray_minimize", P_OFFINT (hex_gui_tray_minimize), TYPE_BOOL}, {"gui_tray_quiet", P_OFFINT (hex_gui_tray_quiet), TYPE_BOOL}, {"gui_ulist_buttons", P_OFFINT (hex_gui_ulist_buttons), TYPE_BOOL}, + {"gui_ulist_color", P_OFFINT (hex_gui_ulist_color), TYPE_BOOL}, {"gui_ulist_count", P_OFFINT (hex_gui_ulist_count), TYPE_BOOL}, {"gui_ulist_doubleclick", P_OFFSET (hex_gui_ulist_doubleclick), TYPE_STR}, {"gui_ulist_hide", P_OFFINT (hex_gui_ulist_hide), TYPE_BOOL}, @@ -523,6 +523,7 @@ const struct prefs vars[] = {"irc_nick3", P_OFFSET (hex_irc_nick3), TYPE_STR}, {"irc_nick_hilight", P_OFFSET (hex_irc_nick_hilight), TYPE_STR}, {"irc_no_hilight", P_OFFSET (hex_irc_no_hilight), TYPE_STR}, + {"irc_notice_pos", P_OFFINT (hex_irc_notice_pos), TYPE_INT}, {"irc_part_reason", P_OFFSET (hex_irc_part_reason), TYPE_STR}, {"irc_quit_reason", P_OFFSET (hex_irc_quit_reason), TYPE_STR}, {"irc_raw_modes", P_OFFINT (hex_irc_raw_modes), TYPE_BOOL}, diff --git a/src/common/cfgfiles.h b/src/common/cfgfiles.h index e55befe5..3feb6a31 100644 --- a/src/common/cfgfiles.h +++ b/src/common/cfgfiles.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + /* cfgfiles.h */ #ifndef HEXCHAT_CFGFILES_H diff --git a/src/common/chanopt.c b/src/common/chanopt.c index c0382000..561f2f9c 100644 --- a/src/common/chanopt.c +++ b/src/common/chanopt.c @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + /* per-channel/dialog settings :: /CHANOPT */ #include <stdio.h> diff --git a/src/common/chanopt.h b/src/common/chanopt.h index 90ca86c3..c0990385 100644 --- a/src/common/chanopt.h +++ b/src/common/chanopt.h @@ -1,6 +1,30 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_CHANOPT_H +#define HEXCHAT_CHANOPT_H + int chanopt_command (session *sess, char *tbuf, char *word[], char *word_eol[]); gboolean chanopt_is_set (unsigned int global, guint8 per_chan_setting); gboolean chanopt_is_set_a (unsigned int global, guint8 per_chan_setting); void chanopt_save_all (void); void chanopt_save (session *sess); void chanopt_load (session *sess); + +#endif diff --git a/src/common/common-xp.vcxproj b/src/common/common-xp.vcxproj deleted file mode 100644 index 2b5979b6..00000000 --- a/src/common/common-xp.vcxproj +++ /dev/null @@ -1,161 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <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> - <ItemGroup> - <ClInclude Include="..\..\config-win32.h" /> - <ClInclude Include="cfgfiles.h" /> - <ClInclude Include="chanopt.h" /> - <ClInclude Include="ctcp.h" /> - <ClInclude Include="dcc.h" /> - <ClInclude Include="fe.h" /> - <ClInclude Include="history.h" /> - <ClInclude Include="identd.h" /> - <ClInclude Include="ignore.h" /> - <ClInclude Include="inbound.h" /> - <ClInclude Include="inet.h" /> - <ClInclude Include="modes.h" /> - <ClInclude Include="msproxy.h" /> - <ClInclude Include="network.h" /> - <ClInclude Include="notify.h" /> - <ClInclude Include="outbound.h" /> - <ClInclude Include="plugin-timer.h" /> - <ClInclude Include="plugin.h" /> - <ClInclude Include="proto-irc.h" /> - <ClInclude Include="server.h" /> - <ClInclude Include="servlist.h" /> - <ClInclude Include="ssl.h" /> - <ClInclude Include="strlutil.h" /> - <ClInclude Include="text.h" /> - <ClInclude Include="textenums.h" /> - <ClInclude Include="textevents.h" /> - <ClInclude Include="thread.h" /> - <ClInclude Include="tree.h" /> - <ClInclude Include="typedef.h" /> - <ClInclude Include="url.h" /> - <ClInclude Include="userlist.h" /> - <ClInclude Include="util.h" /> - <ClInclude Include="hexchat-plugin.h" /> - <ClInclude Include="hexchat.h" /> - <ClInclude Include="hexchatc.h" /> - </ItemGroup> - <ItemGroup> - <ClCompile Include="cfgfiles.c" /> - <ClCompile Include="chanopt.c" /> - <ClCompile Include="ctcp.c" /> - <ClCompile Include="dcc.c" /> - <ClCompile Include="history.c" /> - <ClCompile Include="identd.c" /> - <ClCompile Include="ignore.c" /> - <ClCompile Include="inbound.c" /> - <ClCompile Include="modes.c" /> - <ClCompile Include="msproxy.c" /> - <ClCompile Include="network.c" /> - <ClCompile Include="notify.c" /> - <ClCompile Include="outbound.c" /> - <ClCompile Include="plugin-timer.c" /> - <ClCompile Include="plugin.c" /> - <ClCompile Include="proto-irc.c" /> - <ClCompile Include="server.c" /> - <ClCompile Include="servlist.c" /> - <ClCompile Include="ssl.c" /> - <ClCompile Include="strlutil.c" /> - <ClCompile Include="text.c" /> - <ClCompile Include="thread.c" /> - <ClCompile Include="tree.c" /> - <ClCompile Include="url.c" /> - <ClCompile Include="userlist.c" /> - <ClCompile Include="util.c" /> - <ClCompile Include="hexchat.c" /> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{87554B59-006C-4D94-9714-897B27067BA3}</ProjectGuid> - <Keyword>Win32Proj</Keyword> - <RootNamespace>common</RootNamespace> - <ProjectName>common</ProjectName> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>WDK7</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>WDK7</PlatformToolset> - </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-xp.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-xp.props" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - <DisableSpecificWarnings></DisableSpecificWarnings> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_LIB;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - </ItemDefinitionGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> \ No newline at end of file diff --git a/src/common/common-xp.vcxproj.filters b/src/common/common-xp.vcxproj.filters deleted file mode 100644 index ceeea660..00000000 --- a/src/common/common-xp.vcxproj.filters +++ /dev/null @@ -1,203 +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="Header Files"> - <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - </Filter> - </ItemGroup> - <ItemGroup> - <ClInclude Include="cfgfiles.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="chanopt.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ctcp.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="dcc.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="fe.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="history.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="identd.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ignore.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="inbound.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="inet.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="modes.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="msproxy.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="network.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="notify.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="outbound.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="plugin.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="plugin-timer.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="proto-irc.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="server.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="servlist.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ssl.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="text.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="textenums.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="textevents.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="thread.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="tree.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="url.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="userlist.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="util.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="hexchat.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="hexchatc.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="hexchat-plugin.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\..\config-win32.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="strlutil.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="typedef.h"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <ClCompile Include="cfgfiles.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="chanopt.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ctcp.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="dcc.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="history.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="identd.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ignore.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="inbound.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="modes.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="msproxy.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="network.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="notify.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="outbound.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="plugin.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="plugin-timer.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="proto-irc.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="server.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="servlist.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ssl.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="text.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="thread.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="tree.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="url.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="userlist.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="util.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="hexchat.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="strlutil.c"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> -</Project> \ No newline at end of file diff --git a/src/common/common.vcxproj b/src/common/common.vcxproj index 2595912a..b4fa224a 100644 --- a/src/common/common.vcxproj +++ b/src/common/common.vcxproj @@ -33,7 +33,6 @@ <ClInclude Include="server.h" /> <ClInclude Include="servlist.h" /> <ClInclude Include="ssl.h" /> - <ClInclude Include="strlutil.h" /> <ClInclude Include="text.h" /> <ClInclude Include="textenums.h" /> <ClInclude Include="textevents.h" /> @@ -67,7 +66,6 @@ <ClCompile Include="server.c" /> <ClCompile Include="servlist.c" /> <ClCompile Include="ssl.c" /> - <ClCompile Include="strlutil.c" /> <ClCompile Include="text.c" /> <ClCompile Include="thread.c" /> <ClCompile Include="tree.c" /> diff --git a/src/common/common.vcxproj.filters b/src/common/common.vcxproj.filters index ceeea660..d94ec2d3 100644 --- a/src/common/common.vcxproj.filters +++ b/src/common/common.vcxproj.filters @@ -110,9 +110,6 @@ <ClInclude Include="..\..\config-win32.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="strlutil.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="typedef.h"> <Filter>Header Files</Filter> </ClInclude> @@ -196,8 +193,5 @@ <ClCompile Include="hexchat.c"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="strlutil.c"> - <Filter>Source Files</Filter> - </ClCompile> </ItemGroup> </Project> \ No newline at end of file diff --git a/src/common/ctcp.h b/src/common/ctcp.h index 296e6b1b..54e33f4c 100644 --- a/src/common/ctcp.h +++ b/src/common/ctcp.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_CTCP_H #define HEXCHAT_CTCP_H diff --git a/src/common/dbus/example-gdbus.py b/src/common/dbus/example-gdbus.py new file mode 100644 index 00000000..4f141034 --- /dev/null +++ b/src/common/dbus/example-gdbus.py @@ -0,0 +1,51 @@ +#!/usr/bin/python + +# HexChat +# Copyright (C) 1998-2010 Peter Zelezny. +# Copyright (C) 2009-2013 Berke Viktor. +# +# 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 +# + +from gi.repository import Gio + +bus = Gio.bus_get_sync(Gio.BusType.SESSION, None) +connection = Gio.DBusProxy.new_sync(bus, Gio.DBusProxyFlags.NONE, None, + 'org.hexchat.service', '/org/hexchat/Remote', 'org.hexchat.connection', None) +path = connection.Connect('(ssss)', + 'example.py', + 'Python example', + 'Example of a D-Bus client written in python', + '1.0') +hexchat = Gio.DBusProxy.new_sync(bus, Gio.DBusProxyFlags.NONE, None, + 'org.hexchat.service', path, 'org.hexchat.plugin', None) + +# Note the type before every arguement, this must be done. +# Type requirements are listed in our docs and characters are listed in the dbus docs. +# s = string, u = uint, i = int, etc. + +channels = hexchat.ListGet ('(s)', "channels") +while hexchat.ListNext ('(u)', channels): + name = hexchat.ListStr ('(us)', channels, "channel") + print("------- " + name + " -------") + hexchat.SetContext ('(u)', hexchat.ListInt ('(us)', channels, "context")) + hexchat.EmitPrint ('(sas)', "Channel Message", ["John", "Hi there", "@"]) + users = hexchat.ListGet ('(s)', "users") + while hexchat.ListNext ('(u)', users): + print("Nick: " + hexchat.ListStr ('(us)', users, "nick")) + hexchat.ListFree ('(u)', users) +hexchat.ListFree ('(u)', channels) + +print(hexchat.Strip ('(sii)', "\00312Blue\003 \002Bold!\002", -1, 1|2)) diff --git a/src/common/dbus/example.py b/src/common/dbus/example.py index 49855784..4b94cd68 100644 --- a/src/common/dbus/example.py +++ b/src/common/dbus/example.py @@ -1,5 +1,24 @@ #! /usr/bin/python +# HexChat +# Copyright (C) 1998-2010 Peter Zelezny. +# Copyright (C) 2009-2013 Berke Viktor. +# +# 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 +# + import dbus bus = dbus.SessionBus() @@ -15,14 +34,14 @@ hexchat = dbus.Interface(proxy, 'org.hexchat.plugin') channels = hexchat.ListGet ("channels") while hexchat.ListNext (channels): name = hexchat.ListStr (channels, "channel") - print "------- " + name + " -------" + print("------- " + name + " -------") hexchat.SetContext (hexchat.ListInt (channels, "context")) hexchat.EmitPrint ("Channel Message", ["John", "Hi there", "@"]) users = hexchat.ListGet ("users") while hexchat.ListNext (users): - print "Nick: " + hexchat.ListStr (users, "nick") + print("Nick: " + hexchat.ListStr (users, "nick")) hexchat.ListFree (users) hexchat.ListFree (channels) -print hexchat.Strip ("\00312Blue\003 \002Bold!\002", -1, 1|2) +print(hexchat.Strip ("\00312Blue\003 \002Bold!\002", -1, 1|2)) diff --git a/src/common/dcc.h b/src/common/dcc.h index 6dcd53d5..32d0ed5f 100644 --- a/src/common/dcc.h +++ b/src/common/dcc.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + /* dcc.h */ #include <time.h> /* for time_t */ diff --git a/src/common/fe.h b/src/common/fe.h index 4903ef0e..22db38df 100644 --- a/src/common/fe.h +++ b/src/common/fe.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 "userlist.h" #include "dcc.h" @@ -59,9 +78,8 @@ int fe_is_chanwindow (struct server *serv); void fe_add_chan_list (struct server *serv, char *chan, char *users, char *topic); void fe_chan_list_end (struct server *serv); -int fe_is_banwindow (struct session *sess); -void fe_add_ban_list (struct session *sess, char *mask, char *who, char *when, int is_exemption); -void fe_ban_list_end (struct session *sess, int is_exemption); +gboolean fe_add_ban_list (struct session *sess, char *mask, char *who, char *when, int rplcode); +gboolean fe_ban_list_end (struct session *sess, int rplcode); void fe_notify_update (char *name); void fe_notify_ask (char *name, char *networks); void fe_text_clear (struct session *sess, int lines); diff --git a/src/common/hexchat-plugin.h b/src/common/hexchat-plugin.h index f6e9a659..36dc544f 100644 --- a/src/common/hexchat-plugin.h +++ b/src/common/hexchat-plugin.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + /* You can distribute this header with your plugins for easy compilation */ #ifndef HEXCHAT_PLUGIN_H #define HEXCHAT_PLUGIN_H diff --git a/src/common/hexchat.c b/src/common/hexchat.c index b6c12ce2..140f7653 100644 --- a/src/common/hexchat.c +++ b/src/common/hexchat.c @@ -1009,46 +1009,6 @@ hexchat_execv (char * const argv[]) #endif } -#if 0 /* def WIN32 */ -static void -xchat_restore_window (HWND hexchat_window) -{ - /* ShowWindow (hexchat_window, SW_RESTORE); another way, but works worse */ - SendMessage (hexchat_window, WM_SYSCOMMAND, SC_RESTORE, 0); - SetForegroundWindow (hexchat_window); -} - -BOOL CALLBACK -enum_windows_impl (HWND current_window, LPARAM lParam) -{ - TCHAR window_name[8]; - TCHAR module_path[1024]; - ZeroMemory (&window_name, sizeof (window_name)); - - if (!current_window) - { - return TRUE; - } - - GetWindowText (current_window, window_name, 8); /* name length + 1 */ - if (strcmp (window_name, "HexChat") == 0) - { - /* use a separate if block, this way we don't have to call GetWindowModuleFileName() for each hit */ - ZeroMemory (&module_path, sizeof (module_path)); - GetWindowModuleFileName (current_window, module_path, sizeof (module_path)); - - if (strstr (module_path, "hexchat.exe")) /* We've found it, stop */ - { - xchat_restore_window (current_window); - return FALSE; - } - } - - return TRUE; /* Keep searching */ - -} -#endif - int main (int argc, char *argv[]) { @@ -1057,7 +1017,6 @@ main (int argc, char *argv[]) #ifdef WIN32 char hexchat_lang[13]; /* LC_ALL= plus 5 chars of hex_gui_lang and trailing \0 */ - /* HANDLE mutex; */ #endif srand (time (0)); /* CL: do this only once! */ @@ -1258,33 +1217,6 @@ main (int argc, char *argv[]) } putenv (hexchat_lang); - -#if 0 - if (prefs.hex_gui_single && !portable_mode ()) - { - DWORD error; - - mutex = CreateMutex (NULL, TRUE, "Local\\hexchat"); - error = GetLastError (); - - if (error == ERROR_ALREADY_EXISTS || mutex == NULL) - { - /* Restoring the HexChat window from the tray via the taskbar icon. - * Only works correctly when HexTray is used. - */ - if (hextray_mode ()) - { - /* FindWindow() doesn't support wildcards so we check all the open windows */ - EnumWindows (enum_windows_impl, (LPARAM) NULL); - return 0; - } - else - { - return 1; - } - } - } -#endif #endif #ifdef SOCKS @@ -1324,14 +1256,6 @@ main (int argc, char *argv[]) #ifdef WIN32 WSACleanup (); - -#if 0 - if (prefs.hex_gui_single && !portable_mode ()) - { - ReleaseMutex (mutex); - CloseHandle (mutex); - } -#endif #endif return 0; diff --git a/src/common/hexchat.h b/src/common/hexchat.h index 4f5c82a8..3e07ec4e 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + #ifdef WIN32 #include "../../config-win32.h" #else @@ -146,7 +165,6 @@ struct hexchatprefs unsigned int hex_gui_tab_dialogs; unsigned int hex_gui_tab_dots; unsigned int hex_gui_tab_icons; - unsigned int hex_gui_tab_notices; unsigned int hex_gui_tab_server; unsigned int hex_gui_tab_sort; unsigned int hex_gui_tab_utils; @@ -158,6 +176,7 @@ struct hexchatprefs unsigned int hex_gui_tray_minimize; unsigned int hex_gui_tray_quiet; unsigned int hex_gui_ulist_buttons; + unsigned int hex_gui_ulist_color; unsigned int hex_gui_ulist_count; unsigned int hex_gui_ulist_hide; unsigned int hex_gui_ulist_icons; @@ -276,6 +295,7 @@ struct hexchatprefs int hex_input_balloon_time; int hex_irc_ban_type; int hex_irc_join_delay; + int hex_irc_notice_pos; int hex_net_ping_timeout; int hex_net_proxy_port; int hex_net_proxy_type; /* 0=disabled, 1=wingate 2=socks4, 3=socks5, 4=http */ @@ -572,10 +592,10 @@ typedef struct server unsigned int have_awaynotify:1; unsigned int have_uhnames:1; unsigned int have_whox:1; /* have undernet's WHOX features */ - unsigned int have_capab:1; /* supports CAPAB (005 tells us) */ unsigned int have_idmsg:1; /* freenode's IDENTIFY-MSG */ unsigned int have_sasl:1; /* SASL capability */ unsigned int have_except:1; /* ban exemptions +e */ + unsigned int have_invite:1; /* invite exemptions +I */ unsigned int using_cp1255:1; /* encoding is CP1255/WINDOWS-1255? */ unsigned int using_irc:1; /* encoding is "IRC" (CP1252/UTF-8 hybrid)? */ unsigned int use_who:1; /* whether to use WHO command to get dcc_ip */ diff --git a/src/common/hexchatc.h b/src/common/hexchatc.h index 9650dc10..774f4dd9 100644 --- a/src/common/hexchatc.h +++ b/src/common/hexchatc.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_C_H #define HEXCHAT_C_H diff --git a/src/common/history.h b/src/common/history.h index c5696d70..dc79192c 100644 --- a/src/common/history.h +++ b/src/common/history.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_HISTORY_H #define HEXCHAT_HISTORY_H diff --git a/src/common/identd.c b/src/common/identd.c index 5cfc536f..6dde6a5f 100644 --- a/src/common/identd.c +++ b/src/common/identd.c @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + /* simple identd server for HexChat under Win32 */ #include "inet.h" diff --git a/src/common/identd.h b/src/common/identd.h index 636f9641..3b29135f 100644 --- a/src/common/identd.h +++ b/src/common/identd.h @@ -1 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_IDENTD_H +#define HEXCHAT_IDENTD_H + void identd_start (char *username); + +#endif diff --git a/src/common/ignore.h b/src/common/ignore.h index e4b14a3f..3263a940 100644 --- a/src/common/ignore.h +++ b/src/common/ignore.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_IGNORE_H #define HEXCHAT_IGNORE_H diff --git a/src/common/inbound.c b/src/common/inbound.c index d44fbef6..878a8759 100644 --- a/src/common/inbound.c +++ b/src/common/inbound.c @@ -155,6 +155,7 @@ void inbound_privmsg (server *serv, char *from, char *ip, char *text, int id) { session *sess; + struct User *user; char idtext[64]; sess = find_dialog (serv, from); @@ -197,6 +198,10 @@ inbound_privmsg (server *serv, char *from, char *ip, char *text, int id) EMIT_SIGNAL (XP_TE_PRIVMSG, sess, from, text, idtext, NULL, 0); return; } + + user = userlist_find (sess, from); + if (user) + user->lasttalk = time (0); if (sess->type == SESS_DIALOG) EMIT_SIGNAL (XP_TE_DPRIVMSG, sess, from, text, idtext, NULL, 0); @@ -867,7 +872,27 @@ inbound_notice (server *serv, char *to, char *nick, char *msg, char *ip, int id) if (!sess) { ptr = 0; - if (prefs.hex_gui_tab_notices) + if (prefs.hex_irc_notice_pos == 0) + { + /* paranoia check */ + if (msg[0] == '[' && (!serv->have_idmsg || id)) + { + /* guess where chanserv meant to post this -sigh- */ + if (!g_ascii_strcasecmp (nick, "ChanServ") && !find_dialog (serv, nick)) + { + char *dest = strdup (msg + 1); + char *end = strchr (dest, ']'); + if (end) + { + *end = 0; + sess = find_channel (serv, dest); + } + free (dest); + } + } + if (!sess) + sess = find_session_from_nick (nick, serv); + } else if (prefs.hex_irc_notice_pos == 1) { int stype = server_notice ? SESS_SNOTICES : SESS_NOTICES; sess = find_session_from_type (stype, serv); @@ -888,25 +913,9 @@ inbound_notice (server *serv, char *to, char *nick, char *msg, char *ip, int id) msg += 14; } else { - /* paranoia check */ - if (msg[0] == '[' && (!serv->have_idmsg || id)) - { - /* guess where chanserv meant to post this -sigh- */ - if (!g_ascii_strcasecmp (nick, "ChanServ") && !find_dialog (serv, nick)) - { - char *dest = strdup (msg + 1); - char *end = strchr (dest, ']'); - if (end) - { - *end = 0; - sess = find_channel (serv, dest); - } - free (dest); - } - } - if (!sess) - sess = find_session_from_nick (nick, serv); + sess = serv->front_session; } + if (!sess) { if (server_notice) @@ -1046,6 +1055,7 @@ check_autojoin_channels (server *serv) free (serv->autojoin); serv->autojoin = NULL; + i++; } /* this is really only for re-connects when you @@ -1069,8 +1079,17 @@ check_autojoin_channels (server *serv) if (po) *po = 0; - channels = g_slist_append (channels, g_strdup (sess->waitchannel)); - keys = g_slist_append (keys, g_strdup (sess->channelkey)); + /* There can be no gap between keys, list keyed chans first. */ + if (sess->channelkey[0] != 0) + { + channels = g_slist_prepend (channels, g_strdup (sess->waitchannel)); + keys = g_slist_prepend (keys, g_strdup (sess->channelkey)); + } + else + { + channels = g_slist_append (channels, g_strdup (sess->waitchannel)); + keys = g_slist_append (keys, g_strdup (sess->channelkey)); + } i++; } } @@ -1274,12 +1293,14 @@ inbound_user_info (session *sess, char *chan, char *user, char *host, } int -inbound_banlist (session *sess, time_t stamp, char *chan, char *mask, char *banner, int is_exemption) +inbound_banlist (session *sess, time_t stamp, char *chan, char *mask, char *banner, int rplcode) { char *time_str = ctime (&stamp); server *serv = sess->server; + char *nl; - time_str[19] = 0; /* get rid of the \n */ + if ((nl = strchr (time_str, '\n'))) + *nl = 0; if (stamp == 0) time_str = ""; @@ -1290,18 +1311,17 @@ inbound_banlist (session *sess, time_t stamp, char *chan, char *mask, char *bann goto nowindow; } - if (!fe_is_banwindow (sess)) + if (!fe_add_ban_list (sess, mask, banner, time_str, rplcode)) { nowindow: /* let proto-irc.c do the 'goto def' for exemptions */ - if (is_exemption) + if (rplcode != 367) /* RPL_EXCEPTLIST */ return FALSE; EMIT_SIGNAL (XP_TE_BANLIST, sess, chan, mask, banner, time_str, 0); return TRUE; } - fe_add_ban_list (sess, mask, banner, time_str, is_exemption); return TRUE; } diff --git a/src/common/inbound.h b/src/common/inbound.h index 319996ed..d77a9e53 100644 --- a/src/common/inbound.h +++ b/src/common/inbound.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_INBOUND_H #define HEXCHAT_INBOUND_H diff --git a/src/common/inet.h b/src/common/inet.h index 75e2fb01..36d5bb60 100644 --- a/src/common/inet.h +++ b/src/common/inet.h @@ -1,5 +1,27 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 stuff for internet */ +#ifndef HEXCHAT_INET_H +#define HEXCHAT_INET_H + #ifndef WIN32 #ifdef WANTSOCKET @@ -41,3 +63,5 @@ #define sock_error WSAGetLastError #endif + +#endif diff --git a/src/common/make-te-xp.vcxproj b/src/common/make-te-xp.vcxproj deleted file mode 100644 index bd4cb2da..00000000 --- a/src/common/make-te-xp.vcxproj +++ /dev/null @@ -1,102 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <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>{A7D7CE59-2A31-48AE-BED2-A9828E241832}</ProjectGuid> - <Keyword>Win32Proj</Keyword> - <RootNamespace>makete</RootNamespace> - <ProjectName>make-te</ProjectName> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>WDK7</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>WDK7</PlatformToolset> - </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-xp.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-xp.props" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <LinkIncremental>false</LinkIncremental> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <LinkIncremental>false</LinkIncremental> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - <PostBuildEvent> - <Command>"$(HexChatBin)make-te.exe" < "$(ProjectDir)textevents.in" > "$(ProjectDir)textevents.h" 2> "$(ProjectDir)textenums.h"</Command> - </PostBuildEvent> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - <PostBuildEvent> - <Command>"$(HexChatBin)make-te.exe" < "$(ProjectDir)textevents.in" > "$(ProjectDir)textevents.h" 2> "$(ProjectDir)textenums.h"</Command> - </PostBuildEvent> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="make-te.c" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> \ No newline at end of file diff --git a/src/common/make-te-xp.vcxproj.filters b/src/common/make-te-xp.vcxproj.filters deleted file mode 100644 index ac9f0939..00000000 --- a/src/common/make-te-xp.vcxproj.filters +++ /dev/null @@ -1,22 +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="Header Files"> - <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</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> - <ClCompile Include="make-te.c"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> -</Project> \ No newline at end of file diff --git a/src/common/make-te.c b/src/common/make-te.c index 117d41ab..309eec2f 100644 --- a/src/common/make-te.c +++ b/src/common/make-te.c @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + /* Process textevents.in with make-te < textevents.in > textevents.h 2> textenums.h * * textevents.in notes: diff --git a/src/common/modes.c b/src/common/modes.c index 6caa46b9..419b704a 100644 --- a/src/common/modes.c +++ b/src/common/modes.c @@ -19,8 +19,6 @@ #include <string.h> #include <stdlib.h> #include <stdio.h> -#include <glib.h> -#include <glib/gprintf.h> #include "hexchat.h" #include "hexchatc.h" @@ -34,6 +32,8 @@ #include <strings.h> #endif +#include <glib/gprintf.h> + typedef struct { server *serv; @@ -813,17 +813,15 @@ inbound_005 (server * serv, char *word[]) } else if (strcmp (word[w], "WHOX") == 0) { serv->have_whox = TRUE; - } else if (strcmp (word[w], "CAPAB") == 0) - { - serv->have_capab = TRUE; - /* 12345678901234567890 */ - tcp_send_len (serv, "CAPAB IDENTIFY-MSG\r\n", 20); - /* now wait for numeric 290 */ } else if (strcmp (word[w], "EXCEPTS") == 0) { #ifndef WIN32 serv->have_except = TRUE; #endif + } else if (strcmp (word[w], "INVEX") == 0) + { + /* supports mode letter +I, default channel invite */ + serv->have_invite = TRUE; } else if (strncmp (word[w], "ELIST=", 6) == 0) { /* supports LIST >< min/max user counts? */ diff --git a/src/common/modes.h b/src/common/modes.h index 30ccbd72..e55ec911 100644 --- a/src/common/modes.h +++ b/src/common/modes.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_MODES_H #define HEXCHAT_MODES_H diff --git a/src/common/msproxy.h b/src/common/msproxy.h index 9fb312ad..4371d704 100644 --- a/src/common/msproxy.h +++ b/src/common/msproxy.h @@ -21,6 +21,9 @@ * Inferno Nettverk A/S, Norway. All rights reserved. */ +#ifndef HEXCHAT_MSPROXY_H +#define HEXCHAT_MSPROXY_H + #include "network.h" #define MSPROXY_EXECUTABLE "hexchat.exe" /* This probably can be used for access control on the server side */ @@ -255,3 +258,5 @@ struct msproxy_response_t { int traverse_msproxy (int sok, char *serverAddr, int port, struct msproxy_state_t *state, netstore *ns_proxy, int csok4, int csok6, int *csok, char bound); void msproxy_keepalive (void); + +#endif diff --git a/src/common/network.h b/src/common/network.h index d7957568..6a4dce39 100644 --- a/src/common/network.h +++ b/src/common/network.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_NETWORK_H #define HEXCHAT_NETWORK_H diff --git a/src/common/notify.h b/src/common/notify.h index eefb30e8..8e513d5f 100644 --- a/src/common/notify.h +++ b/src/common/notify.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_NOTIFY_H #define HEXCHAT_NOTIFY_H diff --git a/src/common/outbound.c b/src/common/outbound.c index c146c2ac..c3325f7c 100644 --- a/src/common/outbound.c +++ b/src/common/outbound.c @@ -2272,7 +2272,7 @@ cmd_ignore (struct session *sess, char *tbuf, char *word[], char *word_eol[]) return TRUE; } if (!*word[3]) - return FALSE; + word[3] = "ALL"; i = 3; while (1) @@ -2873,7 +2873,7 @@ open_query (server *serv, char *nick, gboolean focus_existing) sess = find_dialog (serv, nick); if (!sess) - new_ircwindow (serv, nick, SESS_DIALOG, 1); + new_ircwindow (serv, nick, SESS_DIALOG, focus_existing); else if (focus_existing) fe_ctrl_gui (sess, 2, 0); /* bring-to-front */ } @@ -3066,7 +3066,7 @@ cmd_splay (struct session *sess, char *tbuf, char *word[], char *word_eol[]) } static int -parse_irc_url (char *url, char *server_name[], char *port[], char *channel[], int *use_ssl) +parse_irc_url (char *url, char *server_name[], char *port[], char *channel[], char *key[], int *use_ssl) { char *co; #ifdef USE_OPENSSL @@ -3102,8 +3102,17 @@ urlserv: *channel = co+1; else *channel = co; - + + /* check for key - mirc style */ + co = strchr (co + 1, '?'); + if (co) + { + *co = 0; + co++; + *key = co; + } } + return TRUE; } return FALSE; @@ -3117,6 +3126,7 @@ cmd_server (struct session *sess, char *tbuf, char *word[], char *word_eol[]) char *port = NULL; char *pass = NULL; char *channel = NULL; + char *key = NULL; int use_ssl = FALSE; int is_url = TRUE; server *serv = sess->server; @@ -3130,7 +3140,7 @@ cmd_server (struct session *sess, char *tbuf, char *word[], char *word_eol[]) } #endif - if (!parse_irc_url (word[2 + offset], &server_name, &port, &channel, &use_ssl)) + if (!parse_irc_url (word[2 + offset], &server_name, &port, &channel, &key, &use_ssl)) { is_url = FALSE; server_name = word[2 + offset]; @@ -3156,6 +3166,8 @@ cmd_server (struct session *sess, char *tbuf, char *word[], char *word_eol[]) { sess->willjoinchannel[0] = '#'; safe_strcpy ((sess->willjoinchannel + 1), channel, (CHANLEN - 1)); + if (key) + safe_strcpy (sess->channelkey, key, 64); } /* support +7000 style ports like mIRC */ @@ -3277,6 +3289,12 @@ cmd_unignore (struct session *sess, char *tbuf, char *word[], char *arg = word[3]; if (*mask) { + if (strchr (mask, '?') == NULL && strchr (mask, '*') == NULL) + { + mask = tbuf; + snprintf (tbuf, TBUFSIZE, "%s!*@*", word[2]); + } + if (ignore_del (mask, NULL)) { if (g_ascii_strcasecmp (arg, "QUIET")) @@ -3356,15 +3374,18 @@ find_server_from_net (void *net) } static void -url_join_only (server *serv, char *tbuf, char *channel) +url_join_only (server *serv, char *tbuf, char *channel, char *key) { - /* already connected, JOIN only. FIXME: support keys? */ + /* already connected, JOIN only. */ if (channel == NULL) return; tbuf[0] = '#'; /* tbuf is 4kb */ safe_strcpy ((tbuf + 1), channel, 256); - serv->p_join (serv, tbuf, ""); + if (key) + serv->p_join (serv, tbuf, key); + else + serv->p_join (serv, tbuf, ""); } static int @@ -3375,12 +3396,13 @@ cmd_url (struct session *sess, char *tbuf, char *word[], char *word_eol[]) char *server_name = NULL; char *port = NULL; char *channel = NULL; + char *key = NULL; char *url = g_strdup (word[2]); int use_ssl = FALSE; void *net; server *serv; - if (parse_irc_url (url, &server_name, &port, &channel, &use_ssl)) + if (parse_irc_url (url, &server_name, &port, &channel, &key, &use_ssl)) { /* maybe we're already connected to this net */ @@ -3396,7 +3418,7 @@ cmd_url (struct session *sess, char *tbuf, char *word[], char *word_eol[]) serv = find_server_from_net (net); if (serv) { - url_join_only (serv, tbuf, channel); + url_join_only (serv, tbuf, channel, key); g_free (url); return TRUE; } @@ -3407,7 +3429,7 @@ cmd_url (struct session *sess, char *tbuf, char *word[], char *word_eol[]) serv = find_server_from_hostname (server_name); if (serv) { - url_join_only (serv, tbuf, channel); + url_join_only (serv, tbuf, channel, key); g_free (url); return TRUE; } @@ -4438,16 +4460,29 @@ handle_user_input (session *sess, char *text, int history, int nocommand) return 1; } +#if 0 /* Who would remember all this? */ if (prefs.hex_input_command_char[0] == '/') { int i; const char *unix_dirs [] = { - "/bin/", "/boot/", "/dev/", - "/etc/", "/home/", "/lib/", - "/lost+found/", "/mnt/", "/opt/", - "/proc/", "/root/", "/sbin/", - "/tmp/", "/usr/", "/var/", - "/gnome/", NULL}; + "/bin/", + "/boot/", + "/dev/", + "/etc/", + "/home/", + "/lib/", + "/lost+found/", + "/mnt/", + "/opt/", + "/proc/", + "/root/", + "/sbin/", + "/tmp/", + "/usr/", + "/var/", + "/gnome/", + NULL + }; for (i = 0; unix_dirs[i] != NULL; i++) if (strncmp (text, unix_dirs[i], strlen (unix_dirs[i]))==0) { @@ -4455,6 +4490,7 @@ handle_user_input (session *sess, char *text, int history, int nocommand) return 1; } } +#endif return handle_command (sess, text + 1, TRUE); } diff --git a/src/common/outbound.h b/src/common/outbound.h index def3868d..6f45b121 100644 --- a/src/common/outbound.h +++ b/src/common/outbound.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_OUTBOUND_H #define HEXCHAT_OUTBOUND_H diff --git a/src/common/plugin-timer.c b/src/common/plugin-timer.c index 7c87cc41..7f5f5cb4 100644 --- a/src/common/plugin-timer.c +++ b/src/common/plugin-timer.c @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 <string.h> #include <glib.h> diff --git a/src/common/plugin-timer.h b/src/common/plugin-timer.h index 6be73760..711e2bd4 100644 --- a/src/common/plugin-timer.h +++ b/src/common/plugin-timer.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_PLUGIN_TIMER_H #define HEXCHAT_PLUGIN_TIMER_H diff --git a/src/common/plugin.c b/src/common/plugin.c index fe58ba69..479994c8 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -471,7 +471,6 @@ plugin_auto_load (session *sess) for_files (".\\plugins", "hcdoat.dll", plugin_auto_load_cb); for_files (".\\plugins", "hcexec.dll", plugin_auto_load_cb); for_files (".\\plugins", "hcfishlim.dll", plugin_auto_load_cb); - /* for_files (".\\plugins", "hchextray.dll", plugin_auto_load_cb); don't load HexTray until it's fixed */ for_files (".\\plugins", "hcmpcinfo.dll", plugin_auto_load_cb); for_files (".\\plugins", "hcperl.dll", plugin_auto_load_cb); for_files (".\\plugins", "hcpython.dll", plugin_auto_load_cb); diff --git a/src/common/plugin.h b/src/common/plugin.h index 0aa43f0b..dd878895 100644 --- a/src/common/plugin.h +++ b/src/common/plugin.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_COMMONPLUGIN_H #define HEXCHAT_COMMONPLUGIN_H diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c index 699d068d..906ee713 100644 --- a/src/common/proto-irc.c +++ b/src/common/proto-irc.c @@ -518,14 +518,6 @@ process_numeric (session * sess, int n, } goto def; - case 290: /* CAPAB reply */ - if (strstr (word_eol[1], "IDENTIFY-MSG")) - { - serv->have_idmsg = TRUE; - break; - } - goto def; - case 301: inbound_away (serv, word[4], (word_eol[5][0] == ':') ? word_eol[5] + 1 : word_eol[5]); @@ -778,8 +770,18 @@ process_numeric (session * sess, int n, } break; + case 346: /* +I-list entry */ + if (!inbound_banlist (sess, atol (word[7]), word[4], word[5], word[6], 346)) + goto def; + break; + + case 347: /* end of invite list */ + if (!fe_ban_list_end (sess, 347)) + goto def; + break; + case 348: /* +e-list entry */ - if (!inbound_banlist (sess, atol (word[7]), word[4], word[5], word[6], TRUE)) + if (!inbound_banlist (sess, atol (word[7]), word[4], word[5], word[6], 348)) goto def; break; @@ -790,9 +792,8 @@ process_numeric (session * sess, int n, sess = serv->front_session; goto def; } - if (!fe_is_banwindow (sess)) + if (!fe_ban_list_end (sess, 349)) goto def; - fe_ban_list_end (sess, TRUE); break; case 353: /* NAMES */ @@ -806,7 +807,8 @@ process_numeric (session * sess, int n, break; case 367: /* banlist entry */ - inbound_banlist (sess, atol (word[7]), word[4], word[5], word[6], FALSE); + if (!inbound_banlist (sess, atol (word[7]), word[4], word[5], word[6], 367)) + goto def; break; case 368: @@ -816,9 +818,8 @@ process_numeric (session * sess, int n, sess = serv->front_session; goto def; } - if (!fe_is_banwindow (sess)) + if (!fe_ban_list_end (sess, 368)) goto def; - fe_ban_list_end (sess, FALSE); break; case 369: /* WHOWAS end */ @@ -881,6 +882,18 @@ process_numeric (session * sess, int n, notify_set_online (serv, word[4]); break; + case 728: /* +q-list entry */ + /* NOTE: FREENODE returns these results inconsistent with e.g. +b */ + /* Who else has imlemented MODE_QUIET, I wonder? */ + if (!inbound_banlist (sess, atol (word[8]), word[4], word[6], word[7], 728)) + goto def; + break; + + case 729: /* end of quiet list */ + if (!fe_ban_list_end (sess, 729)) + goto def; + break; + case 903: /* successful SASL auth */ case 904: /* aborted SASL auth */ case 905: /* failed SASL auth */ diff --git a/src/common/proto-irc.h b/src/common/proto-irc.h index 1070fd71..2de9815c 100644 --- a/src/common/proto-irc.h +++ b/src/common/proto-irc.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_PROTO_H #define HEXCHAT_PROTO_H diff --git a/src/common/server.c b/src/common/server.c index ca873042..9e07b5d5 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -313,13 +313,6 @@ server_inline (server *serv, char *line, int len) { char *utf_line_allocated = NULL; -#ifdef WIN32 -#if 0 - char *cleaned_line; - int cleaned_len; -#endif -#endif - /* Checks whether we're set to use UTF-8 charset */ if (serv->using_irc || /* 1. using CP1252/UTF-8 Hybrid */ (serv->encoding == NULL && prefs.utf8_locale) || /* OR 2. using system default->UTF-8 */ @@ -406,28 +399,11 @@ server_inline (server *serv, char *line, int len) } } -#ifdef WIN32 -#if 0 - cleaned_line = text_replace_non_bmp (line, len, &cleaned_len); - if (cleaned_line != NULL ) { - line = cleaned_line; - len = cleaned_len; - } -#endif - text_replace_non_bmp2 (line); -#endif - fe_add_rawlog (serv, line, len, FALSE); /* let proto-irc.c handle it */ serv->p_inline (serv, line, len); -#ifdef WIN32 -#if 0 - g_free (cleaned_line); -#endif -#endif - if (utf_line_allocated != NULL) /* only if a special copy was allocated */ g_free (utf_line_allocated); } @@ -1911,10 +1887,10 @@ server_set_defaults (server *serv) serv->have_awaynotify = FALSE; serv->have_uhnames = FALSE; serv->have_whox = FALSE; - serv->have_capab = FALSE; serv->have_idmsg = FALSE; serv->have_sasl = FALSE; serv->have_except = FALSE; + serv->have_invite = FALSE; } char * diff --git a/src/common/server.h b/src/common/server.h index e5c70636..08aeca56 100644 --- a/src/common/server.h +++ b/src/common/server.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_SERVER_H #define HEXCHAT_SERVER_H diff --git a/src/common/servlist.c b/src/common/servlist.c index f4208f61..306b42e8 100644 --- a/src/common/servlist.c +++ b/src/common/servlist.c @@ -27,8 +27,6 @@ #endif #include "hexchat.h" -#include <glib.h> - #include "cfgfiles.h" #include "fe.h" #include "server.h" @@ -496,6 +494,9 @@ static const struct defaultserver def[] = #endif {0, "irc.snoonet.org/6667"}, + {"Snyde", 0}, + {0, "irc.snyde.net/6667"}, + {"Sohbet.Net", 0}, {0, "irc.sohbet.net"}, @@ -511,6 +512,12 @@ static const struct defaultserver def[] = {0, "us.spidernet.org"}, {0, "eu.spidernet.org"}, {0, "irc.spidernet.org"},*/ + + {"SpotChat", 0}, +#ifdef USE_OPENSSL + {0, "irc.spotchat.org/+6697"}, +#endif + {0, "irc.spotchat.org/6667"}, {"StarChat", 0}, {0, "irc.starchat.net"}, @@ -1047,7 +1054,19 @@ servlist_load (void) char *tmp; ircnet *net = NULL; - fp = hexchat_fopen_file ("servlist_.conf", "r", 0); + /* simple migration we will keep for a short while */ + char *oldfile = g_build_filename (get_xdir (), "servlist_.conf", NULL); + char *newfile = g_build_filename (get_xdir (), "servlist.conf", NULL); + + if (g_file_test (oldfile, G_FILE_TEST_EXISTS) && !g_file_test (newfile, G_FILE_TEST_EXISTS)) + { + g_rename (oldfile, newfile); + } + + g_free (oldfile); + g_free (newfile); + + fp = hexchat_fopen_file ("servlist.conf", "r", 0); if (!fp) return FALSE; @@ -1178,12 +1197,12 @@ servlist_save (void) #ifndef WIN32 int first = FALSE; - buf = g_strdup_printf ("%s/servlist_.conf", get_xdir ()); + buf = g_strdup_printf ("%s/servlist.conf", get_xdir ()); if (g_access (buf, F_OK) != 0) first = TRUE; #endif - fp = hexchat_fopen_file ("servlist_.conf", "w", 0); + fp = hexchat_fopen_file ("servlist.conf", "w", 0); if (!fp) { #ifndef WIN32 diff --git a/src/common/servlist.h b/src/common/servlist.h index b50ca0ea..5ed3c4d6 100644 --- a/src/common/servlist.h +++ b/src/common/servlist.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_SERVLIST_H #define HEXCHAT_SERVLIST_H diff --git a/src/common/ssl.c b/src/common/ssl.c index 75a81250..742da619 100644 --- a/src/common/ssl.c +++ b/src/common/ssl.c @@ -31,7 +31,7 @@ #include "ssl.h" /* struct cert_info */ #ifndef HAVE_SNPRINTF -#include <glib.h> +#include <glib.h> #include <glib/gprintf.h> #define snprintf g_snprintf #endif @@ -77,7 +77,7 @@ _SSL_context_init (void (*info_cb_func), int server) SSLeay_add_ssl_algorithms (); SSL_load_error_strings (); - ctx = SSL_CTX_new (server ? SSLv3_server_method() : SSLv3_client_method ()); + ctx = SSL_CTX_new (server ? SSLv23_server_method() : SSLv23_client_method ()); SSL_CTX_set_session_cache_mode (ctx, SSL_SESS_CACHE_BOTH); SSL_CTX_set_timeout (ctx, 300); @@ -288,7 +288,7 @@ _SSL_socket (SSL_CTX *ctx, int sd) __SSL_critical_error ("SSL_new"); SSL_set_fd (ssl, sd); - if (ctx->method == SSLv3_client_method()) + if (ctx->method == SSLv23_client_method()) SSL_set_connect_state (ssl); else SSL_set_accept_state(ssl); diff --git a/src/common/ssl.h b/src/common/ssl.h index 26eb0f88..ad34944c 100644 --- a/src/common/ssl.h +++ b/src/common/ssl.h @@ -1,6 +1,24 @@ -/* - ... -*/ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_SSL_H +#define HEXCHAT_SSL_H struct cert_info { char subject[256]; @@ -63,3 +81,5 @@ int _SSL_recv (SSL * ssl, char *buf, int len); #define _SSL_get_ctx_x509_base64(a) _SSL_get_ctx_obj_base64(a, 2) /*int _SSL_verify_x509(X509 *x509);*/ + +#endif diff --git a/src/common/strlutil.c b/src/common/strlutil.c deleted file mode 100644 index c823c1e8..00000000 --- a/src/common/strlutil.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#include <sys/types.h> -#include <string.h> - -/* - * Appends src to string dst of size siz (unlike strncat, siz is the - * full size of dst, not space left). At most siz-1 characters - * will be copied. Always NUL terminates (unless siz <= strlen(dst)). - * Returns strlen(src) + MIN(siz, strlen(initial dst)). - * If retval >= siz, truncation occurred. - */ -size_t -strlcat(char *dst, const char *src, size_t siz) -{ - char *d = dst; - const char *s = src; - size_t n = siz; - size_t dlen; - - /* Find the end of dst and adjust bytes left but don't go past end */ - while (n-- != 0 && *d != '\0') - d++; - dlen = d - dst; - n = siz - dlen; - - if (n == 0) - return(dlen + strlen(s)); - while (*s != '\0') { - if (n != 1) { - *d++ = *s; - n--; - } - s++; - } - *d = '\0'; - - return(dlen + (s - src)); /* count does not include NUL */ -} - -/* - * Copy src to string dst of size siz. At most siz-1 characters - * will be copied. Always NUL terminates (unless siz == 0). - * Returns strlen(src); if retval >= siz, truncation occurred. - */ -size_t -strlcpy(char *dst, const char *src, size_t siz) -{ - char *d = dst; - const char *s = src; - size_t n = siz; - - /* Copy as many bytes as will fit */ - if (n != 0) { - while (--n != 0) { - if ((*d++ = *s++) == '\0') - break; - } - } - - /* Not enough room in dst, add NUL and traverse rest of src */ - if (n == 0) { - if (siz != 0) - *d = '\0'; /* NUL-terminate dst */ - while (*s++) - ; - } - - return(s - src - 1); /* count does not include NUL */ -} diff --git a/src/common/strlutil.h b/src/common/strlutil.h deleted file mode 100644 index 968aab53..00000000 --- a/src/common/strlutil.h +++ /dev/null @@ -1,2 +0,0 @@ -size_t strlcat(char *dst, const char *src, size_t siz); -size_t strlcpy(char *dst, const char *src, size_t siz); diff --git a/src/common/text.c b/src/common/text.c index 0bef377c..96fdacd0 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -33,7 +33,6 @@ #endif #include "hexchat.h" -#include <glib.h> #include "cfgfiles.h" #include "chanopt.h" #include "plugin.h" @@ -307,21 +306,9 @@ scrollback_load (session *sess) { text = strip_color (text + 1, -1, STRIP_COLOR); } -#ifdef WIN32 -#if 0 - cleaned_text = text_replace_non_bmp (text, -1, &cleaned_len); - if (cleaned_text != NULL) - { - if (prefs.hex_text_stripcolor_replay) - { - g_free (text); - } - text = cleaned_text; - } -#endif - text_replace_non_bmp2 (text); -#endif + fe_print_text (sess, text, stamp); + if (prefs.hex_text_stripcolor_replay) { g_free (text); @@ -833,71 +820,6 @@ iso_8859_1_to_utf8 (unsigned char *text, int len, gsize *bytes_written) return res; } -#ifdef WIN32 -/* replace characters outside of the Basic Multilingual Plane with - * replacement characters (0xFFFD) */ -#if 0 -char * -text_replace_non_bmp (char *utf8_input, int input_length, glong *output_length) -{ - gunichar *ucs4_text; - gunichar suspect; - gchar *utf8_text; - glong ucs4_length; - glong index; - - ucs4_text = g_utf8_to_ucs4_fast (utf8_input, input_length, &ucs4_length); - - /* replace anything not in the Basic Multilingual Plane - * (code points above 0xFFFF) with the replacement - * character */ - for (index = 0; index < ucs4_length; index++) - { - suspect = ucs4_text[index]; - if ((suspect >= 0x1D173 && suspect <= 0x1D17A) - || (suspect >= 0xE0001 && suspect <= 0xE007F)) - { - ucs4_text[index] = 0xFFFD; /* replacement character */ - } - } - - utf8_text = g_ucs4_to_utf8 ( - ucs4_text, - ucs4_length, - NULL, - output_length, - NULL - ); - g_free (ucs4_text); - - return utf8_text; -} -#endif - -void -text_replace_non_bmp2 (char *utf8_input) -{ - char *tmp = utf8_input, *next; - gunichar suspect; - - while (tmp != NULL && *tmp) - { - next = g_utf8_next_char(tmp); - suspect = g_utf8_get_char_validated(tmp, next - tmp); - if ((suspect >= 0x1D173 && suspect <= 0x1D17A) || (suspect >= 0xE0001 && suspect <= 0xE007F)) - { - /* 0xFFFD - replacement character */ - *tmp = 0xEF; - *(++tmp) = 0xBF; - *(++tmp) = 0xBD; - *(++tmp) = 0x1A; /* ASCII Sub to fill the 4th non-BMP byte */ - } - - tmp = next; - } -} -#endif - char * text_validate (char **text, int *len) { @@ -1857,6 +1779,8 @@ format_event (session *sess, int index, char **args, char *o, int sizeofo, unsig printf ("arg[%d] is NULL in print event\n", a + 1); } else { + if (strlen (ar) > sizeofo - oi - 4) + ar[sizeofo - oi - 4] = 0; /* Avoid buffer overflow */ if (stripcolor_args & ARG_FLAG(a + 1)) len = strip_color2 (ar, -1, &o[oi], STRIP_ALL); else len = strip_hidden_attribute (ar, &o[oi]); oi += len; @@ -2081,8 +2005,8 @@ pevt_build_string (const char *input, char **output, int *max_arg) static char rcolors[] = { 19, 20, 22, 24, 25, 26, 27, 28, 29 }; -static int -color_of (char *name) +int +text_color_of (char *name) { int i = 0, sum = 0; @@ -2105,7 +2029,7 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d) if (prefs.hex_text_color_nicks && (index == XP_TE_CHANACTION || index == XP_TE_CHANMSG)) { - snprintf (tbuf, sizeof (tbuf), "\003%d%s", color_of (a), a); + snprintf (tbuf, sizeof (tbuf), "\003%d%s", text_color_of (a), a); a = tbuf; stripcolor_args &= ~ARG_FLAG(1); /* don't strip color from this argument */ } diff --git a/src/common/text.h b/src/common/text.h index ccbae785..52cc8ea9 100644 --- a/src/common/text.h +++ b/src/common/text.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 "textenums.h" #ifndef HEXCHAT_TEXT_H @@ -26,14 +45,9 @@ void pevent_save (char *fn); int pevt_build_string (const char *input, char **output, int *max_arg); int pevent_load (char *filename); void pevent_make_pntevts (void); +int text_color_of (char *name); void text_emit (int index, session *sess, char *a, char *b, char *c, char *d); int text_emit_by_name (char *name, session *sess, char *a, char *b, char *c, char *d); -#ifdef WIN32 -#if 0 -char *text_replace_non_bmp (char *utf8_input, int input_length, glong *output_length); -#endif -void text_replace_non_bmp2 (char *utf8_input); -#endif char *text_validate (char **text, int *len); int get_stamp_str (char *fmt, time_t tim, char **ret); void format_event (session *sess, int index, char **args, char *o, int sizeofo, unsigned int stripcolor_args); diff --git a/src/common/textevents.in b/src/common/textevents.in index 69d42526..7b7050ed 100644 --- a/src/common/textevents.in +++ b/src/common/textevents.in @@ -175,7 +175,7 @@ pevt_chanrmlimit_help Channel Set Key XP_TE_CHANSETKEY pevt_chansetkey_help -%C22*%O$t$1 sets channel keyword to %C24$2%O +%C22*%O$t%C26$1%O sets channel keyword to %C24$2%O 2 Channel Set Limit @@ -187,7 +187,7 @@ pevt_chansetlimit_help Channel UnBan XP_TE_CHANUNBAN pevt_chanunban_help -%C22*%O$t%C26$1%O removes ban on %C24$2%O +%C22*%O$t%C26$1%O removes ban on %C18$2%O 2 Channel Voice diff --git a/src/common/thread.c b/src/common/thread.c index ba808737..40a8778f 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + #if 0 /* native file dialogs */ #include <fcntl.h> #include "thread.h" diff --git a/src/common/thread.h b/src/common/thread.h index 97a4ed30..2c736ca2 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -1,3 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_THREAD_H +#define HEXCHAT_THREAD_H + #if 0 /* native file dialogs */ #include <windows.h> @@ -10,3 +32,5 @@ typedef struct thread *thread_new (void); int thread_start (thread *th, void *(*start_routine)(void *), void *arg); #endif + +#endif diff --git a/src/common/tree.c b/src/common/tree.c index 715b0e56..587d15f0 100644 --- a/src/common/tree.c +++ b/src/common/tree.c @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + /* This is used for quick userlist insertion and lookup. It's not really a tree, but it could be :) diff --git a/src/common/tree.h b/src/common/tree.h index ced8e425..848f5abf 100644 --- a/src/common/tree.h +++ b/src/common/tree.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_TREE_H #define HEXCHAT_TREE_H diff --git a/src/common/typedef.h b/src/common/typedef.h index daeffcae..2034f923 100644 --- a/src/common/typedef.h +++ b/src/common/typedef.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_TYPEDEF_H #define HEXCHAT_TYPEDEF_H diff --git a/src/common/url.c b/src/common/url.c index 6bd7d9ff..9b4e30ad 100644 --- a/src/common/url.c +++ b/src/common/url.c @@ -288,8 +288,8 @@ url_check_line (char *buf, int len) int start, end; g_match_info_fetch_pos(gmi, 0, &start, &end); - if (po[end - 1] == '\r') - po[--end] = 0; + while (end > start && (po[end - 1] == '\r' || po[end - 1] == '\n')) + end--; if (g_strstr_len (po + start, end - start, "://")) url_add(po + start, end - start); g_match_info_next(gmi, NULL); @@ -515,8 +515,8 @@ re_channel (void) /* PATH description --- */ #ifdef WIN32 -/* Windows path can be C: D: etc */ -#define PATH "^([a-z]:).*" +/* Windows path can be .\ ..\ or C: D: etc */ +#define PATH "^(\\.{1,2}\\\\|[a-z]:).*" #else /* Linux path can be / or ./ or ../ etc */ #define PATH "^(/|\\./|\\.\\./).*" diff --git a/src/common/url.h b/src/common/url.h index b8e5c848..96d9f946 100644 --- a/src/common/url.h +++ b/src/common/url.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_URL_H #define HEXCHAT_URL_H diff --git a/src/common/userlist.h b/src/common/userlist.h index d0d79da8..c1070670 100644 --- a/src/common/userlist.h +++ b/src/common/userlist.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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> #ifndef HEXCHAT_USERLIST_H diff --git a/src/common/util.c b/src/common/util.c index 2319f75e..9ce23879 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -48,7 +48,6 @@ #include <errno.h> #include "hexchat.h" #include "hexchatc.h" -#include <glib.h> #include <ctype.h> #include "util.h" @@ -1861,20 +1860,14 @@ portable_mode () } int -hextray_mode () +unity_mode () { -#ifdef WIN32 - if ((_access( "plugins/hchextray.dll", 0 )) != -1) - { +#ifdef G_OS_UNIX + const char *env = g_getenv("XDG_CURRENT_DESKTOP"); + if (env && strcmp (env, "Unity") == 0) return 1; - } - else - { - return 0; - } -#else - return 0; #endif + return 0; } /* Routine for listing subfolders of a given folder. ALWAYS free correctly after use, e.g. diff --git a/src/common/util.h b/src/common/util.h index 8114cbc7..9e2d9f52 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + /************************************************************************ * This technique was borrowed in part from the source code to * ircd-hybrid-5.3 to implement case-insensitive string matches which @@ -14,7 +33,6 @@ #ifndef HEXCHAT_UTIL_H #define HEXCHAT_UTIL_H -#include "strlutil.h" #define rfc_tolower(c) (rfc_tolowertab[(unsigned char)(c)]) extern const unsigned char rfc_tolowertab[]; @@ -59,7 +77,7 @@ guint32 str_ihash (const unsigned char *key); void safe_strcpy (char *dest, const char *src, int bytes_left); void canonalize_key (char *key); int portable_mode (); -int hextray_mode (); +int unity_mode (); GSList *get_subdirs (const char *path); char *encode_sasl_pass (char *user, char *pass); diff --git a/src/fe-gtk/Makefile.am b/src/fe-gtk/Makefile.am index 3928b413..8bbad35d 100644 --- a/src/fe-gtk/Makefile.am +++ b/src/fe-gtk/Makefile.am @@ -2,7 +2,7 @@ localedir = $(datadir)/locale bin_PROGRAMS = hexchat -AM_CPPFLAGS = $(GUI_CFLAGS) -DG_DISABLE_CAST_CHECKS -DLOCALEDIR=\"$(localedir)\" +AM_CPPFLAGS = $(GUI_CFLAGS) -DLOCALEDIR=\"$(localedir)\" hexchat_LDADD = ../common/libhexchatcommon.a $(GUI_LIBS) diff --git a/src/fe-gtk/about.c b/src/fe-gtk/about.c index 54b71053..c47fba4f 100644 --- a/src/fe-gtk/about.c +++ b/src/fe-gtk/about.c @@ -22,17 +22,6 @@ #include "fe-gtk.h" -#include <gtk/gtkmain.h> -#include <gtk/gtkcontainer.h> -#include <gtk/gtkdialog.h> -#include <gtk/gtkvbox.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkimage.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkbutton.h> -#include <gtk/gtkstock.h> -#include <gtk/gtkwindow.h> - #ifdef USE_XLIB #include <gdk/gdkx.h> #endif diff --git a/src/fe-gtk/about.h b/src/fe-gtk/about.h index 2bad159c..b4d5cb34 100644 --- a/src/fe-gtk/about.h +++ b/src/fe-gtk/about.h @@ -1 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_ABOUT_H +#define HEXCHAT_ABOUT_H + void menu_about (GtkWidget * wid, gpointer sess); + +#endif diff --git a/src/fe-gtk/ascii.c b/src/fe-gtk/ascii.c index 06621cd7..56b0198b 100644 --- a/src/fe-gtk/ascii.c +++ b/src/fe-gtk/ascii.c @@ -22,12 +22,6 @@ #include "fe-gtk.h" -#include <gtk/gtkeditable.h> -#include <gtk/gtkframe.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkbutton.h> - #include "../common/hexchat.h" #include "../common/hexchatc.h" #include "gtkutil.h" @@ -90,7 +84,6 @@ static const unsigned char table[]= 0xd1,0x89,0xd1,0x8a,0xd1,0x8b,0xd1,0x8c,0xd1,0x8d,0xd1,0x8e,0xd1,0x8f,0 }; - static gboolean ascii_enter (GtkWidget * wid, GdkEventCrossing *event, GtkWidget *label) { @@ -133,6 +126,7 @@ ascii_open (void) win = mg_create_generic_tab ("charmap", _("Character Chart"), TRUE, TRUE, NULL, NULL, 0, 0, &vbox, NULL); gtk_container_set_border_width (GTK_CONTAINER (win), 5); + gtkutil_destroy_on_esc (win); label = gtk_label_new (NULL); diff --git a/src/fe-gtk/ascii.h b/src/fe-gtk/ascii.h index afd3bd4f..18d63415 100644 --- a/src/fe-gtk/ascii.h +++ b/src/fe-gtk/ascii.h @@ -1 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_ASCII_H +#define HEXCHAT_ASCII_H + void ascii_open (void); + +#endif diff --git a/src/fe-gtk/banlist.c b/src/fe-gtk/banlist.c index a783ea07..8c396d14 100644 --- a/src/fe-gtk/banlist.c +++ b/src/fe-gtk/banlist.c @@ -28,15 +28,6 @@ #include "fe-gtk.h" -#include <gtk/gtkhbox.h> -#include <gtk/gtkvbox.h> -#include <gtk/gtkhbbox.h> -#include <gtk/gtkstock.h> -#include <gtk/gtkliststore.h> -#include <gtk/gtkmessagedialog.h> -#include <gtk/gtktreeview.h> -#include <gtk/gtktreeselection.h> - #include "../common/hexchat.h" #include "../common/fe.h" #include "../common/modes.h" @@ -46,9 +37,56 @@ #include "maingui.h" #include "banlist.h" +/* + * These supports_* routines set capable, readable, writable bits */ +static void supports_bans (banlist_info *, int); +static void supports_exempt (banlist_info *, int); +static void supports_invite (banlist_info *, int); +static void supports_quiet (banlist_info *, int); + +static mode_info modes[MODE_CT] = { + { + N_("Bans"), + N_("Ban"), + 'b', + RPL_BANLIST, + RPL_ENDOFBANLIST, + 1<<MODE_BAN, + supports_bans + } + ,{ + N_("Exempts"), + N_("Exempt"), + 'e', + RPL_EXCEPTLIST, + RPL_ENDOFEXCEPTLIST, + 1<<MODE_EXEMPT, + supports_exempt + } + ,{ + N_("Invites"), + N_("Invite"), + 'I', + RPL_INVITELIST, + RPL_ENDOFINVITELIST, + 1<<MODE_INVITE, + supports_invite + } + ,{ + N_("Quiets"), + N_("Quiet"), + 'q', + RPL_QUIETLIST, + RPL_ENDOFQUIETLIST, + 1<<MODE_QUIET, + supports_quiet + } +}; + /* model for the banlist tree */ enum { + TYPE_COLUMN, MASK_COLUMN, FROM_COLUMN, DATE_COLUMN, @@ -58,7 +96,7 @@ enum static GtkTreeView * get_view (struct session *sess) { - return GTK_TREE_VIEW (sess->res->banlist_treeview); + return GTK_TREE_VIEW (sess->res->banlist->treeview); } static GtkListStore * @@ -67,91 +105,280 @@ get_store (struct session *sess) return GTK_LIST_STORE (gtk_tree_view_get_model (get_view (sess))); } -static gboolean -supports_exempt (server *serv) +static void +supports_bans (banlist_info *banl, int i) +{ + int bit = 1<<i; + + banl->capable |= bit; + banl->readable |= bit; + banl->writeable |= bit; + return; +} + +static void +supports_exempt (banlist_info *banl, int i) { + server *serv = banl->sess->server; char *cm = serv->chanmodes; + int bit = 1<<i; if (serv->have_except) - return TRUE; + goto yes; if (!cm) - return FALSE; + return; while (*cm) { if (*cm == ',') break; if (*cm == 'e') - return TRUE; + goto yes; cm++; } + return; - return FALSE; +yes: + banl->capable |= bit; + banl->writeable |= bit; } -void -fe_add_ban_list (struct session *sess, char *mask, char *who, char *when, int is_exempt) +static void +supports_invite (banlist_info *banl, int i) +{ + server *serv = banl->sess->server; + char *cm = serv->chanmodes; + int bit = 1<<i; + + if (serv->have_invite) + goto yes; + + if (!cm) + return; + + while (*cm) + { + if (*cm == ',') + break; + if (*cm == 'I') + goto yes; + cm++; + } + return; + +yes: + banl->capable |= bit; + banl->writeable |= bit; +} + +static void +supports_quiet (banlist_info *banl, int i) +{ + server *serv = banl->sess->server; + char *cm = serv->chanmodes; + int bit = 1<<i; + + if (!cm) + return; + + while (*cm) + { + if (*cm == ',') + break; + if (*cm == modes[i].letter) + goto yes; + cm++; + } + return; + +yes: + banl->capable |= bit; + banl->readable |= bit; + banl->writeable |= bit; +} + +/* fe_add_ban_list() and fe_ban_list_end() return TRUE if consumed, FALSE otherwise */ +gboolean +fe_add_ban_list (struct session *sess, char *mask, char *who, char *when, int rplcode) { + banlist_info *banl = sess->res->banlist; + int i; GtkListStore *store; GtkTreeIter iter; - char buf[512]; - store = get_store (sess); - gtk_list_store_append (store, &iter); + if (!banl) + return FALSE; - if (is_exempt) + for (i = 0; i < MODE_CT; i++) + if (modes[i].code == rplcode) + break; + if (i == MODE_CT) { - snprintf (buf, sizeof (buf), "(EX) %s", mask); - gtk_list_store_set (store, &iter, 0, buf, 1, who, 2, when, -1); - } else + /* printf ("Unexpected value in fe_add_ban_list: %d\n", rplcode); */ + return FALSE; + } + if (banl->pending & 1<<i) { - gtk_list_store_set (store, &iter, 0, mask, 1, who, 2, when, -1); + store = get_store (sess); + gtk_list_store_append (store, &iter); + + gtk_list_store_set (store, &iter, TYPE_COLUMN, _(modes[i].type), MASK_COLUMN, mask, + FROM_COLUMN, who, DATE_COLUMN, when, -1); + + banl->line_ct++; + return TRUE; } + else return FALSE; } -void -fe_ban_list_end (struct session *sess, int is_exemption) +/* Sensitize checkboxes and buttons as appropriate for the moment */ +static void +banlist_sensitize (banlist_info *banl) { - gtk_widget_set_sensitive (sess->res->banlist_butRefresh, TRUE); + int checkable, i; + + /* CHECKBOXES -- */ + checkable = banl->sess->me->op? banl->writeable: banl->readable; + for (i = 0; i < MODE_CT; i++) + { + if (banl->checkboxes[i] == NULL) + continue; + if ((checkable & 1<<i) == 0) + /* Checkbox is not checkable. Grey it and uncheck it. */ + { + gtk_widget_set_sensitive (banl->checkboxes[i], FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (banl->checkboxes[i]), FALSE); + } + else + /* Checkbox is checkable. Be sure it's sensitive. */ + { + gtk_widget_set_sensitive (banl->checkboxes[i], TRUE); + } + } + + /* BUTTONS --- */ + if (banl->sess->me->op == 0 || banl->line_ct == 0) + { + /* If user is not op or list is empty, buttons should be all greyed */ + gtk_widget_set_sensitive (banl->but_clear, FALSE); + gtk_widget_set_sensitive (banl->but_crop, FALSE); + gtk_widget_set_sensitive (banl->but_remove, FALSE); + } + else + { + /* If no lines are selected, only the CLEAR button should be sensitive */ + if (banl->select_ct == 0) + { + gtk_widget_set_sensitive (banl->but_clear, TRUE); + gtk_widget_set_sensitive (banl->but_crop, FALSE); + gtk_widget_set_sensitive (banl->but_remove, FALSE); + } + /* If any lines are selected, only the REMOVE and CROP buttons should be sensitive */ + else + { + gtk_widget_set_sensitive (banl->but_clear, FALSE); + gtk_widget_set_sensitive (banl->but_crop, TRUE); + gtk_widget_set_sensitive (banl->but_remove, TRUE); + } + } + + /* Set "Refresh" sensitvity */ + gtk_widget_set_sensitive (banl->but_refresh, banl->pending? FALSE: banl->checked? TRUE: FALSE); +} +/* fe_ban_list_end() returns TRUE if consumed, FALSE otherwise */ +gboolean +fe_ban_list_end (struct session *sess, int rplcode) +{ + banlist_info *banl = sess->res->banlist; + int i; + + if (!banl) + return FALSE; + + for (i = 0; i < MODE_CT; i++) + if (modes[i].endcode == rplcode) + break; + if (i == MODE_CT) + { + /* printf ("Unexpected rplcode value in fe_ban_list_end: %d\n", rplcode); */ + return FALSE; + } + if (banl->pending & modes[i].bit) + { + banl->pending &= ~modes[i].bit; + if (!banl->pending) + { + gtk_widget_set_sensitive (banl->but_refresh, TRUE); + banlist_sensitize (banl); + } + return TRUE; + } + else return FALSE; +} + +static void +banlist_select_changed (GtkWidget *item, banlist_info *banl) +{ + GList *list; + + if (banl->line_ct == 0) + banl->select_ct = 0; + else + { + list = gtk_tree_selection_get_selected_rows (GTK_TREE_SELECTION (item), NULL); + banl->select_ct = list? 1: 0; + g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); + g_list_free (list); + } + banlist_sensitize (banl); } /** * * Performs the actual refresh operations. * */ static void -banlist_do_refresh (struct session *sess) +banlist_do_refresh (banlist_info *banl) { + session *sess = banl->sess; char tbuf[256]; + int i; + char *tbufp; + + banlist_sensitize (banl); + if (sess->server->connected) { GtkListStore *store; - gtk_widget_set_sensitive (sess->res->banlist_butRefresh, FALSE); - - snprintf (tbuf, sizeof tbuf, DISPLAY_NAME": Ban List (%s, %s)", + g_snprintf (tbuf, sizeof tbuf, DISPLAY_NAME": Ban List (%s, %s)", sess->channel, sess->server->servername); - mg_set_title (sess->res->banlist_window, tbuf); + mg_set_title (banl->window, tbuf); store = get_store (sess); gtk_list_store_clear (store); - - handle_command (sess, "ban", FALSE); - - if (supports_exempt (sess->server)) + banl->line_ct = 0; + banl->pending = banl->checked; + if (banl->pending) { - snprintf (tbuf, sizeof (tbuf), "quote mode %s +e", sess->channel); + tbufp = tbuf + g_snprintf (tbuf, sizeof tbuf, "quote mode %s +", sess->channel); + for (i = 0; i < MODE_CT; i++) + if (banl->pending & 1<<i) + { + *tbufp++ = modes[i].letter; + } + *tbufp = 0; handle_command (sess, tbuf, FALSE); } - - } else + } + else { fe_message (_("Not connected."), FE_MSG_ERROR); } } static void -banlist_refresh (GtkWidget * wid, struct session *sess) +banlist_refresh (GtkWidget * wid, banlist_info *banl) { /* JG NOTE: Didn't see actual use of wid here, so just forwarding * * this to chanlist_do_refresh because I use it without any widget @@ -159,123 +386,106 @@ banlist_refresh (GtkWidget * wid, struct session *sess) * * or apply for the first time if the list has not yet been * * received. * */ - banlist_do_refresh (sess); + banlist_do_refresh (banl); } static int -banlist_unban_inner (gpointer none, struct session *sess, int do_exempts) +banlist_unban_inner (gpointer none, banlist_info *banl, int mode_num) { + session *sess = banl->sess; GtkTreeModel *model; GtkTreeSelection *sel; GtkTreeIter iter; char tbuf[2048]; - char **masks, *tmp, *space; + char **masks, *mask, *type; int num_sel, i; + /* grab the list of selected items */ model = GTK_TREE_MODEL (get_store (sess)); sel = gtk_tree_view_get_selection (get_view (sess)); - num_sel = 0; - if (gtk_tree_model_get_iter_first (model, &iter)) - { - do - { - if (gtk_tree_selection_iter_is_selected (sel, &iter)) - num_sel++; - } - while (gtk_tree_model_iter_next (model, &iter)); - } - if (num_sel < 1) + if (!gtk_tree_model_get_iter_first (model, &iter)) return 0; - /* create an array of all the masks */ - masks = calloc (1, num_sel * sizeof (char *)); - - i = 0; - gtk_tree_model_get_iter_first (model, &iter); + masks = g_malloc (sizeof (char *) * banl->line_ct); + num_sel = 0; do { if (gtk_tree_selection_iter_is_selected (sel, &iter)) { - gtk_tree_model_get (model, &iter, MASK_COLUMN, &masks[i], -1); - space = strchr (masks[i], ' '); + /* Get the mask part of this selected line */ + gtk_tree_model_get (model, &iter, TYPE_COLUMN, &type, MASK_COLUMN, &mask, -1); - if (do_exempts) - { - if (space) - { - /* remove the "(EX) " */ - tmp = masks[i]; - masks[i] = g_strdup (space + 1); - g_free (tmp); - i++; - } - } else - { - if (!space) - i++; - } + /* If it's the wrong type of mask, just continue */ + if (strcmp (_(modes[mode_num].type), type) != 0) + continue; + + /* Otherwise add it to our array of mask pointers */ + masks[num_sel++] = g_strdup (mask); + g_free (mask); + g_free (type); } } while (gtk_tree_model_iter_next (model, &iter)); /* and send to server */ - if (do_exempts) - send_channel_modes (sess, tbuf, masks, 0, i, '-', 'e', 0); - else - send_channel_modes (sess, tbuf, masks, 0, i, '-', 'b', 0); + if (num_sel) + send_channel_modes (sess, tbuf, masks, 0, num_sel, '-', modes[mode_num].letter, 0); - /* now free everything, and refresh banlist */ + /* now free everything */ for (i=0; i < num_sel; i++) g_free (masks[i]); - free (masks); + g_free (masks); return num_sel; } static void -banlist_unban (GtkWidget * wid, struct session *sess) +banlist_unban (GtkWidget * wid, banlist_info *banl) { - int num = 0; + int i, num = 0; - num += banlist_unban_inner (wid, sess, FALSE); - num += banlist_unban_inner (wid, sess, TRUE); + for (i = 0; i < MODE_CT; i++) + num += banlist_unban_inner (wid, banl, i); + /* This really should not occur with the redesign */ if (num < 1) { fe_message (_("You must select some bans."), FE_MSG_ERROR); return; } - banlist_do_refresh (sess); + banlist_do_refresh (banl); } static void -banlist_clear_cb (GtkDialog *dialog, gint response, gpointer sess) +banlist_clear_cb (GtkDialog *dialog, gint response, gpointer data) { + banlist_info *banl = data; GtkTreeSelection *sel; gtk_widget_destroy (GTK_WIDGET (dialog)); if (response == GTK_RESPONSE_OK) { - sel = gtk_tree_view_get_selection (get_view (sess)); + sel = gtk_tree_view_get_selection (get_view (banl->sess)); gtk_tree_selection_select_all (sel); - banlist_unban (NULL, sess); + banlist_unban (NULL, banl); } } static void -banlist_clear (GtkWidget * wid, struct session *sess) +banlist_clear (GtkWidget * wid, banlist_info *banl) { GtkWidget *dialog; dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, - _("Are you sure you want to remove all bans in %s?"), sess->channel); + _("Are you sure you want to remove all listed items in %s?"), banl->sess->channel); + g_signal_connect (G_OBJECT (dialog), "response", - G_CALLBACK (banlist_clear_cb), sess); + G_CALLBACK (banlist_clear_cb), banl); gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); gtk_widget_show (dialog); } @@ -298,8 +508,9 @@ banlist_add_selected_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *it } static void -banlist_crop (GtkWidget * wid, struct session *sess) +banlist_crop (GtkWidget * wid, banlist_info *banl) { + session *sess = banl->sess; GtkTreeSelection *select; GSList *list = NULL, *node; int num_sel; @@ -318,44 +529,147 @@ banlist_crop (GtkWidget * wid, struct session *sess) for (node = list; node; node = node->next) gtk_tree_selection_unselect_iter (select, node->data); - + g_slist_foreach (list, (GFunc)g_free, NULL); g_slist_free (list); - banlist_unban (NULL, sess); + banlist_unban (NULL, banl); } else fe_message (_("You must select some bans."), FE_MSG_ERROR); } +static void +banlist_toggle (GtkWidget *item, gpointer data) +{ + banlist_info *banl = data; + int i, bit = 0; + + for (i = 0; i < MODE_CT; i++) + if (banl->checkboxes[i] == item) + { + bit = 1<<i; + break; + } + + if (bit) /* Should be gassert() */ + { + banl->checked &= ~bit; + banl->checked |= (GTK_TOGGLE_BUTTON (item)->active)? bit: 0; + banlist_do_refresh (banl); + } +} + +/* NOTICE: The official strptime() is not available on all platforms so + * I've implemented a special version here. The official version is + * vastly more general than this: it uses locales for weekday and month + * names and its second arg is a format character-string. This special + * version depends on the format returned by ctime(3) whose manpage + * says it returns: + * "a null-terminated string of the form "Wed Jun 30 21:49:08 1993\n" + * + * If the real strpftime() comes available, use this format string: + * #define DATE_FORMAT "%a %b %d %T %Y" + */ +static void +banlist_strptime (char *ti, struct tm *tm) +{ + /* Expect something like "Sat Mar 16 21:24:27 2013" */ + static char *mon[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", NULL }; + int M = -1, d = -1, h = -1, m = -1, s = -1, y = -1; + + if (*ti == 0) + { + memset (tm, 0, sizeof *tm); + return; + } + /* No need to supply tm->tm_wday; mktime() doesn't read it */ + ti += 4; + while ((mon[++M])) + if (strncmp (ti, mon[M], 3) == 0) + break; + ti += 4; + + d = strtol (ti, &ti, 10); + h = strtol (++ti, &ti, 10); + m = strtol (++ti, &ti, 10); + s = strtol (++ti, &ti, 10); + y = strtol (++ti, NULL, 10) - 1900; + + tm->tm_sec = s; + tm->tm_min = m; + tm->tm_hour = h; + tm->tm_mday = d; + tm->tm_mon = M; + tm->tm_year = y; +} + +gint +banlist_date_sort (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data) +{ + struct tm tm1, tm2; + time_t t1, t2; + char *time1, *time2; + + gtk_tree_model_get(model, a, DATE_COLUMN, &time1, -1); + gtk_tree_model_get(model, b, DATE_COLUMN, &time2, -1); + banlist_strptime (time1, &tm1); + banlist_strptime (time2, &tm2); + t1 = mktime (&tm1); + t2 = mktime (&tm2); + + if (t1 < t2) return 1; + if (t1 == t2) return 0; + return -1; +} + static GtkWidget * -banlist_treeview_new (GtkWidget *box) +banlist_treeview_new (GtkWidget *box, banlist_info *banl) { GtkListStore *store; GtkWidget *view; GtkTreeSelection *select; GtkTreeViewColumn *col; + GtkTreeSortable *sortable; store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, - G_TYPE_STRING); + G_TYPE_STRING, G_TYPE_STRING); g_return_val_if_fail (store != NULL, NULL); + + sortable = GTK_TREE_SORTABLE (store); + gtk_tree_sortable_set_sort_func (sortable, DATE_COLUMN, banlist_date_sort, GINT_TO_POINTER (DATE_COLUMN), NULL); + view = gtkutil_treeview_new (box, GTK_TREE_MODEL (store), NULL, - MASK_COLUMN, _("Mask"), - FROM_COLUMN, _("From"), - DATE_COLUMN, _("Date"), -1); + TYPE_COLUMN, _("Type"), + MASK_COLUMN, _("Mask"), + FROM_COLUMN, _("From"), + DATE_COLUMN, _("Date"), -1); col = gtk_tree_view_get_column (GTK_TREE_VIEW (view), MASK_COLUMN); gtk_tree_view_column_set_alignment (col, 0.5); - gtk_tree_view_column_set_min_width (col, 300); + gtk_tree_view_column_set_min_width (col, 100); gtk_tree_view_column_set_sort_column_id (col, MASK_COLUMN); + gtk_tree_view_column_set_sizing (col, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_column_set_resizable (col, TRUE); + + col = gtk_tree_view_get_column (GTK_TREE_VIEW (view), TYPE_COLUMN); + gtk_tree_view_column_set_alignment (col, 0.5); + gtk_tree_view_column_set_sort_column_id (col, TYPE_COLUMN); col = gtk_tree_view_get_column (GTK_TREE_VIEW (view), FROM_COLUMN); gtk_tree_view_column_set_alignment (col, 0.5); gtk_tree_view_column_set_sort_column_id (col, FROM_COLUMN); + gtk_tree_view_column_set_sizing (col, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_column_set_resizable (col, TRUE); col = gtk_tree_view_get_column (GTK_TREE_VIEW (view), DATE_COLUMN); gtk_tree_view_column_set_alignment (col, 0.5); + gtk_tree_view_column_set_sort_column_id (col, DATE_COLUMN); + gtk_tree_view_column_set_sizing (col, GTK_TREE_VIEW_COLUMN_AUTOSIZE); + gtk_tree_view_column_set_resizable (col, TRUE); select = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); + g_signal_connect (G_OBJECT (select), "changed", G_CALLBACK (banlist_select_changed), banl); gtk_tree_selection_set_mode (select, GTK_SELECTION_MULTIPLE); gtk_widget_show (view); @@ -363,56 +677,99 @@ banlist_treeview_new (GtkWidget *box) } static void -banlist_closegui (GtkWidget *wid, session *sess) +banlist_closegui (GtkWidget *wid, banlist_info *banl) { - if (is_session (sess)) - sess->res->banlist_window = 0; + session *sess = banl->sess; + + if (sess->res->banlist == banl) + { + g_free (banl); + sess->res->banlist = NULL; + } } void banlist_opengui (struct session *sess) { - GtkWidget *vbox1; - GtkWidget *bbox; + banlist_info *banl; + int i; + GtkWidget *table, *vbox, *bbox; char tbuf[256]; - if (sess->res->banlist_window) + if (sess->type != SESS_CHANNEL) { - mg_bring_tofront (sess->res->banlist_window); + fe_message (_("You can only open the Ban List window while in a channel tab."), FE_MSG_ERROR); return; } - if (sess->type != SESS_CHANNEL) + if (!sess->res->banlist) { - fe_message (_("You can only open the Ban List window while in a channel tab."), FE_MSG_ERROR); + sess->res->banlist = g_malloc0 (sizeof (banlist_info)); + if (!sess->res->banlist) + { + fe_message (_("Banlist initialization failed."), FE_MSG_ERROR); + return; + } + } + banl = sess->res->banlist; + if (banl->window) + { + mg_bring_tofront (banl->window); return; } - snprintf (tbuf, sizeof tbuf, _(DISPLAY_NAME": Ban List (%s)"), + /* New banlist for this session -- Initialize it */ + banl->sess = sess; + /* For each mode set its bit in capable/readable/writeable */ + for (i = 0; i < MODE_CT; i++) + modes[i].tester (banl, i); + /* Force on the checkmark in the "Bans" box */ + banl->checked = 1<<MODE_BAN; + + g_snprintf (tbuf, sizeof tbuf, _(DISPLAY_NAME": Ban List (%s)"), sess->server->servername); - sess->res->banlist_window = mg_create_generic_tab ("BanList", tbuf, FALSE, - TRUE, banlist_closegui, sess, 550, 200, &vbox1, sess->server); + banl->window = mg_create_generic_tab ("BanList", tbuf, FALSE, + TRUE, banlist_closegui, banl, 550, 200, &vbox, sess->server); + gtkutil_destroy_on_esc (banl->window); + + gtk_container_set_border_width (GTK_CONTAINER (banl->window), 3); + gtk_box_set_spacing (GTK_BOX (vbox), 3); /* create banlist view */ - sess->res->banlist_treeview = banlist_treeview_new (vbox1); + banl->treeview = banlist_treeview_new (vbox, banl); + + table = gtk_table_new (1, MODE_CT, FALSE); + gtk_table_set_col_spacings (GTK_TABLE (table), 16); + gtk_box_pack_start (GTK_BOX (vbox), table, 0, 0, 0); + + for (i = 0; i < MODE_CT; i++) + { + if (!(banl->capable & 1<<i)) + continue; + banl->checkboxes[i] = gtk_check_button_new_with_label (_(modes[i].name)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (banl->checkboxes[i]), (banl->checked & 1<<i? TRUE: FALSE)); + g_signal_connect (G_OBJECT (banl->checkboxes[i]), "toggled", + G_CALLBACK (banlist_toggle), banl); + gtk_table_attach (GTK_TABLE (table), banl->checkboxes[i], i+1, i+2, 0, 1, GTK_FILL, GTK_FILL, 0, 0); + } bbox = gtk_hbutton_box_new (); gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD); gtk_container_set_border_width (GTK_CONTAINER (bbox), 5); - gtk_box_pack_end (GTK_BOX (vbox1), bbox, 0, 0, 0); + gtk_box_pack_end (GTK_BOX (vbox), bbox, 0, 0, 0); gtk_widget_show (bbox); - gtkutil_button (bbox, GTK_STOCK_REMOVE, 0, banlist_unban, sess, + banl->but_remove = gtkutil_button (bbox, GTK_STOCK_REMOVE, 0, banlist_unban, banl, _("Remove")); - gtkutil_button (bbox, GTK_STOCK_REMOVE, 0, banlist_crop, sess, + banl->but_crop = gtkutil_button (bbox, GTK_STOCK_REMOVE, 0, banlist_crop, banl, _("Crop")); - gtkutil_button (bbox, GTK_STOCK_CLEAR, 0, banlist_clear, sess, + banl->but_clear = gtkutil_button (bbox, GTK_STOCK_CLEAR, 0, banlist_clear, banl, _("Clear")); - sess->res->banlist_butRefresh = gtkutil_button (bbox, GTK_STOCK_REFRESH, 0, banlist_refresh, sess, _("Refresh")); + banl->but_refresh = gtkutil_button (bbox, GTK_STOCK_REFRESH, 0, banlist_refresh, banl, _("Refresh")); - banlist_do_refresh (sess); + banlist_do_refresh (banl); - gtk_widget_show (sess->res->banlist_window); + gtk_widget_show_all (banl->window); } diff --git a/src/fe-gtk/banlist.h b/src/fe-gtk/banlist.h index 7ceccd00..899ee5e5 100644 --- a/src/fe-gtk/banlist.h +++ b/src/fe-gtk/banlist.h @@ -1 +1,76 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_BANLIST_H +#define HEXCHAT_BANLIST_H + +#include "../common/hexchat.h" void banlist_opengui (session *sess); + +#ifndef RPL_BANLIST +/* Where's that darn header file, that would have all these defines ? */ +#define RPL_BANLIST 367 +#define RPL_ENDOFBANLIST 368 +#define RPL_INVITELIST 346 +#define RPL_ENDOFINVITELIST 347 +#define RPL_EXCEPTLIST 348 +#define RPL_ENDOFEXCEPTLIST 349 +#define RPL_QUIETLIST 728 +#define RPL_ENDOFQUIETLIST 729 +#endif + +typedef enum banlist_modes_e { + MODE_BAN, + MODE_EXEMPT, + MODE_INVITE, + MODE_QUIET, + MODE_CT +} banlist_modes; + +typedef struct banlist_info_s { + session *sess; + int capable; /* MODE bitmask */ + int readable; /* subset of capable if not op */ + int writeable; /* subset of capable if op */ + int checked; /* subset of (op? writeable: readable) */ + int pending; /* subset of checked */ + int current; /* index of currently processing mode */ + int line_ct; /* count of presented lines */ + int select_ct; /* count of selected lines */ + /* Not really; 1 if any are selected otherwise 0 */ + GtkWidget *window; + GtkWidget *treeview; + GtkWidget *checkboxes[MODE_CT]; + GtkWidget *but_remove; + GtkWidget *but_crop; + GtkWidget *but_clear; + GtkWidget *but_refresh; +} banlist_info; + +typedef struct mode_info_s { + char *name; /* Checkbox name, e.g. "Bans" */ + char *type; /* Type for type column, e.g. "Ban" */ + char letter; /* /mode-command letter, e.g. 'b' for MODE_BAN */ + int code; /* rfc RPL_foo code, e.g. 367 for RPL_BANLIST */ + int endcode; /* rfc RPL_ENDOFfoo code, e.g. 368 for RPL_ENDOFBANLIST */ + int bit; /* Mask bit, e.g., 1<<MODE_BAN */ + void (*tester)(banlist_info *, int); /* Function returns true to set bit into checkable */ +} mode_info; + +#endif /* HEXCHAT_BANLIST_H */ diff --git a/src/fe-gtk/chanlist.c b/src/fe-gtk/chanlist.c index c2cc6fcb..47b9f1db 100644 --- a/src/fe-gtk/chanlist.c +++ b/src/fe-gtk/chanlist.c @@ -30,21 +30,6 @@ #include "fe-gtk.h" -#include <gtk/gtkalignment.h> -#include <gtk/gtkcellrenderertext.h> -#include <gtk/gtkcheckbutton.h> -#include <gtk/gtkcombobox.h> -#include <gtk/gtkentry.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkliststore.h> -#include <gtk/gtkscrolledwindow.h> -#include <gtk/gtkspinbutton.h> -#include <gtk/gtkstock.h> -#include <gtk/gtktable.h> -#include <gtk/gtktreeselection.h> -#include <gtk/gtkvbox.h> -#include <gtk/gtkvseparator.h> #include <gdk/gdkkeysyms.h> #include "../common/hexchat.h" @@ -58,10 +43,8 @@ #include "maingui.h" #include "menu.h" - #include "custom-list.h" - enum { COL_CHANNEL, diff --git a/src/fe-gtk/chanlist.h b/src/fe-gtk/chanlist.h index 19a8b25e..481beec3 100644 --- a/src/fe-gtk/chanlist.h +++ b/src/fe-gtk/chanlist.h @@ -1 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_CHANLIST_H +#define HEXCHAT_CHANLIST_H + void chanlist_opengui (server *serv, int do_refresh); + +#endif diff --git a/src/fe-gtk/chanview-tabs.c b/src/fe-gtk/chanview-tabs.c index 10203476..9db6b21a 100644 --- a/src/fe-gtk/chanview-tabs.c +++ b/src/fe-gtk/chanview-tabs.c @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + /* file included in chanview.c */ typedef struct diff --git a/src/fe-gtk/chanview-tree.c b/src/fe-gtk/chanview-tree.c index 4a4f1db2..a7cd7235 100644 --- a/src/fe-gtk/chanview-tree.c +++ b/src/fe-gtk/chanview-tree.c @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + /* file included in chanview.c */ typedef struct @@ -12,7 +31,6 @@ typedef struct #include "maingui.h" #include <gdk/gdk.h> -#include <gtk/gtktreeview.h> static void /* row-activated, when a row is double clicked */ cv_tree_activated_cb (GtkTreeView *view, GtkTreePath *path, @@ -75,6 +93,8 @@ cv_tree_init (chanview *cv) { GtkWidget *view, *win; GtkCellRenderer *renderer; + GtkTreeViewColumn *col; + int wid1, wid2; static const GtkTargetEntry dnd_src_target[] = { {"HEXCHAT_CHANVIEW", GTK_TARGET_SAME_APP, 75 } @@ -105,8 +125,17 @@ cv_tree_init (chanview *cv) { gtk_tree_view_set_enable_tree_lines (GTK_TREE_VIEW (view), TRUE); } + + /* Indented channels with no server looks silly, but we still want expanders */ + if (!prefs.hex_gui_tab_server) + { + gtk_widget_style_get (view, "expander-size", &wid1, "horizontal-separator", &wid2, NULL); + gtk_tree_view_set_level_indentation (GTK_TREE_VIEW (view), -wid1 - wid2); + } + gtk_container_add (GTK_CONTAINER (win), view); + col = gtk_tree_view_column_new(); /* icon column */ if (cv->use_icons) @@ -114,9 +143,9 @@ cv_tree_init (chanview *cv) renderer = gtk_cell_renderer_pixbuf_new (); if (prefs.hex_gui_compact) g_object_set (G_OBJECT (renderer), "ypad", 0, NULL); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), - -1, NULL, renderer, - "pixbuf", COL_PIXBUF, NULL); + + gtk_tree_view_column_pack_start(col, renderer, FALSE); + gtk_tree_view_column_set_attributes (col, renderer, "pixbuf", COL_PIXBUF, NULL); } /* main column */ @@ -124,9 +153,9 @@ cv_tree_init (chanview *cv) if (prefs.hex_gui_compact) g_object_set (G_OBJECT (renderer), "ypad", 0, NULL); gtk_cell_renderer_text_set_fixed_height_from_font (GTK_CELL_RENDERER_TEXT (renderer), 1); - gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), - -1, NULL, renderer, - "text", COL_NAME, "attributes", COL_ATTR, NULL); + gtk_tree_view_column_pack_start(col, renderer, TRUE); + gtk_tree_view_column_set_attributes (col, renderer, "text", COL_NAME, "attributes", COL_ATTR, NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW(view), col); g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (view))), "changed", G_CALLBACK (cv_tree_sel_cb), cv); diff --git a/src/fe-gtk/chanview.c b/src/fe-gtk/chanview.c index f7e01695..500ed1e5 100644 --- a/src/fe-gtk/chanview.c +++ b/src/fe-gtk/chanview.c @@ -1,16 +1,31 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + /* abstract channel view: tabs or tree or anything you like */ #include <stdlib.h> #include <string.h> -#include <gtk/gtk.h> - -#include "chanview.h" #include "gtkutil.h" - +#include "chanview.h" /* treeStore columns */ - #define COL_NAME 0 /* (char *) */ #define COL_CHAN 1 /* (chan *) */ #define COL_ATTR 2 /* (PangoAttrList *) */ diff --git a/src/fe-gtk/chanview.h b/src/fe-gtk/chanview.h index 75b5ef1f..a1495b1d 100644 --- a/src/fe-gtk/chanview.h +++ b/src/fe-gtk/chanview.h @@ -1,3 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_CHANVIEW_H +#define HEXCHAT_CHANVIEW_H + typedef struct _chanview chanview; typedef struct _chan chan; @@ -29,3 +51,5 @@ chan * chan_get_parent (chan *ch); #define FOCUS_NEW_ALL 1 #define FOCUS_NEW_ONLY_ASKED 2 #define FOCUS_NEW_NONE 0 + +#endif diff --git a/src/fe-gtk/custom-list.c b/src/fe-gtk/custom-list.c index 0c3c40b5..ed292294 100644 --- a/src/fe-gtk/custom-list.c +++ b/src/fe-gtk/custom-list.c @@ -1,3 +1,22 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 <string.h> #include <stdlib.h> #include "custom-list.h" diff --git a/src/fe-gtk/custom-list.h b/src/fe-gtk/custom-list.h index d9e4f09e..64f0535f 100644 --- a/src/fe-gtk/custom-list.h +++ b/src/fe-gtk/custom-list.h @@ -1,8 +1,29 @@ -#ifndef _custom_list_h_included_ -#define _custom_list_h_included_ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_CUSTOM_LIST_H +#define HEXCHAT_CUSTOM_LIST_H #include <gtk/gtk.h> +GType custom_list_get_type (void); + /* Some boilerplate GObject defines. 'klass' is used * instead of 'class', because 'class' is a C++ keyword */ @@ -82,4 +103,4 @@ void custom_list_append (CustomList *, chanlistrow *); void custom_list_resort (CustomList *); void custom_list_clear (CustomList *); -#endif /* _custom_list_h_included_ */ +#endif /* HEXCHAT_CUSTOM_LIST_H */ diff --git a/src/fe-gtk/dccgui.c b/src/fe-gtk/dccgui.c index 6cfcd8b7..0fb2e7e5 100644 --- a/src/fe-gtk/dccgui.c +++ b/src/fe-gtk/dccgui.c @@ -28,22 +28,6 @@ #include "../common/inet.h" #include "fe-gtk.h" -#include <gtk/gtkhbbox.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkstock.h> -#include <gtk/gtkmessagedialog.h> -#include <gtk/gtktable.h> -#include <gtk/gtktreeview.h> -#include <gtk/gtkexpander.h> -#include <gtk/gtkliststore.h> -#include <gtk/gtktreeselection.h> -#include <gtk/gtkcellrendererpixbuf.h> -#include <gtk/gtkcellrenderertext.h> -#include <gtk/gtkcheckmenuitem.h> -#include <gtk/gtkradiobutton.h> -#include <gtk/gtkversion.h> - #include "../common/hexchat.h" #include "../common/hexchatc.h" #include "../common/fe.h" @@ -745,6 +729,7 @@ fe_dcc_open_recv_win (int passive) dccfwin.window = mg_create_generic_tab ("Transfers", _(DISPLAY_NAME": Uploads and Downloads"), FALSE, TRUE, close_dcc_file_window, NULL, win_width, win_height, &vbox, 0); + gtkutil_destroy_on_esc (dccfwin.window); gtk_container_set_border_width (GTK_CONTAINER (dccfwin.window), 3); gtk_box_set_spacing (GTK_BOX (vbox), 3); @@ -989,6 +974,7 @@ fe_dcc_open_chat_win (int passive) dcccwin.window = mg_create_generic_tab ("DCCChat", _(DISPLAY_NAME": DCC Chat List"), FALSE, TRUE, dcc_chat_close_cb, NULL, 550, 180, &vbox, 0); + gtkutil_destroy_on_esc (dcccwin.window); gtk_container_set_border_width (GTK_CONTAINER (dcccwin.window), 3); gtk_box_set_spacing (GTK_BOX (vbox), 3); diff --git a/src/fe-gtk/editlist.c b/src/fe-gtk/editlist.c index c1be5b23..4c4c4367 100644 --- a/src/fe-gtk/editlist.c +++ b/src/fe-gtk/editlist.c @@ -31,12 +31,6 @@ #include "fe-gtk.h" -#include <gtk/gtkstock.h> -#include <gtk/gtkentry.h> -#include <gtk/gtkclist.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkvseparator.h> - #include "../common/hexchat.h" #include "../common/cfgfiles.h" #include "../common/hexchatc.h" diff --git a/src/fe-gtk/editlist.h b/src/fe-gtk/editlist.h index f17cc2e0..5487684b 100644 --- a/src/fe-gtk/editlist.h +++ b/src/fe-gtk/editlist.h @@ -1 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_EDITLIST_H +#define HEXCHAT_EDITLIST_H + void editlist_gui_open (char *title1, char *title2, GSList * list, char *title, char *wmclass, char *file, char *help); + +#endif diff --git a/src/fe-gtk/fe-gtk-xp.vcxproj b/src/fe-gtk/fe-gtk-xp.vcxproj deleted file mode 100644 index 94ebd4a0..00000000 --- a/src/fe-gtk/fe-gtk-xp.vcxproj +++ /dev/null @@ -1,179 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <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>{E4BDB4C8-2335-415A-ACEE-BA88B19BFE82}</ProjectGuid> - <Keyword>Win32Proj</Keyword> - <RootNamespace>fegtk</RootNamespace> - <ProjectName>fe-gtk</ProjectName> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>WDK7</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>WDK7</PlatformToolset> - </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-xp.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-xp.props" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <LinkIncremental>false</LinkIncremental> - <TargetName>hexchat</TargetName> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <LinkIncremental>false</LinkIncremental> - <TargetName>hexchat</TargetName> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - <DisableSpecificWarnings>4244</DisableSpecificWarnings> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - <AdditionalLibraryDirectories>$(DepsRoot)\lib;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> - <AdditionalDependencies>$(DepLibs);common.lib;%(AdditionalDependencies)</AdditionalDependencies> - <EntryPointSymbol>mainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);$(Gtk);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - <DisableSpecificWarnings>4244;4267</DisableSpecificWarnings> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - <AdditionalLibraryDirectories>$(DepsRoot)\lib;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> - <AdditionalDependencies>$(DepLibs);common.lib;%(AdditionalDependencies)</AdditionalDependencies> - <EntryPointSymbol>mainCRTStartup</EntryPointSymbol> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClInclude Include="about.h" /> - <ClInclude Include="ascii.h" /> - <ClInclude Include="banlist.h" /> - <ClInclude Include="chanlist.h" /> - <ClInclude Include="chanview.h" /> - <ClInclude Include="custom-list.h" /> - <ClInclude Include="editlist.h" /> - <ClInclude Include="fe-gtk.h" /> - <ClInclude Include="fkeys.h" /> - <ClInclude Include="gtkutil.h" /> - <ClInclude Include="joind.h" /> - <ClInclude Include="maingui.h" /> - <ClInclude Include="menu.h" /> - <ClInclude Include="mmx_cmod.h" /> - <ClInclude Include="notifygui.h" /> - <ClInclude Include="palette.h" /> - <ClInclude Include="pixmaps.h" /> - <ClInclude Include="plugin-tray.h" /> - <ClInclude Include="plugingui.h" /> - <ClInclude Include="rawlog.h" /> - <ClInclude Include="search.h" /> - <ClInclude Include="servlistgui.h" /> - <ClInclude Include="setup.h" /> - <ClInclude Include="sexy-iso-codes.h" /> - <ClInclude Include="sexy-marshal.h" /> - <ClInclude Include="sexy-spell-entry.h" /> - <ClInclude Include="textgui.h" /> - <ClInclude Include="urlgrab.h" /> - <ClInclude Include="userlistgui.h" /> - <ClInclude Include="xtext.h" /> - </ItemGroup> - <ItemGroup> - <ClCompile Include="about.c" /> - <ClCompile Include="ascii.c" /> - <ClCompile Include="banlist.c" /> - <ClCompile Include="chanlist.c" /> - <ClCompile Include="chanview.c" /> - <ClCompile Include="custom-list.c" /> - <ClCompile Include="dccgui.c" /> - <ClCompile Include="editlist.c" /> - <ClCompile Include="fe-gtk.c" /> - <ClCompile Include="fkeys.c" /> - <ClCompile Include="gtkutil.c" /> - <ClCompile Include="ignoregui.c" /> - <ClCompile Include="joind.c" /> - <ClCompile Include="maingui.c" /> - <ClCompile Include="menu.c" /> - <ClCompile Include="notifygui.c" /> - <ClCompile Include="palette.c" /> - <ClCompile Include="pixmaps.c" /> - <ClCompile Include="plugin-tray.c" /> - <ClCompile Include="plugingui.c" /> - <ClCompile Include="rawlog.c" /> - <ClCompile Include="search.c" /> - <ClCompile Include="servlistgui.c" /> - <ClCompile Include="setup.c" /> - <ClCompile Include="sexy-iso-codes.c" /> - <ClCompile Include="sexy-marshal.c" /> - <ClCompile Include="sexy-spell-entry.c" /> - <ClCompile Include="textgui.c" /> - <ClCompile Include="urlgrab.c" /> - <ClCompile Include="userlistgui.c" /> - <ClCompile Include="xtext.c" /> - </ItemGroup> - <ItemGroup> - <Manifest Include="hexchat.exe.manifest" /> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="hexchat.rc" /> - </ItemGroup> - <ItemGroup> - <None Include="..\..\share\icons\hexchat.ico" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> \ No newline at end of file diff --git a/src/fe-gtk/fe-gtk-xp.vcxproj.filters b/src/fe-gtk/fe-gtk-xp.vcxproj.filters deleted file mode 100644 index a319babd..00000000 --- a/src/fe-gtk/fe-gtk-xp.vcxproj.filters +++ /dev/null @@ -1,219 +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="Header Files"> - <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</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> - <ClInclude Include="about.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="ascii.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="banlist.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="chanlist.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="chanview.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="custom-list.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="editlist.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="fe-gtk.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="fkeys.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="gtkutil.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="joind.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="maingui.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="menu.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="mmx_cmod.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="notifygui.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="palette.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="pixmaps.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="plugingui.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="plugin-tray.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="rawlog.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="search.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="sexy-iso-codes.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="sexy-marshal.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="sexy-spell-entry.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="textgui.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="urlgrab.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="userlistgui.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="xtext.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="servlistgui.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="setup.h"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <ClCompile Include="about.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ascii.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="banlist.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="chanlist.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="chanview.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="custom-list.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="dccgui.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="editlist.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="fe-gtk.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="fkeys.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="gtkutil.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="ignoregui.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="joind.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="maingui.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="menu.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="notifygui.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="palette.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="pixmaps.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="plugingui.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="plugin-tray.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="rawlog.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="search.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="servlistgui.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="setup.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="sexy-iso-codes.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="sexy-marshal.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="sexy-spell-entry.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="textgui.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="urlgrab.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="userlistgui.c"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="xtext.c"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <Manifest Include="hexchat.exe.manifest"> - <Filter>Resource Files</Filter> - </Manifest> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="hexchat.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - </ItemGroup> - <ItemGroup> - <None Include="..\..\share\icons\hexchat.ico"> - <Filter>Resource Files</Filter> - </None> - </ItemGroup> -</Project> \ No newline at end of file diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c index a29a6fda..896ab143 100644 --- a/src/fe-gtk/fe-gtk.c +++ b/src/fe-gtk/fe-gtk.c @@ -22,17 +22,9 @@ #include "fe-gtk.h" -#include <gtk/gtkmain.h> -#include <gtk/gtkentry.h> -#include <gtk/gtkprogressbar.h> -#include <gtk/gtkbox.h> -#include <gtk/gtklabel.h> -#include <gtk/gtktogglebutton.h> -#include <gtk/gtkmessagedialog.h> -#include <gtk/gtkversion.h> - #ifdef WIN32 #include <gdk/gdkwin32.h> +#include <windows.h> #else #include <unistd.h> #endif @@ -62,15 +54,6 @@ #ifdef USE_XLIB #include <gdk/gdkx.h> -#include <gtk/gtkinvisible.h> -#endif - -#ifdef USE_GTKSPELL -#include <gtk/gtktextview.h> -#endif - -#ifdef WIN32 -#include <windows.h> #endif GdkPixmap *channelwin_pix; @@ -134,7 +117,7 @@ static const GOptionEntry gopt_entries[] = {"no-plugins", 'n', 0, G_OPTION_ARG_NONE, &arg_skip_plugins, N_("Don't auto load any plugins"), NULL}, {"plugindir", 'p', 0, G_OPTION_ARG_NONE, &arg_show_autoload, N_("Show plugin/script auto-load directory"), NULL}, {"configdir", 'u', 0, G_OPTION_ARG_NONE, &arg_show_config, N_("Show user config directory"), NULL}, - {"url", 0, 0, G_OPTION_ARG_STRING, &arg_url, N_("Open an irc://server:port/channel URL"), "URL"}, + {"url", 0, 0, G_OPTION_ARG_STRING, &arg_url, N_("Open an irc://server:port/channel?key URL"), "URL"}, #ifndef WIN32 /* uses DBUS */ {"command", 'c', 0, G_OPTION_ARG_STRING, &arg_command, N_("Execute command:"), "COMMAND"}, {"existing", 'e', 0, G_OPTION_ARG_NONE, &arg_existing, N_("Open URL or execute command in an existing HexChat"), NULL}, @@ -149,7 +132,7 @@ create_msg_dialog (gchar *title, gchar *message) { GtkWidget *dialog; - dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, message); + dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "%s", message); gtk_window_set_title (GTK_WINDOW (dialog), title); /* On Win32 we automatically have the icon. If we try to load it explicitly, it will look ugly for some reason. */ @@ -604,14 +587,6 @@ fe_is_chanwindow (struct server *serv) return 1; } -int -fe_is_banwindow (struct session *sess) -{ - if (!sess->res->banlist_window) - return 0; - return 1; -} - void fe_notify_update (char *name) { diff --git a/src/fe-gtk/fe-gtk.h b/src/fe-gtk/fe-gtk.h index 313afc4b..7b4132da 100644 --- a/src/fe-gtk/fe-gtk.h +++ b/src/fe-gtk/fe-gtk.h @@ -1,3 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_FE_GTK_H +#define HEXCHAT_FE_GTK_H + #ifdef WIN32 #include "../../config-win32.h" #else @@ -26,9 +48,8 @@ # define _(x) (x) #endif -#include <gtk/gtkwidget.h> -#include <gtk/gtkcontainer.h> -#include <gtk/gtksignal.h> +#include <gtk/gtk.h> +#include "banlist.h" #undef gtk_signal_connect #define gtk_signal_connect g_signal_connect @@ -97,10 +118,7 @@ struct server_gui typedef struct restore_gui { - /* banlist stuff */ - GtkWidget *banlist_window; - GtkWidget *banlist_treeview; - GtkWidget *banlist_butRefresh; + banlist_info *banlist; void *tab; /* (chan *) */ @@ -192,3 +210,5 @@ void SPELL_ENTRY_INSERT (GtkWidget *entry, const char *text, int len, int *pos); #define SPELL_ENTRY_SET_POS(e,p) gtk_editable_set_position(GTK_EDITABLE(e),p); #define SPELL_ENTRY_INSERT(e,t,l,p) gtk_editable_insert_text(GTK_EDITABLE(e),t,l,p) #endif + +#endif diff --git a/src/fe-gtk/fkeys.c b/src/fe-gtk/fkeys.c index 3a937e1a..f35ae466 100644 --- a/src/fe-gtk/fkeys.c +++ b/src/fe-gtk/fkeys.c @@ -32,20 +32,6 @@ #include "fe-gtk.h" -#include <glib.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkeditable.h> -#include <gtk/gtkmenu.h> -#include <gtk/gtkmenuitem.h> -#include <gtk/gtkoptionmenu.h> -#include <gtk/gtkvbox.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkclist.h> -#include <gtk/gtknotebook.h> -#include <gtk/gtkcheckbutton.h> -#include <gtk/gtkentry.h> -#include <gtk/gtkvscrollbar.h> - #include "../common/hexchat.h" #include "../common/hexchatc.h" #include "../common/cfgfiles.h" @@ -65,10 +51,6 @@ #include "textgui.h" #include "fkeys.h" -#ifdef USE_GTKSPELL -#include <gtk/gtktextview.h> -#endif - static void replace_handle (GtkWidget * wid); void key_action_tab_clean (void); diff --git a/src/fe-gtk/fkeys.h b/src/fe-gtk/fkeys.h index 93f2cea7..621c872c 100644 --- a/src/fe-gtk/fkeys.h +++ b/src/fe-gtk/fkeys.h @@ -1,3 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_FKEYS_H +#define HEXCHAT_FKEYS_H + /* These are cp'ed from history.c --AGL */ #define STATE_SHIFT GDK_SHIFT_MASK #define STATE_ALT GDK_MOD1_MASK @@ -12,3 +34,5 @@ void key_dialog_show (void); int key_handle_key_press (GtkWidget * wid, GdkEventKey * evt, session *sess); int key_action_insert (GtkWidget * wid, GdkEventKey * evt, char *d1, char *d2, session *sess); + +#endif diff --git a/src/fe-gtk/gtkutil.c b/src/fe-gtk/gtkutil.c index d032cf48..41948e44 100644 --- a/src/fe-gtk/gtkutil.c +++ b/src/fe-gtk/gtkutil.c @@ -26,25 +26,7 @@ #include "fe-gtk.h" -#include <gtk/gtkbutton.h> -#include <gtk/gtkclist.h> -#include <gtk/gtkscrolledwindow.h> -#include <gtk/gtkmessagedialog.h> -#include <gtk/gtkwindow.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkimage.h> -#include <gtk/gtktooltips.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkentry.h> -#include <gtk/gtkstock.h> -#include <gtk/gtkspinbutton.h> -#include <gtk/gtkclipboard.h> -#include <gtk/gtktreeview.h> -#include <gtk/gtktreeselection.h> -#include <gtk/gtkcellrenderertext.h> -#include <gtk/gtkcellrenderertoggle.h> -#include <gtk/gtkversion.h> -#include <gtk/gtkfilechooserdialog.h> +#include <gdk/gdkkeysyms.h> #include "../common/hexchat.h" #include "../common/fe.h" @@ -338,6 +320,20 @@ gtkutil_file_req (const char *title, void *callback, void *userdata, char *filte gtk_widget_show (dialog); } +static gboolean +gtkutil_esc_destroy (GtkWidget * win, GdkEventKey * key, gpointer userdata) +{ + if (key->keyval == GDK_Escape) + gtk_widget_destroy (win); + return FALSE; +} + +void +gtkutil_destroy_on_esc (GtkWidget *win) +{ + g_signal_connect (G_OBJECT (win), "key_press_event", G_CALLBACK (gtkutil_esc_destroy), win); +} + void gtkutil_destroy (GtkWidget * igad, GtkWidget * dgad) { diff --git a/src/fe-gtk/gtkutil.h b/src/fe-gtk/gtkutil.h index 65b5c079..e3f59a29 100644 --- a/src/fe-gtk/gtkutil.h +++ b/src/fe-gtk/gtkutil.h @@ -1,5 +1,26 @@ -#include <gtk/gtktreeview.h> -#include <gtk/gtktreemodel.h> +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_GTKUTIL_H +#define HEXCHAT_GTKUTIL_H + +#include <gtk/gtk.h> typedef void (*filereqcallback) (void *, char *file); @@ -12,6 +33,7 @@ typedef void (*filereqcallback) (void *, char *file); void gtkutil_file_req (const char *title, void *callback, void *userdata, char *filter, char *extensions, int flags); void gtkutil_destroy (GtkWidget * igad, GtkWidget * dgad); +void gtkutil_destroy_on_esc (GtkWidget *win); GtkWidget *gtkutil_button (GtkWidget *box, char *stock, char *tip, void *callback, void *userdata, char *labeltext); void gtkutil_label_new (char *text, GtkWidget * box); @@ -37,3 +59,4 @@ gboolean gtkutil_treemodel_string_to_iter (GtkTreeModel *model, gchar *pathstr, gboolean gtkutil_treeview_get_selected_iter (GtkTreeView *view, GtkTreeIter *iter_ret); gboolean gtkutil_treeview_get_selected (GtkTreeView *view, GtkTreeIter *iter_ret, ...); +#endif diff --git a/src/fe-gtk/ignoregui.c b/src/fe-gtk/ignoregui.c index dca4384b..ae2dbd94 100644 --- a/src/fe-gtk/ignoregui.c +++ b/src/fe-gtk/ignoregui.c @@ -24,21 +24,6 @@ #include <fcntl.h> #include "fe-gtk.h" -#include <gtk/gtkcheckbutton.h> -#include <gtk/gtkentry.h> -#include <gtk/gtkstock.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkhbbox.h> -#include <gtk/gtkframe.h> -#include <gtk/gtkhseparator.h> -#include <gtk/gtkversion.h> - -#include <gtk/gtkliststore.h> -#include <gtk/gtktreeview.h> -#include <gtk/gtktreeselection.h> -#include <gtk/gtkcellrenderertext.h> -#include <gtk/gtkcellrenderertoggle.h> - #include "../common/hexchat.h" #include "../common/ignore.h" #include "../common/cfgfiles.h" @@ -273,13 +258,15 @@ ignore_store_new (int cancel, char *mask, gpointer data) } static void -ignore_clear_entry_clicked (GtkWidget * wid, gpointer unused) +ignore_clear_cb (GtkDialog *dialog, gint response) { GtkListStore *store = GTK_LIST_STORE (get_store ()); GtkTreeIter iter; char *mask; - if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter)) + gtk_widget_destroy (GTK_WIDGET (dialog)); + + if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter) && response == GTK_RESPONSE_OK) { /* remove from ignore_list */ do @@ -297,6 +284,20 @@ ignore_clear_entry_clicked (GtkWidget * wid, gpointer unused) } static void +ignore_clear_entry_clicked (GtkWidget * wid) +{ + GtkWidget *dialog; + + dialog = gtk_message_dialog_new (NULL, 0, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, + _("Are you sure you want to remove all ignores?")); + g_signal_connect (G_OBJECT (dialog), "response", + G_CALLBACK (ignore_clear_cb), NULL); + gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE); + gtk_widget_show (dialog); +} + +static void ignore_new_entry_clicked (GtkWidget * wid, struct session *sess) { fe_get_str (_("Enter mask to ignore:"), "nick!userid@host.com", @@ -349,6 +350,7 @@ ignore_gui_open () mg_create_generic_tab ("IgnoreList", _(DISPLAY_NAME": Ignore list"), FALSE, TRUE, close_ignore_gui_callback, NULL, 600, 256, &vbox, 0); + gtkutil_destroy_on_esc (ignorewin); view = ignore_treeview_new (vbox); g_object_set_data (G_OBJECT (ignorewin), "view", view); diff --git a/src/fe-gtk/joind.c b/src/fe-gtk/joind.c index 41f3f405..b58d662a 100644 --- a/src/fe-gtk/joind.c +++ b/src/fe-gtk/joind.c @@ -1,7 +1,22 @@ -/* Copyright (c) 2005 Peter Zelezny - All Rights Reserved. - - joind.c - The Join Dialog. +/* X-Chat + * Copyright (C) 2005 Peter Zelezny. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/* joind.c - The Join Dialog. Popups up when you connect without any autojoin channels and helps you to find or join a channel. @@ -16,18 +31,6 @@ #include <unistd.h> #endif -#include <gtk/gtk.h> -#include <gtk/gtkbbox.h> -#include <gtk/gtkbutton.h> -#include <gtk/gtkdialog.h> -#include <gtk/gtkentry.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkimage.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkradiobutton.h> -#include <gtk/gtkvbox.h> -#include <gtk/gtkwindow.h> - #include "../common/hexchat.h" #include "../common/hexchatc.h" #include "../common/server.h" diff --git a/src/fe-gtk/joind.h b/src/fe-gtk/joind.h index aa0fd0ad..a7f466b9 100644 --- a/src/fe-gtk/joind.h +++ b/src/fe-gtk/joind.h @@ -1,2 +1,26 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_JOIND_H +#define HEXCHAT_JOIND_H + void joind_open (server *serv); void joind_close (server *serv); + +#endif diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index 41344c8f..816a93f7 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -21,29 +21,6 @@ #include <stdio.h> #include <ctype.h> -#include <gtk/gtkarrow.h> -#include <gtk/gtktogglebutton.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkvbox.h> -#include <gtk/gtkeventbox.h> -#include <gtk/gtkentry.h> -#include <gtk/gtkhpaned.h> -#include <gtk/gtkvpaned.h> -#include <gtk/gtkframe.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkmenuitem.h> -#include <gtk/gtkprogressbar.h> -#include <gtk/gtkscrolledwindow.h> -#include <gtk/gtkstock.h> -#include <gtk/gtktable.h> -#include <gtk/gtknotebook.h> -#include <gtk/gtkimage.h> -#include <gtk/gtkmessagedialog.h> -#include <gtk/gtkcheckmenuitem.h> -#include <gtk/gtkcheckbutton.h> -#include <gtk/gtkbbox.h> -#include <gtk/gtkvscrollbar.h> - #include "../common/hexchat.h" #include "../common/fe.h" #include "../common/server.h" @@ -71,7 +48,6 @@ #include "xtext.h" #ifdef USE_GTKSPELL -#include <gtk/gtktextview.h> #include <gtkspell/gtkspell.h> #endif @@ -501,7 +477,7 @@ mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata { if ((event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) && (event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) && - prefs.hex_gui_tray_minimize && !hextray_mode ()) + prefs.hex_gui_tray_minimize && !unity_mode ()) { tray_toggle_visibility (TRUE); gtk_window_deiconify (wid); @@ -1295,7 +1271,7 @@ mg_open_quit_dialog (gboolean minimize_button) gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END); - if (minimize_button && !hextray_mode ()) + if (minimize_button && !unity_mode ()) { button = gtk_button_new_with_mnemonic (_("_Minimize to Tray")); gtk_widget_show (button); @@ -1594,10 +1570,7 @@ mg_create_alertmenu (session *sess, GtkWidget *menu) mg_perchan_menu_item (_("Beep on _Message"), submenu, &sess->alert_beep, prefs.hex_input_beep_chans); - if (!hextray_mode ()) /*disable this context menu item when HexTray is loaded */ - { - mg_perchan_menu_item (_("Blink Tray _Icon"), submenu, &sess->alert_tray, prefs.hex_input_tray_chans); - } + mg_perchan_menu_item (_("Blink Tray _Icon"), submenu, &sess->alert_tray, prefs.hex_input_tray_chans); mg_perchan_menu_item (_("Blink Task _Bar"), submenu, &sess->alert_taskbar, prefs.hex_input_flash_chans); } @@ -3087,7 +3060,7 @@ mg_tabwindow_de_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) GSList *list; session *sess; - if (prefs.hex_gui_tray_close && !hextray_mode () && tray_toggle_visibility (FALSE)) + if (prefs.hex_gui_tray_close && !unity_mode () && tray_toggle_visibility (FALSE)) return TRUE; /* check for remaining toplevel windows */ @@ -3530,8 +3503,8 @@ fe_server_callback (server *serv) void fe_session_callback (session *sess) { - if (sess->res->banlist_window) - mg_close_gen (NULL, sess->res->banlist_window); + if (sess->res->banlist && sess->res->banlist->window) + mg_close_gen (NULL, sess->res->banlist->window); if (sess->res->input_text) free (sess->res->input_text); diff --git a/src/fe-gtk/maingui.h b/src/fe-gtk/maingui.h index bc9aaefd..a35f3684 100644 --- a/src/fe-gtk/maingui.h +++ b/src/fe-gtk/maingui.h @@ -1,3 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_MAINGUI_H +#define HEXCHAT_MAINGUI_H + extern GtkStyle *input_style; extern GtkWidget *parent_window; @@ -31,3 +53,5 @@ gboolean mg_drag_begin_cb (GtkWidget *widget, GdkDragContext *context, gpointer void mg_drag_end_cb (GtkWidget *widget, GdkDragContext *context, gpointer userdata); gboolean mg_drag_drop_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, guint time, gpointer user_data); gboolean mg_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, guint time, gpointer user_data); + +#endif diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c index f5f6b456..74b1783f 100644 --- a/src/fe-gtk/menu.c +++ b/src/fe-gtk/menu.c @@ -30,18 +30,6 @@ #include "fe-gtk.h" -#include <gtk/gtkhbox.h> -#include <gtk/gtkcheckmenuitem.h> -#include <gtk/gtkentry.h> -#include <gtk/gtkimage.h> -#include <gtk/gtkimagemenuitem.h> -#include <gtk/gtkradiomenuitem.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkmessagedialog.h> -#include <gtk/gtkmenu.h> -#include <gtk/gtkmenubar.h> -#include <gtk/gtkstock.h> -#include <gtk/gtkversion.h> #include <gdk/gdkkeysyms.h> #include "../common/hexchat.h" @@ -1609,7 +1597,7 @@ static struct mymenu mymenu[] = { {N_("_New"), 0, GTK_STOCK_NEW, M_MENUSUB, 0, 0, 1}, {N_("Server Tab..."), menu_newserver_tab, 0, M_MENUITEM, 0, 0, 1, GDK_t}, {N_("Channel Tab..."), menu_newchannel_tab, 0, M_MENUITEM, 0, 0, 1}, - {N_("Server Window..."), menu_newserver_window, 0, M_MENUITEM, 0, 0, 1}, + {N_("Server Window..."), menu_newserver_window, 0, M_MENUITEM, 0, 0, 1, GDK_n}, {N_("Channel Window..."), menu_newchannel_window, 0, M_MENUITEM, 0, 0, 1}, {0, 0, 0, M_END, 0, 0, 0}, {0, 0, 0, M_SEP, 0, 0, 0}, @@ -1685,7 +1673,7 @@ static struct mymenu mymenu[] = { {0, 0, 0, M_SEP, 0, 0, 0}, {N_("Reset Marker Line"), menu_resetmarker, 0, M_MENUITEM, 0, 0, 1, GDK_m}, {N_("_Copy Selection"), menu_copy_selection, 0, M_MENUITEM, 0, 0, 1, GDK_C}, - {N_("C_lear Text"), menu_flushbuffer, GTK_STOCK_CLEAR, M_MENUSTOCK, 0, 0, 1, GDK_l}, + {N_("C_lear Text"), menu_flushbuffer, GTK_STOCK_CLEAR, M_MENUSTOCK, 0, 0, 1}, {N_("Save Text..."), menu_savebuffer, GTK_STOCK_SAVE, M_MENUSTOCK, 0, 0, 1}, #define SEARCH_OFFSET 68 {N_("Search"), 0, GTK_STOCK_JUSTIFY_LEFT, M_MENUSUB, 0, 0, 1}, diff --git a/src/fe-gtk/menu.h b/src/fe-gtk/menu.h index 7fef79cd..dfc6fd07 100644 --- a/src/fe-gtk/menu.h +++ b/src/fe-gtk/menu.h @@ -1,3 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_MENU_H +#define HEXCHAT_MENU_H + GtkWidget *menu_create_main (void *accel_group, int bar, int away, int toplevel, GtkWidget **menu_widgets); void menu_urlmenu (GdkEventButton * event, char *url); void menu_chanmenu (session *sess, GdkEventButton * event, char *chan); @@ -39,3 +61,5 @@ void menu_change_layout (void); #if (MENU_ID_NUM < MENU_ID_USERMENU) #error MENU_ID_NUM is set wrong #endif + +#endif diff --git a/src/fe-gtk/mmx_cmod.h b/src/fe-gtk/mmx_cmod.h index 52d07102..5b84a4b8 100644 --- a/src/fe-gtk/mmx_cmod.h +++ b/src/fe-gtk/mmx_cmod.h @@ -1,4 +1,28 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_MMX_CMOD_H +#define HEXCHAT_MMX_CMOD_H + void shade_ximage_15_mmx(void *data, int bpl, int w, int h, int rm, int gm, int bm); void shade_ximage_16_mmx(void *data, int bpl, int w, int h, int rm, int gm, int bm); void shade_ximage_32_mmx(void *data, int bpl, int w, int h, int rm, int gm, int bm); int have_mmx (void); + +#endif diff --git a/src/fe-gtk/notifygui.c b/src/fe-gtk/notifygui.c index 0559734c..3c3b6a6e 100644 --- a/src/fe-gtk/notifygui.c +++ b/src/fe-gtk/notifygui.c @@ -24,20 +24,6 @@ #include "fe-gtk.h" -#include <gtk/gtkhbox.h> -#include <gtk/gtkstock.h> -#include <gtk/gtkhbbox.h> -#include <gtk/gtkscrolledwindow.h> - -#include <gtk/gtklabel.h> -#include <gtk/gtkliststore.h> -#include <gtk/gtkentry.h> -#include <gtk/gtkmessagedialog.h> -#include <gtk/gtktable.h> -#include <gtk/gtktreeview.h> -#include <gtk/gtktreeselection.h> -#include <gtk/gtkcellrenderertext.h> - #include "../common/hexchat.h" #include "../common/notify.h" #include "../common/cfgfiles.h" @@ -413,6 +399,7 @@ notify_opengui (void) notify_window = mg_create_generic_tab ("Notify", _(DISPLAY_NAME": Friends List"), FALSE, TRUE, notify_closegui, NULL, 400, 250, &vbox, 0); + gtkutil_destroy_on_esc (notify_window); view = notify_treeview_new (vbox); g_object_set_data (G_OBJECT (notify_window), "view", view); diff --git a/src/fe-gtk/notifygui.h b/src/fe-gtk/notifygui.h index 360834dc..6517995c 100644 --- a/src/fe-gtk/notifygui.h +++ b/src/fe-gtk/notifygui.h @@ -1,2 +1,26 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_NOTIFYGUI_H +#define HEXCHAT_NOTIFYGUI_H + void notify_gui_update (void); void notify_opengui (void); + +#endif diff --git a/src/fe-gtk/palette.h b/src/fe-gtk/palette.h index 627c6963..6f53c1a7 100644 --- a/src/fe-gtk/palette.h +++ b/src/fe-gtk/palette.h @@ -1,3 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_PALETTE_H +#define HEXCHAT_PALETTE_H + extern GdkColor colors[]; #define COL_MARK_FG 32 @@ -14,3 +36,5 @@ extern GdkColor colors[]; void palette_alloc (GtkWidget * widget); void palette_load (void); void palette_save (void); + +#endif diff --git a/src/fe-gtk/pixmaps.c b/src/fe-gtk/pixmaps.c index 419ef4c1..bdd74e1e 100644 --- a/src/fe-gtk/pixmaps.c +++ b/src/fe-gtk/pixmaps.c @@ -26,8 +26,6 @@ #include "../common/fe.h" #include <gdk-pixbuf/gdk-pixbuf.h> -#include <gdk-pixbuf/gdk-pixdata.h> -#include <gtk/gtkstock.h> #include "../pixmaps/inline_pngs.h" diff --git a/src/fe-gtk/pixmaps.h b/src/fe-gtk/pixmaps.h index 64607582..7241fa84 100644 --- a/src/fe-gtk/pixmaps.h +++ b/src/fe-gtk/pixmaps.h @@ -1,3 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_PIXMAPS_H +#define HEXCHAT_PIXMAPS_H + extern GdkPixbuf *pix_ulist_voice; extern GdkPixbuf *pix_ulist_halfop; extern GdkPixbuf *pix_ulist_op; @@ -19,3 +41,5 @@ extern GdkPixbuf *pix_hexchat; extern GdkPixmap *pixmap_load_from_file (char *file); extern void pixmaps_init (void); + +#endif diff --git a/src/fe-gtk/plugin-tray.c b/src/fe-gtk/plugin-tray.c index 694e4c35..cf9d036b 100644 --- a/src/fe-gtk/plugin-tray.c +++ b/src/fe-gtk/plugin-tray.c @@ -1,4 +1,20 @@ -/* Copyright (C) 2006-2007 Peter Zelezny. */ +/* X-Chat + * Copyright (C) 2006-2007 Peter Zelezny. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ #include <string.h> #include "../common/hexchat-plugin.h" @@ -13,7 +29,6 @@ #include "pixmaps.h" #include "maingui.h" #include "menu.h" -#include <gtk/gtk.h> #ifndef WIN32 #include <unistd.h> @@ -837,7 +852,7 @@ tray_apply_setup (void) } else { - if (prefs.hex_gui_tray && !hextray_mode ()) + if (prefs.hex_gui_tray && !unity_mode ()) tray_init (); } } @@ -869,7 +884,7 @@ tray_plugin_init (hexchat_plugin *plugin_handle, char **plugin_name, hexchat_hook_print (ph, "Focus Window", -1, tray_focus_cb, NULL); - if (prefs.hex_gui_tray && !hextray_mode ()) + if (prefs.hex_gui_tray && !unity_mode ()) tray_init (); return 1; /* return 1 for success */ diff --git a/src/fe-gtk/plugin-tray.h b/src/fe-gtk/plugin-tray.h index d54be5a4..cb77019a 100644 --- a/src/fe-gtk/plugin-tray.h +++ b/src/fe-gtk/plugin-tray.h @@ -1,4 +1,28 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_PLUGIN_TRAY_H +#define HEXCHAT_PLUGIN_TRAY_H + int tray_plugin_init (void *, char **, char **, char **, char *); int tray_plugin_deinit (void *); gboolean tray_toggle_visibility (gboolean force_hide); void tray_apply_setup (void); + +#endif diff --git a/src/fe-gtk/plugingui.c b/src/fe-gtk/plugingui.c index 293535cc..48152d78 100644 --- a/src/fe-gtk/plugingui.c +++ b/src/fe-gtk/plugingui.c @@ -22,17 +22,6 @@ #include "fe-gtk.h" -#include <gtk/gtkdialog.h> -#include <gtk/gtkstock.h> -#include <gtk/gtkbox.h> -#include <gtk/gtkhbbox.h> -#include <gtk/gtkscrolledwindow.h> - -#include <gtk/gtkliststore.h> -#include <gtk/gtktreeview.h> -#include <gtk/gtktreeselection.h> -#include <gtk/gtkcellrenderertext.h> - #include "../common/hexchat.h" #define PLUGIN_C typedef struct session hexchat_context; @@ -219,6 +208,7 @@ plugingui_open (void) plugin_window = mg_create_generic_tab ("Addons", _(DISPLAY_NAME": Plugins and Scripts"), FALSE, TRUE, plugingui_close, NULL, 500, 250, &vbox, 0); + gtkutil_destroy_on_esc (plugin_window); view = plugingui_treeview_new (vbox); g_object_set_data (G_OBJECT (plugin_window), "view", view); diff --git a/src/fe-gtk/plugingui.h b/src/fe-gtk/plugingui.h index 945d9a01..ae079a72 100644 --- a/src/fe-gtk/plugingui.h +++ b/src/fe-gtk/plugingui.h @@ -1,2 +1,26 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_PLUGINGUI_H +#define HEXCHAT_PLUGINGUI_H + void plugingui_open (void); void plugingui_load (void); + +#endif diff --git a/src/fe-gtk/rawlog.c b/src/fe-gtk/rawlog.c index 6764034f..d0564406 100644 --- a/src/fe-gtk/rawlog.c +++ b/src/fe-gtk/rawlog.c @@ -29,11 +29,6 @@ #include "fe-gtk.h" -#include <gtk/gtkbutton.h> -#include <gtk/gtkhbbox.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkvscrollbar.h> -#include <gtk/gtkstock.h> #include <gdk/gdkkeysyms.h> #include "../common/hexchat.h" @@ -86,7 +81,7 @@ rawlog_savebutton (GtkWidget * wid, server *serv) return FALSE; } -static void +static gboolean rawlog_key_cb (GtkWidget * wid, GdkEventKey * key, gpointer userdata) { /* Copy rawlog selection to clipboard when Ctrl+Shift+C is pressed, @@ -99,13 +94,7 @@ rawlog_key_cb (GtkWidget * wid, GdkEventKey * key, gpointer userdata) { gtk_xtext_copy_selection (userdata); } - /* close_rawlog is given to mg_create_generic_tab as - * close_callback, it should take care of the rest. - */ - else if (key->keyval == GDK_Escape) - { - gtk_widget_destroy (wid); - } + return FALSE; } void @@ -124,6 +113,7 @@ open_rawlog (struct server *serv) serv->gui->rawlog_window = mg_create_generic_tab ("RawLog", tbuf, FALSE, TRUE, close_rawlog, serv, 640, 320, &vbox, serv); + gtkutil_destroy_on_esc (serv->gui->rawlog_window); hbox = gtk_hbox_new (FALSE, 2); gtk_container_add (GTK_CONTAINER (vbox), hbox); diff --git a/src/fe-gtk/rawlog.h b/src/fe-gtk/rawlog.h index db41e2a7..53c57d42 100644 --- a/src/fe-gtk/rawlog.h +++ b/src/fe-gtk/rawlog.h @@ -1 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_RAWLOG_H +#define HEXCHAT_RAWLOG_H + void open_rawlog (server *serv); + +#endif diff --git a/src/fe-gtk/search.c b/src/fe-gtk/search.c index 41a1a642..49c30a14 100644 --- a/src/fe-gtk/search.c +++ b/src/fe-gtk/search.c @@ -22,18 +22,6 @@ #include "fe-gtk.h" -#include <gtk/gtkentry.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkvbox.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkstock.h> -#include <gtk/gtkhbbox.h> -#include <gtk/gtkhseparator.h> -#include <gtk/gtkvseparator.h> -#include <gtk/gtkradiobutton.h> -#include <gtk/gtktogglebutton.h> -#include <gdk/gdkkeysyms.h> - #include "../common/hexchat.h" #include "../common/fe.h" #include "../common/util.h" @@ -119,14 +107,6 @@ search_entry_cb (GtkWidget * entry, session * sess) search_search (sess, gtk_entry_get_text (GTK_ENTRY (entry))); } -static gboolean -search_key_cb (GtkWidget * window, GdkEventKey * key, gpointer userdata) -{ - if (key->keyval == GDK_Escape) - gtk_widget_destroy (window); - return FALSE; -} - static void search_caseign_cb (GtkToggleButton * but, session * sess) { @@ -238,7 +218,7 @@ search_open (session * sess) add_tip (wid, "Close this box, reset highlighted search items, and stop searching new lines."); /* Add recognition of the ESC key to close the box */ - g_signal_connect (G_OBJECT (win), "key_press_event", G_CALLBACK (search_key_cb), win); + gtkutil_destroy_on_esc (win); /* That's all, folks */ searchwin = win; diff --git a/src/fe-gtk/search.h b/src/fe-gtk/search.h index 8fa1b628..55f8f0b5 100644 --- a/src/fe-gtk/search.h +++ b/src/fe-gtk/search.h @@ -1 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_SEARCH_H +#define HEXCHAT_SEARCH_H + void search_open (session * sess); + +#endif diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c index 4aeaf00f..774ce1cc 100644 --- a/src/fe-gtk/servlistgui.c +++ b/src/fe-gtk/servlistgui.c @@ -1,5 +1,19 @@ /* X-Chat * Copyright (C) 2004-2008 Peter Zelezny. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include <stdlib.h> @@ -7,29 +21,6 @@ #include <string.h> #include <ctype.h> -#include <gtk/gtkversion.h> -#include <gtk/gtkcheckbutton.h> -#include <gtk/gtkcellrenderertext.h> -#include <gtk/gtkcomboboxentry.h> -#include <gtk/gtkentry.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkhbbox.h> -#include <gtk/gtkhseparator.h> -#include <gtk/gtkimage.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkliststore.h> -#include <gtk/gtkmenuitem.h> -#include <gtk/gtkmessagedialog.h> -#include <gtk/gtkscrolledwindow.h> -#include <gtk/gtkstock.h> -#include <gtk/gtktable.h> -#include <gtk/gtktogglebutton.h> -#include <gtk/gtktree.h> -#include <gtk/gtktreeselection.h> -#include <gtk/gtktreeview.h> -#include <gtk/gtkvbbox.h> -#include <gtk/gtkvbox.h> -#include <gtk/gtkwindow.h> #include <gdk/gdkkeysyms.h> #include "../common/hexchat.h" @@ -93,7 +84,6 @@ static GtkWidget *servlist_open_edit (GtkWidget *parent, ircnet *net); static const char *pages[]= { - "UTF-8 (Unicode)", IRC_DEFAULT_CHARSET, "ISO-8859-15 (Western Europe)", "ISO-8859-2 (Central Europe)", diff --git a/src/fe-gtk/servlistgui.h b/src/fe-gtk/servlistgui.h index f2c2d14d..ca176a34 100644 --- a/src/fe-gtk/servlistgui.h +++ b/src/fe-gtk/servlistgui.h @@ -1 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_SERVLISTGUI_H +#define HEXCHAT_SERVLISTGUI_H + void servlist_autojoinedit (ircnet *net, char *channel, gboolean add); + +#endif diff --git a/src/fe-gtk/setup.c b/src/fe-gtk/setup.c index f02bc3d7..ac8826cf 100644 --- a/src/fe-gtk/setup.c +++ b/src/fe-gtk/setup.c @@ -1,5 +1,19 @@ /* X-Chat * Copyright (C) 2004-2007 Peter Zelezny. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include <stdio.h> @@ -23,36 +37,10 @@ #include "menu.h" #include "plugin-tray.h" -#include <gtk/gtkcolorseldialog.h> -#include <gtk/gtktable.h> -#include <gtk/gtkentry.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkmisc.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkvbox.h> -#include <gtk/gtkalignment.h> -#include <gtk/gtknotebook.h> -#include <gtk/gtkframe.h> -#include <gtk/gtkfontsel.h> -#include <gtk/gtkcheckbutton.h> -#include <gtk/gtkscrolledwindow.h> -#include <gtk/gtkspinbutton.h> -#include <gtk/gtkstock.h> -#include <gtk/gtktreeview.h> -#include <gtk/gtkhbbox.h> -#include <gtk/gtkhseparator.h> -#include <gtk/gtkradiobutton.h> -#include <gtk/gtkcombobox.h> -#include <gtk/gtkliststore.h> -#include <gtk/gtktreestore.h> -#include <gtk/gtktreeselection.h> -#include <gtk/gtkcellrenderertext.h> -#include <gtk/gtkhscale.h> #ifdef WIN32 #include "../common/fe.h" #endif #ifdef USE_GTKSPELL -#include <gtk/gtktextview.h> #include <gtkspell/gtkspell.h> #endif #ifdef USE_LIBSEXY @@ -287,6 +275,7 @@ static const setting userlist_settings[] = {ST_TOGGLE, N_("Show hostnames in user list"), P_OFFINTNL(hex_gui_ulist_show_hosts), 0, 0, 0}, {ST_TOGGLE, N_("Use the Text box font and colors"), P_OFFINTNL(hex_gui_ulist_style),0,0,0}, {ST_TOGGLE, N_("Show icons for user modes"), P_OFFINTNL(hex_gui_ulist_icons), N_("Use graphical icons instead of text symbols in the user list."), 0, 0}, + {ST_TOGGLE, N_("Color nicknames in userlist"), P_OFFINTNL(hex_gui_ulist_color), N_("Will color nicknames the same as in chat."), 0, 0}, {ST_TOGGLE, N_("Show user count in channels"), P_OFFINTNL(hex_gui_ulist_count), 0, 0, 0}, /* {ST_TOGGLE, N_("Resizable user list"), P_OFFINTNL(hex_gui_ulist_resizable),0,0,0},*/ {ST_MENU, N_("User list sorted by:"), P_OFFINTNL(hex_gui_ulist_sort), 0, ulmenutext, 0}, @@ -321,6 +310,14 @@ static const char *const focusnewtabsmenu[] = NULL }; +static const char *const noticeposmenu[] = +{ + N_("Automatic"), + N_("In an extra tab"), + N_("In the front tab"), + NULL +}; + static const char *const swtype[] = { N_("Tabs"), /* 0 tabs */ @@ -334,13 +331,13 @@ static const setting tabs_settings[] = /*{ST_HEADER, N_("Channel Switcher"),0,0,0},*/ {ST_RADIO, N_("Switcher type:"),P_OFFINTNL(hex_gui_tab_layout), 0, swtype, 0}, {ST_TOGGLE, N_("Open an extra tab for server messages"), P_OFFINTNL(hex_gui_tab_server), 0, 0, 0}, - {ST_TOGGLE, N_("Open an extra tab for server notices"), P_OFFINTNL(hex_gui_tab_notices), 0, 0, 0}, {ST_TOGGLE, N_("Open a new tab when you receive a private message"), P_OFFINTNL(hex_gui_autoopen_dialog), 0, 0, 0}, {ST_TOGGLE, N_("Sort tabs in alphabetical order"), P_OFFINTNL(hex_gui_tab_sort), 0, 0, 0}, {ST_TOGGLE, N_("Show icons in the channel tree"), P_OFFINTNL(hex_gui_tab_icons), 0, 0, 0}, {ST_TOGGLE, N_("Show dotted lines in the channel tree"), P_OFFINTNL(hex_gui_tab_dots), 0, 0, 0}, {ST_TOGGLE, N_("Smaller text"), P_OFFINTNL(hex_gui_tab_small), 0, 0, 0}, {ST_MENU, N_("Focus new tabs:"), P_OFFINTNL(hex_gui_tab_newtofront), 0, focusnewtabsmenu, 0}, + {ST_MENU, N_("Placement of notices:"), P_OFFINTNL(hex_irc_notice_pos), 0, noticeposmenu, 0}, {ST_MENU, N_("Show channel switcher at:"), P_OFFINTNL(hex_gui_tab_pos), 0, cspos, 1}, {ST_NUMBER, N_("Shorten tab labels to:"), P_OFFINTNL(hex_gui_tab_trunc), 0, (const char **)N_("letters."), 99}, @@ -437,7 +434,7 @@ static const setting alert_settings[] = {ST_TOGGLE, N_("Enable system tray icon"), P_OFFINTNL(hex_gui_tray), 0, 0, 0}, {ST_TOGGLE, N_("Minimize to tray"), P_OFFINTNL(hex_gui_tray_minimize), 0, 0, 0}, {ST_TOGGLE, N_("Close to tray"), P_OFFINTNL(hex_gui_tray_close), 0, 0, 0}, - {ST_TOGGLE, N_("Automatically mark away/back"), P_OFFINTNL(hex_gui_tray_away), N_("When hiding to tray automatically change status."), 0, 0}, + {ST_TOGGLE, N_("Automatically mark away/back"), P_OFFINTNL(hex_gui_tray_away), N_("Automatically change status when hiding to tray."), 0, 0}, #ifndef WIN32 {ST_TOGGLE, N_("Only show tray balloons when hidden or iconified"), P_OFFINTNL(hex_gui_tray_quiet), 0, 0, 0}, #endif @@ -453,11 +450,12 @@ static const setting alert_settings[] = {ST_END, 0, 0, 0, 0, 0} }; -static const setting alert_settings_hextray[] = +static const setting alert_settings_unity[] = { {ST_HEADER, N_("Alerts"),0,0,0}, {ST_ALERTHEAD}, + {ST_3OGGLE, N_("Show tray balloons on:"), 0, 0, (void *)balloonlist, 0}, {ST_3OGGLE, N_("Blink task bar on:"), 0, 0, (void *)taskbarlist, 0}, {ST_3OGGLE, N_("Make a beep sound on:"), 0, 0, (void *)beeplist, 0}, @@ -493,6 +491,7 @@ static const setting general_settings[] = static const setting advanced_settings[] = { {ST_HEADER, N_("Advanced Settings"),0,0,0}, + {ST_ENTRY, N_("Real name:"), P_OFFSETNL(hex_irc_real_name), 0, 0, sizeof prefs.hex_irc_real_name}, #ifdef WIN32 {ST_ENTRY, N_("Alternative fonts:"), P_OFFSETNL(hex_text_font_alternative), "Separate multiple entries with commas without spaces before or after.", 0, sizeof prefs.hex_text_font_alternative}, #endif @@ -522,39 +521,6 @@ static const setting advanced_settings[] = {ST_END, 0, 0, 0, 0, 0} }; -#ifdef WIN32 -static const setting advanced_settings_oneinstance[] = -{ - {ST_HEADER, N_("Advanced Settings"),0,0,0}, - {ST_ENTRY, N_("Alternative fonts:"), P_OFFSETNL(hex_text_font_alternative), "Separate multiple entries with commas without spaces before or after.", 0, sizeof prefs.hex_text_font_alternative}, - {ST_NUMBER, N_("Auto reconnect delay:"), P_OFFINTNL(hex_net_reconnect_delay), 0, 0, 9999}, - {ST_NUMBER, N_("Auto join delay:"), P_OFFINTNL(hex_irc_join_delay), 0, 0, 9999}, - {ST_TOGGLE, N_("Display MODEs in raw form"), P_OFFINTNL(hex_irc_raw_modes), 0, 0, 0}, - {ST_TOGGLE, N_("Whois on notify"), P_OFFINTNL(hex_notify_whois_online), N_("Sends a /WHOIS when a user comes online in your notify list."), 0, 0}, - {ST_TOGGLE, N_("Hide join and part messages"), P_OFFINTNL(hex_irc_conf_mode), N_("Hide channel join/part messages by default."), 0, 0}, - /* {ST_TOGGLE, N_("Allow only one instance of HexChat to run"), P_OFFINTNL(hex_gui_single), 0, 0, 0}, */ - {ST_TOGGLE, N_("Display lists in compact mode"), P_OFFINTNL(hex_gui_compact), N_("Use less spacing between user list/channel tree rows."), 0, 0}, - {ST_HEADER, N_("Auto Open DCC Windows"),0,0,0}, - {ST_TOGGLE, N_("Send window"), P_OFFINTNL(hex_gui_autoopen_send), 0, 0, 0}, - {ST_TOGGLE, N_("Receive window"), P_OFFINTNL(hex_gui_autoopen_recv), 0, 0, 0}, - {ST_TOGGLE, N_("Chat window"), P_OFFINTNL(hex_gui_autoopen_chat), 0, 0, 0}, - {ST_HEADER, N_("Auto Copy Behavior"),0,0,0}, - {ST_TOGGLE, N_("Automatically copy selected text"), P_OFFINTNL(hex_text_autocopy_text), - N_("Copy selected text to clipboard when left mouse button is released. " - "Otherwise, CONTROL-SHIFT-C will copy the " - "selected text to the clipboard."), 0, 0}, - {ST_TOGGLE, N_("Automatically include time stamps"), P_OFFINTNL(hex_text_autocopy_stamp), - N_("Automatically include time stamps in copied lines of text. Otherwise, " - "include time stamps if the SHIFT key is held down while selecting."), 0, 0}, - {ST_TOGGLE, N_("Automatically include color information"), P_OFFINTNL(hex_text_autocopy_color), - N_("Automatically include color information in copied lines of text. " - "Otherwise, include color information if the CONTROL key is held down " - "while selecting."), 0, 0}, - - {ST_END, 0, 0, 0, 0, 0} -}; -#endif - static const setting logging_settings[] = { {ST_HEADER, N_("Logging"),0,0,0}, @@ -1936,9 +1902,9 @@ setup_create_pages (GtkWidget *box) setup_add_page (cata[4], book, setup_create_page (tabs_settings)); setup_add_page (cata[5], book, setup_create_color_page ()); - if (hextray_mode ()) + if (unity_mode ()) { - setup_add_page (cata[8], book, setup_create_page (alert_settings_hextray)); + setup_add_page (cata[8], book, setup_create_page (alert_settings_unity)); } else { @@ -1948,19 +1914,7 @@ setup_create_pages (GtkWidget *box) setup_add_page (cata[9], book, setup_create_page (general_settings)); setup_add_page (cata[10], book, setup_create_page (logging_settings)); setup_add_page (cata[11], book, setup_create_sound_page ()); - -#ifdef WIN32 - if (portable_mode ()) - { - setup_add_page (cata[12], book, setup_create_page (advanced_settings)); - } - else - { - setup_add_page (cata[12], book, setup_create_page (advanced_settings_oneinstance)); - } -#else setup_add_page (cata[12], book, setup_create_page (advanced_settings)); -#endif setup_add_page (cata[14], book, setup_create_page (network_settings)); setup_add_page (cata[15], book, setup_create_page (filexfer_settings)); @@ -2220,7 +2174,7 @@ setup_apply (struct hexchatprefs *pr) if (DIFF (hex_gui_compact)) noapply = TRUE; if (DIFF (hex_gui_input_icon)) - noapply = TRUE; + noapply = TRUE; if (DIFF (hex_gui_input_nick)) noapply = TRUE; if (DIFF (hex_gui_lagometer)) @@ -2253,7 +2207,7 @@ setup_apply (struct hexchatprefs *pr) if (DIFF (hex_gui_tab_layout)) do_layout = TRUE; - if (color_change || (DIFF (hex_away_size_max)) || (DIFF (hex_away_track))) + if (color_change || (DIFF (hex_gui_ulist_color)) || (DIFF (hex_away_size_max)) || (DIFF (hex_away_track))) do_ulist = TRUE; if ((pr->hex_gui_tab_pos == 5 || pr->hex_gui_tab_pos == 6) && diff --git a/src/fe-gtk/setup.h b/src/fe-gtk/setup.h index 646ba18e..d756b10e 100644 --- a/src/fe-gtk/setup.h +++ b/src/fe-gtk/setup.h @@ -1 +1,25 @@ -void setup_apply_real (int new_pix, int do_ulist, int do_layout); \ No newline at end of file +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_SETUP_H +#define HEXCHAT_SETUP_H + +void setup_apply_real (int new_pix, int do_ulist, int do_layout); + +#endif diff --git a/src/fe-gtk/sexy-marshal.c b/src/fe-gtk/sexy-marshal.c index 10a629f2..363842ca 100644 --- a/src/fe-gtk/sexy-marshal.c +++ b/src/fe-gtk/sexy-marshal.c @@ -1,5 +1,22 @@ +/* libsexy + * Copyright (C) 2005-2006 Christian Hammond. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ -#include <glib-object.h> +#include <glib-object.h> #ifdef G_ENABLE_DEBUG diff --git a/src/fe-gtk/sexy-marshal.h b/src/fe-gtk/sexy-marshal.h index f41eccbe..aa560767 100644 --- a/src/fe-gtk/sexy-marshal.h +++ b/src/fe-gtk/sexy-marshal.h @@ -1,8 +1,25 @@ +/* libsexy + * Copyright (C) 2005-2006 Christian Hammond. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ #ifndef __sexy_marshal_MARSHAL_H__ #define __sexy_marshal_MARSHAL_H__ -#include <glib-object.h> +#include <glib-object.h> G_BEGIN_DECLS diff --git a/src/fe-gtk/sexy-spell-entry.h b/src/fe-gtk/sexy-spell-entry.h index 23f01af5..1c761235 100644 --- a/src/fe-gtk/sexy-spell-entry.h +++ b/src/fe-gtk/sexy-spell-entry.h @@ -1,7 +1,5 @@ -/* - * @file libsexy/sexy-spell-entry.h Entry widget - * - * @Copyright (C) 2004-2006 Christian Hammond. +/* libsexy + * Copyright (C) 2004-2006 Christian Hammond. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -14,8 +12,8 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef _SEXY_SPELL_ENTRY_H_ #define _SEXY_SPELL_ENTRY_H_ @@ -24,7 +22,7 @@ typedef struct _SexySpellEntry SexySpellEntry; typedef struct _SexySpellEntryClass SexySpellEntryClass; typedef struct _SexySpellEntryPriv SexySpellEntryPriv; -#include <gtk/gtkentry.h> +#include <gtk/gtk.h> #define SEXY_TYPE_SPELL_ENTRY (sexy_spell_entry_get_type()) #define SEXY_SPELL_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SEXY_TYPE_SPELL_ENTRY, SexySpellEntry)) diff --git a/src/fe-gtk/textgui.c b/src/fe-gtk/textgui.c index 7e006e69..0bdb4476 100644 --- a/src/fe-gtk/textgui.c +++ b/src/fe-gtk/textgui.c @@ -26,16 +26,6 @@ #include "fe-gtk.h" -#include <gtk/gtkbutton.h> -#include <gtk/gtkentry.h> -#include <gtk/gtkhbox.h> -#include <gtk/gtkhbbox.h> -#include <gtk/gtkliststore.h> -#include <gtk/gtkstock.h> -#include <gtk/gtkvbox.h> -#include <gtk/gtkvpaned.h> -#include <gtk/gtkvscrollbar.h> - #include "../common/hexchat.h" #include "../common/hexchatc.h" #include "../common/cfgfiles.h" diff --git a/src/fe-gtk/textgui.h b/src/fe-gtk/textgui.h index 23db5848..6d9a3a23 100644 --- a/src/fe-gtk/textgui.h +++ b/src/fe-gtk/textgui.h @@ -1,2 +1,26 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_TEXTGUI_H +#define HEXCHAT_TEXTGUI_H + void PrintTextRaw (void *xtbuf, unsigned char *text, int indent, time_t stamp); void pevent_dialog_show (void); + +#endif diff --git a/src/fe-gtk/urlgrab.c b/src/fe-gtk/urlgrab.c index b8a40a35..be62239e 100644 --- a/src/fe-gtk/urlgrab.c +++ b/src/fe-gtk/urlgrab.c @@ -22,16 +22,6 @@ #include "fe-gtk.h" -#include <gtk/gtkhbox.h> -#include <gtk/gtkstock.h> -#include <gtk/gtkhbbox.h> -#include <gtk/gtkscrolledwindow.h> - -#include <gtk/gtkliststore.h> -#include <gtk/gtktreeview.h> -#include <gtk/gtktreeselection.h> -#include <gtk/gtkcellrenderertext.h> - #include "../common/hexchat.h" #include "../common/hexchatc.h" #include "../common/cfgfiles.h" @@ -198,6 +188,7 @@ url_opengui () urlgrabberwindow = mg_create_generic_tab ("UrlGrabber", _(DISPLAY_NAME": URL Grabber"), FALSE, TRUE, url_closegui, NULL, 400, 256, &vbox, 0); + gtkutil_destroy_on_esc (urlgrabberwindow); view = url_treeview_new (vbox); g_object_set_data (G_OBJECT (urlgrabberwindow), "model", gtk_tree_view_get_model (GTK_TREE_VIEW (view))); diff --git a/src/fe-gtk/urlgrab.h b/src/fe-gtk/urlgrab.h index 51f15812..246b56e7 100644 --- a/src/fe-gtk/urlgrab.h +++ b/src/fe-gtk/urlgrab.h @@ -1 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_URLGRAB_H +#define HEXCHAT_URLGRAB_H + void url_opengui (void); + +#endif diff --git a/src/fe-gtk/userlistgui.c b/src/fe-gtk/userlistgui.c index 8405695b..c2f2a462 100644 --- a/src/fe-gtk/userlistgui.c +++ b/src/fe-gtk/userlistgui.c @@ -22,22 +22,13 @@ #include "fe-gtk.h" -#include <gtk/gtkbox.h> -#include <gtk/gtklabel.h> -#include <gtk/gtkdnd.h> -#include <gtk/gtkentry.h> -#include <gtk/gtktreeview.h> -#include <gtk/gtktreeselection.h> -#include <gtk/gtkscrolledwindow.h> -#include <gtk/gtkcellrendererpixbuf.h> -#include <gtk/gtkcellrenderertext.h> -#include <gtk/gtkliststore.h> #include <gdk/gdkkeysyms.h> #include "../common/hexchat.h" #include "../common/util.h" #include "../common/userlist.h" #include "../common/modes.h" +#include "../common/text.h" #include "../common/notify.h" #include "../common/hexchatc.h" #include "../common/fe.h" @@ -49,11 +40,6 @@ #include "userlistgui.h" #include "fkeys.h" -#ifdef USE_GTKSPELL -#include <gtk/gtktextview.h> -#endif - - enum { COL_PIX=0, // GdkPixbuf * @@ -327,21 +313,21 @@ fe_userlist_rehash (session *sess, struct User *user) { GtkTreeIter *iter; int sel; - int do_away = TRUE; + int nick_color = 0; iter = find_row (GTK_TREE_VIEW (sess->gui->user_tree), sess->res->user_model, user, &sel); if (!iter) return; - if (prefs.hex_away_size_max < 1 || !prefs.hex_away_track) - do_away = FALSE; + if (prefs.hex_away_track && prefs.hex_away_size_max && user->away) + nick_color = COL_AWAY; + else if (prefs.hex_gui_ulist_color) + nick_color = text_color_of(user->nick); gtk_list_store_set (GTK_LIST_STORE (sess->res->user_model), iter, COL_HOST, user->hostname, - COL_GDKCOLOR, (do_away) - ? (user->away ? &colors[COL_AWAY] : NULL) - : (NULL), + COL_GDKCOLOR, nick_color ? &colors[nick_color] : NULL, -1); } @@ -351,11 +337,13 @@ fe_userlist_insert (session *sess, struct User *newuser, int row, int sel) GtkTreeModel *model = sess->res->user_model; GdkPixbuf *pix = get_user_icon (sess->server, newuser); GtkTreeIter iter; - int do_away = TRUE; char *nick; + int nick_color = 0; - if (prefs.hex_away_size_max < 1 || !prefs.hex_away_track) - do_away = FALSE; + if (prefs.hex_away_track && prefs.hex_away_size_max && newuser->away) + nick_color = COL_AWAY; + else if (prefs.hex_gui_ulist_color) + nick_color = text_color_of(newuser->nick); nick = newuser->nick; if (!prefs.hex_gui_ulist_icons) @@ -374,9 +362,7 @@ fe_userlist_insert (session *sess, struct User *newuser, int row, int sel) COL_NICK, nick, COL_HOST, newuser->hostname, COL_USER, newuser, - COL_GDKCOLOR, (do_away) - ? (newuser->away ? &colors[COL_AWAY] : NULL) - : (NULL), + COL_GDKCOLOR, nick_color ? &colors[nick_color] : NULL, -1); if (!prefs.hex_gui_ulist_icons) diff --git a/src/fe-gtk/userlistgui.h b/src/fe-gtk/userlistgui.h index b49e2b9b..993fe8f0 100644 --- a/src/fe-gtk/userlistgui.h +++ b/src/fe-gtk/userlistgui.h @@ -1,3 +1,25 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_USERLISTGUI_H +#define HEXCHAT_USERLISTGUI_H + void userlist_set_value (GtkWidget *treeview, gfloat val); gfloat userlist_get_value (GtkWidget *treeview); GtkWidget *userlist_create (GtkWidget *box); @@ -6,3 +28,5 @@ void userlist_show (session *sess); void userlist_select (session *sess, char *name); char **userlist_selection_list (GtkWidget *widget, int *num_ret); GdkPixbuf *get_user_icon (server *serv, struct User *user); + +#endif diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c index 6005e265..e151524d 100644 --- a/src/fe-gtk/xtext.c +++ b/src/fe-gtk/xtext.c @@ -42,12 +42,6 @@ #include <ctype.h> #include <stdlib.h> #include <time.h> -#include <gtk/gtkmain.h> -#include <gtk/gtksignal.h> -#include <gtk/gtkselection.h> -#include <gtk/gtkclipboard.h> -#include <gtk/gtkversion.h> -#include <gtk/gtkwindow.h> #ifdef HEXCHAT #ifdef WIN32 @@ -90,15 +84,8 @@ #endif /* is delimiter */ -#if 0 -/* () is used by Wikipedia */ -#define is_del(c) \ - (c == ' ' || c == '\n' || c == ')' || c == '(' || \ - c == '>' || c == '<' || c == ATTR_RESET || c == ATTR_BOLD || c == 0) -#endif #define is_del(c) \ - (c == ' ' || c == '\n' || c == '>' || c == '<' || \ - c == ATTR_RESET || c == ATTR_BOLD || c == 0) + (c == ' ' || c == '\n' || c == '>' || c == '<' || c == 0) #ifdef SCROLL_HACK /* force scrolling off */ diff --git a/src/fe-gtk/xtext.h b/src/fe-gtk/xtext.h index cc6bbebb..8a4b26cf 100644 --- a/src/fe-gtk/xtext.h +++ b/src/fe-gtk/xtext.h @@ -1,7 +1,26 @@ -#ifndef __XTEXT_H__ -#define __XTEXT_H__ - -#include <gtk/gtkadjustment.h> +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 HEXCHAT_XTEXT_H +#define HEXCHAT_XTEXT_H + +#include <gtk/gtk.h> #ifdef USE_XFT #include <X11/Xft/Xft.h> #endif diff --git a/src/fe-text/fe-text-xp.vcxproj b/src/fe-text/fe-text-xp.vcxproj deleted file mode 100644 index 4860df3c..00000000 --- a/src/fe-text/fe-text-xp.vcxproj +++ /dev/null @@ -1,107 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <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>{E93E1255-95D1-4B08-8FDF-B53CC6A21280}</ProjectGuid> - <Keyword>Win32Proj</Keyword> - <RootNamespace>fetext</RootNamespace> - <ProjectName>fe-text</ProjectName> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>WDK7</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>WDK7</PlatformToolset> - </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-xp.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-xp.props" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <LinkIncremental>false</LinkIncremental> - <TargetName>hexchat-text</TargetName> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <LinkIncremental>false</LinkIncremental> - <TargetName>hexchat-text</TargetName> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - <AdditionalDependencies>$(DepLibs);"$(OutDir)\common.lib";%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_CONSOLE;$(OwnFlags);%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>$(DepsRoot)\include;$(Glib);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - <AdditionalDependencies>$(DepLibs);"$(OutDir)\common.lib";%(AdditionalDependencies)</AdditionalDependencies> - <AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClInclude Include="fe-text.h" /> - </ItemGroup> - <ItemGroup> - <ClCompile Include="fe-text.c" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> \ No newline at end of file diff --git a/src/fe-text/fe-text-xp.vcxproj.filters b/src/fe-text/fe-text-xp.vcxproj.filters deleted file mode 100644 index e8a4bcc5..00000000 --- a/src/fe-text/fe-text-xp.vcxproj.filters +++ /dev/null @@ -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="Header Files"> - <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> - <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> - </Filter> - </ItemGroup> - <ItemGroup> - <ClInclude Include="fe-text.h"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <ClCompile Include="fe-text.c"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> -</Project> \ No newline at end of file diff --git a/src/fe-text/fe-text.c b/src/fe-text/fe-text.c index 90f86627..371ce5b8 100644 --- a/src/fe-text/fe-text.c +++ b/src/fe-text/fe-text.c @@ -32,7 +32,7 @@ #endif #include <sys/types.h> #include <ctype.h> -#include <glib.h> +#include <glib-object.h> #include "../common/hexchat.h" #include "../common/hexchatc.h" #include "../common/cfgfiles.h" @@ -61,7 +61,7 @@ handle_line (GIOChannel *channel, GIOCondition cond, gpointer data) GIOStatus result; result = g_io_channel_read_line(channel, &str_return, &length, &terminator_pos, &error); - if (result == G_IO_STATUS_ERROR) { + if (result == G_IO_STATUS_ERROR || result == G_IO_STATUS_EOF) { return FALSE; } else { @@ -429,7 +429,14 @@ fe_input_add (int sok, int flags, void *func, void *data) int tag, type = 0; GIOChannel *channel; +#ifdef G_OS_WIN32 + if (flags & FIA_FD) + channel = g_io_channel_win32_new_fd (sok); + else + channel = g_io_channel_win32_new_socket (sok); +#else channel = g_io_channel_unix_new (sok); +#endif if (flags & FIA_READ) type |= G_IO_IN | G_IO_HUP | G_IO_ERR; @@ -478,6 +485,8 @@ fe_args (int argc, char *argv[]) context = g_option_context_new (NULL); g_option_context_add_main_entries (context, gopt_entries, GETTEXT_PACKAGE); g_option_context_parse (context, &argc, &argv, &error); + + g_type_init (); if (error) { @@ -641,18 +650,15 @@ void fe_chan_list_end (struct server *serv) { } -int -fe_is_banwindow (struct session *sess) +gboolean +fe_add_ban_list (struct session *sess, char *mask, char *who, char *when, int rplcode) { return 0; } -void -fe_add_ban_list (struct session *sess, char *mask, char *who, char *when, int is_exemption) -{ -} -void -fe_ban_list_end (struct session *sess, int is_exemption) +gboolean +fe_ban_list_end (struct session *sess, int rplcode) { + return 0; } void fe_notify_update (char *name) diff --git a/src/fe-text/fe-text.h b/src/fe-text/fe-text.h index e4f6f6c0..a2bc5d75 100644 --- a/src/fe-text/fe-text.h +++ b/src/fe-text/fe-text.h @@ -1 +1,20 @@ +/* HexChat + * Copyright (C) 1998-2010 Peter Zelezny. + * Copyright (C) 2009-2013 Berke Viktor. + * + * 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 + */ + GMainLoop *main_loop; diff --git a/src/gtk2-prefs/callbacks.cpp b/src/gtk2-prefs/callbacks.cpp index 9cc5c928..383dcde9 100644 --- a/src/gtk2-prefs/callbacks.cpp +++ b/src/gtk2-prefs/callbacks.cpp @@ -1,3 +1,21 @@ +/* GTK+ Preference Tool + * Copyright (C) 2003-2005 Alex Shaduri. + * + * 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 + */ + #ifdef HAVE_CONFIG_H # include <config.h> #endif diff --git a/src/gtk2-prefs/callbacks.h b/src/gtk2-prefs/callbacks.h index 5759aebc..770e776d 100644 --- a/src/gtk2-prefs/callbacks.h +++ b/src/gtk2-prefs/callbacks.h @@ -1,3 +1,21 @@ +/* GTK+ Preference Tool + * Copyright (C) 2003-2005 Alex Shaduri. + * + * 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 <gtk/gtk.h> diff --git a/src/gtk2-prefs/config.h b/src/gtk2-prefs/config.h index 4501a33b..ffe17a8d 100644 --- a/src/gtk2-prefs/config.h +++ b/src/gtk2-prefs/config.h @@ -1,3 +1,21 @@ +/* GTK+ Preference Tool + * Copyright (C) 2003-2005 Alex Shaduri. + * + * 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 + */ + /* Define to 1 if you have the <dlfcn.h> header file. */ #undef HAVE_DLFCN_H diff --git a/src/gtk2-prefs/main.cpp b/src/gtk2-prefs/main.cpp index 42e425c2..be1520b4 100644 --- a/src/gtk2-prefs/main.cpp +++ b/src/gtk2-prefs/main.cpp @@ -1,3 +1,21 @@ +/* GTK+ Preference Tool + * Copyright (C) 2003-2005 Alex Shaduri. + * + * 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 + */ + /*************************************************************************** main.cpp - description ------------------- diff --git a/src/gtk2-prefs/main.h b/src/gtk2-prefs/main.h index ab4e5cbd..45e3b786 100644 --- a/src/gtk2-prefs/main.h +++ b/src/gtk2-prefs/main.h @@ -1,3 +1,21 @@ +/* GTK+ Preference Tool + * Copyright (C) 2003-2005 Alex Shaduri. + * + * 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 + */ + /*************************************************************************** main.cpp - description ------------------- diff --git a/src/gtk2-prefs/sys_win32.h b/src/gtk2-prefs/sys_win32.h index 0a106690..a7e0069e 100644 --- a/src/gtk2-prefs/sys_win32.h +++ b/src/gtk2-prefs/sys_win32.h @@ -1,3 +1,21 @@ +/* GTK+ Preference Tool + * Copyright (C) 2003-2005 Alex Shaduri. + * + * 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 + */ + /*************************************************************************** sys_win32.h - description ------------------- diff --git a/src/gtk2-prefs/win32util.cpp b/src/gtk2-prefs/win32util.cpp index 79cab17d..83b21493 100644 --- a/src/gtk2-prefs/win32util.cpp +++ b/src/gtk2-prefs/win32util.cpp @@ -1,3 +1,21 @@ +/* GTK+ Preference Tool + * Copyright (C) 2003-2005 Alex Shaduri. + * + * 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 + */ + /*************************************************************************** win32util.cpp - description ------------------- diff --git a/src/gtk2-prefs/win32util.h b/src/gtk2-prefs/win32util.h index 8c194a19..d4fb441a 100644 --- a/src/gtk2-prefs/win32util.h +++ b/src/gtk2-prefs/win32util.h @@ -1,3 +1,21 @@ +/* GTK+ Preference Tool + * Copyright (C) 2003-2005 Alex Shaduri. + * + * 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 + */ + /*************************************************************************** win32util.h - description ------------------- diff --git a/src/htm/Main.Designer.cs b/src/htm/Main.Designer.cs index 87fdc396..d95cf7fc 100644 --- a/src/htm/Main.Designer.cs +++ b/src/htm/Main.Designer.cs @@ -1,4 +1,25 @@ -namespace thememan +/** + * HexChat Theme Manager + * + * Copyright (C) 2012 Patrick Griffs + * Copyright (C) 2012 Berke Viktor + * + * 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 + */ + +namespace thememan { partial class HTM { diff --git a/src/htm/Main.cs b/src/htm/Main.cs index cc33e206..8873d886 100644 --- a/src/htm/Main.cs +++ b/src/htm/Main.cs @@ -1,4 +1,5 @@ -/* HexChat Theme Manager +/** + * HexChat Theme Manager * * Copyright (C) 2012 Patrick Griffs * Copyright (C) 2012 Berke Viktor @@ -281,7 +282,7 @@ namespace thememan try { - using (Package zip = Package.Open(zipFile.FullName, FileMode.Open)) + using (Package zip = Package.Open(zipFile.FullName, FileMode.Open, FileAccess.Read)) { PackagePartCollection parts = zip.GetParts(); diff --git a/src/htm/Program.cs b/src/htm/Program.cs index ac350f91..afbb6483 100644 --- a/src/htm/Program.cs +++ b/src/htm/Program.cs @@ -1,4 +1,25 @@ -using System; +/** + * HexChat Theme Manager + * + * Copyright (C) 2012 Patrick Griffs + * Copyright (C) 2012 Berke Viktor + * + * 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 + */ + +using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; diff --git a/src/htm/Properties/AssemblyInfo.cs b/src/htm/Properties/AssemblyInfo.cs index b42e34a2..9cedc211 100644 --- a/src/htm/Properties/AssemblyInfo.cs +++ b/src/htm/Properties/AssemblyInfo.cs @@ -1,4 +1,25 @@ -using System.Reflection; +/** + * HexChat Theme Manager + * + * Copyright (C) 2012 Patrick Griffs + * Copyright (C) 2012 Berke Viktor + * + * 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 + */ + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Resources; diff --git a/src/htm/htm-xp.csproj b/src/htm/htm-xp.csproj deleted file mode 100644 index 84fce8aa..00000000 --- a/src/htm/htm-xp.csproj +++ /dev/null @@ -1,161 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">x86</Platform> - <ProductVersion>8.0.30703</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{DE87FFCA-9606-4116-B747-062D88A56A28}</ProjectGuid> - <OutputType>WinExe</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>thememan</RootNamespace> - <AssemblyName>thememan</AssemblyName> - <FileAlignment>512</FileAlignment> - <IsWebBootstrapper>false</IsWebBootstrapper> - <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> - <TargetFrameworkProfile>Client</TargetFrameworkProfile> - <PublishUrl>publish\</PublishUrl> - <Install>true</Install> - <InstallFrom>Disk</InstallFrom> - <UpdateEnabled>false</UpdateEnabled> - <UpdateMode>Foreground</UpdateMode> - <UpdateInterval>7</UpdateInterval> - <UpdateIntervalUnits>Days</UpdateIntervalUnits> - <UpdatePeriodically>false</UpdatePeriodically> - <UpdateRequired>false</UpdateRequired> - <MapFileExtensions>true</MapFileExtensions> - <AutorunEnabled>true</AutorunEnabled> - <ApplicationRevision>1</ApplicationRevision> - <ApplicationVersion>1.0.0.%2a</ApplicationVersion> - <UseApplicationTrust>false</UseApplicationTrust> - <PublishWizardCompleted>true</PublishWizardCompleted> - <BootstrapperEnabled>true</BootstrapperEnabled> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> - <PlatformTarget>x86</PlatformTarget> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>..\..\..\hexchat-build-xp\Win32\bin\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode> - </PropertyGroup> - <PropertyGroup> - <ApplicationIcon>Resources\htm.ico</ApplicationIcon> - </PropertyGroup> - <PropertyGroup> - <ManifestCertificateThumbprint>25412E3EF25458D894050F8209E4D9DCCDF432D7</ManifestCertificateThumbprint> - </PropertyGroup> - <PropertyGroup> - <ManifestKeyFile>htm_TemporaryKey.pfx</ManifestKeyFile> - </PropertyGroup> - <PropertyGroup> - <GenerateManifests>false</GenerateManifests> - </PropertyGroup> - <PropertyGroup> - <SignManifests>false</SignManifests> - </PropertyGroup> - <PropertyGroup> - <TargetZone>LocalIntranet</TargetZone> - </PropertyGroup> - <PropertyGroup /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> - <OutputPath>..\..\..\hexchat-build-xp\x64\bin\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <Optimize>true</Optimize> - <DebugType>pdbonly</DebugType> - <PlatformTarget>x64</PlatformTarget> - <CodeAnalysisLogFile>bin\Release\thememan.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile> - <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression> - <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile> - <ErrorReport>prompt</ErrorReport> - <CodeAnalysisIgnoreGeneratedCode>false</CodeAnalysisIgnoreGeneratedCode> - <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> - <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories> - <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets> - <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> - <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> - <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules> - </PropertyGroup> - <ItemGroup> - <Reference Include="System" /> - <Reference Include="System.Core" /> - <Reference Include="System.Xml.Linq" /> - <Reference Include="System.Data.DataSetExtensions" /> - <Reference Include="Microsoft.CSharp" /> - <Reference Include="System.Data" /> - <Reference Include="System.Drawing" /> - <Reference Include="System.Windows.Forms" /> - <Reference Include="System.Xml" /> - <Reference Include="WindowsBase" /> - </ItemGroup> - <ItemGroup> - <Compile Include="Main.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="Main.Designer.cs"> - <DependentUpon>Main.cs</DependentUpon> - </Compile> - <Compile Include="Program.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <EmbeddedResource Include="Main.resx"> - <DependentUpon>Main.cs</DependentUpon> - </EmbeddedResource> - <EmbeddedResource Include="Properties\Resources.resx"> - <Generator>ResXFileCodeGenerator</Generator> - <LastGenOutput>Resources.Designer.cs</LastGenOutput> - <SubType>Designer</SubType> - </EmbeddedResource> - <Compile Include="Properties\Resources.Designer.cs"> - <AutoGen>True</AutoGen> - <DependentUpon>Resources.resx</DependentUpon> - <DesignTime>True</DesignTime> - </Compile> - <None Include="app.config"> - <SubType>Designer</SubType> - </None> - <None Include="Properties\Settings.settings"> - <Generator>SettingsSingleFileGenerator</Generator> - <LastGenOutput>Settings.Designer.cs</LastGenOutput> - </None> - <Compile Include="Properties\Settings.Designer.cs"> - <AutoGen>True</AutoGen> - <DependentUpon>Settings.settings</DependentUpon> - <DesignTimeSharedInput>True</DesignTimeSharedInput> - </Compile> - </ItemGroup> - <ItemGroup> - <BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client"> - <Visible>False</Visible> - <ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName> - <Install>true</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> - <Install>false</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> - <Visible>False</Visible> - <ProductName>.NET Framework 3.5 SP1</ProductName> - <Install>false</Install> - </BootstrapperPackage> - <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> - <Visible>False</Visible> - <ProductName>Windows Installer 3.1</ProductName> - <Install>true</Install> - </BootstrapperPackage> - </ItemGroup> - <ItemGroup> - <Content Include="Resources\htm.ico" /> - </ItemGroup> - <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> -</Project> \ No newline at end of file diff --git a/src/pixmaps/pixmaps-xp.vcxproj b/src/pixmaps/pixmaps-xp.vcxproj deleted file mode 100644 index 8f7538ab..00000000 --- a/src/pixmaps/pixmaps-xp.vcxproj +++ /dev/null @@ -1,114 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <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>{626DA61C-FA8B-474C-B2F5-72AD9DFEE642}</ProjectGuid> - <Keyword>Win32Proj</Keyword> - <RootNamespace>pixmaps</RootNamespace> - <ProjectName>pixmaps</ProjectName> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>WDK7</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>WDK7</PlatformToolset> - </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-xp.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-xp.props" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <LinkIncremental>false</LinkIncremental> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <LinkIncremental>false</LinkIncremental> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - <PostBuildEvent> - <Command>"$(DepsRoot)\bin\gdk-pixbuf-csource" --build-list $(Pixmaps) > "$(SolutionDir)\..\src\pixmaps\inline_pngs.h"</Command> - </PostBuildEvent> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - <PostBuildEvent> - <Command>"$(DepsRoot)\bin\gdk-pixbuf-csource" --build-list $(Pixmaps) > "$(SolutionDir)\..\src\pixmaps\inline_pngs.h"</Command> - </PostBuildEvent> - </ItemDefinitionGroup> - <ItemGroup> - <None Include="ulist_voice.png" /> - <None Include="ulist_halfop.png" /> - <None Include="ulist_op.png" /> - <None Include="ulist_owner.png" /> - <None Include="ulist_founder.png" /> - <None Include="ulist_netop.png" /> - <None Include="tray_fileoffer.png" /> - <None Include="tray_highlight.png" /> - <None Include="tray_message.png" /> - <None Include="tree_channel.png" /> - <None Include="tree_dialog.png" /> - <None Include="tree_server.png" /> - <None Include="tree_util.png" /> - <None Include="book.png" /> - <None Include="hexchat.png" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> diff --git a/src/pixmaps/pixmaps-xp.vcxproj.filters b/src/pixmaps/pixmaps-xp.vcxproj.filters deleted file mode 100644 index 1351b32f..00000000 --- a/src/pixmaps/pixmaps-xp.vcxproj.filters +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <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="ulist_voice.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="ulist_halfop.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="ulist_op.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="ulist_owner.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="ulist_founder.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="ulist_netop.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="tray_fileoffer.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="tray_highlight.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="tray_message.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="tree_channel.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="tree_dialog.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="tree_server.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="tree_util.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="book.png"> - <Filter>Resource Files</Filter> - </None> - <None Include="hexchat.png"> - <Filter>Resource Files</Filter> - </None> - </ItemGroup> -</Project> diff --git a/src/version/version-xp.vcxproj b/src/version/version-xp.vcxproj deleted file mode 100644 index a0b5cf11..00000000 --- a/src/version/version-xp.vcxproj +++ /dev/null @@ -1,102 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <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>{6CD3647E-4541-4849-9DD7-C8816665AE42}</ProjectGuid> - <Keyword>Win32Proj</Keyword> - <RootNamespace>version</RootNamespace> - <ProjectName>version</ProjectName> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>WDK7</PlatformToolset> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>Application</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - <PlatformToolset>WDK7</PlatformToolset> - </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-xp.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-xp.props" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <LinkIncremental>false</LinkIncremental> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <LinkIncremental>false</LinkIncremental> - <OutDir>$(HexChatBin)</OutDir> - <IntDir>$(HexChatObj)$(ProjectName)\</IntDir> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - <PostBuildEvent> - <Command>"$(OutDir)\$(TargetName)$(TargetExt)" -r > "$(SolutionDir)\..\resource.h"</Command> - </PostBuildEvent> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <MultiProcessorCompilation>true</MultiProcessorCompilation> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - <PostBuildEvent> - <Command>"$(OutDir)\$(TargetName)$(TargetExt)" -r > "$(SolutionDir)\..\resource.h"</Command> - </PostBuildEvent> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="version.c" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project> \ No newline at end of file diff --git a/src/version/version-xp.vcxproj.filters b/src/version/version-xp.vcxproj.filters deleted file mode 100644 index decec7d0..00000000 --- a/src/version/version-xp.vcxproj.filters +++ /dev/null @@ -1,14 +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> - </ItemGroup> - <ItemGroup> - <ClCompile Include="version.c"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> -</Project> \ No newline at end of file |