*** empty log message ***
[m17n/m17n-lib.git] / example / mview.c
index 20dd43f..ad5cd42 100644 (file)
@@ -1,5 +1,5 @@
-/* mview.c -- File viewer
-   Copyright (C) 2003, 2004
+/* mview.c -- File viewer                              -*- coding: euc-jp; -*-
+   Copyright (C) 2003, 2004, 2005, 2006, 2007
      National Institute of Advanced Industrial Science and Technology (AIST)
      Registration Number H15PRO112
 
 
    You should have received a copy of the GNU Lesser General Public
    License along with the m17n library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    02111-1307, USA.  */
 
 /***en
-    @enpage mview view file
+    @enpage m17n-view view file
 
-    @section mview-synopsis SYNOPSIS
+    @section m17n-view-synopsis SYNOPSIS
 
-    mview [ XT-OPTION ...] [ OPTION ... ] [ FILE ]
+    m17n-view [ XT-OPTION ...] [ OPTION ... ] [ FILE ]
 
-    @section mview-description DESCRIPTION
+    @section m17n-view-description DESCRIPTION
 
     Display FILE on a window.
 
@@ -45,7 +45,7 @@
 
     <li> -s FONTSIZE
 
-    FONTSIZE is the fontsize in point.  If ommited, it defaults to the
+    FONTSIZE is the fontsize in point.  If omitted, it defaults to the
     size of the default font defined in X resource.
 
     <li> --version
     </ul>
 */
 /***ja
-    @japage mview ¥Õ¥¡¥¤¥ë¤ò¸«¤ë
+    @japage m17n-view ¥Õ¥¡¥¤¥ë¤ò¸«¤ë
 
-    @section mview-synopsis SYNOPSIS
+    @section m17n-view-synopsis SYNOPSIS
 
-    mview [ XT-OPTION ...] [ OPTION ... ] [ FILE ]
+    m17n-view [ XT-OPTION ...] [ OPTION ... ] [ FILE ]
 
-    @section mview-description DESCRIPTION
+    @section m17n-view-description DESCRIPTION
 
     FILE ¤ò¥¦¥£¥ó¥É¥¦¤Ëɽ¼¨¤¹¤ë¡£ 
 
 
 #include <stdio.h>
 
+#ifdef HAVE_X11_XAW_COMMAND_H
+
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
 #include <X11/Shell.h>
-#include <X11/Xaw/Form.h>
-#include <X11/Xaw/Command.h>
-#include <X11/Xaw/Viewport.h>
 
 #include <m17n-gui.h>
 #include <m17n-misc.h>
 #include <m17n-X.h>
 
-#define VERSION "1.0"
+#include <X11/Xaw/Form.h>
+#include <X11/Xaw/Command.h>
+#include <X11/Xaw/Viewport.h>
 
 /* Global m17n variables.  */
 MFrame *frame;
@@ -227,7 +228,7 @@ help_exit (char *prog, int exit_code)
          "ENCODING is the encoding of FILE (defaults to UTF-8).\n");
   printf ("  %-13s %s", "-s FONTSIZE",
          "FONTSIZE is the fontsize in point.\n");
-  printf ("\t\tIf ommited, it defaults to the size\n");
+  printf ("\t\tIf omitted, it defaults to the size\n");
   printf ("\t\tof the default font defined in X resource.\n");
   printf ("  %-13s %s", "--version", "print version number\n");
   printf ("  %-13s %s", "-h, --help", "print this message\n");
@@ -275,7 +276,7 @@ main (int argc, char **argv)
 
   /* Open an application context.  */
   XtSetLanguageProc (NULL, NULL, NULL);
-  shell = XtOpenApplication (&context, "MView", NULL, 0, &argc, argv, NULL,
+  shell = XtOpenApplication (&context, "M17NView", NULL, 0, &argc, argv, NULL,
                             sessionShellWidgetClass, NULL, 0);
   XtAppAddActions (context, actions, XtNumber (actions));
 
@@ -287,8 +288,8 @@ main (int argc, char **argv)
        help_exit (argv[0], 0);
       else if (! strcmp (argv[i], "--version"))
        {
-         printf ("mview (m17n library) %s\n", VERSION);
-         printf ("Copyright (C) 2003 AIST, JAPAN\n");
+         printf ("m17n-view (m17n library) %s\n", M17NLIB_VERSION_NAME);
+         printf ("Copyright (C) 2003, 2004, 2005, 2006, 2007 AIST, JAPAN\n");
          exit (0);
        }
       else if (! strcmp (argv[i], "-e"))
@@ -420,4 +421,17 @@ main (int argc, char **argv)
 
   exit (0);
 }
+
+#else  /* not HAVE_X11_XAW_COMMAND_H */
+
+int
+main (int argc, char **argv)
+{
+  fprintf (stderr,
+          "Building of this program failed (lack of some header files)\n");
+  exit (1);
+}
+
+#endif /* not HAVE_X11_XAW_COMMAND_H */
+
 #endif /* not FOR_DOXYGEN */