123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- /*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
- /* $XConsortium: HelpCB.c /main/5 1996/03/25 00:51:28 pascale $ */
- /*
- ****************************************************************************
- **
- ** File: HelpCB.c
- **
- ** Project: DT 3.0
- **
- ** Description: Contains the callbacks for Help
- **
- **
- ****************************************************************************/
- /*
- * (c) Copyright 1996 Digital Equipment Corporation.
- * (c) Copyright 1990, 1996 Hewlett-Packard Company.
- * (c) Copyright 1996 International Business Machines Corp.
- * (c) Copyright 1996 Sun Microsystems, Inc.
- * (c) Copyright 1996 Novell, Inc.
- * (c) Copyright 1996 FUJITSU LIMITED.
- * (c) Copyright 1996 Hitachi.
- */
- #include <Dt/HelpDialog.h>
- #include "Main.h"
- #include "Help.h"
- void
- HelpRequestCB(
- Widget w,
- caddr_t client_data,
- caddr_t call_data )
- {
- char *helpVolume, *locationId;
- intptr_t topic;
-
- topic = (intptr_t) client_data;
- helpVolume = HELP_VOLUME;
- switch (topic)
- {
- case HELP_MAIN_WINDOW:
- locationId = HELP_MAIN_WINDOW_STR;
- break;
- case HELP_MENUBAR:
- locationId = HELP_MENUBAR_STR;
- break;
- case HELP_FILE_BUTTON:
- locationId = HELP_FILE_BUTTON_STR;
- break;
- case HELP_HELP_BUTTON:
- locationId = HELP_HELP_BUTTON_STR;
- break;
- case HELP_FILE_MENU:
- locationId = HELP_FILE_MENU_STR;
- break;
- case HELP_HELP_MENU:
- locationId = HELP_HELP_MENU_STR;
- break;
- case HELP_EXIT:
- locationId = HELP_EXIT_STR;
- break;
- case HELP_INTRODUCTION:
- locationId = HELP_INTRODUCTION_STR;
- break;
- case HELP_TASKS:
- locationId = HELP_TASKS_STR;
- break;
- case HELP_REFERENCE:
- locationId = HELP_REFERENCE_STR;
- break;
- case HELP_ITEM:
- locationId = HELP_ITEM_STR;
- break;
- case HELP_USING:
- locationId = HELP_USING_STR;
- helpVolume = HELP_USING_HELP_VOLUME;
- break;
- case HELP_VERSION:
- locationId = HELP_VERSION_STR;
- break;
- case HELP_COLOR_BUTTON:
- locationId = HELP_COLOR_BUTTON_STR;
- break;
- case HELP_FONT_BUTTON:
- locationId = HELP_FONT_BUTTON_STR;
- break;
- case HELP_BACKDROP_BUTTON:
- locationId = HELP_BACKDROP_BUTTON_STR;
- break;
- case HELP_KEYBOARD_BUTTON:
- locationId = HELP_KEYBOARD_BUTTON_STR;
- break;
- case HELP_MOUSE_BUTTON:
- locationId = HELP_MOUSE_BUTTON_STR;
- break;
- case HELP_AUDIO_BUTTON:
- locationId = HELP_AUDIO_BUTTON_STR;
- break;
- case HELP_SCREEN_BUTTON:
- locationId = HELP_SCREEN_BUTTON_STR;
- break;
- case HELP_DTWM_BUTTON:
- locationId = HELP_DTWM_BUTTON_STR;
- break;
- case HELP_STARTUP_BUTTON:
- locationId = HELP_STARTUP_BUTTON_STR;
- break;
- case HELP_I18N_BUTTON:
- locationId = HELP_I18N_BUTTON_STR;
- break;
- case HELP_COLOR_DIALOG:
- locationId = HELP_COLOR_DIALOG_STR;
- break;
- case HELP_ADD_PALETTE_DIALOG:
- locationId = HELP_ADD_PALETTE_DIALOG_STR;
- break;
- case HELP_ADD_PALETTE_WARNING_DIALOG:
- locationId = HELP_ADD_PALETTE_WARNING_DIALOG_STR;
- break;
- case HELP_DELETE_PALETTE_DIALOG:
- locationId = HELP_DELETE_PALETTE_DIALOG_STR;
- break;
- case HELP_DELETE_PALETTE_WARNING_DIALOG:
- locationId = HELP_DELETE_PALETTE_WARNING_DIALOG_STR;
- break;
- case HELP_MODIFY_PALETTE_DIALOG:
- locationId = HELP_MODIFY_PALETTE_DIALOG_STR;
- break;
- case HELP_COLOR_USE_DIALOG:
- locationId = HELP_COLOR_USE_DIALOG_STR;
- break;
- case HELP_FONT_DIALOG:
- locationId = HELP_FONT_DIALOG_STR;
- break;
- case HELP_BACKDROP_DIALOG:
- locationId = HELP_BACKDROP_DIALOG_STR;
- break;
- case HELP_KEYBOARD_DIALOG:
- locationId = HELP_KEYBOARD_DIALOG_STR;
- break;
- case HELP_MOUSE_DIALOG:
- locationId = HELP_MOUSE_DIALOG_STR;
- break;
- case HELP_AUDIO_DIALOG:
- locationId = HELP_AUDIO_DIALOG_STR;
- break;
- case HELP_SCREEN_DIALOG:
- locationId = HELP_SCREEN_DIALOG_STR;
- break;
- case HELP_DTWM_DIALOG:
- locationId = HELP_DTWM_DIALOG_STR;
- break;
- case HELP_STARTUP_DIALOG:
- locationId = HELP_STARTUP_DIALOG_STR;
- break;
- case HELP_I18N_DIALOG:
- locationId = HELP_I18N_DIALOG_STR;
- break;
- }
- Help(helpVolume, locationId);
- }
- void
- QuickHelpRequestCB(
- Widget w,
- caddr_t client_data,
- caddr_t call_data )
- {
- }
- void
- HelpModeCB(
- Widget w,
- caddr_t client_data,
- caddr_t call_data )
- {
- Widget widget;
- switch(DtHelpReturnSelectedWidgetId(style.shell, (Cursor)NULL, &widget))
- {
- /*
- * There are additional cases (e.g. user aborts request) but I
- * don't feel they warrant an error dialog.
- */
- case DtHELP_SELECT_VALID:
- while (!XtIsShell(widget))
- {
- if (XtHasCallbacks(widget, XmNhelpCallback) == XtCallbackHasSome)
- {
- XtCallCallbacks(widget, XmNhelpCallback, (XtPointer)NULL);
- return;
- }
- widget = XtParent(widget);
- }
- break;
- case DtHELP_SELECT_INVALID:
- ErrDialog((char *)GETMESSAGE(2, 8, "You must select an item\nwithin the Style Manager."), style.shell);
- break;
- }
- }
- void
- HelpHyperlinkCB(
- Widget w,
- caddr_t client_data,
- caddr_t call_data )
- {
- DtHelpDialogCallbackStruct *pHyper =
- (DtHelpDialogCallbackStruct *) call_data;
- switch(pHyper->hyperType)
- {
- case DtHELP_LINK_JUMP_NEW:
- DisplayHelp(pHyper->helpVolume, pHyper->locationId);
- break;
- default:
- ;
- /* application defined link code goes here */
- }
- }
- void
- HelpCloseCB(
- Widget w,
- caddr_t client_data,
- caddr_t call_data )
- {
- HelpStruct *pHelpCache = (HelpStruct *)client_data;
- HelpStruct *pHelp;
- /*
- * empty for loop just marches pHelp to the right place
- */
- for(pHelp = pHelpCache;
- pHelp != (HelpStruct *)NULL && pHelp->dialog != w;
- pHelp = pHelp->pNext);
- if(pHelp != (HelpStruct *)NULL)
- {
- /* this should always happen */
- pHelp->inUse = False;
- }
- XtUnmapWidget(XtParent(w));
- }
|