2010-04-02 01:29:16 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/perl/perl.c xchat-wdk/plugins/perl/perl.c
2010-12-27 20:20:58 -05:00
--- xchat-wdk.orig/plugins/perl/perl.c 2010-12-22 04:53:06 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/plugins/perl/perl.c 2010-12-28 14:57:32 +0100
2010-08-26 10:08:34 -04:00
@@ -22,12 +22,15 @@
2010-04-02 01:29:16 -04:00
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <dirent.h>
#ifdef ENABLE_NLS
#include <locale.h>
#endif
2010-08-26 09:59:08 -04:00
#ifdef WIN32
#include <windows.h>
2010-08-26 10:08:34 -04:00
+#define _INC_DIRENT
2010-08-26 09:59:08 -04:00
+#include "../../src/common/dirent.h"
+#else
+#include <dirent.h>
#endif
#undef PACKAGE
@@ -1339,7 +1342,11 @@
if (GetLastError () == ERROR_BAD_EXE_FORMAT)
/* http://forum.xchat.org/viewtopic.php?t=3277 */
thread_mbox ("Cannot use this " PERL_DLL "\n\n"
+#ifdef _WIN64
+ "64-bit ActivePerl is required.");
+#else
"32-bit ActivePerl is required.");
+#endif
else {
/* a lot of people install this old version */
lib = LoadLibraryA ("perl56.dll");
@@ -1354,7 +1361,7 @@
2010-05-02 08:25:35 -04:00
thread_mbox ("Cannot open " PERL_DLL "\n\n"
2010-08-26 09:59:08 -04:00
"You must have ActivePerl " PERL_REQUIRED_VERSION " installed in order to\n"
2010-05-02 08:25:35 -04:00
"run perl scripts.\n\n"
2010-07-30 15:55:49 -04:00
- "http://www.activestate.com/ActivePerl/\n\n"
+ "http://www.activestate.com/activeperl/downloads\n\n"
2010-05-02 08:25:35 -04:00
"Make sure perl's bin directory is in your PATH.");
2010-07-30 15:55:49 -04:00
}
}
2010-04-02 01:29:16 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/python/python.c xchat-wdk/plugins/python/python.c
2010-12-28 08:47:09 -05:00
--- xchat-wdk.orig/plugins/python/python.c 2010-12-28 03:50:24 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/plugins/python/python.c 2010-12-28 14:57:32 +0100
2010-08-11 00:29:19 -04:00
@@ -53,10 +53,10 @@
2010-04-02 01:29:16 -04:00
#include <glib.h>
#include <string.h>
-#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
-#include <dirent.h>
+#include "../../src/common/dirent.h"
+#include "../../config.h"
#include "xchat-plugin.h"
#include "Python.h"
2010-08-11 00:29:19 -04:00
@@ -68,7 +68,7 @@
2010-04-02 01:29:16 -04:00
#ifdef WIN32
#undef WITH_THREAD /* Thread support locks up xchat on Win32. */
-#define VERSION "0.8/2.4" /* Linked to python24.dll */
2010-12-27 20:21:52 -05:00
+#define VERSION "0.8/2.7" /* Linked to python27.dll */
2010-04-02 01:29:16 -04:00
#else
#define VERSION "0.8"
#endif
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/tcl/tclplugin.c xchat-wdk/plugins/tcl/tclplugin.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/plugins/tcl/tclplugin.c 2010-03-21 01:49:42 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/plugins/tcl/tclplugin.c 2010-12-28 14:57:32 +0100
2010-04-02 01:29:16 -04:00
@@ -32,8 +32,6 @@
#include <windows.h>
#define bzero(mem, sz) memset((mem), 0, (sz))
#define bcopy(src, dest, count) memmove((dest), (src), (count))
-#else
-#include <unistd.h>
#endif
#include "xchat-plugin.h"
2010-07-30 15:55:49 -04:00
@@ -2221,7 +2219,7 @@
#ifdef WIN32
lib = LoadLibraryA(TCL_DLL);
if (!lib) {
- xchat_print(ph, "You must have ActiveTCL installed in order to run Tcl scripts.\n" "http://aspn.activestate.com/ASPN/Tcl/\n" "Make sure Tcl's bin directory is in your PATH.\n\n");
+ xchat_print(ph, "You must have ActiveTCL 8.5 installed in order to run Tcl scripts.\n" "http://www.activestate.com/activetcl/downloads\n" "Make sure Tcl's bin directory is in your PATH.\n\n");
return 0;
}
FreeLibrary(lib);
2010-08-11 16:52:30 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xdcc/xdcc.c xchat-wdk/plugins/xdcc/xdcc.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/plugins/xdcc/xdcc.c 2002-12-26 04:35:09 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/plugins/xdcc/xdcc.c 2010-12-28 14:57:32 +0100
2010-08-11 16:52:30 -04:00
@@ -2,11 +2,11 @@
#include <glib.h>
#include <string.h>
-#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include "xchat-plugin.h"
+#include "../../src/common/xchat.h"
static xchat_plugin *ph; /* plugin handle */
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/cfgfiles.c xchat-wdk/src/common/cfgfiles.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/cfgfiles.c 2010-08-07 09:14:45 +0200
2011-01-09 16:46:59 -05:00
+++ xchat-wdk/src/common/cfgfiles.c 2011-01-09 22:15:18 +0100
2010-03-29 17:23:34 -04:00
@@ -17,7 +17,6 @@
*/
#include <fcntl.h>
-#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
2010-08-18 17:20:18 -04:00
@@ -30,10 +29,9 @@
#include "fe.h"
#include "text.h"
2010-05-22 19:51:41 -04:00
#include "xchatc.h"
2010-08-18 17:20:18 -04:00
+#include "portable.h"
2010-05-22 19:51:41 -04:00
2010-08-18 17:20:18 -04:00
-#ifdef WIN32
-#define XCHAT_DIR "X-Chat 2"
-#else
+#ifndef WIN32
2010-05-22 19:51:41 -04:00
#define XCHAT_DIR ".xchat2"
#endif
2010-08-18 17:20:18 -04:00
#define DEF_FONT "Monospace 9"
@@ -308,12 +306,19 @@
2010-05-22 19:51:41 -04:00
{
if (!xdir_fs)
{
2010-08-18 17:20:18 -04:00
- char out[256];
+ if (portable_mode ())
+ {
2010-10-04 22:57:00 -04:00
+ xdir_fs = ".\\config";
2010-08-18 17:20:18 -04:00
+ }
+ else
+ {
+ char out[256];
- if (!get_reg_str ("Software\\Microsoft\\Windows\\CurrentVersion\\"
- "Explorer\\Shell Folders", "AppData", out, sizeof (out)))
- return "./config";
- xdir_fs = g_strdup_printf ("%s\\" XCHAT_DIR, out);
+ if (!get_reg_str ("Software\\Microsoft\\Windows\\CurrentVersion\\"
+ "Explorer\\Shell Folders", "AppData", out, sizeof (out)))
+ return "./config";
+ xdir_fs = g_strdup_printf ("%s\\" "X-Chat 2", out);
+ }
2010-05-22 19:51:41 -04:00
}
return xdir_fs;
}
2010-10-08 22:49:08 -04:00
@@ -393,7 +398,7 @@
{"dcc_blocksize", P_OFFINT (dcc_blocksize), TYPE_INT},
{"dcc_completed_dir", P_OFFSET (dcc_completed_dir), TYPE_STR},
{"dcc_dir", P_OFFSET (dccdir), TYPE_STR},
- {"dcc_fast_send", P_OFFINT (fastdccsend), TYPE_BOOL},
+ /* {"dcc_fast_send", P_OFFINT (fastdccsend), TYPE_BOOL}, */
{"dcc_global_max_get_cps", P_OFFINT (dcc_global_max_get_cps), TYPE_INT},
{"dcc_global_max_send_cps", P_OFFINT (dcc_global_max_send_cps), TYPE_INT},
{"dcc_ip", P_OFFSET (dcc_ip_str), TYPE_STR},
2010-09-19 01:03:29 -04:00
@@ -536,6 +541,7 @@
{"tab_chans", P_OFFINT (tabchannels), TYPE_BOOL},
{"tab_dialogs", P_OFFINT (privmsgtab), TYPE_BOOL},
+ {"tab_icons", P_OFFINT (tab_icons), TYPE_BOOL},
{"tab_layout", P_OFFINT (tab_layout), TYPE_INT},
{"tab_new_to_front", P_OFFINT (newtabstofront), TYPE_INT},
{"tab_notices", P_OFFINT (notices_tabs), TYPE_BOOL},
2011-01-09 16:46:59 -05:00
@@ -546,9 +552,14 @@
2010-09-19 01:03:29 -04:00
{"tab_sort", P_OFFINT (tab_sort), TYPE_BOOL},
{"tab_trunc", P_OFFINT (truncchans), TYPE_INT},
{"tab_utils", P_OFFINT (windows_as_tabs), TYPE_BOOL},
+ {"tab_xp", P_OFFINT (tab_xp), TYPE_BOOL},
2011-01-09 16:46:59 -05:00
+ {"text_auto_copy_text", P_OFFINT (autocopy_text), TYPE_BOOL},
+ {"text_auto_copy_stamp", P_OFFINT (autocopy_stamp), TYPE_BOOL},
+ {"text_auto_copy_color", P_OFFINT (autocopy_color), TYPE_BOOL},
2010-09-19 01:03:29 -04:00
{"text_background", P_OFFSET (background), TYPE_STR},
{"text_color_nicks", P_OFFINT (colorednicks), TYPE_BOOL},
2010-09-17 10:45:10 -04:00
+ {"text_emoticons", P_OFFINT (emoticons), TYPE_BOOL},
2010-09-19 01:03:29 -04:00
{"text_font", P_OFFSET (font_normal), TYPE_STR},
{"text_indent", P_OFFINT (indent_nicks), TYPE_BOOL},
{"text_max_indent", P_OFFINT (max_auto_indent), TYPE_INT},
2011-01-09 16:46:59 -05:00
@@ -561,7 +572,7 @@
2010-09-29 11:14:24 -04:00
{"text_tint_blue", P_OFFINT (tint_blue), TYPE_INT},
{"text_tint_green", P_OFFINT (tint_green), TYPE_INT},
{"text_tint_red", P_OFFINT (tint_red), TYPE_INT},
- {"text_transparent", P_OFFINT (transparent), TYPE_BOOL},
+ /* {"text_transparent", P_OFFINT (transparent), TYPE_BOOL}, */
{"text_wordwrap", P_OFFINT (wordwrap), TYPE_BOOL},
{0, 0, 0},
2011-01-09 16:46:59 -05:00
@@ -624,13 +635,14 @@
2010-10-08 22:49:08 -04:00
prefs.indent_nicks = 1;
prefs.thin_separator = 1;
prefs._tabs_position = 2; /* 2 = left */
- prefs.fastdccsend = 1;
+ /* prefs.fastdccsend = 1; */
prefs.wordwrap = 1;
prefs.autosave = 1;
prefs.autodialog = 1;
2011-01-09 16:46:59 -05:00
prefs.gui_input_spell = 1;
prefs.autoreconnect = 1;
prefs.recon_delay = 10;
+ prefs.autocopy_text = 1;
prefs.text_replay = 1;
prefs.tabchannels = 1;
prefs.tab_layout = 2; /* 0=Tabs 1=Reserved 2=Tree */
@@ -648,6 +660,7 @@
2010-08-13 16:39:25 -04:00
prefs.dialog_height = 256;
prefs.gui_join_dialog = 1;
prefs.gui_quit_dialog = 1;
2010-08-13 19:18:59 -04:00
+ prefs.slist_skip = 1;
2010-08-13 16:39:25 -04:00
prefs.dcctimeout = 180;
prefs.dccstalltimeout = 60;
prefs.notify_timeout = 15;
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/chanopt.c xchat-wdk/src/common/chanopt.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/chanopt.c 2008-06-15 06:40:29 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/chanopt.c 2010-12-28 14:57:32 +0100
2010-03-29 17:23:34 -04:00
@@ -3,7 +3,6 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/ctcp.c xchat-wdk/src/common/ctcp.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/ctcp.c 2010-05-30 04:28:04 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/ctcp.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -18,7 +18,6 @@
#include <stdio.h>
#include <string.h>
-#include <unistd.h>
#include <stdlib.h>
#include "xchat.h"
2010-05-21 15:50:49 -04:00
@@ -134,7 +133,7 @@
2010-03-31 06:44:38 -04:00
if (!strcasecmp (msg, "VERSION") && !prefs.hidever)
{
- snprintf (outbuf, sizeof (outbuf), "VERSION xchat "PACKAGE_VERSION" %s",
2010-10-09 05:41:05 -04:00
+ snprintf (outbuf, sizeof (outbuf), "VERSION XChat-WDK "PACKAGE_VERSION" / %s",
2010-03-31 06:44:38 -04:00
get_cpu_str ());
serv->p_nctcp (serv, nick, outbuf);
}
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/dcc.c xchat-wdk/src/common/dcc.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/dcc.c 2010-05-30 04:28:04 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/dcc.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -31,7 +31,6 @@
#include <time.h>
#include <errno.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <fcntl.h>
#define WANTSOCKET
2010-10-08 23:18:25 -04:00
@@ -57,6 +56,7 @@
#ifdef USE_DCC64
#define BIG_STR_TO_INT(x) strtoull(x,NULL,10)
+#define stat _stat64
#else
#define BIG_STR_TO_INT(x) strtoul(x,NULL,10)
#endif
@@ -1983,9 +1983,7 @@
2010-10-04 23:55:30 -04:00
return TRUE;
2010-03-29 17:23:34 -04:00
/* now handle case-insensitive Filesystems: HFS+, FAT */
2010-10-04 23:55:30 -04:00
-#ifdef WIN32
2010-03-29 17:23:34 -04:00
-#warning no win32 implementation - behaviour may be unreliable
2010-10-04 23:55:30 -04:00
-#else
+#ifndef WIN32
2010-03-29 17:23:34 -04:00
/* this fstat() shouldn't really fail */
if ((dcc->fp == -1 ? stat (dcc->destfile_fs, &st_a) : fstat (dcc->fp, &st_a)) == -1)
2010-10-04 23:55:30 -04:00
return FALSE;
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/ignore.c xchat-wdk/src/common/ignore.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/ignore.c 2006-04-15 09:00:39 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/ignore.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -19,7 +19,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/inbound.c xchat-wdk/src/common/inbound.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/inbound.c 2010-05-30 04:28:04 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/inbound.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -21,7 +21,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
-#include <unistd.h>
#include <time.h>
#define WANTARPA
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/inet.h xchat-wdk/src/common/inet.h
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/inet.h 2005-09-03 12:57:48 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/inet.h 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -24,9 +24,8 @@
#ifdef USE_IPV6
#include <winsock2.h>
#include <ws2tcpip.h>
-#include <tpipv6.h>
#else
-#include <winsock.h>
+#include <winsock2.h>
#endif
#define set_blocking(sok) { \
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/msproxy.c xchat-wdk/src/common/msproxy.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/msproxy.c 2006-04-16 17:32:17 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/msproxy.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -26,7 +26,6 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <unistd.h>
#include <fcntl.h>
#define WANTSOCKET
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/network.c xchat-wdk/src/common/network.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/network.c 2006-04-16 10:11:26 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/network.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -21,7 +21,6 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
-#include <unistd.h>
#include <glib.h>
#include "../../config.h" /* grab USE_IPV6 and LOOKUPD defines */
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/notify.c xchat-wdk/src/common/notify.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/notify.c 2008-06-08 09:58:58 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/notify.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -22,7 +22,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <unistd.h>
#include <time.h>
#include "xchat.h"
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/outbound.c xchat-wdk/src/common/outbound.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/outbound.c 2010-05-30 04:28:04 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/outbound.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -32,7 +32,6 @@
#include <sys/wait.h>
#endif
-#include <unistd.h>
#include <time.h>
#include <signal.h>
#include <sys/stat.h>
2010-08-24 14:03:18 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/plugin-timer.c xchat-wdk/src/common/plugin-timer.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/plugin-timer.c 2005-02-02 11:03:51 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/plugin-timer.c 2010-12-28 14:57:33 +0100
2010-08-24 14:03:18 -04:00
@@ -1,7 +1,7 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h>
-#include "xchat-plugin.h"
2010-11-08 05:15:56 -05:00
+#include "../../plugins/xchat-plugin.h"
2010-08-24 14:03:18 -04:00
#ifdef WIN32
#define strcasecmp stricmp
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/plugin.c xchat-wdk/src/common/plugin.c
2010-12-28 08:47:09 -05:00
--- xchat-wdk.orig/src/common/plugin.c 2010-12-28 03:56:42 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/plugin.c 2010-12-28 14:57:33 +0100
2010-08-24 14:03:18 -04:00
@@ -34,7 +34,7 @@
#include "text.h"
#define PLUGIN_C
typedef struct session xchat_context;
-#include "xchat-plugin.h"
2010-11-08 05:15:56 -05:00
+#include "../../plugins/xchat-plugin.h"
2010-08-24 14:03:18 -04:00
#include "plugin.h"
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/proto-irc.c xchat-wdk/src/common/proto-irc.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/proto-irc.c 2010-05-30 04:28:04 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/proto-irc.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -18,7 +18,6 @@
/* IRC RFC1459(+commonly used extensions) protocol implementation */
-#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/server.c xchat-wdk/src/common/server.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/server.c 2010-05-30 04:28:04 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/server.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -26,7 +26,6 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
2010-11-12 01:17:50 -05:00
@@ -838,33 +837,6 @@
fe_set_throttle (serv);
}
-#ifdef WIN32
-
-static int
-waitline2 (GIOChannel *source, char *buf, int bufsize)
-{
- int i = 0;
- int len;
-
- while (1)
- {
- if (g_io_channel_read (source, &buf[i], 1, &len) != G_IO_ERROR_NONE)
- return -1;
- if (buf[i] == '\n' || bufsize == i + 1)
- {
- buf[i] = 0;
- return i;
- }
- i++;
- }
-}
-
-#else
-
-#define waitline2(source,buf,size) waitline(serv->childread,buf,size,0)
-
-#endif
-
/* connect() successed */
static void
@@ -1388,12 +1360,7 @@
2010-10-04 23:55:30 -04:00
static int
http_read_line (int print_fd, int sok, char *buf, int len)
2010-08-10 20:12:56 -04:00
{
2010-10-04 23:55:30 -04:00
-#ifdef WIN32
- /* make sure waitline() uses recv() or it'll fail on win32 */
2010-08-10 20:12:56 -04:00
- len = waitline (sok, buf, len, FALSE);
2010-10-04 23:55:30 -04:00
-#else
2010-08-10 20:12:56 -04:00
len = waitline (sok, buf, len, TRUE);
2010-10-04 23:55:30 -04:00
-#endif
if (len >= 1)
{
/* print the message out (send it to the parent process) */
2010-11-12 01:17:50 -05:00
@@ -1738,7 +1705,7 @@
2010-03-29 17:23:34 -04:00
}
2010-08-10 20:12:56 -04:00
#endif
serv->childpid = pid;
- serv->iotag = fe_input_add (serv->childread, FIA_READ, server_read_child,
+ serv->iotag = fe_input_add (serv->childread, FIA_READ|FIA_FD, server_read_child,
serv);
2010-03-29 17:23:34 -04:00
}
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/servlist.c xchat-wdk/src/common/servlist.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/servlist.c 2010-05-16 09:43:49 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/servlist.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -21,7 +21,6 @@
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#include "xchat.h"
#include <glib/ghash.h>
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/ssl.c xchat-wdk/src/common/ssl.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/ssl.c 2007-03-28 10:35:06 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/ssl.c 2010-12-28 14:57:33 +0100
2010-08-11 19:08:52 -04:00
@@ -17,12 +17,12 @@
2010-03-29 23:04:15 -04:00
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
2010-08-11 19:08:52 -04:00
+#include "inet.h" /* make it first to avoid macro redefinitions */
2010-03-29 23:04:15 -04:00
#include <openssl/ssl.h> /* SSL_() */
#include <openssl/err.h> /* ERR_() */
#include <time.h> /* asctime() */
2010-08-11 19:08:52 -04:00
#include <string.h> /* strncpy() */
#include "ssl.h" /* struct cert_info */
-#include "inet.h"
#include "../../config.h" /* HAVE_SNPRINTF */
#ifndef HAVE_SNPRINTF
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/text.c xchat-wdk/src/common/text.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/text.c 2010-05-30 04:28:04 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/text.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -19,13 +19,11 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <unistd.h>
#include <ctype.h>
#include <time.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
-#include <sys/mman.h>
#include "xchat.h"
#include <glib/ghash.h>
2010-09-18 19:36:37 -04:00
@@ -271,9 +269,6 @@
char *text;
time_t stamp;
int lines;
- char *map, *end_map;
- struct stat statbuf;
- const char *begin, *eol;
2010-03-29 17:23:34 -04:00
if (sess->text_scrollback == SET_DEFAULT)
{
2010-09-18 19:36:37 -04:00
@@ -293,32 +288,9 @@
if (fh == -1)
2010-03-29 17:23:34 -04:00
return;
2010-09-18 19:36:37 -04:00
- if (fstat (fh, &statbuf) < 0)
- return;
-
- map = mmap (NULL, statbuf.st_size, PROT_READ, MAP_PRIVATE, fh, 0);
- if (map == MAP_FAILED)
- return;
-
- end_map = map + statbuf.st_size;
-
lines = 0;
- begin = map;
- while (begin < end_map)
+ while (waitline (fh, buf, sizeof buf, FALSE) != -1)
{
- int n_bytes;
-
- eol = memchr (begin, '\n', end_map - begin);
-
- if (!eol)
- eol = end_map;
-
- n_bytes = MIN (eol - begin, sizeof (buf) - 1);
-
- strncpy (buf, begin, n_bytes);
-
- buf[n_bytes] = 0;
-
if (buf[0] == 'T')
{
if (sizeof (time_t) == 4)
@@ -334,8 +306,6 @@
}
lines++;
}
-
- begin = eol + 1;
}
2010-03-29 17:23:34 -04:00
2010-09-18 19:36:37 -04:00
sess->scrollwritten = lines;
@@ -349,7 +319,6 @@
2010-03-29 17:23:34 -04:00
/*EMIT_SIGNAL (XP_TE_GENMSG, sess, "*", buf, NULL, NULL, NULL, 0);*/
}
2010-09-18 19:36:37 -04:00
- munmap (map, statbuf.st_size);
2010-03-29 17:23:34 -04:00
close (fh);
}
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/util.c xchat-wdk/src/common/util.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/util.c 2008-02-07 02:50:37 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/util.c 2010-12-28 14:57:33 +0100
2010-08-11 19:08:52 -04:00
@@ -16,11 +16,13 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
2010-03-29 17:23:34 -04:00
*/
2010-08-11 19:08:52 -04:00
+#define WANTSOCKET
+#include "inet.h" /* make it first to avoid macro redefinitions */
+
2010-03-29 17:23:34 -04:00
#define __APPLE_API_STRICT_CONFORMANCE
#define _FILE_OFFSET_BITS 64
#include <stdio.h>
-#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
2010-08-11 19:08:52 -04:00
@@ -35,7 +37,7 @@
2010-03-29 17:23:34 -04:00
#include <sys/utsname.h>
#endif
#include <fcntl.h>
-#include <dirent.h>
+#include "dirent.h"
#include <errno.h>
#include "xchat.h"
#include "xchatc.h"
2010-08-11 19:08:52 -04:00
@@ -44,9 +46,6 @@
#include "util.h"
#include "../../config.h"
-#define WANTSOCKET
-#include "inet.h"
-
#if defined (USING_FREEBSD) || defined (__APPLE__)
#include <sys/sysctl.h>
#endif
@@ -54,9 +53,11 @@
2010-03-29 23:04:15 -04:00
#include <socks.h>
#endif
+#ifndef ENABLE_NLS
#ifndef HAVE_SNPRINTF
#define snprintf g_snprintf
#endif
+#endif
#ifdef USE_DEBUG
2010-11-12 01:17:50 -05:00
@@ -383,6 +384,28 @@
}
}
+#ifdef WIN32
2010-11-12 02:05:57 -05:00
+/* waitline2 using win32 file descriptor and glib instead of _read. win32 can't _read() sok! */
2010-11-12 01:17:50 -05:00
+int
+waitline2 (GIOChannel *source, char *buf, int bufsize)
+{
+ int i = 0;
+ int len;
+
+ while (1)
+ {
+ if (g_io_channel_read (source, &buf[i], 1, &len) != G_IO_ERROR_NONE)
+ return -1;
+ if (buf[i] == '\n' || bufsize == i + 1)
+ {
+ buf[i] = 0;
+ return i;
+ }
+ i++;
+ }
+}
+#endif
+
/* checks for "~" in a file and expands */
char *
@@ -628,26 +651,79 @@
2010-10-09 04:55:05 -04:00
get_cpu_str (void)
{
static char verbuf[64];
- OSVERSIONINFO osvi;
2010-10-09 05:13:40 -04:00
- SYSTEM_INFO si;
+ static char winver[20];
2010-10-09 04:55:05 -04:00
+ OSVERSIONINFOEX osvi;
2010-03-29 17:23:34 -04:00
double mhz;
2010-10-09 04:55:05 -04:00
- osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
+ osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEX);
2010-03-29 17:23:34 -04:00
GetVersionEx (&osvi);
2010-10-09 05:13:40 -04:00
- GetSystemInfo (&si);
+
2010-10-09 04:55:05 -04:00
+ switch (osvi.dwMajorVersion)
2010-03-29 17:23:34 -04:00
+ {
2010-10-09 04:55:05 -04:00
+ case 5:
+ switch (osvi.dwMinorVersion)
+ {
+ case 1:
+ strcpy (winver, "XP");
+ break;
+ case 2:
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ {
+ strcpy (winver, "XP x64 Edition");
+ }
+ else
+ {
+ if (GetSystemMetrics(SM_SERVERR2) == 0)
+ {
+ strcpy (winver, "Server 2003");
+ }
+ else
+ {
+ strcpy (winver, "Server 2003 R2");
+ }
+ }
+ break;
+ }
+ break;
+ case 6:
+ switch (osvi.dwMinorVersion)
+ {
+ case 0:
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ {
+ strcpy (winver, "Vista");
+ }
+ else
+ {
+ strcpy (winver, "Server 2008");
+ }
+ break;
+ case 1:
+ if (osvi.wProductType == VER_NT_WORKSTATION)
+ {
+ strcpy (winver, "7");
+ }
+ else
+ {
+ strcpy (winver, "Server 2008 R2");
+ }
+ break;
+ }
+ break;
2010-03-29 17:23:34 -04:00
+ }
2010-10-09 05:13:40 -04:00
2010-03-29 17:23:34 -04:00
mhz = get_mhz ();
if (mhz)
{
double cpuspeed = ( mhz > 1000 ) ? mhz / 1000 : mhz;
const char *cpuspeedstr = ( mhz > 1000 ) ? "GHz" : "MHz";
- sprintf (verbuf, "Windows %ld.%ld [i%d86/%.2f%s]",
- osvi.dwMajorVersion, osvi.dwMinorVersion, si.wProcessorLevel,
2010-10-09 04:55:05 -04:00
- cpuspeed, cpuspeedstr);
- } else
2010-03-29 17:23:34 -04:00
- sprintf (verbuf, "Windows %ld.%ld [i%d86]",
- osvi.dwMajorVersion, osvi.dwMinorVersion, si.wProcessorLevel);
2010-10-09 04:55:05 -04:00
-
2010-10-09 05:13:40 -04:00
+ sprintf (verbuf, "Windows %s [%.2f%s]", winver, cpuspeed, cpuspeedstr);
2010-10-09 04:55:05 -04:00
+ }
+ else
+ {
2010-10-09 05:13:40 -04:00
+ sprintf (verbuf, "Windows %s", winver);
2010-10-09 04:55:05 -04:00
+ }
+
2010-03-29 17:23:34 -04:00
return verbuf;
}
2010-10-09 04:55:05 -04:00
2010-11-12 01:17:50 -05:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/util.h xchat-wdk/src/common/util.h
--- xchat-wdk.orig/src/common/util.h 2008-02-07 02:50:37 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/util.h 2010-12-28 14:57:33 +0100
2010-11-12 01:17:50 -05:00
@@ -43,6 +43,11 @@
int strip_hidden_attribute (char *src, char *dst);
char *errorstring (int err);
int waitline (int sok, char *buf, int bufsize, int);
+#ifdef WIN32
+int waitline2 (GIOChannel *source, char *buf, int bufsize);
+#else
+#define waitline2(source,buf,size) waitline(serv->childread,buf,size,0)
+#endif
unsigned long make_ping_time (void);
void move_file_utf8 (char *src_dir, char *dst_dir, char *fname, int dccpermissions);
int mkdir_utf8 (char *dir);
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/xchat.c xchat-wdk/src/common/xchat.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/xchat.c 2008-06-08 09:58:58 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/common/xchat.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -22,7 +22,6 @@
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#define WANTSOCKET
#include "inet.h"
2010-08-24 14:03:18 -04:00
@@ -38,7 +37,7 @@
#include "cfgfiles.h"
#include "chanopt.h"
#include "ignore.h"
-#include "xchat-plugin.h"
2010-11-08 05:15:56 -05:00
+#include "../../plugins/xchat-plugin.h"
2010-08-24 14:03:18 -04:00
#include "plugin.h"
#include "plugin-timer.h"
#include "notify.h"
2010-09-18 23:46:50 -04:00
@@ -583,6 +582,7 @@
2010-09-07 09:15:47 -04:00
"NAME DMSG\n" "CMD msg =%2 &3\n\n"\
"NAME EXIT\n" "CMD quit\n\n"\
2010-09-18 23:46:50 -04:00
"NAME GREP\n" "CMD lastlog -r &2\n\n"\
2010-09-07 09:15:47 -04:00
+ "NAME IGNALL\n" "CMD ignore %2!*@* ALL\n\n"\
"NAME J\n" "CMD join &2\n\n"\
"NAME KILL\n" "CMD quote KILL %2 :&3\n\n"\
"NAME LEAVE\n" "CMD part &2\n\n"\
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/xchat.h xchat-wdk/src/common/xchat.h
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/common/xchat.h 2010-08-07 09:14:45 +0200
2011-01-09 16:46:59 -05:00
+++ xchat-wdk/src/common/xchat.h 2011-01-09 22:15:02 +0100
2010-03-29 23:04:15 -04:00
@@ -12,12 +12,14 @@
#include "history.h"
+#ifndef ENABLE_NLS
#ifndef HAVE_SNPRINTF
#define snprintf g_snprintf
2010-03-29 17:23:34 -04:00
#endif
#ifndef HAVE_VSNPRINTF
-#define vsnprintf g_vsnprintf
+#define vsnprintf _vsnprintf
2010-03-29 23:04:15 -04:00
+#endif
2010-03-29 17:23:34 -04:00
#endif
#ifdef USE_DEBUG
2010-03-29 23:04:15 -04:00
@@ -58,7 +60,7 @@
2010-03-29 17:23:34 -04:00
#ifdef WIN32 /* for win32 */
#define OFLAGS O_BINARY
-#define sleep(t) _sleep(t*1000)
+#define sleep(t) Sleep(t*1000)
#include <direct.h>
#define F_OK 0
#define X_OK 1
2011-01-09 16:46:59 -05:00
@@ -209,6 +211,9 @@
unsigned int wallops;
unsigned int skipmotd;
unsigned int autorejoin;
+ unsigned int autocopy_text;
+ unsigned int autocopy_stamp;
+ unsigned int autocopy_color;
unsigned int colorednicks;
unsigned int chanmodebuttons;
unsigned int userlistbuttons;
@@ -297,6 +302,9 @@
2010-09-17 10:45:10 -04:00
unsigned int confmode;
unsigned int utf8_locale;
unsigned int identd;
+ unsigned int emoticons;
2010-09-19 01:03:29 -04:00
+ unsigned int tab_icons;
+ unsigned int tab_xp;
2010-09-17 10:45:10 -04:00
unsigned int ctcp_number_limit; /*flood */
unsigned int ctcp_time_limit; /*seconds of floods */
2010-04-03 22:06:25 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/about.c xchat-wdk/src/fe-gtk/about.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/about.c 2010-05-16 09:43:49 +0200
2010-12-29 11:28:47 -05:00
+++ xchat-wdk/src/fe-gtk/about.c 2010-12-29 17:28:03 +0100
2010-08-30 06:43:50 -04:00
@@ -39,6 +39,7 @@
2010-08-18 17:20:18 -04:00
#include "../common/xchat.h"
#include "../common/util.h"
+#include "../common/portable.h"
#include "palette.h"
#include "pixmaps.h"
#include "gtkutil.h"
2010-10-09 05:13:40 -04:00
@@ -87,6 +88,19 @@
char buf[512];
const char *locale = NULL;
extern GtkWindow *parent_window; /* maingui.c */
+ SYSTEM_INFO si;
+ unsigned short int cpu_arch;
+
+ GetSystemInfo (&si);
+
+ if (si.wProcessorArchitecture == 9)
+ {
+ cpu_arch = 64;
+ }
+ else
+ {
+ cpu_arch = 86;
+ }
if (about)
{
@@ -95,7 +109,7 @@
2010-09-19 10:14:11 -04:00
}
about = gtk_dialog_new ();
- gtk_window_set_position (GTK_WINDOW (about), GTK_WIN_POS_CENTER);
+ gtk_window_set_position (GTK_WINDOW (about), GTK_WIN_POS_CENTER_ON_PARENT);
gtk_window_set_resizable (GTK_WINDOW (about), FALSE);
gtk_window_set_title (GTK_WINDOW (about), _("About "DISPLAY_NAME));
if (parent_window)
2010-12-29 11:28:47 -05:00
@@ -114,35 +128,42 @@
2010-08-30 04:08:17 -04:00
g_get_charset (&locale);
(snprintf) (buf, sizeof (buf),
2010-12-29 11:28:47 -05:00
"<span size=\"x-large\"><b>"DISPLAY_NAME" "PACKAGE_VERSION"</b></span>\n\n"
2010-08-30 04:08:17 -04:00
- "%s\n\n"
2010-04-03 22:06:25 -04:00
#ifdef WIN32
2010-08-30 04:23:08 -04:00
- /* leave this message to avoid time wasting bug reports! */
2010-04-03 22:06:25 -04:00
- "This version is unofficial and comes with no support.\n\n"
2010-08-30 04:08:17 -04:00
-#endif
2010-10-09 05:13:40 -04:00
- "%s\n"
2010-08-30 04:23:08 -04:00
+ "<b>XChat Base</b>: 2.8.8\n\n"
2010-10-09 05:13:40 -04:00
+ "<b>OS</b>: %s\n"
2010-04-03 22:06:25 -04:00
"<b>Charset</b>: %s "
2010-08-30 04:08:17 -04:00
-#ifdef WIN32
"<b>GTK+</b>: %i.%i.%i\n"
2010-08-18 17:20:18 -04:00
+ "<b>Compiled</b>: "__DATE__"\n"
2010-10-09 05:13:40 -04:00
+ "<b>Portable Mode</b>: %s\n"
+ "<b>Build Type</b>: x%d\n\n"
2010-08-30 04:23:08 -04:00
+ "<small>This version is unofficial and comes with no support.\n"
2010-10-20 15:38:38 -04:00
+ "\302\251 1998-2010 Peter \305\275elezn\303\275 <zed@xchat.org>"
+ /* "\n<a href=\"http://code.google.com/p/xchat-wdk/\">http://code.google.com/p/xchat-wdk/</a>" this is broken in gtk ATM */
+ "</small>",
2010-08-30 06:20:50 -04:00
+ get_cpu_str (),
2010-08-30 04:08:17 -04:00
+ locale,
+ gtk_major_version,
+ gtk_minor_version,
+ gtk_micro_version,
2010-10-09 05:13:40 -04:00
+ (portable_mode () ? "Yes" : "No"),
+ cpu_arch
2010-08-30 04:08:17 -04:00
#else
+ "%s\n\n"
+ "%s\n"
+ "<b>Charset</b>: %s "
"<b>Renderer</b>: %s\n"
-#endif
"<b>Compiled</b>: "__DATE__"\n\n"
2010-05-30 05:12:00 -04:00
"<small>\302\251 1998-2010 Peter \305\275elezn\303\275 <zed@xchat.org></small>",
2010-08-30 04:08:17 -04:00
- _("A multiplatform IRC Client"),
- get_cpu_str(),
- locale,
-#ifdef WIN32
- gtk_major_version,
- gtk_minor_version,
2010-08-18 17:20:18 -04:00
- gtk_micro_version
2010-08-30 04:08:17 -04:00
-#else
+ _("A multiplatform IRC Client"),
2010-08-30 06:20:50 -04:00
+ get_cpu_str (),
2010-08-30 04:08:17 -04:00
+ locale,
2010-08-18 17:20:18 -04:00
#ifdef USE_XFT
2010-08-30 04:08:17 -04:00
- "Xft"
+ "Xft"
#else
- "Pango"
+ "Pango"
#endif
#endif
- );
+ );
gtk_label_set_markup (GTK_LABEL (label), buf);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER);
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/banlist.c xchat-wdk/src/fe-gtk/banlist.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/banlist.c 2010-05-16 05:20:22 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/banlist.c 2010-12-28 14:57:33 +0100
2010-05-21 15:50:49 -04:00
@@ -19,7 +19,6 @@
2010-03-29 17:23:34 -04:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <fcntl.h>
#include <time.h>
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/chanlist.c xchat-wdk/src/fe-gtk/chanlist.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/chanlist.c 2008-02-24 04:46:02 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/chanlist.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -19,7 +19,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <fcntl.h>
#include <time.h>
2010-09-29 15:57:26 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/chanview-tabs.c xchat-wdk/src/fe-gtk/chanview-tabs.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/chanview-tabs.c 2005-11-21 06:25:39 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/chanview-tabs.c 2010-12-28 14:57:33 +0100
2010-09-29 15:57:26 -04:00
@@ -144,8 +144,8 @@
for (i = adj->value; ((i > new_value) && (tab_left_is_moving)); i -= 0.1)
{
gtk_adjustment_set_value (adj, i);
- while (g_main_pending ())
- g_main_iteration (TRUE);
+ while (g_main_context_pending (NULL))
+ g_main_context_iteration (NULL, TRUE);
}
gtk_adjustment_set_value (adj, new_value);
@@ -191,8 +191,8 @@
for (i = adj->value; ((i < new_value) && (tab_right_is_moving)); i += 0.1)
{
gtk_adjustment_set_value (adj, i);
- while (g_main_pending ())
- g_main_iteration (TRUE);
+ while (g_main_context_pending (NULL))
+ g_main_context_iteration (NULL, TRUE);
}
gtk_adjustment_set_value (adj, new_value);
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/editlist.c xchat-wdk/src/fe-gtk/editlist.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/editlist.c 2006-03-13 09:33:45 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/editlist.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -19,7 +19,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/fe-gtk.c xchat-wdk/src/fe-gtk/fe-gtk.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/fe-gtk.c 2010-08-14 03:46:21 +0200
2011-01-08 03:56:33 -05:00
+++ xchat-wdk/src/fe-gtk/fe-gtk.c 2011-01-08 09:54:34 +0100
2010-05-21 15:50:49 -04:00
@@ -19,7 +19,6 @@
2010-03-29 17:23:34 -04:00
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <unistd.h>
#include "fe-gtk.h"
2010-05-21 15:50:49 -04:00
@@ -32,6 +31,8 @@
2010-03-29 17:23:34 -04:00
#include <gtk/gtkmessagedialog.h>
#include <gtk/gtkversion.h>
+#include <gdk/gdkwin32.h>
+
#include "../common/xchat.h"
#include "../common/fe.h"
#include "../common/util.h"
2010-05-21 15:50:49 -04:00
@@ -39,6 +40,7 @@
2010-03-29 17:23:34 -04:00
#include "../common/cfgfiles.h"
#include "../common/xchatc.h"
#include "../common/plugin.h"
+#include "../common/server.h"
#include "gtkutil.h"
#include "maingui.h"
#include "pixmaps.h"
2011-01-08 03:56:33 -05:00
@@ -136,11 +138,26 @@
{NULL}
};
+#ifdef WIN32
+static void
+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);
+ gtk_window_set_title (GTK_WINDOW (dialog), title);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+}
+#endif
+
int
fe_args (int argc, char *argv[])
2010-12-30 23:07:44 -05:00
{
GError *error = NULL;
GOptionContext *context;
+#ifdef WIN32
2011-01-08 03:56:33 -05:00
+ char *buffer[2048];
2010-12-30 23:07:44 -05:00
+#endif
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
2011-01-08 03:56:33 -05:00
@@ -149,22 +166,67 @@
#endif
context = g_option_context_new (NULL);
2010-12-30 23:07:44 -05:00
+#ifdef WIN32
2011-01-08 03:56:33 -05:00
+ g_option_context_set_help_enabled (context, FALSE); /* disable stdout help as stdout is unavailable for subsystem:windows */
+#endif
g_option_context_add_main_entries (context, gopt_entries, GETTEXT_PACKAGE);
g_option_context_add_group (context, gtk_get_option_group (FALSE));
g_option_context_parse (context, &argc, &argv, &error);
+#ifdef WIN32
+ if (error) /* workaround for argv not being available when using subsystem:windows */
+ {
+ if (error->message) /* the error message contains argv so search for patterns in that */
+ {
+ if (strstr (error->message, "--help-all") != NULL)
+ {
+ if (snprintf (buffer, 2048, g_option_context_get_help (context, FALSE, NULL)))
+ {
+ gtk_init (&argc, &argv);
+ create_msg_dialog ("Long Help", buffer);
+ }
+ return 0;
+ } else if (strstr (error->message, "--help") != NULL || strstr (error->message, "-?") != NULL)
2010-12-30 23:07:44 -05:00
+ {
2011-01-08 03:56:33 -05:00
+ if (snprintf (buffer, 2048, g_option_context_get_help (context, TRUE, NULL)))
+ {
+ gtk_init (&argc, &argv);
+ create_msg_dialog ("Help", buffer);
+ }
+ return 0;
+ } else
+ {
+ if (snprintf (buffer, 2048, "%s\n", error->message))
+ {
+ gtk_init (&argc, &argv);
+ create_msg_dialog ("Error", buffer);
+ }
+ return 1;
2010-12-30 23:07:44 -05:00
+ }
2011-01-08 03:56:33 -05:00
+ }
+ }
2010-12-30 23:07:44 -05:00
+#else
2011-01-08 03:56:33 -05:00
if (error)
{
if (error->message)
2010-12-30 23:07:44 -05:00
printf ("%s\n", error->message);
return 1;
}
2011-01-08 03:56:33 -05:00
+#endif
2010-12-30 23:07:44 -05:00
2011-01-08 03:56:33 -05:00
g_option_context_free (context);
2010-12-30 23:07:44 -05:00
if (arg_show_version)
{
+#ifdef WIN32
2011-01-08 03:56:33 -05:00
+ if (snprintf (buffer, 2048, DISPLAY_NAME" "PACKAGE_VERSION"\n"))
2010-12-30 23:07:44 -05:00
+ {
2011-01-08 03:56:33 -05:00
+ gtk_init (&argc, &argv);
+ create_msg_dialog ("Version Information", buffer);
2010-12-30 23:07:44 -05:00
+ }
+#else
printf (PACKAGE_TARNAME" "PACKAGE_VERSION"\n");
+#endif
return 0;
}
2011-01-08 03:56:33 -05:00
@@ -177,7 +239,18 @@
2010-12-30 23:07:44 -05:00
if (sl)
{
*sl = 0;
- printf ("%s\\plugins\n", exe);
2011-01-08 03:56:33 -05:00
+ if (snprintf (buffer, 2048, "%s\\plugins\n", exe))
2010-12-30 23:07:44 -05:00
+ {
2011-01-08 03:56:33 -05:00
+ gtk_init (&argc, &argv);
+ create_msg_dialog ("Plugin Auto-load Directory", buffer);
2010-12-30 23:07:44 -05:00
+ }
+ } else
+ {
2011-01-08 03:56:33 -05:00
+ if (snprintf (buffer, 2048, ".\\plugins\n"))
2010-12-30 23:07:44 -05:00
+ {
2011-01-08 03:56:33 -05:00
+ gtk_init (&argc, &argv);
+ create_msg_dialog ("Plugin Auto-load Directory", buffer);
2010-12-30 23:07:44 -05:00
+ }
}
#else
printf ("%s\n", XCHATLIBDIR"/plugins");
2011-01-08 03:56:33 -05:00
@@ -187,7 +260,15 @@
2010-12-30 23:07:44 -05:00
if (arg_show_config)
{
+#ifdef WIN32
2011-01-08 03:56:33 -05:00
+ if (snprintf (buffer, 2048, "%s\n", get_xdir_fs ()))
2010-12-30 23:07:44 -05:00
+ {
2011-01-08 03:56:33 -05:00
+ gtk_init (&argc, &argv);
+ create_msg_dialog ("User Config Directory", buffer);
2010-12-30 23:07:44 -05:00
+ }
+#else
printf ("%s\n", get_xdir_fs ());
+#endif
return 0;
}
2011-01-08 03:56:33 -05:00
@@ -330,7 +411,7 @@
2010-08-17 00:26:01 -04:00
{
session *sess;
- if (getenv ("XCHAT_WARNING_IGNORE"))
+ /* if (getenv ("XCHAT_WARNING_IGNORE")) */
return;
sess = find_dialog (serv_list->data, "(warnings)");
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/fe-gtk.h xchat-wdk/src/fe-gtk/fe-gtk.h
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/fe-gtk.h 2010-05-30 08:31:29 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/fe-gtk.h 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -4,7 +4,7 @@
/* If you're compiling this for Windows, your release is un-official
2010-05-30 05:04:01 -04:00
* and not condoned. Please don't use the XChat name. Make up your
* own name! */
-#define DISPLAY_NAME "XChat-Unofficial"
2010-03-29 17:23:34 -04:00
+#define DISPLAY_NAME "XChat-WDK"
#else
#define DISPLAY_NAME "XChat"
#endif
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/fkeys.c xchat-wdk/src/fe-gtk/fkeys.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/fkeys.c 2008-02-24 06:09:34 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/fkeys.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -20,7 +20,6 @@
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <ctype.h>
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/gtkutil.c xchat-wdk/src/fe-gtk/gtkutil.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/gtkutil.c 2009-07-18 14:38:10 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/gtkutil.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -22,7 +22,6 @@
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <fcntl.h>
#include "fe-gtk.h"
2010-10-09 06:51:46 -04:00
@@ -51,6 +50,10 @@
#include "../common/util.h"
#include "gtkutil.h"
#include "pixmaps.h"
+#ifdef WIN32
+#include "../common/fe.h"
+#include "../common/thread.h"
+#endif
/* gtkutil.c, just some gtk wrappers */
@@ -63,6 +66,13 @@
void *userdata;
filereqcallback callback;
int flags; /* FRF_* flags */
+
+#ifdef WIN32
2010-10-09 09:29:59 -04:00
+ int multiple;
+ thread *th;
+ char *title; /* native locale */
+ char *filter;
2010-10-09 06:51:46 -04:00
+#endif
};
static char last_dir[256] = "";
2010-11-12 01:17:50 -05:00
@@ -164,6 +174,190 @@
2010-10-09 06:51:46 -04:00
}
}
+#ifdef WIN32
+static int
+win32_openfile (char *file_buf, int file_buf_len, char *title_text, char *filter,
+ int multiple)
+{
+ OPENFILENAME o;
+
+ memset (&o, 0, sizeof (o));
+
+ o.lStructSize = sizeof (o);
+ o.lpstrFilter = filter;
+ o.lpstrFile = file_buf;
+ o.nMaxFile = file_buf_len;
+ o.lpstrTitle = title_text;
+ o.Flags = 0x02000000 | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY |
2010-10-09 09:29:59 -04:00
+ OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_LONGNAMES | OFN_NONETWORKBUTTON;
2010-10-09 06:51:46 -04:00
+ if (multiple)
2010-10-09 09:29:59 -04:00
+ {
2010-10-09 06:51:46 -04:00
+ o.Flags |= OFN_ALLOWMULTISELECT;
2010-10-09 09:29:59 -04:00
+ }
2010-10-09 06:51:46 -04:00
+
+ return GetOpenFileName (&o);
+}
+
+static int
+win32_savefile (char *file_buf, int file_buf_len, char *title_text, char *filter,
+ int multiple)
+{
2010-10-09 09:21:43 -04:00
+ /* we need the filter to get the default filename. it is from fe-gtk.c (fe_confirm);
+ * but that filter is actually the whole filename, so apply an empty filter and all good.
+ * in win32_thread2 we copy the filter ( = the filename) after the last dir into our
+ * LPTSTR file buffer to make it actually work. the docs for this amazingly retard api:
+ *
+ * http://msdn.microsoft.com/en-us/library/ms646839%28VS.85%29.aspx
+ */
+
2010-10-09 09:29:59 -04:00
+ OPENFILENAME o;
2010-10-09 06:51:46 -04:00
+
2010-10-09 09:29:59 -04:00
+ memset (&o, 0, sizeof (o));
2010-10-09 06:51:46 -04:00
+
2010-10-09 09:29:59 -04:00
+ o.lStructSize = sizeof (o);
+ o.lpstrFilter = "All files\0*.*\0\0";
+ o.lpstrFile = file_buf;
+ o.nMaxFile = file_buf_len;
+ o.lpstrTitle = title_text;
+ o.Flags = 0x02000000 | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY |
+ OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_LONGNAMES | OFN_NONETWORKBUTTON;
+ if (multiple)
+ {
+ o.Flags |= OFN_ALLOWMULTISELECT;
+ }
2010-10-09 06:51:46 -04:00
+
2010-10-09 09:29:59 -04:00
+ return GetSaveFileName (&o);
2010-10-09 06:51:46 -04:00
+}
+
+static void *
+win32_thread (struct file_req *freq)
+{
+ char buf[1024 + 32];
+ char file[1024];
+
+ memset (file, 0, sizeof (file));
+ safe_strcpy (file, last_dir, sizeof (file));
+
+ if (win32_openfile (file, sizeof (file), freq->title, freq->filter, freq->multiple))
+ {
+ if (freq->multiple)
+ {
+ char *f = file;
+
+ if (f[strlen (f) + 1] == 0) /* only selected one file */
+ {
+ snprintf (buf, sizeof (buf), "1\n%s\n", file);
+ write (freq->th->pipe_fd[1], buf, strlen (buf));
+ } else
+ {
+ f += strlen (f) + 1; /* skip first, it's only the dir */
+ while (f[0])
+ {
+ snprintf (buf, sizeof (buf), "1\n%s\\%s\n", /*dir!*/file, f);
+ write (freq->th->pipe_fd[1], buf, strlen (buf));
+ f += strlen (f) + 1;
+ }
+ }
+
+ } else
+ {
+ snprintf (buf, sizeof (buf), "1\n%s\n", file);
+ write (freq->th->pipe_fd[1], buf, strlen (buf));
+ }
+ }
+
+ write (freq->th->pipe_fd[1], "0\n", 2);
+ Sleep (2000);
+
+ return NULL;
+}
+
+static void *
+win32_thread2 (struct file_req *freq)
+{
2010-10-09 09:21:43 -04:00
+ char buf[1024 + 32];
+ char file[1024];
2010-10-09 06:51:46 -04:00
+
2010-10-09 09:21:43 -04:00
+ memset (file, 0, sizeof (file));
+ safe_strcpy (file, last_dir, sizeof (file));
+ safe_strcpy (file, freq->filter, sizeof (file));
2010-10-09 06:51:46 -04:00
+
2010-10-09 09:21:43 -04:00
+ if (win32_savefile (file, sizeof (file), freq->title, NULL, freq->multiple))
+ {
+ if (freq->multiple)
+ {
+ char *f = file;
2010-10-09 06:51:46 -04:00
+
2010-10-09 09:21:43 -04:00
+ if (f[strlen (f) + 1] == 0) /* only selected one file */
+ {
+ snprintf (buf, sizeof (buf), "1\n%s\n", file);
+ write (freq->th->pipe_fd[1], buf, strlen (buf));
+ } else
+ {
+ f += strlen (f) + 1; /* skip first, it's only the dir */
+ while (f[0])
+ {
+ snprintf (buf, sizeof (buf), "1\n%s\\%s\n", /*dir!*/file, f);
+ write (freq->th->pipe_fd[1], buf, strlen (buf));
+ f += strlen (f) + 1;
+ }
+ }
2010-10-09 06:51:46 -04:00
+
2010-10-09 09:21:43 -04:00
+ } else
+ {
+ snprintf (buf, sizeof (buf), "1\n%s\n", file);
+ write (freq->th->pipe_fd[1], buf, strlen (buf));
+ }
+ }
2010-10-09 06:51:46 -04:00
+
2010-10-09 09:21:43 -04:00
+ write (freq->th->pipe_fd[1], "0\n", 2);
+ Sleep (2000);
2010-10-09 06:51:46 -04:00
+
2010-10-09 09:21:43 -04:00
+ return NULL;
2010-10-09 06:51:46 -04:00
+}
+
+static gboolean
+win32_close_pipe (int fd)
+{
+ close (fd);
+ return 0;
+}
+
+static gboolean
+win32_read_thread (GIOChannel *source, GIOCondition cond, struct file_req *freq)
+{
+ char buf[512];
+ char *file;
+
+ waitline2 (source, buf, sizeof buf);
+
+ switch (buf[0])
+ {
+ case '0': /* filedialog has closed */
+ freq->callback (freq->userdata, NULL);
+ break;
+
+ case '1': /* got a filename! */
+ waitline2 (source, buf, sizeof buf);
+ file = g_filename_to_utf8 (buf, -1, 0, 0, 0);
+ freq->callback (freq->userdata, file);
+ g_free (file);
+ return TRUE;
+ }
+
+ /* it doesn't work to close them here, because of the weird
+ way giowin32 works. We must _return_ before closing them */
+ g_timeout_add(3000, (GSourceFunc)win32_close_pipe, freq->th->pipe_fd[0]);
+ g_timeout_add(2000, (GSourceFunc)win32_close_pipe, freq->th->pipe_fd[1]);
+
+ g_free (freq->title);
+ free (freq->th);
+ free (freq);
+
+ return FALSE;
+}
+#endif
+
void
gtkutil_file_req (const char *title, void *callback, void *userdata, char *filter,
int flags)
2010-11-12 01:17:50 -05:00
@@ -172,6 +366,58 @@
2010-10-09 06:51:46 -04:00
GtkWidget *dialog;
extern char *get_xdir_fs (void);
+#ifdef WIN32
+ if (!(flags & FRF_WRITE))
+ {
+ freq = malloc (sizeof (struct file_req));
+ freq->th = thread_new ();
+ freq->flags = 0;
+ freq->multiple = (flags & FRF_MULTIPLE);
+ freq->callback = callback;
+ freq->userdata = userdata;
+ freq->title = g_locale_from_utf8 (title, -1, 0, 0, 0);
+ if (!filter)
2010-10-09 09:21:43 -04:00
+ {
+ freq->filter = "All files\0*.*\0"
+ "Executables\0*.exe\0"
+ "ZIP files\0*.zip\0\0";
+ }
2010-10-09 06:51:46 -04:00
+ else
2010-10-09 09:21:43 -04:00
+ {
2010-10-09 06:51:46 -04:00
+ freq->filter = filter;
2010-10-09 09:21:43 -04:00
+ }
2010-10-09 06:51:46 -04:00
+
+ thread_start (freq->th, win32_thread, freq);
+ fe_input_add (freq->th->pipe_fd[0], FIA_FD|FIA_READ, win32_read_thread, freq);
+
+ return;
+
+ }
+
+ else {
+ freq = malloc (sizeof (struct file_req));
+ freq->th = thread_new ();
+ freq->flags = 0;
+ freq->multiple = (flags & FRF_MULTIPLE);
+ freq->callback = callback;
+ freq->userdata = userdata;
+ freq->title = g_locale_from_utf8 (title, -1, 0, 0, 0);
+ if (!filter)
2010-10-09 09:21:43 -04:00
+ {
+ freq->filter = "All files\0*.*\0\0";
+ }
2010-10-09 06:51:46 -04:00
+ else
2010-10-09 09:21:43 -04:00
+ {
+ freq->filter = filter;
+ }
2010-10-09 06:51:46 -04:00
+
+ thread_start (freq->th, win32_thread2, freq);
+ fe_input_add (freq->th->pipe_fd[0], FIA_FD|FIA_READ, win32_read_thread, freq);
+
+ return;
+ }
+#endif
+
if (flags & FRF_WRITE)
{
dialog = gtk_file_chooser_dialog_new (title, NULL,
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/joind.c xchat-wdk/src/fe-gtk/joind.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/joind.c 2006-12-26 05:56:55 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/joind.c 2010-12-28 14:57:33 +0100
2010-03-29 17:23:34 -04:00
@@ -9,7 +9,6 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#include <string.h>
#include <stdio.h>
2010-08-13 19:08:29 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/maingui.c xchat-wdk/src/fe-gtk/maingui.c
2010-12-28 08:47:09 -05:00
--- xchat-wdk.orig/src/fe-gtk/maingui.c 2010-12-28 04:16:34 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/maingui.c 2010-12-28 14:57:33 +0100
2010-08-13 19:08:29 -04:00
@@ -214,60 +214,10 @@
away_list = mg_attr_list_create (&colors[COL_AWAY], FALSE);
}
-#ifdef WIN32
-#define WINVER 0x0501 /* needed for vc6? */
-#include <windows.h>
-#include <gdk/gdkwin32.h>
-
-/* Flash the taskbar button on Windows when there's a highlight event. */
-
-static void
-flash_window (GtkWidget *win)
-{
- FLASHWINFO fi;
- static HMODULE user = NULL;
- static BOOL (*flash) (PFLASHWINFO) = NULL;
-
- if (!user)
- {
- user = GetModuleHandleA ("USER32");
- if (!user)
- return; /* this should never fail */
- }
-
- if (!flash)
- {
- flash = (void *)GetProcAddress (user, "FlashWindowEx");
- if (!flash)
- return; /* this fails on NT4.0 and Win95 */
- }
-
- fi.cbSize = sizeof (fi);
- fi.hwnd = GDK_WINDOW_HWND (win->window);
- fi.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
- fi.uCount = 0;
- fi.dwTimeout = 500;
- flash (&fi);
- /*FlashWindowEx (&fi);*/
-}
-#else
-
-#ifdef USE_XLIB
-#include <gdk/gdkx.h>
-
static void
set_window_urgency (GtkWidget *win, gboolean set)
{
- XWMHints *hints;
-
- hints = XGetWMHints(GDK_WINDOW_XDISPLAY(win->window), GDK_WINDOW_XWINDOW(win->window));
- if (set)
- hints->flags |= XUrgencyHint;
- else
- hints->flags &= ~XUrgencyHint;
- XSetWMHints(GDK_WINDOW_XDISPLAY(win->window),
- GDK_WINDOW_XWINDOW(win->window), hints);
- XFree(hints);
+ gtk_window_set_urgency_hint (GTK_WINDOW (win), set);
}
static void
@@ -281,18 +231,14 @@
{
set_window_urgency (win, FALSE);
}
-#endif
-#endif
/* flash the taskbar button */
void
fe_flash_window (session *sess)
{
-#if defined(WIN32) || defined(USE_XLIB)
if (fe_gui_info (sess, 0) != 1) /* only do it if not focused */
flash_window (sess->gui->window);
-#endif
}
/* set a tab plain, red, light-red, or blue */
2010-12-28 08:47:09 -05:00
@@ -2972,11 +2918,7 @@
2010-08-13 19:08:29 -04:00
gtk_xtext_check_marker_visibility (GTK_XTEXT (current_sess->gui->xtext));
plugin_emit_dummy_print (current_sess, "Focus Window");
}
-#ifndef WIN32
-#ifdef USE_XLIB
unflash_window (GTK_WIDGET (win));
-#endif
-#endif
return FALSE;
}
2010-12-28 08:47:09 -05:00
@@ -2987,11 +2929,7 @@
2010-08-13 19:08:29 -04:00
if (!sess->server->server_session)
sess->server->server_session = sess;
gtk_xtext_check_marker_visibility(GTK_XTEXT (current_sess->gui->xtext));
-#ifndef WIN32
-#ifdef USE_XLIB
unflash_window (GTK_WIDGET (win));
-#endif
-#endif
plugin_emit_dummy_print (sess, "Focus Window");
return FALSE;
}
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/menu.c xchat-wdk/src/fe-gtk/menu.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/menu.c 2010-05-16 06:24:24 +0200
2011-01-10 01:02:40 -05:00
+++ xchat-wdk/src/fe-gtk/menu.c 2011-01-10 06:56:59 +0100
2010-05-21 15:50:49 -04:00
@@ -20,7 +20,6 @@
2010-03-29 17:23:34 -04:00
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
-#include <unistd.h>
#ifdef WIN32
#include <windows.h>
2011-01-10 01:02:40 -05:00
@@ -1204,6 +1203,12 @@
}
static void
+menu_copy_selection (GtkWidget * wid, gpointer none)
+{
+ gtk_xtext_copy_selection (GTK_XTEXT (current_sess->gui->xtext));
+}
+
+static void
menu_flushbuffer (GtkWidget * wid, gpointer none)
{
fe_text_clear (current_sess, 0);
@@ -1645,6 +1650,7 @@
{N_("URL Grabber..."), url_opengui, 0, M_MENUITEM, 0, 0, 1},
{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},
#define SEARCH_OFFSET 67
{N_("Search Text..."), menu_search, GTK_STOCK_FIND, M_MENUSTOCK, 0, 0, 1, GDK_f},
@@ -2188,7 +2194,9 @@
mymenu[i].key,
mymenu[i].key == GDK_F1 ? 0 :
mymenu[i].key == GDK_w ? close_mask :
- GDK_CONTROL_MASK,
+ (g_ascii_isupper (mymenu[i].key)) ?
+ GDK_SHIFT_MASK | GDK_CONTROL_MASK :
+ GDK_CONTROL_MASK,
GTK_ACCEL_VISIBLE);
if (mymenu[i].callback)
g_signal_connect (G_OBJECT (item), "activate",
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/palette.c xchat-wdk/src/fe-gtk/palette.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/palette.c 2010-05-16 05:20:22 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/palette.c 2010-12-28 14:57:33 +0100
2010-05-21 15:50:49 -04:00
@@ -18,7 +18,6 @@
2010-03-29 17:23:34 -04:00
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/plugin-tray.c xchat-wdk/src/fe-gtk/plugin-tray.c
2010-12-27 20:20:58 -05:00
--- xchat-wdk.orig/src/fe-gtk/plugin-tray.c 2010-11-16 09:26:23 +0100
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/plugin-tray.c 2010-12-28 14:57:33 +0100
2010-08-24 14:03:18 -04:00
@@ -1,8 +1,7 @@
2010-03-29 17:23:34 -04:00
/* Copyright (C) 2006-2007 Peter Zelezny. */
#include <string.h>
-#include <unistd.h>
2010-08-24 14:03:18 -04:00
-#include "../common/xchat-plugin.h"
2010-11-08 05:15:56 -05:00
+#include "../../plugins/xchat-plugin.h"
2010-03-29 17:23:34 -04:00
#include "../common/xchat.h"
#include "../common/xchatc.h"
2010-08-24 14:03:18 -04:00
#include "../common/inbound.h"
2010-12-27 20:20:58 -05:00
@@ -297,10 +296,10 @@
2010-05-29 19:43:30 -04:00
nets = tray_count_networks ();
chans = tray_count_channels ();
if (nets)
- tray_set_tipf (_("XChat: Connected to %u networks and %u channels"),
+ tray_set_tipf (_("XChat-WDK: Connected to %u networks and %u channels"),
nets, chans);
else
- tray_set_tipf ("XChat: %s", _("Not connected."));
+ tray_set_tipf ("XChat-WDK: %s", _("Not connected."));
}
if (custom_icon1)
2010-12-27 20:20:58 -05:00
@@ -450,7 +449,7 @@
2010-08-13 22:35:23 -04:00
/* ph may have an invalid context now */
xchat_set_context (ph, xchat_find_context (ph, NULL, NULL));
- win = (GtkWindow *)xchat_get_info (ph, "win_ptr");
+ win = xchat_get_info (ph, "gtkwin_ptr");
tray_stop_flash ();
tray_reset_counts ();
2010-12-27 20:20:58 -05:00
@@ -650,15 +649,15 @@
2010-05-29 19:43:30 -04:00
/* FIXME: hides any previous private messages */
tray_hilight_count++;
if (tray_hilight_count == 1)
- tray_set_tipf (_("XChat: Highlighted message from: %s (%s)"),
+ tray_set_tipf (_("XChat-WDK: Highlighted message from: %s (%s)"),
word[1], xchat_get_info (ph, "channel"));
else
- tray_set_tipf (_("XChat: %u highlighted messages, latest from: %s (%s)"),
+ tray_set_tipf (_("XChat-WDK: %u highlighted messages, latest from: %s (%s)"),
tray_hilight_count, word[1], xchat_get_info (ph, "channel"));
}
if (prefs.input_balloon_hilight)
- tray_set_balloonf (word[2], _("XChat: Highlighted message from: %s (%s)"),
+ tray_set_balloonf (word[2], _("XChat-WDK: Highlighted message from: %s (%s)"),
word[1], xchat_get_info (ph, "channel"));
return XCHAT_EAT_NONE;
2010-12-27 20:20:58 -05:00
@@ -676,14 +675,14 @@
2010-05-29 19:43:30 -04:00
tray_pub_count++;
if (tray_pub_count == 1)
- tray_set_tipf (_("XChat: New public message from: %s (%s)"),
+ tray_set_tipf (_("XChat-WDK: New public message from: %s (%s)"),
word[1], xchat_get_info (ph, "channel"));
else
- tray_set_tipf (_("XChat: %u new public messages."), tray_pub_count);
+ tray_set_tipf (_("XChat-WDK: %u new public messages."), tray_pub_count);
}
if (prefs.input_balloon_chans)
- tray_set_balloonf (word[2], _("XChat: New public message from: %s (%s)"),
+ tray_set_balloonf (word[2], _("XChat-WDK: New public message from: %s (%s)"),
word[1], xchat_get_info (ph, "channel"));
return XCHAT_EAT_NONE;
2010-12-27 20:20:58 -05:00
@@ -705,14 +704,14 @@
2010-05-29 19:43:30 -04:00
tray_priv_count++;
if (tray_priv_count == 1)
- tray_set_tipf (_("XChat: Private message from: %s (%s)"),
+ tray_set_tipf (_("XChat-WDK: Private message from: %s (%s)"),
from, network);
else
- tray_set_tipf (_("XChat: %u private messages, latest from: %s (%s)"),
+ tray_set_tipf (_("XChat-WDK: %u private messages, latest from: %s (%s)"),
tray_priv_count, from, network);
if (prefs.input_balloon_priv)
- tray_set_balloonf (text, _("XChat: Private message from: %s (%s)"),
+ tray_set_balloonf (text, _("XChat-WDK: Private message from: %s (%s)"),
from, network);
}
2010-12-27 20:20:58 -05:00
@@ -758,15 +757,15 @@
2010-05-29 19:43:30 -04:00
tray_file_count++;
if (tray_file_count == 1)
- tray_set_tipf (_("XChat: File offer from: %s (%s)"),
+ tray_set_tipf (_("XChat-WDK: File offer from: %s (%s)"),
word[1], network);
else
- tray_set_tipf (_("XChat: %u file offers, latest from: %s (%s)"),
+ tray_set_tipf (_("XChat-WDK: %u file offers, latest from: %s (%s)"),
tray_file_count, word[1], network);
}
if (prefs.input_balloon_priv)
- tray_set_balloonf ("", _("XChat: File offer from: %s (%s)"),
+ tray_set_balloonf ("", _("XChat-WDK: File offer from: %s (%s)"),
word[1], network);
return XCHAT_EAT_NONE;
2010-08-24 14:03:18 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/plugingui.c xchat-wdk/src/fe-gtk/plugingui.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/plugingui.c 2010-05-16 05:20:22 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/plugingui.c 2010-12-28 14:57:33 +0100
2010-08-24 14:03:18 -04:00
@@ -35,7 +35,7 @@
#include "../common/xchat.h"
#define PLUGIN_C
typedef struct session xchat_context;
-#include "../common/xchat-plugin.h"
2010-11-08 05:15:56 -05:00
+#include "../../plugins/xchat-plugin.h"
2010-08-24 14:03:18 -04:00
#include "../common/plugin.h"
#include "../common/util.h"
#include "../common/outbound.h"
2010-10-09 06:51:46 -04:00
@@ -147,7 +147,9 @@
plugingui_load (void)
{
gtkutil_file_req (_("Select a Plugin or Script to load"), plugingui_load_cb,
- current_sess, NULL, FRF_ADDFOLDER);
+ current_sess,
2010-10-09 09:21:43 -04:00
+ "Plugins and Scripts\0*.dll;*.lua;*.pl;*.py;*.tcl\0"
+ "All files\0*.*\0\0", 0);
2010-10-09 06:51:46 -04:00
}
static void
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/rawlog.c xchat-wdk/src/fe-gtk/rawlog.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/rawlog.c 2010-05-16 05:20:22 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/rawlog.c 2010-12-28 14:57:33 +0100
2010-05-21 15:50:49 -04:00
@@ -19,7 +19,6 @@
2010-03-29 17:23:34 -04:00
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
-#include <unistd.h>
#include <stdlib.h>
#include "fe-gtk.h"
2010-09-28 10:40:34 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/search.c xchat-wdk/src/fe-gtk/search.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/search.c 2010-05-16 05:20:22 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/search.c 2010-12-28 14:57:33 +0100
2010-09-28 10:40:34 -04:00
@@ -153,7 +153,7 @@
_("_Find"));
g_object_set_data (G_OBJECT (wid), "e", entry);
- g_signal_connect (G_OBJECT (win), "key-press-event", G_CALLBACK (search_key_cb), win);
+ g_signal_connect (G_OBJECT (win), "key_press_event", G_CALLBACK (search_key_cb), win);
gtk_widget_show (win);
}
2010-09-28 10:38:22 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/servlistgui.c xchat-wdk/src/fe-gtk/servlistgui.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/servlistgui.c 2010-08-07 09:14:45 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/servlistgui.c 2010-12-28 14:57:33 +0100
2010-09-28 10:40:05 -04:00
@@ -1782,7 +1782,7 @@
2010-09-24 20:33:37 -04:00
gtk_container_add (GTK_CONTAINER (hbox), checkbutton_fav);
g_signal_connect (G_OBJECT (checkbutton_fav), "toggled",
G_CALLBACK (fav_servlist), 0);
- gtk_widget_show (checkbutton_fav);
+ /* gtk_widget_show (checkbutton_fav); don't show this until it's completed */
vbuttonbox2 = gtk_vbutton_box_new ();
gtk_box_set_spacing (GTK_BOX (vbuttonbox2), 3);
2010-09-14 15:01:28 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/setup.c xchat-wdk/src/fe-gtk/setup.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/setup.c 2008-02-08 10:04:45 +0100
2011-01-10 01:02:40 -05:00
+++ xchat-wdk/src/fe-gtk/setup.c 2011-01-10 06:58:17 +0100
@@ -109,19 +109,32 @@
2010-09-29 11:14:24 -04:00
N_("Give each person on IRC a different color"),0,0},
{ST_TOGGLR, N_("Indent nick names"), P_OFFINTNL(indent_nicks),
N_("Make nick names right-justified"),0,0},
- {ST_TOGGLE, N_("Transparent background"), P_OFFINTNL(transparent),0,0,0},
- {ST_TOGGLR, N_("Show marker line"), P_OFFINTNL(show_marker),
+ /* {ST_TOGGLE, N_("Transparent background"), P_OFFINTNL(transparent),0,0,0}, */
+ {ST_TOGGLE, N_("Show marker line"), P_OFFINTNL(show_marker),
N_("Insert a red line after the last read text."),0,0},
2010-09-29 11:33:31 -04:00
- {ST_HEADER, N_("Transparency Settings"), 0,0,0},
+ /* {ST_HEADER, N_("Transparency Settings"), 0,0,0},
2010-09-29 11:14:24 -04:00
{ST_HSCALE, N_("Red:"), P_OFFINTNL(tint_red),0,0,0},
2010-09-29 11:33:31 -04:00
{ST_HSCALE, N_("Green:"), P_OFFINTNL(tint_green),0,0,0},
- {ST_HSCALE, N_("Blue:"), P_OFFINTNL(tint_blue),0,0,0},
+ {ST_HSCALE, N_("Blue:"), P_OFFINTNL(tint_blue),0,0,0}, */
{ST_HEADER, N_("Time Stamps"),0,0,0},
{ST_TOGGLE, N_("Enable time stamps"), P_OFFINTNL(timestamp),0,0,2},
2011-01-10 01:02:40 -05:00
{ST_ENTRY, N_("Time stamp format:"), P_OFFSETNL(stamp_format),
N_("See strftime manpage for details."),0,sizeof prefs.stamp_format},
+ {ST_HEADER, N_("Auto-Copy Behavior"),0,0,0},
+ {ST_TOGGLE, N_("Automatically copy selected text"), P_OFFINTNL(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(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(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}
};
@@ -363,7 +376,6 @@
2010-09-14 15:01:28 -04:00
{ST_END, 0, 0, 0, 0, 0}
};
-#if 0
static const setting advanced_settings[] =
{
{ST_HEADER, N_("Advanced Settings"),0,0,0},
2011-01-10 01:02:40 -05:00
@@ -378,7 +390,6 @@
2010-09-14 15:01:28 -04:00
{ST_END, 0, 0, 0, 0, 0}
};
-#endif
static const setting logging_settings[] =
{
2011-01-10 01:02:40 -05:00
@@ -1708,7 +1719,7 @@
2010-09-14 15:12:14 -04:00
N_("General"),
N_("Logging"),
N_("Sound"),
-/* N_("Advanced"),*/
+ N_("Advanced"),
NULL,
N_("Network"),
N_("Network setup"),
2011-01-10 01:02:40 -05:00
@@ -1733,6 +1744,7 @@
2010-09-14 15:12:14 -04:00
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 ());
+ setup_add_page (cata[12], book, setup_create_page (advanced_settings));
setup_add_page (cata[14], book, setup_create_page (network_settings));
setup_add_page (cata[15], book, setup_create_page (filexfer_settings));
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/sexy-spell-entry.c xchat-wdk/src/fe-gtk/sexy-spell-entry.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-gtk/sexy-spell-entry.c 2006-07-17 07:51:02 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-gtk/sexy-spell-entry.c 2010-12-28 14:57:33 +0100
2010-10-06 08:29:45 -04:00
@@ -31,6 +31,8 @@
2010-03-29 17:23:34 -04:00
/*#include "gtkspell-iso-codes.h"
#include "sexy-marshal.h"*/
2010-10-06 08:29:45 -04:00
+#include "typedef.h"
2010-03-29 17:23:34 -04:00
+
/*
* Bunch of poop to make enchant into a runtime dependency rather than a
* compile-time dependency. This makes it so I don't have to hear the
2010-10-06 08:29:45 -04:00
@@ -134,12 +136,10 @@
2010-10-01 13:13:44 -04:00
GModule *enchant;
gpointer funcptr;
- enchant = g_module_open("libenchant", 0);
2010-10-05 18:10:52 -04:00
+ enchant = g_module_open("libenchant.dll", 0);
2010-10-01 13:13:44 -04:00
if (enchant == NULL)
{
- enchant = g_module_open("libenchant.so.1", 0);
- if (enchant == NULL)
- return;
+ return;
}
have_enchant = TRUE;
2010-03-30 07:17:54 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/xtext.c xchat-wdk/src/fe-gtk/xtext.c
2010-12-27 20:20:58 -05:00
--- xchat-wdk.orig/src/fe-gtk/xtext.c 2010-12-17 08:58:17 +0100
2011-01-10 01:02:40 -05:00
+++ xchat-wdk/src/fe-gtk/xtext.c 2011-01-10 07:00:18 +0100
2010-03-29 17:23:34 -04:00
@@ -42,7 +42,6 @@
#include <ctype.h>
#include <stdlib.h>
#include <time.h>
-#include <unistd.h>
#include <gtk/gtkmain.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkselection.h>
2011-01-09 16:46:59 -05:00
@@ -67,6 +66,8 @@
#endif
#include "xtext.h"
+#include "../common/xchat.h"
+#include "../common/xchatc.h"
#define charlen(str) g_utf8_skip[*(guchar *)(str)]
@@ -1941,7 +1942,7 @@
{
gboolean redraw = FALSE;
- if ((mask & GDK_SHIFT_MASK))
2011-01-10 01:02:40 -05:00
+ if (mask & GDK_SHIFT_MASK || prefs.autocopy_stamp)
2011-01-09 16:46:59 -05:00
{
if (!xtext->mark_stamp)
{
2011-01-10 01:02:40 -05:00
@@ -2106,7 +2107,16 @@
free (str);
}
- gtk_selection_owner_set (xtext, GDK_SELECTION_PRIMARY, event->time);
+ if (event)
+ {
+ gtk_selection_owner_set (xtext, GDK_SELECTION_PRIMARY, event->time);
+ }
+}
+
+void
+gtk_xtext_copy_selection (GtkXText *xtext)
+{
+ gtk_xtext_set_clip_owner (xtext, NULL);
}
static void
@@ -2182,9 +2192,12 @@
2011-01-09 16:46:59 -05:00
if (xtext->buffer->last_ent_start)
{
xtext->color_paste = FALSE;
- if (event->state & GDK_CONTROL_MASK)
+ if (event->state & GDK_CONTROL_MASK || prefs.autocopy_color)
xtext->color_paste = TRUE;
- gtk_xtext_set_clip_owner (GTK_WIDGET (xtext), event);
2011-01-10 01:02:40 -05:00
+ if (prefs.autocopy_text)
2011-01-09 16:46:59 -05:00
+ {
+ gtk_xtext_set_clip_owner (GTK_WIDGET (xtext), event);
+ }
}
if (xtext->select_start_x == event->x &&
2011-01-10 01:02:40 -05:00
@@ -2249,7 +2262,10 @@
2011-01-09 16:46:59 -05:00
ent->mark_end = offset + len;
gtk_xtext_selection_render (xtext, ent, offset, ent, offset + len);
xtext->word_or_line_select = TRUE;
- gtk_xtext_set_clip_owner (GTK_WIDGET (xtext), event);
2011-01-10 01:02:40 -05:00
+ if (prefs.autocopy_text)
2011-01-09 16:46:59 -05:00
+ {
+ gtk_xtext_set_clip_owner (GTK_WIDGET (xtext), event);
+ }
}
return FALSE;
2011-01-10 01:02:40 -05:00
@@ -2265,7 +2281,10 @@
2011-01-09 16:46:59 -05:00
ent->mark_end = ent->str_len;
gtk_xtext_selection_render (xtext, ent, 0, ent, ent->str_len);
xtext->word_or_line_select = TRUE;
- gtk_xtext_set_clip_owner (GTK_WIDGET (xtext), event);
2011-01-10 01:02:40 -05:00
+ if (prefs.autocopy_text)
2011-01-09 16:46:59 -05:00
+ {
+ gtk_xtext_set_clip_owner (GTK_WIDGET (xtext), event);
+ }
}
return FALSE;
2011-01-10 01:02:40 -05:00
@@ -3836,7 +3855,7 @@
2010-09-29 16:09:40 -04:00
PaintDesktop (hdc);
ReleaseDC (hwnd, hdc);
- gdk_window_get_size (GTK_WIDGET (xtext)->window, &width, &height);
+ gdk_drawable_get_size (GTK_WIDGET (xtext)->window, &width, &height);
img = gdk_image_get (GTK_WIDGET (xtext)->window, 0, 0, width+128, height);
xtext->pixmap = win32_tint (xtext, img, img->width, img->height);
2011-01-10 01:02:40 -05:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/xtext.h xchat-wdk/src/fe-gtk/xtext.h
--- xchat-wdk.orig/src/fe-gtk/xtext.h 2010-12-17 08:58:17 +0100
+++ xchat-wdk/src/fe-gtk/xtext.h 2011-01-10 07:00:31 +0100
@@ -270,6 +270,7 @@
xtext_buffer *gtk_xtext_buffer_new (GtkXText *xtext);
void gtk_xtext_buffer_free (xtext_buffer *buf);
void gtk_xtext_buffer_show (GtkXText *xtext, xtext_buffer *buf, int render);
+void gtk_xtext_copy_selection (GtkXText *xtext);
GType gtk_xtext_get_type (void);
#endif
2010-08-24 22:19:10 -04:00
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-text/fe-text.c xchat-wdk/src/fe-text/fe-text.c
2010-10-04 21:56:14 -04:00
--- xchat-wdk.orig/src/fe-text/fe-text.c 2008-08-29 13:24:17 +0200
2010-12-28 08:58:07 -05:00
+++ xchat-wdk/src/fe-text/fe-text.c 2010-12-28 14:57:33 +0100
2010-08-24 22:19:10 -04:00
@@ -22,9 +22,13 @@
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
+#ifdef WIN32
+#define STDIN_FILENO 0
+#define STDOUT_FILENO 1
+#else
#include <sys/time.h>
+#endif
#include <sys/types.h>
-#include <unistd.h>
#include <ctype.h>
#include "../common/xchat.h"
#include "../common/xchatc.h"
@@ -339,7 +343,11 @@
te->callback = callback;
te->userdata = userdata;
- gettimeofday (&now, NULL);
+#ifdef WIN32
+ g_get_current_time (&now);
+#else
+ gettimeofday (&now, NULL);
+#endif
te->next_call = now.tv_sec * 1000 + (now.tv_usec / 1000) + te->interval;
tmr_list = g_slist_prepend (tmr_list, te);
@@ -417,7 +425,12 @@
void
fe_main (void)
{
- struct timeval timeout, now;
+ struct timeval timeout;
+#ifdef WIN32
+ GTimeVal now;
+#else
+ struct timeval now;
+#endif
socketevent *se;
timerevent *te;
fd_set rd, wd, ex;
@@ -428,7 +441,7 @@
new_ircwindow (NULL, NULL, SESS_SERVER, 0);
#ifdef ENABLE_NLS
- bindtextdomain (GETTEXT_PACKAGE, PREFIX"/share/locale");
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
#endif
@@ -464,7 +477,11 @@
shortest = te->next_call;
list = list->next;
}
+#ifdef WIN32
+ g_get_current_time (&now);
+#else
gettimeofday (&now, NULL);
+#endif
delay = shortest - ((now.tv_sec * 1000) + (now.tv_usec / 1000));
timeout.tv_sec = delay / 1000;
timeout.tv_usec = (delay % 1000) * 1000;
@@ -514,7 +531,11 @@
}
/* now check our list of timeout events, some might need to be called! */
+#ifdef WIN32
+ g_get_current_time (&now);
+#else
gettimeofday (&now, NULL);
+#endif
list = tmr_list;
while (list)
{