/*************************************************************************
 ***                        help.c                       (JJB TEMPLAR) ***
 *** Date modifications begun: 7/8/89.                                 ***
 *** Last modified: 27/8/89.                                           ***
 *************************************************************************/
/*** Help stuff. Compile with -cs                                      ***
 *************************************************************************/

#include "less.h"
#include "screen.h"

extern int  has_resized;

char    *help0data[] = {
"\n    [32mTy 1.3 Commands:[m\n\n",
"    qQxX{ESC} ............... Quit.\n",
"    tT< ..................... Top of file.\n",
"    bB> ..................... Bottom of file.\n",
"    {BACKSPC}{SHIFT UP} ..... Back page.\n",
"    {SPACE}{SHIFT DOWN} ..... Forward page.\n",
"    {UP} .................... Back one line.\n",
"    {DOWN}{RETURN} .......... Forward one line.\n",
"    nN ...................... Next file.\n",
"    pP ...................... Previous file.\n",
"    .sS ..................... Search forward.\n",
"    ,rR ..................... Search backward.\n",
"    / ....................... Search forward for last pattern.\n",
"    ? ....................... Search backward for last pattern.\n",
"    iI ...................... Iconify (by Leo Schwab, Fish126).\n",
"    % ....................... Go a percentage into the file.\n",
"    cC{NK *} ................ NewCLI.\n",
"    eE ...................... Invoke ENV:EDITOR on current file.\n",
"    aA ...................... Add new file.\n",
"                           [33m(press RETURN)[m",
NULL};          /* Use NULL to end data, so output is size independent. */
char    *help1data[] = {
"\n    [32mTy 1.3 Commands: (page 2)[m\n\n",
"    {LEFT} .................. Move left.\n",
"    {RIGHT} ................. Move right.\n",
"    {SHIFT LEFT} ............ Move to left edge.\n",
"    {SHIFT RIGHT} ........... Move to right edge.\n",
"    mM ...................... Set mark [0-9].\n",
"    `gG ..................... Go to mark [0-9].\n",
"    {CTRL-L} ................ Repaint.\n",
"    {F1} .................... Print file to PRT:\n",
"    + ....................... Turn mode on.\n",
"    - ....................... Turn mode off.\n",
"    hH{HELP} ................ This info.\n",
"    {SHIFT HELP} ............ About info.\n",
"    vV ...................... Version.\n",
"    = ....................... Summary information.\n\n\n",
"    [3mSome of the command keys have been added for compatibility with\n",
"    \"more\" v3.23 (the help screen of which is the basis of this one).[m\n",
"                           [33m(press RETURN)[m",
NULL};          /* Use NULL to end data, so output is size independent. */

char    *aboutdata[] = {
"\n    [32mAbout Ty 1.3:[m\n\n",
"    Ty is the text display program used by the 1st NZAmigaUG (Wgtn).\n",
"    It was converted from \"less\" by our president for use on the\n",
"    Newsdisks, and has seen continual improvement (until now :-).\n\n",
"    [32mHistory:[m\n",
"    Originally was \"less\", a program based on \"more\", and © 1984, 1985\n",
"    by Mark Nudelman. \"Less\" was designed to be machine independent.\n\n",
"    In 1986 Tony Wills hacked \"less\" into a form suitable for the Amiga,\n",
"    particularly regarding use from WorkBench. Since then (ty 1.0), he\n",
"    has modified it further to suit the WorkBench environment as set up\n",
"    by our Newsdisks, up till ty 1.2.\n\n",
"    Now (Aug 1989) the program has fallen into my hands (JJB TEMPLAR), in\n",
"    order to add Intuition support. In the process, ty has lost a number\n",
"    of features, as well as the machine independent nature of the original\n",
"    source code.\n\n",
"                           [33m(press RETURN)[m",
NULL};

char    *aboutdata2[] = {
"\n    [32mAbout Ty 1.3: (page 2)[m\n\n",
"    Iconify is by Leo Schwab, and may be found on Fish126.\n\n",
"    And... if anyone would like to improve ty, contact me for the source:\n",
"                    J Bickers,\n",
"                    214 Rata St,\n",
"                    Naenae.\n",
"                    PH: (04) 672-085.\n\n",
"    Suggestions, complaints or questions should be directed to the above\n",
"    address for the moment. Questions relating to the use of this program\n",
"    outside the 1st NZAmigaUG (Wgtn) should be directed to:\n",
"                    Tony Wills,\n",
"                    156c Queens Dr,\n",
"                    Lyall Bay,\n",
"                    Wellington.\n",
"                    PH: (04) 877-258.\n\n\n",
"                           [33m(press RETURN)[m",
NULL};

static void page(ch,cp) /*===============================================*/
register char   **ch,*cp;
{
    clear();
    while (*ch) puts(*ch++);
    error(cp,1);
    if (has_resized) {
        resize();
        has_resized = 0;
    }
}

void    help() /*========================================================*/
{
    page(help0data,"More ...");
    page(help1data,"To continue ...");
}

void    about() /*=======================================================*/
{
    page(aboutdata,"More ...");
    page(aboutdata2,"To continue ...");
}
