Commit 451bac61 authored by masayuki%d-toybox.com's avatar masayuki%d-toybox.com
Browse files

Bug 330276 Drop support for pre-Win2k platforms. patch by Masatoshi Kimura...

Bug 330276 Drop support for pre-Win2k platforms. patch by Masatoshi Kimura (emk) <VYV03354@nifty.ne.jp> r=emaijala+dougt, sr=roc
parent d1e3621e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ EXTRA_LIBS += $(STATIC_EXTRA_LIBS)
endif

ifeq ($(OS_ARCH),WINNT)
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool gdi32)
OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool gdi32 imm32)
ifdef MOZ_ENABLE_CAIRO_GFX
OS_LIBS += $(call EXPAND_LIBNAME,usp10)
endif
+11 −11
Original line number Diff line number Diff line
@@ -87,8 +87,8 @@ BOOL PeekKeyAndIMEMessage(LPMSG msg, HWND hwnd)
{
  MSG msg1, msg2, *lpMsg;
  BOOL b1, b2;
  b1 = nsToolkit::mPeekMessage(&msg1, NULL, WM_KEYFIRST, WM_IME_KEYLAST, PM_NOREMOVE);
  b2 = nsToolkit::mPeekMessage(&msg2, NULL, WM_IME_SETCONTEXT, WM_IME_KEYUP, PM_NOREMOVE);
  b1 = ::PeekMessageW(&msg1, NULL, WM_KEYFIRST, WM_IME_KEYLAST, PM_NOREMOVE);
  b2 = ::PeekMessageW(&msg2, NULL, WM_IME_SETCONTEXT, WM_IME_KEYUP, PM_NOREMOVE);
  if (b1 || b2) {
    if (b1 && b2) {
      if (msg1.time < msg2.time)
@@ -99,7 +99,7 @@ BOOL PeekKeyAndIMEMessage(LPMSG msg, HWND hwnd)
      lpMsg = &msg1;
    else
      lpMsg = &msg2;
    return nsToolkit::mPeekMessage(msg, hwnd, lpMsg->message, lpMsg->message, PM_REMOVE);
    return ::PeekMessageW(msg, hwnd, lpMsg->message, lpMsg->message, PM_REMOVE);
  }

  return false;
@@ -124,13 +124,13 @@ NS_METHOD nsAppShell::Run(void)
    // Give priority to system messages (in particular keyboard, mouse,
    // timer, and paint messages).
     if (PeekKeyAndIMEMessage(&msg, NULL) ||
         nsToolkit::mPeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE) || 
         nsToolkit::mPeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
         ::PeekMessageW(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE) || 
         ::PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) {
      keepGoing = (msg.message != WM_QUIT);

      if (keepGoing != 0) {
        TranslateMessage(&msg);
        nsToolkit::mDispatchMessage(&msg);
        ::DispatchMessageW(&msg);
      }
    } else {

@@ -140,7 +140,7 @@ NS_METHOD nsAppShell::Run(void)
        do {
          timerManager->FireNextIdleTimer();
          timerManager->HasIdleTimers(&hasTimers);
        } while (hasTimers && !nsToolkit::mPeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE));
        } while (hasTimers && !::PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE));
      } else {

        if (!gKeepGoing) {
@@ -185,8 +185,8 @@ nsAppShell::GetNativeEvent(PRBool &aRealEvent, void *&aEvent)
    // Give priority to system messages (in particular keyboard, mouse,
    // timer, and paint messages).
     if (PeekKeyAndIMEMessage(&msg, NULL) ||
        nsToolkit::mPeekMessage(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE) || 
        nsToolkit::mPeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
        ::PeekMessageW(&msg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE) || 
        ::PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) {
      gotMessage = true;
    } else {
      PRBool hasTimers;
@@ -195,7 +195,7 @@ nsAppShell::GetNativeEvent(PRBool &aRealEvent, void *&aEvent)
        do {
          timerManager->FireNextIdleTimer();
          timerManager->HasIdleTimers(&hasTimers);
        } while (hasTimers && !nsToolkit::mPeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE));
        } while (hasTimers && !::PeekMessageW(&msg, NULL, 0, 0, PM_NOREMOVE));
      } else {
        // Block and wait for any posted application message
        ::WaitMessage();
@@ -217,7 +217,7 @@ nsAppShell::GetNativeEvent(PRBool &aRealEvent, void *&aEvent)

nsresult nsAppShell::DispatchNativeEvent(PRBool aRealEvent, void *aEvent)
{
  nsToolkit::mDispatchMessage((MSG *)aEvent);
  ::DispatchMessageW((MSG *)aEvent);
  return NS_OK;
}

+3 −10
Original line number Diff line number Diff line
@@ -765,15 +765,8 @@ nsDeviceContextSpecWin::GetDataFromPrinter(const PRUnichar * aName, nsIPrintSett

    SetDeviceName(NS_CONST_CAST(char*, nativeName.get()));

    // The driver should be NULL for Win95/Win98
    OSVERSIONINFO os;
    os.dwOSVersionInfoSize = sizeof(os);
    ::GetVersionEx(&os);
    if (VER_PLATFORM_WIN32_NT == os.dwPlatformId) {
    SetDriverName("WINSPOOL");
    } else {
      SetDriverName(NULL);
    }

    ::ClosePrinter(hPrinter);
    rv = NS_OK;
  } else {
+2 −2
Original line number Diff line number Diff line
@@ -709,9 +709,9 @@ LRESULT WINAPI nsDragService::HiddenWndProc(HWND aWnd, UINT aMsg, WPARAM awParam
      // Get From path (where the file is comming from)
      WCHAR szPathFrom[MAX_PATH + 1];
      WCHAR szPathTo[MAX_PATH + 1];
      nsToolkit::mSHGetPathFromIDList(ppidl[0], szPathFrom);
      ::SHGetPathFromIDListW(ppidl[0], szPathFrom);
      // Get To path (where the file is going to)
      nsToolkit::mSHGetPathFromIDList(ppidl[1], szPathTo);
      ::SHGetPathFromIDListW(ppidl[1], szPathTo);

      // first is from where the file is coming
      // and the second is where the file is going
+6 −10
Original line number Diff line number Diff line
@@ -179,9 +179,9 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
    browserInfo.iImage         = nsnull;

    // XXX UNICODE support is needed here --> DONE
    LPITEMIDLIST list = nsToolkit::mSHBrowseForFolder(&browserInfo);
    LPITEMIDLIST list = ::SHBrowseForFolderW(&browserInfo);
    if (list != NULL) {
      result = nsToolkit::mSHGetPathFromIDList(list, (LPWSTR)fileBuffer);
      result = ::SHGetPathFromIDListW(list, (LPWSTR)fileBuffer);
      if (result) {
          mUnicodeFile.Assign(fileBuffer);
      }
@@ -196,11 +196,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)

    OPENFILENAMEW ofn;
    memset(&ofn, 0, sizeof(ofn));
#if _WIN32_WINNT >= 0x0500
    ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
#else
    ofn.lStructSize = sizeof(ofn);
#endif
    nsString filterBuffer = mFilterList;
                                  
    if (!initialDir.IsEmpty()) {
@@ -249,11 +245,11 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
      if (mMode == modeOpen) {
        // FILE MUST EXIST!
        ofn.Flags |= OFN_FILEMUSTEXIST;
        result = nsToolkit::mGetOpenFileName(&ofn);
        result = ::GetOpenFileNameW(&ofn);
      }
      else if (mMode == modeOpenMultiple) {
        ofn.Flags |= OFN_FILEMUSTEXIST | OFN_ALLOWMULTISELECT | OFN_EXPLORER;
        result = nsToolkit::mGetOpenFileName(&ofn);
        result = ::GetOpenFileNameW(&ofn);
      }
      else if (mMode == modeSave) {
        ofn.Flags |= OFN_NOREADONLYRETURN;
@@ -268,7 +264,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
            StringEndsWith(ext, NS_LITERAL_CSTRING(".url")))
          ofn.Flags |= OFN_NODEREFERENCELINKS;

        result = nsToolkit::mGetSaveFileName(&ofn);
        result = ::GetSaveFileNameW(&ofn);
        if (!result) {
          // Error, find out what kind.
          if (::GetLastError() == ERROR_INVALID_PARAMETER ||
@@ -276,7 +272,7 @@ NS_IMETHODIMP nsFilePicker::ShowW(PRInt16 *aReturnVal)
            // probably the default file name is too long or contains illegal characters!
            // Try again, without a starting file name.
            ofn.lpstrFile[0] = 0;
            result = nsToolkit::mGetSaveFileName(&ofn);
            result = ::GetSaveFileNameW(&ofn);
          }
        }
      }
Loading