diff options
Diffstat (limited to 'third_party/npapi/npspy/windows')
29 files changed, 3661 insertions, 0 deletions
diff --git a/third_party/npapi/npspy/windows/dirpick.cpp b/third_party/npapi/npspy/windows/dirpick.cpp new file mode 100644 index 0000000..a3bdaa4 --- /dev/null +++ b/third_party/npapi/npspy/windows/dirpick.cpp @@ -0,0 +1,605 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +#define _CRT_SECURE_NO_DEPRECATE + +#include <windows.h> +#include <windowsx.h> +#include <direct.h> +#include <stdio.h> + +#include "resource.h" + +extern HINSTANCE hInst; + +#define ITEM_BITMAPWIDTH 16 +#define ITEM_BITMAPHEIGHT 16 +#define ITEM_LEFTMARGIN 4 +#define ITEM_GAP 4 + +static HWND hWndDirPicker; +static HICON hIconDrives[5]; +static HICON hIconFolders[3]; +static LPSTR lpszStringToReturn; +static char szUNCRoot[256] = ""; + +UINT DriveType(UINT iType); + +static void fillComboBox(HWND hWnd) +{ + HWND hWndCB = GetDlgItem(hWnd, ID_COMBO_DIR); + HWND hWndTempLB = GetDlgItem(hWnd, ID_LISTTEMP_DIR); + if(hWndCB == NULL) + return; + ComboBox_ResetContent(hWndCB); + ListBox_ResetContent(hWndTempLB); + ListBox_Dir(hWndTempLB, DDL_DRIVES|DDL_EXCLUSIVE, (LPSTR)"*"); + + int iDriveCount = ListBox_GetCount(hWndTempLB); + int iCurDrive=_getdrive() - 1; + + char szDrive[16]; + char szItem[80]; + + for (int i = 0; i < iDriveCount; i++) + { + ListBox_GetText(hWndTempLB, i, szDrive); + CharLower(szDrive); + int iDrive = szDrive[2] - 'a'; + char szRoot[16]; + sprintf(szRoot, "%c:\\", szDrive[2]); + + int iType = DriveType(iDrive); + + if(iType < 2) + continue; + + //Start the item string with the drive letter, colon, and two spaces + sprintf(szItem, "%c%s", szDrive[2], ": "); + + if((iType == DRIVE_FIXED) || (iType == DRIVE_RAMDISK)) + { // get volume ID + char szVolumeID[80]; + DWORD dwMaxLength; + DWORD dwSysFlags; + GetVolumeInformation(szRoot, // address of root directory of the file system + szVolumeID, // address of name of the volume + sizeof(szVolumeID), // length of lpVolumeNameBuffer + NULL, // address of volume serial number + &dwMaxLength, // address of system's maximum filename length + &dwSysFlags, // address of file system flags + NULL, // address of name of file system + NULL); // length of lpFileSystemNameBuffer + + CharLower(szVolumeID); + lstrcat(szItem, szVolumeID); + } + + //For network drives, go grab the \\server\share for it. + if(DRIVE_REMOTE == iType) + { + char szNet[64]; + szNet[0] = '\0'; + DWORD dwSizeOfszNet = sizeof(szNet); + + sprintf(szDrive, "%c:", szDrive[2]); + CharUpper(szDrive); + WNetGetConnection(szDrive, szNet, &dwSizeOfszNet); + CharLower(szNet); + lstrcat(szItem, szNet); + } + + int index = ComboBox_AddString(hWndCB, szItem); + ComboBox_SetItemData(hWndCB, index, MAKELONG(iDrive, iType)); + if(iDrive == iCurDrive) + ComboBox_SetCurSel(hWndCB, index); + if(szUNCRoot[0] != '\0') + ComboBox_SetCurSel(hWndCB, -1); + } +} + +static void fillTempLBWithDirs(HWND hWndTempLB, LPSTR lpszDir) +{ + BOOL bDone = FALSE; + WIN32_FIND_DATA ffdataStruct; + + char szPath[_MAX_PATH]; + char szFileName[_MAX_PATH]; + lstrcpy(szPath, lpszDir); + if(szPath[lstrlen(szPath) - 1] == '\\') + szPath[lstrlen(szPath) - 1] = '\0'; + lstrcpy(szFileName, szPath); + lstrcat(szFileName, "\\*"); + HANDLE handle = FindFirstFile(szFileName, &ffdataStruct); + if(handle == INVALID_HANDLE_VALUE) + { + FindClose(handle); + return; + } + while(!bDone) + { + lstrcpy(szFileName, szPath); + lstrcat(szFileName, "\\"); + lstrcat(szFileName, ffdataStruct.cFileName); + if(ffdataStruct. dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + char szStringToAdd[_MAX_PATH + 2]; + lstrcpy(szStringToAdd, "["); + lstrcat(szStringToAdd, ffdataStruct.cFileName); + lstrcat(szStringToAdd, "]"); + CharLower(szStringToAdd); + ListBox_AddString(hWndTempLB, szStringToAdd); + } + bDone = !FindNextFile(handle, &ffdataStruct); + } + FindClose(handle); +} + +static void fillListBox(HWND hWnd, LPSTR lpszDir) +{ + HWND hWndLB = GetDlgItem(hWnd, ID_LIST_DIR); + HWND hWndTempLB = GetDlgItem(hWnd, ID_LISTTEMP_DIR); + HWND hWndEdit = GetDlgItem(hWnd, ID_EDIT_DIR); + if((hWndLB == NULL) || (lpszDir == NULL)) + return; + + int iLastChar = lstrlen(lpszDir); + if(lpszDir[iLastChar - 1] == '\\') + lpszDir[iLastChar - 1] = '\0'; + + SetWindowRedraw(hWndLB, FALSE); + ListBox_ResetContent(hWndLB); + ListBox_ResetContent(hWndTempLB); + + LPSTR lpszLast; + lpszLast = CharLower(lpszDir); + + SetWindowText(hWndLB, lpszDir); + + char szDir[_MAX_DIR]; + char szFullDir[_MAX_DIR]; + sprintf(szFullDir, "%s", lpszDir); + sprintf(szDir, "%s\\*.*", lpszDir); + + BOOL bFirst = TRUE; + char ch; + int index; + while (TRUE) + { + LPSTR lpsz; + if((lpszDir[0] == '\\') && (lpszDir[1] == '\\') && bFirst) + lpsz = strchr(lpszLast + lstrlen(szUNCRoot), '\\'); + else + lpsz = strchr(lpszLast, '\\'); + if(lpsz != NULL) { + if (bFirst) + ch = *(++lpsz); + else + ch = *lpsz; + *lpsz = 0; + } + else + { + //If we're looking at a drive only, then append a backslash + if (lpszLast == lpszDir && bFirst) + lstrcat(lpszLast, "\\"); + } + //Add the drive string--includes the last one where lpsz == NULL + index = ListBox_AddString(hWndLB, lpszLast); + + UINT i = (NULL != lpsz) ? ID_ICON_FOLDEROPEN : ID_ICON_OPENSELECT; + ListBox_SetItemData(hWndLB, index, MAKELONG(index, i)); + + if(NULL == lpsz) + break; + + //Restore last character. + *lpsz = ch; + lpsz += (bFirst) ? 0 : 1; + + bFirst=FALSE; + lpszLast = lpsz; + } + int indent = index + 1; + + //Get available directories + fillTempLBWithDirs(hWndTempLB, lpszDir); + + int itemCount = ListBox_GetCount(hWndTempLB); + + int i=0; + for (i = 0; i < itemCount; i++) { + index = ListBox_GetText(hWndTempLB, i, lpszDir); + //Skip directories beginning with . (skipping . and ..) + if(lpszDir[1] == '.') + continue; + //Remove the ending ']' + iLastChar = lstrlen(lpszDir); + lpszDir[iLastChar - 1] = '\0'; + //Add the string to the real directory list. + index = ListBox_AddString(hWndLB, lpszDir + 1); + ListBox_SetItemData(hWndLB, index, MAKELONG(indent, ID_ICON_FOLDERCLOSED)); + } + //Force a listbox repaint. + SetWindowRedraw(hWndLB, TRUE); + InvalidateRect(hWndLB, NULL, TRUE); + + if(szFullDir[lstrlen(szFullDir) - 1] == ':') + lstrcat(szFullDir, "\\"); + Edit_SetText(hWndEdit, szFullDir); + + GetScrollRange(hWndLB, SB_VERT, (LPINT)&i, (LPINT)&index); + + if(!(i == 0 && index == 0)) + ListBox_SetTopIndex(hWndLB, max((int)(index - 2), 0)); + + ListBox_SetCurSel(hWndLB, indent - 1); +} + +static void onDrawItem(LPDRAWITEMSTRUCT lpdis, BOOL bDrive) +{ + if((int)lpdis->itemID < 0) + return; + + char szItem[_MAX_DIR]; + DWORD dwItemData; + + if(bDrive) + { + dwItemData = ComboBox_GetItemData(lpdis->hwndItem, lpdis->itemID); + ComboBox_GetLBText(lpdis->hwndItem, lpdis->itemID, szItem); + } + else + { + dwItemData = ListBox_GetItemData(lpdis->hwndItem, lpdis->itemID); + ListBox_GetText(lpdis->hwndItem, lpdis->itemID, szItem); + } + + if(lpdis->itemAction & (ODA_DRAWENTIRE | ODA_SELECT)) + { + COLORREF colorText; + COLORREF colorBack; + if(lpdis->itemState & ODS_SELECTED) + { + colorText = SetTextColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHTTEXT)); + colorBack = SetBkColor(lpdis->hDC, GetSysColor(COLOR_HIGHLIGHT)); + } + HICON hIcon; + int indent = 0; + if(bDrive) + { + int iType=(int)HIWORD(dwItemData); + switch (iType) + { + case DRIVE_REMOVABLE: + hIcon = hIconDrives[0]; + break; + case DRIVE_FIXED: + hIcon = hIconDrives[1]; + break; + case DRIVE_REMOTE: + hIcon = hIconDrives[2]; + break; + case DRIVE_CDROM: + hIcon = hIconDrives[3]; + break; + case DRIVE_RAMDISK: + hIcon = hIconDrives[4]; + break; + } + + } + else + { + int iconID = (int)HIWORD(lpdis->itemData); + switch (iconID) + { + case ID_ICON_FOLDERCLOSED: + hIcon = hIconFolders[0]; + break; + case ID_ICON_FOLDEROPEN: + hIcon = hIconFolders[1]; + break; + case ID_ICON_OPENSELECT: + hIcon = hIconFolders[2]; + break; + } + indent = 4 * (1 + LOWORD(lpdis->itemData)); + } + + ExtTextOut(lpdis->hDC, + lpdis->rcItem.left + ITEM_LEFTMARGIN + ITEM_BITMAPWIDTH + ITEM_GAP + indent, + lpdis->rcItem.top, + ETO_OPAQUE | ETO_CLIPPED, + &lpdis->rcItem, + szItem, + lstrlen(szItem), + NULL); + + BOOL res = DrawIcon(lpdis->hDC, + lpdis->rcItem.left + ITEM_LEFTMARGIN + indent, + lpdis->rcItem.top, + hIcon); + + if(lpdis->itemState & ODS_SELECTED) + { + SetTextColor(lpdis->hDC, colorText); + SetBkColor(lpdis->hDC, colorBack); + } + } + if((lpdis->itemAction & ODA_FOCUS) || (lpdis->itemState & ODS_FOCUS)) + DrawFocusRect(lpdis->hDC, &lpdis->rcItem); +} + +static void fillUNCRootArray(LPSTR lpsz) +{ + char szCurDir[_MAX_PATH]; + _getcwd(szCurDir, sizeof(szCurDir)); + lstrcpy(szUNCRoot, lpsz); + if(szUNCRoot[lstrlen(szUNCRoot) - 1] == '\\') + szUNCRoot[lstrlen(szUNCRoot) - 1] = '\0'; + for(;;) + { + LPSTR lptemp = strrchr(szUNCRoot, '\\'); + if(lptemp == NULL) + break; + *lptemp = '\0'; + if(_chdir(szUNCRoot) == -1) + { + *lptemp = '\\'; + break; + } + } + _chdir(szCurDir); +} + +static void onInitDialog(HWND hWnd, LPSTR lpsz) +{ + hWndDirPicker = hWnd; + lpszStringToReturn = lpsz; + + hIconDrives[0] = LoadIcon(hInst, MAKEINTRESOURCE(ID_ICON_DRIVEFLOPPY)); + hIconDrives[1] = LoadIcon(hInst, MAKEINTRESOURCE(ID_ICON_DRIVEHARD)); + hIconDrives[2] = LoadIcon(hInst, MAKEINTRESOURCE(ID_ICON_DRIVENETWORK)); + hIconDrives[3] = LoadIcon(hInst, MAKEINTRESOURCE(ID_ICON_DRIVECDROM)); + hIconDrives[4] = LoadIcon(hInst, MAKEINTRESOURCE(ID_ICON_DRIVERAM)); + + hIconFolders[0] = LoadIcon(hInst, MAKEINTRESOURCE(ID_ICON_FOLDERCLOSED)); + hIconFolders[1] = LoadIcon(hInst, MAKEINTRESOURCE(ID_ICON_FOLDEROPEN)); + hIconFolders[2] = LoadIcon(hInst, MAKEINTRESOURCE(ID_ICON_OPENSELECT)); + + if(lpsz[0] == '\0') + _getcwd(lpsz, _MAX_PATH); + else if(lpsz[lstrlen(lpsz) - 1] == ':') + lstrcat(lpsz, "\\"); + + int ret = _chdir(lpsz); + if(ret == -1) + { + char szText[_MAX_PATH + 80]; + sprintf(szText, "The specified directory %s\ncannot be found", lpsz); + MessageBox(GetParent(hWnd), szText, "Choose Directory", MB_ICONEXCLAMATION|MB_OK); + _getcwd(lpsz, _MAX_PATH); + } + if((lpsz[0] == '\\') && (lpsz[1] == '\\')) + fillUNCRootArray(lpsz); + fillListBox(hWnd, lpsz); + fillComboBox(hWnd); +} + +static void shutDialog(HWND hWnd) +{ + szUNCRoot[0] = '\0'; +} + +static void onCommand(HWND hWnd, int id, HWND hWndCtl, UINT codeNotify) +{ + char szCurDir[_MAX_PATH]; + switch(id) + { + case ID_LIST_DIR: + if(codeNotify == LBN_DBLCLK) + { + int index = ListBox_GetCurSel(hWndCtl); + DWORD dwItemData = ListBox_GetItemData(hWndCtl, index); + + if(HIWORD(dwItemData) == ID_ICON_OPENSELECT) + { + shutDialog(hWnd); + char szString[_MAX_PATH]; + Edit_GetText(GetDlgItem(hWndDirPicker, ID_EDIT_DIR), szString, sizeof(szString)); + lstrcpy(lpszStringToReturn, szString); + EndDialog(hWnd, IDOK); + break; + } + + ListBox_GetText(hWndCtl, index, szCurDir); + + char szDir[_MAX_DIR]; + LPSTR lpsz; + if((HIWORD(dwItemData) == ID_ICON_FOLDEROPEN) && (index != 0)) + { + GetWindowText(hWndCtl, szDir, sizeof(szDir)); + lpsz=_fstrstr(szDir, szCurDir); + *(lpsz + lstrlen(szCurDir)) = '\0'; + lstrcpy(szCurDir, szDir); + } + if (_chdir(szCurDir) == 0) + { + _getcwd(szCurDir, _MAX_PATH); + fillListBox(hWndDirPicker, szCurDir); + } + } + break; + case ID_COMBO_DIR: + if(codeNotify == CBN_SELCHANGE) + { + char szDrive[80]; + int index = ComboBox_GetCurSel(hWndCtl); + if(index == CB_ERR) + break; + ComboBox_GetLBText(hWndCtl, index, szDrive); + + int iCurDrive = _getdrive(); +Retry: + HCURSOR hCursorOld = SetCursor(LoadCursor(NULL, IDC_WAIT)); + SetCapture(hWndDirPicker); + if((0 == _chdrive((int)(szDrive[0] - 'a' + 1))) && (NULL != _getcwd(szCurDir, _MAX_PATH))) + { + fillListBox(hWndDirPicker, szCurDir); + ListBox_SetTopIndex(GetDlgItem(hWndDirPicker, ID_LIST_DIR), 0); + SetCursor(hCursorOld); + ReleaseCapture(); + break; + } + SetCursor(hCursorOld); + ReleaseCapture(); + + char szText[80]; + sprintf(szText, "Cannot read drive %c:", szDrive[0]); + if(IDRETRY == MessageBox(hWndDirPicker, szText, "Choose Directory", MB_ICONEXCLAMATION|MB_RETRYCANCEL)) + goto Retry; + + //Changing drives failed so restore drive and selection + _chdrive(iCurDrive); + + sprintf(szDrive, "%c:", (char)(iCurDrive + 'a' - 1)); + index = ComboBox_SelectString(hWndCtl, -1, szDrive); + } + break; + case IDOK: + shutDialog(hWnd); + char szString[_MAX_PATH]; + Edit_GetText(GetDlgItem(hWndDirPicker, ID_EDIT_DIR), szString, sizeof(szString)); + lstrcpy(lpszStringToReturn, szString); + EndDialog(hWnd, IDOK); + break; + case IDCANCEL: + shutDialog(hWnd); + lpszStringToReturn[0] = '\0'; + EndDialog(hWnd, IDCANCEL); + break; + default: + break; + } +} + +static BOOL CALLBACK DirPickDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) { + case WM_INITDIALOG: + onInitDialog(hWnd, (LPSTR)lParam); + break; + case WM_COMMAND: + HANDLE_WM_COMMAND(hWnd, wParam, lParam, onCommand); + break; + case WM_MEASUREITEM: + { + static int cyItem = -1; //Height of a listbox item + LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT)lParam; + if(cyItem == -1) + { + HFONT hFont = (HFONT)SendMessage(hWnd, WM_GETFONT, 0, 0L); + if(hFont == NULL) + hFont = GetStockFont(SYSTEM_FONT); + HDC hDC = GetDC(hWnd); + HFONT hFontOld = SelectFont(hDC, hFont); + TEXTMETRIC tm; + GetTextMetrics(hDC, &tm); + cyItem = max(ITEM_BITMAPHEIGHT, tm.tmHeight); + SelectFont(hDC, hFontOld); + ReleaseDC(hWnd, hDC); + } + + lpmis->itemHeight = cyItem; + } + break; + case WM_DRAWITEM: + onDrawItem((LPDRAWITEMSTRUCT)lParam, ((UINT)wParam == ID_COMBO_DIR)); + return TRUE; // to prevent default action in listbox (drawing focus) + default: + return FALSE; + } + return TRUE; +} + +/* + * DriveType + * + * Purpose: + * Augments the Windows API GetDriveType with a call to the CD-ROM + * extensions to determine if a drive is a floppy, hard disk, CD-ROM, + * RAM-drive, or networked drive. + * + * Parameters: + * iDrive UINT containing the zero-based drive index + * + * Return Value: + * UINT One of the following values describing the drive: + * DRIVE_FLOPPY, DRIVE_HARD, DRIVE_CDROM, DRIVE_RAMDISK, + * DRIVE_NETWORK. + * + * Copyright (c)1992 Kraig Brockschmidt, All Right Reserved + * Compuserve: 70750,2344 + * Internet : kraigb@microsoft.com + * + */ +UINT DriveType(UINT iDrive) +{ + //Validate possible drive indices + if((0 > iDrive) || (25 < iDrive)) + return (UINT)-1; + + static char path[] = "d:\\"; + path[0] = 'a' + iDrive; + int iType = GetDriveType(path); + + /* + * Under Windows NT, GetDriveType returns complete information + * not provided under Windows 3.x which we now get through other + * means. + */ + + return iType; +} + +BOOL PickupDirectory(HWND hWndOwner, LPSTR lpszString) +{ + if(hWndOwner == NULL) + hWndOwner = GetDesktopWindow(); + int ret = DialogBoxParam(hInst, MAKEINTRESOURCE(ID_DIALOG_CHOOSEDIR), hWndOwner, DirPickDlgProc, (LPARAM)lpszString); + return (ret == IDOK); +} diff --git a/third_party/npapi/npspy/windows/gui_advanced.cpp b/third_party/npapi/npspy/windows/gui_advanced.cpp new file mode 100644 index 0000000..6b8c2ad --- /dev/null +++ b/third_party/npapi/npspy/windows/gui_advanced.cpp @@ -0,0 +1,100 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "xp.h" +#include <windowsx.h> + +#include "windowsxx.h" + +#include "resource.h" +#include "logger.h" + +static void onApply(HWND hWnd) +{ + Logger * logger = (Logger *)GetWindowLong(hWnd, DWL_USER); + if(!logger) + return; + + logger->bSPALID = (BST_CHECKED == IsDlgButtonChecked(hWnd, IDC_CHECK_SPALID)); + logger->bSaveSettings = TRUE; +} + +static void onNotify(HWND hWnd, int idCtrl, LPNMHDR lpNMHdr) +{ + switch(lpNMHdr->code) + { + case PSN_RESET: + break; + case PSN_APPLY: + onApply(hWnd); + break; + } +} + +static BOOL onInitDialog(HWND hWnd, HWND hWndFocus, LPARAM lParam) +{ + Logger * logger = NULL; + + if(lParam) + { + logger = (Logger *)(((PROPSHEETPAGE *)lParam)->lParam); + SetWindowLong(hWnd, DWL_USER, (long)logger); + } + + if(logger) + { + CheckDlgButton(hWnd, IDC_CHECK_SPALID, logger->bSPALID ? BST_CHECKED : BST_UNCHECKED); + } + + return TRUE; +} + +BOOL CALLBACK AdvancedPageProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) + { + case WM_INITDIALOG: + return (BOOL)HANDLE_WM_INITDIALOG(hWnd, wParam, lParam, onInitDialog); + case WM_NOTIFY: + HANDLE_WM_NOTIFY(hWnd, wParam, lParam, onNotify); + break; + + default: + return FALSE; + } + return TRUE; +} diff --git a/third_party/npapi/npspy/windows/gui_fiter.cpp b/third_party/npapi/npspy/windows/gui_fiter.cpp new file mode 100644 index 0000000..47d22e5 --- /dev/null +++ b/third_party/npapi/npspy/windows/gui_fiter.cpp @@ -0,0 +1,141 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "xp.h" +#include <windowsx.h> + +#include "windowsxx.h" + +#include "resource.h" +#include "logger.h" + +static void onCommand(HWND hWnd, int id, HWND hWndCtl, UINT codeNotify) +{ + switch (id) + { + case IDC_BUTTON_CHECKALL: + { + for(int i = IDC_CHECK_NPN_VERSION; i < IDC_CHECK_NPN_VERSION + TOTAL_NUMBER_OF_API_CALLS - 1; i++) + CheckDlgButton(hWnd, i, BST_CHECKED); + break; + } + case IDC_BUTTON_CLEARALL: + { + for(int i = IDC_CHECK_NPN_VERSION; i < IDC_CHECK_NPN_VERSION + TOTAL_NUMBER_OF_API_CALLS - 1; i++) + CheckDlgButton(hWnd, i, BST_UNCHECKED); + break; + } + default: + break; + } +} + +static void onApply(HWND hWnd) +{ + Logger * logger = (Logger *)GetWindowLong(hWnd, DWL_USER); + if(!logger) + return; + + BOOL mutedcalls[TOTAL_NUMBER_OF_API_CALLS]; + + mutedcalls[0] = FALSE; // for invalid call + + // we assume that checkbox ids start with IDC_CHECK_NPN_VERSION and are consequitive + for(int i = IDC_CHECK_NPN_VERSION; i < IDC_CHECK_NPN_VERSION + TOTAL_NUMBER_OF_API_CALLS - 1; i++) + mutedcalls[i - IDC_CHECK_NPN_VERSION + 1] = (BST_UNCHECKED == IsDlgButtonChecked(hWnd, i)); + + logger->setMutedCalls(&mutedcalls[0]); + logger->bSaveSettings = TRUE; +} + +static void onNotify(HWND hWnd, int idCtrl, LPNMHDR lpNMHdr) +{ + switch(lpNMHdr->code) + { + case PSN_RESET: + break; + case PSN_APPLY: + onApply(hWnd); + break; + } +} + +static BOOL onInitDialog(HWND hWnd, HWND hWndFocus, LPARAM lParam) +{ + Logger * logger = NULL; + + if(lParam) + { + logger = (Logger *)(((PROPSHEETPAGE *)lParam)->lParam); + SetWindowLong(hWnd, DWL_USER, (long)logger); + } + + BOOL * mutedcalls = logger->getMutedCalls(); + + if(mutedcalls) + { + // we assume that checkbox ids start with IDC_CHECK_NPN_VERSION and are consequitive + for(int i = IDC_CHECK_NPN_VERSION; i < IDC_CHECK_NPN_VERSION + TOTAL_NUMBER_OF_API_CALLS - 1; i++) + CheckDlgButton(hWnd, i, mutedcalls[i - IDC_CHECK_NPN_VERSION + 1] ? BST_UNCHECKED : BST_CHECKED); + } + else + { + for(int i = IDC_CHECK_NPN_VERSION; i < IDC_CHECK_NPN_VERSION + TOTAL_NUMBER_OF_API_CALLS - 1; i++) + CheckDlgButton(hWnd, i, BST_CHECKED); + } + + return TRUE; +} + +BOOL CALLBACK FilterPageProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) + { + case WM_INITDIALOG: + return (BOOL)HANDLE_WM_INITDIALOG(hWnd, wParam, lParam, onInitDialog); + case WM_COMMAND: + HANDLE_WM_COMMAND(hWnd, wParam, lParam, onCommand); + break; + case WM_NOTIFY: + HANDLE_WM_NOTIFY(hWnd, wParam, lParam, onNotify); + break; + + default: + return FALSE; + } + return TRUE; +} diff --git a/third_party/npapi/npspy/windows/gui_general.cpp b/third_party/npapi/npspy/windows/gui_general.cpp new file mode 100644 index 0000000..54e7fc4 --- /dev/null +++ b/third_party/npapi/npspy/windows/gui_general.cpp @@ -0,0 +1,100 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "xp.h" +#include <windowsx.h> + +#include "windowsxx.h" + +#include "resource.h" +#include "logger.h" + +static void onApply(HWND hWnd) +{ + Logger * logger = (Logger *)GetWindowLong(hWnd, DWL_USER); + if(!logger) + return; + + logger->bOnTop = (BST_CHECKED == IsDlgButtonChecked(hWnd, IDC_CHECK_ONTOP)); + logger->bSaveSettings = TRUE; +} + +static void onNotify(HWND hWnd, int idCtrl, LPNMHDR lpNMHdr) +{ + switch(lpNMHdr->code) + { + case PSN_RESET: + break; + case PSN_APPLY: + onApply(hWnd); + break; + } +} + +static BOOL onInitDialog(HWND hWnd, HWND hWndFocus, LPARAM lParam) +{ + Logger * logger = NULL; + + if(lParam) + { + logger = (Logger *)(((PROPSHEETPAGE *)lParam)->lParam); + SetWindowLong(hWnd, DWL_USER, (long)logger); + } + + if(logger) + { + CheckDlgButton(hWnd, IDC_CHECK_ONTOP, logger->bOnTop ? BST_CHECKED : BST_UNCHECKED); + } + + return TRUE; +} + +BOOL CALLBACK GeneralPageProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) + { + case WM_INITDIALOG: + return (BOOL)HANDLE_WM_INITDIALOG(hWnd, wParam, lParam, onInitDialog); + case WM_NOTIFY: + HANDLE_WM_NOTIFY(hWnd, wParam, lParam, onNotify); + break; + + default: + return FALSE; + } + return TRUE; +} diff --git a/third_party/npapi/npspy/windows/gui_log.cpp b/third_party/npapi/npspy/windows/gui_log.cpp new file mode 100644 index 0000000..3d2ab0f --- /dev/null +++ b/third_party/npapi/npspy/windows/gui_log.cpp @@ -0,0 +1,167 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "xp.h" +#include <windowsx.h> + +#include "windowsxx.h" + +#include "resource.h" +#include "logger.h" +#include "dirpick.h" + +static void onChooseDir(HWND hWnd) +{ + Logger * logger = (Logger *)GetWindowLong(hWnd, DWL_USER); + if(!logger) + return; + + char string[_MAX_PATH]; + char name[_MAX_PATH]; + + GetDlgItemText(hWnd, IDC_EDIT_FILE, string, strlen(string)); + char * p = NULL; + p = strrchr(string, '\\'); + if(p) + { + strcpy(name, p); + *p = '\0'; + } + + if(PickupDirectory(hWnd, string)) + { + //check the last character for being '\' + if(string[strlen(string) - 1] == '\\') + string[strlen(string) - 1] = '\0'; + + if(p) + strcat(string, name); + else + { + strcat(string, "\\"); + strcat(string, DEFAULT_LOG_FILE_NAME); + } + SetDlgItemText(hWnd, IDC_EDIT_FILE, string); + } +} + +static void onCommand(HWND hWnd, int id, HWND hWndCtl, UINT codeNotify) +{ + switch (id) + { + case IDC_CHECK_TOFILE: + EnableWindow(GetDlgItem(hWnd, IDC_EDIT_FILE), (BST_CHECKED == IsDlgButtonChecked(hWnd, IDC_CHECK_TOFILE))); + EnableWindow(GetDlgItem(hWnd, IDC_BUTTON_CHOOSEDIR), (BST_CHECKED == IsDlgButtonChecked(hWnd, IDC_CHECK_TOFILE))); + break; + case IDC_BUTTON_CHOOSEDIR: + onChooseDir(hWnd); + break; + default: + break; + } +} + +static void onApply(HWND hWnd) +{ + Logger * logger = (Logger *)GetWindowLong(hWnd, DWL_USER); + if(!logger) + return; + + logger->bToWindow = (BST_CHECKED == IsDlgButtonChecked(hWnd, IDC_CHECK_TOWINDOW)); + logger->bToConsole = (BST_CHECKED == IsDlgButtonChecked(hWnd, IDC_CHECK_TOCONSOLE)); + + char filename[_MAX_PATH]; + GetDlgItemText(hWnd, IDC_EDIT_FILE, filename, strlen(filename)); + logger->setToFile(BST_CHECKED == IsDlgButtonChecked(hWnd, IDC_CHECK_TOFILE), filename); + + logger->bSaveSettings = TRUE; +} + +static void onNotify(HWND hWnd, int idCtrl, LPNMHDR lpNMHdr) +{ + switch(lpNMHdr->code) + { + case PSN_RESET: + break; + case PSN_APPLY: + onApply(hWnd); + break; + } +} + +static BOOL onInitDialog(HWND hWnd, HWND hWndFocus, LPARAM lParam) +{ + Logger * logger = NULL; + + if(lParam) + { + logger = (Logger *)(((PROPSHEETPAGE *)lParam)->lParam); + SetWindowLong(hWnd, DWL_USER, (long)logger); + } + + if(logger) + { + CheckDlgButton(hWnd, IDC_CHECK_TOWINDOW, logger->bToWindow ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hWnd, IDC_CHECK_TOCONSOLE, logger->bToConsole ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hWnd, IDC_CHECK_TOFILE, logger->bToFile ? BST_CHECKED : BST_UNCHECKED); + + SetDlgItemText(hWnd, IDC_EDIT_FILE, logger->szFile); + EnableWindow(GetDlgItem(hWnd, IDC_EDIT_FILE), (BST_CHECKED == IsDlgButtonChecked(hWnd, IDC_CHECK_TOFILE))); + EnableWindow(GetDlgItem(hWnd, IDC_BUTTON_CHOOSEDIR), (BST_CHECKED == IsDlgButtonChecked(hWnd, IDC_CHECK_TOFILE))); + } + + return TRUE; +} + +BOOL CALLBACK LogPageProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) + { + case WM_INITDIALOG: + return (BOOL)HANDLE_WM_INITDIALOG(hWnd, wParam, lParam, onInitDialog); + case WM_COMMAND: + HANDLE_WM_COMMAND(hWnd, wParam, lParam, onCommand); + break; + case WM_NOTIFY: + HANDLE_WM_NOTIFY(hWnd, wParam, lParam, onNotify); + break; + + default: + return FALSE; + } + return TRUE; +} diff --git a/third_party/npapi/npspy/windows/gui_main.cpp b/third_party/npapi/npspy/windows/gui_main.cpp new file mode 100644 index 0000000..37f46a3 --- /dev/null +++ b/third_party/npapi/npspy/windows/gui_main.cpp @@ -0,0 +1,305 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "xp.h" +#include <windowsx.h> + +#include "resource.h" +#include "loggerw.h" +#include "profilew.h" + +extern HINSTANCE hInst; +extern char * ActionName[]; +extern char szAppName[]; + +BOOL CALLBACK GeneralPageProc(HWND, UINT, WPARAM, LPARAM); +BOOL CALLBACK LogPageProc(HWND, UINT, WPARAM, LPARAM); +BOOL CALLBACK FilterPageProc(HWND, UINT, WPARAM, LPARAM); +BOOL CALLBACK AdvancedPageProc(HWND, UINT, WPARAM, LPARAM); + +static void onOptions(HWND hWnd, Logger * logger) +{ + if(!logger) + return; + + PROPSHEETPAGE psp[4]; + + psp[0].dwSize = sizeof(psp[0]); + psp[0].dwFlags = PSP_DEFAULT; + psp[0].hInstance = hInst; + psp[0].pszTemplate = MAKEINTRESOURCE(IDD_PAGE_GENERAL); + psp[0].pszIcon = 0; + psp[0].pfnDlgProc = GeneralPageProc; + psp[0].pszTitle = 0; + psp[0].lParam = (LPARAM)logger; + psp[0].pfnCallback = NULL; + + psp[1].dwSize = sizeof(psp[1]); + psp[1].dwFlags = PSP_DEFAULT; + psp[1].hInstance = hInst; + psp[1].pszTemplate = MAKEINTRESOURCE(IDD_PAGE_LOG); + psp[1].pszIcon = 0; + psp[1].pfnDlgProc = LogPageProc; + psp[1].pszTitle = 0; + psp[1].lParam = (LPARAM)logger; + psp[1].pfnCallback = NULL; + + psp[2].dwSize = sizeof(psp[2]); + psp[2].dwFlags = PSP_DEFAULT; + psp[2].hInstance = hInst; + psp[2].pszTemplate = MAKEINTRESOURCE(IDD_PAGE_FILTER); + psp[2].pszIcon = 0; + psp[2].pfnDlgProc = FilterPageProc; + psp[2].pszTitle = 0; + psp[2].lParam = (LPARAM)logger; + psp[2].pfnCallback = NULL; + + psp[3].dwSize = sizeof(psp[3]); + psp[3].dwFlags = PSP_DEFAULT; + psp[3].hInstance = hInst; + psp[3].pszTemplate = MAKEINTRESOURCE(IDD_PAGE_ADVANCED); + psp[3].pszIcon = 0; + psp[3].pfnDlgProc = AdvancedPageProc; + psp[3].pszTitle = 0; + psp[3].lParam = (LPARAM)logger; + psp[3].pfnCallback = NULL; + + PROPSHEETHEADER psh; + psh.dwSize = sizeof(PROPSHEETHEADER); + psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW; + psh.hwndParent = hWnd; + psh.hInstance = hInst; + psh.pszIcon = 0; + psh.pszCaption = "Settings"; + psh.nPages = sizeof(psp) / sizeof(psp[0]); + psh.nStartPage = 0; + psh.ppsp = psp; + psh.pfnCallback = NULL; + + logger->bSaveSettings = FALSE; + + int rv = PropertySheet(&psh); + if(rv == -1) + return; + + if(logger->bSaveSettings) + { + ProfileWin profile; + + if(hWnd != NULL) + { + RECT rc; + if(GetWindowRect(hWnd, &rc)) + profile.setSizeAndPosition(rc.right - rc.left, rc.bottom - rc.top, rc.left, rc.top); + } + + profile.setBool(NPSPY_REG_KEY_ONTOP, logger->bOnTop); + profile.setBool(NPSPY_REG_KEY_LOGTOWINDOW, logger->bToWindow); + profile.setBool(NPSPY_REG_KEY_LOGTOCONSOLE, logger->bToConsole); + profile.setBool(NPSPY_REG_KEY_LOGTOFILE, logger->bToFile); + profile.setBool(NPSPY_REG_KEY_SPALID, logger->bSPALID); + profile.setString(NPSPY_REG_KEY_LOGFILENAME, logger->szFile); + + for(int i = 1; i < TOTAL_NUMBER_OF_API_CALLS; i++) + profile.setBool(ActionName[i], !logger->bMutedCalls[i]); + + SetWindowPos(hWnd, logger->bOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0,0,0,0,SWP_NOMOVE|SWP_NOSIZE); + } + + logger->bSaveSettings = FALSE; +} + +static void onCommand(HWND hWnd, int id, HWND hWndCtl, UINT codeNotify) +{ + LoggerWin * logger = (LoggerWin *)GetWindowLong(hWnd, DWL_USER); + switch (id) + { + case IDC_CHECK_MUTE: + if(logger) + logger->bMutedAll = (BST_CHECKED == IsDlgButtonChecked(hWnd, IDC_CHECK_MUTE)); + break; + case IDC_BUTTON_OPTIONS: + onOptions(hWnd, logger); + break; + case IDC_BUTTON_CLEAR: + if(logger) + logger->onClear(); + break; + default: + break; + } +} + +static BOOL onInitDialog(HWND hWnd, HWND hWndFocus, LPARAM lParam) +{ + LoggerWin * logger = (LoggerWin *)lParam; + SetWindowLong(hWnd, DWL_USER, (long)logger); + SetWindowText(hWnd, szAppName); + HFONT hFont = GetStockFont(ANSI_FIXED_FONT); + SetWindowFont(GetDlgItem(hWnd, IDC_MAIN_OUTPUT), hFont, FALSE); + + if(logger) + { + CheckDlgButton(hWnd, IDC_CHECK_MUTE, logger->bMutedAll ? BST_CHECKED : BST_UNCHECKED); + if(logger->width && logger->height) + SetWindowPos(hWnd, NULL, logger->x, logger->y, logger->width, logger->height, SWP_NOZORDER); + + SetWindowPos(hWnd, logger->bOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE); + } + return TRUE; +} + +static void onDestroy(HWND hWnd) +{ + LoggerWin * logger = (LoggerWin *)GetWindowLong(hWnd, DWL_USER); + if(logger) + logger->onDestroyWindow(); +} + +static void onSize(HWND hWnd, UINT state, int cx, int cy) +{ + long bu = GetDialogBaseUnits(); + int bux = LOWORD(bu); + int buy = HIWORD(bu); + int factorx = bux/4; + int factory = buy/8; + + int marginLeft = 7 * factorx; + int marginRight = 0 * factorx; + int marginTop = 0 * factory; + int marginBottom = 7 * factory; + int spaceHor = 4 * factorx; + int spaceVer = 7 * factory; + + HWND hWndOutput = GetDlgItem(hWnd, IDC_MAIN_OUTPUT); + HWND hWndCheckMute = GetDlgItem(hWnd, IDC_CHECK_MUTE); + HWND hWndCheckOntop = GetDlgItem(hWnd, IDC_CHECK_ONTOP); + HWND hWndButtonOptions = GetDlgItem(hWnd, IDC_BUTTON_OPTIONS); + HWND hWndClear = GetDlgItem(hWnd, IDC_BUTTON_CLEAR); + + RECT rcMain; + GetClientRect(hWnd, &rcMain); + + int width = rcMain.right - rcMain.left; + int height = rcMain.bottom - rcMain.top; + + RECT rcButtonOptions; + GetWindowRect(hWndButtonOptions, &rcButtonOptions); + SetWindowPos(hWndButtonOptions, NULL, + width - marginLeft - rcButtonOptions.right + rcButtonOptions.left, + height - rcButtonOptions.bottom + rcButtonOptions.top - marginBottom, + 0, 0, SWP_NOZORDER | SWP_NOSIZE); + + RECT rcClear; + GetWindowRect(hWndClear, &rcClear); + SetWindowPos(hWndClear, NULL, + width - marginLeft - rcClear.right + rcClear.left - rcButtonOptions.right + rcButtonOptions.left - spaceHor, + height - rcClear.bottom + rcClear.top - marginBottom, + 0, 0, SWP_NOZORDER | SWP_NOSIZE); + + RECT rcCheckMute; + GetWindowRect(hWndCheckMute, &rcCheckMute); + SetWindowPos(hWndCheckMute, NULL, + marginLeft, + height - rcCheckMute.bottom + rcCheckMute.top - marginBottom, + 0, 0, SWP_NOZORDER | SWP_NOSIZE); + + RECT rcCheckOntop; + GetWindowRect(hWndCheckOntop, &rcCheckOntop); + SetWindowPos(hWndCheckOntop, NULL, + marginLeft + rcCheckMute.right - rcCheckMute.left + spaceHor, + height - rcCheckOntop.bottom + rcCheckOntop.top - marginBottom, + 0, 0, SWP_NOZORDER | SWP_NOSIZE); + + SetWindowPos(hWndOutput, NULL, + 0, 0, + width, + height - rcButtonOptions.bottom + rcButtonOptions.top - marginBottom - marginTop - spaceVer, + SWP_NOZORDER | SWP_NOMOVE); + + // somehow the Clear button doesn't redraw itself well, so force it + InvalidateRect(hWndClear, NULL, TRUE); + UpdateWindow(hWndClear); +} + +BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) + { + case WM_INITDIALOG: + return (BOOL)HANDLE_WM_INITDIALOG(hWnd, wParam, lParam, onInitDialog); + case WM_COMMAND: + HANDLE_WM_COMMAND(hWnd, wParam, lParam, onCommand); + break; + case WM_CLOSE: + DestroyWindow(hWnd); + break; + case WM_DESTROY: + HANDLE_WM_DESTROY(hWnd, wParam, lParam, onDestroy); + break; + case WM_SIZE: + HANDLE_WM_SIZE(hWnd, wParam, lParam, onSize); + break; + + default: + return FALSE; + } + return TRUE; +} + +// This is exported function which allows to access Settings GUI from other applications +void WINAPI SPY_Setup() +{ + LoggerWin logger; + ProfileWin profile; + + profile.getBool(NPSPY_REG_KEY_ONTOP, &logger.bOnTop); + profile.getBool(NPSPY_REG_KEY_LOGTOWINDOW, &logger.bToWindow); + profile.getBool(NPSPY_REG_KEY_LOGTOCONSOLE, &logger.bToConsole); + profile.getBool(NPSPY_REG_KEY_LOGTOFILE, &logger.bToFile); + profile.getBool(NPSPY_REG_KEY_SPALID, &logger.bSPALID); + profile.getString(NPSPY_REG_KEY_LOGFILENAME, logger.szFile, strlen(logger.szFile)); + + for(int i = 1; i < TOTAL_NUMBER_OF_API_CALLS; i++) + { + BOOL selected = TRUE; + if(profile.getBool(ActionName[i], &selected)) + logger.bMutedCalls[i] = !selected; + } + + onOptions(NULL, &logger); +}
\ No newline at end of file diff --git a/third_party/npapi/npspy/windows/gui_pause.cpp b/third_party/npapi/npspy/windows/gui_pause.cpp new file mode 100644 index 0000000..683abdd --- /dev/null +++ b/third_party/npapi/npspy/windows/gui_pause.cpp @@ -0,0 +1,81 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "xp.h" +#include <windowsx.h> + +#include "resource.h" + +static void onCommand(HWND hWnd, int id, HWND hWndCtl, UINT codeNotify) +{ + switch (id) + { + case IDOK: + EndDialog(hWnd, IDOK); + break; + case IDCANCEL: + EndDialog(hWnd, IDCANCEL); + break; + default: + break; + } +} + +static BOOL onInitDialog(HWND hWnd, HWND hWndFocus, LPARAM lParam) +{ + SetWindowPos(hWnd, NULL, 0,0,0,0, SWP_NOZORDER); + return TRUE; +} + +BOOL CALLBACK PauseDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) + { + case WM_INITDIALOG: + return (BOOL)HANDLE_WM_INITDIALOG(hWnd, wParam, lParam, onInitDialog); + case WM_COMMAND: + HANDLE_WM_COMMAND(hWnd, wParam, lParam, onCommand); + break; + case WM_CLOSE: + EndDialog(hWnd, IDCANCEL); + break; + + default: + return FALSE; + } + return TRUE; +} diff --git a/third_party/npapi/npspy/windows/loggerw.cpp b/third_party/npapi/npspy/windows/loggerw.cpp new file mode 100644 index 0000000..b3e6dd5 --- /dev/null +++ b/third_party/npapi/npspy/windows/loggerw.cpp @@ -0,0 +1,203 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include "xp.h" +#include "windowsx.h" + +#include "resource.h" +#include "loggerw.h" +#include "profilew.h" +#include "actionnames.h" + +extern HINSTANCE hInst; +static char szClassName[] = "NPSpyWindowClass"; + +BOOL CALLBACK MainDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); +BOOL CALLBACK PauseDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + +LoggerWin::LoggerWin() : Logger(), + hWnd(NULL), + width(0), + height(0), + x(0), + y(0), + bSaveSettings(FALSE) +{ +} + +LoggerWin::~LoggerWin() +{ +} + +BOOL LoggerWin::platformInit() +{ + WNDCLASS wc; + wc.style = 0; + wc.lpfnWndProc = DefDlgProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = DLGWINDOWEXTRA; + wc.hInstance = hInst; + wc.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON_APP)); + wc.hCursor = LoadCursor(0, IDC_ARROW); + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); + wc.lpszMenuName = NULL; + wc.lpszClassName = szClassName; + + if(!RegisterClass(&wc)) + return FALSE; + + // restore prefs + ProfileWin profile; + + profile.getBool(NPSPY_REG_KEY_ONTOP, &bOnTop); + bOnTop = false; // XXXMB + profile.getBool(NPSPY_REG_KEY_LOGTOWINDOW, &bToWindow); + profile.getBool(NPSPY_REG_KEY_LOGTOCONSOLE, &bToConsole); + profile.getBool(NPSPY_REG_KEY_LOGTOFILE, &bToFile); + profile.getBool(NPSPY_REG_KEY_SPALID, &bSPALID); + profile.getString(NPSPY_REG_KEY_LOGFILENAME, szFile, strlen(szFile)); + + for(int i = 1; i < TOTAL_NUMBER_OF_API_CALLS; i++) + { + BOOL selected = TRUE; + if(profile.getBool(ActionName[i], &selected)) + bMutedCalls[i] = !selected; + } + + if(!profile.getSizeAndPosition(&width, &height, &x, &y)) + { + width = 0; + height = 0; + x = 0; + y = 0; + } + + hWnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_DIALOG_MAIN), GetDesktopWindow(), (DLGPROC)MainDlgProc, (LPARAM)this); + if(hWnd == NULL) + { + UnregisterClass(szClassName, hInst); + return FALSE; + } + + if(bOnTop) + SetWindowPos(hWnd, bOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE); + + return TRUE; +} + +void LoggerWin::platformShut() +{ + if(hWnd != NULL) + { + char szLog[] = "--- GOING AWAY... PRESS SPACE BAR TO CONTINUE ---"; + HWND hWndOutput = GetDlgItem(hWnd, IDC_MAIN_OUTPUT); + ListBox_AddString(hWndOutput, ""); + ListBox_AddString(hWndOutput, szLog); + int count = ListBox_GetCount(hWndOutput); + ListBox_SetCaretIndex(hWndOutput, count - 1); + UpdateWindow(hWndOutput); + + DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOG_PAUSE), hWnd, (DLGPROC)PauseDlgProc); + + ProfileWin profile; + + RECT rc; + if(GetWindowRect(hWnd, &rc)) + profile.setSizeAndPosition(rc.right - rc.left, rc.bottom - rc.top, rc.left, rc.top); + + DestroyWindow(hWnd); + hWnd = NULL; + } + + UnregisterClass(szClassName, hInst); +} + +void LoggerWin::onDestroyWindow() +{ + hWnd = NULL; +} + +void LoggerWin::dumpStringToMainWindow(char * string) +{ + bool free_string = false; + // listboxes don't want <CR> and <LF> so cut them off if any. The order is important. + char * p = strrchr(string, '\n'); + if(p) { + // make copy of string since it might be a constant + char* temp = string; + string = (char*)malloc(strlen(temp) + 1); + strcpy(string, temp); + free_string = true; + + p = strrchr(string, '\n'); + *p = '\0'; + + p = strrchr(string, '\r'); + if(p) + *p = '\0'; + } + + HWND hWndOutput = GetDlgItem(hWnd, IDC_MAIN_OUTPUT); + ListBox_AddString(hWndOutput, string); + int count = ListBox_GetCount(hWndOutput); + if(count == 32767) + ListBox_ResetContent(hWndOutput); + ListBox_SetCaretIndex(hWndOutput, count - 1); + UpdateWindow(hWndOutput); + + if (free_string) + free(string); +} + +void LoggerWin::onClear() +{ + HWND hWndOutput = GetDlgItem(hWnd, IDC_MAIN_OUTPUT); + ListBox_ResetContent(hWndOutput); + UpdateWindow(hWndOutput); +} + +Logger * NewLogger() +{ + LoggerWin * res = new LoggerWin(); + return res; +} + +void DeleteLogger(Logger * logger) +{ + if(logger) + delete logger; +}
\ No newline at end of file diff --git a/third_party/npapi/npspy/windows/loggerw.h b/third_party/npapi/npspy/windows/loggerw.h new file mode 100644 index 0000000..599d255 --- /dev/null +++ b/third_party/npapi/npspy/windows/loggerw.h @@ -0,0 +1,64 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef __LOGGRERW_H__ +#define __LOGGRERW_H__ + +#include "logger.h" + +class LoggerWin : public Logger +{ +public: + HWND hWnd; + int width; + int height; + int x; + int y; + BOOL bSaveSettings; + + LoggerWin(); + ~LoggerWin(); + + BOOL platformInit(); + void platformShut(); + void dumpStringToMainWindow(char * string); + + void onDestroyWindow(); + void onClear(); +}; + +#endif diff --git a/third_party/npapi/npspy/windows/npspy.def b/third_party/npapi/npspy/windows/npspy.def new file mode 100644 index 0000000..655a228 --- /dev/null +++ b/third_party/npapi/npspy/windows/npspy.def @@ -0,0 +1,45 @@ +; -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +; +; ***** BEGIN LICENSE BLOCK ***** +; Version: MPL 1.1/GPL 2.0/LGPL 2.1 +; +; The contents of this file are subject to the Mozilla Public License Version +; 1.1 (the "License"); you may not use this file except in compliance with +; the License. You may obtain a copy of the License at +; http://www.mozilla.org/MPL/ +; +; Software distributed under the License is distributed on an "AS IS" basis, +; WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +; for the specific language governing rights and limitations under the +; License. +; +; The Original Code is mozilla.org code. +; +; The Initial Developer of the Original Code is +; Netscape Communications Corporation. +; Portions created by the Initial Developer are Copyright (C) 1998 +; the Initial Developer. All Rights Reserved. +; +; Contributor(s): +; +; Alternatively, the contents of this file may be used under the terms of +; either the GNU General Public License Version 2 or later (the "GPL"), or +; the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +; in which case the provisions of the GPL or the LGPL are applicable instead +; of those above. If you wish to allow use of your version of this file only +; under the terms of either the GPL or the LGPL, and not to allow others to +; use your version of this file under the terms of the MPL, indicate your +; decision by deleting the provisions above and replace them with the notice +; and other provisions required by the GPL or the LGPL. If you do not delete +; the provisions above, a recipient may use your version of this file under +; the terms of any one of the MPL, the GPL or the LGPL. +; +; ***** END LICENSE BLOCK ***** + +LIBRARY NPSPY + +EXPORTS + NP_GetEntryPoints @1 + NP_Initialize @2 + NP_Shutdown @3 + SPY_Setup @4
\ No newline at end of file diff --git a/third_party/npapi/npspy/windows/npspy.rc b/third_party/npapi/npspy/windows/npspy.rc new file mode 100644 index 0000000..96244d3 --- /dev/null +++ b/third_party/npapi/npspy/windows/npspy.rc @@ -0,0 +1,352 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winresrc.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// +// NOTE: Made this look like flash! + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "mozilla.org\0" + VALUE "FileDescription", "Spy plugin\0" + VALUE "FileExtents", "*\0" + VALUE "FileOpenName", "Macromedia Flash movie (*.swf)|FutureSplash movie (*.spl)|Macromedia Flash Paper (*.mfp)|*|any name (*.*)\0" + VALUE "FileVersion", "8, 0, 24, 0\0" + VALUE "InternalName", "Macromedia Flash Player 8.0\0" + VALUE "LegalCopyright", "Copyright © 2001-\0" + VALUE "LegalTrademarks", "\0" + VALUE "MIMEType", "application/x-shockwave-flash|video/quicktime|application/x-mplayer2|*\0" + VALUE "OriginalFilename", "NPSPY.DLL\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Shockwave Flash\0" + VALUE "ProductVersion", "8, 0, 24, 0\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // !_MAC + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DIALOG_MAIN DIALOG DISCARDABLE 0, 0, 322, 212 +STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | + WS_SYSMENU | WS_THICKFRAME +CAPTION "Dialog" +CLASS "NPSpyWindowClass" +FONT 8, "MS Sans Serif" +BEGIN + LISTBOX IDC_MAIN_OUTPUT,0,0,321,185,LBS_MULTIPLESEL | + LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | + WS_TABSTOP + CONTROL "&Mute",IDC_CHECK_MUTE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,195,32,10 + PUSHBUTTON "&Clear",IDC_BUTTON_CLEAR,209,191,50,14 + PUSHBUTTON "&Settings...",IDC_BUTTON_OPTIONS,263,191,50,14 +END + +IDD_DIALOG_PAUSE DIALOG DISCARDABLE 0, 0, 64, 29 +STYLE WS_POPUP +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,7,7,50,14 +END + +IDD_PAGE_GENERAL DIALOG DISCARDABLE 0, 0, 238, 246 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "General" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Always on &top",IDC_CHECK_ONTOP,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,23,60,10 + GROUPBOX "Window",IDC_STATIC,7,7,224,32 +END + +IDD_PAGE_FILTER DIALOG DISCARDABLE 0, 0, 238, 246 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Filter" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Select calls to log",IDC_STATIC,7,7,224,232 + CONTROL "NPN_Version",IDC_CHECK_NPN_VERSION,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,22,59,10 + CONTROL "NPN_GetURLNotify",IDC_CHECK_NPN_GETURLNOTIFY,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,32,79,10 + CONTROL "NPN_GetURL",IDC_CHECK_NPN_GETURL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,41,61,10 + CONTROL "NPN_PostURLNotify",IDC_CHECK_NPN_POSTURLNOTIFY,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,51,82,10 + CONTROL "NPN_PostURL",IDC_CHECK_NPN_POSTURL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,61,64,10 + CONTROL "NPN_RequestRead",IDC_CHECK_NPN_REQUESTREAD,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,70,79,10 + CONTROL "NPN_NewStream",IDC_CHECK_NPN_NEWSTREAM,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,80,72,10 + CONTROL "NPN_Write",IDC_CHECK_NPN_WRITE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,15,89,52,10 + CONTROL "NPN_DestroyStream",IDC_CHECK_NPN_DESTROYSTREAM,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,99,81,10 + CONTROL "NPN_Status",IDC_CHECK_NPN_STATUS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,109,55,10 + CONTROL "NPN_UserAgent",IDC_CHECK_NPN_ESERAGENT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,118,69,10 + CONTROL "NPN_MemAlloc",IDC_CHECK_NPN_MEMALLOC,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,128,66,10 + CONTROL "NPN_MemFree",IDC_CHECK_NPN_MEMFREE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,137,65,10 + CONTROL "NPN_MemFlush",IDC_CHECK_NPN_MEMFLUSH,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,147,67,10 + CONTROL "NPN_ReloadPlugins",IDC_CHECK_NPN_RELOADPLUGINS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,157,81,10 + CONTROL "NPN_GetJavaEnv",IDC_CHECK_NPN_GETJAVAENV,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,166,75,10 + CONTROL "NPN_GetJavaPeer",IDC_CHECK_NPN_GETJAVAPEER,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,176,77,10 + CONTROL "NPN_GetValue",IDC_CHECK_NPN_GETVALUE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,185,65,10 + CONTROL "NPN_SetValue",IDC_CHECK_NPN_SETVALUE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,195,64,10 + CONTROL "NPN_InvalidateRect",IDC_CHECK_NPN_INVALIDATEREGION, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,205,81,10 + CONTROL "NPN_InvalidateRegion",IDC_CHECK_NPNINVALIDATEREGION, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,214,89,10 + CONTROL "NPN_ForceRedraw",IDC_CHECK_NPN_FORCEREDRAW,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,224,78,10 + CONTROL "NPP_New",IDC_CHECK_NPP_NEW,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,140,22,49,10 + CONTROL "NPP_Destroy",IDC_CHECK_NPP_DESTROY,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,140,32,59,10 + CONTROL "NPP_SetWindow",IDC_CHECK_NPP_SETWINDOW,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,140,41,71,10 + CONTROL "NPP_NewStream",IDC_CHECK_NPP_NEWSTREAM,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,140,51,71,10 + CONTROL "NPP_DestroyStream",IDC_CHECK_NPP_DESTROYSTREAM,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,140,61,81,10 + CONTROL "NPP_StreamAsFile",IDC_CHECK_NPP_STREAMASFILE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,140,70,75,10 + CONTROL "NPP_Write",IDC_CHECK_NPP_WRITE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,140,80,51,10 + CONTROL "NPP_WriteReady",IDC_CHECK_NPP_WRITEREADY,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,140,89,72,10 + CONTROL "NPP_Print",IDC_CHECK_NPP_PRINT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,140,99,49,10 + CONTROL "NPP_HandleEvent",IDC_CHECK_NPP_HANDLEEVENT,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,140,109,76,10 + CONTROL "NPP_URLNotify",IDC_CHECK_NPP_URLNOTIFY,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,140,118,67,10 + CONTROL "NPP_GetJavaClass",IDC_CHECK_NPP_GETJAVACLASS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,140,128,78,10 + CONTROL "NPP_GetValue",IDC_CHECK_NPP_GETVALUE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,140,137,64,10 + CONTROL "NPP_SetValue",IDC_CHECK_NPP_SETVALUE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,140,147,63,10 + PUSHBUTTON "&Check All",IDC_BUTTON_CHECKALL,169,198,50,14 + PUSHBUTTON "C&lear All",IDC_BUTTON_CLEARALL,169,216,50,14 +END + +IDD_PAGE_LOG DIALOG DISCARDABLE 0, 0, 238, 246 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Log" +FONT 8, "MS Sans Serif" +BEGIN + GROUPBOX "Choose where to output",IDC_STATIC,7,7,224,66 + CONTROL "To &window",IDC_CHECK_TOWINDOW,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,15,23,51,10 + CONTROL "To c&onsole",IDC_CHECK_TOCONSOLE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,15,37,51,10 + CONTROL "To &file",IDC_CHECK_TOFILE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,15,51,35,10 + EDITTEXT IDC_EDIT_FILE,52,49,152,14,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_BUTTON_CHOOSEDIR,206,49,19,14 +END + +IDD_PAGE_ADVANCED DIALOG DISCARDABLE 0, 0, 238, 246 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Advanced" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "&Shutdown immediately after the last instance destroyed", + IDC_CHECK_SPALID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 15,23,188,10 + GROUPBOX "Shutdown policy",IDC_STATIC,7,7,224,88 + LTEXT "Use this option to emulate 4.x behaviour when NP_Shutdown is called after the last plugin instance is destroyed. If this box is checked the Spy Plugin will call NP_Shutdown after NPP_Destroy is called on last instance.", + IDC_STATIC,15,39,209,33 + LTEXT "If this box is unchecked NP_Shutdown will be issued only when the Navigator commands so.", + IDC_STATIC,15,71,209,19 +END + +ID_DIALOG_CHOOSEDIR DIALOG DISCARDABLE 0, 0, 228, 143 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Choose Directory" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "Directory &Name:",-1,7,9,55,8 + EDITTEXT ID_EDIT_DIR,7,20,151,13,ES_AUTOHSCROLL + LISTBOX ID_LIST_DIR,7,33,151,74,LBS_OWNERDRAWFIXED | + LBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + LTEXT "Dri&ves:",-1,7,111,26,8 + COMBOBOX ID_COMBO_DIR,7,121,151,68,CBS_DROPDOWNLIST | + CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | WS_VSCROLL | + WS_TABSTOP + DEFPUSHBUTTON "OK",IDOK,171,9,50,14 + PUSHBUTTON "Cancel",IDCANCEL,171,27,50,14 + LISTBOX ID_LISTTEMP_DIR,181,53,20,40,LBS_SORT | + LBS_NOINTEGRALHEIGHT | NOT WS_VISIBLE | WS_VSCROLL | + WS_TABSTOP +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_DIALOG_MAIN, DIALOG + BEGIN + BOTTOMMARGIN, 205 + END + + IDD_DIALOG_PAUSE, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 57 + TOPMARGIN, 7 + BOTTOMMARGIN, 22 + END + + IDD_PAGE_GENERAL, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 231 + TOPMARGIN, 7 + BOTTOMMARGIN, 239 + END + + IDD_PAGE_FILTER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 231 + TOPMARGIN, 7 + BOTTOMMARGIN, 239 + END + + IDD_PAGE_LOG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 231 + TOPMARGIN, 7 + BOTTOMMARGIN, 239 + END + + IDD_PAGE_ADVANCED, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 231 + TOPMARGIN, 7 + BOTTOMMARGIN, 239 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON_APP ICON DISCARDABLE "res/icon.ico" +ID_ICON_DRIVECDROM ICON DISCARDABLE "res/cdrom.ICO" +ID_ICON_DRIVEFLOPPY ICON DISCARDABLE "res/floppy.ICO" +ID_ICON_DRIVEHARD ICON DISCARDABLE "res/harddr.ICO" +ID_ICON_DRIVENETWORK ICON DISCARDABLE "res/netdr.ICO" +ID_ICON_DRIVERAM ICON DISCARDABLE "res/ramdr.ICO" +ID_ICON_FOLDERCLOSED ICON DISCARDABLE "res/foldcl.ICO" +ID_ICON_FOLDEROPEN ICON DISCARDABLE "res/foldop.ICO" +ID_ICON_OPENSELECT ICON DISCARDABLE "res/foldopse.ICO" +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/third_party/npapi/npspy/windows/npspy.sln b/third_party/npapi/npspy/windows/npspy.sln new file mode 100644 index 0000000..0e573eb --- /dev/null +++ b/third_party/npapi/npspy/windows/npspy.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "npspy", "npspy.vcproj", "{BC7D34B8-CF4C-442C-ACC4-0DFAC3EDA19C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "spysetup", "spysetup.vcproj", "{8489E6BA-49E8-4F84-BC9E-D500D6DD3C8A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {BC7D34B8-CF4C-442C-ACC4-0DFAC3EDA19C}.Debug|Win32.ActiveCfg = Debug|Win32 + {BC7D34B8-CF4C-442C-ACC4-0DFAC3EDA19C}.Debug|Win32.Build.0 = Debug|Win32 + {BC7D34B8-CF4C-442C-ACC4-0DFAC3EDA19C}.Release|Win32.ActiveCfg = Release|Win32 + {BC7D34B8-CF4C-442C-ACC4-0DFAC3EDA19C}.Release|Win32.Build.0 = Release|Win32 + {8489E6BA-49E8-4F84-BC9E-D500D6DD3C8A}.Debug|Win32.ActiveCfg = Debug|Win32 + {8489E6BA-49E8-4F84-BC9E-D500D6DD3C8A}.Debug|Win32.Build.0 = Debug|Win32 + {8489E6BA-49E8-4F84-BC9E-D500D6DD3C8A}.Release|Win32.ActiveCfg = Release|Win32 + {8489E6BA-49E8-4F84-BC9E-D500D6DD3C8A}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/third_party/npapi/npspy/windows/npspy.vcproj b/third_party/npapi/npspy/windows/npspy.vcproj new file mode 100644 index 0000000..fc416b6 --- /dev/null +++ b/third_party/npapi/npspy/windows/npspy.vcproj @@ -0,0 +1,783 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="npspy" + ProjectGUID="{BC7D34B8-CF4C-442C-ACC4-0DFAC3EDA19C}" + RootNamespace="npspy" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory=".\Debug" + IntermediateDirectory=".\Debug" + ConfigurationType="2" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="_DEBUG" + MkTypLibCompatible="true" + SuppressStartupBanner="true" + TargetEnvironment="1" + TypeLibraryName=".\Debug/npspy.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="..\include;..\extern\plugin;..\extern\java;..\extern\nspr;c:\work\oss\firefox\mozilla\modules\plugin\base\public;"c:\work\oss\firefox\mozilla\firefox-objdir\dist\sdk\include"" + PreprocessorDefinitions="XP_WIN;WIN32;_DEBUG;_WINDOWS;_USRDLL;NPSPY_EXPORTS;OJI" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + PrecompiledHeaderFile=".\Debug/npspy.pch" + AssemblerListingLocation=".\Debug/" + ObjectFile=".\Debug/" + ProgramDataBaseFileName=".\Debug/" + WarningLevel="3" + SuppressStartupBanner="true" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="version.lib comctl32.lib mpr.lib" + OutputFile="Debug\npspy.dll" + LinkIncremental="2" + SuppressStartupBanner="true" + ModuleDefinitionFile=".\npspy.def" + GenerateDebugInformation="true" + ProgramDatabaseFile=".\Debug/npspy.pdb" + ImportLibrary=".\Debug/npspy.lib" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + SuppressStartupBanner="true" + OutputFile=".\Debug/npspy.bsc" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory=".\Release" + IntermediateDirectory=".\Release" + ConfigurationType="2" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="NDEBUG" + MkTypLibCompatible="true" + SuppressStartupBanner="true" + TargetEnvironment="1" + TypeLibraryName=".\Release/npspy.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + InlineFunctionExpansion="1" + AdditionalIncludeDirectories="..\include,..\..\..\..\..\dist\include,..\..\..\..\..\dist\include\nspr" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;NPSPY_EXPORTS" + StringPooling="true" + RuntimeLibrary="0" + EnableFunctionLevelLinking="true" + PrecompiledHeaderFile=".\Release/npspy.pch" + AssemblerListingLocation=".\Release/" + ObjectFile=".\Release/" + ProgramDataBaseFileName=".\Release/" + WarningLevel="3" + SuppressStartupBanner="true" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + OutputFile=".\Release/npspy.dll" + LinkIncremental="1" + SuppressStartupBanner="true" + ModuleDefinitionFile=".\npspy.def" + ProgramDatabaseFile=".\Release/npspy.pdb" + ImportLibrary=".\Release/npspy.lib" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + SuppressStartupBanner="true" + OutputFile=".\Release/npspy.bsc" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > + <File + RelativePath="dirpick.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\common\epmanager.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\common\format.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="gui_advanced.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="gui_fiter.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="gui_general.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="gui_log.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="gui_main.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="gui_pause.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\common\logfile.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\common\logger.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="loggerw.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\common\np_entry.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\common\npn_gate.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\common\npp_gate.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="npspy.def" + > + </File> + <File + RelativePath="npspy.rc" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\common\plugload.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\common\profile.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="profilew.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="..\common\utils.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + <File + RelativePath="winentry.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl" + > + <File + RelativePath="..\include\actionnames.h" + > + </File> + <File + RelativePath="..\include\dirpick.h" + > + </File> + <File + RelativePath="..\include\epmanager.h" + > + </File> + <File + RelativePath="..\include\format.h" + > + </File> + <File + RelativePath="..\include\logfile.h" + > + </File> + <File + RelativePath="..\include\logger.h" + > + </File> + <File + RelativePath="loggerw.h" + > + </File> + <File + RelativePath="..\include\plugload.h" + > + </File> + <File + RelativePath="..\include\profile.h" + > + </File> + <File + RelativePath="profilew.h" + > + </File> + <File + RelativePath="resource.h" + > + </File> + <File + RelativePath="windowsxx.h" + > + </File> + <File + RelativePath="..\include\xp.h" + > + </File> + </Filter> + <Filter + Name="Resource Files" + Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" + > + <File + RelativePath="res\cdrom.ico" + > + </File> + <File + RelativePath="res\floppy.ico" + > + </File> + <File + RelativePath="res\foldcl.ico" + > + </File> + <File + RelativePath="res\foldop.ico" + > + </File> + <File + RelativePath="res\foldopse.ico" + > + </File> + <File + RelativePath="res\harddr.ico" + > + </File> + <File + RelativePath="res\icon.ico" + > + </File> + <File + RelativePath="res\netdr.ico" + > + </File> + <File + RelativePath="res\ramdr.ico" + > + </File> + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/third_party/npapi/npspy/windows/profilew.cpp b/third_party/npapi/npspy/windows/profilew.cpp new file mode 100644 index 0000000..d97915e --- /dev/null +++ b/third_party/npapi/npspy/windows/profilew.cpp @@ -0,0 +1,152 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#include <windows.h> + +#include "profilew.h" + +ProfileWin::ProfileWin() : Profile() +{ + hKey = NULL; + char szClass[] = "SpyPluginClass"; + DWORD disp = 0L; + + LONG res = RegCreateKeyEx(HKEY_LOCAL_MACHINE, + NPSPY_REG_SUBKEY, + 0L, + szClass, + 0L, + KEY_READ | KEY_WRITE, + NULL, + &hKey, + &disp); + + if(res != ERROR_SUCCESS) + hKey = NULL; +} + +ProfileWin::~ProfileWin() +{ + if(hKey) + RegCloseKey(hKey); +} + +BOOL ProfileWin::getBool(char * key, BOOL * value) +{ + if(!value) + return FALSE; + + DWORD size = sizeof(DWORD); + DWORD val = 1L; + LONG res = RegQueryValueEx(hKey, key, 0L, NULL, (BYTE *)&val, &size); + + if(res != ERROR_SUCCESS) + return FALSE; + + *value = (val == 0L) ? FALSE : TRUE; + + return TRUE; +} + +BOOL ProfileWin::setBool(char * key, BOOL value) +{ + DWORD size = sizeof(DWORD); + DWORD val = value ? 1L : 0L; + LONG res = RegSetValueEx(hKey, key, 0L, REG_DWORD, (const BYTE *)&val, size); + return (res == ERROR_SUCCESS); +} + +BOOL ProfileWin::getString(char * key, char * string, int size) +{ + LONG res = RegQueryValueEx(hKey, key, 0L, NULL, (BYTE *)string, (DWORD *)&size); + return (res == ERROR_SUCCESS); +} + +BOOL ProfileWin::setString(char * key, char * string) +{ + DWORD size = strlen(string); + LONG res = RegSetValueEx(hKey, key, 0L, REG_SZ, (const BYTE *)string, size); + return (res == ERROR_SUCCESS); +} + +BOOL ProfileWin::getSizeAndPosition(int *width, int *height, int *x, int *y) +{ + DWORD size = sizeof(DWORD); + LONG res = ERROR_SUCCESS; + + res = RegQueryValueEx(hKey, NPSPY_REG_KEY_WIDTH, 0L, NULL, (BYTE *)width, &size); + if(res != ERROR_SUCCESS) + return FALSE; + + res = RegQueryValueEx(hKey, NPSPY_REG_KEY_HEIGHT, 0L, NULL, (BYTE *)height, &size); + if(res != ERROR_SUCCESS) + return FALSE; + + res = RegQueryValueEx(hKey, NPSPY_REG_KEY_X, 0L, NULL, (BYTE *)x, &size); + if(res != ERROR_SUCCESS) + return FALSE; + + res = RegQueryValueEx(hKey, NPSPY_REG_KEY_Y, 0L, NULL, (BYTE *)y, &size); + if(res != ERROR_SUCCESS) + return FALSE; + + return TRUE; +} + +BOOL ProfileWin::setSizeAndPosition(int width, int height, int x, int y) +{ + DWORD size = sizeof(DWORD); + LONG res = ERROR_SUCCESS; + + res = RegSetValueEx(hKey, NPSPY_REG_KEY_WIDTH, 0L, REG_DWORD, (const BYTE *)&width, size); + if(res != ERROR_SUCCESS) + return FALSE; + + res = RegSetValueEx(hKey, NPSPY_REG_KEY_HEIGHT, 0L, REG_DWORD, (const BYTE *)&height, size); + if(res != ERROR_SUCCESS) + return FALSE; + + res = RegSetValueEx(hKey, NPSPY_REG_KEY_X, 0L, REG_DWORD, (const BYTE *)&x, size); + if(res != ERROR_SUCCESS) + return FALSE; + + res = RegSetValueEx(hKey, NPSPY_REG_KEY_Y, 0L, REG_DWORD, (const BYTE *)&y, size); + if(res != ERROR_SUCCESS) + return FALSE; + + return TRUE; +} diff --git a/third_party/npapi/npspy/windows/profilew.h b/third_party/npapi/npspy/windows/profilew.h new file mode 100644 index 0000000..9567bd9 --- /dev/null +++ b/third_party/npapi/npspy/windows/profilew.h @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef __PROFILEW_H__ +#define __PROFILEW_H__ + +#include "profile.h" + +class ProfileWin : public Profile +{ + HKEY hKey; + +public: + ProfileWin(); + ~ProfileWin(); + + BOOL getBool(char * key, BOOL * value); + BOOL setBool(char * key, BOOL value); + + BOOL getString(char * key, char * string, int size); + BOOL setString(char * key, char * string); + + BOOL getSizeAndPosition(int *width, int *height, int *x, int *y); + BOOL setSizeAndPosition(int width, int height, int x, int y); +}; + +#define NPSPY_REG_SUBKEY "Software\\Netscape\\SpyPlugin" + +#define NPSPY_REG_KEY_ONTOP "AlwaysOnTop" +#define NPSPY_REG_KEY_LOGTOWINDOW "LogToWindow" +#define NPSPY_REG_KEY_LOGTOCONSOLE "LogToConsole" +#define NPSPY_REG_KEY_LOGTOFILE "LogToFile" +#define NPSPY_REG_KEY_SPALID "ShutdownPluginsAfterDestroy" +#define NPSPY_REG_KEY_WIDTH "width" +#define NPSPY_REG_KEY_HEIGHT "height" +#define NPSPY_REG_KEY_X "x" +#define NPSPY_REG_KEY_Y "y" +#define NPSPY_REG_KEY_LOGFILENAME "LogFileName" + +#endif + diff --git a/third_party/npapi/npspy/windows/res/cdrom.ico b/third_party/npapi/npspy/windows/res/cdrom.ico Binary files differnew file mode 100644 index 0000000..5e28215 --- /dev/null +++ b/third_party/npapi/npspy/windows/res/cdrom.ico diff --git a/third_party/npapi/npspy/windows/res/floppy.ico b/third_party/npapi/npspy/windows/res/floppy.ico Binary files differnew file mode 100644 index 0000000..b420960 --- /dev/null +++ b/third_party/npapi/npspy/windows/res/floppy.ico diff --git a/third_party/npapi/npspy/windows/res/foldcl.ico b/third_party/npapi/npspy/windows/res/foldcl.ico Binary files differnew file mode 100644 index 0000000..cc2ff7f --- /dev/null +++ b/third_party/npapi/npspy/windows/res/foldcl.ico diff --git a/third_party/npapi/npspy/windows/res/foldop.ico b/third_party/npapi/npspy/windows/res/foldop.ico Binary files differnew file mode 100644 index 0000000..10e2840 --- /dev/null +++ b/third_party/npapi/npspy/windows/res/foldop.ico diff --git a/third_party/npapi/npspy/windows/res/foldopse.ico b/third_party/npapi/npspy/windows/res/foldopse.ico Binary files differnew file mode 100644 index 0000000..c80112e --- /dev/null +++ b/third_party/npapi/npspy/windows/res/foldopse.ico diff --git a/third_party/npapi/npspy/windows/res/harddr.ico b/third_party/npapi/npspy/windows/res/harddr.ico Binary files differnew file mode 100644 index 0000000..04fe5a5 --- /dev/null +++ b/third_party/npapi/npspy/windows/res/harddr.ico diff --git a/third_party/npapi/npspy/windows/res/icon.ico b/third_party/npapi/npspy/windows/res/icon.ico Binary files differnew file mode 100644 index 0000000..dc53279 --- /dev/null +++ b/third_party/npapi/npspy/windows/res/icon.ico diff --git a/third_party/npapi/npspy/windows/res/netdr.ico b/third_party/npapi/npspy/windows/res/netdr.ico Binary files differnew file mode 100644 index 0000000..f3387d2 --- /dev/null +++ b/third_party/npapi/npspy/windows/res/netdr.ico diff --git a/third_party/npapi/npspy/windows/res/ramdr.ico b/third_party/npapi/npspy/windows/res/ramdr.ico Binary files differnew file mode 100644 index 0000000..ac11f68 --- /dev/null +++ b/third_party/npapi/npspy/windows/res/ramdr.ico diff --git a/third_party/npapi/npspy/windows/resource.h b/third_party/npapi/npspy/windows/resource.h new file mode 100644 index 0000000..fac3a5f --- /dev/null +++ b/third_party/npapi/npspy/windows/resource.h @@ -0,0 +1,92 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by npspy.rc +// +#define IDC_STATIC -1 +#define IDD_DIALOG_OPTIONS 101 +#define IDI_ICON1 102 +#define IDI_ICON_APP 102 +#define ID_DIALOG_CHOOSEDIR 102 +#define IDD_DIALOG_PAUSE 103 +#define ID_ICON_DRIVEFLOPPY 103 +#define IDD_PAGE_GENERAL 104 +#define ID_ICON_DRIVEHARD 104 +#define IDD_PAGE_FILTER 105 +#define ID_ICON_DRIVENETWORK 105 +#define IDD_PAGE_LOG 106 +#define ID_ICON_DRIVECDROM 106 +#define IDD_PAGE_ADVANCED 107 +#define ID_ICON_DRIVERAM 107 +#define ID_ICON_FOLDERCLOSED 108 +#define ID_ICON_FOLDEROPEN 109 +#define ID_ICON_OPENSELECT 110 +#define IDD_MAIN 308 +#define IDD_DIALOG_MAIN 308 +#define IDC_MAIN_OUTPUT 1001 +#define IDC_CHECK_NPN_VERSION 1002 +#define IDC_CHECK_NPN_GETURLNOTIFY 1003 +#define ID_EDIT_DIR 1003 +#define IDC_CHECK_NPNGETURL 1004 +#define IDC_CHECK_NPN_GETURL 1004 +#define ID_LIST_DIR 1004 +#define IDC_CHECK_NPN_POSTURLNOTIFY 1005 +#define ID_COMBO_DIR 1005 +#define IDC_CHECK_NPN_POSTURL 1006 +#define ID_LISTTEMP_DIR 1006 +#define IDC_CHECK_NPN_REQUESTREAD 1007 +#define IDC_CHECK_NPN_NEWSTREAM 1008 +#define IDC_CHECK_NPN_WRITE 1009 +#define IDC_CHECK_NPN_DESTROYSTREAM 1010 +#define IDC_CHECK_NPN_STATUS 1011 +#define IDC_CHECK_NPN_ESERAGENT 1012 +#define IDC_CHECK_NPN_MEMALLOC 1013 +#define IDC_CHECK_NPN_MEMFREE 1014 +#define IDC_CHECK_NPN_MEMFLUSH 1015 +#define IDC_CHECK_NPN_RELOADPLUGINS 1016 +#define IDC_CHECK_NPNGETJAVAENV 1017 +#define IDC_CHECK_NPN_GETJAVAENV 1017 +#define IDC_CHECK_NPN_GETJAVAPEER 1018 +#define IDC_CHECK_NPN_GETVALUE 1019 +#define IDC_CHECK_NPN_SETVALUE 1020 +#define IDC_CHECK_NPN_INVALIDATERECT 1021 +#define IDC_CHECK_NPN_INVALIDATEREGION 1021 +#define IDC_CHECK_NPNINVALIDATEREGION 1022 +#define IDC_CHECK_NPN_FORCEREDRAW 1023 +#define IDC_CHECK_NPP_NEW 1024 +#define IDC_CHECK_NPP_DESTROY 1025 +#define IDC_CHECK_NPP_SETWINDOW 1026 +#define IDC_CHECK_NPP_NEWSTREAM 1027 +#define IDC_CHECK_NPP_DESTROYSTREAM 1028 +#define IDC_CHECK_NPP_STREAMASFILE 1029 +#define IDC_CHECK_NPP_WRITEREADY 1030 +#define IDC_CHECK_NPP_WRITE 1031 +#define IDC_CHECK_NPP_PRINT 1032 +#define IDC_CHECK_NPP_HANDLEEVENT 1033 +#define IDC_CHECK_NPP_URLNOTIFY 1034 +#define IDC_CHECK_NPP_GETJAVACLASS 1035 +#define IDC_CHECK_NPP_GETVALUE 1036 +#define IDC_CHECK_NPP_SETVALUE 1037 +#define IDC_BUTTON_CHECKALL 1038 +#define IDC_BUTTON_CLEARALL 1039 +#define IDC_CHECK_TOCONSOLE 1041 +#define IDC_CHECK_TOWINDOW 1042 +#define IDC_CHECK_TOFILE 1043 +#define IDC_CHECK_SPALID 1044 +#define IDC_EDIT_FILE 1047 +#define IDC_BUTTON_CHOOSEDIR 1048 +#define IDC_CHECK_MUTE 2019 +#define IDC_CHECK_ONTOP 2020 +#define IDC_BUTTON_OPTIONS 2023 +#define IDC_BUTTON_CLEAR 2024 +#define IDC_OUTPUT 2026 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 108 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1049 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/third_party/npapi/npspy/windows/setupexe.cpp b/third_party/npapi/npspy/windows/setupexe.cpp new file mode 100644 index 0000000..5ce140c --- /dev/null +++ b/third_party/npapi/npspy/windows/setupexe.cpp @@ -0,0 +1,9 @@ +#include <windows.h> +#include "setup.h" +#define _CRT_SECURE_NO_DEPRECATE + +int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) +{ + SPY_Setup(); + return 0; +} diff --git a/third_party/npapi/npspy/windows/spysetup.vcproj b/third_party/npapi/npspy/windows/spysetup.vcproj new file mode 100644 index 0000000..ef87917 --- /dev/null +++ b/third_party/npapi/npspy/windows/spysetup.vcproj @@ -0,0 +1,248 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="8.00" + Name="spysetup" + ProjectGUID="{8489E6BA-49E8-4F84-BC9E-D500D6DD3C8A}" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory=".\Debug" + IntermediateDirectory=".\Debug" + ConfigurationType="1" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="_DEBUG" + MkTypLibCompatible="true" + SuppressStartupBanner="true" + TargetEnvironment="1" + TypeLibraryName=".\Debug/spysetup.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="0" + AdditionalIncludeDirectories="../include" + PreprocessorDefinitions="XP_WIN;WIN32;_DEBUG;_WINDOWS" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="1" + PrecompiledHeaderFile=".\Debug/spysetup.pch" + AssemblerListingLocation=".\Debug/" + ObjectFile=".\Debug/" + ProgramDataBaseFileName=".\Debug/" + WarningLevel="3" + SuppressStartupBanner="true" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="_DEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + AdditionalDependencies="debug/npspy.lib" + OutputFile="Debug\spysetup.exe" + LinkIncremental="2" + SuppressStartupBanner="true" + GenerateDebugInformation="true" + ProgramDatabaseFile=".\Debug/spysetup.pdb" + SubSystem="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + SuppressStartupBanner="true" + OutputFile=".\Debug/spysetup.bsc" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory=".\Release" + IntermediateDirectory=".\Release" + ConfigurationType="1" + InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops" + UseOfMFC="0" + ATLMinimizesCRunTimeLibraryUsage="false" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + PreprocessorDefinitions="NDEBUG" + MkTypLibCompatible="true" + SuppressStartupBanner="true" + TargetEnvironment="1" + TypeLibraryName=".\Release/spysetup.tlb" + HeaderFileName="" + /> + <Tool + Name="VCCLCompilerTool" + Optimization="2" + InlineFunctionExpansion="1" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" + StringPooling="true" + RuntimeLibrary="0" + EnableFunctionLevelLinking="true" + PrecompiledHeaderFile=".\Release/spysetup.pch" + AssemblerListingLocation=".\Release/" + ObjectFile=".\Release/" + ProgramDataBaseFileName=".\Release/" + WarningLevel="3" + SuppressStartupBanner="true" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + PreprocessorDefinitions="NDEBUG" + Culture="1033" + /> + <Tool + Name="VCPreLinkEventTool" + /> + <Tool + Name="VCLinkerTool" + OutputFile=".\Release/spysetup.exe" + LinkIncremental="1" + SuppressStartupBanner="true" + ProgramDatabaseFile=".\Release/spysetup.pdb" + SubSystem="2" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + SuppressStartupBanner="true" + OutputFile=".\Release/spysetup.bsc" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCWebDeploymentTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + > + <File + RelativePath="setupexe.cpp" + > + <FileConfiguration + Name="Debug|Win32" + > + <Tool + Name="VCCLCompilerTool" + AdditionalIncludeDirectories="" + PreprocessorDefinitions="" + /> + </FileConfiguration> + <FileConfiguration + Name="Release|Win32" + > + <Tool + Name="VCCLCompilerTool" + PreprocessorDefinitions="" + /> + </FileConfiguration> + </File> + </Filter> + <Filter + Name="Header Files" + Filter="h;hpp;hxx;hm;inl" + > + </Filter> + <Filter + Name="Resource Files" + Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" + > + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/third_party/npapi/npspy/windows/windowsxx.h b/third_party/npapi/npspy/windows/windowsxx.h new file mode 100644 index 0000000..2705518 --- /dev/null +++ b/third_party/npapi/npspy/windows/windowsxx.h @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef __WINDOWSXX_H__ +#define __WINDOWSXX_H__ + +/* void onNotify(HWND hWnd, int idCtrl, LPNMHDR lpNMHdr) */ +#define HANDLE_WM_NOTIFY(hwnd, wParam, lParam, fn) \ + (fn)((hwnd), (int)(wParam), (LPNMHDR)lParam) + +#endif diff --git a/third_party/npapi/npspy/windows/winentry.cpp b/third_party/npapi/npspy/windows/winentry.cpp new file mode 100644 index 0000000..3f897ca --- /dev/null +++ b/third_party/npapi/npspy/windows/winentry.cpp @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1998 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +// Windows entry point. Mainly for debug purposes. +#include <windows.h> + +char szAppName[] = "NPSpy"; +HINSTANCE hInst = NULL; + +BOOL WINAPI DllMain(HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved) +{ +#ifdef DEBUG + char szReason[80]; + + switch (dwReason) + { + case DLL_PROCESS_ATTACH: + strcpy(szReason, "DLL_PROCESS_ATTACH"); + break; + case DLL_THREAD_ATTACH: + strcpy(szReason, "DLL_THREAD_ATTACH"); + break; + case DLL_PROCESS_DETACH: + strcpy(szReason, "DLL_PROCESS_DETACH"); + break; + case DLL_THREAD_DETACH: + strcpy(szReason, "DLL_THREAD_DETACH"); + break; + } +#endif + + hInst = hDLL; + return TRUE; +} |