home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 April / VPR0004A.BIN / OLS / CSSH102 / CSSH102.LZH / csshtml.mac next >
Text File  |  1999-12-20  |  7KB  |  231 lines

  1. ////////////////////////////////////////////////////////////
  2. // csshtml.mac  Ver1.02                                   //
  3. // HTML File Generator Macro For Hidemaru Editor          //
  4. // Copyright(C)1999 Toshiyuki Akutsu. All rights reserved.//
  5. // mailto:locrian@mbd.sphere.ne.jp                        //
  6. // Mon, 20 Dec 1999 21:30:54                              //
  7. ////////////////////////////////////////////////////////////
  8.     call changeEnvironment;
  9.     if( ##return < 0 ){
  10.         if( ##return == -2 ){
  11.             call restoreEnvironment;
  12.             message "インストール終了 csshtml.mac";
  13.         }
  14.         endmacro;
  15.     }
  16. //////////////////////////////
  17.     if( selecting ){
  18.         execmacro $__DIR + "selecting.mac";
  19.         ##execute = getininum($__INI,"SUBMACRO","EXECUTE");
  20.         call restoreEnvironment;
  21.         if( ##execute ) beep;
  22.         endmacro;
  23.     }
  24. //////////////////////////////
  25.     #__PRE = getininum( $__INI,"CSSHTML","__PRE" );
  26.     #__CR = getininum( $__INI,"CSSHTML","__CR" );
  27.     #__ANCHOR = getininum( $__INI,"CSSHTML","__ANCHOR" );
  28. //////////////////////////////
  29.  
  30.     ##execute = 0;
  31.     $$mi[0] = "<<< csshtml.mac 1.02 >>>";
  32.     $$mi[1]=""; $$mi[2]="";
  33.     $$mi[3]=""; $$mi[4]=""; $$mi[5]=""; $$mi[6]="";
  34.     $$mi[07] = "&M HTML作成 実行";
  35.     $$mi[08] = "----------------------";
  36.     $$mi[09] = "&S 後処理 SPAN最適化";
  37.     $$mi[10] = "&R 後処理 SPAN置換";
  38.     $$mi[11] = "&A 後処理 全実行など";
  39.     $$mi[12] = "----------------------";
  40.     $$mi[13] = "&C CSS を開く";
  41.     $$mi[14] = "&H ヘルプ";
  42.     $$mi[15] = "&Q 終了 ( ESC )";
  43.     ##end = 16;
  44.     RE_MENU:
  45.     if( #__PRE ) $$mi[1] = "&1 構成【<PRE>】/ <BR>";
  46.     else $$mi[1] = "&1 構成 <PRE> /【<BR>】";
  47.     if( #__CR ) $$mi[2] = "&2 改行 非表示 /【表示】";
  48.     else $$mi[2] = "&2 改行【非表示】/ 表示 ";
  49.  
  50.     if( #__ANCHOR & 0x01 ) $$mi[3] = "&3 行の強調1 anchor";
  51.     else $$mi[3] = "&3 行の強調1";
  52.     if( #__ANCHOR & 0x02 ) $$mi[4] = "&4 行の強調2 anchor";
  53.     else $$mi[4] = "&4 行の強調2";
  54.     if( #__ANCHOR & 0x04 ) $$mi[5] = "&5 特に強調1 anchor";
  55.     else $$mi[5] = "&5 特に強調1";
  56.     if( #__ANCHOR & 0x08 ) $$mi[6] = "&6 特に強調2 anchor";
  57.     else $$mi[6] = "&6 特に強調2";
  58.  
  59.     menuarray $$mi, ##end;
  60.     ##item = result - 1;
  61.  
  62.  if( ##item > 0 && ##item <= 6 ){
  63.         if( ##item == 1 ){
  64.             #__PRE = #__PRE ^ 0x01;
  65.         }else if( ##item == 2 ){
  66.             #__CR = #__CR ^ 0x01;
  67.         }else if( ##item == 3 ){
  68.             if( #__ANCHOR & 0x01 ) #__ANCHOR = #__ANCHOR & 0x0E;
  69.             else #__ANCHOR = #__ANCHOR | 0x01;
  70.         }else if( ##item == 4 ){
  71.             if( #__ANCHOR & 0x02 ) #__ANCHOR = #__ANCHOR & 0x0D;
  72.             else #__ANCHOR = #__ANCHOR | 0x02;
  73.         }else if( ##item == 5 ){
  74.             if( #__ANCHOR & 0x04 ) #__ANCHOR = #__ANCHOR & 0x0B;
  75.             else #__ANCHOR = #__ANCHOR | 0x04;
  76.         }else if( ##item == 6 ){
  77.             if( #__ANCHOR & 0x08 ) #__ANCHOR = #__ANCHOR & 0x07;
  78.             else #__ANCHOR = #__ANCHOR | 0x08;
  79.         }
  80.         goto RE_MENU;
  81.  }else if( ##item == 7 ){
  82.         call writeIniFileParam;
  83.         ##h_client = hidemaruhandle( 0 );
  84.         execmacro $__DIR + "extracth.mac";
  85.         ##success = getininum($__INI,"SUBMACRO","SUCCESS");
  86.         if( ##success ){
  87.             execmacro $__DIR + "validateh.mac";
  88.             ##success = getininum($__INI,"SUBMACRO","SUCCESS");
  89.         }
  90.         ##execute = 1;
  91.         setactivehidemaru ##h_client;
  92.         if( ! ##success ) message "なんかエラー発生しました。csshtml.mac";
  93.  
  94.  }else if( ##item == 8 || ##item == 12 ){
  95.         goto RE_MENU;
  96.  }else if( ##item == 9 ){
  97.         execmacro $__DIR + "spanoptimizer_menu.mac";
  98.         ##execute = getininum($__INI,"SUBMACRO","EXECUTE");
  99.         if( ##execute ) execmacro $__DIR + "spanoptimizer.mac";
  100.         else goto RE_MENU;
  101.  }else if( ##item == 10 ){
  102.         execmacro $__DIR + "spanreplacer_menu.mac";
  103.         ##execute = getininum($__INI,"SUBMACRO","EXECUTE");
  104.         if( ##execute ) execmacro $__DIR + "spanreplacer.mac";
  105.         else goto RE_MENU;
  106.  }else if( ##item == 11 ){
  107.         execmacro $__DIR + "atoshori.mac";
  108.         ##execute = getininum($__INI,"SUBMACRO","EXECUTE");
  109.         if( ##execute ){
  110.             execmacro $__DIR + "spanoptimizer.mac";
  111.             execmacro $__DIR + "spanreplacer.mac";
  112.         }else{
  113.             goto RE_MENU;
  114.         }
  115.  }else if( ##item == 13 ){
  116.         execmacro $__DIR + "opencss.mac";
  117.  }else if( ##item == 14 ){
  118.     $$help = "file:///" + $__DIR + "help\\csshtml.htm";
  119.     ##NT = getininum( $__INI,"CSSHTML","NT" );
  120.     if( ##NT ) run "cmd.exe /c start \"" + $$help + "\"";
  121.     else run "command.com /c start \"" + $$help + "\"";
  122.  }
  123.  
  124.     call restoreEnvironment;
  125.     if( ##execute ){
  126.         title 0; beep;
  127.     }
  128.  
  129. endmacro;
  130. // End of csshtml.mac
  131. //////////////////////////////
  132. writeIniFileParam:
  133.     title "前処理中 Read Only";
  134.     golinetop;
  135.     #__windowwidth = windowwidth;
  136.     #__windowheight = windowheight;
  137.     setwindowsize 30,5;
  138.     if( ! linenostate ){
  139.         showlineno; #__changedShowLineno = 1;
  140.     }
  141.     if( ! readonly ){
  142.         #__changedReadOnly = 1;
  143.         readonlyswitch;
  144.     }
  145.     writeininum $__INI, "CSSHTML", "__PRE", #__PRE;
  146.     writeininum $__INI, "CSSHTML", "__CR", #__CR;
  147.     writeininum $__INI, "CSSHTML", "__ANCHOR", #__ANCHOR;
  148.     $$TIME = rightstr( "0000" + str(tickcount), 5 ) + time;
  149.     writeinistr $__INI, "CSSHTML", "__TIME", $$TIME;
  150.  
  151. return;
  152. // end of writeIniFileParam
  153. //////////////////////////////
  154. changeEnvironment:
  155.     openreg "CURRENTUSER", "Software\\Hidemaruo\\Hidemaru\\Env";
  156.     if( !result ) return -1;
  157.     $__macroPath = getregstr( "MacroPath" );
  158.     #__selectFound = getregnum( "SelectFound" );
  159.     #__cursorBreakCR = getregnum( "CursorBreakCR" );
  160.     #__caretTab = getregnum( "CaretTab" );
  161.     #__pasteCursorFix = getregnum( "PasteCursorFix" );
  162.  
  163.     #__changedEnvironment = 0;
  164.     if( ! #__selectFound ){
  165.         writeregnum "SelectFound", 1;
  166.         #__changedEnvironment = 1;
  167.     }
  168.     if( ! #__cursorBreakCR ){
  169.         writeregnum "CursorBreakCR", 1;
  170.         #__changedEnvironment = 1;
  171.     }
  172.     if( #__caretTab != 2 ){
  173.         writeregnum "CaretTab", 2;
  174.         #__changedEnvironment = 1;
  175.     }
  176.     if( #__pasteCursorFix ){
  177.         writeregnum "PasteCursorFix", 0;
  178.         #__changedEnvironment = 1;
  179.     }
  180.     closereg;
  181.     if( #__changedEnvironment ) envchanged;
  182.     if( $__macroPath == "" ) $__macroPath = hidemarudir;
  183.     if( rightstr( $__macroPath, 1 ) != "\\" ) $__macroPath = $__macroPath + "\\";
  184.     $__DIR = $__macroPath + "csshtml\\";
  185.  
  186.     $__searchBuffer = searchbuffer;
  187.     #__searchOption = searchoption;
  188.     #__changedOverwrite = 0;
  189.     if( overwrite ){
  190.         #__changedOverwrite = 1;
  191.         overwriteswitch;
  192.     }
  193.     #__changedFreecursor = 0;
  194.     if( freecursor ){
  195.         #__changedFreecursor = 1;
  196.         freecursorswitch;
  197.     }
  198.     #__changedReadOnly = 0;
  199.     #__windowwidth = 0;
  200.     #__changedShowLineno = 0;
  201.     $__INI = $__DIR + "csshtml.ini";
  202.     if( ! existfile( $__INI ) ){
  203.         execmacro $__DIR + "initializer.mac";
  204.         return -2;
  205.     }
  206.  
  207. return 1;
  208. // end of changeEnvironment
  209. //////////////////////////////
  210. restoreEnvironment:
  211.     setsearch $__searchBuffer, #__searchOption;
  212.     if( #__changedOverwrite ) overwriteswitch;
  213.     if( #__changedFreecursor ) freecursorswitch;
  214.     if( #__changedReadOnly ) readonlyswitch;
  215.     if( #__windowwidth ) setwindowsize #__windowwidth, #__windowheight;
  216.     if( #__changedShowLineno ) showlineno;
  217.  
  218.     if( ! #__changedEnvironment ) return;
  219.     openreg "CURRENTUSER", "Software\\Hidemaruo\\Hidemaru\\Env";
  220.     if( result ){
  221.         if( ! #__selectFound ) writeregnum "SelectFound", 0;
  222.         if( ! #__cursorBreakCR ) writeregnum "CursorBreakCR", 0;
  223.         if( #__caretTab != 2 ) writeregnum "CaretTab", #__caretTab;
  224.         if( #__pasteCursorFix ) writeregnum "PasteCursorFix", 1;
  225.         closereg;
  226.         envchanged;
  227.     }
  228. return;
  229. // end of restoreEnvironment
  230. //////////////////////////////
  231.