[xorg-commit-diffs] xc/programs/Xserver/hw/xwin InitOutput.c,
1.1.4.1.2.35, 1.1.4.1.2.36 winglobals.c, 1.1.2.17,
1.1.2.18 winprocarg.c, 1.1.2.15, 1.1.2.16
Alexander Gottwald
xorg-commit at pdx.freedesktop.org
Sun Apr 18 05:34:21 EST 2004
Committed by: ago
Update of /cvs/xorg/xc/programs/Xserver/hw/xwin
In directory pdx:/tmp/cvs-serv8621
Modified Files:
Tag: CYGWIN
InitOutput.c winglobals.c winprocarg.c
Log Message:
--help and --version available
Index: InitOutput.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/InitOutput.c,v
retrieving revision 1.1.4.1.2.35
retrieving revision 1.1.4.1.2.36
diff -u -d -r1.1.4.1.2.35 -r1.1.4.1.2.36
--- a/InitOutput.c 13 Apr 2004 18:48:06 -0000 1.1.4.1.2.35
+++ b/InitOutput.c 17 Apr 2004 19:34:19 -0000 1.1.4.1.2.36
@@ -71,6 +71,7 @@
extern HMODULE g_hmodCommonControls;
extern FARPROC g_fpTrackMouseEvent;
+extern Bool g_fNoHelpMessageBox;
/*
@@ -320,13 +321,9 @@
}
-/* See Porting Layer Definition - p. 57 */
void
-ddxUseMsg (void)
+winUseMsg (void)
{
- /* Set a flag so that FatalError won't give duplicate warning message */
- g_fUseMsg = TRUE;
-
ErrorF ("-depth bits_per_pixel\n"
"\tSpecify an optional bitdepth to use in fullscreen mode\n"
"\twith a DirectDraw engine.\n");
@@ -463,6 +460,16 @@
ErrorF ("-[no]keyhook\n"
"\tGrab special windows key combinations like Alt-Tab or the Menu key.\n"
"\tThese keys are discarded by default.\n");
+}
+
+/* See Porting Layer Definition - p. 57 */
+void
+ddxUseMsg(void)
+{
+ /* Set a flag so that FatalError won't give duplicate warning message */
+ g_fUseMsg = TRUE;
+
+ winUseMsg();
/* Log file will not be opened for UseMsg unless we open it now */
if (!g_fLogInited) {
@@ -472,7 +479,8 @@
LogClose ();
/* Notify user where UseMsg text can be found.*/
- winMessageBoxF ("The Cygwin/X help text has been printed to "
+ if (!g_fNoHelpMessageBox)
+ winMessageBoxF ("The Cygwin/X help text has been printed to "
"/tmp/XWin.log.\n"
"Please open /tmp/XWin.log to read the help text.\n",
MB_ICONINFORMATION);
Index: winglobals.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winglobals.c,v
retrieving revision 1.1.2.17
retrieving revision 1.1.2.18
diff -u -d -r1.1.2.17 -r1.1.2.18
--- a/winglobals.c 3 Apr 2004 22:21:56 -0000 1.1.2.17
+++ b/winglobals.c 17 Apr 2004 19:34:19 -0000 1.1.2.18
@@ -63,6 +63,7 @@
Bool g_fKeyboardHookLL = FALSE;
HHOOK g_hhookKeyboardLL = NULL;
HWND g_hwndKeyboardFocus = NULL;
+Bool g_fNoHelpMessageBox = FALSE;
/*
Index: winprocarg.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/Attic/winprocarg.c,v
retrieving revision 1.1.2.15
retrieving revision 1.1.2.16
diff -u -d -r1.1.2.15 -r1.1.2.16
--- a/winprocarg.c 10 Apr 2004 06:18:29 -0000 1.1.2.15
+++ b/winprocarg.c 17 Apr 2004 19:34:19 -0000 1.1.2.16
@@ -31,7 +31,6 @@
#include "winprefs.h"
#include "winmsg.h"
-
/*
* References to external symbols
*/
@@ -49,6 +48,7 @@
extern Bool g_fXdmcpEnabled;
extern char * g_pszCommandLine;
extern Bool g_fKeyboardHookLL;
+extern Bool g_fNoHelpMessageBox;
/*
@@ -190,15 +190,17 @@
s_fBeenHere = TRUE;
- /* Log the version information */
- winLogVersionInfo ();
-
- /* Log the command line */
- winLogCommandLine (argc, argv);
-
/* Initialize only if option is not -help */
- if (!IS_OPTION("-help"))
+ if (!IS_OPTION("-help") && !IS_OPTION("-h") && !IS_OPTION("--help") &&
+ !IS_OPTION("-version") && !IS_OPTION("--version"))
{
+
+ /* Log the version information */
+ winLogVersionInfo ();
+
+ /* Log the command line */
+ winLogCommandLine (argc, argv);
+
/*
* Initialize default screen settings. We have to do this before
* OsVendorInit () gets called, otherwise we will overwrite
@@ -213,7 +215,29 @@
#if CYGDEBUG
winErrorFVerb (2, "ddxProcessArgument - arg: %s\n", argv[i]);
#endif
-
+
+ /*
+ * Look for the '-help' and similar options
+ */
+ if (IS_OPTION ("-help") || IS_OPTION("-h") || IS_OPTION("--help"))
+ {
+ /* Reset logfile. We don't need that helpmessage in the logfile */
+ g_pszLogFile = NULL;
+ g_fNoHelpMessageBox = TRUE;
+ UseMsg();
+ exit (0);
+ return 1;
+ }
+
+ if (IS_OPTION ("-version") || IS_OPTION("--version"))
+ {
+ /* Reset logfile. We don't need that versioninfo in the logfile */
+ g_pszLogFile = NULL;
+ winLogVersionInfo ();
+ exit (0);
+ return 1;
+ }
+
/*
* Look for the '-screen scr_num [width height]' argument
*/
More information about the xorg-commit-diffs
mailing list