Subject: please test PATCH -- make printUsage XP
From: Sam TH (sam@uchicago.edu)
Date: Fri Jan 26 2001 - 18:08:15 CST
The following makes printUsage, which is exactly the same on all
platforms, into an XP function.  However, I haven't tested this on
other platforms, so I'd like someone to say that it works for them
before I commit it.  
Index: src/af/xap/xp/xap_App.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/xap/xp/xap_App.cpp,v
retrieving revision 1.54
diff -u -r1.54 xap_App.cpp
--- src/af/xap/xp/xap_App.cpp	2000/12/17 06:26:30	1.54
+++ src/af/xap/xp/xap_App.cpp	2001/01/27 00:07:19
@@ -636,3 +636,23 @@
                 }
         }
 }
+
+
+void XAP_App::_printUsage(void)
+{
+	// just print to stdout, not stderr
+	printf("\nUsage: %s [option]... [file]...\n\n", m_pArgs->m_argv[0]);
+	printf("  -to               The target format of the file\n");
+        printf("                    (abw, zabw, rtf, txt, utf8, html, latex)\n");
+	printf("  -verbose          The verbosity level (0, 1, 2)\n");
+	printf("  -show             If you really want to start the GUI\n");
+        printf("                    (even if you use the -to option)\n");
+#ifdef DEBUG
+	printf("  -dumpstrings      dump strings strings to file\n");
+#endif
+	printf("  -geometry geom    set initial frame geometry\n");
+	printf("  -lib dir          use dir for application components\n");
+	printf("  -nosplash         do not show splash screen\n");
+
+	printf("\n");
+}
Index: src/af/xap/xp/xap_App.h
===================================================================
RCS file: /cvsroot/abi/src/af/xap/xp/xap_App.h,v
retrieving revision 1.53
diff -u -r1.53 xap_App.h
--- src/af/xap/xp/xap_App.h	2000/11/28 02:16:01	1.53
+++ src/af/xap/xp/xap_App.h	2001/01/27 00:07:19
@@ -137,7 +137,9 @@
 
 protected:
         void				  _setAbiSuiteLibDir(const char * sz);
+	virtual void                      _printUsage(void);   
         
+	
         XAP_Args *						m_pArgs;
         const char *					m_szAppName;
         const char *					m_szAbiSuiteLibDir;
@@ -162,6 +164,7 @@
         
         XAP_EncodingManager*				m_pEncMgr;
         static XAP_App *				m_pApp;
+
 };
 
 #endif /* XAP_APP_H */
Index: src/wp/ap/unix/ap_UnixApp.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/unix/ap_UnixApp.cpp,v
retrieving revision 1.65
diff -u -r1.65 ap_UnixApp.cpp
--- src/wp/ap/unix/ap_UnixApp.cpp	2000/12/19 08:50:32	1.65
+++ src/wp/ap/unix/ap_UnixApp.cpp	2001/01/27 00:07:20
@@ -1146,33 +1146,6 @@
         return UT_TRUE;
 }
 
