Esempio n. 1
0
/*********************************
 *                               *
 *    main                       *
 *                               *
 *********************************/
int
main(int argc, char **argv)
{
/*  yydebug = 1; */
  progname = argv[0];

  if (argc > 2) {
    fprintf(stderr, usage, progname);
    exit(1);
  }

  SystemConstruct();

  if (argc > 1) {
    yyin = fopen(argv[1], "r");
    if (yyin == NULL) {
      printMsg(ERROR_MSG, "%s: can not open %s\n", progname, argv[1]);
      yyin = stdin;
    }
  }
  ParseStream();

  SystemDestruct();

  printf ("\n");     /* [H-O] [FIX] SHOULD BE VIA I/O MODULE */

  return(0);
}
Esempio n. 2
0
int main(int argc,char *argv[])
{
  int i,Result;      //MessageNumber;
  HWND Window;
  HMSG Message;
  ULONG Param1,Param2;
  char *opt;

  GetProfileString( ProfileName,InitSection, VectLibPathEntry,VectLibPath,
       "c:\\ezp\\fonts\\;c:\\;d:\\;e:\\;d:\\bttf;e:\\bttf;f:\\bttf;g:\\bttf");
  GetProfileString( ProfileName,InitSection, TrueTypeLibPathEntry,TrueTypeLibPath,
       "c:\\ezp\\fonts\\;d:\\cttf;e:\\cttf;f:\\cttf;g:\\cttf;d:\ttf;e:\\ttf;f:\\ttf;g:\\ttf");

  for (i=1;i<argc;i++)
  {
      opt = argv[i];
      if (*opt == '-'|| *opt == '/')
      {
          opt ++;
          switch (toupper(*opt)) {
              case '6':
                   if(!strcmp(opt,"640"))
                      ScreenMode=MODE640X480X16;
                   break;
              case '8':
                   if(!strcmp(opt,"800"))
                      ScreenMode=MODE800X600X16;
                   break;
              case '1':
                   if(!strcmp(opt,"1024"))
                      ScreenMode=MODE1024X768X16;
                   break;
              case 'E':
                   fEditor=TRUE;
                   break;
              case 'D':
              default:break;
          }     // switch
      } else
      if (*opt == '%')
      {
          opt ++;
          if(*opt=='%')
             Result=60000;
      }
      else
          MakeName(opt);
  } /*-- argc > 1 ---*/

  InitDot13LIB();

  i=Result;
  if ((Result=SystemConstruct())<OpOK)
  {
     SystemDestruct();
     Error(Result);
  }

  Result=i;
  FileSetMeterCM();
  WaitMessageEmpty();           // run all init, ByHance

/*-------------
//  test_speed();
  printf("size of Box = %d\n",sizeof(Boxs));
  printf("size of Pages = %d\n",sizeof(Pages));
  printf("size of window= %d\n",sizeof(Windows));
  printf("size of fillp = %d\n",sizeof(FILLP));
  printf("size of fillp = %d\n",sizeof(FILLP));
  getch();
  goto game_over;
-----------------*/

  if(!fEditor)
  {     // get printer type from file <EZP.INI>
     char str[80];
     GetProfileString( ProfileName,InitSection, PrinterEntry,str,
                        "HPϵÁм¤¹â´òÓ¡»ú(A4 300DPI)");
     i=0;
     while(PrinterName[i])
     {
       if( strcmp(str,PrinterName[i])==0 )
         break;
       i++;
     }
     if(PrinterName[i]==NULL) i=0;
     CurrentPrinter=i;

     MessageInsert(1,MENUCOMMAND,MENU_VIEWTOOLS,0L);
     MessageInsert(1,MENUCOMMAND,MENU_CLIBRATION,0L);
     strcpy(DefaultFileName,"*.EZP;*.FRA;*.TXT;*.*");
     WaitMessageEmpty();           // run all init, ByHance
  }
  else
  {
     strcpy(DefaultFileName,"*.TXT");
     GlobalBoxTool=IDX_INPUTBOX;
     DEFAULTTYPESTYLE.CharSize=DEFAULTTYPESTYLE.CharHSize=
       FormattingTextStyle.CharSize=FormattingTextStyle.CharHSize=160;  // 16*16
     DEFAULTTYPESTYLE.ParagraphAlign=
       FormattingTextStyle.ParagraphAlign=ALIGNLEFT;
     DEFAULTTYPESTYLE.VParagraphAlign=
       FormattingTextStyle.VParagraphAlign=ALIGNUPDOWN;
  }



  if(fAutoLoad)
     MessageInsert(1,MENUCOMMAND,MENU_OPEN,0L);
  else
     //if(fEditor) MessageInsert(1,MENUCOMMAND,MENU_NEW,0L);
  {
  MessageInsert(1,MENUCOMMAND,MENU_NEW,0L);    //By zjh 96.10.17 for auto load
  fNewA4=TRUE;
  }

// #define OLD_VERSION
#ifdef OLD_VERSION
  DrawIconImage();    // for debug
#endif

/*----------------- for test -----
  WaitMessageEmpty();
  for(i=0;i<200;i++)
  {
    //RedrawUserField();
    //WaitMessageEmpty();
    TextBoxRedrawPart(GlobalBoxHeadHandle,0,30000,0,FALSE);
  }
  goto game_over;
  -----------------*/

  GlobalTimer=TimerInsert(1,1);   // in main window, 18.2/second

  while(1)
  {
    if(Result==60000) {
        if(0==strcmp(&argv[1][2],"Han&Zhou"))
        {
           static unsigned char REDTEK_Company[32]={
              '±'+3,'±'+2,
              '¾'+1,'©'+0,
              'À'-1, 'í'-2,
              'µ'-3, 'Â'-4,
              'É'-5, 'Ì'-6,
              'Ó'-7, 'Ã'-8,
              '¼'-9, '¼'-10,
              'Ê'-11,'õ'-12,
              'Ó'-13,'Ð'-14,
              'Ï'-15,'Þ'-16,
              '¹'-17,'«'-18,
              'Ë'-19,'¾'-20,
              '°'-21,'æ'-22,
              'È'-23,'¨'-24,
              'Ë'-25,'ù'-26,
              'Ó'-27,'Ð'-28
           };

           Result=0;
           while(PageDialog[Result].ItemProcedure!=PageInitialBoxProcedure)
                Result++;
           PageDialog[Result].ItemUserData=1;       // pageInitBox=TRUE;

           //UserMenuCommand(1,MENUCOMMAND,MENU_NEW,0L);
           MenuHotKeyToMessage(1,ALT_F);        // ByHance
           MenuDefaultProc(1,KEYDOWN,'N',0);   // in UserMenu.C
           //MessageCreatbyKeyboard(ENTER,0);
           *(short *)0x41a=0x1e;
           *(short *)0x41c=0x20;
           *(short *)0x41e=0x1c0d;

           WaitMessageEmpty();
           for(Result=0;Result<32;Result++)
                REDTEK_Company[Result]+=(Result-3)&0xff;
           MessageCreatbyKeyString(REDTEK_Company,32);
        }
    }
    else

    KeyToMessage();
    if ((Result=MessageGet(&Window,&Message,&Param1,&Param2))<OpOK)
       break;
    if (Result<MAXMESSAGES)
    {
       if ((Result=MessageGo(Window,Message,Param1,Param2))==SYSTEMQUIT)
          break;
    }
    else
       MessageGo(1,SYSTEMIDLE,Param1,Param2);           // main window idle
  }

  TimerDelete(GlobalTimer);

//game_over:
#ifdef WELCOME_DISPLAY
  MessageNumber=Result;

  if ((Result=SystemDestruct())<OpOK)
  {
     SystemDealError(Result);
  }
  SystemDealError(MessageNumber);
#else
  SystemDestruct();
#endif

 //printf("OK.\n");
 return(0);
}