home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 January / maximum-cd-2010-01.iso / DiscContents / npp.5.5.1.Installer.exe / plugins / doc / NppExec_TechInfo.txt < prev    next >
Encoding:
Text File  |  2009-08-31  |  13.4 KB  |  364 lines

  1.  ****************************************************************************
  2.  * NppExec plugin ver. 0.3.2 for Notepad++ 5.1 (and above)
  3.  * by DV, December 2006 - September 2009
  4.  ****************************************************************************
  5.  
  6.  
  7.  ***************************
  8.  *  Technical Information  *
  9.  ***************************
  10.  
  11.  NppExec has advanced "hidden" settings which can be set manually.
  12.  You need to edit NppExec's ini-file: "\Plugins\Config\NppExec.ini".
  13.  
  14.   --------------------------------------------------------------------
  15.  |  KEY                             |  DEFAULT VALUE         |  TYPE  |
  16.  |--------------------------------------------------------------------|
  17.  |                                  |                        |        |
  18.  |  [Console]                       |                        |        |
  19.  |  ChildProcess_StartupTimeout_ms  |  240                   |  int   |
  20.  |  ChildProcess_CycleTimeout_ms    |  120                   |  int   |
  21.  |  ChildProcess_ExitTimeout_ms     |  4000                  |  int   |
  22.  |  Path_AutoDblQuotes              |  0            (FALSE)  |  BOOL  |
  23.  |  CmdHistory_MaxItems             |  256                   |  int   |
  24.  |  Exec_MaxCount                   |  100                   |  int   |
  25.  |  RichEdit_MaxTextLength          |  4194304      (4 MB)   |  int   |
  26.  |  CommentDelimiter                |  //                    | string |
  27.  |  Visible                         |  0            (FALSE)  |  BOOL  |
  28.  |  ShowHelp                        |  0            (FALSE)  |  BOOL  |
  29.  |  NoEmptyVars                     |  1            (TRUE)   |  BOOL  |
  30.  |  SaveCmdHistory                  |  1            (TRUE)   |  BOOL  |
  31.  |  TextColorNormal                 |  00 00 00              |  HEX   |
  32.  |  TextColorError                  |  A0 10 10              |  HEX   |
  33.  |  TextColorMessage                |  20 80 20              |  HEX   |
  34.  |  BackgroundColor                 |  0                     |  HEX   |
  35.  |  Alias_Cmd_NppExec               |  \                     | string |
  36.  |                                  |                        |        |
  37.  |  [Options]                       |                        |        |
  38.  |  HotKey                          |  F6                    | string |
  39.  |  ToolbarBtn                      |  1                     |  int   |
  40.  |  WatchScriptFile                 |  1            (TRUE)   |  BOOL  |
  41.  |  ScriptNppStart                  |               (empty)  | string |
  42.  |  ScriptNppExit                   |               (empty)  | string |
  43.  |  HelpFile                        | doc\NppExec_Manual.chm | string |
  44.  |                                  |                        |        |
  45.   --------------------------------------------------------------------
  46.  
  47.  The purpose of each key is described below.
  48.  You can add specified keys to [Console] or [Options] section of 
  49.  this ini-file.
  50.  For example, you can modify it in the following way:
  51.  
  52.    [Options]
  53.    HotKey=F6
  54.    ToolbarBtn=1
  55.    WatchScriptFile=1
  56.    ScriptNppStart=
  57.    ScriptNppExit=
  58.    HelpFile=doc\NppExec_Manual.chm
  59.    
  60.    [Console]
  61.    Visible=0
  62.    ShowHelp=0
  63.    OEM=1
  64.    CmdHistory=1
  65.    ChildProcess_StartupTimeout_ms=240
  66.    ChildProcess_CycleTimeout_ms=120
  67.    ChildProcess_ExitTimeout_ms=4000
  68.    Path_AutoDblQuotes=0
  69.    CmdHistory_MaxItems=256
  70.    Exec_MaxCount=100
  71.    RichEdit_MaxTextLength=4194304
  72.    CommentDelimiter=//
  73.    NoEmptyVars=1
  74.    SaveCmdHistory=1
  75.    TextColorNormal=00 00 00
  76.    TextColorError=A0 10 10
  77.    TextColorMessage=20 80 20
  78.    BackgroundColor=0
  79.    Alias_Cmd_NppExec=\
  80.  
  81.  
  82.  ChildProcess_StartupTimeout_ms
  83.  ------------------------------
  84.    This parameter is important when a child console process is created.
  85.    The child process usually can't be created immediately, therefore
  86.    we must give some time to this process to be started.
  87.    Here is a general implementation of this part of code:
  88.    
  89.        if ( CreateProcess( ... , &ProcInfo ) )
  90.        {
  91.            CloseHandle( ProcInfo.hThread );
  92.            WaitForSingleObject( ProcInfo.hProcess, STARTUP_TIMEOUT );
  93.            ...
  94.        }
  95.  
  96.    When the process is started, WaitForSingleObject returns.
  97.    But, if the value of STARTUP_TIMEOUT is too low, WaitForSingleObject 
  98.    may return before the process is started.
  99.    If default value of ChildProcess_StartupTimeout_ms is not enough for
  100.    your PC, you can increase it. IMHO, it can not exceed 400 ms.
  101.    
  102.  
  103.  ChildProcess_CycleTimeout_ms
  104.  ----------------------------
  105.    The only purpose of this parameter is to decrease the CPU usage.
  106.    The bigger value you set, the less CPU usage you get :-)
  107.    Here is an implementation of this part of code in outline:
  108.    
  109.        do {
  110.            // reading from the process'es pipe
  111.            ...
  112.        } while ( WaitForSingleObject( ProcInfo.hProcess, 
  113.                      CYCLE_TIMEOUT ) == WAIT_TIMEOUT );
  114.    
  115.    Don't forget that actually the value of ChildProcess_CycleTimeout_ms
  116.    is a pause between requests to the child console process'es output, 
  117.    so values > 500 ms are not recommened.
  118.  
  119.  
  120.  ChildProcess_ExitTimeout_ms
  121.  ---------------------------
  122.    This parameter is needed when you are about to exit (quit) a running
  123.    child console process by sending the exit message to it.
  124.    For example, cmd.exe is running, but you want to close the Console
  125.    window or start another NppExec's script. So, you send the exit 
  126.    message - and NppExec waits for the cmd.exe process to be finished. 
  127.    If the child process has been finished before the timeout of
  128.    ChildProcess_ExitTimeout_ms elapsed, NppExec performs the action 
  129.    requested previously - closes its Console window or starts another 
  130.    script.
  131.    Otherwise, if the child process has not been finished during 
  132.    ChildProcess_ExitTimeout_ms (for example, if "dir" has been sent 
  133.    instead of "exit"), then NppExec does not close its Console window
  134.    or does not start another script after the child process will be
  135.    finished at last.
  136.  
  137.  
  138.  
  139.  Path_AutoDblQuotes
  140.  ------------------
  141.    If you enable this option (set it to 1), then path to executable 
  142.    which contains spaces (for example, "my program 1.exe") will be 
  143.    automatically enclosed in quotes "".
  144.    It is disabled by default because of a bug with executables w/o
  145.    extension. For example, this line
  146.    
  147.      cmd /c calc.exe
  148.    
  149.    will be modified (if this option is enabled) to this one:
  150.    
  151.      "cmd /c calc.exe"
  152.      
  153.    because "cmd" is given without extension ".exe".
  154.    Therefore don't forget to enclose paths with spaces in quotes
  155.    manually, when this option is disabled.
  156.    
  157.  
  158.  CmdHistory_MaxItems
  159.  -------------------
  160.    Specifies maximum number of items in the console commands history.
  161.    
  162.  
  163.  Exec_MaxCount
  164.  -------------
  165.    Specifies maximum number of NPP_EXEC calls within one script.
  166.    This value is needed to prevent the infinite loop of several scripts
  167.    which call each other, e.g.
  168.    
  169.      ::script1
  170.      npp_exec script2
  171.      
  172.      ::script2
  173.      npp_exec script1
  174.    
  175.  
  176.  RichEdit_MaxTextLength  
  177.  ----------------------
  178.    Specifies maximum number of characters which can be stored or 
  179.    pasted into the Console dialog's rich edit control.
  180.  
  181.  
  182.  CommentDelimiter
  183.  ----------------
  184.    Specifies a comment delimiter  :-)  I.e. all characters after
  185.    this delimiter are understood as a comment, and the text line
  186.    (command) is truncated at the position of this delimiter.
  187.    Exception: 
  188.    - when the comment delimiter is // then :// is not truncated 
  189.    at the position of // (because :// can be a part of http://).
  190.    Note:
  191.    - if you specify empty comment delimiter i.e.
  192.  
  193.      CommentDelimiter=
  194.  
  195.    then you can not use comments in your commands/scripts because
  196.    there is no comment delimiter in this case.
  197.  
  198.  
  199.  Visible
  200.  -------
  201.    If you enable this option (set it to 1), then the Console window
  202.    will be visible when Notepad++ starts. Otherwise, when this option
  203.    is set to 0 (default value), there will be no Console window opened
  204.    when Notepad++ starts.
  205.  
  206.  
  207.  ShowHelp
  208.  --------
  209.    When this option is enabled (set to 1), the Console window shows
  210.    the Help Info each time Notepad++ starts.
  211.    If this option is disabled (set to 0), the Console window does not
  212.    show the Help Info when Notepad++ starts.
  213.    
  214.  
  215.  NoEmptyVars
  216.  -----------
  217.    When this option is enabled (set to 1), then all unset variables
  218.    such as "$(var)" will be replaced with "" (empty string).
  219.    If this option is disabled (set to 0), then unset variable "$(var)" 
  220.    will not be replaced with empty string i.e. it will remain "$(var)".
  221.  
  222.  
  223.  SaveCmdHistory
  224.  --------------
  225.    When this option is enabled (set to 1) and "Console Commands History"
  226.    is checked, then the console commands history is saved to file
  227.    "npec_cmdhistory.txt" when Notepad++ exits. And the commands history
  228.    is restored from this file when Notepad++ starts.
  229.    If this option is disabled (set to 0), then the console commands
  230.    history is not saved and restored.
  231.  
  232.  
  233.  TextColorNormal
  234.  ---------------
  235.    This option can specify the Console's normal text colour in a form of
  236.    RR GG BB, where RR, GG and BB are HEX values of red, green and blue
  237.    colours.
  238.    Value of "00 00 00" or "000000" means RR = 00, GG = 00 and BB = 00 
  239.    i.e. black colour (because values of red, green and blue = 0x00).
  240.    Value of "FF 00 00" or "FF0000" means RR = FF, GG = 00 and BB = 00 
  241.    i.e. red colour (red = 0xFF, green and blue = 0x00).
  242.    Value of "0" or any other value which does not contain three values of
  243.    relative intensities of red, green and blue colours means "don't use
  244.    this value, use default colour". I.e. you can specify
  245.    
  246.      TextColorNormal=0
  247.      
  248.    or just
  249.    
  250.      TextColorNormal=
  251.      
  252.    to use the default (internal) colour.
  253.    The same approach is used for TextColorError, TextColorMessage and
  254.    BackgroundColor values.
  255.    If you want to have a "console-style" look (i.e. white text on the
  256.    black background), specify the values similar to:
  257.    
  258.      TextColorNormal=C0 C0 C0
  259.      TextColorError=C0 10 10
  260.      TextColorMessage=20 A0 20
  261.      BackgroundColor=00 00 00
  262.  
  263.  
  264.  TextColorError
  265.  --------------
  266.    This option can specify the colour of Console's error messages.
  267.    See TextColorNormal for details.
  268.    
  269.  
  270.  TextColorMessage
  271.  ----------------
  272.    This option can specify the colour of Console's internal messages
  273.    (such as  "Process started >>>",  "======== READY ========"  etc.)
  274.    See TextColorNormal for details.
  275.    
  276.  
  277.  BackgroundColor
  278.  ---------------
  279.    Background color of the Console's output window.
  280.    See TextColorNormal for details.
  281.  
  282.  
  283.  Alias_Cmd_NppExec
  284.  -----------------
  285.    This alias can be used instead of the "NPP_EXEC " command when you 
  286.    want to execute some NppExec's script. The alias consists of one 
  287.    character; only the first character from specified string value is 
  288.    taken. For example,
  289.  
  290.      Alias_Cmd_NppExec=\!?
  291.  
  292.    sets the first character '\' as the alias, other characters are
  293.    ignored. With this example, you can type
  294.  
  295.      \"my script" "param 1" "param 2"
  296.  
  297.    instead of
  298.  
  299.      NPP_EXEC "my script" "param 1" "param 2"
  300.  
  301.    and the script named "my script" will be executed.
  302.    You can also specify an empty value of Alias_Cmd_NppExec:
  303.  
  304.      Alias_Cmd_NppExec=
  305.  
  306.    The empty value of Alias_Cmd_NppExec disables the alias i.e. no
  307.    character can be used instead of "NPP_EXEC ".
  308.  
  309.  
  310.  HotKey
  311.  ------
  312.    Specifies the plugin hotkey which calls the "Execute..." dialog.
  313.    Available values are: F1, F2, F3 ... F12.
  314.  
  315.  
  316.  ToolbarBtn
  317.  ----------
  318.    ToolbarBtn = 0  -  no toolbar button;
  319.    ToolbarBtn = 1  -  the toolbar button shows the Console window;
  320.    ToolbarBtn = 2  -  the toolbar button calls the "Execute..." dialog.
  321.    ToolbarBtn = 3  -  the toolbar button directly executes last script.
  322.    
  323.    
  324.  WatchScriptFile
  325.  ---------------
  326.    When this option is enabled (set to 1), the plugin rereads the file
  327.    with saved scripts if its time stamp has been changed. The plugin
  328.    checks the file time stamp when you call the "Execute..." dialog.
  329.    If this option is disabled (set to 0), the plugin does not check
  330.    the file time stamp and does not reread this file.
  331.  
  332.  
  333.  ScriptNppStart
  334.  --------------
  335.    You can specify here a name of existing script which you want to be
  336.    executed each time when Notepad++ starts.
  337.    For example, this script can contain declarations of your own variables
  338.    (using SET command), some welcome messages (using ECHO command) or
  339.    whatever command(s) you want.
  340.    Note: if you specify an empty value or non-existent script name for
  341.    this option, no script will be executed when Notepad++ starts.
  342.    See also: ScriptNppExit.
  343.    
  344.  
  345.  ScriptNppExit
  346.  -------------
  347.    You can specify here a name of existing script which you want to be
  348.    executed each time when Notepad++ exits.
  349.    Note: if you specify an empty value or non-existent script name for
  350.    this option, no script will be executed when Notepad++ exits.
  351.    See also: ScriptNppStart.
  352.  
  353.  
  354.  HelpFile
  355.  --------
  356.    Relative pathname to NppExec's help file (manual). 
  357.    This pathname is relative to location of the "NppExec.dll" file.
  358.    Usually "NppExec.dll" is located somewhere in "...\Notepad++\plugins",
  359.    and the help file is located in "...\Notepad++\plugins\doc" so its
  360.    relative pathname is "doc\NppExec_Manual.chm".
  361.    You can specify different file name and/or extension here.
  362.    Also you can specify absolute pathname (e.g. C:\docs\NppExec.chm).
  363.  
  364.