2008-08-21 12:34:29 +02:00
|
|
|
#ifndef X_DISPLAY_MISSING
|
2011-08-20 19:27:09 +02:00
|
|
|
#include <ngspice/ngspice.h>
|
|
|
|
|
#include <ngspice/wordlist.h>
|
|
|
|
|
#include <ngspice/bool.h>
|
2000-06-27 18:15:43 +02:00
|
|
|
#include <variable.h>
|
|
|
|
|
|
|
|
|
|
#include "variable.h"
|
2011-08-20 19:27:09 +02:00
|
|
|
#include <ngspice/cpextern.h>
|
|
|
|
|
#include <ngspice/cpextern.h>
|
|
|
|
|
#include <ngspice/hlpdefs.h>
|
2008-08-21 12:34:29 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "com_ghelp.h"
|
|
|
|
|
#include "com_help.h"
|
2000-06-27 18:15:43 +02:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
com_ghelp(wordlist *wl)
|
|
|
|
|
{
|
|
|
|
|
char *npath;
|
|
|
|
|
char *path = Help_Path;
|
|
|
|
|
char buf[BSIZE_SP];
|
2008-11-19 20:46:08 +01:00
|
|
|
#ifndef X_DISPLAY_MISSING
|
2000-06-27 18:15:43 +02:00
|
|
|
int i;
|
2008-11-19 20:46:08 +01:00
|
|
|
#endif /* X_DISPLAY_MISSING 1 */
|
2000-06-27 18:15:43 +02:00
|
|
|
|
2010-07-17 22:48:20 +02:00
|
|
|
if (cp_getvar("helppath", CP_STRING, buf))
|
2000-06-27 18:15:43 +02:00
|
|
|
path = copy(buf);
|
|
|
|
|
if (!path) {
|
|
|
|
|
fprintf(cp_err, "Note: defaulting to old help.\n\n");
|
|
|
|
|
com_help(wl);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2010-11-19 19:54:40 +01:00
|
|
|
if ((npath = cp_tildexpand(path)) == NULL) {
|
2000-06-27 18:15:43 +02:00
|
|
|
fprintf(cp_err, "Note: can't find help dir %s\n", path);
|
|
|
|
|
fprintf(cp_err, "Defaulting to old help.\n\n");
|
|
|
|
|
com_help(wl);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2008-08-21 12:34:29 +02:00
|
|
|
#ifndef X_DISPLAY_MISSING /* 1 */
|
2000-06-27 18:15:43 +02:00
|
|
|
path = npath;
|
2010-07-17 22:48:20 +02:00
|
|
|
if (cp_getvar("helpregfont", CP_STRING, buf))
|
2000-06-27 18:15:43 +02:00
|
|
|
hlp_regfontname = copy(buf);
|
2010-07-17 22:48:20 +02:00
|
|
|
if (cp_getvar("helpboldfont", CP_STRING, buf))
|
2000-06-27 18:15:43 +02:00
|
|
|
hlp_boldfontname = copy(buf);
|
2010-07-17 22:48:20 +02:00
|
|
|
if (cp_getvar("helpitalicfont", CP_STRING, buf))
|
2000-06-27 18:15:43 +02:00
|
|
|
hlp_italicfontname = copy(buf);
|
2010-07-17 22:48:20 +02:00
|
|
|
if (cp_getvar("helptitlefont", CP_STRING, buf))
|
2000-06-27 18:15:43 +02:00
|
|
|
hlp_titlefontname = copy(buf);
|
2010-07-17 22:48:20 +02:00
|
|
|
if (cp_getvar("helpbuttonfont", CP_STRING, buf))
|
2000-06-27 18:15:43 +02:00
|
|
|
hlp_buttonfontname = copy(buf);
|
2011-04-30 14:29:19 +02:00
|
|
|
if (cp_getvar("helpinitxpos", CP_NUM, &i))
|
2000-06-27 18:15:43 +02:00
|
|
|
hlp_initxpos = i;
|
2011-04-30 14:29:19 +02:00
|
|
|
if (cp_getvar("helpinitypos", CP_NUM, &i))
|
2000-06-27 18:15:43 +02:00
|
|
|
hlp_initypos = i;
|
2010-07-17 22:48:20 +02:00
|
|
|
if (cp_getvar("helpbuttonstyle", CP_STRING, buf)) {
|
2000-06-27 18:15:43 +02:00
|
|
|
if (cieq(buf, "left"))
|
|
|
|
|
hlp_buttonstyle = BS_LEFT;
|
|
|
|
|
else if (cieq(buf, "center"))
|
|
|
|
|
hlp_buttonstyle = BS_CENTER;
|
|
|
|
|
else if (cieq(buf, "unif"))
|
|
|
|
|
hlp_buttonstyle = BS_UNIF;
|
|
|
|
|
else
|
|
|
|
|
fprintf(cp_err, "Warning: no such button style %s\n",
|
|
|
|
|
buf);
|
|
|
|
|
}
|
2011-04-30 14:29:19 +02:00
|
|
|
if (cp_getvar("width", CP_NUM, &i))
|
2000-06-27 18:15:43 +02:00
|
|
|
hlp_width = i;
|
2010-07-17 22:48:20 +02:00
|
|
|
if (cp_getvar("display", CP_STRING, buf))
|
2000-06-27 18:15:43 +02:00
|
|
|
hlp_displayname = copy(buf);
|
2010-07-17 22:48:20 +02:00
|
|
|
else if (cp_getvar("device", CP_STRING, buf))
|
2000-06-27 18:15:43 +02:00
|
|
|
hlp_displayname = copy(buf);
|
|
|
|
|
else
|
|
|
|
|
hlp_displayname = NULL;
|
|
|
|
|
hlp_main(path, wl);
|
|
|
|
|
return;
|
2008-08-21 12:34:29 +02:00
|
|
|
#endif /* X_DISPLAY_MISSING 1 */
|
2008-11-08 14:55:42 +01:00
|
|
|
#ifdef HAS_WINDOWS
|
|
|
|
|
printf("Internal help is no longer avaialable!\n");
|
|
|
|
|
printf("Please check for\n");
|
|
|
|
|
printf("http://newton.ex.ac.uk/teaching/CDHW/Electronics2/userguide/\n");
|
|
|
|
|
#endif
|
2000-06-27 18:15:43 +02:00
|
|
|
}
|