From eb1142901b4272c6630ab1af31345a2b8fd6f5dc Mon Sep 17 00:00:00 2001 From: jongfoster Date: Sat, 26 May 2001 01:26:34 +0000 Subject: [PATCH] New #define, WIN_GUI_EDIT, enables the (embryonic) Win32 GUI editor. This #define cannot be set from ./configure - there's no point, it doesn't work yet. See feature request # 425722 --- acconfig.h | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ w32log.c | 13 +++++++++++-- w32res.h | 23 ++++++++++++++++++++--- w32rulesdlg.c | 9 ++++++++- w32rulesdlg.h | 13 +++++++++++-- 5 files changed, 101 insertions(+), 8 deletions(-) diff --git a/acconfig.h b/acconfig.h index 7d89427a..d90de204 100644 --- a/acconfig.h +++ b/acconfig.h @@ -37,6 +37,50 @@ * * Revisions : * $Log: acconfig.h,v $ + * Revision 1.2 2001/05/22 17:43:35 oes + * + * - Enabled filtering banners by size rather than URL + * by adding patterns that replace all standard banner + * sizes with the "Junkbuster" gif to the re_filterfile + * + * - Enabled filtering WebBugs by providing a pattern + * which kills all 1x1 images + * + * - Added support for PCRE_UNGREEDY behaviour to pcrs, + * which is selected by the (nonstandard and therefore + * capital) letter 'U' in the option string. + * It causes the quantifiers to be ungreedy by default. + * Appending a ? turns back to greedy (!). + * + * - Added a new interceptor ijb-send-banner, which + * sends back the "Junkbuster" gif. Without imagelist or + * MSIE detection support, or if tinygif = 1, or the + * URL isn't recognized as an imageurl, a lame HTML + * explanation is sent instead. + * + * - Added new feature, which permits blocking remote + * script redirects and firing back a local redirect + * to the browser. + * The feature is conditionally compiled, i.e. it + * can be disabled with --disable-fast-redirects, + * plus it must be activated by a "fast-redirects" + * line in the config file, has its own log level + * and of course wants to be displayed by show-proxy-args + * Note: Boy, all the #ifdefs in 1001 locations and + * all the fumbling with configure.in and acconfig.h + * were *way* more work than the feature itself :-( + * + * - Because a generic redirect template was needed for + * this, tinygif = 3 now uses the same. + * + * - Moved GIFs, and other static HTTP response templates + * to project.h + * + * - Many minor fixes + * + * - Removed some >400 CRs again (Jon, you really worked + * a lot! ;-) + * * Revision 1.1.1.1 2001/05/15 13:58:45 oes * Initial import of version 2.9.3 source tree * @@ -181,6 +225,13 @@ */ #undef PCRE +/* + * Define this to use the Windows GUI for editing the blocklist. + * FIXME: This feature is only partially implemented and does not work + * FIXME: This #define can never be set by ./configure. + */ +#undef WIN_GUI_EDIT + @BOTTOM@ #endif /* _CONFIG_H */ diff --git a/w32log.c b/w32log.c index 388a0a79..e1fa8cc5 100644 --- a/w32log.c +++ b/w32log.c @@ -1,4 +1,4 @@ -const char w32log_rcs[] = "$Id: w32log.c,v 1.5 2001/05/26 00:28:36 jongfoster Exp $"; +const char w32log_rcs[] = "$Id: w32log.c,v 1.6 2001/05/26 00:31:30 jongfoster Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32log.c,v $ @@ -32,6 +32,9 @@ const char w32log_rcs[] = "$Id: w32log.c,v 1.5 2001/05/26 00:28:36 jongfoster Ex * * Revisions : * $Log: w32log.c,v $ + * Revision 1.6 2001/05/26 00:31:30 jongfoster + * Fixing compiler warning about comparing signed/unsigned. + * * Revision 1.5 2001/05/26 00:28:36 jongfoster * Automatic reloading of config file. * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). @@ -951,7 +954,9 @@ void OnLogRButtonUp(int nModifier, int x, int y) if (hMenu != NULL) { HMENU hMenuPopup = GetSubMenu(hMenu, 0); +#ifdef WIN_GUI_EDIT char *szURL; +#endif /* def WIN_GUI_EDIT */ /* Check if there is a selection */ CHARRANGE range; @@ -964,7 +969,8 @@ void OnLogRButtonUp(int nModifier, int x, int y) { EnableMenuItem(hMenuPopup, ID_EDIT_COPY, MF_BYCOMMAND | MF_ENABLED); } - + +#ifdef WIN_GUI_EDIT /* Check if cursor is over a link */ szURL = LogGetURLUnderCursor(); if (szURL) @@ -996,6 +1002,7 @@ void OnLogRButtonUp(int nModifier, int x, int y) free(szURL); } +#endif /* def WIN_GUI_EDIT */ /* Display the popup */ TrackPopupMenu(hMenuPopup, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RIGHTBUTTON, x, y, 0, g_hwndLogFrame, NULL); @@ -1112,9 +1119,11 @@ void OnLogCommand(int nCommand) break; #endif /* def TRUST_FILES */ +#ifdef WIN_GUI_EDIT case ID_NEW_BLOCKER: ShowRulesDialog(g_hwndLogFrame); break; +#endif /* def WIN_GUI_EDIT */ case ID_HELP_GPL: ShellExecute(g_hwndLogFrame, "open", "gpl.html", NULL, NULL, SW_SHOWNORMAL); diff --git a/w32res.h b/w32res.h index c052373f..f4417b8a 100644 --- a/w32res.h +++ b/w32res.h @@ -1,6 +1,6 @@ #ifndef _W32RES_H #define _W32RES_H -#define W32RES_H_VERSION "$Id: w32res.h,v 1.2 2001/05/20 01:21:20 jongfoster Exp $" +#define W32RES_H_VERSION "$Id: w32res.h,v 1.3 2001/05/26 00:28:36 jongfoster Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32res.h,v $ @@ -34,6 +34,13 @@ * * Revisions : * $Log: w32res.h,v $ + * Revision 1.3 2001/05/26 00:28:36 jongfoster + * Automatic reloading of config file. + * Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32). + * Most of the global variables have been moved to a new + * struct configuration_spec, accessed through csp->config->globalname + * Most of the globals remaining are used by the Win32 GUI. + * * Revision 1.2 2001/05/20 01:21:20 jongfoster * Version 2.9.4 checkin. * - Merged popupfile and cookiefile, and added control over PCRS @@ -53,17 +60,22 @@ * *********************************************************************/ +#ifdef WIN_GUI_EDIT #define IDS_NEW_BLOCKER 1 #define ID_NEW_BLOCKER 100 +#endif /* def WIN_GUI_EDIT */ + #define IDR_TRAYMENU 101 #define IDI_IDLE 102 #define IDR_LOGVIEW 103 #define IDR_ACCELERATOR 104 #define IDR_POPUP_SELECTION 105 + +#ifdef WIN_GUI_EDIT #define IDD_RULES 106 -#define IDI_DENYRULE 107 -#define IDI_ALLOWRULE 108 +#endif /* def WIN_GUI_EDIT */ + #define IDI_JUNKBUSTER 200 #define IDI_JUNKBUSTER1 201 @@ -75,6 +87,10 @@ #define IDI_JUNKBUSTER7 207 #define IDI_JUNKBUSTER8 208 +#ifdef WIN_GUI_EDIT +#define IDI_DENYRULE 209 +#define IDI_ALLOWRULE 210 + #define IDC_NEW 300 #define IDC_ACTION 301 #define IDC_RULES 302 @@ -83,6 +99,7 @@ #define IDC_MOVEDOWN 305 #define IDC_DELETE 306 #define IDC_SAVE 307 +#endif /* def WIN_GUI_EDIT */ #define ID_SHOWWINDOW 4000 #define ID_HELP_ABOUTJUNKBUSTER 4001 diff --git a/w32rulesdlg.c b/w32rulesdlg.c index 8b0b896a..75168620 100644 --- a/w32rulesdlg.c +++ b/w32rulesdlg.c @@ -1,4 +1,4 @@ -const char w32rulesdlg_rcs[] = "$Id: w32rulesdlg.c,v 1.2 2001/05/20 15:07:54 jongfoster Exp $"; +const char w32rulesdlg_rcs[] = "$Id: w32rulesdlg.c,v 1.3 2001/05/22 18:56:28 oes Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32rulesdlg.c,v $ @@ -32,6 +32,9 @@ const char w32rulesdlg_rcs[] = "$Id: w32rulesdlg.c,v 1.2 2001/05/20 15:07:54 jon * * Revisions : * $Log: w32rulesdlg.c,v $ + * Revision 1.3 2001/05/22 18:56:28 oes + * CRLF -> LF + * * Revision 1.2 2001/05/20 15:07:54 jongfoster * File is now ignored if _WIN_CONSOLE is defined. * @@ -58,7 +61,10 @@ const char w32rulesdlg_rcs[] = "$Id: w32rulesdlg.c,v 1.2 2001/05/20 15:07:54 jon const char w32rulesdlg_h_rcs[] = W32RULESDLG_H_VERSION; + #ifndef _WIN_CONSOLE /* entire file */ +#ifdef WIN_GUI_EDIT /* entire file */ + const int nSmallIconWidth = 16; const int nSmallIconHeight = 16; @@ -532,6 +538,7 @@ static BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l } +#endif /* def WIN_GUI_EDIT - entire file */ #endif /* ndef _WIN_CONSOLE - entire file */ /* diff --git a/w32rulesdlg.h b/w32rulesdlg.h index 991a8bd0..9fe945de 100644 --- a/w32rulesdlg.h +++ b/w32rulesdlg.h @@ -1,9 +1,9 @@ #ifndef _W32RULESDLG_H #define _W32RULESDLG_H -#define W32RULESDLG_H_VERSION "$Id: w32rulesdlg.h,v 1.1 2001/05/13 21:57:07 administrator Exp $" +#define W32RULESDLG_H_VERSION "$Id: w32rulesdlg.h,v 1.1.1.1 2001/05/15 13:59:08 oes Exp $" /********************************************************************* * - * File : $Source: /home/administrator/cvs/ijb/w32rulesdlg.h,v $ + * File : $Source: /cvsroot/ijbswa/current/w32rulesdlg.h,v $ * * Purpose : A dialog to allow GUI editing of the rules. * Unfinished. @@ -34,6 +34,9 @@ * * Revisions : * $Log: w32rulesdlg.h,v $ + * Revision 1.1.1.1 2001/05/15 13:59:08 oes + * Initial import of version 2.9.3 source tree + * * *********************************************************************/ @@ -42,9 +45,15 @@ extern "C" { #endif +#ifndef _WIN_CONSOLE /* entire file */ +#ifdef WIN_GUI_EDIT /* entire file */ + extern int ShowRulesDialog(HWND hwndParent); extern void SetDefaultRule(const char *pszRule); +#endif /* def WIN_GUI_EDIT - entire file */ +#endif /* ndef _WIN_CONSOLE - entire file */ + /* Revision control strings from this header and associated .c file */ extern const char w32rulesdlg_rcs[]; extern const char w32rulesdlg_h_rcs[]; -- 2.39.2