Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
57
cde/programs/dthelp/dthelpview/Dthelpview
Normal file
57
cde/programs/dthelp/dthelpview/Dthelpview
Normal file
@@ -0,0 +1,57 @@
|
||||
!######################################################################
|
||||
!#
|
||||
!# Dthelpview
|
||||
!#
|
||||
!# Common Desktop Environment (CDE)
|
||||
!#
|
||||
!# Application Defaults for the CDE dthelpview application
|
||||
!#
|
||||
!# (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
!# (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
!# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
!# (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary
|
||||
!# of Novell, Inc.
|
||||
!#
|
||||
!# $XConsortium: Dthelpview /main/3 1995/11/08 09:21:11 rswiston $
|
||||
!#
|
||||
!######################################################################
|
||||
|
||||
!########
|
||||
!#
|
||||
!# Dthelpview app-defaults file.
|
||||
!#
|
||||
!########
|
||||
|
||||
|
||||
!########
|
||||
!#
|
||||
!# Pull in additional help resources via the Dt app-defaults file
|
||||
!#
|
||||
!########
|
||||
|
||||
#include "Dt"
|
||||
|
||||
!########
|
||||
!#
|
||||
!# Man Page Box and File Box resources
|
||||
!#
|
||||
!# The "manBox" is the DtHelpQuickDialog used by dthelpview to display
|
||||
!# man pages by dthelpview; "fileBox" is used to display text files.
|
||||
!#
|
||||
!########
|
||||
|
||||
Dthelpview*manBox.rows: 32
|
||||
Dthelpview*manBox.columns: %|nls-1-80^columns|
|
||||
Dthelpview*fileBox.rows: 32
|
||||
Dthelpview*fileBox.columns: %|nls-2-80^columns|
|
||||
|
||||
!########
|
||||
!#
|
||||
!# Size of the dthelpview man page query dialog text field and the
|
||||
!# search word text field in the index search dialog of the DtHelpDialog widget.
|
||||
!#
|
||||
!########
|
||||
|
||||
Dthelpview*man_text.columns: %|nls-3-#20#|
|
||||
Dthelpview*searchShell*srchWord.columns: %|nls-4-#30#|
|
||||
|
||||
14
cde/programs/dthelp/dthelpview/Imakefile
Normal file
14
cde/programs/dthelp/dthelpview/Imakefile
Normal file
@@ -0,0 +1,14 @@
|
||||
XCOMM $XConsortium: Imakefile /main/7 1996/09/14 15:26:44 drk $
|
||||
PROGRAMS = dthelpview
|
||||
|
||||
DEFINES = -D_BMS
|
||||
INCLUDES = -I.
|
||||
|
||||
DEPLIBS = $(DEPDTHELPLIB) $(DEPDTSVCLIB) $(DEPTTLIB) $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXPLIB) $(DEPXLIB)
|
||||
LOCAL_LIBRARIES = $(DTHELPLIB) $(DTSVCLIB) $(TTLIB) $(XMLIB) $(XTOOLLIB) $(XPLIB) $(XLIB)
|
||||
SYS_LIBRARIES = DtClientSysLibs $(CXXLIB)
|
||||
|
||||
SRCS = Main.c ManPage.c Util.c version.c
|
||||
OBJS = Main.o ManPage.o Util.o version.o
|
||||
|
||||
ComplexProgramTarget($(PROGRAMS))
|
||||
368
cde/programs/dthelp/dthelpview/Main.c
Normal file
368
cde/programs/dthelp/dthelpview/Main.c
Normal file
@@ -0,0 +1,368 @@
|
||||
/* $TOG: Main.c /main/5 1998/04/20 12:52:56 mgreess $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Main.c
|
||||
**
|
||||
** Project: Cache Creek (Rivers) Project
|
||||
**
|
||||
** Description: This is the main.c file for the helpview program.
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
/* System Include Files */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h>
|
||||
#include <limits.h>
|
||||
#include <unistd.h> /* R_OK */
|
||||
#ifdef __osf__
|
||||
/* Suppress unaligned access message */
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#endif /* __osf__ */
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/Shell.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#include <Xm/MwmUtil.h>
|
||||
#include <Xm/Protocols.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/PushB.h>
|
||||
|
||||
#include <Dt/HelpDialog.h>
|
||||
|
||||
|
||||
#include <Dt/DtNlUtils.h>
|
||||
#include <Dt/EnvControlP.h>
|
||||
|
||||
/* Local Includes */
|
||||
|
||||
#include <DtI/HelposI.h>
|
||||
#include <DtI/HelpP.h>
|
||||
#include <DtI/FileUtilsI.h>
|
||||
#include "Main.h"
|
||||
#include "UtilI.h"
|
||||
#include "ManPageI.h"
|
||||
|
||||
/* Application resource list definition */
|
||||
|
||||
static XrmOptionDescRec option_list[] =
|
||||
{
|
||||
{ "-helpVolume", "helpVolume", XrmoptionSepArg, NULL },
|
||||
{ "-locationId", "locationId", XrmoptionSepArg, NULL },
|
||||
{ "-file", "file", XrmoptionSepArg, NULL },
|
||||
{ "-manPage", "manPage", XrmoptionSepArg, NULL },
|
||||
{ "-man", "man", XrmoptionNoArg, "True" },
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* Structure, resource definitions, for View's optional parameters. */
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char * helpVolume;
|
||||
char * locationId;
|
||||
char * file;
|
||||
char * manPage;
|
||||
char * man;
|
||||
|
||||
} ApplicationArgs, *ApplicationArgsPtr;
|
||||
|
||||
static ApplicationArgs application_args;
|
||||
|
||||
static XtResource resources[] =
|
||||
{
|
||||
|
||||
{
|
||||
"helpVolume", "HelpVolume", XmRString, sizeof (char *),
|
||||
XtOffset (ApplicationArgsPtr, helpVolume),XmRImmediate,(caddr_t) NULL,
|
||||
},
|
||||
|
||||
{
|
||||
"locationId", "LocationId", XmRString, sizeof (char *),
|
||||
XtOffset (ApplicationArgsPtr, locationId), XmRImmediate, (caddr_t) NULL,
|
||||
},
|
||||
|
||||
{
|
||||
"file", "File", XmRString, sizeof (char *),
|
||||
XtOffset (ApplicationArgsPtr, file), XmRImmediate, (caddr_t) NULL,
|
||||
},
|
||||
{
|
||||
"manPage", "ManPage", XmRString, sizeof (char *),
|
||||
XtOffset (ApplicationArgsPtr, manPage), XmRImmediate, (caddr_t) NULL,
|
||||
},
|
||||
{
|
||||
"man", "Man", XmRString, sizeof (char *),
|
||||
XtOffset (ApplicationArgsPtr, man), XmRImmediate, (caddr_t) NULL,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/******** Static Function Declarations ********/
|
||||
|
||||
static void Usage(
|
||||
char ** argv);
|
||||
static void ExpandVolume(
|
||||
char **helpVolume);
|
||||
|
||||
|
||||
|
||||
|
||||
/* Global Variables */
|
||||
#define MAX_ARGS 20
|
||||
#define charset XmFONTLIST_DEFAULT_TAG
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: static void GlobalInit();
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Initializes our global variables to valid starting values.
|
||||
*
|
||||
****************************************************************************/
|
||||
static void GlobalInit()
|
||||
|
||||
{
|
||||
|
||||
pCacheListHead = NULL;
|
||||
pCacheListTale = NULL;
|
||||
totalCacheNodes = NULL;
|
||||
|
||||
helpClass = XtNewString("Dthelpview");
|
||||
|
||||
viewWidget = NULL;
|
||||
manWidget = NULL;
|
||||
manBtn = NULL;
|
||||
manText = NULL;
|
||||
manForm = NULL;
|
||||
closeBtn = NULL;
|
||||
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
* Main Line Program:
|
||||
*
|
||||
***************************************************************************/
|
||||
void main(
|
||||
int argc,
|
||||
char **argv)
|
||||
{
|
||||
char *appName;
|
||||
Arg args[2];
|
||||
int n;
|
||||
int newArgc=0;
|
||||
char **newArgv;
|
||||
int counter=0;
|
||||
|
||||
#ifdef __osf__
|
||||
/* Code to suppress unaligned access message. */
|
||||
unsigned long op;
|
||||
int buffer[2];
|
||||
unsigned long nbytes = 1;
|
||||
char* arg = 0;
|
||||
unsigned long flag = 0;
|
||||
|
||||
int ssi_status;
|
||||
|
||||
op = SSI_NVPAIRS;
|
||||
|
||||
buffer[0] = SSIN_UACPROC;
|
||||
buffer[1] = 0x00000001;
|
||||
#ifdef DEBUG_UAC
|
||||
buffer[1] |= 0x00000004;
|
||||
#endif
|
||||
|
||||
ssi_status = setsysinfo ( op, (caddr_t) buffer, nbytes, arg, flag );
|
||||
#endif
|
||||
|
||||
|
||||
XtSetLanguageProc(NULL, NULL, NULL);
|
||||
startCommand = argv[0];
|
||||
appName = strrchr(argv[0], '/');
|
||||
if (appName != NULL)
|
||||
appName++;
|
||||
else
|
||||
appName = argv[0];
|
||||
|
||||
|
||||
/* Copy our argv values into a new array for use in DisplayTopic... */
|
||||
newArgc = argc;
|
||||
newArgv = (char **) XtMalloc (sizeof(char *) * (argc +1));
|
||||
|
||||
for (counter=0;counter < argc; counter++)
|
||||
{
|
||||
newArgv[counter] = XtMalloc (strlen(argv[counter]) +1);
|
||||
strcpy (newArgv[counter], argv[counter]);
|
||||
}
|
||||
|
||||
/* Setup our Help message catalog file name */
|
||||
DtHelpSetCatalogName("DtHelp.cat");
|
||||
|
||||
_DtEnvControl(DT_ENV_SET);
|
||||
{
|
||||
/* char * foo = ((char *)GETMESSAGE(7, 1, "")); ??? */
|
||||
}
|
||||
|
||||
|
||||
/* Initialize toolkit and open the display */
|
||||
topLevel = XtInitialize(appName, "Dthelpview", option_list, 5, &argc, argv);
|
||||
appDisplay = XtDisplay(topLevel);
|
||||
|
||||
if (!appDisplay)
|
||||
{
|
||||
XtWarning ("Dialogs: Can't open display, exiting...");
|
||||
exit (0);
|
||||
}
|
||||
|
||||
/* Get the application resources. */
|
||||
XtGetApplicationResources(topLevel, &application_args,
|
||||
resources, XtNumber(resources), NULL, 0);
|
||||
|
||||
/* If all of the command line parameters were not processed */
|
||||
/* out, print out a usage message set and exit. */
|
||||
|
||||
if (argc != 1)
|
||||
Usage (argv);
|
||||
|
||||
/* Call our global init routine */
|
||||
GlobalInit();
|
||||
|
||||
|
||||
/* Setup or environment to handle multi-byte stuff */
|
||||
#ifdef NLS16
|
||||
Dt_nlInit();
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Give our shell a default size greater than zero */
|
||||
n = 0;
|
||||
XtSetArg (args[n], XmNheight, 10); n++;
|
||||
XtSetArg (args[n], XmNwidth, 10); n++;
|
||||
XtSetValues(topLevel, args, n);
|
||||
|
||||
|
||||
/* Setup up our top level shell */
|
||||
/* XtSetMappedWhenManaged(topLevel, FALSE);
|
||||
* XtRealizeWidget(topLevel);
|
||||
*/
|
||||
|
||||
|
||||
if (application_args.file != NULL)
|
||||
DisplayFile(topLevel, application_args.file);
|
||||
else if (application_args.manPage != NULL)
|
||||
DisplayMan(topLevel, application_args.manPage,
|
||||
EXIT_ON_CLOSE);
|
||||
else if (application_args.man != NULL)
|
||||
PostManDialog(topLevel, newArgc, newArgv);
|
||||
else if (application_args.helpVolume != NULL)
|
||||
{
|
||||
/* See if you can expand the helpVolume value */
|
||||
ExpandVolume(&(application_args.helpVolume));
|
||||
DisplayTopic(topLevel, application_args.helpVolume,
|
||||
application_args.locationId, newArgc, newArgv);
|
||||
}
|
||||
else
|
||||
Usage (argv);
|
||||
|
||||
XtMainLoop();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* Usage
|
||||
* When incorrect parameters have been specified on the command
|
||||
* line, print out a set of messages detailing the correct use
|
||||
* and exit.
|
||||
*
|
||||
************************************************************************/
|
||||
static void Usage(
|
||||
char ** argv)
|
||||
{
|
||||
(void) fprintf (stderr, ((char *)_DTGETMESSAGE(7, 1,
|
||||
"Usage: %s...\n")), argv[0]);
|
||||
(void) fprintf (stderr, "\n");
|
||||
(void) fprintf (stderr, ((char *)_DTGETMESSAGE(7, 2,
|
||||
"\t-helpVolume <Help Volume File>\n")), argv[0]);
|
||||
(void) fprintf (stderr, ((char *) _DTGETMESSAGE(7, 3,
|
||||
"\t-locationId <ID>\n")), argv[0]);
|
||||
(void) fprintf (stderr, ((char *) _DTGETMESSAGE(7, 5,
|
||||
"\t-file <ASCII Text File>\n")), argv[0]);
|
||||
(void) fprintf (stderr, ((char *) _DTGETMESSAGE(7, 6,
|
||||
"\t-man\n")), argv[0]);
|
||||
(void) fprintf (stderr, ((char *) _DTGETMESSAGE(7, 7,
|
||||
"\t-manPage <Unix Man Page>\n\n\n")), argv[0]);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: ExpandVolume()
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Takes a helpVolume file name and adds the cwd path to the
|
||||
* front of it, and possibly adds a suffix.
|
||||
* It then stats the file; if the file is present, the
|
||||
* function returns a malloc'd full path in helpVolume,
|
||||
* otherwise it returns a malloc'd copy of the original value.
|
||||
*
|
||||
***************************************************************************/
|
||||
static void ExpandVolume(
|
||||
char **helpVolume)
|
||||
{
|
||||
|
||||
char * workingPath=NULL;
|
||||
|
||||
/* try to locate file and its entry, if present */
|
||||
/* True: search relative to current directory as well */
|
||||
workingPath = _DtHelpFileLocate("volumes", *helpVolume,
|
||||
_DtHelpFileSuffixList,True,R_OK);
|
||||
if (workingPath) *helpVolume = workingPath;
|
||||
else *helpVolume = strdup(*helpVolume);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
73
cde/programs/dthelp/dthelpview/Main.h
Normal file
73
cde/programs/dthelp/dthelpview/Main.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/* $XConsortium: Main.h /main/3 1995/11/08 09:22:29 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Main.h
|
||||
**
|
||||
** Project: helpviewerr 3.0
|
||||
**
|
||||
** Description: Structures and defines needed by all of the files.
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _Main_h
|
||||
#define _Main_h
|
||||
|
||||
|
||||
#include "UtilI.h"
|
||||
|
||||
#define NOSUCCESS 0
|
||||
#define SUCCESS 1
|
||||
|
||||
|
||||
/* Close callback types used by our Quick help sutff */
|
||||
#define EXIT_ON_CLOSE 1
|
||||
#define NO_EXIT_ON_CLOSE 2
|
||||
|
||||
|
||||
/* Run Mode Defines */
|
||||
#define HELP_TOPIC_SESSION 1
|
||||
#define SINGLE_MAN_SESSION 2
|
||||
#define MULTI_MAN_SESSION 3
|
||||
#define SINGLE_FILE_SESSION 4
|
||||
|
||||
|
||||
|
||||
/* Global Variables Used to maintain our cache list of help dialogs */
|
||||
CacheListStruct *pCacheListHead;
|
||||
CacheListStruct *pCacheListTale;
|
||||
int totalCacheNodes;
|
||||
|
||||
/* Global Variables */
|
||||
Widget topLevel;
|
||||
Widget viewWidget;
|
||||
Widget manWidget;
|
||||
Widget manBtn;
|
||||
Widget manText;
|
||||
Widget manForm;
|
||||
Widget closeBtn;
|
||||
|
||||
|
||||
/* General global variables */
|
||||
int runMode;
|
||||
char *helpClass;
|
||||
Display *appDisplay;
|
||||
char *startCommand;
|
||||
|
||||
|
||||
|
||||
#endif /* _Main_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
|
||||
|
||||
|
||||
376
cde/programs/dthelp/dthelpview/ManPage.c
Normal file
376
cde/programs/dthelp/dthelpview/ManPage.c
Normal file
@@ -0,0 +1,376 @@
|
||||
/* $XConsortium: ManPage.c /main/5 1996/09/30 11:28:22 cde-hp $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: ManPage.c
|
||||
**
|
||||
** Project: Cache Creek
|
||||
**
|
||||
** Description: Contains the code for generating the man page dialog
|
||||
** used in the helpview program.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/* System Include Files */
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/Shell.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#include <Xm/Protocols.h>
|
||||
#include <Xm/MwmUtil.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/XmP.h>
|
||||
#include <Xm/TextF.h>
|
||||
#include <Xm/Text.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/DialogS.h>
|
||||
|
||||
#include <Dt/Help.h>
|
||||
#include <Dt/HelpDialog.h>
|
||||
|
||||
#include <DtI/HelposI.h>
|
||||
#include <DtI/HourGlassI.h>
|
||||
/* Local Includes */
|
||||
#include "Main.h"
|
||||
#include "UtilI.h"
|
||||
#include "ManPageI.h"
|
||||
|
||||
/******** Static Function Declarations ********/
|
||||
|
||||
|
||||
static void ManTextUpdateCB(
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data);
|
||||
static void ManDisplayCB(
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XtPointer callback);
|
||||
static void CatchClose(
|
||||
Widget widget);
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: CatchClose( Widget w);
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Catches the window manager close requests and assigns our
|
||||
* CloseHelpCB to handel them.
|
||||
*
|
||||
***************************************************************************/
|
||||
static void CatchClose (
|
||||
Widget widget)
|
||||
{
|
||||
|
||||
Atom wm_delete_window;
|
||||
Arg args[2];
|
||||
|
||||
/* Grab the window mgr close */
|
||||
wm_delete_window = XmInternAtom(XtDisplay(XtParent(widget)),
|
||||
"WM_DELETE_WINDOW", FALSE);
|
||||
XtSetArg(args[0], XmNdeleteResponse, XmDO_NOTHING);
|
||||
|
||||
/* Current Help Dialog Window */
|
||||
XmAddWMProtocolCallback(XtParent(widget),wm_delete_window,
|
||||
(XtCallbackProc)CloseAndExitCB, (XtPointer)widget);
|
||||
XtSetValues(XtParent(widget), args, 1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: static void PostManDialog();
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Creates and manages a simple prompt dialog that allows a
|
||||
* user to type in and display any manpage on the system.
|
||||
*
|
||||
****************************************************************************/
|
||||
void PostManDialog(
|
||||
Widget parent,
|
||||
int argc,
|
||||
char **argv)
|
||||
|
||||
{
|
||||
|
||||
Widget separator;
|
||||
Widget manLabel;
|
||||
XmString labelStr;
|
||||
Arg args[20];
|
||||
int n;
|
||||
char * title;
|
||||
Pixel foreground;
|
||||
Pixel background;
|
||||
|
||||
Colormap colormap;
|
||||
Pixel selectColor;
|
||||
Pixel topShadowColor;
|
||||
Pixel bottomShadowColor;
|
||||
Pixel foregroundColor;
|
||||
|
||||
|
||||
/* Create the shell and form used for the dialog. */
|
||||
|
||||
title = XtNewString(((char *)_DTGETMESSAGE(7, 11, "Man Page")));
|
||||
n = 0;
|
||||
XtSetArg (args[n], XmNtitle, title); n++;
|
||||
XtSetArg (args[n], XmNallowShellResize, False); n++;
|
||||
manWidget = XmCreateDialogShell(parent, "manWidget", args, n);
|
||||
XtFree(title);
|
||||
|
||||
/* Set the useAsyncGeo on the shell */
|
||||
n = 0;
|
||||
XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
|
||||
XtSetValues (XtParent(manWidget), args, n);
|
||||
|
||||
n = 0;
|
||||
XtSetArg (args[n], XmNmarginWidth, 1); n++;
|
||||
XtSetArg (args[n], XmNmarginHeight, 1); n++;
|
||||
XtSetArg (args[n], XmNshadowThickness, 1); n++;
|
||||
XtSetArg (args[n], XmNshadowType, XmSHADOW_OUT); n++;
|
||||
XtSetArg (args[n], XmNautoUnmanage, False); n++;
|
||||
manForm = XmCreateForm (manWidget, "manForm", args, n);
|
||||
|
||||
/* Get the select color and margin widths and heights */
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNforeground, &foreground); ++n;
|
||||
XtSetArg(args[n], XmNbackground, &background); ++n;
|
||||
XtSetArg (args[n], XmNcolormap, &colormap); ++n;
|
||||
XtGetValues(manForm, args, n);
|
||||
|
||||
XmGetColors (XtScreen (manForm), colormap, background,
|
||||
&foregroundColor, &topShadowColor,
|
||||
&bottomShadowColor, &selectColor);
|
||||
|
||||
labelStr = XmStringCreateLocalized((char *)_DTGETMESSAGE(7, 12,"Man Page:"));
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); ++n;
|
||||
XtSetArg(args[n], XmNleftOffset,5); ++n;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); ++n;
|
||||
XtSetArg(args[n], XmNtopOffset, 15); ++n;
|
||||
XtSetArg(args[n], XmNlabelType, XmSTRING); ++n;
|
||||
XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING); ++n;
|
||||
XtSetArg(args[n], XmNtraversalOn, False); ++n;
|
||||
XtSetArg(args[n], XmNlabelString, labelStr); ++n;
|
||||
manLabel = XmCreateLabelGadget(manForm, "manLabel", args, n);
|
||||
XtManageChild (manLabel);
|
||||
XmStringFree(labelStr);
|
||||
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET); ++n;
|
||||
XtSetArg(args[n], XmNleftWidget, manLabel); ++n;
|
||||
XtSetArg(args[n], XmNleftOffset, 5); ++n;
|
||||
XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); ++n;
|
||||
XtSetArg(args[n], XmNtopOffset, 10); ++n;
|
||||
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); ++n;
|
||||
XtSetArg(args[n], XmNrightOffset, 5); ++n;
|
||||
XtSetArg(args[n], XmNeditable, True); ++n;
|
||||
XtSetArg(args[n], XmNeditMode, XmSINGLE_LINE_EDIT); ++n;
|
||||
XtSetArg(args[n], XmNbackground, selectColor); ++n;
|
||||
manText = XmCreateTextField(manForm, "man_text", args, n);
|
||||
XtManageChild (manText);
|
||||
XtAddCallback(manText, XmNvalueChangedCallback,
|
||||
ManTextUpdateCB,(XtPointer) NULL);
|
||||
|
||||
/* Create a separator between the buttons */
|
||||
n = 0;
|
||||
XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg (args[n], XmNtopWidget,manLabel);n++;
|
||||
XtSetArg (args[n], XmNtopOffset, 20); n++;
|
||||
separator = XmCreateSeparatorGadget (manForm, "separator", args, n);
|
||||
XtManageChild (separator);
|
||||
|
||||
/* Create the action buttons along the bottom */
|
||||
labelStr = XmStringCreateLocalized ((char *)_DTGETMESSAGE(7, 13,
|
||||
"Show Man Page"));
|
||||
n = 0;
|
||||
XtSetArg (args[n], XmNlabelString, labelStr); n++;
|
||||
XtSetArg (args[n], XmNleftAttachment, XmATTACH_POSITION); n++;
|
||||
XtSetArg (args[n], XmNleftPosition, 1); n++;
|
||||
XtSetArg (args[n], XmNrightAttachment, XmATTACH_POSITION); n++;
|
||||
XtSetArg (args[n], XmNrightPosition, 49); n++;
|
||||
XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg (args[n], XmNtopWidget, separator); n++;
|
||||
XtSetArg (args[n], XmNtopOffset, 5); n++;
|
||||
XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
|
||||
XtSetArg (args[n], XmNbottomOffset, 5); n++;
|
||||
XtSetArg (args[n], XmNmarginHeight, 4); n++;
|
||||
manBtn = XmCreatePushButtonGadget(manForm, "manBtn", args, n);
|
||||
XtManageChild (manBtn);
|
||||
XmStringFree(labelStr);
|
||||
XtSetSensitive(manBtn, False);
|
||||
|
||||
XtAddCallback(manBtn, XmNactivateCallback, ManDisplayCB,
|
||||
(XtPointer) manForm);
|
||||
|
||||
|
||||
/* Build the Close button */
|
||||
labelStr = XmStringCreateLocalized((char *)_DTGETMESSAGE(7, 16,"Exit"));
|
||||
|
||||
n = 0;
|
||||
XtSetArg (args[n], XmNlabelString, labelStr); n++;
|
||||
XtSetArg (args[n], XmNleftAttachment, XmATTACH_POSITION); n++;
|
||||
XtSetArg (args[n], XmNleftPosition, 51); n++;
|
||||
XtSetArg (args[n], XmNrightAttachment, XmATTACH_POSITION); n++;
|
||||
XtSetArg (args[n], XmNrightPosition, 99); n++;
|
||||
XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++;
|
||||
XtSetArg (args[n], XmNtopWidget, separator); n++;
|
||||
XtSetArg (args[n], XmNtopOffset, 5); n++;
|
||||
XtSetArg (args[n], XmNmarginHeight, 4); n++;
|
||||
closeBtn = XmCreatePushButtonGadget (manForm, "closeBtn", args, n);
|
||||
XtManageChild (closeBtn);
|
||||
|
||||
XtAddCallback(closeBtn, XmNactivateCallback, CloseAndExitCB,
|
||||
(XtPointer) NULL);
|
||||
|
||||
XmStringFree (labelStr);
|
||||
|
||||
XtSetArg (args[0], XmNdefaultButton, closeBtn);
|
||||
XtSetValues (manForm, args, 1);
|
||||
|
||||
/** force tabs to go to each widget and in right order **/
|
||||
XtSetArg (args[0], XmNnavigationType, XmSTICKY_TAB_GROUP);
|
||||
XtSetValues (manText,args,1);
|
||||
XtSetValues (manBtn,args,1);
|
||||
XtSetValues (closeBtn,args,1);
|
||||
|
||||
/** put focus on the text field **/
|
||||
XtSetArg (args[0], XmNinitialFocus, manText);
|
||||
XtSetValues (manForm,args,1);
|
||||
|
||||
|
||||
/* Adjust the decorations for the dialog shell of the dialog */
|
||||
n = 0;
|
||||
XtSetArg(args[n], XmNmwmFunctions,
|
||||
MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE |
|
||||
MWM_FUNC_CLOSE); n++;
|
||||
XtSetArg (args[n], XmNmwmDecorations,
|
||||
MWM_DECOR_BORDER | MWM_DECOR_TITLE | MWM_DECOR_MENU |
|
||||
MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE); n++;
|
||||
XtSetValues (manWidget, args, n);
|
||||
|
||||
|
||||
XtManageChild(manForm);
|
||||
|
||||
/* Add the CatchClose here so we catch the window manager close requests */
|
||||
CatchClose(manForm);
|
||||
|
||||
/* Set the wm_command property on the help dialog window */
|
||||
if (argc != 0)
|
||||
XSetCommand(XtDisplay(manWidget), XtWindow(manWidget), argv, argc);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Function: ManTextUpdateCB
|
||||
*
|
||||
* ManText is called when the string in the man text Widget changes. We
|
||||
* activate or deactivate the display man page PushButton.
|
||||
*
|
||||
* Called by:
|
||||
**************************************************************************/
|
||||
|
||||
static void ManTextUpdateCB(
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
char *textString;
|
||||
Arg args[2];
|
||||
|
||||
/* Get the text string to check its length, then set the search buttons' */
|
||||
/* sensitivity appropriately. */
|
||||
|
||||
textString = XmTextFieldGetString(widget);
|
||||
if (strlen(textString) == 0)
|
||||
{
|
||||
XtSetSensitive(manBtn, False);
|
||||
XtSetArg (args[0], XmNdefaultButton, closeBtn);
|
||||
XtSetValues (manForm, args, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
XtSetSensitive(manBtn, True);
|
||||
XtSetArg (args[0], XmNdefaultButton, manBtn);
|
||||
XtSetValues (manForm, args, 1);
|
||||
|
||||
}
|
||||
XtFree(textString);
|
||||
|
||||
} /* End ManTextCB */
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* Function: ManDisplayCB
|
||||
*
|
||||
* ManDisplayCB is called when the user hits Return in the man text
|
||||
* Widget or clicks the display man PushButton.
|
||||
*******************************************************************/
|
||||
static void ManDisplayCB(
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
|
||||
char *manPageStr;
|
||||
|
||||
_DtHelpTurnOnHourGlass((Widget) client_data);
|
||||
manPageStr = XmTextFieldGetString(manText);
|
||||
|
||||
DisplayMan(topLevel, manPageStr, NO_EXIT_ON_CLOSE);
|
||||
|
||||
_DtHelpTurnOffHourGlass((Widget) client_data);
|
||||
XtFree(manPageStr);
|
||||
|
||||
} /* End ManDisplayCB */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
53
cde/programs/dthelp/dthelpview/ManPageI.h
Normal file
53
cde/programs/dthelp/dthelpview/ManPageI.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* $XConsortium: ManPageI.h /main/4 1995/11/08 09:22:48 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: ManPageI.h
|
||||
**
|
||||
** Project: helpviewer 3.0
|
||||
**
|
||||
** Description: Structures and defines supported in ManPage.c
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
#ifndef _ManPageI_h
|
||||
#define _ManPageI_h
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: static void PostManDialog();
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Creates and manages a simple prompt dialog that allows a
|
||||
* user to type in and display any manpage on the system.
|
||||
*
|
||||
****************************************************************************/
|
||||
void PostManDialog(
|
||||
Widget parent,
|
||||
int argc,
|
||||
char **argv);
|
||||
|
||||
|
||||
|
||||
#endif /* _ManPageI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
630
cde/programs/dthelp/dthelpview/Util.c
Normal file
630
cde/programs/dthelp/dthelpview/Util.c
Normal file
@@ -0,0 +1,630 @@
|
||||
/* $XConsortium: Util.c /main/5 1996/09/30 11:29:05 cde-hp $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: Util.c
|
||||
**
|
||||
** Project: Cache Creek
|
||||
**
|
||||
** Description: Contains the Help Callback and Utility functions for or
|
||||
** preview tool and DT 3.0 help browser tool.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/* System Include Files */
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/Shell.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#include <Xm/MwmUtil.h>
|
||||
#include <Xm/Protocols.h>
|
||||
#include <Xm/Xm.h>
|
||||
#include <Xm/XmP.h>
|
||||
#include <Xm/Text.h>
|
||||
|
||||
#include <Dt/Help.h>
|
||||
#include <DtI/HelpP.h>
|
||||
#include <Dt/HelpDialog.h>
|
||||
#include <Dt/HelpQuickD.h>
|
||||
|
||||
|
||||
#include <DtI/HelposI.h>
|
||||
/* Local Includes */
|
||||
#include "Main.h"
|
||||
#include "UtilI.h"
|
||||
|
||||
|
||||
/******** Static Function Declarations ********/
|
||||
|
||||
|
||||
|
||||
static void CloseQuickHelpCB(
|
||||
Widget w,
|
||||
XtPointer clientData,
|
||||
XtPointer callData);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: CloseAndExitCB(
|
||||
* Widget w,
|
||||
* XtPointer clientData,
|
||||
* XtPointer callData
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Closes the helpview process when the users
|
||||
* closes either a man page view or a ascii
|
||||
* text file view.
|
||||
*
|
||||
***************************************************************************/
|
||||
void CloseAndExitCB(
|
||||
Widget w,
|
||||
XtPointer clientData,
|
||||
XtPointer callData)
|
||||
{
|
||||
|
||||
/* We just want to go away here */
|
||||
exit (0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: CloseQuickHelpCB(
|
||||
* Widget w,
|
||||
* XtPointer clientData,
|
||||
* XtPointer callData
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Closes the Quick Help dialog without exiting.
|
||||
*
|
||||
***************************************************************************/
|
||||
static void CloseQuickHelpCB(
|
||||
Widget w,
|
||||
XtPointer clientData,
|
||||
XtPointer callData)
|
||||
{
|
||||
|
||||
/* We just unmanage the dialog */
|
||||
XtUnmanageChild(viewWidget);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: CloseHelpCB(
|
||||
* Widget w,
|
||||
* XtPointer clientData,
|
||||
* XtPointer callData
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Process close requests on all Help Dialog widgets
|
||||
* created and managed by this application.
|
||||
*
|
||||
***************************************************************************/
|
||||
void CloseHelpCB (
|
||||
Widget w,
|
||||
XtPointer clientData,
|
||||
XtPointer callData)
|
||||
{
|
||||
|
||||
Widget helpDialog = (Widget) clientData;
|
||||
|
||||
CacheListStruct *pTemp;
|
||||
CacheListStruct *pTempCurrent;
|
||||
|
||||
pTemp = pCacheListHead;
|
||||
|
||||
/* Search our Cache List for the closed help dialog */
|
||||
while ((pTemp->helpDialog != helpDialog) && (pTemp != NULL))
|
||||
pTemp = pTemp->pNext;
|
||||
|
||||
|
||||
if (pTemp == NULL)
|
||||
/* ERROR */
|
||||
printf("We did not find our help dialog widget in the cache list??? /n");
|
||||
|
||||
/* Un Map and Clean up the help widget */
|
||||
XtUnmanageChild(helpDialog);
|
||||
pTemp->inUseFlag = FALSE;
|
||||
|
||||
|
||||
/* Re-Assign our pTemp to point to our head so we can see
|
||||
* if we have any in-use help dialog in our list.
|
||||
*/
|
||||
pTemp = pCacheListHead;
|
||||
|
||||
/* Check and see if we should exit */
|
||||
while (pTemp != NULL && (pTemp->inUseFlag != TRUE))
|
||||
pTemp = pTemp->pNext;
|
||||
|
||||
if (pTemp == NULL) /* We have no dialog mapped so exit */
|
||||
{
|
||||
/* Lets clean up our cache list just for fun, prior to exiting */
|
||||
pTemp = pCacheListHead;
|
||||
while (pTemp != NULL)
|
||||
{
|
||||
pTempCurrent = pTemp;
|
||||
pTemp = pTemp->pNext;
|
||||
XtDestroyWidget(pTempCurrent->helpDialog);
|
||||
}
|
||||
|
||||
exit (0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: void ProcessLinkCB(
|
||||
* Widget w,
|
||||
* XtPointer clientData,
|
||||
* XtPointer callData
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Process JUMP-NEW and APP-LINK hypertext requests in a
|
||||
* given Help Dialog Window.
|
||||
*
|
||||
* This is the callback used for the DtNhyperLinkCallback
|
||||
* on each of the help dialog widges created.
|
||||
*
|
||||
****************************************************************************/
|
||||
void ProcessLinkCB (
|
||||
Widget w,
|
||||
XtPointer clientData,
|
||||
XtPointer callData)
|
||||
|
||||
{
|
||||
|
||||
DtHelpDialogCallbackStruct * hyperData =
|
||||
(DtHelpDialogCallbackStruct *) callData;
|
||||
|
||||
|
||||
switch (hyperData->hyperType)
|
||||
{
|
||||
case DtHELP_LINK_JUMP_NEW:
|
||||
|
||||
DisplayTopic (topLevel, hyperData->helpVolume,
|
||||
hyperData->locationId, 0, NULL);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case DtHELP_LINK_MAN_PAGE:
|
||||
/* Add support for man links */
|
||||
DisplayMan(topLevel, hyperData->specification, NO_EXIT_ON_CLOSE);
|
||||
|
||||
break;
|
||||
|
||||
case DtHELP_LINK_APP_DEFINE:
|
||||
/* Send out the proper warning (e.g. message 14) */
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
/* ERROR */
|
||||
/* Send out warning (e.g. message 15) */
|
||||
break;
|
||||
|
||||
|
||||
} /* End Switch Statement */
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: void DisplayTopic(
|
||||
* Widget parent,
|
||||
* char *helpVolume,
|
||||
* char *locationId)
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Displays a new Cache Creek help topic in a new/cached
|
||||
* help dialog widget.
|
||||
*
|
||||
****************************************************************************/
|
||||
void DisplayTopic (
|
||||
Widget parent,
|
||||
char *helpVolume,
|
||||
char *locationId,
|
||||
int argc,
|
||||
char **argv)
|
||||
|
||||
{
|
||||
Arg args[15];
|
||||
int n;
|
||||
CacheListStruct *pCurrentNode = NULL;
|
||||
Boolean cachedNode = FALSE;
|
||||
char *titleString;
|
||||
|
||||
/* If we have a null location id within helpview we want to force
|
||||
* it to the default: _HOMETOPIC.
|
||||
*/
|
||||
if (locationId == NULL)
|
||||
locationId = XtNewString("_HOMETOPIC");
|
||||
|
||||
/* Get a used or new node form our cache if we have one */
|
||||
cachedNode = GetFromCache(parent, &pCurrentNode);
|
||||
|
||||
|
||||
titleString = XtNewString((char*)_DTGETMESSAGE (7,20,"Help Viewer"));
|
||||
|
||||
/* If we got a free one from the Cache, use it */
|
||||
/* Set Values on current free one, then map it */
|
||||
if (cachedNode)
|
||||
{
|
||||
|
||||
n = 0;
|
||||
XtSetArg (args[n], XmNtitle, titleString); n++;
|
||||
if (helpVolume != NULL)
|
||||
{
|
||||
XtSetArg (args[n],DtNhelpVolume,helpVolume); n++;
|
||||
}
|
||||
XtSetArg (args[n], DtNlocationId,locationId); n++;
|
||||
XtSetArg (args[n], DtNhelpType, DtHELP_TYPE_TOPIC); n++;
|
||||
|
||||
XtSetValues(pCurrentNode->helpDialog, args, n);
|
||||
|
||||
XtManageChild(pCurrentNode->helpDialog);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Build a new one in our cached list */
|
||||
n = 0;
|
||||
XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
|
||||
XtSetArg (args[n], XmNtitle, titleString); n++;
|
||||
XtSetArg (args[n], DtNshowTopLevelButton, TRUE); n++;
|
||||
XtSetArg (args[n], DtNshowNewWindowButton, TRUE); n++;
|
||||
if (helpVolume != NULL)
|
||||
{
|
||||
XtSetArg (args[n],DtNhelpVolume,helpVolume); n++;
|
||||
}
|
||||
XtSetArg (args[n], DtNlocationId,locationId); n++;
|
||||
pCurrentNode->helpDialog =
|
||||
DtCreateHelpDialog(parent, "helpWidget", args, n);
|
||||
|
||||
|
||||
XtAddCallback(pCurrentNode->helpDialog, DtNhyperLinkCallback,
|
||||
ProcessLinkCB, NULL);
|
||||
|
||||
XtAddCallback(pCurrentNode->helpDialog, DtNcloseCallback,
|
||||
CloseHelpCB,(XtPointer) pCurrentNode->helpDialog);
|
||||
|
||||
XtManageChild(pCurrentNode->helpDialog);
|
||||
|
||||
/* Set the wm_command property on the help dialog window */
|
||||
if (argc != 0)
|
||||
XSetCommand(appDisplay,
|
||||
XtWindow(XtParent(pCurrentNode->helpDialog)), argv, argc);
|
||||
|
||||
}
|
||||
|
||||
XtFree(titleString);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: CacheListStruct GetFromCache(
|
||||
* Widget parent);
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Gets a free help node form our cache list. If none are
|
||||
* free, it will return fallse and the calling routine will
|
||||
* create a new help dialog widget.
|
||||
*
|
||||
****************************************************************************/
|
||||
Boolean GetFromCache(
|
||||
Widget parent,
|
||||
CacheListStruct **pCurrentNode)
|
||||
|
||||
{
|
||||
|
||||
CacheListStruct *pTemp;
|
||||
|
||||
if (pCacheListHead == NULL)
|
||||
{
|
||||
/* We have a new list so lets create one and pass it back */
|
||||
pCacheListHead =
|
||||
(CacheListStruct *) XtMalloc((sizeof(CacheListStruct)));
|
||||
|
||||
/* Assign the default values to our node */
|
||||
pCacheListHead->helpDialog = NULL;
|
||||
pCacheListHead->inUseFlag = TRUE;
|
||||
pCacheListHead->pNext = NULL;
|
||||
pCacheListHead->pPrevious = NULL;
|
||||
|
||||
/* Assign our tale pointer */
|
||||
pCacheListTale = pCacheListHead;
|
||||
|
||||
/* Make sure or totalNodes counter is correct, e.g. force it to 1 */
|
||||
totalCacheNodes = 1;
|
||||
|
||||
/* Return our head pointer because it's our first and only node */
|
||||
*pCurrentNode = pCacheListHead;
|
||||
return (FALSE);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We have some nodes so search for a free one first */
|
||||
pTemp = pCacheListHead;
|
||||
|
||||
while (pTemp != NULL)
|
||||
{
|
||||
if (pTemp->inUseFlag == FALSE)
|
||||
{
|
||||
pTemp->inUseFlag = TRUE;
|
||||
*pCurrentNode = pTemp;
|
||||
return (TRUE);
|
||||
}
|
||||
else
|
||||
pTemp = pTemp->pNext;
|
||||
}
|
||||
|
||||
|
||||
/* If we did not find a free nod then we must add a new one to the
|
||||
* top of the list, and return it.
|
||||
*/
|
||||
|
||||
pTemp = (CacheListStruct *) XtMalloc((sizeof(CacheListStruct)));
|
||||
|
||||
/* Assign the default values to our node */
|
||||
pTemp->helpDialog = NULL;
|
||||
pTemp->inUseFlag = TRUE;
|
||||
|
||||
pTemp->pNext = pCacheListHead;
|
||||
pTemp->pPrevious = NULL;
|
||||
|
||||
pCacheListHead->pPrevious = pTemp;
|
||||
|
||||
/* Re-Assign our head pointer to point to the new head of the list */
|
||||
pCacheListHead = pTemp;
|
||||
|
||||
/* Make sure or totalNodes counter is correct, e.g. force it to 1 */
|
||||
totalCacheNodes = totalCacheNodes + 1;
|
||||
|
||||
/* Return our head pointer because it's our new node */
|
||||
*pCurrentNode = pCacheListHead;
|
||||
return (FALSE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: void DisplayFile(
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Displays a ascii file in a quick help dialog.
|
||||
*
|
||||
****************************************************************************/
|
||||
void DisplayFile (
|
||||
Widget parent,
|
||||
char *file)
|
||||
|
||||
{
|
||||
|
||||
Arg args[20];
|
||||
int n;
|
||||
Widget helpWidget;
|
||||
Widget backWidget;
|
||||
char *title;
|
||||
XmString printString;
|
||||
XmString exitString;
|
||||
|
||||
|
||||
/* Create the QuickHelpDialog widget for help on help */
|
||||
title = XtNewString(file);
|
||||
printString = XmStringCreateLocalized((char *)_DTGETMESSAGE(7,19,"Print ..."));
|
||||
exitString = XmStringCreateLocalized((char *)_DTGETMESSAGE(7, 16, "Exit"));
|
||||
|
||||
n =0;
|
||||
XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
|
||||
XtSetArg (args[n], XmNtitle, title); n++;
|
||||
XtSetArg (args[n], DtNprintLabelString, printString); n++;
|
||||
XtSetArg (args[n], XmNokLabelString, exitString); n++;
|
||||
XtSetArg (args[n], DtNhelpType,DtHELP_TYPE_FILE); n++;
|
||||
XtSetArg (args[n], DtNhelpFile, file); n++;
|
||||
XtSetArg (args[n], XmNscrollBarPlacement,
|
||||
DtHELP_AS_NEEDED_SCROLLBARS); n++;
|
||||
viewWidget = DtCreateHelpQuickDialog(parent,"fileBox", args, n);
|
||||
XmStringFree(printString);
|
||||
XmStringFree(exitString);
|
||||
XtFree((char*) title);
|
||||
|
||||
/* Catch the close callback so we can destroy the widget */
|
||||
XtAddCallback(viewWidget, DtNcloseCallback,
|
||||
CloseAndExitCB, (XtPointer) NULL);
|
||||
|
||||
/* We do not want a help button for now so we unmap it */
|
||||
helpWidget = DtHelpQuickDialogGetChild (viewWidget,DtHELP_QUICK_HELP_BUTTON);
|
||||
XtUnmanageChild (helpWidget);
|
||||
|
||||
/* We do not want a backtrack button for now so we unmap it */
|
||||
backWidget = DtHelpQuickDialogGetChild (viewWidget,DtHELP_QUICK_BACK_BUTTON);
|
||||
XtUnmanageChild (backWidget);
|
||||
|
||||
/* Display the dialog */
|
||||
XtManageChild(viewWidget);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: void DisplayMan()
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Displays a UNIX man page in a quick help dialog.
|
||||
*
|
||||
****************************************************************************/
|
||||
void DisplayMan (
|
||||
Widget parent,
|
||||
char *man,
|
||||
int closeOption)
|
||||
|
||||
{
|
||||
|
||||
Arg args[20];
|
||||
int n;
|
||||
Widget helpWidget;
|
||||
char *title;
|
||||
XmString printString;
|
||||
XmString exitString;
|
||||
XmString backString;
|
||||
|
||||
XmUpdateDisplay(topLevel);
|
||||
|
||||
|
||||
if (viewWidget == NULL)
|
||||
{
|
||||
/* Create the QuickHelpDialog widget for help on help */
|
||||
title = XtNewString(man);
|
||||
printString = XmStringCreateLocalized((char *)_DTGETMESSAGE(
|
||||
7, 19, "Print ..."));
|
||||
|
||||
backString = XmStringCreateLocalized((char *)_DTGETMESSAGE(
|
||||
7, 18, "Backtrack"));
|
||||
|
||||
if (closeOption == EXIT_ON_CLOSE)
|
||||
{
|
||||
exitString = XmStringCreateLocalized((char *)_DTGETMESSAGE(
|
||||
7, 16, "Exit"));
|
||||
}
|
||||
else
|
||||
{
|
||||
exitString = XmStringCreateLocalized((char *)_DTGETMESSAGE(
|
||||
7, 17, "Close"));
|
||||
}
|
||||
|
||||
n =0;
|
||||
XtSetArg (args[n], XmNuseAsyncGeometry, True); n++;
|
||||
XtSetArg (args[n], XmNtitle, title); n++;
|
||||
XtSetArg (args[n], DtNbackLabelString, backString); n++;
|
||||
XtSetArg (args[n], DtNprintLabelString, printString); n++;
|
||||
XtSetArg (args[n], XmNokLabelString, exitString); n++;
|
||||
XtSetArg (args[n], DtNhelpType,DtHELP_TYPE_MAN_PAGE); n++;
|
||||
XtSetArg (args[n], DtNmanPage, man); n++;
|
||||
XtSetArg (args[n], XmNscrollBarPlacement,
|
||||
DtHELP_AS_NEEDED_SCROLLBARS); n++;
|
||||
viewWidget = DtCreateHelpQuickDialog(parent,"manBox", args, n);
|
||||
XmStringFree(printString);
|
||||
XmStringFree(exitString);
|
||||
XmStringFree(backString);
|
||||
XtFree((char*) title);
|
||||
|
||||
if (closeOption == EXIT_ON_CLOSE)
|
||||
{
|
||||
XtAddCallback(viewWidget, DtNcloseCallback,
|
||||
CloseAndExitCB, (XtPointer) NULL);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
XtAddCallback(viewWidget, DtNcloseCallback,
|
||||
CloseQuickHelpCB, (XtPointer) NULL);
|
||||
}
|
||||
|
||||
/* We do not want a help button for now so we unmap it */
|
||||
helpWidget = DtHelpQuickDialogGetChild (viewWidget,DtHELP_QUICK_HELP_BUTTON);
|
||||
XtUnmanageChild (helpWidget);
|
||||
|
||||
XtManageChild(viewWidget);
|
||||
}
|
||||
else
|
||||
{
|
||||
_DtHelpTurnOnHourGlass(viewWidget);
|
||||
|
||||
/* We already have a quick help dialog so re-use it */
|
||||
n = 0;
|
||||
XtSetArg (args[n], DtNhelpType,DtHELP_TYPE_MAN_PAGE); n++;
|
||||
XtSetArg (args[n], DtNmanPage, man); n++;
|
||||
|
||||
XtSetValues(viewWidget, args, n);
|
||||
|
||||
|
||||
title = XtNewString(man);
|
||||
n = 0;
|
||||
XtSetArg (args[n], XmNtitle, title); n++;
|
||||
XtSetValues(XtParent(viewWidget), args, n);
|
||||
XtFree((char*) title);
|
||||
|
||||
XtManageChild(viewWidget);
|
||||
XtMapWidget(XtParent(viewWidget));
|
||||
XRaiseWindow(appDisplay, XtWindow(XtParent(viewWidget)));
|
||||
_DtHelpTurnOffHourGlass(viewWidget);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
205
cde/programs/dthelp/dthelpview/UtilI.h
Normal file
205
cde/programs/dthelp/dthelpview/UtilI.h
Normal file
@@ -0,0 +1,205 @@
|
||||
/* $XConsortium: UtilI.h /main/4 1995/11/08 09:23:08 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Util.h
|
||||
**
|
||||
** Project: helpviewer 3.0
|
||||
**
|
||||
** Description: Structures and defines needed HelpUtil.h in our Preview
|
||||
** tool (aka, helpviewer).
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
#ifndef _UtilI_h
|
||||
#define _UtilI_h
|
||||
|
||||
|
||||
|
||||
#define DEFAULT_ROWS 20
|
||||
#define DEFAULT_COLUMNS 20
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Cache List Info Structure Definition.
|
||||
*
|
||||
****************************************************************/
|
||||
typedef struct _CacheListStruct {
|
||||
Widget helpDialog;
|
||||
Boolean inUseFlag;
|
||||
struct _CacheListStruct *pNext;
|
||||
struct _CacheListStruct *pPrevious;
|
||||
} CacheListStruct;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: void DisplayTopic(
|
||||
* Widget parent,
|
||||
* char *accessPath,
|
||||
* char *idString)
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Displays a new Cache Creek help topic in a new help dialog
|
||||
* widget.
|
||||
*
|
||||
****************************************************************************/
|
||||
extern void DisplayTopic (
|
||||
Widget parent,
|
||||
char *accessPath,
|
||||
char *idString,
|
||||
int argc,
|
||||
char **argv);
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: void DisplayFile(
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Displays a ascii file in a quick help dialog.
|
||||
*
|
||||
****************************************************************************/
|
||||
extern void DisplayFile (
|
||||
Widget parent,
|
||||
char *file);
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: void DisplayMan();
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Displays a UNIX man page in a quick help dialog.
|
||||
*
|
||||
****************************************************************************/
|
||||
extern void DisplayMan (
|
||||
Widget parent,
|
||||
char *man,
|
||||
int closeOption);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: CloseAndExitCB(
|
||||
* Widget w,
|
||||
* XtPointer clientData,
|
||||
* XtPointer callData
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Closes the helpview process when the users
|
||||
* closes either a man page view or a ascii
|
||||
* text file view.
|
||||
*
|
||||
***************************************************************************/
|
||||
extern void CloseAndExitCB(
|
||||
Widget w,
|
||||
XtPointer clientData,
|
||||
XtPointer callData);
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: CloseHelpCB(
|
||||
* Widget w,
|
||||
* XtPointer clientData,
|
||||
* XtPointer callData
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Process close requests on all Help Dialog widgets
|
||||
* created and managed by this application.
|
||||
*
|
||||
***************************************************************************/
|
||||
extern void CloseHelpCB (
|
||||
Widget w,
|
||||
XtPointer clientData,
|
||||
XtPointer callData);
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: void ProcessLinkCB(
|
||||
* Widget w,
|
||||
* XtPointer clientData,
|
||||
* XtPointer callData
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Process JUMP-NEW and APP-LINK hypertext requests in a
|
||||
* given Help Dialog Window.
|
||||
*
|
||||
* This is the callback used for the DtNhyperLinkCallback
|
||||
* on each of the help dialog widges created.
|
||||
*
|
||||
****************************************************************************/
|
||||
extern void ProcessLinkCB (
|
||||
Widget w,
|
||||
XtPointer clientData,
|
||||
XtPointer callData);
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: CacheListStruct GetFromCache(
|
||||
* Widget parent);
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Gets a free help node form our cache list. If none are
|
||||
* free, it will return fallse and the calling routine will
|
||||
* create a new help dialog widget.
|
||||
*
|
||||
****************************************************************************/
|
||||
Boolean GetFromCache(
|
||||
Widget parent,
|
||||
CacheListStruct **pCurrentNode);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* _UtilI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
59
cde/programs/dthelp/dthelpview/helpview.1x
Normal file
59
cde/programs/dthelp/dthelpview/helpview.1x
Normal file
@@ -0,0 +1,59 @@
|
||||
.\" $XConsortium: helpview.1x /main/2 1995/07/17 14:55:24 drk $
|
||||
.\" **
|
||||
.\" **
|
||||
.\" ** (c) Copyright 1992, by Hewlett-Packard Company
|
||||
.\" **
|
||||
.\" **
|
||||
.TH helpview 1X
|
||||
.ds )H Hewlett-Packard Company
|
||||
.SH NAME
|
||||
\fBhelpview\fP - The HP Help viewer.
|
||||
.iX "helpview"
|
||||
.SH SYNOPSIS
|
||||
.B helpview
|
||||
[\fIoptions\fP]
|
||||
.SH DESCRIPTION
|
||||
\fBhelpview\fP is an OSF/Motif based client that is used to display on-line
|
||||
help text, ASCII files, or man pages. helpview is an integral part of the
|
||||
Hewlett-Packard Help System (HP Help). Its functionality and user interface
|
||||
is almost completely that of the help and quick help widgets. See
|
||||
\fIXvhHelpDialog.3x\fP and \fIXvhQuickHelpDialog.3x.\fP When displaying
|
||||
information, \fBhelpview\fP provides access to the HP Hellp System's printing
|
||||
capabilities. See \fIhelpprint.1X\fP.
|
||||
.SS Options
|
||||
.TP 8
|
||||
.BI \-display " display"
|
||||
This option specifies the display to use, typically of the form
|
||||
\fBhostname:display_number.screen_number\fR.
|
||||
For example, \fB-display oregon:2.0\fR specifies
|
||||
the first screen of the second display of host \fBoregon\fR.
|
||||
If no \fIscreen_number\fR is specified, the first screen (screen ``0'')
|
||||
is used. See also \fIX(1)\fP.
|
||||
.TP 8
|
||||
.BI \-helpVolume " volume file name"
|
||||
This option causes \fBhelpview\fP to display a topic of the help volume.
|
||||
.TP 8
|
||||
.BI \-locationId " id"
|
||||
This option causes \fBhelpview\fP to display the help volume topic
|
||||
referenced by location id.
|
||||
.TP 8
|
||||
.BI \-file " file name"
|
||||
This option causes \fBhelpview\fP to read and display an ASCII file.
|
||||
.TP 8
|
||||
.BI \-man
|
||||
This option causes \fBhelpview\fP to display a dialog which prompts for
|
||||
a man page name which is then read and displayed.
|
||||
.TP 8
|
||||
.BI \-manPage " man page name"
|
||||
This option causes \fBhelpview\fP to read and display a man page.
|
||||
.sp 1
|
||||
.SH COPYRIGHT
|
||||
(c) Copyright 1992 by Hewlett-Packard Company
|
||||
.br
|
||||
All rights reserved.
|
||||
.sp 1
|
||||
.SH ORIGIN
|
||||
Hewlett-Packard Company UTD-CV.
|
||||
.sp 1
|
||||
.SH SEE ALSO
|
||||
\fBhelpprint(1X), XvhHelpDialog.3X, XvhQuickHelpDialog.3X\fR.
|
||||
7
cde/programs/dthelp/dthelpview/helpview_main.c
Normal file
7
cde/programs/dthelp/dthelpview/helpview_main.c
Normal file
@@ -0,0 +1,7 @@
|
||||
/* $XConsortium: helpview_main.c /main/3 1995/11/08 09:23:17 rswiston $ */
|
||||
helpview(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
main(argc,argv);
|
||||
}
|
||||
386
cde/programs/dthelp/dthelpview/nlsMsgChk.txt
Normal file
386
cde/programs/dthelp/dthelpview/nlsMsgChk.txt
Normal file
@@ -0,0 +1,386 @@
|
||||
# $XConsortium: nlsMsgChk.txt /main/2 1996/11/11 11:29:19 drk $
|
||||
#############################################################################
|
||||
#
|
||||
# Component: helpview (e.g $(TOP)/hp/rivers/cachecreek/helpview/helpview)
|
||||
#
|
||||
############################################################################
|
||||
|
||||
# NOTE: Some of the dialogs exercise messages which are in different
|
||||
# message sets. The syntax used to specify this is:
|
||||
#
|
||||
# (set #, msg#)
|
||||
#
|
||||
|
||||
|
||||
1. Screendump file name: < 1.Z >
|
||||
|
||||
_DtMessage catalog set number: 2, and 9
|
||||
|
||||
_DtMessage number(s): (Set 2, messages 1 - 28), (Set 9, message 1)
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -helpVolume HelpOnHelp.hv
|
||||
|
||||
By selecting each of the helpveiw pulldown menus, you can see each of the
|
||||
menu labels covered in the messages. The screen dump given here just shows
|
||||
the main helpview dialog and top level menu items.
|
||||
|
||||
Set 9, message 1 is displayed in the main window under the menubar.
|
||||
|
||||
|
||||
|
||||
|
||||
2. Screendump file name: < 2.Z >
|
||||
|
||||
_DtMessage catalog set number: 2
|
||||
|
||||
_DtMessage number(s): 31
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -man
|
||||
|
||||
Type "foo" inside the 'Man Page:' text field and select the 'Show Man Page'
|
||||
button. A quick help dialog will appear displaying the proper error
|
||||
message (e.g. "Man Page could not be formatted").
|
||||
Select the Exit button to exit the Man Page viewer.
|
||||
|
||||
|
||||
|
||||
|
||||
3. Screendump file name: < 3.Z >
|
||||
|
||||
_DtMessage catalog set number: 7
|
||||
|
||||
_DtMessage number(s): 11, 12, 13, 16
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -man
|
||||
|
||||
The Man Page dialog that shows up contains all of the above messages.
|
||||
Select the Exit button to exit the Man Page viewer.
|
||||
|
||||
|
||||
|
||||
|
||||
4. Screendump file name: < 4.Z >
|
||||
|
||||
_DtMessage catalog set number: 2
|
||||
|
||||
_DtMessage number(s): 34
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -helpVolume HelpOnHelp.hv -locationId foobar
|
||||
|
||||
'foobar' is not a valid locationId for the HelpOnHelp help volume, thus the
|
||||
error message "Nonexistent location ID" is generated within the helpview
|
||||
main window. This error message is also sent to Standard Error (e.g. the
|
||||
terminal window you ran helpveiw from), however, this version of the error
|
||||
message is not localized. Only the version that goes comes from the
|
||||
(Set 2, _DtMessage 34), and is displayed in the helpviw main window is
|
||||
localized.
|
||||
|
||||
|
||||
|
||||
|
||||
5. Screendump file name: < 5.Z >
|
||||
|
||||
_DtMessage catalog set number: 2
|
||||
|
||||
_DtMessage number(s): 37
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -helpVolume foobar
|
||||
|
||||
'foobar' is not a valid helpVolume, thus the error message "Could not find
|
||||
help volume." is generated within the helpview main window.
|
||||
This error message is also sent to Standard Error (e.g. the
|
||||
terminal window you ran helpveiw from), however, this version of the error
|
||||
message is not localized. Only the version that goes comes from the
|
||||
(Set 2, _DtMessage 37), and is displayed in the helpviw main window is
|
||||
localized.
|
||||
|
||||
|
||||
|
||||
|
||||
6. Screendump file name: < 6.Z >
|
||||
|
||||
_DtMessage catalog set number: 2
|
||||
|
||||
_DtMessage number(s): 39
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview
|
||||
|
||||
Because you did not give any helpVolume resource to the helpview
|
||||
application it will generate the error message: "No help volume specified".
|
||||
|
||||
|
||||
|
||||
|
||||
7. Screendump file name: < 7.Z >
|
||||
|
||||
_DtMessage catalog set number: 3
|
||||
|
||||
_DtMessage number(s): 1, 2, 3, 4
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -helpVolume HelpOnHelp.hv
|
||||
|
||||
From the main Helpview window select the History... menu item under the
|
||||
Search menu. The History dialog contains all the messages used in set 3.
|
||||
|
||||
|
||||
|
||||
|
||||
8. Screendump file name: < 8.Z >
|
||||
|
||||
_DtMessage catalog set number: 4
|
||||
|
||||
_DtMessage number(s): 1, 2, 3, 4, 5, 6, and 7.
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -helpVolume HelpOnHelp.hv
|
||||
|
||||
From the main Helpview window select the Print... menu item under the
|
||||
File menu. The Print dialog contains all the messages used in set 4.
|
||||
|
||||
|
||||
|
||||
|
||||
9. Screendump file name: < 9.Z >
|
||||
|
||||
_DtMessage catalog set number: 5
|
||||
|
||||
_DtMessage number(s): 1, 2, 3, 4, 5, and 6.
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -helpVolume HelpOnHelp.hv
|
||||
|
||||
From the main Helpview window select the Keyword... menu item under the
|
||||
Search menu. This dialog contains messages 1 through 6.
|
||||
|
||||
|
||||
|
||||
|
||||
10. Screendump file name: < 10.Z >
|
||||
|
||||
_DtMessage catalog set number: 5 and 8
|
||||
|
||||
_DtMessage number(s): (Set 5, message 10), (Set 8, messages 2, and 5)
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -helpVolume HelpOnHelp.hv
|
||||
|
||||
From the main Helpview window select the Keyword... menu item under the
|
||||
Search menu. Type foo in the "Keyword Filter (Optional):" field and hit
|
||||
<return>. An error dialog will be posted.
|
||||
|
||||
|
||||
|
||||
|
||||
11. Screendump file name: < 11.Z >
|
||||
|
||||
_DtMessage catalog set number: 5
|
||||
|
||||
_DtMessage number(s): 9
|
||||
|
||||
Instructions:
|
||||
|
||||
As root move the file "/usr/hphelp/help/%L/onhelp/HelpOnHelp.hvk" to
|
||||
"/usr/hphelp/help/%L/onhelp/HelpOnHelp.sav".
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -helpVolume HelpOnHelp.hv
|
||||
|
||||
From the main Helpview window select the Keyword... menu item under the
|
||||
Search menu. An error dialog will be posted stating: "Keyword index not
|
||||
available!".
|
||||
|
||||
Be sure to restore the HelpOnHelp.sav file back to HelpOnHelp.hvk.
|
||||
|
||||
|
||||
|
||||
|
||||
12. Screendump file name: < 12.Z >
|
||||
|
||||
_DtMessage catalog set number: 6
|
||||
|
||||
_DtMessage number(s): 1, 2, 3, and 5.
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -helpVolume HelpOnHelp.hv
|
||||
|
||||
From the main Helpview window select the Using Help... menu item under the
|
||||
Help menu. The Help On Help dialog will be posted.
|
||||
|
||||
|
||||
|
||||
|
||||
13. Screendump file name: < 13.Z >
|
||||
|
||||
_DtMessage catalog set number: 6
|
||||
|
||||
_DtMessage number(s): 4
|
||||
|
||||
Instructions:
|
||||
|
||||
Make a copy of the /usr/hphelp/app-defaults/%L/Helpview file in your
|
||||
home directory. Comment out the following line in that file:
|
||||
"Helpview*helpOnHelpVolume: HelpOnHelp.hv".
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -helpVolume HelpOnHelp.hv
|
||||
|
||||
From the main Helpview window select the Using Help... menu item under the
|
||||
Help menu. An error dialog will be posted with the proper error message
|
||||
in it.
|
||||
|
||||
Make sure to un-comment the HelpOnHelpVolume resource in your Helpview
|
||||
app-defaults file before you continue.
|
||||
|
||||
|
||||
|
||||
|
||||
14. Screendump file name: < 14.Z >
|
||||
|
||||
_DtMessage catalog set number: 2
|
||||
|
||||
_DtMessage number(s): 32
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -file foobar
|
||||
|
||||
Note: foobar must not exist in your current working directory.
|
||||
|
||||
'foobar' is not a valid file, thus the error message "Text file data could
|
||||
not be formatted." is generated within the quick help window.
|
||||
This error message is also sent to Standard Error (e.g. the terminal
|
||||
window you ran helpveiw from), however, this version of the error
|
||||
message is not localized. Only the version that goes comes from the
|
||||
(Set 2, _DtMessage 32), and is displayed in the helpviw main window is
|
||||
localized.
|
||||
|
||||
|
||||
|
||||
|
||||
15. Screendump file name: < 15.Z >
|
||||
|
||||
_DtMessage catalog set number: 7
|
||||
|
||||
_DtMessage number(s): 7, and 16
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -manPage grep
|
||||
|
||||
Note: If you do not have the grep man page on your system just use any
|
||||
man page that you have on the current system.
|
||||
|
||||
The quick help dialog that is displayed will show the above listed messages.
|
||||
|
||||
|
||||
|
||||
|
||||
16. Screendump file name: <None>
|
||||
|
||||
_DtMessage catalog set number: 7
|
||||
|
||||
_DtMessage number(s): 1, 2, 3, 4, 5, 6, and 13.
|
||||
|
||||
Instructions:
|
||||
|
||||
From a terminal window type the following command to start
|
||||
helpview:
|
||||
|
||||
/usr/hphelp/bin/helpview -foobar
|
||||
|
||||
Because 'foobar' is not a valid command line option, the following
|
||||
Usage message is produced:
|
||||
|
||||
Usage: helpview...
|
||||
|
||||
-helpVolume <Help Volume File>
|
||||
-locationId <Cache Creek LocationId>
|
||||
-file <ASCII Text File>
|
||||
-man
|
||||
-manPage <Unix Man Page>
|
||||
|
||||
|
||||
|
||||
|
||||
17. The following messages and corresponding message sets are used only when
|
||||
specific error conditions are hit. Their is no easy way for a localizer
|
||||
to display these messages, thus, their are no screen dumps or explanations
|
||||
on how to display them.
|
||||
|
||||
The bottom line is that they need to be localized, however, they cannot be
|
||||
viewed by the localizers.
|
||||
|
||||
|
||||
|
||||
a) _DtMessage catalog set number: 2
|
||||
_DtMessage number(s): 29, 30, 33, and 38.
|
||||
|
||||
|
||||
b) _DtMessage catalog set number: 7
|
||||
_DtMessage number(s): 14, and 15.
|
||||
|
||||
|
||||
c) _DtMessage catalog set number: 8
|
||||
_DtMessage number(s): 3, and 4.
|
||||
|
||||
23
cde/programs/dthelp/dthelpview/nlsREADME.txt
Normal file
23
cde/programs/dthelp/dthelpview/nlsREADME.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
# $XConsortium: nlsREADME.txt /main/2 1996/11/11 11:29:38 drk $
|
||||
#############################################################################
|
||||
#
|
||||
# Component: helpview
|
||||
#
|
||||
# Helpview is a simple application that allows authors, developers, and
|
||||
# end users to view Cache Creek help files within the DT environment.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
_DtMessage catalog source:
|
||||
|
||||
File name: DtHelp.msg
|
||||
|
||||
Target: /usr/dt/nls/%L/DtHelp.cat
|
||||
|
||||
App-defaults file:
|
||||
|
||||
File name: Helpview
|
||||
|
||||
Target: /usr/hphelp/app-defaults/%L/Helpview
|
||||
|
||||
#
|
||||
28
cde/programs/dthelp/dthelpview/version.c
Normal file
28
cde/programs/dthelp/dthelpview/version.c
Normal file
@@ -0,0 +1,28 @@
|
||||
/********************************************************
|
||||
|
||||
Copyright (c) 1988 by the Massachusetts Institute of Technology
|
||||
|
||||
Permission to use, copy, modify, and distribute this software
|
||||
and its documentation for any purpose and without fee is hereby
|
||||
granted, provided that the above copyright notice appear in all
|
||||
copies and that both that copyright notice and this permission
|
||||
notice appear in supporting documentation, and that the names of
|
||||
Hewlett-Packard or M.I.T. not be used in advertising or publicity
|
||||
pertaining to distribution of the software without specific, written
|
||||
prior permission.
|
||||
|
||||
(c) Copyright 1993-1994,1996 Digital Equipment Corporation.
|
||||
(c) Copyright 1987-1994,1996 Hewlett-Packard Company.
|
||||
(c) Copyright 1993-1994,1996 International Business Machines Corp.
|
||||
(c) Copyright 1993-1994,1996 Sun Microsystems, Inc.
|
||||
(c) Copyright 1996 Novell, Inc.
|
||||
(c) Copyright 1996 FUJITSU LIMITED.
|
||||
(c) Copyright 1996 Hitachi.
|
||||
|
||||
********************************************************/
|
||||
|
||||
#include <include/hpversion.h>
|
||||
|
||||
#ifndef lint
|
||||
version_tag("dthelpview: $XConsortium: version.c /main/5 1996/08/30 15:38:24 drk $")
|
||||
#endif /* lint */
|
||||
Reference in New Issue
Block a user