winmessages.h
winmsg.h winmsg.c winmultiwindowwndproc.c winwin32rootlesswndproc.c Make logging of messages configurable with environment variables
This commit is contained in:
parent
2982d173ca
commit
8d277ceb22
|
@ -1,3 +1,5 @@
|
||||||
|
#ifndef __WINMESSAGES_H__
|
||||||
|
#define __WINMESSAGES_H__
|
||||||
static const unsigned MESSAGE_NAMES_LEN =1024;
|
static const unsigned MESSAGE_NAMES_LEN =1024;
|
||||||
static const char *MESSAGE_NAMES[1024] = {
|
static const char *MESSAGE_NAMES[1024] = {
|
||||||
"WM_NULL",
|
"WM_NULL",
|
||||||
|
@ -1025,3 +1027,4 @@ static const char *MESSAGE_NAMES[1024] = {
|
||||||
"1022",
|
"1022",
|
||||||
"1023"
|
"1023"
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
|
|
||||||
#include "win.h"
|
#include "win.h"
|
||||||
#include "winmsg.h"
|
#include "winmsg.h"
|
||||||
|
#if CYGDEBUG
|
||||||
|
#include "winmessages.h"
|
||||||
|
#endif
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
void winVMsg (int, MessageType, int verb, const char *, va_list);
|
void winVMsg (int, MessageType, int verb, const char *, va_list);
|
||||||
|
@ -140,3 +143,33 @@ winW32ErrorEx(int verb, const char *msg, DWORD errorcode)
|
||||||
LocalFree(buffer);
|
LocalFree(buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CYGDEBUG
|
||||||
|
void winDebugWin32Message(const char* function, HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
if (message >= WM_USER)
|
||||||
|
{
|
||||||
|
if (getenv("WIN_DEBUG_MESSAGES") || getenv("WIN_DEBUG_WM_USER"))
|
||||||
|
{
|
||||||
|
winDebug("%s - Message WM_USER + %d", function, message - WM_USER);
|
||||||
|
winDebug("\twParam 0x%x lParam 0x%x\n", wParam, lParam);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (message < MESSAGE_NAMES_LEN && MESSAGE_NAMES[message])
|
||||||
|
{
|
||||||
|
const char *msgname = MESSAGE_NAMES[message];
|
||||||
|
char buffer[64];
|
||||||
|
snprintf(buffer, sizeof(buffer), "WIN_DEBUG_%s", msgname);
|
||||||
|
buffer[63] = 0;
|
||||||
|
if (getenv("WIN_DEBUG_MESSAGES") || getenv(buffer))
|
||||||
|
{
|
||||||
|
winDebug("%s - Message %s", function, MESSAGE_NAMES[message]);
|
||||||
|
winDebug("\twParam 0x%x lParam 0x%x\n", wParam, lParam);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void winDebugWin32Message(const char* function, HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -47,5 +47,6 @@ void winTrace (const char *format, ...);
|
||||||
void winErrorFVerb (int verb, const char *format, ...);
|
void winErrorFVerb (int verb, const char *format, ...);
|
||||||
void winW32Error(int verb, const char *message);
|
void winW32Error(int verb, const char *message);
|
||||||
void winW32ErrorEx(int verb, const char *message, DWORD errorcode);
|
void winW32ErrorEx(int verb, const char *message, DWORD errorcode);
|
||||||
|
void winDebugWin32Message(const char* function, HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -35,9 +35,7 @@
|
||||||
#include "dixevents.h"
|
#include "dixevents.h"
|
||||||
#include "winmultiwindowclass.h"
|
#include "winmultiwindowclass.h"
|
||||||
#include "winprefs.h"
|
#include "winprefs.h"
|
||||||
#if CYGDEBUG
|
#include "winmsg.h"
|
||||||
#include "winmessages.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* External global variables
|
* External global variables
|
||||||
|
@ -292,16 +290,7 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
|
||||||
static Bool s_fTracking = FALSE;
|
static Bool s_fTracking = FALSE;
|
||||||
|
|
||||||
#if CYGDEBUG
|
#if CYGDEBUG
|
||||||
if (message >= WM_USER)
|
winDebugWin32Message("winTopLevelWindowProc", hwnd, message, wParam, lParam);
|
||||||
{
|
|
||||||
winDebug("winTopLevelWindowProc - Message WM_USER + %d", message - WM_USER);
|
|
||||||
winDebug(" wParam 0x%x lParam 0x%x\n", wParam, lParam);
|
|
||||||
}
|
|
||||||
else if (message < MESSAGE_NAMES_LEN && MESSAGE_NAMES[message])
|
|
||||||
{
|
|
||||||
winDebug("winTopLevelWindowProc - Message %s", MESSAGE_NAMES[message]);
|
|
||||||
winDebug(" wParam 0x%x lParam 0x%x\n", wParam, lParam);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Check if the Windows window property for our X window pointer is valid */
|
/* Check if the Windows window property for our X window pointer is valid */
|
||||||
|
|
|
@ -37,9 +37,7 @@
|
||||||
#include "propertyst.h"
|
#include "propertyst.h"
|
||||||
#include "Xatom.h"
|
#include "Xatom.h"
|
||||||
#include "winmultiwindowclass.h"
|
#include "winmultiwindowclass.h"
|
||||||
#if CYGDEBUG
|
#include "winmsg.h"
|
||||||
#include "winmessages.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -436,19 +434,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
wmMsg.iHeight = pRLWinPriv->pFrame->height;
|
wmMsg.iHeight = pRLWinPriv->pFrame->height;
|
||||||
|
|
||||||
fWMMsgInitialized = TRUE;
|
fWMMsgInitialized = TRUE;
|
||||||
#if 0
|
#if CYGDEBUG
|
||||||
if (message >= WM_USER)
|
winDebugWin32Message("winMWExtWMWindowProc", hwnd, message, wParam, lParam);
|
||||||
{
|
|
||||||
winDebug("winMWExtWMWindowProc - Message WM_USER + %d",
|
|
||||||
message - WM_USER);
|
|
||||||
winDebug(" wParam 0x%x lParam 0x%x\n", wParam, lParam);
|
|
||||||
}
|
|
||||||
else if (message < MESSAGE_NAMES_LEN && MESSAGE_NAMES[message])
|
|
||||||
{
|
|
||||||
winDebug("winMWExtWMWindowProc - Message %s",
|
|
||||||
MESSAGE_NAMES[message]);
|
|
||||||
winDebug(" wParam 0x%x lParam 0x%x\n", wParam, lParam);
|
|
||||||
}
|
|
||||||
|
|
||||||
winDebug ("\thWnd %08X\n", hwnd);
|
winDebug ("\thWnd %08X\n", hwnd);
|
||||||
winDebug ("\tpScreenPriv %08X\n", pScreenPriv);
|
winDebug ("\tpScreenPriv %08X\n", pScreenPriv);
|
||||||
|
|
|
@ -37,9 +37,7 @@
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#include "winprefs.h"
|
#include "winprefs.h"
|
||||||
#include "winconfig.h"
|
#include "winconfig.h"
|
||||||
#if CYGDEBUG
|
#include "winmsg.h"
|
||||||
#include "winmessages.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global variables
|
* Global variables
|
||||||
|
@ -59,6 +57,7 @@ extern HWND g_hwndKeyboardFocus;
|
||||||
extern Bool g_fSoftwareCursor;
|
extern Bool g_fSoftwareCursor;
|
||||||
extern DWORD g_dwCurrentThreadID;
|
extern DWORD g_dwCurrentThreadID;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called by winWakeupHandler
|
* Called by winWakeupHandler
|
||||||
* Processes current Windows message
|
* Processes current Windows message
|
||||||
|
@ -80,16 +79,7 @@ winWindowProc (HWND hwnd, UINT message,
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
#if CYGDEBUG
|
#if CYGDEBUG
|
||||||
if (message >= WM_USER)
|
winDebugWin32Message("winWindowProc", hwnd, message, wParam, lParam);
|
||||||
{
|
|
||||||
winDebug("winWindowProc - Message WM_USER + %d", message - WM_USER);
|
|
||||||
winDebug(" wParam 0x%x lParam 0x%x\n", wParam, lParam);
|
|
||||||
}
|
|
||||||
else if (message < MESSAGE_NAMES_LEN && MESSAGE_NAMES[message])
|
|
||||||
{
|
|
||||||
winDebug("winWindowProc - Message %s", MESSAGE_NAMES[message]);
|
|
||||||
winDebug(" wParam 0x%x lParam 0x%x\n", wParam, lParam);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Watch for server regeneration */
|
/* Watch for server regeneration */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user