diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index d4e467d35..a36620ea4 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -29,6 +29,7 @@ from The Open Group. /* $XFree86: xc/programs/Xserver/hw/xwin/InitOutput.c,v 1.35 2003/10/08 11:13:02 eich Exp $ */ #include "win.h" +#include "winmsg.h" #include "winconfig.h" #include "winprefs.h" @@ -129,7 +130,7 @@ winInitializeDefaultScreens (void) dwWidth = GetSystemMetrics (SM_CXSCREEN); dwHeight = GetSystemMetrics (SM_CYSCREEN); - ErrorF ("winInitializeDefaultScreens - w %d h %d\n", + winErrorFVerb (2, "winInitializeDefaultScreens - w %d h %d\n", (int) dwWidth, (int) dwHeight); /* Set a default DPI, if no parameter was passed */ @@ -173,7 +174,7 @@ winInitializeDefaultScreens (void) /* Signal that the default screens have been initialized */ g_fInitializedDefaultScreens = TRUE; - ErrorF ("winInitializeDefaultScreens - Returning\n"); + winErrorFVerb (2, "winInitializeDefaultScreens - Returning\n"); } @@ -182,7 +183,7 @@ void ddxGiveUp() { #if CYGDEBUG - ErrorF ("ddxGiveUp\n"); + winErrorFVerb (2, "ddxGiveUp\n"); #endif /* Notify the worker threads we're exiting */ @@ -235,7 +236,7 @@ void AbortDDX (void) { #if CYGDEBUG - ErrorF ("AbortDDX\n"); + winErrorFVerb (2, "AbortDDX\n"); #endif ddxGiveUp (); } @@ -259,7 +260,7 @@ OsVendorInit (void) /* Add a default screen if no screens were specified */ if (g_iNumScreens == 0) { - ErrorF ("OsVendorInit - Creating bogus screen 0\n"); + winErrorFVerb (2, "OsVendorInit - Creating bogus screen 0\n"); /* * We need to initialize default screens if no arguments @@ -371,6 +372,8 @@ ddxUseMsg (void) ErrorF ("-nounicodeclipboard\n" "\tDo not use Unicode clipboard even if NT-based platform.\n"); + + /* TODO: new options */ } @@ -422,25 +425,25 @@ ddxProcessArgument (int argc, char *argv[], int i) * OsVendorInit () gets called, otherwise we will overwrite * settings changed by parameters such as -fullscreen, etc. */ - ErrorF ("ddxProcessArgument - Initializing default screens\n"); + winErrorFVerb (2, "ddxProcessArgument - Initializing default screens\n"); winInitializeDefaultScreens (); } #if CYGDEBUG - ErrorF ("ddxProcessArgument - arg: %s\n", argv[i]); + winErrorFVerb (2, "ddxProcessArgument - arg: %s\n", argv[i]); #endif /* * Look for the '-screen scr_num [width height]' argument */ - if (strcmp (argv[i], "-screen") == 0) + if (IS_OPTION ("-screen")) { int iArgsProcessed = 1; int nScreenNum; int iWidth, iHeight; #if CYGDEBUG - ErrorF ("ddxProcessArgument - screen - argc: %d i: %d\n", + winErrorFVerb (2, "ddxProcessArgument - screen - argc: %d i: %d\n", argc, i); #endif @@ -468,7 +471,7 @@ ddxProcessArgument (int argc, char *argv[], int i) (int *) &iWidth, (int *) &iHeight)) { - ErrorF ("ddxProcessArgument - screen - Found ``WxD'' arg\n"); + winErrorFVerb (2, "ddxProcessArgument - screen - Found ``WxD'' arg\n"); iArgsProcessed = 3; g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = TRUE; g_ScreenInfo[nScreenNum].dwWidth = iWidth; @@ -482,7 +485,7 @@ ddxProcessArgument (int argc, char *argv[], int i) && 1 == sscanf (argv[i + 3], "%d", (int *) &iHeight)) { - ErrorF ("ddxProcessArgument - screen - Found ``W D'' arg\n"); + winErrorFVerb (2, "ddxProcessArgument - screen - Found ``W D'' arg\n"); iArgsProcessed = 4; g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = TRUE; g_ScreenInfo[nScreenNum].dwWidth = iWidth; @@ -492,7 +495,7 @@ ddxProcessArgument (int argc, char *argv[], int i) } else { - ErrorF ("ddxProcessArgument - screen - Did not find size arg. " + winErrorFVerb (2, "ddxProcessArgument - screen - Did not find size arg. " "dwWidth: %d dwHeight: %d\n", (int) g_ScreenInfo[nScreenNum].dwWidth, (int) g_ScreenInfo[nScreenNum].dwHeight); @@ -530,7 +533,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-engine n' argument */ - if (strcmp (argv[i], "-engine") == 0) + if (IS_OPTION ("-engine")) { DWORD dwEngine = 0; CARD8 c8OnBits = 0; @@ -579,7 +582,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-fullscreen' argument */ - if (strcmp (argv[i], "-fullscreen") == 0) + if (IS_OPTION ("-fullscreen")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -617,7 +620,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-lesspointer' argument */ - if (strcmp (argv[i], "-lesspointer") == 0) + if (IS_OPTION ("-lesspointer")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -643,7 +646,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-nodecoration' argument */ - if (strcmp (argv[i], "-nodecoration") == 0) + if (IS_OPTION ("-nodecoration")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -669,7 +672,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-rootless' argument */ - if (strcmp (argv[i], "-rootless") == 0) + if (IS_OPTION ("-rootless")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -695,7 +698,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-multiwindow' argument */ - if (strcmp (argv[i], "-multiwindow") == 0) + if (IS_OPTION ("-multiwindow")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -721,8 +724,8 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-multiplemonitors' argument */ - if (strcmp (argv[i], "-multiplemonitors") == 0 - || strcmp (argv[i], "-multimonitors") == 0) + if (IS_OPTION ("-multiplemonitors") + || IS_OPTION ("-multimonitors")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -748,7 +751,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-scrollbars' argument */ - if (strcmp (argv[i], "-scrollbars") == 0) + if (IS_OPTION ("-scrollbars")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -782,7 +785,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-clipboard' argument */ - if (strcmp (argv[i], "-clipboard") == 0) + if (IS_OPTION ("-clipboard")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -808,7 +811,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-ignoreinput' argument */ - if (strcmp (argv[i], "-ignoreinput") == 0) + if (IS_OPTION ("-ignoreinput")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -834,7 +837,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-emulate3buttons' argument */ - if (strcmp (argv[i], "-emulate3buttons") == 0) + if (IS_OPTION ("-emulate3buttons")) { int iArgsProcessed = 1; int iE3BTimeout = WIN_DEFAULT_E3B_TIME; @@ -882,7 +885,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-depth n' argument */ - if (strcmp (argv[i], "-depth") == 0) + if (IS_OPTION ("-depth")) { DWORD dwBPP = 0; @@ -920,7 +923,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-refresh n' argument */ - if (strcmp (argv[i], "-refresh") == 0) + if (IS_OPTION ("-refresh")) { DWORD dwRefreshRate = 0; @@ -958,7 +961,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-clipupdates num_boxes' argument */ - if (strcmp (argv[i], "-clipupdates") == 0) + if (IS_OPTION ("-clipupdates")) { DWORD dwNumBoxes = 0; @@ -996,7 +999,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-emulatepseudo' argument */ - if (strcmp (argv[i], "-emulatepseudo") == 0) + if (IS_OPTION ("-emulatepseudo")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -1022,7 +1025,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-nowinkill' argument */ - if (strcmp (argv[i], "-nowinkill") == 0) + if (IS_OPTION ("-nowinkill")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -1048,7 +1051,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-winkill' argument */ - if (strcmp (argv[i], "-winkill") == 0) + if (IS_OPTION ("-winkill")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -1074,7 +1077,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-nounixkill' argument */ - if (strcmp (argv[i], "-nounixkill") == 0) + if (IS_OPTION ("-nounixkill")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -1100,7 +1103,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-unixkill' argument */ - if (strcmp (argv[i], "-unixkill") == 0) + if (IS_OPTION ("-unixkill")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -1126,7 +1129,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-notrayicon' argument */ - if (strcmp (argv[i], "-notrayicon") == 0) + if (IS_OPTION ("-notrayicon")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -1152,7 +1155,7 @@ ddxProcessArgument (int argc, char *argv[], int i) /* * Look for the '-trayicon' argument */ - if (strcmp (argv[i], "-trayicon") == 0) + if (IS_OPTION ("-trayicon")) { /* Is this parameter attached to a screen or is it global? */ if (-1 == g_iLastScreen) @@ -1293,12 +1296,12 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) int iMaxConsecutiveScreen = 0; #if CYGDEBUG - ErrorF ("InitOutput\n"); + winErrorFVerb (2, "InitOutput\n"); #endif /* Try to read the XF86Config-style configuration file */ if (!winReadConfigfile ()) - ErrorF ("InitOutput - Error reading config file\n"); + winErrorFVerb (1, "InitOutput - Error reading config file\n"); /* Setup global screen info parameters */ screenInfo->imageByteOrder = IMAGE_BYTE_ORDER; @@ -1327,7 +1330,7 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) "_TrackMouseEvent"); if (g_fpTrackMouseEvent == NULL) { - ErrorF ("InitOutput - Could not get pointer to function\n" + winErrorFVerb (1, "InitOutput - Could not get pointer to function\n" "\t_TrackMouseEvent in comctl32.dll. Try installing\n" "\tInternet Explorer 3.0 or greater if you have not\n" "\talready.\n"); @@ -1352,7 +1355,7 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) if (g_ScreenInfo[i].fExplicitScreen) iMaxConsecutiveScreen = i + 1; } - ErrorF ("InitOutput - g_iNumScreens: %d iMaxConsecutiveScreen: %d\n", + winErrorFVerb (2, "InitOutput - g_iNumScreens: %d iMaxConsecutiveScreen: %d\n", g_iNumScreens, iMaxConsecutiveScreen); if (g_iNumScreens < iMaxConsecutiveScreen) FatalError ("InitOutput - Malformed set of screen parameter(s). " @@ -1379,6 +1382,6 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) LoadPreferences(); #if CYGDEBUG || YES - ErrorF ("InitOutput - Returning.\n"); + winErrorFVerb (2, "InitOutput - Returning.\n"); #endif } diff --git a/hw/xwin/winconfig.c b/hw/xwin/winconfig.c index c0feea931..4b6d63d86 100644 --- a/hw/xwin/winconfig.c +++ b/hw/xwin/winconfig.c @@ -189,7 +189,7 @@ winReadConfigfile () g_xf86configptr->conf_layout_lst, NULL)) { - winMsg (X_ERROR, "Unable to determin the screen layout\n"); + winMsg (X_ERROR, "Unable to determine the screen layout\n"); return FALSE; } } diff --git a/hw/xwin/winengine.c b/hw/xwin/winengine.c index 9e0e8feb2..b66068d05 100644 --- a/hw/xwin/winengine.c +++ b/hw/xwin/winengine.c @@ -66,12 +66,12 @@ winDetectSupportedEngines () { case VER_PLATFORM_WIN32_NT: /* Engine 4 is supported on NT only */ - ErrorF ("winDetectSupportedEngines - Windows NT/2000/XP\n"); + winErrorFVerb (2, "winDetectSupportedEngines - Windows NT/2000/XP\n"); break; case VER_PLATFORM_WIN32_WINDOWS: /* Engine 4 is supported on NT only */ - ErrorF ("winDetectSupportedEngines - Windows 95/98/Me\n"); + winErrorFVerb (2, "winDetectSupportedEngines - Windows 95/98/Me\n"); break; } @@ -97,20 +97,20 @@ winDetectSupportedEngines () if (FAILED (ddrval)) { /* No DirectDraw support */ - ErrorF ("winDetectSupportedEngines - DirectDraw not installed\n"); + winErrorFVerb (2, "winDetectSupportedEngines - DirectDraw not installed\n"); return; } else { /* We have DirectDraw */ - ErrorF ("winDetectSupportedEngines - DirectDraw installed\n"); + winErrorFVerb (2, "winDetectSupportedEngines - DirectDraw installed\n"); g_dwEnginesSupported |= WIN_SERVER_SHADOW_DD; /* Allow PrimaryDD engine if NT */ if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { g_dwEnginesSupported |= WIN_SERVER_PRIMARY_DD; - ErrorF ("winDetectSupportedEngines - Allowing PrimaryDD\n"); + winErrorFVerb (2, "winDetectSupportedEngines - Allowing PrimaryDD\n"); } } @@ -121,7 +121,7 @@ winDetectSupportedEngines () if (SUCCEEDED (ddrval)) { /* We have DirectDraw4 */ - ErrorF ("winDetectSupportedEngines - DirectDraw4 installed\n"); + winErrorFVerb (2, "winDetectSupportedEngines - DirectDraw4 installed\n"); g_dwEnginesSupported |= WIN_SERVER_SHADOW_DDNL; } @@ -132,7 +132,7 @@ winDetectSupportedEngines () IDirectDraw_Release (lpdd); } - ErrorF ("winDetectSupportedEngines - Returning, supported engines %08x\n", + winErrorFVerb (2, "winDetectSupportedEngines - Returning, supported engines %08x\n", (unsigned int) g_dwEnginesSupported); } diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c index e7dd2a4b4..2ffce8348 100644 --- a/hw/xwin/winkeybd.c +++ b/hw/xwin/winkeybd.c @@ -407,7 +407,7 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState) names.geometry = g_winInfo.xkb.geometry; } - ErrorF("Rules = \"%s\" Model = \"%s\" Layout = \"%s\"" + winErrorFVerb(2, "Rules = \"%s\" Model = \"%s\" Layout = \"%s\"" " Variant = \"%s\" Options = \"%s\"\n", g_winInfo.xkb.rules, g_winInfo.xkb.model, g_winInfo.xkb.layout, g_winInfo.xkb.variant, @@ -433,7 +433,7 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState) } else { - ErrorF ("winKeybdProc - Error initializing keyboard AutoRepeat (No XKB)\n"); + winErrorFVerb (1, "winKeybdProc - Error initializing keyboard AutoRepeat (No XKB)\n"); } } #endif diff --git a/hw/xwin/winmsg.c b/hw/xwin/winmsg.c index ce8ac4199..4e98f6d8b 100644 --- a/hw/xwin/winmsg.c +++ b/hw/xwin/winmsg.c @@ -33,14 +33,8 @@ #include "winmsg.h" #include -#ifndef VERBOSE_LEVEL -#define VERBOSE_LEVEL 4 -#endif - - void winVMsg (int, MessageType, int verb, const char *, va_list); - void winVMsg (int scrnIndex, MessageType type, int verb, const char *format, va_list ap) @@ -64,7 +58,7 @@ winMsg (MessageType type, const char *format, ...) { va_list ap; va_start (ap, format); - LogVMessageVerb(type, 0, format, ap); + LogVMessageVerb(type, 1, format, ap); va_end (ap); }