mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
3ea1cc0dd0
- Bug 1165515 - Part 1: Convert PR_LOG to MOZ_LOG. r=froydnj (034b6056f) - Bug 1165515 - Part 3: Convert PR_LOG_TEST to MOZ_LOG_TEST. r=froydnj (38739377e) - Bug 1165515 - Part 5: Convert instances of PR_LOG_ALWAYS. r=froydnj (867725f77) - Bug 1165515 - Part 7: Convert PR_LOG_DEBUG + 1 to PR_LOG_VERBOSE. rs=froydnj (afe55d0b8) - Bug 1165515 - Part 8: Convert log level 6 to PR_LOG_VERBOSE. r=jesup (d01127f2c) - Bug 1165515 - Part 9: Remove instances of using numeric log levels 15. rs=froydnj (2ff8b0056) - Bug 1165515 - Part 10: Convert mtransport/logging.h to use PR_LOG levels. r=ekr (a0334c607) - Bug 1165515 - Part 11: Align CSFLogLevel with PR_LOG levels. r=jesup (ca57ae88a) - Bug 1165515 - Part 12: Convert nsPluginLogging to use PR_LOG levels. r=bsmedberg (1f3226ca8) - Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj (96db7f2e9) - Bug 1165515 - Part 14: Undef PR_LOG macros when using mozilla/Logging.h. r=froydnj (81d9dc8e5) - fix some bustage after Bug 1165515 - Part 14, stuff missed in part 13 (80c83c78d) - Bug 1165515 - Part 15: Reduce log level of WebRTC during testing. r=jesup (dda33e173)
67 lines
1.7 KiB
C++
67 lines
1.7 KiB
C++
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
/*
|
|
* nsWindowDbg - Debug related utilities for nsWindow.
|
|
*/
|
|
|
|
#include "nsWindowDbg.h"
|
|
#include "WinUtils.h"
|
|
|
|
using namespace mozilla::widget;
|
|
|
|
extern PRLogModuleInfo* gWindowsLog;
|
|
|
|
#if defined(POPUP_ROLLUP_DEBUG_OUTPUT)
|
|
MSGFEventMsgInfo gMSGFEvents[] = {
|
|
"MSGF_DIALOGBOX", 0,
|
|
"MSGF_MESSAGEBOX", 1,
|
|
"MSGF_MENU", 2,
|
|
"MSGF_SCROLLBAR", 5,
|
|
"MSGF_NEXTWINDOW", 6,
|
|
"MSGF_MAX", 8,
|
|
"MSGF_USER", 4096,
|
|
nullptr, 0};
|
|
#endif
|
|
|
|
static long gEventCounter = 0;
|
|
static long gLastEventMsg = 0;
|
|
|
|
void PrintEvent(UINT msg, bool aShowAllEvents, bool aShowMouseMoves)
|
|
{
|
|
int inx = 0;
|
|
while (gAllEvents[inx].mId != msg && gAllEvents[inx].mStr != nullptr) {
|
|
inx++;
|
|
}
|
|
if (aShowAllEvents || (!aShowAllEvents && gLastEventMsg != (long)msg)) {
|
|
if (aShowMouseMoves || (!aShowMouseMoves && msg != 0x0020 && msg != 0x0200 && msg != 0x0084)) {
|
|
MOZ_LOG(gWindowsLog, LogLevel::Info,
|
|
("%6d - 0x%04X %s\n", gEventCounter++, msg,
|
|
gAllEvents[inx].mStr ? gAllEvents[inx].mStr : "Unknown"));
|
|
gLastEventMsg = msg;
|
|
}
|
|
}
|
|
}
|
|
|
|
#ifdef DEBUG
|
|
void DDError(const char *msg, HRESULT hr)
|
|
{
|
|
/*XXX make nicer */
|
|
MOZ_LOG(gWindowsLog, LogLevel::Error,
|
|
("direct draw error %s: 0x%08lx\n", msg, hr));
|
|
}
|
|
#endif
|
|
|
|
#ifdef DEBUG_VK
|
|
bool is_vk_down(int vk)
|
|
{
|
|
SHORT st = GetKeyState(vk);
|
|
#ifdef DEBUG
|
|
MOZ_LOG(gWindowsLog, LogLevel::Info, ("is_vk_down vk=%x st=%x\n",vk, st));
|
|
#endif
|
|
return (st < 0);
|
|
}
|
|
#endif
|