1
/* $XConsortium: help.c,v 1.10 94/04/17 20:43:53 dave Exp $ */
4
Copyright (c) 1987, 1988 X Consortium
6
Permission is hereby granted, free of charge, to any person obtaining
7
a copy of this software and associated documentation files (the
8
"Software"), to deal in the Software without restriction, including
9
without limitation the rights to use, copy, modify, merge, publish,
10
distribute, sublicense, and/or sell copies of the Software, and to
11
permit persons to whom the Software is furnished to do so, subject to
12
the following conditions:
14
The above copyright notice and this permission notice shall be included
15
in all copies or substantial portions of the Software.
17
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
21
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
OTHER DEALINGS IN THE SOFTWARE.
25
Except as contained in this notice, the name of the X Consortium shall
26
not be used in advertising or otherwise to promote the sale, use or
27
other dealings in this Software without prior written authorization
28
from the X Consortium.
31
/* $XFree86: xc/programs/xman/help.c,v 1.3 2000/03/03 23:16:27 dawes Exp $ */
34
* xman - X window system manual page display program.
35
* Author: Chris D. Peterson, MIT Project Athena
36
* Created: January 19, 1988
41
extern Atom wm_delete_window; /* in main.c */
43
/* Function Name: MakeHelpWidget.
44
* Description: This function creates the help widget so that it will be
45
* ready to be displayed.
54
ManpageGlobals * man_globals; /* The psuedo global structure. */
56
if (help_widget != NULL) /* If we already have a help widget.
57
then do not create one. */
60
man_globals = InitPsuedoGlobals();
62
CreateManpageWidget(man_globals, HELPNAME, FALSE);
63
help_widget = man_globals->This_Manpage;
65
if (OpenHelpfile(man_globals) == FALSE) {
66
XtDestroyWidget(help_widget);
71
ChangeLabel(man_globals->label, "Xman Help");
73
XtManageChild( man_globals->manpagewidgets.manpage );
74
XtRealizeWidget( help_widget );
75
SaveGlobals( man_globals->This_Manpage, man_globals );
76
AddCursor( help_widget, resources.cursors.manpage);
79
* Set up ICCCM delete window.
81
XtOverrideTranslations
82
(man_globals->This_Manpage,
83
XtParseTranslationTable ("<Message>WM_PROTOCOLS: RemoveThisManpage()"));
84
(void) XSetWMProtocols (XtDisplay(man_globals->This_Manpage),
85
XtWindow(man_globals->This_Manpage),
86
&wm_delete_window, 1);
91
/* Function Name: OpenHelpfile
92
* Description: opens the helpfile.
93
* Arguments: man_globals - the psuedo globals structure.
94
* Returns: False if no helpfile was found.
98
OpenHelpfile(ManpageGlobals * man_globals)
100
FILE * help_file_ptr;
102
if( (help_file_ptr = fopen(resources.help_file, "r")) == NULL ) {
103
PopupWarning(man_globals,
104
"Could not open help file, NO HELP WILL BE AVALIABLE.");
108
OpenFile(man_globals, help_file_ptr);