-// TODO : MOVE THIS TO XP CODE!  This is a cut & paste job since each
-// TODO : platform _can_ have different options, and we didn't sort
-// TODO : out how to honor them correctly yet.  There is a copy of
-// TODO : this function in other platforms.
-
-void AP_UnixApp::_printUsage(void)
-{
-	// just print to stdout, not stderr
-	printf("\nUsage: %s [option]... [file]...\n\n", m_pArgs->m_argv[0]);
-	printf("  -to               The target format of the file\n");
-        printf("                    (abw, zabw, rtf, txt, utf8, html, latex)\n");
-	printf("  -verbose          The verbosity level (0, 1, 2)\n");
-	printf("  -show             If you really want to start the GUI\n");
-        printf("                    (even if you use the -to option)\n");
-#ifdef DEBUG
-	printf("  -dumpstrings      dump strings strings to file\n");
-#endif
-	printf("  -geometry geom    set initial frame geometry\n");
-	printf("  -lib dir          use dir for application components\n");
-	printf("  -nosplash         do not show splash screen\n");
-#ifdef ABI_OPT_JS
-	printf("  -script file      execute file as script\n");
-#endif
-
-	printf("\n");
-}
-
 void signalWrapper(int sig_num)
 {
         AP_UnixApp *pApp = (AP_UnixApp *) XAP_App::getApp();
@@ -1183,9 +1156,9 @@
 
 void AP_UnixApp::catchSignals(int sig_num)
 {
-        // Reset the signal handler 
-  // (not that it matters - this is mostly for race conditions)
-        signal(SIGSEGV, signalWrapper);
+	// Reset the signal handler 
+	// (not that it matters - this is mostly for race conditions)
+	signal(SIGSEGV, signalWrapper);
 
         s_signal_count = s_signal_count + 1;
         if(s_signal_count > 1)
Index: src/wp/ap/unix/ap_UnixApp.h
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/unix/ap_UnixApp.h,v
retrieving revision 1.21
diff -u -r1.21 ap_UnixApp.h
--- src/wp/ap/unix/ap_UnixApp.h	2000/07/14 04:52:58	1.21
+++ src/wp/ap/unix/ap_UnixApp.h	2001/01/27 00:07:20
@@ -54,9 +54,9 @@
         virtual UT_Bool					forgetFrame(XAP_Frame * pFrame);
         virtual UT_Bool					shutdown(void);
         virtual UT_Bool					getPrefsValueDirectory(UT_Bool bAppSpecific,
-														   const XML_Char * szKey, const XML_Char ** pszValue) const;
-	virtual const XAP_StringSet *	getStringSet(void) const;
-	virtual const char *			getAbiSuiteAppDir(void) const;
+									       const XML_Char * szKey, const XML_Char ** pszValue) const;
+	virtual const XAP_StringSet *	                getStringSet(void) const;
+	virtual const char *			        getAbiSuiteAppDir(void) const;
         virtual void					copyToClipboard(PD_DocumentRange * pDocRange);
         virtual void					pasteFromClipboard(PD_DocumentRange * pDocRange, UT_Bool bUseClipboard);
         virtual UT_Bool					canPasteFromClipboard(void);
@@ -64,12 +64,12 @@
         virtual UT_Bool					parseCommandLine(void);
 
         virtual void					setSelectionStatus(AV_View * pView);
-        virtual void                                            setViewSelection( AV_View * pView);
-        virtual AV_View *                                       getViewSelection( void);
+        virtual void                                    setViewSelection( AV_View * pView);
+        virtual AV_View *                               getViewSelection( void);
         virtual void					clearSelection(void);
         virtual UT_Bool					getCurrentSelection(const char** formatList,
-														void ** ppData, UT_uint32 * pLen,
-														const char **pszFormatFound);
+									    void ** ppData, UT_uint32 * pLen,
+									    const char **pszFormatFound);
         virtual void					cacheCurrentSelection(AV_View *);
 
         static int main (const char * szAppName, int argc, char ** argv);
@@ -78,7 +78,6 @@
 
 protected:
 
-	void							_printUsage(void);
         static GR_Image *                                       _showSplash(UT_uint32);
 
         XAP_StringSet *			m_pStringSet;
@@ -94,7 +93,7 @@
         PD_DocumentRange		m_cacheDocumentRangeOfSelection;
 };
 
-// What follows is an ugly hack. It is neccessitated by the 
+// HACK What follows is an ugly hack. It is neccessitated by the 
 // C/C++ conflict over pointers to member functions. It is,
 // however, what the C++ FAQ reccommends.
 
           
        sam th		     
        sam@uchicago.edu
        http://www.abisource.com/~sam/
        GnuPG Key:  
        http://www.abisource.com/~sam/key
This archive was generated by hypermail 2b25 : Fri Jan 26 2001 - 18:09:09 CST