|
|
| version 1.10, 2003/12/19 16:08:01 | version 1.18, 2004/06/17 14:36:33 |
|---|---|
| Line 27 | Line 27 |
| #include "compiler.h" | #include "compiler.h" |
| #include <sys/stat.h> | |
| #include <getopt.h> | #include <getopt.h> |
| #include <signal.h> | #include <signal.h> |
| Line 46 | Line 47 |
| #include "sysmenu.h" | #include "sysmenu.h" |
| #include "toolwin.h" | #include "toolwin.h" |
| #include "viewer.h" | #include "viewer.h" |
| #include "debugwin.h" | |
| #include "skbdwin.h" | |
| #include "commng.h" | #include "commng.h" |
| #include "fontmng.h" | #include "fontmng.h" |
| Line 99 sighandler(int signo) | Line 102 sighandler(int signo) |
| static struct option longopts[] = { | static struct option longopts[] = { |
| { "config", required_argument, 0, 'c' }, | { "config", required_argument, 0, 'c' }, |
| { "timidity-config", required_argument, 0, 'C' }, | { "timidity-config", required_argument, 0, 'C' }, |
| { "shared-pixmap", no_argument, 0, 'p' }, | #if defined(USE_SDL) || defined(USE_SYSMENU) |
| { "ttfont", required_argument, 0, 't' }, | |
| #endif | |
| { "help", no_argument, 0, 'h' }, | { "help", no_argument, 0, 'h' }, |
| { 0, 0, 0, 0 }, | { 0, 0, 0, 0 }, |
| }; | }; |
| Line 110 static void | Line 115 static void |
| usage(void) | usage(void) |
| { | { |
| printf("Usage: %s [options] [[FD1 image] [[FD2 image] [[FD3 image] [FD4 image]]]]\n", progname); | printf("Usage: %s [options] [[FD1 image] [[FD2 image] [[FD3 image] [FD4 image]]]]\n\n", progname); |
| printf("options:\n"); | |
| printf("\t--help [-h] : print this message\n"); | |
| printf("\t--config [-c] <file> : specify config file\n"); | |
| printf("\t--timidity-config [-C] <file> : specify timidity config file\n"); | |
| #if defined(USE_SDL) || defined(USE_SYSMENU) | |
| printf("\t--ttfont [-t] <file> : specify TrueType font\n"); | |
| #endif | |
| exit(1); | exit(1); |
| } | } |
| Line 133 main(int argc, char *argv[]) | Line 145 main(int argc, char *argv[]) |
| toolkit_initialize(); | toolkit_initialize(); |
| toolkit_arginit(&argc, &argv); | toolkit_arginit(&argc, &argv); |
| while ((ch = getopt_long(argc, argv, "c:C:nh", longopts, NULL)) != -1) { | while ((ch = getopt_long(argc, argv, "c:C:t:ph", longopts, NULL)) != -1) { |
| switch (ch) { | switch (ch) { |
| case 'c': | case 'c': |
| if (stat(optarg, &sb) < 0 || !S_ISREG(sb.st_mode)) { | if (stat(optarg, &sb) < 0 || !S_ISREG(sb.st_mode)) { |
| Line 156 main(int argc, char *argv[]) | Line 168 main(int argc, char *argv[]) |
| sizeof(timidity_cfgfile_path)); | sizeof(timidity_cfgfile_path)); |
| break; | break; |
| case 'p': | case 't': |
| shared_pixmap_flag = TRUE; | if (stat(optarg, &sb) < 0 || !S_ISREG(sb.st_mode)) { |
| fprintf(stderr, "Can't access %s.\n", optarg); | |
| exit(1); | |
| } | |
| milstr_ncpy(fontfilename, optarg, sizeof(fontfilename)); | |
| break; | break; |
| case 'h': | case 'h': |
| Line 227 main(int argc, char *argv[]) | Line 243 main(int argc, char *argv[]) |
| initload(); | initload(); |
| toolwin_readini(); | toolwin_readini(); |
| kdispwin_readini(); | kdispwin_readini(); |
| skbdwin_readini(); | |
| rand_setseed((SINT32)time(NULL)); | rand_setseed((SINT32)time(NULL)); |
| #if defined(__GNUC__) && (defined(i386) || defined(__i386__)) | #if defined(GCC_CPU_ARCH_IA32) |
| mmxflag = havemmx() ? 0 : MMXFLAG_NOTSUPPORT; | mmxflag = havemmx() ? 0 : MMXFLAG_NOTSUPPORT; |
| mmxflag += np2oscfg.disablemmx ? MMXFLAG_DISABLE : 0; | mmxflag += np2oscfg.disablemmx ? MMXFLAG_DISABLE : 0; |
| #endif | #endif |
| Line 244 main(int argc, char *argv[]) | Line 261 main(int argc, char *argv[]) |
| kdispwin_initialize(); | kdispwin_initialize(); |
| viewer_init(); | viewer_init(); |
| skbdwin_initialize(); | |
| toolkit_widget_create(); | toolkit_widget_create(); |
| scrnmng_initialize(); | scrnmng_initialize(); |
| kbdmng_init(); | kbdmng_init(); |
| inputmng_init(); | inputmng_init(); |
| keystat_reset(); | keystat_initialize(); |
| scrnmode = 0; | scrnmode = 0; |
| if (np2cfg.RASTER) { | if (np2cfg.RASTER) { |
| Line 303 main(int argc, char *argv[]) | Line 321 main(int argc, char *argv[]) |
| if (np2oscfg.keydisp) { | if (np2oscfg.keydisp) { |
| kdispwin_create(); | kdispwin_create(); |
| } | } |
| if (np2oscfg.softkbd) { | |
| skbdwin_create(); | |
| } | |
| } | } |
| if (np2oscfg.resume) { | if (np2oscfg.resume) { |
| Line 324 main(int argc, char *argv[]) | Line 345 main(int argc, char *argv[]) |
| kdispwin_destroy(); | kdispwin_destroy(); |
| toolwin_destroy(); | toolwin_destroy(); |
| skbdwin_destroy(); | |
| pccore_cfgupdate(); | pccore_cfgupdate(); |
| Line 337 main(int argc, char *argv[]) | Line 359 main(int argc, char *argv[]) |
| } | } |
| pccore_term(); | pccore_term(); |
| debugwin_destroy(); | |
| soundmng_deinitialize(); | soundmng_deinitialize(); |
| scrnmng_destroy(); | scrnmng_destroy(); |
| Line 352 fontmng_failure: | Line 375 fontmng_failure: |
| initsave(); | initsave(); |
| toolwin_writeini(); | toolwin_writeini(); |
| kdispwin_writeini(); | kdispwin_writeini(); |
| skbdwin_writeini(); | |
| } | } |
| skbdwin_deinitialize(); | |
| TRACETERM(); | TRACETERM(); |
| dosio_term(); | dosio_term(); |