Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
3382
cde/lib/DtWidget/ComboBox.c
Normal file
3382
cde/lib/DtWidget/ComboBox.c
Normal file
File diff suppressed because it is too large
Load Diff
565
cde/lib/DtWidget/ComboBox.h
Normal file
565
cde/lib/DtWidget/ComboBox.h
Normal file
@@ -0,0 +1,565 @@
|
||||
/* $XConsortium: ComboBox.h /main/4 1995/10/26 09:29:51 rswiston $ */
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
/***********************************************************
|
||||
Copyright 1993 Interleaf, Inc.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software
|
||||
and its documentation for any purpose without fee is granted,
|
||||
provided that the above copyright notice appear in all copies
|
||||
and that both copyright notice and this permission notice appear
|
||||
in supporting documentation, and that the name of Interleaf not
|
||||
be used in advertising or publicly pertaining to distribution of
|
||||
the software without specific written prior permission.
|
||||
|
||||
Interleaf makes no representation about the suitability of this
|
||||
software for any purpose. It is provided "AS IS" without any
|
||||
express or implied warranty.
|
||||
******************************************************************/
|
||||
|
||||
#ifndef _Dt_ComboBox_h
|
||||
#define _Dt_ComboBox_h
|
||||
|
||||
/*
|
||||
* This widget is deprecated in favor of XmComboBox. The two are very
|
||||
* similar, but do have minor differences. Applications doing new
|
||||
* development are encouraged to use XmComboBox directly. Existing
|
||||
* applications may wish to recompile with DT_USE_XM_COMBOBOX.
|
||||
*/
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#ifdef DT_USE_XM_COMBOBOX
|
||||
#include <Xm/ComboBox.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
|
||||
/* Resources */
|
||||
|
||||
#ifndef DT_USE_XM_COMBOBOX
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* NOTE:
|
||||
* Because of future development of the ComboBox, not all of the
|
||||
* following resources should be used. The only ones which are
|
||||
* supported are the ones found in the Common Desktop Environment:
|
||||
* Programmer's Guide. The supported resources include:
|
||||
* DtNmarginHeight, DtNmarginWidth, DtNselectedItem,
|
||||
* DtNselectedPosition, DtNselectionCallback, and DtNcomboBoxType.
|
||||
*
|
||||
* The use of the unsupported resources found in this header
|
||||
* file may cause dangerous and unexpected behavior.
|
||||
*
|
||||
**********************************************************************/
|
||||
|
||||
/* WARNING: DtNactivateCallback is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNactivateCallback
|
||||
#define DtNactivateCallback XmNactivateCallback
|
||||
#endif
|
||||
/* WARNING: DtNalignment is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNalignment
|
||||
#define DtNalignment XmNalignment
|
||||
#endif
|
||||
/* WARNING: DtNarrowSize is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNarrowSize
|
||||
#define DtNarrowSize "arrowSize"
|
||||
#endif
|
||||
/* WARNING: DtNarrowSpacing is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNarrowSpacing
|
||||
#define DtNarrowSpacing "arrowSpacing"
|
||||
#endif
|
||||
/* WARNING: DtNarrowType is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNarrowType
|
||||
#define DtNarrowType "arrowType"
|
||||
#endif
|
||||
/* WARNING: DtNcolumns is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNcolumns
|
||||
#define DtNcolumns XmNcolumns
|
||||
#endif
|
||||
#ifndef DtNcomboBoxType
|
||||
#define DtNcomboBoxType "comboBoxType"
|
||||
#endif
|
||||
/* WARNING: DtNfocusCallback is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNfocusCallback
|
||||
#define DtNfocusCallback XmNfocusCallback
|
||||
#endif
|
||||
/* WARNING: DtNhorizontalSpacing is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNhorizontalSpacing
|
||||
#define DtNhorizontalSpacing XmNhorizontalSpacing
|
||||
#endif
|
||||
/* WARNING: DtNitemCount is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNitemCount
|
||||
#define DtNitemCount XmNitemCount
|
||||
#endif
|
||||
/* WARNING: DtNitems is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNitems
|
||||
#define DtNitems XmNitems
|
||||
#endif
|
||||
/* WARNING: DtNlabelString is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNlabelString
|
||||
#define DtNlabelString XmNlabelString
|
||||
#endif
|
||||
/* WARNING: DtNlist is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNlist
|
||||
#define DtNlist "list"
|
||||
#endif
|
||||
/* WARNING: DtNlistFontList is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNlistFontList
|
||||
#define DtNlistFontList "listFontList"
|
||||
#endif
|
||||
/* WARNING: DtNlistMarginHeight is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNlistMarginHeight
|
||||
#define DtNlistMarginHeight XmNlistMarginHeight
|
||||
#endif
|
||||
/* WARNING: DtNlistMarginWidth is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNlistMarginWidth
|
||||
#define DtNlistMarginWidth XmNlistMarginWidth
|
||||
#endif
|
||||
/* WARNING: DtNlistSpacing is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNlistSpacing
|
||||
#define DtNlistSpacing XmNlistSpacing
|
||||
#endif
|
||||
/* WARNING: DtNlosingFocusCallback is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNlosingFocusCallback
|
||||
#define DtNlosingFocusCallback XmNlosingFocusCallback
|
||||
#endif
|
||||
#ifndef DtNmarginHeight
|
||||
#define DtNmarginHeight XmNmarginHeight
|
||||
#endif
|
||||
#ifndef DtNmarginWidth
|
||||
#define DtNmarginWidth XmNmarginWidth
|
||||
#endif
|
||||
/* WARNING: DtNmaxLength is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNmaxLength
|
||||
#define DtNmaxLength XmNmaxLength
|
||||
#endif
|
||||
/* WARNING: DtNmenuPostCallback is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNmenuPostCallback
|
||||
#define DtNmenuPostCallback "menuPostCallback"
|
||||
#endif
|
||||
/* WARNING: DtNorientation is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNorientation
|
||||
#define DtNorientation XmNorientation
|
||||
#endif
|
||||
/* WARNING: DtNpoppedUp is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNpoppedUp
|
||||
#define DtNpoppedUp "poppedUp"
|
||||
#endif
|
||||
/* WARNING: DtNrecomputeSize is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNrecomputeSize
|
||||
#define DtNrecomputeSize XmNrecomputeSize
|
||||
#endif
|
||||
#ifndef DtNselectedItem
|
||||
#define DtNselectedItem "selectedItem"
|
||||
#endif
|
||||
#ifndef DtNselectedPosition
|
||||
#define DtNselectedPosition "selectedPosition"
|
||||
#endif
|
||||
#ifndef DtNselectionCallback
|
||||
#define DtNselectionCallback "selectionCallback"
|
||||
#endif
|
||||
/* WARNING: DtNtextField is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNtextField
|
||||
#define DtNtextField "textField"
|
||||
#endif
|
||||
/* WARNING: DtNtopItemPosition is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNtopItemPosition
|
||||
#define DtNtopItemPosition XmNtopItemPosition
|
||||
#endif
|
||||
/* WARNING: DtNupdateLabel is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNupdateLabel
|
||||
#define DtNupdateLabel "updateLabel"
|
||||
#endif
|
||||
/* WARNING: DtNverticalSpacing is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNverticalSpacing
|
||||
#define DtNverticalSpacing XmNverticalSpacing
|
||||
#endif
|
||||
/* WARNING: DtNvisibleItemCount is an unsupported resource in CDE 1.0 */
|
||||
#ifndef DtNvisibleItemCount
|
||||
#define DtNvisibleItemCount XmNvisibleItemCount
|
||||
#endif
|
||||
|
||||
#ifndef DtCAlignment
|
||||
#define DtCAlignment XmCAlignment
|
||||
#endif
|
||||
#ifndef DtCArrowSize
|
||||
#define DtCArrowSize "ArrowSize"
|
||||
#endif
|
||||
#ifndef DtCArrowSpacing
|
||||
#define DtCArrowSpacing "ArrowSpacing"
|
||||
#endif
|
||||
#ifndef DtCArrowType
|
||||
#define DtCArrowType "ArrowType"
|
||||
#endif
|
||||
#ifndef DtCCallback
|
||||
#define DtCCallback XmCCallback
|
||||
#endif
|
||||
#ifndef DtCColumns
|
||||
#define DtCColumns XmCColumns
|
||||
#endif
|
||||
#ifndef DtCComboBoxType
|
||||
#define DtCComboBoxType "ComboBoxType"
|
||||
#endif
|
||||
#ifndef DtCHorizontalSpacing
|
||||
#define DtCHorizontalSpacing "HorizontalSpacing"
|
||||
#endif
|
||||
#ifndef DtCItemCount
|
||||
#define DtCItemCount XmCItemCount
|
||||
#endif
|
||||
#ifndef DtCItems
|
||||
#define DtCItems XmCItems
|
||||
#endif
|
||||
#ifndef DtCList
|
||||
#define DtCList "List"
|
||||
#endif
|
||||
#ifndef DtCListFontList
|
||||
#define DtCListFontList "ListFontList"
|
||||
#endif
|
||||
#ifndef DtCListMarginHeight
|
||||
#define DtCListMarginHeight XmCListMarginHeight
|
||||
#endif
|
||||
#ifndef DtCListMarginWidth
|
||||
#define DtCListMarginWidth XmCListMarginWidth
|
||||
#endif
|
||||
#ifndef DtCListSpacing
|
||||
#define DtCListSpacing XmCListSpacing
|
||||
#endif
|
||||
#ifndef DtCMarginHeight
|
||||
#define DtCMarginHeight XmCMarginHeight
|
||||
#endif
|
||||
#ifndef DtCMarginWidth
|
||||
#define DtCMarginWidth XmCMarginWidth
|
||||
#endif
|
||||
#ifndef DtCMaxLength
|
||||
#define DtCMaxLength XmCMaxLength
|
||||
#endif
|
||||
#ifndef DtCOrientation
|
||||
#define DtCOrientation XmCOrientation
|
||||
#endif
|
||||
#ifndef DtCPoppedUp
|
||||
#define DtCPoppedUp "PoppedUp"
|
||||
#endif
|
||||
#ifndef DtCRecomputeSize
|
||||
#define DtCRecomputeSize XmCRecomputeSize
|
||||
#endif
|
||||
#ifndef DtCSelectedItem
|
||||
#define DtCSelectedItem "SelectedItem"
|
||||
#endif
|
||||
#ifndef DtCSelectedPosition
|
||||
#define DtCSelectedPosition "SelectedPosition"
|
||||
#endif
|
||||
#ifndef DtCTextField
|
||||
#define DtCTextField "TextField"
|
||||
#endif
|
||||
#ifndef DtCTopItemPosition
|
||||
#define DtCTopItemPosition XmCTopItemPosition
|
||||
#endif
|
||||
#ifndef DtCUpdateLabel
|
||||
#define DtCUpdateLabel "UpdateLabel"
|
||||
#endif
|
||||
#ifndef DtCVerticalSpacing
|
||||
#define DtCVerticalSpacing "VerticalSpacing"
|
||||
#endif
|
||||
#ifndef DtCVisibleItemCount
|
||||
#define DtCVisibleItemCount XmCVisibleItemCount
|
||||
#endif
|
||||
#ifndef DtCXmString
|
||||
#define DtCXmString XmCXmString
|
||||
#endif
|
||||
|
||||
#else /* DT_USE_XM_COMBOBOX */
|
||||
|
||||
#ifndef DtNarrowSize
|
||||
#define DtNarrowSize XmNarrowSize
|
||||
#endif
|
||||
#ifndef DtNarrowSpacing
|
||||
#define DtNarrowSpacing XmNarrowSpacing
|
||||
#endif
|
||||
#ifndef DtNcolumns
|
||||
#define DtNcolumns XmNcolumns
|
||||
#endif
|
||||
#ifndef DtNcomboBoxType
|
||||
#define DtNcomboBoxType XmNcomboBoxType
|
||||
#endif
|
||||
#ifndef DtNitemCount
|
||||
#define DtNitemCount XmNitemCount
|
||||
#endif
|
||||
#ifndef DtNitems
|
||||
#define DtNitems XmNitems
|
||||
#endif
|
||||
#ifndef DtNlabelString
|
||||
#define DtNlabelString XmNlabelString
|
||||
#endif
|
||||
#ifndef DtNlist
|
||||
#define DtNlist XmNlist
|
||||
#endif
|
||||
#ifndef DtNmarginHeight
|
||||
#define DtNmarginHeight XmNmarginHeight
|
||||
#endif
|
||||
#ifndef DtNmarginWidth
|
||||
#define DtNmarginWidth XmNmarginWidth
|
||||
#endif
|
||||
#ifndef DtNselectedItem
|
||||
#define DtNselectedItem XmNselectedItem
|
||||
#endif
|
||||
#ifndef DtNselectedPosition
|
||||
#define DtNselectedPosition XmNselectedPosition
|
||||
#endif
|
||||
#ifndef DtNselectionCallback
|
||||
#define DtNselectionCallback XmNselectionCallback
|
||||
#endif
|
||||
#ifndef DtNtextField
|
||||
#define DtNtextField XmNtextField
|
||||
#endif
|
||||
#ifndef DtNvisibleItemCount
|
||||
#define DtNvisibleItemCount XmNvisibleItemCount
|
||||
#endif
|
||||
|
||||
#ifndef DtCArrowSize
|
||||
#define DtCArrowSize XmCArrowSize
|
||||
#endif
|
||||
#ifndef DtCArrowSpacing
|
||||
#define DtCArrowSpacing XmCArrowSpacing
|
||||
#endif
|
||||
#ifndef DtCCallback
|
||||
#define DtCCallback XmCCallback
|
||||
#endif
|
||||
#ifndef DtCColumns
|
||||
#define DtCColumns XmCColumns
|
||||
#endif
|
||||
#ifndef DtCComboBoxType
|
||||
#define DtCComboBoxType XmCComboBoxType
|
||||
#endif
|
||||
#ifndef DtCItemCount
|
||||
#define DtCItemCount XmCItemCount
|
||||
#endif
|
||||
#ifndef DtCItems
|
||||
#define DtCItems XmCItems
|
||||
#endif
|
||||
#ifndef DtCList
|
||||
#define DtCList XmCList
|
||||
#endif
|
||||
#ifndef DtCMarginHeight
|
||||
#define DtCMarginHeight XmCMarginHeight
|
||||
#endif
|
||||
#ifndef DtCMarginWidth
|
||||
#define DtCMarginWidth XmCMarginWidth
|
||||
#endif
|
||||
#ifndef DtCSelectedItem
|
||||
#define DtCSelectedItem XmCSelectedItem
|
||||
#endif
|
||||
#ifndef DtCSelectedPosition
|
||||
#define DtCSelectedPosition XmCSelectedPosition
|
||||
#endif
|
||||
#ifndef DtCTextField
|
||||
#define DtCTextField XmCTextField
|
||||
#endif
|
||||
#ifndef DtCVisibleItemCount
|
||||
#define DtCVisibleItemCount XmCVisibleItemCount
|
||||
#endif
|
||||
#ifndef DtCXmString
|
||||
#define DtCXmString XmCXmString
|
||||
#endif
|
||||
|
||||
#endif /* DT_USE_XM_COMBOBOX */
|
||||
|
||||
/* Representation types */
|
||||
|
||||
#ifndef DT_USE_XM_COMBOBOX
|
||||
|
||||
#ifndef DtRArrowType
|
||||
#define DtRArrowType "ArrowType"
|
||||
#endif
|
||||
#ifndef DtRComboBoxType
|
||||
#define DtRComboBoxType "ComboBoxType"
|
||||
#endif
|
||||
|
||||
#else /* DT_USE_XM_COMBOBOX */
|
||||
|
||||
#ifndef DtRComboBoxType
|
||||
#define DtRComboBoxType XmRComboBoxType
|
||||
#endif
|
||||
|
||||
#endif /* DT_USE_XM_COMBOBOX */
|
||||
|
||||
/* DtNorientation values */
|
||||
|
||||
#ifndef DT_USE_XM_COMBOBOX
|
||||
|
||||
#ifndef DtLEFT
|
||||
#define DtLEFT 1
|
||||
#endif
|
||||
#ifndef DtRIGHT
|
||||
#define DtRIGHT 2
|
||||
#endif
|
||||
|
||||
#endif /* not DT_USE_XM_COMBOBOX */
|
||||
|
||||
/* DtNarrowType values */
|
||||
|
||||
#ifndef DT_USE_XM_COMBOBOX
|
||||
|
||||
#ifndef DtMOTIF
|
||||
#define DtMOTIF 0
|
||||
#endif
|
||||
#ifndef DtWINDOWS
|
||||
#define DtWINDOWS 1
|
||||
#endif
|
||||
|
||||
#endif /* not DT_USE_XM_COMBOBOX */
|
||||
|
||||
/* DtNcomboBoxType values */
|
||||
|
||||
#ifndef DT_USE_XM_COMBOBOX
|
||||
|
||||
#ifndef DtDROP_DOWN_LIST
|
||||
#define DtDROP_DOWN_LIST 2
|
||||
#endif
|
||||
#ifndef DtDROP_DOWN_COMBO_BOX
|
||||
#define DtDROP_DOWN_COMBO_BOX 1
|
||||
#endif
|
||||
|
||||
#else /* DT_USE_XM_COMBOBOX */
|
||||
|
||||
#ifndef DtDROP_DOWN_LIST
|
||||
#define DtDROP_DOWN_LIST XmDROP_DOWN_LIST
|
||||
#endif
|
||||
#ifndef DtDROP_DOWN_COMBO_BOX
|
||||
#define DtDROP_DOWN_COMBO_BOX XmDROP_DOWN_COMBO_BOX
|
||||
#endif
|
||||
|
||||
#endif /* DT_USE_XM_COMBOBOX */
|
||||
|
||||
/* DtNalignment values */
|
||||
|
||||
#ifndef DT_USE_XM_COMBOBOX
|
||||
|
||||
#ifndef DtALIGNMENT_BEGINNING
|
||||
#define DtALIGNMENT_BEGINNING XmALIGNMENT_BEGINNING
|
||||
#endif
|
||||
#ifndef DtALIGNMENT_CENTER
|
||||
#define DtALIGNMENT_CENTER XmALIGNMENT_CENTER
|
||||
#endif
|
||||
#ifndef DtALIGNMENT_END
|
||||
#define DtALIGNMENT_END XmALIGNMENT_END
|
||||
#endif
|
||||
|
||||
#endif /* not DT_USE_XM_COMBOBOX */
|
||||
|
||||
/* Callback reasons */
|
||||
|
||||
#ifndef DT_USE_XM_COMBOBOX
|
||||
|
||||
#ifndef DtCR_SELECT
|
||||
#define DtCR_SELECT 57 /* Large #, so no collisions with XM */
|
||||
#endif
|
||||
#ifndef DtCR_MENU_POST
|
||||
#define DtCR_MENU_POST 129 /* Large #, so no collisions with XM */
|
||||
#endif
|
||||
|
||||
#endif /* not DT_USE_XM_COMBOBOX */
|
||||
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
|
||||
#ifndef DT_USE_XM_COMBOBOX
|
||||
|
||||
typedef struct {
|
||||
int reason;
|
||||
XEvent *event;
|
||||
XmString item_or_text;
|
||||
int item_position;
|
||||
} DtComboBoxCallbackStruct;
|
||||
|
||||
|
||||
/* Widget class and instance */
|
||||
|
||||
typedef struct _DtComboBoxClassRec *DtComboBoxWidgetClass;
|
||||
typedef struct _DtComboBoxRec *DtComboBoxWidget;
|
||||
|
||||
#else /* DT_USE_XM_COMBOBOX */
|
||||
|
||||
#define DtComboBoxCallbackStruct XmComboBoxCallbackStruct
|
||||
#define DtComboBoxWidgetClass XmComboBoxWidgetClass
|
||||
#define DtComboBoxWidget XmComboBoxWidget
|
||||
|
||||
#endif /* DT_USE_XM_COMBOBOX */
|
||||
|
||||
|
||||
/*
|
||||
* Data
|
||||
*/
|
||||
|
||||
#ifndef DT_USE_XM_COMBOBOX
|
||||
|
||||
/* Widget class record */
|
||||
|
||||
externalref WidgetClass dtComboBoxWidgetClass;
|
||||
|
||||
#else /* DT_USE_XM_COMBOBOX */
|
||||
|
||||
#define dtComboBoxWidgetClass xmComboBoxWidgetClass;
|
||||
|
||||
#endif /* DT_USE_XM_COMBOBOX */
|
||||
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
|
||||
#ifndef DT_USE_XM_COMBOBOX
|
||||
|
||||
extern Widget DtCreateComboBox(
|
||||
Widget parent,
|
||||
char *name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount);
|
||||
|
||||
extern void DtComboBoxAddItem(
|
||||
Widget combo,
|
||||
XmString item,
|
||||
int pos,
|
||||
Boolean unique);
|
||||
|
||||
extern void DtComboBoxDeletePos(
|
||||
Widget combo,
|
||||
int pos);
|
||||
|
||||
extern void DtComboBoxSetItem(
|
||||
Widget combo,
|
||||
XmString item);
|
||||
|
||||
extern void DtComboBoxSelectItem(
|
||||
Widget combo,
|
||||
XmString item);
|
||||
|
||||
#else /* DT_USE_XM_COMBOBOX */
|
||||
|
||||
#define DtCreateComboBox XmCreateComboBox
|
||||
#define DtComboBoxAddItem XmComboBoxAddItem
|
||||
#define DtComboBoxDeletePos XmComboBoxDeletePos
|
||||
#define DtComboBoxSetItem XmComboBoxSetItem
|
||||
#define DtComboBoxSelectItem XmComboBoxSelectItem
|
||||
|
||||
#endif /* DT_USE_XM_COMBOBOX */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _Dt_ComboBox_h */
|
||||
233
cde/lib/DtWidget/ComboBoxP.h
Normal file
233
cde/lib/DtWidget/ComboBoxP.h
Normal file
@@ -0,0 +1,233 @@
|
||||
/* $XConsortium: ComboBoxP.h /main/3 1995/10/26 09:29:58 rswiston $ */
|
||||
/*
|
||||
* DtWidget/ComboBoxP.h
|
||||
*/
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
/***********************************************************
|
||||
Copyright 1993 Interleaf, Inc.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software
|
||||
and its documentation for any purpose without fee is granted,
|
||||
provided that the above copyright notice appear in all copies
|
||||
and that both copyright notice and this permission notice appear
|
||||
in supporting documentation, and that the name of Interleaf not
|
||||
be used in advertising or publicly pertaining to distribution of
|
||||
the software without specific written prior permission.
|
||||
|
||||
Interleaf makes no representation about the suitability of this
|
||||
software for any purpose. It is provided "AS IS" without any
|
||||
express or implied warranty.
|
||||
******************************************************************/
|
||||
|
||||
/*
|
||||
* (C) Copyright 1991,1992, 1993
|
||||
* Interleaf, Inc.
|
||||
* Nine Hillside Avenue, Waltham, MA 02154
|
||||
*
|
||||
* ComboBoxP.h:
|
||||
*
|
||||
* Private header file for DtComboBoxWidget.
|
||||
*/
|
||||
#ifndef _ComboBoxP_h
|
||||
#define _ComboBoxP_h
|
||||
|
||||
#include <X11/IntrinsicP.h>
|
||||
#include <X11/ShellP.h>
|
||||
#include <Xm/DrawnB.h>
|
||||
#include <Xm/ArrowB.h>
|
||||
#include <Xm/TextFP.h>
|
||||
#include <Xm/Label.h>
|
||||
#include <Xm/Frame.h>
|
||||
#include <Xm/ListP.h>
|
||||
#include <Xm/Separator.h>
|
||||
#include <Xm/ScrolledWP.h>
|
||||
#include <Xm/ScrollBarP.h>
|
||||
|
||||
#include <Xm/ManagerP.h>
|
||||
#include "ComboBox.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* External definitions of syn_resources for our list widget.
|
||||
*/
|
||||
#define SYN_RESOURCE_AA (Widget w, int resource_offset, XtArgVal *value)
|
||||
extern void _DtComboBoxGetArrowSize SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetLabelString SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListItemCount SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListItems SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListFontList SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListMarginHeight SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListMarginWidth SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListSpacing SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListTopItemPosition SYN_RESOURCE_AA;
|
||||
extern void _DtComboBoxGetListVisibleItemCount SYN_RESOURCE_AA;
|
||||
|
||||
#define ARROW_MULT .45
|
||||
#define ARROW_MIN 13
|
||||
#define MARGIN 2
|
||||
#define LABEL_PADDING 2
|
||||
#define LABEL_SHADOW 2
|
||||
#define TEXT_FIELD_SHADOW 1
|
||||
#define TEXT_CONTEXT_MARGIN 4
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Message Defines
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
#define CB_ALIGNMENT DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_ALIGNMENT, _DtMsgComboBox_0000)
|
||||
|
||||
#define CB_MARGIN_HEIGHT DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_MARGIN_HEIGHT, _DtMsgComboBox_0001)
|
||||
|
||||
#define CB_MARGIN_WIDTH DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_MARGIN_WIDTH, _DtMsgComboBox_0002)
|
||||
|
||||
#define CB_HORIZONTAL_SPACING DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_HORIZONTAL_SPACING, _DtMsgComboBox_0003)
|
||||
|
||||
#define CB_VERTICAL_SPACING DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_VERTICAL_SPACING, _DtMsgComboBox_0004)
|
||||
|
||||
#define CB_ORIENTATION DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_ORIENTATION, _DtMsgComboBox_0005)
|
||||
|
||||
#define CB_ITEM_COUNT DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_ITEM_COUNT, _DtMsgComboBox_0006)
|
||||
|
||||
#define CB_VISIBLE_ITEM DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_VISIBLE_ITEM, _DtMsgComboBox_0007)
|
||||
|
||||
#define CB_TEXT DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_TEXT, _DtMsgComboBox_0008)
|
||||
|
||||
#define CB_SET_ITEM DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_SET_ITEM, _DtMsgComboBox_0009)
|
||||
|
||||
#define CB_SELECT_ITEM DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_SELECT_ITEM, _DtMsgComboBox_0010)
|
||||
|
||||
#define CB_RESIZE DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_RESIZE, _DtMsgComboBox_0011)
|
||||
|
||||
#define CB_LABEL DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_LABEL, _DtMsgComboBox_0012)
|
||||
|
||||
#define CB_CVTSTRING DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_CVTSTRING, _DtMsgComboBox_0013)
|
||||
|
||||
#define CB_DEL_POS DTWIDGET_GETMESSAGE( \
|
||||
MS_ComboBox, COMBO_DEL_POS, _DtMsgComboBox_0014)
|
||||
/*
|
||||
* Class Records
|
||||
*/
|
||||
typedef struct {
|
||||
Boolean junk; /* Need something */
|
||||
} DtComboBoxClassPart;
|
||||
|
||||
typedef struct _DtComboBoxClassRec {
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
DtComboBoxClassPart combo_box_class;
|
||||
} DtComboBoxClassRec;
|
||||
|
||||
extern DtComboBoxClassRec dtComboBoxClassRec;
|
||||
|
||||
|
||||
/*
|
||||
* Instance Record.
|
||||
*/
|
||||
typedef struct _DtComboBoxPart {
|
||||
/* Private data */
|
||||
Widget arrow;
|
||||
Widget shell;
|
||||
Widget frame;
|
||||
Widget label;
|
||||
Widget sep;
|
||||
Dimension old_width;
|
||||
Dimension old_height;
|
||||
Dimension label_max_length;
|
||||
Dimension label_max_height;
|
||||
/*
|
||||
* max_shell_width is the width that is needed to hold the
|
||||
* list if the longest item was visible. We then use this
|
||||
* width to figure out if the shell is not wide enough,
|
||||
* when it gets popped on the screen. This is needed in case the
|
||||
* combo-box resizes, or if items changes (list will resize).
|
||||
* Sometimes we change the size of the shell to fit on the screen, or
|
||||
* to make it at least as large as the combo_box. The next time we pop
|
||||
* the shell up the size may be different; therefore, we set the shell
|
||||
* size to the maximum everytime it gets popped up, then we will
|
||||
* make adjustments, only if needed.
|
||||
* This value gets saved every time the user updates DtNitems.
|
||||
*/
|
||||
Dimension max_shell_width;
|
||||
Dimension max_shell_height;
|
||||
|
||||
/* ComboBox specific public resources */
|
||||
Dimension margin_height;
|
||||
Dimension margin_width;
|
||||
XmString selected_item;
|
||||
int selected_position;
|
||||
XtCallbackList selection_callback;
|
||||
unsigned char type;
|
||||
Dimension arrow_spacing;
|
||||
|
||||
/* ComboBox specific private resources */
|
||||
Dimension arrow_size;
|
||||
XtCallbackList activate_callback;
|
||||
unsigned char alignment;
|
||||
unsigned char arrow_type;
|
||||
short text_columns;
|
||||
XtCallbackList focus_callback;
|
||||
Dimension horizontal_spacing;
|
||||
int item_count;
|
||||
XmStringTable items;
|
||||
XmStringTable list_items;
|
||||
XmString label_string;
|
||||
Widget list;
|
||||
XmFontList list_font_list;
|
||||
Dimension list_margin_height;
|
||||
Dimension list_margin_width;
|
||||
Dimension list_spacing;
|
||||
XtCallbackList losing_focus_callback;
|
||||
unsigned int text_max_length;
|
||||
XtCallbackList menu_post_callback;
|
||||
unsigned char orientation;
|
||||
Boolean popped_up;
|
||||
Boolean recompute_size;
|
||||
Widget text;
|
||||
int top_item_position;
|
||||
Boolean update_label;
|
||||
Dimension vertical_spacing;
|
||||
int visible_item_count;
|
||||
} DtComboBoxPart;
|
||||
|
||||
|
||||
typedef struct _DtComboBoxRec {
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
DtComboBoxPart combo_box;
|
||||
} DtComboBoxRec;
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _XmComboBoxP_h */
|
||||
2101
cde/lib/DtWidget/Control.c
Normal file
2101
cde/lib/DtWidget/Control.c
Normal file
File diff suppressed because it is too large
Load Diff
87
cde/lib/DtWidget/Control.h
Normal file
87
cde/lib/DtWidget/Control.h
Normal file
@@ -0,0 +1,87 @@
|
||||
/* $XConsortium: Control.h /main/4 1995/10/26 09:30:15 rswiston $ */
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: Control.h
|
||||
***
|
||||
*** project: MotifPlus Widgets
|
||||
***
|
||||
*** description: Public include file for DtControl class.
|
||||
***
|
||||
***
|
||||
*** (c) Copyright 1992 by Hewlett-Packard Company.
|
||||
***
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _DtControl_h
|
||||
#define _DtControl_h
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define XmCONTROL_NONE 0
|
||||
#define XmCONTROL_BLANK 1
|
||||
#define XmCONTROL_BUSY 2
|
||||
#define XmCONTROL_BUTTON 3
|
||||
#define XmCONTROL_CLIENT 4
|
||||
#define XmCONTROL_DATE 5
|
||||
#define XmCONTROL_MAIL 6
|
||||
#define XmCONTROL_MONITOR 7
|
||||
#define XmCONTROL_SWITCH 8
|
||||
|
||||
#define NUM_LIST_ITEMS 10
|
||||
|
||||
#define XmCR_BUSY_START 60
|
||||
#define XmCR_BUSY_STOP 61
|
||||
#define XmCR_MONITOR 62
|
||||
|
||||
#define DtMONITOR_OFF 0
|
||||
#define DtMONITOR_ON 1
|
||||
|
||||
#define XmNuseLabelAdjustment "use_label_adjustment"
|
||||
|
||||
#ifndef DtIsControl
|
||||
#define DtIsControl(w) XtIsSubclass(w, dtControlGadgetClass)
|
||||
#endif /* DtIsControl */
|
||||
|
||||
|
||||
extern Widget _DtCreateControl (Widget, String, ArgList, int);
|
||||
extern void _DtControlSetFileChanged (Widget, Boolean);
|
||||
extern void _DtControlSetBusy (Widget, Boolean);
|
||||
extern void _DtControlAddDropAnimationImage (Widget, String, int);
|
||||
extern void _DtControlDoDropAnimation (Widget);
|
||||
extern void _DtControlAddPushAnimationImage (Widget, String, int);
|
||||
extern void _DtControlDoPushAnimation (Widget);
|
||||
extern char _DtControlGetMonitorState(Widget);
|
||||
|
||||
|
||||
extern WidgetClass dtControlGadgetClass;
|
||||
|
||||
typedef struct _DtControlClassRec * DtControlClass;
|
||||
typedef struct _DtControlRec * DtControlGadget;
|
||||
|
||||
#define XmCR_FILE_CHANGED 51
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int reason;
|
||||
XEvent *event;
|
||||
Boolean set;
|
||||
unsigned char control_type;
|
||||
XtPointer push_function;
|
||||
XtPointer push_argument;
|
||||
Widget subpanel;
|
||||
long file_size;
|
||||
} DtControlCallbackStruct;
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _DtControl_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
223
cde/lib/DtWidget/ControlP.h
Normal file
223
cde/lib/DtWidget/ControlP.h
Normal file
@@ -0,0 +1,223 @@
|
||||
/* $XConsortium: ControlP.h /main/6 1996/03/25 11:17:48 rswiston $ */
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: ControlP.h
|
||||
***
|
||||
*** project: MotifPlus Widgets
|
||||
***
|
||||
*** description: Private include file for DtControl class.
|
||||
***
|
||||
***
|
||||
*** (c) Copyright 1992 by Hewlett-Packard Company.
|
||||
***
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _DtControlP_h
|
||||
#define _DtControlP_h
|
||||
|
||||
#include <Xm/XmP.h>
|
||||
#include <Dt/IconP.h>
|
||||
#include <Dt/Control.h>
|
||||
|
||||
typedef struct _DtControlCacheObjClassPart
|
||||
{
|
||||
XtPointer dummy;
|
||||
} DtControlCacheObjClassPart;
|
||||
|
||||
|
||||
typedef struct _DtControlCacheObjClassRec /* label cache class record */
|
||||
{
|
||||
ObjectClassPart object_class;
|
||||
XmExtClassPart ext_class;
|
||||
DtControlCacheObjClassPart control_class_cache;
|
||||
} DtControlCacheObjClassRec;
|
||||
|
||||
externalref DtControlCacheObjClassRec dtControlCacheObjClassRec;
|
||||
|
||||
|
||||
/* The Control Gadget Cache instance record */
|
||||
|
||||
typedef struct _DtControlCacheObjPart
|
||||
{
|
||||
XtPointer dummy;
|
||||
} DtControlCacheObjPart;
|
||||
|
||||
typedef struct _DtControlCacheObjRec
|
||||
{
|
||||
ObjectPart object;
|
||||
XmExtPart ext;
|
||||
DtControlCacheObjPart control_cache;
|
||||
} DtControlCacheObjRec;
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Class Structure
|
||||
*/
|
||||
|
||||
/* Class Part
|
||||
*/
|
||||
typedef struct _DtControlClassPart
|
||||
{
|
||||
XmCacheClassPartPtr cache_part;
|
||||
caddr_t extension;
|
||||
} DtControlClassPart;
|
||||
|
||||
/* Full Class Record
|
||||
*/
|
||||
typedef struct _DtControlClassRec
|
||||
{
|
||||
RectObjClassPart rect_class;
|
||||
XmGadgetClassPart gadget_class;
|
||||
DtIconClassPart icon_class;
|
||||
DtControlClassPart control_class;
|
||||
} DtControlClassRec;
|
||||
|
||||
/* Actual Class
|
||||
*/
|
||||
extern DtControlClassRec dtControlClassRec;
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Instance Structure
|
||||
*/
|
||||
|
||||
/* Instance Part
|
||||
*/
|
||||
typedef struct _DtControlPart
|
||||
{
|
||||
XtPointer push_function;
|
||||
XtPointer push_argument;
|
||||
|
||||
String push_action;
|
||||
int num_push_images;
|
||||
int max_push_images;
|
||||
int push_image_position;
|
||||
int *push_delays;
|
||||
Pixmap *push_pixmaps;
|
||||
Pixmap *push_masks;
|
||||
|
||||
String drop_action;
|
||||
int num_drop_images;
|
||||
int max_drop_images;
|
||||
int drop_image_position;
|
||||
int *drop_delays;
|
||||
Pixmap *drop_pixmaps;
|
||||
Pixmap *drop_masks;
|
||||
|
||||
Widget subpanel;
|
||||
|
||||
Pixmap alt_pix;
|
||||
Pixmap alt_mask;
|
||||
String alt_image;
|
||||
|
||||
XmString alt_string;
|
||||
Dimension alt_string_width;
|
||||
Dimension alt_string_height;
|
||||
|
||||
String format;
|
||||
String format_jp;
|
||||
String file_name;
|
||||
long file_size;
|
||||
XtIntervalId monitor_timer;
|
||||
int monitor_time;
|
||||
Boolean chime;
|
||||
Boolean file_changed;
|
||||
|
||||
Boolean _do_update;
|
||||
Boolean use_embossed_text;
|
||||
Boolean use_label_adj;
|
||||
|
||||
unsigned char control_type;
|
||||
|
||||
GC top_shadow_gc;
|
||||
GC bottom_shadow_gc;
|
||||
|
||||
XtIntervalId click_timer;
|
||||
int click_time;
|
||||
|
||||
short busy;
|
||||
int blink_elapsed;
|
||||
int max_blink_time;
|
||||
int blink_time;
|
||||
XtIntervalId blink_timer;
|
||||
|
||||
XtIntervalId date_timer;
|
||||
XtIntervalId push_animation_timer;
|
||||
XtIntervalId drop_animation_timer;
|
||||
} DtControlPart;
|
||||
|
||||
/* Full Instance Record
|
||||
*/
|
||||
typedef struct _DtControlRec
|
||||
{
|
||||
ObjectPart object;
|
||||
RectObjPart rectangle;
|
||||
XmGadgetPart gadget;
|
||||
DtIconPart icon;
|
||||
DtControlPart control;
|
||||
} DtControlRec;
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Class and Instance Macros
|
||||
*/
|
||||
|
||||
/* DtControl Class Macros
|
||||
*/
|
||||
|
||||
/* DtControl Instance Macros
|
||||
*/
|
||||
#define G_Format(g) (g -> control.format)
|
||||
#define G_TopShadowGC(g) (g -> control.top_shadow_gc)
|
||||
#define G_BottomShadowGC(g) (g -> control.bottom_shadow_gc)
|
||||
#define G_Busy(g) (g -> control.busy)
|
||||
#define G_PushImagePosition(g) (g -> control.push_image_position)
|
||||
#define G_NumPushImages(g) (g -> control.num_push_images)
|
||||
#define G_MaxPushImages(g) (g -> control.max_push_images)
|
||||
#define G_PushDelays(g) (g -> control.push_delays)
|
||||
#define G_PushPixmaps(g) (g -> control.push_pixmaps)
|
||||
#define G_PushMasks(g) (g -> control.push_masks)
|
||||
#define G_DropImagePosition(g) (g -> control.drop_image_position)
|
||||
#define G_NumDropImages(g) (g -> control.num_drop_images)
|
||||
#define G_MaxDropImages(g) (g -> control.max_drop_images)
|
||||
#define G_DropDelays(g) (g -> control.drop_delays)
|
||||
#define G_DropPixmaps(g) (g -> control.drop_pixmaps)
|
||||
#define G_DropMasks(g) (g -> control.drop_masks)
|
||||
#define G_DropAction(g) (g -> control.drop_action)
|
||||
#define G_PushAction(g) (g -> control.push_action)
|
||||
#define G__DoUpdate(g) (g -> control._do_update)
|
||||
#define G_PushFunction(g) (g -> control.push_function)
|
||||
#define G_PushArgument(g) (g -> control.push_argument)
|
||||
#define G_Subpanel(g) (g -> control.subpanel)
|
||||
#define G_AltMask(g) (g -> control.alt_mask)
|
||||
#define G_AltPix(g) (g -> control.alt_pix)
|
||||
#define G_AltString(g) (g -> control.alt_string)
|
||||
#define G_AltStringWidth(g) (g -> control.alt_string_width)
|
||||
#define G_AltStringHeight(g) (g -> control.alt_string_height)
|
||||
#define G_ControlType(g) (g -> control.control_type)
|
||||
#define G_AltImage(g) (g -> control.alt_image)
|
||||
#define G_FileChanged(g) (g -> control.file_changed)
|
||||
#define G_FileName(g) (g -> control.file_name)
|
||||
#define G_FileSize(g) (g -> control.file_size)
|
||||
#define G_Chime(g) (g -> control.chime)
|
||||
#define G_MonitorTimer(g) (g -> control.monitor_timer)
|
||||
#define G_MonitorTime(g) (g -> control.monitor_time)
|
||||
#define G_ClickTime(g) (g -> control.click_time)
|
||||
#define G_ClickTimer(g) (g -> control.click_timer)
|
||||
#define G_DateTimer(g) (g -> control.date_timer)
|
||||
#define G_PushAnimationTimer(g) (g -> control.push_animation_timer)
|
||||
#define G_DropAnimationTimer(g) (g -> control.drop_animation_timer)
|
||||
#define G_BlinkCount(g) (g -> control.blink_count)
|
||||
#define G_BlinkElapsed(g) (g -> control.blink_elapsed)
|
||||
#define G_MaxBlinkTime(g) (g -> control.max_blink_time)
|
||||
#define G_BlinkTime(g) (g -> control.blink_time)
|
||||
#define G_BlinkTimer(g) (g -> control.blink_timer)
|
||||
#define G_BlinkTime(g) (g -> control.blink_time)
|
||||
#define G_UseEmbossedText(g) (g -> control.use_embossed_text)
|
||||
#define G_UseLabelAdjustment(g) (g -> control.use_label_adj)
|
||||
|
||||
|
||||
#endif /* _DtControlP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
926
cde/lib/DtWidget/DialogBox.c
Normal file
926
cde/lib/DtWidget/DialogBox.c
Normal file
@@ -0,0 +1,926 @@
|
||||
/* $XConsortium: DialogBox.c /main/9 1996/05/14 15:26:42 drk $
|
||||
*
|
||||
* (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.
|
||||
*/
|
||||
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: DialogBox.c
|
||||
***
|
||||
*** project: Motif Widgets
|
||||
***
|
||||
*** description: Source code for DtDialogBox class.
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Include Files
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
#include <Dt/DialogBoxP.h>
|
||||
#include <Dt/MacrosP.h>
|
||||
#include <Dt/DtMsgsP.h>
|
||||
#include "DtWidgetI.h"
|
||||
|
||||
/*
|
||||
* Private functions borrowed from Motif.
|
||||
*/
|
||||
extern void _XmSetThickness(Widget widget, int offset, XrmValue *value);
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Public Interface
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
extern Widget _DtCreateDialogBox(
|
||||
Widget parent,
|
||||
char *name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount) ;
|
||||
extern Widget __DtCreateDialogBoxDialog(
|
||||
Widget ds_p,
|
||||
String name,
|
||||
ArgList db_args,
|
||||
Cardinal db_n) ;
|
||||
extern Widget _DtDialogBoxGetButton(
|
||||
Widget w,
|
||||
Cardinal pos) ;
|
||||
extern Widget _DtDialogBoxGetWorkArea(
|
||||
Widget w) ;
|
||||
|
||||
#define Max(x, y) (((x) > (y)) ? (x) : (y))
|
||||
|
||||
/******** Static Function Declarations ********/
|
||||
|
||||
static void ClassInitialize( void ) ;
|
||||
static void ClassPartInitialize(
|
||||
WidgetClass wc) ;
|
||||
static void Initialize(
|
||||
Widget request_w,
|
||||
Widget new_w) ;
|
||||
static void Destroy(
|
||||
Widget w) ;
|
||||
static Boolean SetValues(
|
||||
Widget current_w,
|
||||
Widget request_w,
|
||||
Widget new_w) ;
|
||||
static void ChangeManaged(
|
||||
Widget manager) ;
|
||||
static void InsertChild(
|
||||
Widget child) ;
|
||||
static void DeleteChild(
|
||||
Widget child) ;
|
||||
static void ConstraintInitialize(
|
||||
Widget request,
|
||||
Widget new) ;
|
||||
static void GetSize(
|
||||
Widget manager,
|
||||
Dimension wa_w,
|
||||
Dimension wa_h,
|
||||
Dimension bp_w,
|
||||
Dimension bp_h,
|
||||
Dimension *w,
|
||||
Dimension *h) ;
|
||||
static void CreateChildren(
|
||||
DtDialogBoxWidget new,
|
||||
Widget top_widget,
|
||||
Widget bottom_widget) ;
|
||||
static void ButtonCallback(
|
||||
Widget g,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data) ;
|
||||
|
||||
/******** End Static Function Declarations ********/
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Forward Declarations
|
||||
*/
|
||||
|
||||
#define OFFSET 6
|
||||
#define CENTER_POS 50
|
||||
#define LEFT_POS 50
|
||||
|
||||
#define WARN_CHILD_TYPE _DtMsgDialogBox_0000
|
||||
#define WARN_BUTTON_CHILD _DtMsgDialogBox_0001
|
||||
|
||||
extern void _DtRegisterNewConverters ();
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Translations and Actions
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Resource List
|
||||
*/
|
||||
|
||||
/* Define offset macros.
|
||||
*/
|
||||
#define DB_Offset(field) \
|
||||
XtOffset (DtDialogBoxWidget, dialog_box.field)
|
||||
#define DBC_Offset(field) \
|
||||
XtOffset (DtDialogBoxConstraintPtr, dialog_box_constraint.field)
|
||||
|
||||
/* Core Resources.
|
||||
*/
|
||||
static XtResource resources[] =
|
||||
{
|
||||
{
|
||||
XmNminimizeButtons,
|
||||
XmCMinimizeButtons, XmRBoolean, sizeof (Boolean),
|
||||
DB_Offset (minimize_buttons), XmRImmediate, (XtPointer) False
|
||||
},
|
||||
{
|
||||
XmNbuttonCount,
|
||||
XmCButtonCount, XmRCardinal, sizeof (Cardinal),
|
||||
DB_Offset (button_count), XmRImmediate, (XtPointer) 4
|
||||
},
|
||||
{
|
||||
XmNbuttonLabelStrings,
|
||||
XmCButtonLabelStrings, XmRXmStringTable, sizeof (XtPointer),
|
||||
DB_Offset (button_label_strings), XmRStringTable, NULL
|
||||
},
|
||||
{
|
||||
XmNcallback,
|
||||
XmCCallback, XmRCallback, sizeof (XtCallbackList),
|
||||
DB_Offset (callback), XmRImmediate, (XtPointer) NULL
|
||||
},
|
||||
{
|
||||
XmNshadowThickness,
|
||||
XmCShadowThickness, XmRHorizontalDimension, sizeof(Dimension),
|
||||
XtOffsetOf (struct _XmManagerRec, manager.shadow_thickness),
|
||||
XmRCallProc, (XtPointer) _XmSetThickness
|
||||
}
|
||||
};
|
||||
|
||||
/* Constraint Resources
|
||||
*/
|
||||
static XtResource constraints[] =
|
||||
{
|
||||
{
|
||||
XmNchildType,
|
||||
XmCChildType, XmRChildType, sizeof (unsigned char),
|
||||
DBC_Offset (child_type), XmRImmediate, (XtPointer) XmWORK_AREA
|
||||
}
|
||||
};
|
||||
|
||||
#undef DB_Offset
|
||||
#undef DBC_Offset
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Class Record
|
||||
*/
|
||||
DtDialogBoxClassRec dtDialogBoxClassRec =
|
||||
{
|
||||
/* Core Part
|
||||
*/
|
||||
{
|
||||
(WidgetClass) &xmFormClassRec, /* superclass */
|
||||
"DtDialogBox", /* class_name */
|
||||
sizeof (DtDialogBoxRec), /* widget_size */
|
||||
ClassInitialize, /* class_initialize */
|
||||
ClassPartInitialize, /* class_part_initialize*/
|
||||
False, /* class_inited */
|
||||
(XtInitProc) Initialize, /* initialize */
|
||||
NULL, /* initialize_hook */
|
||||
XtInheritRealize, /* realize */
|
||||
NULL, /* actions */
|
||||
0, /* num_actions */
|
||||
resources, /* resources */
|
||||
XtNumber (resources), /* num_resources */
|
||||
NULLQUARK, /* xrm_class */
|
||||
True, /* compress_motion */
|
||||
False, /* compress_exposure */
|
||||
True, /* compress_enterleave */
|
||||
False, /* visible_interest */
|
||||
Destroy, /* destroy */
|
||||
XtInheritResize, /* resize */
|
||||
XtInheritExpose, /* expose */
|
||||
(XtSetValuesFunc) SetValues, /* set_values */
|
||||
NULL, /* set_values_hook */
|
||||
XtInheritSetValuesAlmost, /* set_values_almost */
|
||||
NULL, /* get_values_hook */
|
||||
NULL, /* accept_focus */
|
||||
XtVersion, /* version */
|
||||
NULL, /* callback private */
|
||||
XtInheritTranslations, /* tm_table */
|
||||
XtInheritQueryGeometry, /* query_geometry */
|
||||
NULL, /* display_accelerator */
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
/* Composite Part
|
||||
*/
|
||||
{
|
||||
XtInheritGeometryManager, /* geometry_manager */
|
||||
XtInheritChangeManaged, /* change_managed */
|
||||
InsertChild, /* insert_child */
|
||||
DeleteChild, /* delete_child */
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
/* Constraint Part
|
||||
*/
|
||||
{
|
||||
constraints, /* constraint_resources */
|
||||
XtNumber (constraints), /* num_constraint_resources */
|
||||
sizeof (DtDialogBoxConstraintRec),/* constraint_record */
|
||||
(XtInitProc) ConstraintInitialize,/* constraint_initialize */
|
||||
NULL, /* constraint_destroy */
|
||||
NULL, /* constraint_set_values */
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
/* XmManager Part
|
||||
*/
|
||||
{
|
||||
XtInheritTranslations, /* default_translations */
|
||||
NULL, /* get_resources */
|
||||
NULL, /* num_get_resources */
|
||||
NULL, /* get_cont_resources */
|
||||
0, /* num_get_cont_resources */
|
||||
XmInheritParentProcess, /* parent_process */
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
/* XmBulletinBoard Part
|
||||
*/
|
||||
{
|
||||
True, /* always_install_accelerators*/
|
||||
NULL, /* geo_matrix_create */
|
||||
XmInheritFocusMovedProc, /* focus_moved_proc */
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
/* XmForm Part
|
||||
*/
|
||||
{
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
/* DtDialogBox Part
|
||||
*/
|
||||
{
|
||||
(XtWidgetProc) CreateChildren, /* create_children */
|
||||
NULL, /* configure_children */
|
||||
GetSize, /* get_size */
|
||||
NULL, /* button_callback */
|
||||
NULL, /* extension */
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
WidgetClass dtDialogBoxWidgetClass = (WidgetClass) &dtDialogBoxClassRec;
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Private Procs
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Action Procs
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Core Procs
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** ClassInitialize
|
||||
** Initialize widget class.
|
||||
*/
|
||||
static void
|
||||
ClassInitialize( void )
|
||||
{
|
||||
_DtRegisterNewConverters ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** ClassPartInitialize
|
||||
** Initialize widget class part.
|
||||
*/
|
||||
static void
|
||||
ClassPartInitialize(
|
||||
WidgetClass wc )
|
||||
{
|
||||
DtDialogBoxWidgetClass mc = (DtDialogBoxWidgetClass) wc;
|
||||
DtDialogBoxWidgetClass super = (DtDialogBoxWidgetClass)
|
||||
C_Superclass (wc);
|
||||
|
||||
mc->bulletin_board_class.always_install_accelerators = True;
|
||||
|
||||
/* Propagate class procs for subclasses.
|
||||
*/
|
||||
if (C_CreateChildren (mc) == (XtWidgetProc) _XtInherit)
|
||||
C_CreateChildren (mc) = C_CreateChildren (super);
|
||||
|
||||
if (C_ConfigureChildren (mc) == (XtWidgetProc) _XtInherit)
|
||||
C_ConfigureChildren (mc) = C_ConfigureChildren (super);
|
||||
|
||||
if (C_GetSize (mc) == (DlgGetSizeProc) _XtInherit)
|
||||
C_GetSize (mc) = C_GetSize (super);
|
||||
|
||||
if (C_ButtonCallback (mc) == (XtCallbackProc) _XtInherit)
|
||||
C_ButtonCallback (mc) = C_ButtonCallback (super);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Initialize
|
||||
** Initialize a new widget instance.
|
||||
*/
|
||||
static void
|
||||
Initialize(
|
||||
Widget request_w,
|
||||
Widget new_w )
|
||||
{
|
||||
DtDialogBoxWidget request = (DtDialogBoxWidget) request_w,
|
||||
new = (DtDialogBoxWidget) new_w;
|
||||
Widget sep;
|
||||
|
||||
Arg al[20]; /* arg list */
|
||||
register int ac; /* arg count */
|
||||
XtWidgetProc create_children;
|
||||
|
||||
if (M_ButtonCount (new) > 0)
|
||||
M_Button (new) = (Widget *)
|
||||
XtMalloc (sizeof (Widget) * M_ButtonCount (new));
|
||||
else
|
||||
M_Button (new) = NULL;
|
||||
|
||||
M_WorkArea (new) = NULL;
|
||||
_DtProcessLock();
|
||||
create_children = C_CreateChildren((DtDialogBoxWidgetClass) XtClass(new));
|
||||
_DtProcessUnlock();
|
||||
(*create_children) ((Widget)new);
|
||||
|
||||
M_ButtonLabelStrings (new) = NULL;
|
||||
|
||||
M_MarginWidth (new) = M_ShadowThickness (new);
|
||||
M_MarginHeight (new) = M_ShadowThickness (new);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Destroy
|
||||
** Release resources allocated for widget instance.
|
||||
*/
|
||||
static void
|
||||
Destroy(
|
||||
Widget w )
|
||||
{
|
||||
DtDialogBoxWidget mgr = (DtDialogBoxWidget) w;
|
||||
|
||||
/* Free button pointers.
|
||||
*/
|
||||
if (M_Button (mgr) != NULL)
|
||||
XtFree ((char *)M_Button (mgr));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** SetValues
|
||||
** Handle changes in resource data.
|
||||
*/
|
||||
static Boolean
|
||||
SetValues(
|
||||
Widget current_w,
|
||||
Widget request_w,
|
||||
Widget new_w )
|
||||
{
|
||||
DtDialogBoxWidget current = (DtDialogBoxWidget) current_w,
|
||||
request = (DtDialogBoxWidget) request_w,
|
||||
new = (DtDialogBoxWidget) new_w;
|
||||
|
||||
Boolean redraw_flag = False;
|
||||
|
||||
/* Superclass does all the work so far; checks for redisplay, etc.
|
||||
*/
|
||||
|
||||
return (redraw_flag);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Composite Procs
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** ChangeManaged
|
||||
** Handle change in set of managed children.
|
||||
*/
|
||||
static void
|
||||
ChangeManaged(
|
||||
Widget manager )
|
||||
{
|
||||
DtDialogBoxWidget mgr = (DtDialogBoxWidget) manager;
|
||||
Dimension w = M_Width (mgr),
|
||||
h = M_Height (mgr);
|
||||
DlgGetSizeProc get_size;
|
||||
XtWidgetProc resize;
|
||||
/* Compute desired size.
|
||||
*/
|
||||
_DtProcessLock();
|
||||
get_size = C_GetSize((DtDialogBoxWidgetClass) XtClass(mgr));
|
||||
resize = XtCoreProc(manager, resize);
|
||||
_DtProcessUnlock();
|
||||
(*get_size) ((Widget)mgr, 0, 0, 0, 0, &w, &h);
|
||||
|
||||
/* check for resize policy if not first time ?? */
|
||||
|
||||
/* Try to change size to fit children
|
||||
*/
|
||||
if (w != M_Width (mgr) || h != M_Height (mgr))
|
||||
{
|
||||
switch (XtMakeResizeRequest ((Widget) mgr, w, h, &w, &h))
|
||||
{
|
||||
case XtGeometryAlmost:
|
||||
XtMakeResizeRequest ((Widget) mgr, w, h,
|
||||
NULL, NULL);
|
||||
case XtGeometryYes:
|
||||
case XtGeometryNo:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set positions and sizes of children.
|
||||
*/
|
||||
(*resize) (manager);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** InsertChild
|
||||
** Add a child.
|
||||
*/
|
||||
static void
|
||||
InsertChild(
|
||||
Widget child )
|
||||
{
|
||||
DtDialogBoxConstraint constraint = (DtDialogBoxConstraint)
|
||||
M_DialogBoxConstraint (child);
|
||||
DtDialogBoxWidget w = (DtDialogBoxWidget) XtParent (child);
|
||||
XmManagerWidgetClass mc = (XmManagerWidgetClass)xmManagerWidgetClass;
|
||||
Dimension s_t = M_ShadowThickness (w);
|
||||
Arg al[20]; /* arg list */
|
||||
register int ac; /* arg count */
|
||||
XtWidgetProc insert_child;
|
||||
|
||||
_DtProcessLock();
|
||||
insert_child = mc->composite_class.insert_child;
|
||||
_DtProcessUnlock();
|
||||
(*insert_child) (child);
|
||||
|
||||
if (constraint->child_type == XmWORK_AREA)
|
||||
{
|
||||
if (! M_WorkArea (w))
|
||||
{
|
||||
M_WorkArea (w) = child;
|
||||
ac = 0;
|
||||
XtSetArg (al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg (al[ac], XmNtopOffset, s_t); ac++;
|
||||
XtSetArg (al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg (al[ac], XmNleftOffset, s_t); ac++;
|
||||
XtSetArg (al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg (al[ac], XmNrightOffset, s_t); ac++;
|
||||
XtSetArg (al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg (al[ac], XmNbottomWidget, M_Separator (w)); ac++;
|
||||
XtSetArg (al[ac], XmNbottomOffset, 0); ac++;
|
||||
XtSetValues (child, al, ac);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** DeleteChild
|
||||
** Delete a child.
|
||||
*/
|
||||
static void
|
||||
DeleteChild(
|
||||
Widget child )
|
||||
{
|
||||
DtDialogBoxWidget w = (DtDialogBoxWidget) XtParent (child);
|
||||
XmManagerWidgetClass mc = (XmManagerWidgetClass)xmManagerWidgetClass;
|
||||
XtWidgetProc delete_child;
|
||||
|
||||
_DtProcessLock();
|
||||
delete_child = mc->composite_class.delete_child;
|
||||
_DtProcessUnlock();
|
||||
(*delete_child) (child);
|
||||
|
||||
if (child == M_Separator (w))
|
||||
M_Separator (w) = NULL;
|
||||
else if (child == M_WorkArea (w))
|
||||
M_WorkArea (w) = NULL;
|
||||
|
||||
/* button children ?? */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Constraint Procs
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
/*-------------------------------------------------------------
|
||||
** ConstraintInitialize
|
||||
** Add a child.
|
||||
*/
|
||||
static void
|
||||
ConstraintInitialize(
|
||||
Widget request,
|
||||
Widget new )
|
||||
{
|
||||
DtDialogBoxWidget mgr = (DtDialogBoxWidget) XtParent (new);
|
||||
DtDialogBoxConstraint constraint = M_DialogBoxConstraint (new);
|
||||
|
||||
/* Validate child type.
|
||||
*/
|
||||
if (constraint->child_type != XmWORK_AREA &&
|
||||
constraint->child_type != XmSEPARATOR &&
|
||||
constraint->child_type != XmBUTTON)
|
||||
{
|
||||
XmeWarning (new, WARN_CHILD_TYPE);
|
||||
if (! M_WorkArea (mgr))
|
||||
{
|
||||
constraint->child_type = XmWORK_AREA;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** XmManager Procs
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* All inherited from superclass.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** DtDialogBox Procs
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
** GetSize
|
||||
** Calculate desired size based on children.
|
||||
*/
|
||||
static void
|
||||
GetSize(
|
||||
Widget manager,
|
||||
Dimension wa_w,
|
||||
Dimension wa_h,
|
||||
Dimension bp_w,
|
||||
Dimension bp_h,
|
||||
Dimension *w,
|
||||
Dimension *h )
|
||||
{
|
||||
DtDialogBoxWidget mgr = (DtDialogBoxWidget) manager;
|
||||
Widget work_area = M_WorkArea (mgr),
|
||||
separator = M_Separator (mgr);
|
||||
Widget * button = M_Button (mgr);
|
||||
register int button_count = M_ButtonCount (mgr),
|
||||
i;
|
||||
Boolean min_btns = M_MinimizeButtons (mgr);
|
||||
Dimension sep_h = 0,
|
||||
b_h, offset = OFFSET, pad,
|
||||
max_w = 0, max_h = 0,
|
||||
s_t = M_ShadowThickness (mgr);
|
||||
XtWidgetGeometry request, reply;
|
||||
|
||||
|
||||
/* Query work area.
|
||||
*/
|
||||
if (work_area && !wa_w && !wa_h)
|
||||
{
|
||||
request.request_mode = CWWidth | CWHeight;
|
||||
XtQueryGeometry (work_area, &request, &reply);
|
||||
wa_w = reply.width;
|
||||
wa_h = reply.height;
|
||||
}
|
||||
|
||||
sep_h = (separator) ? P_Height (separator) : 0;
|
||||
|
||||
/* Get button panel size.
|
||||
*/
|
||||
s_t = Max (2, s_t);
|
||||
if ((bp_w == 0) && (bp_h == 0) && !min_btns)
|
||||
{
|
||||
request.request_mode = CWWidth | CWHeight;
|
||||
for (i = 0; i < button_count; i++)
|
||||
{
|
||||
pad = (i == 0) ? 0 : 4 * s_t;
|
||||
XtQueryGeometry (button[i], &request, &reply);
|
||||
max_w = Max ((unsigned)max_w, reply.width + pad);
|
||||
max_h = Max ((unsigned)max_h, reply.height + pad);
|
||||
}
|
||||
|
||||
if (button_count)
|
||||
{
|
||||
max_w += 4;
|
||||
max_h += 1;
|
||||
}
|
||||
|
||||
bp_w = (button_count * max_w) + ((button_count + 1) * offset);
|
||||
bp_h = sep_h + max_h + (2 * offset);
|
||||
}
|
||||
|
||||
else if ((bp_w == 0) && (bp_h == 0) && min_btns)
|
||||
{
|
||||
request.request_mode = CWWidth | CWHeight;
|
||||
for (i = 0; i < button_count; i++)
|
||||
{
|
||||
XtQueryGeometry (button[i], &request, &reply);
|
||||
bp_w += reply.width;
|
||||
max_h = Max (max_h, reply.height);
|
||||
}
|
||||
|
||||
bp_w += (button_count + 1) * offset;
|
||||
bp_h = sep_h + max_h + (2 * offset);
|
||||
}
|
||||
|
||||
/* Set width and height.
|
||||
*/
|
||||
*w = Max (wa_w, bp_w);
|
||||
*h = wa_h + sep_h + bp_h;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** CreateChildren
|
||||
** Create resource and value labels and text.
|
||||
*/
|
||||
static void
|
||||
CreateChildren(
|
||||
DtDialogBoxWidget new,
|
||||
Widget top_widget,
|
||||
Widget bottom_widget )
|
||||
{
|
||||
Widget ref_widget,
|
||||
sep, btn;
|
||||
Widget * button = M_Button (new);
|
||||
int count = M_ButtonCount (new),
|
||||
i, l_p, r_p, off_p, b_delta, offset = 0;
|
||||
XmStringTable string = M_ButtonLabelStrings (new);
|
||||
Boolean min_btns = M_MinimizeButtons (new);
|
||||
Dimension s_t = M_ShadowThickness (new);
|
||||
char button_name[100];
|
||||
|
||||
Arg al[20]; /* arg list */
|
||||
register int ac; /* arg count */
|
||||
|
||||
/* Compute position factors.
|
||||
*/
|
||||
off_p = 2;
|
||||
b_delta = (100 - off_p) / count;
|
||||
l_p = (100 - (count * b_delta) + off_p) / 2;
|
||||
r_p = l_p + b_delta - off_p;
|
||||
/* s_t = Max (2, s_t); */
|
||||
|
||||
/* Create buttons.
|
||||
*/
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
ac = 0;
|
||||
XtSetArg (al[ac], XmNdefaultButtonShadowThickness,Max(2U,s_t)/2U);
|
||||
ac++;
|
||||
XtSetArg (al[ac], XmNshadowThickness, s_t); ac++;
|
||||
XtSetArg (al[ac], XmNhighlightThickness, s_t); ac++;
|
||||
if (!min_btns)
|
||||
{
|
||||
XtSetArg (al[ac], XmNleftAttachment,
|
||||
XmATTACH_POSITION); ac++;
|
||||
XtSetArg (al[ac], XmNleftPosition, l_p); ac++;
|
||||
XtSetArg (al[ac], XmNleftOffset, offset); ac++;
|
||||
XtSetArg (al[ac], XmNrightAttachment,
|
||||
XmATTACH_POSITION); ac++;
|
||||
XtSetArg (al[ac], XmNrightPosition, r_p); ac++;
|
||||
XtSetArg (al[ac], XmNrightOffset, offset); ac++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
XtSetArg (al[ac], XmNleftAttachment,
|
||||
XmATTACH_FORM); ac++;
|
||||
XtSetArg (al[ac], XmNleftOffset, OFFSET); ac++;
|
||||
}
|
||||
else if (i == count -1)
|
||||
{
|
||||
XtSetArg (al[ac], XmNrightAttachment,
|
||||
XmATTACH_FORM); ac++;
|
||||
XtSetArg (al[ac], XmNrightOffset, OFFSET); ac++;
|
||||
}
|
||||
else
|
||||
{
|
||||
XtSetArg (al[ac], XmNleftAttachment,
|
||||
XmATTACH_WIDGET); ac++;
|
||||
XtSetArg (al[ac], XmNleftWidget, button[i-1]);
|
||||
ac++;
|
||||
XtSetArg (al[ac], XmNleftOffset, OFFSET);
|
||||
ac++;
|
||||
}
|
||||
}
|
||||
|
||||
XtSetArg (al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg (al[ac], XmNbottomOffset, OFFSET + offset); ac++;
|
||||
if (string)
|
||||
{
|
||||
XtSetArg (al[ac], XmNlabelString, string[i]); ac++;
|
||||
}
|
||||
XtSetArg (al[ac], XmNchildType, XmBUTTON); ac++;
|
||||
sprintf (button_name, "%s_%d\0", M_Name (new), i+1);
|
||||
btn = XmCreatePushButtonGadget ((Widget)new, button_name, al, ac);
|
||||
XtManageChild (btn);
|
||||
XtAddCallback (btn, XmNactivateCallback,
|
||||
(XtCallbackProc)ButtonCallback,
|
||||
(XtPointer)(i+1));
|
||||
|
||||
button[i] = btn;
|
||||
l_p += b_delta;
|
||||
r_p += b_delta;
|
||||
|
||||
}
|
||||
ref_widget = button[0];
|
||||
new->bulletin_board.default_button = button[0];
|
||||
|
||||
/* Create Separator
|
||||
*/
|
||||
ac = 0;
|
||||
XtSetArg (al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg (al[ac], XmNleftOffset, 0); ac++;
|
||||
XtSetArg (al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg (al[ac], XmNrightOffset, 0); ac++;
|
||||
XtSetArg (al[ac], XmNbottomAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg (al[ac], XmNbottomWidget, ref_widget); ac++;
|
||||
XtSetArg (al[ac], XmNbottomOffset, OFFSET); ac++;
|
||||
XtSetArg (al[ac], XmNhighlightThickness, 0); ac++;
|
||||
XtSetArg (al[ac], XmNchildType, XmSEPARATOR); ac++;
|
||||
sep = XmCreateSeparatorGadget ((Widget)new, "separator", al, ac);
|
||||
XtManageChild (sep);
|
||||
M_Separator (new) = sep;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** ButtonCallback
|
||||
*/
|
||||
static void
|
||||
ButtonCallback(
|
||||
Widget g,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
DtDialogBoxWidget mgr = (DtDialogBoxWidget) XtParent (g);
|
||||
XtCallbackList cb_list = M_Callback (mgr);
|
||||
XmAnyCallbackStruct * b_cb_data =
|
||||
(XmAnyCallbackStruct *) call_data;
|
||||
DtDialogBoxCallbackStruct cb_data;
|
||||
|
||||
if (cb_list != NULL)
|
||||
{
|
||||
cb_data.reason = XmCR_DIALOG_BUTTON;
|
||||
cb_data.event = b_cb_data->event;
|
||||
cb_data.button_position = (int) client_data;
|
||||
cb_data.button = g;
|
||||
XtCallCallbackList ((Widget) mgr, cb_list, &cb_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Public Entry Points
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** _DtCreateDialogBox
|
||||
** Create a new DtDialogBox instance.
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
Widget
|
||||
_DtCreateDialogBox(
|
||||
Widget parent,
|
||||
char *name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount )
|
||||
{
|
||||
return (XtCreateWidget (name, dtDialogBoxWidgetClass,
|
||||
parent, arglist, argcount));
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** __DtCreateDialogBoxDialog
|
||||
** Create a DialogShell and a new DialogBox instance;
|
||||
** return the DialogBox widget;
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
Widget
|
||||
__DtCreateDialogBoxDialog(
|
||||
Widget ds_p,
|
||||
String name,
|
||||
ArgList db_args,
|
||||
Cardinal db_n )
|
||||
{
|
||||
Widget ds; /* DialogShell */
|
||||
Arg ds_args[10]; /* arglist for shell */
|
||||
Cardinal ds_n; /* argcount for shell */
|
||||
Widget db; /* new sb widget */
|
||||
|
||||
|
||||
/* create DialogShell parent
|
||||
*/
|
||||
ds_n = 0;
|
||||
XtSetArg (ds_args[ds_n], XmNallowShellResize, True); ds_n++;
|
||||
ds = XtCreatePopupShell (name, xmDialogShellWidgetClass,
|
||||
ds_p, ds_args, ds_n);
|
||||
|
||||
/* create DialogBox, free args, return
|
||||
*/
|
||||
db = XtCreateWidget (name, dtDialogBoxWidgetClass,
|
||||
ds, db_args, db_n);
|
||||
|
||||
return (db);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** _DtDialogBoxGetButton
|
||||
** Return DialogBox button.
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
Widget
|
||||
_DtDialogBoxGetButton(
|
||||
Widget w,
|
||||
Cardinal pos )
|
||||
{
|
||||
DtDialogBoxWidget mgr = (DtDialogBoxWidget) w;
|
||||
int index = pos - 1;
|
||||
Widget * button = M_Button (mgr);
|
||||
Widget rtn_w = NULL;
|
||||
|
||||
|
||||
if (index >= M_ButtonCount (mgr))
|
||||
XmeWarning ((Widget)mgr, WARN_BUTTON_CHILD);
|
||||
else
|
||||
rtn_w = button[index];
|
||||
|
||||
return (rtn_w);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** _DtDialogBoxGetWorkArea
|
||||
** Return DialogBox work area;
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
Widget
|
||||
_DtDialogBoxGetWorkArea(
|
||||
Widget w )
|
||||
{
|
||||
DtDialogBoxWidget mgr = (DtDialogBoxWidget) w;
|
||||
Widget rtn_w = M_WorkArea (mgr);
|
||||
|
||||
return (rtn_w);
|
||||
}
|
||||
|
||||
|
||||
66
cde/lib/DtWidget/DialogBox.h
Normal file
66
cde/lib/DtWidget/DialogBox.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/* $XConsortium: DialogBox.h /main/4 1995/10/26 09:30:36 rswiston $ */
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: DialogBox.h
|
||||
***
|
||||
*** project: MotifPlus Widgets
|
||||
***
|
||||
*** description: Public include file for DtDialogBox class.
|
||||
***
|
||||
***
|
||||
*** (c) Copyright 1990 by Hewlett-Packard Company.
|
||||
***
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _DtDialogBox_h
|
||||
#define _DtDialogBox_h
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Dt/DtStrDefs.h>
|
||||
|
||||
#ifndef DtIsDialogBox
|
||||
#define DtIsDialogBox(w) XtIsSubclass(w, dtDialogBoxWidgetClass)
|
||||
#endif /* XmIsDialogBox */
|
||||
|
||||
|
||||
extern Widget _DtCreateDialogBox(
|
||||
Widget parent,
|
||||
char *name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount) ;
|
||||
extern Widget __DtCreateDialogBoxDialog(
|
||||
Widget ds_p,
|
||||
String name,
|
||||
ArgList db_args,
|
||||
Cardinal db_n) ;
|
||||
extern Widget _DtDialogBoxGetButton(
|
||||
Widget w,
|
||||
Cardinal pos) ;
|
||||
extern Widget _DtDialogBoxGetWorkArea(
|
||||
Widget w) ;
|
||||
|
||||
|
||||
extern WidgetClass dtDialogBoxWidgetClass;
|
||||
|
||||
typedef struct _DtDialogBoxClassRec * DtDialogBoxWidgetClass;
|
||||
typedef struct _DtDialogBoxRec * DtDialogBoxWidget;
|
||||
|
||||
|
||||
#define XmBUTTON 11
|
||||
|
||||
|
||||
#define XmCR_DIALOG_BUTTON 100
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int reason;
|
||||
XEvent * event;
|
||||
Cardinal button_position;
|
||||
Widget button;
|
||||
} DtDialogBoxCallbackStruct;
|
||||
|
||||
|
||||
#endif /* _DtDialogBox_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
147
cde/lib/DtWidget/DialogBoxP.h
Normal file
147
cde/lib/DtWidget/DialogBoxP.h
Normal file
@@ -0,0 +1,147 @@
|
||||
/* $XConsortium: DialogBoxP.h /main/5 1996/03/27 20:16:24 drk $ */
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: DialogBoxP.h
|
||||
***
|
||||
*** project: Motif Widgets
|
||||
***
|
||||
*** description: Private include file for DtDialogBox class.
|
||||
***
|
||||
***
|
||||
*** (c) Copyright 1990 by Hewlett-Packard Company.
|
||||
***
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _DtDialogBoxP_h
|
||||
#define _DtDialogBoxP_h
|
||||
|
||||
#include <Xm/XmP.h>
|
||||
#include <Xm/BulletinBP.h>
|
||||
#include <Xm/FormP.h>
|
||||
#include <Dt/DialogBox.h>
|
||||
|
||||
typedef void (*DlgGetSizeProc)(
|
||||
Widget,
|
||||
Dimension,
|
||||
Dimension,
|
||||
Dimension,
|
||||
Dimension,
|
||||
Dimension *,
|
||||
Dimension *
|
||||
);
|
||||
/*-------------------------------------------------------------
|
||||
** Class Structure
|
||||
*/
|
||||
|
||||
/* Class Part
|
||||
*/
|
||||
typedef struct _DtDialogBoxClassPart
|
||||
{
|
||||
XtWidgetProc create_children;
|
||||
XtWidgetProc configure_children;
|
||||
DlgGetSizeProc get_size;
|
||||
XtCallbackProc button_callback;
|
||||
caddr_t extension;
|
||||
} DtDialogBoxClassPart;
|
||||
|
||||
/* Full Class Record
|
||||
*/
|
||||
typedef struct _DtDialogBoxClassRec
|
||||
{
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
XmBulletinBoardClassPart bulletin_board_class;
|
||||
XmFormClassPart form_class;
|
||||
DtDialogBoxClassPart dialog_box_class;
|
||||
} DtDialogBoxClassRec;
|
||||
|
||||
/* Actual Class
|
||||
*/
|
||||
extern DtDialogBoxClassRec dtDialogBoxClassRec;
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Instance Structure
|
||||
*/
|
||||
|
||||
/* Instance Part
|
||||
*/
|
||||
typedef struct _DtDialogBoxPart
|
||||
{
|
||||
XtCallbackList callback;
|
||||
Widget work_area;
|
||||
Widget separator;
|
||||
WidgetList button;
|
||||
Cardinal button_count;
|
||||
Boolean minimize_buttons;
|
||||
XmStringTable button_label_strings;
|
||||
} DtDialogBoxPart;
|
||||
|
||||
/* Full Instance Record
|
||||
*/
|
||||
typedef struct _DtDialogBoxRec
|
||||
{
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
XmBulletinBoardPart bulletin_board;
|
||||
XmFormPart form;
|
||||
DtDialogBoxPart dialog_box;
|
||||
} DtDialogBoxRec;
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Constraint Structure
|
||||
*/
|
||||
|
||||
/* Constraint Part
|
||||
*/
|
||||
typedef struct _DtDialogBoxConstraintPart
|
||||
{
|
||||
unsigned char child_type;
|
||||
} DtDialogBoxConstraintPart, * DtDialogBoxConstraint;
|
||||
|
||||
/* Full Constraint Record
|
||||
*/
|
||||
typedef struct _DtDialogBoxConstraintRec
|
||||
{
|
||||
XmManagerConstraintPart manager_constraint;
|
||||
XmFormConstraintPart form_constraint;
|
||||
DtDialogBoxConstraintPart dialog_box_constraint;
|
||||
} DtDialogBoxConstraintRec, * DtDialogBoxConstraintPtr;
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Class and Instance Macros
|
||||
*/
|
||||
|
||||
/* DtDialogBox Class Macros
|
||||
*/
|
||||
/**** WARNING: These macros are not thread-safe! ****/
|
||||
#define C_CreateChildren(mc) ((mc) -> dialog_box_class.create_children)
|
||||
#define C_ConfigureChildren(mc) ((mc) -> dialog_box_class.configure_children)
|
||||
#define C_GetSize(mc) ((mc) -> dialog_box_class.get_size)
|
||||
#define C_ButtonCallback(mc) ((mc) -> dialog_box_class.button_callback)
|
||||
|
||||
/* DtDialogBox Instance Macros
|
||||
*/
|
||||
#define M_DialogBoxConstraint(w) \
|
||||
(&((DtDialogBoxConstraintPtr) (w)->core.constraints) \
|
||||
-> dialog_box_constraint)
|
||||
#define M_WorkArea(m) (m -> dialog_box.work_area)
|
||||
#define M_Separator(m) (m -> dialog_box.separator)
|
||||
#define M_MinimizeButtons(m) (m -> dialog_box.minimize_buttons)
|
||||
#define M_Button(m) (m -> dialog_box.button)
|
||||
#define M_ButtonCount(m) (m -> dialog_box.button_count)
|
||||
#define M_ButtonLabelStrings(m) (m -> dialog_box.button_label_strings)
|
||||
#define M_Callback(m) (m -> dialog_box.callback)
|
||||
|
||||
#endif /* _DtDialogBoxP_h */
|
||||
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
334
cde/lib/DtWidget/DtMsgs.c
Normal file
334
cde/lib/DtWidget/DtMsgs.c
Normal file
@@ -0,0 +1,334 @@
|
||||
/* $XConsortium: DtMsgs.c /main/7 1996/06/19 11:27:11 cde-dec $ */
|
||||
/*
|
||||
* DtWidget/DtMsgs.c
|
||||
*/
|
||||
/*** const causes the HP compiler to complain. Remove reference until ***
|
||||
*** the build and integration people can figure out how to get this to ***
|
||||
*** work. ***/
|
||||
/* #define CONST const */
|
||||
#define CONST
|
||||
|
||||
#ifdef I18N_MSG
|
||||
|
||||
#include <nl_types.h>
|
||||
|
||||
#if !defined(NL_CAT_LOCALE)
|
||||
#define NL_CAT_LOCALE 0
|
||||
#endif
|
||||
|
||||
#define _DTWIDGET_CAT_NAME "DtWidget"
|
||||
|
||||
#endif /* I18N_MSG */
|
||||
|
||||
#include <DtWidgetI.h>
|
||||
|
||||
/*** Common messages across libDtWidget ***/
|
||||
CONST char _DtMsgCommon_0000[] =
|
||||
"Close";
|
||||
CONST char _DtMsgCommon_0001[] =
|
||||
"Help";
|
||||
|
||||
/*** ComboBox.c ***/
|
||||
CONST char _DtMsgComboBox_0000[] =
|
||||
"DtComboBoxWidget: Invalid alignment resource (defaulting to DtALIGNMENT_CENTER).";
|
||||
|
||||
CONST char _DtMsgComboBox_0001[] =
|
||||
"DtComboBoxWidget: Invalid marginHeight resource (defaulting to 2).";
|
||||
|
||||
CONST char _DtMsgComboBox_0002[] =
|
||||
"DtComboBoxWidget: Invalid marginWidth resource (defaulting to 2).";
|
||||
|
||||
CONST char _DtMsgComboBox_0003[] =
|
||||
"DtComboBoxWidget: Invalid horizontalSpacing resource (defaulting to 0).";
|
||||
|
||||
CONST char _DtMsgComboBox_0004[] =
|
||||
"DtComboBoxWidget: Invalid verticalSpacing resource (defaulting to 0).";
|
||||
|
||||
CONST char _DtMsgComboBox_0005[] =
|
||||
"DtComboBoxWidget: Invalid orientation resource (defaulting to DtRIGHT).";
|
||||
|
||||
CONST char _DtMsgComboBox_0006[] =
|
||||
"DtComboBoxWidget: Invalid itemCount resource (defaulting to 0).";
|
||||
|
||||
CONST char _DtMsgComboBox_0007[] =
|
||||
"DtComboBoxWidget: Invalid selectedPosition resource (defaulting to 0).";
|
||||
|
||||
CONST char _DtMsgComboBox_0008[] =
|
||||
"DtComboBoxWidget: Unable to set textField resource.";
|
||||
|
||||
CONST char _DtMsgComboBox_0009[] =
|
||||
"DtComboBoxWidget: Unable to find item to set (DtComboBoxSetItem).";
|
||||
|
||||
CONST char _DtMsgComboBox_0010[] =
|
||||
"DtComboBoxWidget: Unable to find item to select (DtComboBoxSelectItem).";
|
||||
|
||||
CONST char _DtMsgComboBox_0011[] =
|
||||
"Resizing failed. Maybe longest item is wider than space allowed.";
|
||||
|
||||
CONST char _DtMsgComboBox_0012[] =
|
||||
"ComboBox";
|
||||
|
||||
CONST char _DtMsgComboBox_0013[] =
|
||||
"cvtStringToType: wrongParameters, String to XmRType conversion needs no extra arguments";
|
||||
|
||||
CONST char _DtMsgComboBox_0014[] =
|
||||
"DtComboBoxDeletePos: wrongParameters, Invalid position value";
|
||||
|
||||
/*** DialogBox.c TitleBox.c ***/
|
||||
CONST char _DtMsgDialogBox_0000[] =
|
||||
"Incorrect child type.";
|
||||
|
||||
|
||||
/*** DialogBox.c ***/
|
||||
CONST char _DtMsgDialogBox_0001[] =
|
||||
"Invalid button position.";
|
||||
|
||||
|
||||
/*** Editor.c & SearchDlg.c ***/
|
||||
/* Default value for DtNformatSettingsDialogTitle */
|
||||
CONST char _DtMsgEditor_0000[] =
|
||||
"Format Settings";
|
||||
|
||||
/* Default values for DtNleftMarginFieldLabel and DtNrightMarginFieldLabel */
|
||||
CONST char _DtMsgEditor_0001[] =
|
||||
"Right Margin:";
|
||||
|
||||
CONST char _DtMsgEditor_0002[] =
|
||||
"Left Margin:";
|
||||
|
||||
/* Default values for DtNleftAlignToggleLabel, DtNrightAlignToggleLabel, */
|
||||
/* DtNjustifyToggleLabel, and DtNcenterToggleLabel */
|
||||
CONST char _DtMsgEditor_0003[] =
|
||||
"Left Align";
|
||||
|
||||
CONST char _DtMsgEditor_0004[] =
|
||||
"Right Align";
|
||||
|
||||
CONST char _DtMsgEditor_0005[] =
|
||||
"Justify";
|
||||
|
||||
CONST char _DtMsgEditor_0006[] =
|
||||
"Center";
|
||||
|
||||
/* Default values for DtNformatParagraphButtonLabel and */
|
||||
/* DtNformatAllButtonLabel */
|
||||
CONST char _DtMsgEditor_0007[] =
|
||||
"Paragraph";
|
||||
|
||||
CONST char _DtMsgEditor_0008[] =
|
||||
"All";
|
||||
|
||||
/* Default value for DtNspellDialogTitle resource */
|
||||
CONST char _DtMsgEditor_0009[] =
|
||||
"Spell";
|
||||
|
||||
/* Default value for DtNfindChangeDialogTitle resource */
|
||||
CONST char _DtMsgEditor_0010[] =
|
||||
"Find/Change";
|
||||
|
||||
/* Default value for DtNmisspelledListLabel resource */
|
||||
CONST char _DtMsgEditor_0011[] =
|
||||
"Misspelled Words:";
|
||||
|
||||
/* Default value for DtNfindFieldLabel resource */
|
||||
CONST char _DtMsgEditor_0012[] =
|
||||
"Find:";
|
||||
|
||||
/* Default value for DtNchangeFieldLabel resource */
|
||||
CONST char _DtMsgEditor_0013[] =
|
||||
"Change To:";
|
||||
|
||||
/* Default value for DtNfindButtonLabel, DtNchangeButtonLabel, and */
|
||||
/* DtNchangeAllButtonLabel resources */
|
||||
CONST char _DtMsgEditor_0014[] =
|
||||
"Find";
|
||||
|
||||
CONST char _DtMsgEditor_0015[] =
|
||||
"Change";
|
||||
|
||||
CONST char _DtMsgEditor_0016[] =
|
||||
"Change All";
|
||||
|
||||
/* 'Unable to locate word' message */
|
||||
CONST char _DtMsgEditor_0017[] =
|
||||
"Unable to find the string %s in the current document.";
|
||||
|
||||
/* Default value for DtNinformationDialogTitle resource */
|
||||
CONST char _DtMsgEditor_0018[] =
|
||||
"Information";
|
||||
|
||||
/* Default values for DtNcurrentLineLabel, DtNtotalLineCountLabel,
|
||||
* DtNoverstrikeLabel, and DtNinsertLabel resources */
|
||||
CONST char _DtMsgEditor_0019[] =
|
||||
"Line:";
|
||||
|
||||
CONST char _DtMsgEditor_0020[] =
|
||||
"Total:";
|
||||
|
||||
CONST char _DtMsgEditor_0021[] =
|
||||
"Overstrike";
|
||||
|
||||
CONST char _DtMsgEditor_0022[] =
|
||||
" ";
|
||||
|
||||
/* Default values for messages and title when spell filter is
|
||||
* not executable or not found */
|
||||
CONST char _DtMsgEditor_0023[] =
|
||||
"Error executing spell filter.";
|
||||
|
||||
CONST char _DtMsgEditor_0024[] =
|
||||
"Check to see if filter, %s, is installed and in the path.";
|
||||
|
||||
CONST char _DtMsgEditor_0025[] =
|
||||
"Editor Error";
|
||||
|
||||
|
||||
|
||||
/*** Icon.c ***/
|
||||
CONST char _DtMsgIcon_0000[] =
|
||||
"Incorrect alignment.";
|
||||
|
||||
CONST char _DtMsgIcon_0001[] =
|
||||
"Incorrect behavior.";
|
||||
|
||||
CONST char _DtMsgIcon_0002[] =
|
||||
"Incorrect fill mode.";
|
||||
|
||||
CONST char _DtMsgIcon_0003[] =
|
||||
"Incorrect string or pixmap position.";
|
||||
|
||||
CONST char _DtMsgIcon_0004[] =
|
||||
"Incorrect margin width or height.";
|
||||
|
||||
|
||||
/*** Icon.c TitleBox.c ***/
|
||||
CONST char _DtMsgIcon_0005[] =
|
||||
"Incorrect shadow type.";
|
||||
|
||||
|
||||
/*** Indicator.c ***/
|
||||
#ifdef _SUN_OS
|
||||
CONST char _DtMsgIndicator_0000[] =
|
||||
"/usr/spool/mail/";
|
||||
#else
|
||||
CONST char _DtMsgIndicator_0000[] =
|
||||
"/usr/mail/";
|
||||
#endif
|
||||
|
||||
/*** MenuButton.c ***/
|
||||
CONST char _DtMsgMenuButton_0000[] =
|
||||
"XmNmenuPost has illegal value.";
|
||||
|
||||
CONST char _DtMsgMenuButton_0001[] =
|
||||
"DtMenuButtonWidget: Invalid Parent.";
|
||||
|
||||
CONST char _DtMsgMenuButton_0002[] =
|
||||
"DtMenuButtonWidget: Invalid Submenu.";
|
||||
|
||||
/*** SpinBox.c ***/
|
||||
CONST char _DtMsgSpinBox_0000[] =
|
||||
"DtSpinBoxWidget: Invalid arrowSensitivity resource (defaulting to DtARROWS_SENSITIVE).";
|
||||
|
||||
CONST char _DtMsgSpinBox_0001[] =
|
||||
"DtSpinBoxWidget: Invalid alignment resource (defaulting to DtALIGNMENT_CENTER).";
|
||||
|
||||
CONST char _DtMsgSpinBox_0002[] =
|
||||
"DtSpinBoxWidget: Invalid initialDelay resource (defaulting to 250).";
|
||||
|
||||
CONST char _DtMsgSpinBox_0003[] =
|
||||
"DtSpinBoxWidget: Invalid marginHeight resource (defaulting to 2).";
|
||||
|
||||
CONST char _DtMsgSpinBox_0004[] =
|
||||
"DtSpinBoxWidget: Invalid marginWidth resource (defaulting to 2).";
|
||||
|
||||
CONST char _DtMsgSpinBox_0005[] =
|
||||
"DtSpinBoxWidget: Invalid arrowLayout resource (defaulting to DtARROWS_BEGINNING).";
|
||||
|
||||
CONST char _DtMsgSpinBox_0006[] =
|
||||
"DtSpinBoxWidget: Invalid repeatDelay resource (defaulting to 200).";
|
||||
|
||||
CONST char _DtMsgSpinBox_0007[] =
|
||||
"DtSpinBoxWidget: Invalid itemCount resource (defaulting to 0).";
|
||||
|
||||
CONST char _DtMsgSpinBox_0008[] =
|
||||
"DtSpinBoxWidget: Invalid position resource (defaulting to 0).";
|
||||
|
||||
CONST char _DtMsgSpinBox_0009[] =
|
||||
"DtSpinBoxWidget: Invalid position resource (defaulting to minimum).";
|
||||
|
||||
CONST char _DtMsgSpinBox_0010[] =
|
||||
"DtSpinBoxWidget: Invalid decimalPoints resource (defaulting to 0).";
|
||||
|
||||
CONST char _DtMsgSpinBox_0011[] =
|
||||
"DtSpinBoxWidget: Invalid minimum resource (defaulting to maximum).";
|
||||
|
||||
CONST char _DtMsgSpinBox_0012[] =
|
||||
"DtSpinBoxWidget: Unable to set textField resource.";
|
||||
|
||||
CONST char _DtMsgSpinBox_0013[] =
|
||||
"DtSpinBoxWidget: Unable to find item to set (DtSpinBoxSetItem).";
|
||||
|
||||
CONST char _DtMsgSpinBox_0014[] =
|
||||
"SpinBox";
|
||||
|
||||
/*** TitleBox.c ***/
|
||||
CONST char _DtMsgTitleBox_0000[] =
|
||||
"Incorrect title position.";
|
||||
|
||||
CONST char _DtMsgTitleBox_0001[] =
|
||||
"Incorrect title alignment.";
|
||||
|
||||
CONST char _DtMsgTitleBox_0002[] =
|
||||
"Only one child should be inserted in a frame.";
|
||||
|
||||
CONST char _DtMsgTitleBox_0003[] =
|
||||
"Invalid margin width.";
|
||||
|
||||
CONST char _DtMsgTitleBox_0004[] =
|
||||
"Invalid margin height.";
|
||||
|
||||
#ifdef I18N_MSG
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Function: _DtWidgetGetMessage
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* int set - The message catalog set number.
|
||||
*
|
||||
* int n - The message number.
|
||||
*
|
||||
* char *s - The default message if the message is not
|
||||
* retrieved from a message catalog.
|
||||
*
|
||||
* Returns: the string for set 'set' and number 'n'.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
char *
|
||||
_DtWidgetGetMessage(int set,
|
||||
int n,
|
||||
char *s)
|
||||
{
|
||||
char *msg;
|
||||
nl_catd catopen();
|
||||
char *catgets();
|
||||
static int first = 1;
|
||||
static nl_catd nlmsg_fd;
|
||||
|
||||
if ( first )
|
||||
{
|
||||
_DtProcessLock();
|
||||
if ( first)
|
||||
{
|
||||
nlmsg_fd = catopen(_DTWIDGET_CAT_NAME, NL_CAT_LOCALE);
|
||||
first = 0;
|
||||
}
|
||||
_DtProcessUnlock();
|
||||
}
|
||||
|
||||
msg=catgets(nlmsg_fd,set,n,s);
|
||||
return (msg);
|
||||
}
|
||||
#endif /* I18N_MSG */
|
||||
210
cde/lib/DtWidget/DtMsgsP.h
Normal file
210
cde/lib/DtWidget/DtMsgsP.h
Normal file
@@ -0,0 +1,210 @@
|
||||
/* $XConsortium: DtMsgsP.h /main/7 1996/06/19 11:27:42 cde-dec $ */
|
||||
/*
|
||||
* DtWidget/DtMsgsP.h
|
||||
*/
|
||||
/*
|
||||
* DtMsgsP.h:
|
||||
*
|
||||
* Private header file for libDtWidget
|
||||
*/
|
||||
#ifndef _DtMessages_h
|
||||
#define _DtMessages_h
|
||||
|
||||
/*** const causes the HP compiler to complain. Remove reference until ***
|
||||
*** the build and integration people can figure out how to get this to ***
|
||||
*** work. ***/
|
||||
|
||||
/* #define CONST const */
|
||||
#define CONST
|
||||
|
||||
#ifdef I18N_MSG
|
||||
#include <nl_types.h>
|
||||
#define DTWIDGET_GETMESSAGE(set, number, string)\
|
||||
(char *) _DtWidgetGetMessage(set, number, string)
|
||||
|
||||
#else /* I18N_MSG */
|
||||
#define DTWIDGET_GETMESSAGE(set, number, string) string
|
||||
#endif /* I18N_MSG */
|
||||
|
||||
extern CONST char _DtMsgCommon_0000[];
|
||||
extern CONST char _DtMsgCommon_0001[];
|
||||
extern CONST char _DtMsgComboBox_0000[];
|
||||
extern CONST char _DtMsgComboBox_0001[];
|
||||
extern CONST char _DtMsgComboBox_0002[];
|
||||
extern CONST char _DtMsgComboBox_0003[];
|
||||
extern CONST char _DtMsgComboBox_0004[];
|
||||
extern CONST char _DtMsgComboBox_0005[];
|
||||
extern CONST char _DtMsgComboBox_0006[];
|
||||
extern CONST char _DtMsgComboBox_0007[];
|
||||
extern CONST char _DtMsgComboBox_0008[];
|
||||
extern CONST char _DtMsgComboBox_0009[];
|
||||
extern CONST char _DtMsgComboBox_0010[];
|
||||
extern CONST char _DtMsgComboBox_0011[];
|
||||
extern CONST char _DtMsgComboBox_0012[];
|
||||
extern CONST char _DtMsgComboBox_0013[];
|
||||
extern CONST char _DtMsgComboBox_0014[];
|
||||
extern CONST char _DtMsgDialogBox_0000[];
|
||||
extern CONST char _DtMsgDialogBox_0001[];
|
||||
extern CONST char _DtMsgEditor_0000[];
|
||||
extern CONST char _DtMsgEditor_0001[];
|
||||
extern CONST char _DtMsgEditor_0002[];
|
||||
extern CONST char _DtMsgEditor_0003[];
|
||||
extern CONST char _DtMsgEditor_0004[];
|
||||
extern CONST char _DtMsgEditor_0005[];
|
||||
extern CONST char _DtMsgEditor_0006[];
|
||||
extern CONST char _DtMsgEditor_0007[];
|
||||
extern CONST char _DtMsgEditor_0008[];
|
||||
extern CONST char _DtMsgEditor_0009[];
|
||||
extern CONST char _DtMsgEditor_0010[];
|
||||
extern CONST char _DtMsgEditor_0011[];
|
||||
extern CONST char _DtMsgEditor_0012[];
|
||||
extern CONST char _DtMsgEditor_0013[];
|
||||
extern CONST char _DtMsgEditor_0014[];
|
||||
extern CONST char _DtMsgEditor_0015[];
|
||||
extern CONST char _DtMsgEditor_0016[];
|
||||
extern CONST char _DtMsgEditor_0017[];
|
||||
extern CONST char _DtMsgEditor_0018[];
|
||||
extern CONST char _DtMsgEditor_0019[];
|
||||
extern CONST char _DtMsgEditor_0020[];
|
||||
extern CONST char _DtMsgEditor_0021[];
|
||||
extern CONST char _DtMsgEditor_0022[];
|
||||
extern CONST char _DtMsgEditor_0023[];
|
||||
extern CONST char _DtMsgEditor_0024[];
|
||||
extern CONST char _DtMsgEditor_0025[];
|
||||
extern CONST char _DtMsgIcon_0000[];
|
||||
extern CONST char _DtMsgIcon_0001[];
|
||||
extern CONST char _DtMsgIcon_0002[];
|
||||
extern CONST char _DtMsgIcon_0003[];
|
||||
extern CONST char _DtMsgIcon_0004[];
|
||||
extern CONST char _DtMsgIcon_0005[];
|
||||
extern CONST char _DtMsgIndicator_0000[];
|
||||
extern CONST char _DtMsgMenuButton_0000[];
|
||||
extern CONST char _DtMsgMenuButton_0001[];
|
||||
extern CONST char _DtMsgMenuButton_0002[];
|
||||
extern CONST char _DtMsgSpinBox_0000[];
|
||||
extern CONST char _DtMsgSpinBox_0001[];
|
||||
extern CONST char _DtMsgSpinBox_0002[];
|
||||
extern CONST char _DtMsgSpinBox_0003[];
|
||||
extern CONST char _DtMsgSpinBox_0004[];
|
||||
extern CONST char _DtMsgSpinBox_0005[];
|
||||
extern CONST char _DtMsgSpinBox_0006[];
|
||||
extern CONST char _DtMsgSpinBox_0007[];
|
||||
extern CONST char _DtMsgSpinBox_0008[];
|
||||
extern CONST char _DtMsgSpinBox_0009[];
|
||||
extern CONST char _DtMsgSpinBox_0010[];
|
||||
extern CONST char _DtMsgSpinBox_0011[];
|
||||
extern CONST char _DtMsgSpinBox_0012[];
|
||||
extern CONST char _DtMsgSpinBox_0013[];
|
||||
extern CONST char _DtMsgSpinBox_0014[];
|
||||
extern CONST char _DtMsgTitleBox_0000[];
|
||||
extern CONST char _DtMsgTitleBox_0001[];
|
||||
extern CONST char _DtMsgTitleBox_0002[];
|
||||
extern CONST char _DtMsgTitleBox_0003[];
|
||||
extern CONST char _DtMsgTitleBox_0004[];
|
||||
|
||||
#ifdef I18N_MSG
|
||||
|
||||
/*
|
||||
* Message set for shared messages
|
||||
*/
|
||||
#define MS_Common 2
|
||||
|
||||
/* Message IDs for shared messages */
|
||||
#define MSG_CLOSE 1
|
||||
#define MSG_HELP 2
|
||||
|
||||
/*
|
||||
* Message set for Editor widget
|
||||
*/
|
||||
#define MS_Editor 3
|
||||
|
||||
/* Message IDs for Editor */
|
||||
#define EDITOR_FORMAT_SETTINGS 1
|
||||
#define EDITOR_RIGHT_MARGIN 2
|
||||
#define EDITOR_LEFT_MARGIN 3
|
||||
#define EDITOR_LEFT_ALIGN 4
|
||||
#define EDITOR_RIGHT_ALIGN 5
|
||||
#define EDITOR_JUSTIFY 6
|
||||
#define EDITOR_CENTER 7
|
||||
#define EDITOR_PARAGRAPH 8
|
||||
#define EDITOR_ALL 9
|
||||
#define EDITOR_SPELL_TITLE 20
|
||||
#define EDITOR_FIND_TITLE 21
|
||||
#define EDITOR_MISSPELLED 22
|
||||
#define EDITOR_FIND_LABEL 23
|
||||
#define EDITOR_CHANGE_LABEL 24
|
||||
#define EDITOR_FIND_BUTTON 25
|
||||
#define EDITOR_CHANGE_BUTTON 26
|
||||
#define EDITOR_CHNG_ALL_BUTTON 27
|
||||
#define EDITOR_NO_FIND 30
|
||||
#define EDITOR_INFO_TITLE 31
|
||||
#define EDITOR_LINE 40
|
||||
#define EDITOR_TOTAL 41
|
||||
#define EDITOR_OVR 42
|
||||
#define EDITOR_INS 43
|
||||
#define EDITOR_FILTER_ERROR 50
|
||||
#define EDITOR_FILTER_ERROR2 51
|
||||
#define EDITOR_ERROR_TITLE 52
|
||||
|
||||
/*
|
||||
* Message set for MenuButton widget
|
||||
*/
|
||||
#define MS_MenuButton 4
|
||||
|
||||
/* Message IDs for MenuButton*/
|
||||
#define MENU_POST 1
|
||||
#define MENU_PARENT 2
|
||||
#define MENU_SUBMENU 3
|
||||
|
||||
/*
|
||||
* Message set for ComboBox widget
|
||||
*/
|
||||
#define MS_ComboBox 5
|
||||
|
||||
/* Message IDs for ComboBox */
|
||||
#define COMBO_ALIGNMENT 1
|
||||
#define COMBO_MARGIN_HEIGHT 2
|
||||
#define COMBO_MARGIN_WIDTH 3
|
||||
#define COMBO_HORIZONTAL_SPACING 4
|
||||
#define COMBO_VERTICAL_SPACING 5
|
||||
#define COMBO_ORIENTATION 6
|
||||
#define COMBO_ITEM_COUNT 7
|
||||
#define COMBO_VISIBLE_ITEM 8
|
||||
#define COMBO_TEXT 9
|
||||
#define COMBO_SET_ITEM 10
|
||||
#define COMBO_SELECT_ITEM 11
|
||||
#define COMBO_RESIZE 12
|
||||
#define COMBO_LABEL 13
|
||||
#define COMBO_CVTSTRING 14
|
||||
#define COMBO_DEL_POS 15
|
||||
|
||||
/*
|
||||
* Message set for SpinBox widget
|
||||
*/
|
||||
#define MS_SpinBox 6
|
||||
|
||||
/* Message IDs for SpinBox */
|
||||
#define SPIN_ARROW_SENSITIVE 1
|
||||
#define SPIN_ALIGNMENT 2
|
||||
#define SPIN_INIT_DELAY 3
|
||||
#define SPIN_MARGIN_HEIGHT 4
|
||||
#define SPIN_MARGIN_WIDTH 5
|
||||
#define SPIN_ARROW_LAYOUT 6
|
||||
#define SPIN_REPEAT_DELAY 7
|
||||
#define SPIN_ITEM_COUNT 8
|
||||
#define SPIN_POSITION_STRING 9
|
||||
#define SPIN_POSITION_NUMERIC 10
|
||||
#define SPIN_DECIMAL_POINTS 11
|
||||
#define SPIN_MIN_MAX 12
|
||||
#define SPIN_TEXT 13
|
||||
#define SPIN_SET_ITEM 14
|
||||
#define SPIN_LABEL 15
|
||||
|
||||
extern char * _DtWidgetGetMessage(
|
||||
int set,
|
||||
int n,
|
||||
char *s );
|
||||
|
||||
#endif /* I18N_MSG */
|
||||
|
||||
#endif /* _DtMessageh */
|
||||
121
cde/lib/DtWidget/DtStrDefs.c
Normal file
121
cde/lib/DtWidget/DtStrDefs.c
Normal file
@@ -0,0 +1,121 @@
|
||||
/* $XConsortium: DtStrDefs.c /main/5 1996/03/25 11:18:12 rswiston $ */
|
||||
/* This file is automatically generated. */
|
||||
/* Do not edit. */
|
||||
|
||||
#ifndef DtConst
|
||||
#if defined(__STDC__) || !defined(NO_CONST)
|
||||
#define DtConst const
|
||||
#else
|
||||
#define DtConst
|
||||
#endif /* __STDC__ */
|
||||
#endif /* DtConst */
|
||||
|
||||
#ifndef _DtConst
|
||||
#define _DtConst DtConst
|
||||
#endif
|
||||
|
||||
|
||||
_DtConst char _DtStrings[] = {
|
||||
'A','l','t','e','r','n','a','t','e','I','m','a','g','e',0,
|
||||
'B','e','h','a','v','i','o','r',0,
|
||||
'B','e','h','a','v','i','o','r',0,
|
||||
'B','o','r','d','e','r','T','y','p','e',0,
|
||||
'B','o','r','d','e','r','T','y','p','e',0,
|
||||
'B','o','x','T','y','p','e',0,
|
||||
'B','o','x','T','y','p','e',0,
|
||||
'B','u','t','t','o','n','L','a','b','e','l','S','t','r','i','n','g','s',0,
|
||||
'C','o','n','t','r','o','l','T','y','p','e',0,
|
||||
'C','o','n','t','r','o','l','T','y','p','e',0,
|
||||
'C','u','r','s','o','r','F','o','n','t',0,
|
||||
'D','r','a','w','S','h','a','d','o','w',0,
|
||||
'D','r','o','p','A','c','t','i','o','n',0,
|
||||
'D','r','o','p','C','a','l','l','b','a','c','k',0,
|
||||
'F','i','l','l','M','o','d','e',0,
|
||||
'F','i','l','l','M','o','d','e',0,
|
||||
'F','o','r','m','a','t',0,
|
||||
'H','i','g','h','R','e','s','F','o','n','t','L','i','s','t',0,
|
||||
'L','o','w','R','e','s','F','o','n','t','L','i','s','t',0,
|
||||
'M','e','d','i','u','m','R','e','s','F','o','n','t','L','i','s','t',0,
|
||||
'P','i','x','m','a','p','P','o','s','i','t','i','o','n',0,
|
||||
'P','i','x','m','a','p','P','o','s','i','t','i','o','n',0,
|
||||
'P','u','s','h','A','r','g','u','m','e','n','t',0,
|
||||
'P','u','s','h','F','u','n','c','t','i','o','n',0,
|
||||
'S','t','r','i','n','g','P','o','s','i','t','i','o','n',0,
|
||||
'S','t','r','i','n','g','P','o','s','i','t','i','o','n',0,
|
||||
'S','u','b','p','a','n','e','l',0,
|
||||
'T','i','t','l','e','S','p','a','c','i','n','g',0,
|
||||
'T','i','t','l','e','P','o','s','i','t','i','o','n',0,
|
||||
'T','i','t','l','e','P','o','s','i','t','i','o','n',0,
|
||||
'U','n','d','e','r','l','i','n','e',0,
|
||||
'a','l','t','e','r','n','a','t','e','I','m','a','g','e',0,
|
||||
'b','e','h','a','v','i','o','r',0,
|
||||
'b','o','t','t','o','m','I','n','s','e','t',0,
|
||||
'b','o','r','d','e','r','T','y','p','e',0,
|
||||
'b','o','x','T','y','p','e',0,
|
||||
'b','u','t','t','o','n','L','a','b','e','l','S','t','r','i','n','g','s',0,
|
||||
'c','h','i','m','e',0,
|
||||
'c','l','i','e','n','t','T','i','m','e','o','u','t','I','n','t','e','r','v','a','l',0,
|
||||
'c','l','o','c','k','I','n','t','e','r','v','a','l',0,
|
||||
'c','o','n','t','r','o','l','T','y','p','e',0,
|
||||
'c','u','r','s','o','r','F','o','n','t',0,
|
||||
'd','r','a','w','S','h','a','d','o','w',0,
|
||||
'd','r','o','p','A','c','t','i','o','n',0,
|
||||
'd','r','o','p','C','a','l','l','b','a','c','k',0,
|
||||
'f','i','l','e','N','a','m','e',0,
|
||||
'f','i','l','l','M','o','d','e',0,
|
||||
'f','o','r','m','a','t',0,
|
||||
'h','e','i','g','h','t','I','n','c','r','e','m','e','n','t',0,
|
||||
'h','i','g','h','R','e','s','F','o','n','t','L','i','s','t',0,
|
||||
'i','m','a','g','e','N','a','m','e',0,
|
||||
'l','e','f','t','I','n','s','e','t',0,
|
||||
'l','o','w','R','e','s','F','o','n','t','L','i','s','t',0,
|
||||
'm','e','d','i','u','m','R','e','s','F','o','n','t','L','i','s','t',0,
|
||||
'm','o','n','i','t','o','r','T','i','m','e',0,
|
||||
'p','i','x','m','a','p','F','o','r','e','g','r','o','u','n','d',0,
|
||||
'p','i','x','m','a','p','B','a','c','k','g','r','o','u','n','d',0,
|
||||
'p','i','x','m','a','p','P','o','s','i','t','i','o','n',0,
|
||||
'p','u','s','h','A','r','g','u','m','e','n','t',0,
|
||||
'p','u','s','h','B','u','t','t','o','n','C','l','i','c','k','T','i','m','e',0,
|
||||
'p','u','s','h','F','u','n','c','t','i','o','n',0,
|
||||
'r','i','g','h','t','I','n','s','e','t',0,
|
||||
's','t','r','i','n','g','P','o','s','i','t','i','o','n',0,
|
||||
's','u','b','p','a','n','e','l',0,
|
||||
'r','e','s','o','l','u','t','i','o','n',0,
|
||||
't','i','t','l','e','S','p','a','c','i','n','g',0,
|
||||
't','i','t','l','e','P','o','s','i','t','i','o','n',0,
|
||||
't','i','t','l','e','A','l','i','g','n','m','e','n','t',0,
|
||||
't','o','p','I','n','s','e','t',0,
|
||||
'u','n','d','e','r','l','i','n','e',0,
|
||||
'u','s','e','E','m','b','o','s','s','e','d','T','e','x','t',0,
|
||||
'w','a','i','t','i','n','g','B','l','i','n','k','R','a','t','e',0,
|
||||
'w','i','d','t','h','I','n','c','r','e','m','e','n','t',0,
|
||||
'i','c','o','n','_','l','a','b','e','l',0,
|
||||
'i','c','o','n','_','b','u','t','t','o','n',0,
|
||||
'i','c','o','n','_','t','o','g','g','l','e',0,
|
||||
'i','c','o','n','_','d','r','a','g',0,
|
||||
'w','o','r','k','_','a','r','e','a',0,
|
||||
't','i','t','l','e','_','a','r','e','a',0,
|
||||
's','e','p','a','r','a','t','o','r',0,
|
||||
'b','u','t','t','o','n',0,
|
||||
'f','i','l','l','_','n','o','n','e',0,
|
||||
'f','i','l','l','_','p','a','r','e','n','t',0,
|
||||
'f','i','l','l','_','t','r','a','n','s','p','a','r','e','n','t',0,
|
||||
'f','i','l','l','_','s','e','l','f',0,
|
||||
'p','i','x','m','a','p','_','t','o','p',0,
|
||||
'p','i','x','m','a','p','_','b','o','t','t','o','m',0,
|
||||
'p','i','x','m','a','p','_','l','e','f','t',0,
|
||||
'p','i','x','m','a','p','_','r','i','g','h','t',0,
|
||||
's','t','r','i','n','g','_','t','o','p',0,
|
||||
's','t','r','i','n','g','_','b','o','t','t','o','m',0,
|
||||
's','t','r','i','n','g','_','l','e','f','t',0,
|
||||
's','t','r','i','n','g','_','r','i','g','h','t',0,
|
||||
't','i','t','l','e','_','t','o','p',0,
|
||||
't','i','t','l','e','_','b','o','t','t','o','m',0,
|
||||
'm','a','x','P','i','x','m','a','p','W','i','d','t','h',0,
|
||||
'm','a','x','P','i','x','m','a','p','H','e','i','g','h','t',0
|
||||
};
|
||||
|
||||
_DtConst char _AIXJPStrings[] = {
|
||||
'f','o','r','m','a','t','J','P',0,
|
||||
'F','o','r','m','a','t','J','P',0
|
||||
};
|
||||
520
cde/lib/DtWidget/DtStrDefs.h
Normal file
520
cde/lib/DtWidget/DtStrDefs.h
Normal file
@@ -0,0 +1,520 @@
|
||||
/* $XConsortium: DtStrDefs.h /main/4 1996/03/25 11:18:44 rswiston $ */
|
||||
/* This file is automatically generated. */
|
||||
/* Do not edit. */
|
||||
|
||||
#ifndef _DtStrDefs_h_
|
||||
#define _DtStrDefs_h_
|
||||
|
||||
#ifdef DTSTRINGDEFINES
|
||||
#define DtCAlternateImage "AlternateImage"
|
||||
#define DtCBehavior "Behavior"
|
||||
#define DtRBehavior "Behavior"
|
||||
#define DtCBorderType "BorderType"
|
||||
#define DtRBorderType "BorderType"
|
||||
#define DtCBoxType "BoxType"
|
||||
#define DtRBoxType "BoxType"
|
||||
#define DtCButtonLabelStrings "ButtonLabelStrings"
|
||||
#define DtCControlType "ControlType"
|
||||
#define DtRControlType "ControlType"
|
||||
#define DtCCursorFont "CursorFont"
|
||||
#define DtCDrawShadow "DrawShadow"
|
||||
#define DtCDropAction "DropAction"
|
||||
#define DtCDropCallback "DropCallback"
|
||||
#define DtCFillMode "FillMode"
|
||||
#define DtRFillMode "FillMode"
|
||||
#define DtCFormat "Format"
|
||||
#define DtCHighResFontList "HighResFontList"
|
||||
#define DtCLowResFontList "LowResFontList"
|
||||
#define DtCMediumResFontList "MediumResFontList"
|
||||
#define DtCPixmapPosition "PixmapPosition"
|
||||
#define DtRPixmapPosition "PixmapPosition"
|
||||
#define DtCPushArgument "PushArgument"
|
||||
#define DtCPushFunction "PushFunction"
|
||||
#define DtCStringPosition "StringPosition"
|
||||
#define DtRStringPosition "StringPosition"
|
||||
#define DtCSubpanel "Subpanel"
|
||||
#define DtCTitleSpacing "TitleSpacing"
|
||||
#define DtCTitlePosition "TitlePosition"
|
||||
#define DtRTitlePosition "TitlePosition"
|
||||
#define DtCUnderline "Underline"
|
||||
#define DtNalternateImage "alternateImage"
|
||||
#define DtNbehavior "behavior"
|
||||
#define DtNbottomInset "bottomInset"
|
||||
#define DtNborderType "borderType"
|
||||
#define DtNboxType "boxType"
|
||||
#define DtNbuttonLabelStrings "buttonLabelStrings"
|
||||
#define DtNchime "chime"
|
||||
#define DtNclientTimeoutInterval "clientTimeoutInterval"
|
||||
#define DtNclockInterval "clockInterval"
|
||||
#define DtNcontrolType "controlType"
|
||||
#define DtNcursorFont "cursorFont"
|
||||
#define DtNdrawShadow "drawShadow"
|
||||
#define DtNdropAction "dropAction"
|
||||
#define DtNdropCallback "dropCallback"
|
||||
#define DtNfileName "fileName"
|
||||
#define DtNfillMode "fillMode"
|
||||
#define DtNformat "format"
|
||||
#define DtNheightIncrement "heightIncrement"
|
||||
#define DtNhighResFontList "highResFontList"
|
||||
#define DtNimageName "imageName"
|
||||
#define DtNleftInset "leftInset"
|
||||
#define DtNlowResFontList "lowResFontList"
|
||||
#define DtNmediumResFontList "mediumResFontList"
|
||||
#define DtNmonitorTime "monitorTime"
|
||||
#define DtNpixmapForeground "pixmapForeground"
|
||||
#define DtNpixmapBackground "pixmapBackground"
|
||||
#define DtNmaxPixmapWidth "maxPixmapWidth"
|
||||
#define DtNmaxPixmapHeight "maxPixmapHeight"
|
||||
#define DtNpixmapPosition "pixmapPosition"
|
||||
#define DtNpushArgument "pushArgument"
|
||||
#define DtNpushButtonClickTime "pushButtonClickTime"
|
||||
#define DtNpushFunction "pushFunction"
|
||||
#define DtNrightInset "rightInset"
|
||||
#define DtNstringPosition "stringPosition"
|
||||
#define DtNsubpanel "subpanel"
|
||||
#define DtNresolution "resolution"
|
||||
#define DtNtitleSpacing "titleSpacing"
|
||||
#define DtNtitlePosition "titlePosition"
|
||||
#define DtNtitleAlignment "titleAlignment"
|
||||
#define DtNtopInset "topInset"
|
||||
#define DtNunderline "underline"
|
||||
#define DtNuseEmbossedText "useEmbossedText"
|
||||
#define DtNwaitingBlinkRate "waitingBlinkRate"
|
||||
#define DtNwidthIncrement "widthIncrement"
|
||||
#define DtSicon_label "icon_label"
|
||||
#define DtSicon_button "icon_button"
|
||||
#define DtSicon_toggle "icon_toggle"
|
||||
#define DtSicon_drag "icon_drag"
|
||||
#define DtSwork_area "work_area"
|
||||
#define DtStitle_area "title_area"
|
||||
#define DtSseparator "separator"
|
||||
#define DtSbutton "button"
|
||||
#define DtSfill_none "fill_none"
|
||||
#define DtSfill_parent "fill_parent"
|
||||
#define DtSfill_transparent "fill_transparent"
|
||||
#define DtSfill_self "fill_self"
|
||||
#define DtSpixmap_top "pixmap_top"
|
||||
#define DtSpixmap_bottom "pixmap_bottom"
|
||||
#define DtSpixmap_left "pixmap_left"
|
||||
#define DtSpixmap_right "pixmap_right"
|
||||
#define DtSstring_top "string_top"
|
||||
#define DtSstring_bottom "string_bottom"
|
||||
#define DtSstring_left "string_left"
|
||||
#define DtSstring_right "string_right"
|
||||
#define DtStitle_top "title_top"
|
||||
#define DtStitle_bottom "title_bottom"
|
||||
#define DtNformatJP "formatJP"
|
||||
#define DtCFormatJP "FormatJP"
|
||||
#else
|
||||
#ifndef _DtConst
|
||||
#define _DtConst /**/
|
||||
#endif
|
||||
extern _DtConst char _DtStrings[];
|
||||
#ifndef DtCAlternateImage
|
||||
#define DtCAlternateImage ((char*)&_DtStrings[0])
|
||||
#endif
|
||||
#ifndef DtCBehavior
|
||||
#define DtCBehavior ((char*)&_DtStrings[15])
|
||||
#endif
|
||||
#ifndef DtRBehavior
|
||||
#define DtRBehavior ((char*)&_DtStrings[24])
|
||||
#endif
|
||||
#ifndef DtCBorderType
|
||||
#define DtCBorderType ((char*)&_DtStrings[33])
|
||||
#endif
|
||||
#ifndef DtRBorderType
|
||||
#define DtRBorderType ((char*)&_DtStrings[44])
|
||||
#endif
|
||||
#ifndef DtCBoxType
|
||||
#define DtCBoxType ((char*)&_DtStrings[55])
|
||||
#endif
|
||||
#ifndef DtRBoxType
|
||||
#define DtRBoxType ((char*)&_DtStrings[63])
|
||||
#endif
|
||||
#ifndef DtCButtonLabelStrings
|
||||
#define DtCButtonLabelStrings ((char*)&_DtStrings[71])
|
||||
#endif
|
||||
#ifndef DtCControlType
|
||||
#define DtCControlType ((char*)&_DtStrings[90])
|
||||
#endif
|
||||
#ifndef DtRControlType
|
||||
#define DtRControlType ((char*)&_DtStrings[102])
|
||||
#endif
|
||||
#ifndef DtCCursorFont
|
||||
#define DtCCursorFont ((char*)&_DtStrings[114])
|
||||
#endif
|
||||
#ifndef DtCDrawShadow
|
||||
#define DtCDrawShadow ((char*)&_DtStrings[125])
|
||||
#endif
|
||||
#ifndef DtCDropAction
|
||||
#define DtCDropAction ((char*)&_DtStrings[136])
|
||||
#endif
|
||||
#ifndef DtCDropCallback
|
||||
#define DtCDropCallback ((char*)&_DtStrings[147])
|
||||
#endif
|
||||
#ifndef DtCFillMode
|
||||
#define DtCFillMode ((char*)&_DtStrings[160])
|
||||
#endif
|
||||
#ifndef DtRFillMode
|
||||
#define DtRFillMode ((char*)&_DtStrings[169])
|
||||
#endif
|
||||
#ifndef DtCFormat
|
||||
#define DtCFormat ((char*)&_DtStrings[178])
|
||||
#endif
|
||||
#ifndef DtCHighResFontList
|
||||
#define DtCHighResFontList ((char*)&_DtStrings[185])
|
||||
#endif
|
||||
#ifndef DtCLowResFontList
|
||||
#define DtCLowResFontList ((char*)&_DtStrings[201])
|
||||
#endif
|
||||
#ifndef DtCMediumResFontList
|
||||
#define DtCMediumResFontList ((char*)&_DtStrings[216])
|
||||
#endif
|
||||
#ifndef DtCPixmapPosition
|
||||
#define DtCPixmapPosition ((char*)&_DtStrings[234])
|
||||
#endif
|
||||
#ifndef DtRPixmapPosition
|
||||
#define DtRPixmapPosition ((char*)&_DtStrings[249])
|
||||
#endif
|
||||
#ifndef DtCPushArgument
|
||||
#define DtCPushArgument ((char*)&_DtStrings[264])
|
||||
#endif
|
||||
#ifndef DtCPushFunction
|
||||
#define DtCPushFunction ((char*)&_DtStrings[277])
|
||||
#endif
|
||||
#ifndef DtCStringPosition
|
||||
#define DtCStringPosition ((char*)&_DtStrings[290])
|
||||
#endif
|
||||
#ifndef DtRStringPosition
|
||||
#define DtRStringPosition ((char*)&_DtStrings[305])
|
||||
#endif
|
||||
#ifndef DtCSubpanel
|
||||
#define DtCSubpanel ((char*)&_DtStrings[320])
|
||||
#endif
|
||||
#ifndef DtCTitleSpacing
|
||||
#define DtCTitleSpacing ((char*)&_DtStrings[329])
|
||||
#endif
|
||||
#ifndef DtCTitlePosition
|
||||
#define DtCTitlePosition ((char*)&_DtStrings[342])
|
||||
#endif
|
||||
#ifndef DtRTitlePosition
|
||||
#define DtRTitlePosition ((char*)&_DtStrings[356])
|
||||
#endif
|
||||
#ifndef DtCUnderline
|
||||
#define DtCUnderline ((char*)&_DtStrings[370])
|
||||
#endif
|
||||
#ifndef DtNalternateImage
|
||||
#define DtNalternateImage ((char*)&_DtStrings[380])
|
||||
#endif
|
||||
#ifndef DtNbehavior
|
||||
#define DtNbehavior ((char*)&_DtStrings[395])
|
||||
#endif
|
||||
#ifndef DtNbottomInset
|
||||
#define DtNbottomInset ((char*)&_DtStrings[404])
|
||||
#endif
|
||||
#ifndef DtNborderType
|
||||
#define DtNborderType ((char*)&_DtStrings[416])
|
||||
#endif
|
||||
#ifndef DtNboxType
|
||||
#define DtNboxType ((char*)&_DtStrings[427])
|
||||
#endif
|
||||
#ifndef DtNbuttonLabelStrings
|
||||
#define DtNbuttonLabelStrings ((char*)&_DtStrings[435])
|
||||
#endif
|
||||
#ifndef DtNchime
|
||||
#define DtNchime ((char*)&_DtStrings[454])
|
||||
#endif
|
||||
#ifndef DtNclientTimeoutInterval
|
||||
#define DtNclientTimeoutInterval ((char*)&_DtStrings[460])
|
||||
#endif
|
||||
#ifndef DtNclockInterval
|
||||
#define DtNclockInterval ((char*)&_DtStrings[482])
|
||||
#endif
|
||||
#ifndef DtNcontrolType
|
||||
#define DtNcontrolType ((char*)&_DtStrings[496])
|
||||
#endif
|
||||
#ifndef DtNcursorFont
|
||||
#define DtNcursorFont ((char*)&_DtStrings[508])
|
||||
#endif
|
||||
#ifndef DtNdrawShadow
|
||||
#define DtNdrawShadow ((char*)&_DtStrings[519])
|
||||
#endif
|
||||
#ifndef DtNdropAction
|
||||
#define DtNdropAction ((char*)&_DtStrings[530])
|
||||
#endif
|
||||
#ifndef DtNdropCallback
|
||||
#define DtNdropCallback ((char*)&_DtStrings[541])
|
||||
#endif
|
||||
#ifndef DtNfileName
|
||||
#define DtNfileName ((char*)&_DtStrings[554])
|
||||
#endif
|
||||
#ifndef DtNfillMode
|
||||
#define DtNfillMode ((char*)&_DtStrings[563])
|
||||
#endif
|
||||
#ifndef DtNformat
|
||||
#define DtNformat ((char*)&_DtStrings[572])
|
||||
#endif
|
||||
#ifndef DtNheightIncrement
|
||||
#define DtNheightIncrement ((char*)&_DtStrings[579])
|
||||
#endif
|
||||
#ifndef DtNhighResFontList
|
||||
#define DtNhighResFontList ((char*)&_DtStrings[595])
|
||||
#endif
|
||||
#ifndef DtNimageName
|
||||
#define DtNimageName ((char*)&_DtStrings[611])
|
||||
#endif
|
||||
#ifndef DtNleftInset
|
||||
#define DtNleftInset ((char*)&_DtStrings[621])
|
||||
#endif
|
||||
#ifndef DtNlowResFontList
|
||||
#define DtNlowResFontList ((char*)&_DtStrings[631])
|
||||
#endif
|
||||
#ifndef DtNmediumResFontList
|
||||
#define DtNmediumResFontList ((char*)&_DtStrings[646])
|
||||
#endif
|
||||
#ifndef DtNmonitorTime
|
||||
#define DtNmonitorTime ((char*)&_DtStrings[664])
|
||||
#endif
|
||||
#ifndef DtNpixmapForeground
|
||||
#define DtNpixmapForeground ((char*)&_DtStrings[676])
|
||||
#endif
|
||||
#ifndef DtNpixmapBackground
|
||||
#define DtNpixmapBackground ((char*)&_DtStrings[693])
|
||||
#endif
|
||||
#ifndef DtNpixmapPosition
|
||||
#define DtNpixmapPosition ((char*)&_DtStrings[710])
|
||||
#endif
|
||||
#ifndef DtNpushArgument
|
||||
#define DtNpushArgument ((char*)&_DtStrings[725])
|
||||
#endif
|
||||
#ifndef DtNpushButtonClickTime
|
||||
#define DtNpushButtonClickTime ((char*)&_DtStrings[738])
|
||||
#endif
|
||||
#ifndef DtNpushFunction
|
||||
#define DtNpushFunction ((char*)&_DtStrings[758])
|
||||
#endif
|
||||
#ifndef DtNrightInset
|
||||
#define DtNrightInset ((char*)&_DtStrings[771])
|
||||
#endif
|
||||
#ifndef DtNstringPosition
|
||||
#define DtNstringPosition ((char*)&_DtStrings[782])
|
||||
#endif
|
||||
#ifndef DtNsubpanel
|
||||
#define DtNsubpanel ((char*)&_DtStrings[797])
|
||||
#endif
|
||||
#ifndef DtNresolution
|
||||
#define DtNresolution ((char*)&_DtStrings[806])
|
||||
#endif
|
||||
#ifndef DtNtitleSpacing
|
||||
#define DtNtitleSpacing ((char*)&_DtStrings[817])
|
||||
#endif
|
||||
#ifndef DtNtitlePosition
|
||||
#define DtNtitlePosition ((char*)&_DtStrings[830])
|
||||
#endif
|
||||
#ifndef DtNtitleAlignment
|
||||
#define DtNtitleAlignment ((char*)&_DtStrings[844])
|
||||
#endif
|
||||
#ifndef DtNtopInset
|
||||
#define DtNtopInset ((char*)&_DtStrings[859])
|
||||
#endif
|
||||
#ifndef DtNunderline
|
||||
#define DtNunderline ((char*)&_DtStrings[868])
|
||||
#endif
|
||||
#ifndef DtNuseEmbossedText
|
||||
#define DtNuseEmbossedText ((char*)&_DtStrings[878])
|
||||
#endif
|
||||
#ifndef DtNwaitingBlinkRate
|
||||
#define DtNwaitingBlinkRate ((char*)&_DtStrings[894])
|
||||
#endif
|
||||
#ifndef DtNwidthIncrement
|
||||
#define DtNwidthIncrement ((char*)&_DtStrings[911])
|
||||
#endif
|
||||
#ifndef DtSicon_label
|
||||
#define DtSicon_label ((char*)&_DtStrings[926])
|
||||
#endif
|
||||
#ifndef DtSicon_button
|
||||
#define DtSicon_button ((char*)&_DtStrings[937])
|
||||
#endif
|
||||
#ifndef DtSicon_toggle
|
||||
#define DtSicon_toggle ((char*)&_DtStrings[949])
|
||||
#endif
|
||||
#ifndef DtSicon_drag
|
||||
#define DtSicon_drag ((char*)&_DtStrings[961])
|
||||
#endif
|
||||
#ifndef DtSwork_area
|
||||
#define DtSwork_area ((char*)&_DtStrings[971])
|
||||
#endif
|
||||
#ifndef DtStitle_area
|
||||
#define DtStitle_area ((char*)&_DtStrings[981])
|
||||
#endif
|
||||
#ifndef DtSseparator
|
||||
#define DtSseparator ((char*)&_DtStrings[992])
|
||||
#endif
|
||||
#ifndef DtSbutton
|
||||
#define DtSbutton ((char*)&_DtStrings[1002])
|
||||
#endif
|
||||
#ifndef DtSfill_none
|
||||
#define DtSfill_none ((char*)&_DtStrings[1009])
|
||||
#endif
|
||||
#ifndef DtSfill_parent
|
||||
#define DtSfill_parent ((char*)&_DtStrings[1019])
|
||||
#endif
|
||||
#ifndef DtSfill_transparent
|
||||
#define DtSfill_transparent ((char*)&_DtStrings[1031])
|
||||
#endif
|
||||
#ifndef DtSfill_self
|
||||
#define DtSfill_self ((char*)&_DtStrings[1048])
|
||||
#endif
|
||||
#ifndef DtSpixmap_top
|
||||
#define DtSpixmap_top ((char*)&_DtStrings[1058])
|
||||
#endif
|
||||
#ifndef DtSpixmap_bottom
|
||||
#define DtSpixmap_bottom ((char*)&_DtStrings[1069])
|
||||
#endif
|
||||
#ifndef DtSpixmap_left
|
||||
#define DtSpixmap_left ((char*)&_DtStrings[1083])
|
||||
#endif
|
||||
#ifndef DtSpixmap_right
|
||||
#define DtSpixmap_right ((char*)&_DtStrings[1095])
|
||||
#endif
|
||||
#ifndef DtSstring_top
|
||||
#define DtSstring_top ((char*)&_DtStrings[1108])
|
||||
#endif
|
||||
#ifndef DtSstring_bottom
|
||||
#define DtSstring_bottom ((char*)&_DtStrings[1119])
|
||||
#endif
|
||||
#ifndef DtSstring_left
|
||||
#define DtSstring_left ((char*)&_DtStrings[1133])
|
||||
#endif
|
||||
#ifndef DtSstring_right
|
||||
#define DtSstring_right ((char*)&_DtStrings[1145])
|
||||
#endif
|
||||
#ifndef DtStitle_top
|
||||
#define DtStitle_top ((char*)&_DtStrings[1158])
|
||||
#endif
|
||||
#ifndef DtStitle_bottom
|
||||
#define DtStitle_bottom ((char*)&_DtStrings[1168])
|
||||
#endif
|
||||
#ifndef DtNmaxPixmapWidth
|
||||
#define DtNmaxPixmapWidth ((char*)&_DtStrings[1181])
|
||||
#endif
|
||||
#ifndef DtNmaxPixmapHeight
|
||||
#define DtNmaxPixmapHeight ((char*)&_DtStrings[1196])
|
||||
#endif
|
||||
#endif
|
||||
extern _DtConst char _AIXJPStrings[];
|
||||
#ifndef DtNformatJP
|
||||
#define DtNformatJP ((char*)&_AIXJPStrings[0])
|
||||
#endif
|
||||
#ifndef DtCFormatJP
|
||||
#define DtCFormatJP ((char*)&_AIXJPStrings[9])
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Resource name mapping to Xm prefix. If Motif defines on of these
|
||||
* resources, the redefined resource definition should be removed.
|
||||
*/
|
||||
#define XmCAlternateImage DtCAlternateImage
|
||||
#define XmCBehavior DtCBehavior
|
||||
#define XmRBehavior DtRBehavior
|
||||
#define XmCBorderType DtCBorderType
|
||||
#define XmRBorderType DtRBorderType
|
||||
#define XmCBoxType DtCBoxType
|
||||
#define XmRBoxType DtRBoxType
|
||||
#define XmCButtonLabelStrings DtCButtonLabelStrings
|
||||
#define XmCControlType DtCControlType
|
||||
#define XmRControlType DtRControlType
|
||||
#define XmCCursorFont DtCCursorFont
|
||||
#define XmCDrawShadow DtCDrawShadow
|
||||
#define XmCDropAction DtCDropAction
|
||||
#define XmCDropCallback DtCDropCallback
|
||||
#define XmCFillMode DtCFillMode
|
||||
#define XmRFillMode DtRFillMode
|
||||
#define XmCFormat DtCFormat
|
||||
#define XmCHighResFontList DtCHighResFontList
|
||||
#define XmCLowResFontList DtCLowResFontList
|
||||
#define XmCMediumResFontList DtCMediumResFontList
|
||||
#define XmCPixmapPosition DtCPixmapPosition
|
||||
#define XmRPixmapPosition DtRPixmapPosition
|
||||
#define XmCPushArgument DtCPushArgument
|
||||
#define XmCPushFunction DtCPushFunction
|
||||
#define XmCStringPosition DtCStringPosition
|
||||
#define XmRStringPosition DtRStringPosition
|
||||
#define XmCSubpanel DtCSubpanel
|
||||
#define XmCTitleSpacing DtCTitleSpacing
|
||||
#define XmCTitlePosition DtCTitlePosition
|
||||
#define XmRTitlePosition DtRTitlePosition
|
||||
#define XmCUnderline DtCUnderline
|
||||
#define XmNalternateImage DtNalternateImage
|
||||
#define XmNbehavior DtNbehavior
|
||||
#define XmNbottomInset DtNbottomInset
|
||||
#define XmNborderType DtNborderType
|
||||
#define XmNboxType DtNboxType
|
||||
#define XmNbuttonLabelStrings DtNbuttonLabelStrings
|
||||
#define XmNchime DtNchime
|
||||
#define XmNclientTimeoutInterval DtNclientTimeoutInterval
|
||||
#define XmNclockInterval DtNclockInterval
|
||||
#define XmNcontrolType DtNcontrolType
|
||||
#define XmNcursorFont DtNcursorFont
|
||||
#define XmNdrawShadow DtNdrawShadow
|
||||
#define XmNdropAction DtNdropAction
|
||||
#define XmNdropCallback DtNdropCallback
|
||||
#define XmNfileName DtNfileName
|
||||
#define XmNfillMode DtNfillMode
|
||||
#define XmNformat DtNformat
|
||||
#define XmNheightIncrement DtNheightIncrement
|
||||
#define XmNhighResFontList DtNhighResFontList
|
||||
#define XmNimageName DtNimageName
|
||||
#define XmNleftInset DtNleftInset
|
||||
#define XmNlowResFontList DtNlowResFontList
|
||||
#define XmNmediumResFontList DtNmediumResFontList
|
||||
#define XmNmonitorTime DtNmonitorTime
|
||||
#define XmNpixmapForeground DtNpixmapForeground
|
||||
#define XmNpixmapBackground DtNpixmapBackground
|
||||
#define XmNmaxPixmapWidth DtNmaxPixmapWidth
|
||||
#define XmNmaxPixmapHeight DtNmaxPixmapHeight
|
||||
#define XmNpixmapPosition DtNpixmapPosition
|
||||
#define XmNpushArgument DtNpushArgument
|
||||
#define XmNpushButtonClickTime DtNpushButtonClickTime
|
||||
#define XmNpushFunction DtNpushFunction
|
||||
#define XmNrightInset DtNrightInset
|
||||
#define XmNstringPosition DtNstringPosition
|
||||
#define XmNsubpanel DtNsubpanel
|
||||
#define XmNresolution DtNresolution
|
||||
#define XmNtitleSpacing DtNtitleSpacing
|
||||
#define XmNtitlePosition DtNtitlePosition
|
||||
#define XmNtitleAlignment DtNtitleAlignment
|
||||
#define XmNtopInset DtNtopInset
|
||||
#define XmNunderline DtNunderline
|
||||
#define XmNuseEmbossedText DtNuseEmbossedText
|
||||
#define XmNwaitingBlinkRate DtNwaitingBlinkRate
|
||||
#define XmNwidthIncrement DtNwidthIncrement
|
||||
#define XmNformatJP DtNformatJP
|
||||
#define XmCFormatJP DtCFormatJP
|
||||
|
||||
/*
|
||||
* String defines for converter string names.
|
||||
*/
|
||||
#define STR_ICON_LABEL DtSicon_label
|
||||
#define STR_ICON_BUTTON DtSicon_button
|
||||
#define STR_ICON_TOGGLE DtSicon_toggle
|
||||
#define STR_ICON_DRAG DtSicon_drag
|
||||
#define STR_WORK_AREA DtSwork_area
|
||||
#define STR_TITLE_AREA DtStitle_area
|
||||
#define STR_SEPARATOR DtSseparator
|
||||
#define STR_BUTTON DtSbutton
|
||||
#define STR_FILL_NONE DtSfill_none
|
||||
#define STR_FILL_PARENT DtSfill_parent
|
||||
#define STR_FILL_TRANSPARENT DtSfill_transparent
|
||||
#define STR_FILL_SELF DtSfill_self
|
||||
#define STR_PIXMAP_TOP DtSpixmap_top
|
||||
#define STR_PIXMAP_BOTTOM DtSpixmap_bottom
|
||||
#define STR_PIXMAP_LEFT DtSpixmap_left
|
||||
#define STR_PIXMAP_RIGHT DtSpixmap_right
|
||||
#define STR_STRING_TOP DtSstring_top
|
||||
#define STR_STRING_BOTTOM DtSstring_bottom
|
||||
#define STR_STRING_LEFT DtSstring_left
|
||||
#define STR_STRING_RIGHT DtSstring_right
|
||||
#define STR_TITLE_TOP DtStitle_top
|
||||
#define STR_TITLE_BOTTOM DtStitle_bottom
|
||||
#endif
|
||||
285
cde/lib/DtWidget/DtWidget.msg
Normal file
285
cde/lib/DtWidget/DtWidget.msg
Normal file
@@ -0,0 +1,285 @@
|
||||
$ *************************************<+>*************************************
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ ** File: DtWidget.vmsg
|
||||
$ **
|
||||
$ ** Project: DT
|
||||
$ **
|
||||
$ ** Description:
|
||||
$ ** -----------
|
||||
$ ** This file is the source for the message catalog for the Dt widget
|
||||
$ ** library.
|
||||
$ **
|
||||
$ **
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ ** (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.
|
||||
$ **
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ **
|
||||
$ ** $XConsortium: DtWidget.msg /main/6 1996/06/19 11:28:04 cde-dec $
|
||||
$ *****************************************************************************
|
||||
$ *****************************************************************************
|
||||
|
||||
$ *****************************************************************************
|
||||
$
|
||||
$ ***** NOTE FOR MESSAGE CATALOG TRANSLATORS *****
|
||||
$
|
||||
$ There MAY be three types of messages in this file:
|
||||
$
|
||||
$ 1. Messages that appear in dialogs or are displayed to the user.
|
||||
$
|
||||
$ These messages are the default and they should ALL BE LOCALIZED.
|
||||
$ Note that these messages do NOT have any identification (see the
|
||||
$ comments for type 2 and 3 below).
|
||||
$
|
||||
$ 2. Messages that only appear in the DT error log file ($HOME/.dt/errorlog).
|
||||
$
|
||||
$ The localization of these messages is OPTIONAL. These messages are
|
||||
$ identified by the following:
|
||||
$
|
||||
$ MESSAGES xx-yy IN SET zz WILL ONLY APPEAR IN THE DT ERRORLOG FILE
|
||||
$
|
||||
$ 3. Messages that should not be localized.
|
||||
$
|
||||
$ These messages are identified by the following:
|
||||
$
|
||||
$ DO NOT TRANSLATE or CHANGE or LOCALIZE MESSAGES xx-yy from set zz
|
||||
$
|
||||
$ ***** END (NOTE FOR MESSAGE CATALOG TRANSLATORS) *****
|
||||
$
|
||||
$ ******************************************************************************
|
||||
|
||||
|
||||
$set 2
|
||||
$ *************************************************************
|
||||
$ ** **
|
||||
$ ** Common messages shared by all DT widgets **
|
||||
$ ** **
|
||||
$ *************************************************************
|
||||
$ Default value for DtNdialogCloseButtonLabel resource.
|
||||
$ This string is used for all "Close" buttons in all dialogs.
|
||||
1 Close
|
||||
|
||||
$ Default value for DtNdialogHelpButtonLabel resource.
|
||||
$ This string is used for all "Help" buttons in all dialogs.
|
||||
2 Help
|
||||
|
||||
$set 3
|
||||
$ *************************************************************
|
||||
$ ** **
|
||||
$ ** This set of messages is used by the DtEditor widget. **
|
||||
$ ** **
|
||||
$ *************************************************************
|
||||
|
||||
$ **********************************************
|
||||
$ ** module: Editor.c **
|
||||
$ ** Messages for the Format/Settings dialog **
|
||||
$ **********************************************
|
||||
|
||||
$ Default value for DtNformatSettingsDialogTitle resource,
|
||||
$ title of format settings dialog
|
||||
1 Format Settings
|
||||
|
||||
$ Default values for DtNlMarginFieldLabel and DtNrMarginFieldLabel resources,
|
||||
$ labels for margin fields in Format Settings dialog
|
||||
2 Right Margin:
|
||||
3 Left Margin:
|
||||
|
||||
$ Default values for DtNlAlignToggleLabel, DtNrAlignToggleLabel,
|
||||
$ DtNjustifyToggleLabel, and DtNcenterToggleLabel resources,
|
||||
$ labels for justification radio buttons in Format Settings dialog
|
||||
4 Left Align
|
||||
5 Right Align
|
||||
6 Justify
|
||||
7 Center
|
||||
|
||||
$ Default values for DtNformatParagraphButtonLabel and
|
||||
$ DtNformatAllButtonLabel resources,
|
||||
$ labels for paragraph and all buttons in Format Settings dialog
|
||||
8 Paragraph
|
||||
9 All
|
||||
|
||||
$ ******************************************************************
|
||||
$ ** module Editor.c **
|
||||
$ ** Strings used in the spell checking and find/change dialogs. **
|
||||
$ ******************************************************************
|
||||
|
||||
$ Default value for DtNspellDialogTitle resource,
|
||||
$ title of the Spell dialog
|
||||
20 Spell
|
||||
|
||||
$ Default value for DtNfindDialogTitle resource,
|
||||
$ title of the Find/Change dialog
|
||||
21 Find/Change
|
||||
|
||||
$ Default value for DtNmisspelledListLabel resource,
|
||||
$ label for list of unrecognized and misspelled words
|
||||
22 Misspelled Words:
|
||||
|
||||
$ Default value for DtNfindFieldLabel resource,
|
||||
$ label of field in which user types string for which to search.
|
||||
23 Find:
|
||||
|
||||
$ Default value for DtNchangeFieldLabel resource,
|
||||
$ label of field in which user types the replacement string
|
||||
24 Change To:
|
||||
|
||||
$ Default values for DtNfindButtonLabel, DtNchangeButtonLabel, and
|
||||
$ DtNchangeAllButtonLabel resources,
|
||||
$ labels for find, change, and change all buttons in Find/Change dialog
|
||||
25 Find
|
||||
26 Change
|
||||
27 Change All
|
||||
|
||||
$ ******************************************************************
|
||||
$ ** module: SearchDlg. **
|
||||
$ ** Message displayed when Find/Replace/Spell fails to find the **
|
||||
$ ** specified string or word. **
|
||||
$ ******************************************************************
|
||||
$ Used to display "Unable to find the string FOO in the current document."
|
||||
$ Note: Do not localize the characters %s.
|
||||
30 Unable to find the string %s in the current document.
|
||||
|
||||
$ Title for general information dialog (e.g. "Find/Change dialog can't
|
||||
$ find word in document.").
|
||||
31 Information
|
||||
|
||||
$ ***********************************************************
|
||||
$ ** module Editor.c **
|
||||
$ ** Messages and strings associated with the status line. **
|
||||
$ ***********************************************************
|
||||
|
||||
$ Default value for DtNcurrentLineLabel resource,
|
||||
$ label for the display showing the current insert cursor line
|
||||
40 Line:
|
||||
|
||||
$ Default value for DtNtotalLineCountLabel resource,
|
||||
$ label for the display showing the total number of lines in the document
|
||||
41 Total:
|
||||
|
||||
$ Default value for DtNoverstrikeLabel resource,
|
||||
$ label used to indicate Editor is in overstrike (overtype) mode.
|
||||
42 Overstrike
|
||||
|
||||
$ Default value for DtNinsertLabel resource,
|
||||
$ label used to indicate Editor is in insert mode.
|
||||
$ The default value is a blank string.
|
||||
43
|
||||
|
||||
$ ******************************************************************
|
||||
$ ** module: SearchCalls **
|
||||
$ ** Message displayed when Find/Replace/Spell fails to execute **
|
||||
$ ** the spell filter. **
|
||||
$ ******************************************************************
|
||||
$ Error message if there is a problem running the spell filter
|
||||
$ Message 34 and 35 are part of the same message for the error
|
||||
$ dialog.
|
||||
$ do not translate %s
|
||||
$ "NEW-"
|
||||
50 Error executing spell filter.
|
||||
51 Check to see if filter, %s, is installed and in the path.
|
||||
|
||||
$ Title for Error dialog
|
||||
$ "NEW-"
|
||||
52 Editor Error
|
||||
|
||||
$set 4
|
||||
$ *************************************************************
|
||||
$ ** **
|
||||
$ ** MenuButton messages **
|
||||
$ ** **
|
||||
$ *************************************************************
|
||||
$ Warning messsage
|
||||
$ Note: do not localize the chars XmNmenuPost
|
||||
1 XmNmenuPost has illegal value.
|
||||
|
||||
$ Error messsages
|
||||
$ Note: do not localize the chars DtMenuButtonWidget in messages 2 and 3
|
||||
2 DtMenuButtonWidget: Invalid Parent.
|
||||
3 DtMenuButtonWidget: Invalid Submenu.
|
||||
|
||||
$set 5
|
||||
$ *************************************************************
|
||||
$ ** **
|
||||
$ ** ComboBox messages **
|
||||
$ ** **
|
||||
$ *************************************************************
|
||||
$ Warning messsages
|
||||
$ Note: do not localize the chars DtComboBoxWidget in messages 1 - 11
|
||||
$ Note: do not localize the chars alignment and DtALIGNMENT_CENTER
|
||||
1 DtComboBoxWidget: Invalid alignment resource (defaulting to DtALIGNMENT_CENTER).
|
||||
$ Note: do not localize the chars marginHeight
|
||||
2 DtComboBoxWidget: Invalid marginHeight resource (defaulting to 2).
|
||||
$ Note: do not localize the chars marginWidth
|
||||
3 DtComboBoxWidget: Invalid marginWidth resource (defaulting to 2).
|
||||
$ Note: do not localize the chars horizontalSpacing
|
||||
4 DtComboBoxWidget: Invalid horizontalSpacing resource (defaulting to 0).
|
||||
$ Note: do not localize the chars verticalSpacing
|
||||
5 DtComboBoxWidget: Invalid verticalSpacing resource (defaulting to 0).
|
||||
$ Note: do not localize the chars orientation and DtRIGHT
|
||||
6 DtComboBoxWidget: Invalid orientation resource (defaulting to DtRIGHT).
|
||||
$ Note: do not localize the chars itemCount
|
||||
7 DtComboBoxWidget: Invalid itemCount resource (defaulting to 0).
|
||||
$ Note: do not localize the chars selectedPosition
|
||||
8 DtComboBoxWidget: Invalid selectedPosition resource (defaulting to 0).
|
||||
$ Note: do not localize the chars textField
|
||||
9 DtComboBoxWidget: Unable to set textField resource.
|
||||
$ Note: do not localize the chars DtComboBoxSetItem
|
||||
10 DtComboBoxWidget: Unable to find item to set (DtComboBoxSetItem).
|
||||
$ Note: do not localize the chars DtComboBoxSelectItem
|
||||
11 DtComboBoxWidget: Unable to find item to select (DtComboBoxSelectItem).
|
||||
12 Resizing failed. Maybe longest item is wider than space allowed.
|
||||
|
||||
$ Label value
|
||||
13 ComboBox
|
||||
|
||||
$ Error message
|
||||
$ Note: do not localize the chars String and XmRType
|
||||
14 cvtStringToType: wrongParameters, String to XmRType conversion needs no extra arguments
|
||||
|
||||
$ Warning message
|
||||
15 DtComboBoxDeletePos: wrongParameters, Invalid position value
|
||||
|
||||
$set 6
|
||||
$ *************************************************************
|
||||
$ ** **
|
||||
$ ** SpinBox messages **
|
||||
$ ** **
|
||||
$ *************************************************************
|
||||
$ Warning messsages
|
||||
$ Note: do not localize the chars DtSpinBoxWidget in messages 1 - 14
|
||||
$ Note: do not localize the chars arrowSensitivity and DtARROWS_SENSITIVE
|
||||
1 DtSpinBoxWidget: Invalid arrowSensitivity resource (defaulting to DtARROWS_SENSITIVE).
|
||||
$ Note: do not localize the chars alignment and DtALIGNMENT_CENTER
|
||||
2 DtSpinBoxWidget: Invalid alignment resource (defaulting to DtALIGNMENT_CENTER).
|
||||
$ Note: do not localize the chars intialDelay
|
||||
3 DtSpinBoxWidget: Invalid initialDelay resource (defaulting to 250).
|
||||
$ Note: do not localize the chars marginHeight
|
||||
4 DtSpinBoxWidget: Invalid marginHeight resource (defaulting to 2).
|
||||
$ Note: do not localize the chars marginWidth
|
||||
5 DtSpinBoxWidget: Invalid marginWidth resource (defaulting to 2).
|
||||
$ Note: do not localize the chars arrowLayout and DtARROWS_BEGINNING
|
||||
6 DtSpinBoxWidget: Invalid arrowLayout resource (defaulting to DtARROWS_BEGINNING).
|
||||
$ Note: do not localize the chars repeatDelay
|
||||
7 DtSpinBoxWidget: Invalid repeatDelay resource (defaulting to 200).
|
||||
$ Note: do not localize the chars itemCount
|
||||
8 DtSpinBoxWidget: Invalid itemCount resource (defaulting to 0).
|
||||
$ Note: do not localize the chars position in messages 9 and 10
|
||||
9 DtSpinBoxWidget: Invalid position resource (defaulting to 0).
|
||||
10 DtSpinBoxWidget: Invalid position resource (defaulting to minimum).
|
||||
$ Note: do not localize the chars decimalPoints
|
||||
11 DtSpinBoxWidget: Invalid decimalPoints resource (defaulting to 0).
|
||||
$ Note: do not localize the chars minimum
|
||||
12 DtSpinBoxWidget: Invalid minimum resource (defaulting to maximum).
|
||||
$ Note: do not localize the chars textField
|
||||
13 DtSpinBoxWidget: Unable to set textField resource.
|
||||
$ Note: do not localize the chars DtSpinBoxSetItem
|
||||
14 DtSpinBoxWidget: Unable to find item to set (DtSpinBoxSetItem).
|
||||
|
||||
$ Label value
|
||||
15 SpinBox
|
||||
46
cde/lib/DtWidget/DtWidgetI.h
Normal file
46
cde/lib/DtWidget/DtWidgetI.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* $XConsortium: DtWidgetI.h /main/1 1996/03/26 19:53:18 drk $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 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.
|
||||
*/
|
||||
#ifndef _DtWidgetI_h
|
||||
#define _DtWidgetI_h
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
/******** Conditionally defined macros for thread safe DtWidget ******/
|
||||
#ifdef XTHREADS
|
||||
|
||||
#define _DtWidgetToAppContext(w) \
|
||||
XtAppContext app = XtWidgetToApplicationContext(w)
|
||||
|
||||
#define _DtDisplayToAppContext(d) \
|
||||
XtAppContext app = XtDisplayToApplicationContext(d)
|
||||
|
||||
#define _DtAppLock(app) XtAppLock(app)
|
||||
#define _DtAppUnlock(app) XtAppUnlock(app)
|
||||
#define _DtProcessLock() XtProcessLock()
|
||||
#define _DtProcessUnlock() XtProcessUnlock()
|
||||
|
||||
#else /* XTHREADS */
|
||||
|
||||
#define _DtWidgetToAppContext(w)
|
||||
#define _DtDisplayToAppContext(d)
|
||||
#define _DtAppLock(app)
|
||||
#define _DtAppUnlock(app)
|
||||
#define _DtProcessLock()
|
||||
#define _DtProcessUnlock()
|
||||
|
||||
#endif /* XTHREADS */
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtWidgetI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
1865
cde/lib/DtWidget/EditAreaData.c
Normal file
1865
cde/lib/DtWidget/EditAreaData.c
Normal file
File diff suppressed because it is too large
Load Diff
411
cde/lib/DtWidget/EditCalls.c
Normal file
411
cde/lib/DtWidget/EditCalls.c
Normal file
@@ -0,0 +1,411 @@
|
||||
/* $XConsortium: EditCalls.c /main/4 1996/03/26 19:53:27 drk $
|
||||
**********************************<+>*************************************
|
||||
***************************************************************************
|
||||
**
|
||||
** File: EditCalls.c
|
||||
**
|
||||
** Project: DtEditor widget interface for text edit services.
|
||||
**
|
||||
** Description: Contains the public functions related to undo,
|
||||
** cut, copy, paste, and the internal Modify/Verify callback.
|
||||
** -----------
|
||||
**
|
||||
*******************************************************************
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1993, 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.
|
||||
* (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of Novell, Inc.
|
||||
********************************************************************
|
||||
**
|
||||
**
|
||||
**************************************************************************
|
||||
**********************************<+>*************************************/
|
||||
|
||||
#include "EditorP.h"
|
||||
#include "DtWidgetI.h"
|
||||
|
||||
void
|
||||
_DtEditorResetUndo(
|
||||
DtEditorWidget editor)
|
||||
{
|
||||
|
||||
/*
|
||||
* Reset deletion & insertion contexts.
|
||||
*/
|
||||
|
||||
if( (M_deletedText(editor) != (char *)NULL) &&
|
||||
(strlen(M_deletedText(editor)) != 0) )
|
||||
{
|
||||
XtFree(M_deletedText(editor));
|
||||
M_deletedText(editor) = (char *) NULL;
|
||||
}
|
||||
|
||||
M_deletionStart(editor) = NO_DELETION_IN_PROGRESS;
|
||||
M_insertStart(editor) = 0;
|
||||
M_insertionLength(editor) = 0;
|
||||
|
||||
} /* end _DtEditorResetUndo */
|
||||
|
||||
|
||||
Boolean
|
||||
DtEditorUndoEdit(
|
||||
Widget widget)
|
||||
{
|
||||
DtEditorWidget pPriv = (DtEditorWidget) widget;
|
||||
_DtWidgetToAppContext(widget);
|
||||
_DtAppLock(app);
|
||||
|
||||
/*
|
||||
* Remove any insertion, and then put back any previous deletion.
|
||||
* The tricky part is that removing the insertion looks like a deletion
|
||||
* and the modifyVerify callback will save in the undo buffer, wiping
|
||||
* out any previous deletion (before we can reinsert it). So we have to
|
||||
* save the previous deletion before undoing the insertion so we can
|
||||
* reinsert it. Make sense?
|
||||
*/
|
||||
if(M_insertionLength(pPriv) != 0)
|
||||
{
|
||||
/*
|
||||
* There is an insertion so remove everything we just inserted
|
||||
*/
|
||||
if( (M_deletedText(pPriv) != (char *)NULL) &&
|
||||
(strlen(M_deletedText(pPriv)) != 0) )
|
||||
{
|
||||
/*
|
||||
* If there is a current deletion, save it before removing the
|
||||
* insertion so we can put it back (i.e. undo the deletion).
|
||||
*/
|
||||
int oldDeleteStart = M_deletionStart(pPriv);
|
||||
char *oldDeletion = M_deletedText(pPriv);
|
||||
M_deletedText(pPriv) = (char *)NULL;
|
||||
|
||||
/*
|
||||
* 1. Delete the last insertion.
|
||||
*/
|
||||
XmTextSetSelection(M_text(pPriv), M_insertStart(pPriv),
|
||||
M_insertStart(pPriv) + M_insertionLength(pPriv),
|
||||
CurrentTime);
|
||||
|
||||
M_insertionLength(pPriv)=0;
|
||||
XmTextRemove(M_text(pPriv));
|
||||
|
||||
/*
|
||||
* 2. Put back the previous deletion.
|
||||
*/
|
||||
XmTextInsert(M_text(pPriv), oldDeleteStart, oldDeletion);
|
||||
|
||||
XtFree(oldDeletion);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* There is no deletion, so we just have to remove the
|
||||
* insertion.
|
||||
*/
|
||||
XmTextSetSelection(M_text(pPriv), M_insertStart(pPriv),
|
||||
M_insertStart(pPriv) + M_insertionLength(pPriv),
|
||||
CurrentTime);
|
||||
M_insertionLength(pPriv) = 0;
|
||||
XmTextRemove(M_text(pPriv));
|
||||
}
|
||||
}
|
||||
else if(M_deletedText(pPriv) != (char *)NULL)
|
||||
{
|
||||
/*
|
||||
* Nothing has been inserted so just undo the previous deletion.
|
||||
*/
|
||||
|
||||
char *oldDeletion = M_deletedText(pPriv);
|
||||
M_deletedText(pPriv) = (char *)NULL;
|
||||
|
||||
XmTextInsert(M_text(pPriv), M_deletionStart(pPriv), oldDeletion);
|
||||
|
||||
XtFree(oldDeletion);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* There is no insertion to remove or deletion to put back in
|
||||
* (i.e. nothing to undo) so return False.
|
||||
*/
|
||||
_DtAppUnlock(app);
|
||||
return(False);
|
||||
}
|
||||
|
||||
_DtAppUnlock(app);
|
||||
return(True);
|
||||
|
||||
} /* end DtEditorUndoEdit */
|
||||
|
||||
Boolean
|
||||
DtEditorCutToClipboard(
|
||||
Widget widget)
|
||||
{
|
||||
|
||||
DtEditorWidget editor = (DtEditorWidget) widget;
|
||||
XEvent *event;
|
||||
_DtWidgetToAppContext(widget);
|
||||
_DtAppLock(app);
|
||||
|
||||
/*
|
||||
* Create an event with a correct timestamp
|
||||
*/
|
||||
event = (XEvent *) XtMalloc( sizeof(XEvent) );
|
||||
event->xkey.time = XtLastTimestampProcessed( M_display(editor) );
|
||||
|
||||
/*
|
||||
* Call routine to cut selection to clipboard
|
||||
*/
|
||||
XtCallActionProc(M_text(editor), "cut-clipboard", event, NULL, 0);
|
||||
|
||||
XtFree( (char *) event );
|
||||
|
||||
_DtAppUnlock(app);
|
||||
return(True);
|
||||
|
||||
}
|
||||
|
||||
Boolean
|
||||
DtEditorCopyToClipboard(
|
||||
Widget widget)
|
||||
{
|
||||
DtEditorWidget editor = (DtEditorWidget) widget;
|
||||
XEvent *event;
|
||||
_DtWidgetToAppContext(widget);
|
||||
_DtAppLock(app);
|
||||
|
||||
/*
|
||||
* Create an event with a correct timestamp
|
||||
*/
|
||||
event = (XEvent *) XtMalloc( sizeof(XEvent) );
|
||||
event->xkey.time = XtLastTimestampProcessed( M_display(editor) );
|
||||
|
||||
/*
|
||||
* Call routine to copy selection to clipboard
|
||||
*/
|
||||
XtCallActionProc(M_text(editor), "copy-clipboard", event, NULL, 0);
|
||||
|
||||
XtFree( (char *) event );
|
||||
|
||||
_DtAppUnlock(app);
|
||||
return(True);
|
||||
}
|
||||
|
||||
Boolean
|
||||
DtEditorPasteFromClipboard(
|
||||
Widget widget)
|
||||
{
|
||||
DtEditorWidget editor = (DtEditorWidget) widget;
|
||||
XEvent *event;
|
||||
_DtWidgetToAppContext(widget);
|
||||
_DtAppLock(app);
|
||||
|
||||
/*
|
||||
* Create an event with a correct timestamp
|
||||
*/
|
||||
event = (XEvent *) XtMalloc( sizeof(XEvent) );
|
||||
event->xkey.time = XtLastTimestampProcessed( M_display(editor) );
|
||||
|
||||
/*
|
||||
* Call routine to paste contents of clipboard at insertion cursor
|
||||
*/
|
||||
XtCallActionProc(M_text(editor), "paste-clipboard", event, NULL, 0);
|
||||
|
||||
XtFree( (char *) event );
|
||||
|
||||
_DtAppUnlock(app);
|
||||
return(True);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* SetUndoDeletionState maintains the contents of editStuff.undo related
|
||||
* to deletion (the deleted text & its original starting position).
|
||||
*
|
||||
* SetUndoDeletionState can also reset/invalidate the undo contents related to
|
||||
* insertion if it detects a "new" deletion. The idea is to treat consecutive
|
||||
* deletions as atomic from the viewpoint of undo. A delete is
|
||||
* non-consecutive if it's start or end position is not coincidental with
|
||||
* the last deletion. One set of consecutive insertions is allowed following
|
||||
* deletions, and will be undone by the DtEditorUndo(). Non-consecutive
|
||||
* insertions will reset/invalidate the deletion undo buffer.
|
||||
*/
|
||||
static void
|
||||
SetUndoDeletionState(
|
||||
DtEditorWidget pPriv,
|
||||
XmTextVerifyCallbackStruct *cb)
|
||||
{
|
||||
char *pDeletedText;
|
||||
|
||||
/*
|
||||
* Get the text which will be deleted from the text widget.
|
||||
*/
|
||||
pDeletedText = (char *)_XmStringSourceGetString(
|
||||
(XmTextWidget) M_text(pPriv),
|
||||
cb->startPos,
|
||||
cb->endPos,
|
||||
False);
|
||||
|
||||
if( M_deletedText(pPriv) != (char *)NULL &&
|
||||
M_insertionLength(pPriv) == 0 &&
|
||||
(cb->startPos == M_deletionStart(pPriv) ||
|
||||
cb->endPos == M_deletionStart(pPriv))
|
||||
)
|
||||
{
|
||||
/*
|
||||
* Continuation of the current deletion. For a continuation, there
|
||||
* must have been no intervening insertions, and we must be deleting
|
||||
* from the same point, either forward or backward.
|
||||
*/
|
||||
char *oldUndo = M_deletedText(pPriv);
|
||||
M_deletedText(pPriv) = XtMalloc( strlen(M_deletedText(pPriv)) +
|
||||
strlen(pDeletedText) + 1 );
|
||||
|
||||
if(cb->startPos == M_deletionStart(pPriv)) {
|
||||
/*
|
||||
* deleting forward - deletionStart remains the same.
|
||||
*/
|
||||
strcpy(M_deletedText(pPriv), oldUndo);
|
||||
strcat(M_deletedText(pPriv), pDeletedText);
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* deleting backward (e.g. Backspace)
|
||||
*/
|
||||
strcpy(M_deletedText(pPriv), pDeletedText);
|
||||
strcat(M_deletedText(pPriv), oldUndo);
|
||||
M_deletionStart(pPriv) = cb->startPos;
|
||||
}
|
||||
if(oldUndo != (char *)NULL)
|
||||
XtFree(oldUndo);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Starting a new deletion context. Replace the old deletion
|
||||
* context, and remove the insertion context.
|
||||
*/
|
||||
_DtEditorResetUndo( pPriv );
|
||||
|
||||
M_deletedText(pPriv) = XtMalloc(strlen(pDeletedText) + 1);
|
||||
|
||||
strcpy(M_deletedText(pPriv), pDeletedText);
|
||||
M_deletionStart(pPriv) = cb->startPos;
|
||||
M_insertStart(pPriv) = cb->startPos;
|
||||
M_insertionLength(pPriv) = 0;
|
||||
}
|
||||
|
||||
if( pDeletedText != (char *)NULL )
|
||||
XtFree( pDeletedText );
|
||||
} /* SetUndoDeletionState */
|
||||
|
||||
/*
|
||||
* SetUndoInsertionState maintains the contents of editStuff.undo related
|
||||
* to insertions (the number of characters inserted & the position of the
|
||||
* first one).
|
||||
*/
|
||||
static void
|
||||
SetUndoInsertionState(
|
||||
DtEditorWidget pPriv,
|
||||
XmTextVerifyCallbackStruct *cb)
|
||||
{
|
||||
if(M_insertionLength(pPriv) == 0) {
|
||||
/*
|
||||
* We've started a new deletion context, so reset the insertion
|
||||
* context.
|
||||
*/
|
||||
M_insertStart(pPriv) = cb->startPos;
|
||||
M_insertionLength(pPriv) = _DtEditor_CountCharacters(cb->text->ptr,
|
||||
cb->text->length);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Determine if we're continuing the current insertion context
|
||||
* or beginning a new one.
|
||||
*/
|
||||
if(cb->startPos == (M_insertStart(pPriv) + M_insertionLength(pPriv)))
|
||||
M_insertionLength(pPriv) += _DtEditor_CountCharacters(
|
||||
cb->text->ptr, cb->text->length);
|
||||
else
|
||||
{
|
||||
/*
|
||||
* We're starting a new insertion context, so invalidate any
|
||||
* existing deletion context, and reset the insertion context.
|
||||
*/
|
||||
_DtEditorResetUndo( pPriv );
|
||||
M_insertStart(pPriv) = cb->startPos;
|
||||
M_insertionLength(pPriv) = _DtEditor_CountCharacters(
|
||||
cb->text->ptr, cb->text->length);
|
||||
}
|
||||
}
|
||||
} /* SetUndoInsertionState */
|
||||
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* _DtEditorModifyVerifyCB - The modify/verify callback
|
||||
*
|
||||
* The modify verify callback handles incoming data and the data which
|
||||
* will be replaced. The replaced data is saved (for later undos).
|
||||
*
|
||||
* Parameters:
|
||||
* widget - the text widget
|
||||
* client_data - the edit area widget
|
||||
* call_data - callback structure
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
_DtEditorModifyVerifyCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data )
|
||||
{
|
||||
register XmTextVerifyCallbackStruct * cb =
|
||||
(XmTextVerifyCallbackStruct *) call_data;
|
||||
DtEditorWidget editor = (DtEditorWidget) client_data;
|
||||
|
||||
/*
|
||||
* Loading all new data so no need to set up the data for later undos
|
||||
*/
|
||||
if (M_loadingAllNewData(editor) == True)
|
||||
{
|
||||
_DtEditorResetUndo( editor );
|
||||
M_unreadChanges(editor) = False;
|
||||
M_loadingAllNewData(editor) = False;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/*
|
||||
* Adding additional data, rather than replacing all of the contents.
|
||||
*
|
||||
* Mark that the contents have been modified since the last time the
|
||||
* application requested a copy.
|
||||
*/
|
||||
M_unreadChanges(editor) = True;
|
||||
|
||||
/*
|
||||
* First, account for any data which will be removed by the new data.
|
||||
* If text is being deleted, then grab a copy for later undo's.
|
||||
*/
|
||||
if(cb->endPos > cb->startPos)
|
||||
SetUndoDeletionState(editor, cb);
|
||||
|
||||
/*
|
||||
* If text is being inserted, then change the undo insertion state.
|
||||
*/
|
||||
if(cb->text->length > 0)
|
||||
SetUndoInsertionState(editor, cb);
|
||||
|
||||
}
|
||||
|
||||
} /* end ModifyVerifyCB */
|
||||
|
||||
8273
cde/lib/DtWidget/Editor.c
Normal file
8273
cde/lib/DtWidget/Editor.c
Normal file
File diff suppressed because it is too large
Load Diff
594
cde/lib/DtWidget/Editor.h
Normal file
594
cde/lib/DtWidget/Editor.h
Normal file
@@ -0,0 +1,594 @@
|
||||
/* $XConsortium: Editor.h /main/3 1995/10/26 09:32:07 rswiston $ */
|
||||
/*
|
||||
* (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 _Dt_Editor_h
|
||||
#define _Dt_Editor_h
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
|
||||
/* Sources of Help requests */
|
||||
/* Used with XmNhelpCallback */
|
||||
|
||||
#define DtEDITOR_HELP_EDIT_WINDOW 1
|
||||
#define DtEDITOR_HELP_STATUS_LINE 2
|
||||
#define DtEDITOR_HELP_STATUS_CURRENT_LINE 3
|
||||
#define DtEDITOR_HELP_STATUS_TOTAL_LINES 4
|
||||
#define DtEDITOR_HELP_STATUS_MESSAGE 5
|
||||
#define DtEDITOR_HELP_STATUS_OVERSTRIKE 6
|
||||
#define DtEDITOR_HELP_FORMAT_DIALOG 7
|
||||
#define DtEDITOR_HELP_FORMAT_LEFT_MARGIN 8
|
||||
#define DtEDITOR_HELP_FORMAT_RIGHT_MARGIN 9
|
||||
#define DtEDITOR_HELP_FORMAT_ALIGNMENT 10
|
||||
#define DtEDITOR_HELP_CHANGE_DIALOG 11
|
||||
#define DtEDITOR_HELP_CHANGE_FIND 12
|
||||
#define DtEDITOR_HELP_CHANGE_CHANGE 13
|
||||
#define DtEDITOR_HELP_SPELL_DIALOG 14
|
||||
#define DtEDITOR_HELP_SPELL_MISSPELLED_WORDS 15
|
||||
#define DtEDITOR_HELP_SPELL_CHANGE 16
|
||||
|
||||
/* Specifies the last line in the edit area */
|
||||
/* Used with DtEditorGoToLine */
|
||||
#define DtEDITOR_LAST_LINE -999
|
||||
|
||||
/* Resource constants */
|
||||
|
||||
#ifndef DtNautoShowCursorPosition
|
||||
#define DtNautoShowCursorPosition XmNautoShowCursorPosition
|
||||
#endif
|
||||
#ifndef DtCAutoShowCursorPosition
|
||||
#define DtCAutoShowCursorPosition XmCAutoShowCursorPosition
|
||||
#endif
|
||||
#ifndef DtNblinkRate
|
||||
#define DtNblinkRate XmNblinkRate
|
||||
#endif
|
||||
#ifndef DtCBlinkRate
|
||||
#define DtCBlinkRate XmCBlinkRate
|
||||
#endif
|
||||
#ifndef DtNbuttonFontList
|
||||
#define DtNbuttonFontList XmNbuttonFontList
|
||||
#endif
|
||||
#ifndef DtCFontList
|
||||
#define DtCFontList XmCFontList
|
||||
#endif
|
||||
#ifndef DtNcenterToggleLabel
|
||||
#define DtNcenterToggleLabel "centerToggleLabel"
|
||||
#endif
|
||||
#ifndef DtCCenterToggleLabel
|
||||
#define DtCCenterToggleLabel "CenterToggleLabel"
|
||||
#endif
|
||||
#ifndef DtNchangeAllButtonLabel
|
||||
#define DtNchangeAllButtonLabel "changeAllButtonLabel"
|
||||
#endif
|
||||
#ifndef DtCChangeAllButtonLabel
|
||||
#define DtCChangeAllButtonLabel "ChangeAllButtonLabel"
|
||||
#endif
|
||||
#ifndef DtNchangeButtonLabel
|
||||
#define DtNchangeButtonLabel "changeButtonLabel"
|
||||
#endif
|
||||
#ifndef DtCChangeButtonLabel
|
||||
#define DtCChangeButtonLabel "ChangeButtonLabel"
|
||||
#endif
|
||||
#ifndef DtNchangeFieldLabel
|
||||
#define DtNchangeFieldLabel "changeFieldLabel"
|
||||
#endif
|
||||
#ifndef DtCChangeFieldLabel
|
||||
#define DtCChangeFieldLabel "ChangeFieldLabel"
|
||||
#endif
|
||||
#ifndef DtNcolumns
|
||||
#define DtNcolumns XmNcolumns
|
||||
#endif
|
||||
#ifndef DtCColumns
|
||||
#define DtCColumns XmCColumns
|
||||
#endif
|
||||
#ifndef DtNcurrentLineLabel
|
||||
#define DtNcurrentLineLabel "currentLineLabel"
|
||||
#endif
|
||||
#ifndef DtCCurrentLineLabel
|
||||
#define DtCCurrentLineLabel "CurrentLineLabel"
|
||||
#endif
|
||||
#ifndef DtNcursorPosition
|
||||
#define DtNcursorPosition XmNcursorPosition
|
||||
#endif
|
||||
#ifndef DtCCursorPosition
|
||||
#define DtCCursorPosition XmCCursorPosition
|
||||
#endif
|
||||
#ifndef DtNcursorPositionVisible
|
||||
#define DtNcursorPositionVisible XmNcursorPositionVisible
|
||||
#endif
|
||||
#ifndef DtCCursorPositionVisible
|
||||
#define DtCCursorPositionVisible XmCCursorPositionVisible
|
||||
#endif
|
||||
#ifndef DtNdialogTitle
|
||||
#define DtNdialogTitle "dialogTitle"
|
||||
#endif
|
||||
#ifndef DtCDialogTitle
|
||||
#define DtCDialogTitle XmCDialogTitle
|
||||
#endif
|
||||
#ifndef DtNeditable
|
||||
#define DtNeditable XmNeditable
|
||||
#endif
|
||||
#ifndef DtCEditable
|
||||
#define DtCEditable XmCEditable
|
||||
#endif
|
||||
#ifndef DtNfindButtonLabel
|
||||
#define DtNfindButtonLabel "findButtonLabel"
|
||||
#endif
|
||||
#ifndef DtCFindButtonLabel
|
||||
#define DtCFindButtonLabel "FindButtonLabel"
|
||||
#endif
|
||||
#ifndef DtNfindChangeDialogTitle
|
||||
#define DtNfindChangeDialogTitle "findChangeDialogTitle"
|
||||
#endif
|
||||
#ifndef DtCFindChangeDialogTitle
|
||||
#define DtCFindChangeDialogTitle "FindChangeDialogTitle"
|
||||
#endif
|
||||
#ifndef DtNfindFieldLabel
|
||||
#define DtNfindFieldLabel "findFieldLabel"
|
||||
#endif
|
||||
#ifndef DtCFindFieldLabel
|
||||
#define DtCFindFieldLabel "FindFieldLabel"
|
||||
#endif
|
||||
#ifndef DtNformatAllButtonLabel
|
||||
#define DtNformatAllButtonLabel "formatAllButtonLabel"
|
||||
#endif
|
||||
#ifndef DtCFormatAllButtonLabel
|
||||
#define DtCFormatAllButtonLabel "FormatAllButtonLabel"
|
||||
#endif
|
||||
#ifndef DtNformatParagraphButtonLabel
|
||||
#define DtNformatParagraphButtonLabel "formatParagraphButtonLabel"
|
||||
#endif
|
||||
#ifndef DtCFormatParagraphButtonLabel
|
||||
#define DtCFormatParagraphButtonLabel "FormatParagraphButtonLabel"
|
||||
#endif
|
||||
#ifndef DtNformatSettingsDialogTitle
|
||||
#define DtNformatSettingsDialogTitle "formatSettingsDialogTitle"
|
||||
#endif
|
||||
#ifndef DtCFormatSettingsDialogTitle
|
||||
#define DtCFormatSettingsDialogTitle "FormatSettingsDialogTitle"
|
||||
#endif
|
||||
#ifndef DtNinformationDialogTitle
|
||||
#define DtNinformationDialogTitle "informationDialogTitle"
|
||||
#endif
|
||||
#ifndef DtCInformationDialogTitle
|
||||
#define DtCInformationDialogTitle "InformationDialogTitle"
|
||||
#endif
|
||||
#ifndef DtNinsertLabel
|
||||
#define DtNinsertLabel "insertLabel"
|
||||
#endif
|
||||
#ifndef DtCInsertLabel
|
||||
#define DtCInsertLabel "InsertLabel"
|
||||
#endif
|
||||
#ifndef DtNjustifyToggleLabel
|
||||
#define DtNjustifyToggleLabel "justifyToggleLabel"
|
||||
#endif
|
||||
#ifndef DtCJustifyToggleLabel
|
||||
#define DtCJustifyToggleLabel "JustifyToggleLabel"
|
||||
#endif
|
||||
#ifndef DtNlabelFontList
|
||||
#define DtNlabelFontList XmNlabelFontList
|
||||
#endif
|
||||
#ifndef DtNleftAlignToggleLabel
|
||||
#define DtNleftAlignToggleLabel "leftAlignToggleLabel"
|
||||
#endif
|
||||
#ifndef DtCLeftAlignToggleLabel
|
||||
#define DtCLeftAlignToggleLabel "LeftAlignToggleLabel"
|
||||
#endif
|
||||
#ifndef DtNleftMarginFieldLabel
|
||||
#define DtNleftMarginFieldLabel "leftMarginFieldLabel"
|
||||
#endif
|
||||
#ifndef DtCLeftMarginFieldLabel
|
||||
#define DtCLeftMarginFieldLabel "LeftMarginFieldLabel"
|
||||
#endif
|
||||
#ifndef DtNmaxLength
|
||||
#define DtNmaxLength XmNmaxLength
|
||||
#endif
|
||||
#ifndef DtCMaxLength
|
||||
#define DtCMaxLength XmCMaxLength
|
||||
#endif
|
||||
#ifndef DtNmisspelledListLabel
|
||||
#define DtNmisspelledListLabel "misspelledListLabel"
|
||||
#endif
|
||||
#ifndef DtCMisspelledListLabel
|
||||
#define DtCMisspelledListLabel "MisspelledListLabel"
|
||||
#endif
|
||||
#ifndef DtNoverstrike
|
||||
#define DtNoverstrike "overstrike"
|
||||
#endif
|
||||
#ifndef DtCOverstrike
|
||||
#define DtCOverstrike "Overstrike"
|
||||
#endif
|
||||
#ifndef DtNoverstrikeLabel
|
||||
#define DtNoverstrikeLabel "overstrikeLabel"
|
||||
#endif
|
||||
#ifndef DtCOverstrikeLabel
|
||||
#define DtCOverstrikeLabel "OverstrikeLabel"
|
||||
#endif
|
||||
#ifndef DtNrightAlignToggleLabel
|
||||
#define DtNrightAlignToggleLabel "rightAlignToggleLabel"
|
||||
#endif
|
||||
#ifndef DtCRightAlignToggleLabel
|
||||
#define DtCRightAlignToggleLabel "RightAlignToggleLabel"
|
||||
#endif
|
||||
#ifndef DtNrightMarginFieldLabel
|
||||
#define DtNrightMarginFieldLabel "rightMarginFieldLabel"
|
||||
#endif
|
||||
#ifndef DtCRightMarginFieldLabel
|
||||
#define DtCRightMarginFieldLabel "RightMarginFieldLabel"
|
||||
#endif
|
||||
#ifndef DtNrows
|
||||
#define DtNrows XmNrows
|
||||
#endif
|
||||
#ifndef DtCRows
|
||||
#define DtCRows XmCRows
|
||||
#endif
|
||||
#ifndef DtNscrollHorizontal
|
||||
#define DtNscrollHorizontal XmNscrollHorizontal
|
||||
#endif
|
||||
#ifndef DtCScroll
|
||||
#define DtCScroll XmCScroll
|
||||
#endif
|
||||
#ifndef DtNscrollLeftSide
|
||||
#define DtNscrollLeftSide XmNscrollLeftSide
|
||||
#endif
|
||||
#ifndef DtCScrollSide
|
||||
#define DtCScrollSide XmCScrollSide
|
||||
#endif
|
||||
#ifndef DtNscrollTopSide
|
||||
#define DtNscrollTopSide XmNscrollTopSide
|
||||
#endif
|
||||
#ifndef DtNscrollVertical
|
||||
#define DtNscrollVertical XmNscrollVertical
|
||||
#endif
|
||||
#ifndef DtNshowStatusLine
|
||||
#define DtNshowStatusLine "showStatusLine"
|
||||
#endif
|
||||
#ifndef DtCShowStatusLine
|
||||
#define DtCShowStatusLine "ShowStatusLine"
|
||||
#endif
|
||||
#ifndef DtNspellDialogTitle
|
||||
#define DtNspellDialogTitle "spellDialogTitle"
|
||||
#endif
|
||||
#ifndef DtCSpellDialogTitle
|
||||
#define DtCSpellDialogTitle "SpellDialogTitle"
|
||||
#endif
|
||||
#ifndef DtNspellFilter
|
||||
#define DtNspellFilter "spellFilter"
|
||||
#endif
|
||||
#ifndef DtCSpellFilter
|
||||
#define DtCSpellFilter "SpellFilter"
|
||||
#endif
|
||||
#ifndef DtNtextBackground
|
||||
#define DtNtextBackground "textBackground"
|
||||
#endif
|
||||
#ifndef DtCBackground
|
||||
#define DtCBackground XmCBackground
|
||||
#endif
|
||||
#ifndef DtNtextDeselectCallback
|
||||
#define DtNtextDeselectCallback "textDeselectCallback"
|
||||
#endif
|
||||
#ifndef DtNtextFontList
|
||||
#define DtNtextFontList XmNtextFontList
|
||||
#endif
|
||||
#ifndef DtNtextForeground
|
||||
#define DtNtextForeground "textForeground"
|
||||
#endif
|
||||
#ifndef DtCForeground
|
||||
#define DtCForeground XmCForeground
|
||||
#endif
|
||||
#ifndef DtNtextSelectCallback
|
||||
#define DtNtextSelectCallback "textSelectCallback"
|
||||
#endif
|
||||
#ifndef DtNtextTranslations
|
||||
#define DtNtextTranslations XmNtextTranslations
|
||||
#endif
|
||||
#ifndef DtCTranslations
|
||||
#define DtCTranslations XmCTranslations
|
||||
#endif
|
||||
#ifndef DtCCallback
|
||||
#define DtCCallback XmCCallback
|
||||
#endif
|
||||
#ifndef DtNtopCharacter
|
||||
#define DtNtopCharacter XmNtopCharacter
|
||||
#endif
|
||||
#ifndef DtCTopCharacter
|
||||
#define DtCTopCharacter XmCTopCharacter
|
||||
#endif
|
||||
#ifndef DtNtotalLineCountLabel
|
||||
#define DtNtotalLineCountLabel "totalLineCountLabel"
|
||||
#endif
|
||||
#ifndef DtCTotalLineCountLabel
|
||||
#define DtCTotalLineCountLabel "TotalLineCountLabel"
|
||||
#endif
|
||||
#ifndef DtNwordWrap
|
||||
#define DtNwordWrap XmNwordWrap
|
||||
#endif
|
||||
#ifndef DtCWordWrap
|
||||
#define DtCWordWrap XmCWordWrap
|
||||
#endif
|
||||
|
||||
#ifndef DtEditorHelpCallbackStruct
|
||||
#define DtEditorHelpCallbackStruct XmAnyCallbackStruct
|
||||
#endif
|
||||
#ifndef DtEditorSelectCallbackStruct
|
||||
#define DtEditorSelectCallbackStruct XmAnyCallbackStruct
|
||||
#endif
|
||||
#ifndef DtEditorDeselectCallbackStruct
|
||||
#define DtEditorDeselectCallbackStruct XmAnyCallbackStruct
|
||||
#endif
|
||||
|
||||
|
||||
/* Used with DtEditorChange() */
|
||||
|
||||
enum {
|
||||
DtEDITOR_CURRENT_SELECTION,
|
||||
DtEDITOR_NEXT_OCCURRENCE,
|
||||
DtEDITOR_ALL_OCCURRENCES
|
||||
};
|
||||
|
||||
/* Used with DtEditorFormat() */
|
||||
|
||||
enum {
|
||||
DtEDITOR_FORMAT_ALL,
|
||||
DtEDITOR_FORMAT_PARAGRAPH
|
||||
};
|
||||
|
||||
enum {
|
||||
DtEDITOR_ALIGN_CENTER,
|
||||
DtEDITOR_ALIGN_JUSTIFY,
|
||||
DtEDITOR_ALIGN_LEFT,
|
||||
DtEDITOR_ALIGN_RIGHT
|
||||
};
|
||||
|
||||
/* Used with DtNtextSelectCallback */
|
||||
enum {
|
||||
DtEDITOR_TEXT_SELECT,
|
||||
DtEDITOR_TEXT_DESELECT
|
||||
};
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
|
||||
typedef enum _DtEditorErrorCode{
|
||||
DtEDITOR_NO_ERRORS,
|
||||
DtEDITOR_INVALID_TYPE,
|
||||
DtEDITOR_INVALID_RANGE,
|
||||
DtEDITOR_NULL_ITEM,
|
||||
DtEDITOR_ILLEGAL_SIZE,
|
||||
DtEDITOR_SPELL_FILTER_FAILED,
|
||||
DtEDITOR_NO_TMP_FILE,
|
||||
DtEDITOR_INVALID_FILENAME,
|
||||
DtEDITOR_NONEXISTENT_FILE,
|
||||
DtEDITOR_UNREADABLE_FILE,
|
||||
DtEDITOR_READ_ONLY_FILE,
|
||||
DtEDITOR_NO_FILE_ACCESS,
|
||||
DtEDITOR_DIRECTORY,
|
||||
DtEDITOR_CHAR_SPECIAL_FILE,
|
||||
DtEDITOR_BLOCK_MODE_FILE,
|
||||
DtEDITOR_UNWRITABLE_FILE,
|
||||
DtEDITOR_WRITABLE_FILE,
|
||||
DtEDITOR_SAVE_FAILED,
|
||||
DtEDITOR_INSUFFICIENT_MEMORY,
|
||||
DtEDITOR_NULLS_REMOVED
|
||||
} DtEditorErrorCode;
|
||||
|
||||
|
||||
/* Used with DtEditorChange() to specify Find and Change To strings */
|
||||
|
||||
typedef struct _DtEditorChangeValues {
|
||||
char *find;
|
||||
char *changeTo;
|
||||
} DtEditorChangeValues;
|
||||
|
||||
/* Used with DtEditorFormat() to specify left margin, right margin *
|
||||
* and justification styles. */
|
||||
|
||||
typedef struct _DtEditorFormatSettings {
|
||||
int leftMargin;
|
||||
int rightMargin;
|
||||
unsigned int alignment;
|
||||
} DtEditorFormatSettings;
|
||||
|
||||
/* Types used to tag data to/from the editor widget */
|
||||
|
||||
typedef enum _DtEditorDataFormat{
|
||||
DtEDITOR_TEXT,
|
||||
DtEDITOR_WCHAR,
|
||||
DtEDITOR_DATA
|
||||
} DtEditorDataFormat;
|
||||
|
||||
|
||||
/* Types used to pass data to/from the editor widget */
|
||||
|
||||
typedef struct _DtEditor_DataObj {
|
||||
unsigned int length;
|
||||
void *buf;
|
||||
} DtEditor_DataObj;
|
||||
|
||||
typedef struct _DtEditorContentRec {
|
||||
DtEditorDataFormat type;
|
||||
union {
|
||||
char *string;
|
||||
wchar_t *wchar;
|
||||
DtEditor_DataObj data;
|
||||
} value;
|
||||
} DtEditorContentRec;
|
||||
|
||||
|
||||
/* Widget class and instance */
|
||||
|
||||
typedef struct _DtEditorClassRec *DtEditorClass;
|
||||
typedef struct _DtEditorRec *DtEditorWidget;
|
||||
|
||||
|
||||
/*
|
||||
* Data
|
||||
*/
|
||||
|
||||
/* Widget class */
|
||||
|
||||
externalref WidgetClass dtEditorWidgetClass;
|
||||
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
|
||||
extern Widget DtCreateEditor(
|
||||
Widget parent,
|
||||
char *name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount);
|
||||
|
||||
extern DtEditorErrorCode DtEditorAppend(
|
||||
Widget widget,
|
||||
DtEditorContentRec *data);
|
||||
|
||||
extern DtEditorErrorCode DtEditorAppendFromFile(
|
||||
Widget widget,
|
||||
char *fileName);
|
||||
|
||||
extern Boolean DtEditorChange(
|
||||
Widget widget,
|
||||
DtEditorChangeValues *findChangeStrings,
|
||||
unsigned int instanceToChange);
|
||||
|
||||
extern Boolean DtEditorCheckForUnsavedChanges(
|
||||
Widget widget);
|
||||
|
||||
extern Boolean DtEditorClearSelection(
|
||||
Widget widget);
|
||||
|
||||
extern Boolean DtEditorCopyToClipboard(
|
||||
Widget widget);
|
||||
|
||||
extern Boolean DtEditorCutToClipboard(
|
||||
Widget widget);
|
||||
|
||||
extern Boolean DtEditorDeleteSelection(
|
||||
Widget widget);
|
||||
|
||||
extern Boolean DtEditorDeselect(
|
||||
Widget widget);
|
||||
|
||||
extern void DtEditorDisableRedisplay(
|
||||
Widget widget);
|
||||
|
||||
extern void DtEditorEnableRedisplay(
|
||||
Widget widget);
|
||||
|
||||
extern Boolean DtEditorFind(
|
||||
Widget widget,
|
||||
char * find);
|
||||
|
||||
extern DtEditorErrorCode DtEditorFormat(
|
||||
Widget widget,
|
||||
DtEditorFormatSettings *formatSettings,
|
||||
unsigned int amountToFormat);
|
||||
|
||||
extern DtEditorErrorCode DtEditorGetContents(
|
||||
Widget widget,
|
||||
DtEditorContentRec *data,
|
||||
Boolean hardCarriageReturns,
|
||||
Boolean markContentsAsSaved);
|
||||
|
||||
extern XmTextPosition DtEditorGetInsertionPosition(
|
||||
Widget widget);
|
||||
|
||||
extern XmTextPosition DtEditorGetLastPosition(
|
||||
Widget widget);
|
||||
|
||||
extern Widget DtEditorGetMessageTextFieldID(
|
||||
Widget widget);
|
||||
|
||||
extern void DtEditorGetSizeHints(
|
||||
Widget widget,
|
||||
XSizeHints *pHints);
|
||||
|
||||
extern void DtEditorGoToLine(
|
||||
Widget widget,
|
||||
int lineNumber);
|
||||
|
||||
extern DtEditorErrorCode DtEditorInsert(
|
||||
Widget widget,
|
||||
DtEditorContentRec *data);
|
||||
|
||||
extern DtEditorErrorCode DtEditorInsertFromFile(
|
||||
Widget widget,
|
||||
char *fileName);
|
||||
|
||||
extern void DtEditorInvokeFindChangeDialog(
|
||||
Widget widget);
|
||||
|
||||
extern void DtEditorInvokeFormatDialog(
|
||||
Widget widget);
|
||||
|
||||
extern DtEditorErrorCode DtEditorInvokeSpellDialog(
|
||||
Widget widget);
|
||||
|
||||
extern Boolean DtEditorPasteFromClipboard(
|
||||
Widget widget);
|
||||
|
||||
extern DtEditorErrorCode DtEditorReplace(
|
||||
Widget widget,
|
||||
XmTextPosition startPos,
|
||||
XmTextPosition endPos,
|
||||
DtEditorContentRec *data);
|
||||
|
||||
extern DtEditorErrorCode DtEditorReplaceFromFile(
|
||||
Widget widget,
|
||||
XmTextPosition startPos,
|
||||
XmTextPosition endPos,
|
||||
char *fileName);
|
||||
|
||||
extern void DtEditorReset(
|
||||
Widget widget);
|
||||
|
||||
extern DtEditorErrorCode DtEditorSaveContentsToFile(
|
||||
Widget widget,
|
||||
char *fileName,
|
||||
Boolean overwriteIfExists,
|
||||
Boolean hardCarriageReturns,
|
||||
Boolean markContentsAsSaved);
|
||||
|
||||
extern Boolean DtEditorSelectAll(
|
||||
Widget widget);
|
||||
|
||||
extern DtEditorErrorCode DtEditorSetContents(
|
||||
Widget widget,
|
||||
DtEditorContentRec *data);
|
||||
|
||||
extern DtEditorErrorCode DtEditorSetContentsFromFile(
|
||||
Widget widget,
|
||||
char *fileName);
|
||||
|
||||
extern void DtEditorSetInsertionPosition(
|
||||
Widget widget,
|
||||
XmTextPosition position);
|
||||
|
||||
extern void DtEditorTraverseToEditor(
|
||||
Widget widget);
|
||||
|
||||
extern Boolean DtEditorUndoEdit(
|
||||
Widget widget);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _Dt_Editor_h */
|
||||
688
cde/lib/DtWidget/EditorP.h
Normal file
688
cde/lib/DtWidget/EditorP.h
Normal file
@@ -0,0 +1,688 @@
|
||||
/* $XConsortium: EditorP.h /main/4 1996/06/19 11:28:20 cde-dec $ */
|
||||
/**********************************<+>*************************************
|
||||
***************************************************************************
|
||||
**
|
||||
** File: EditorP.h
|
||||
**
|
||||
** Project: DtEditor widget
|
||||
**
|
||||
** Description:
|
||||
** -----------
|
||||
** Private include file for the DtEditor widget, text editor class.
|
||||
**
|
||||
*******************************************************************
|
||||
*
|
||||
* (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.
|
||||
*
|
||||
********************************************************************
|
||||
**
|
||||
**
|
||||
**************************************************************************
|
||||
**********************************<+>*************************************/
|
||||
#ifndef _DtEditorP_h
|
||||
#define _DtEditorP_h
|
||||
|
||||
#include <Dt/Editor.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <X11/StringDefs.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
#include <Xm/Protocols.h>
|
||||
#include <Xm/XmP.h>
|
||||
#include <Xm/FormP.h>
|
||||
#include <Xm/TextP.h>
|
||||
|
||||
#include "MacrosP.h"
|
||||
#include <Dt/Dts.h>
|
||||
|
||||
#ifdef SENTINEL
|
||||
#include <sentinel.h>
|
||||
#endif /* SENTINEL */
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Defines
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
#define READ_ACCESS 1
|
||||
#define WRITE_ACCESS 2
|
||||
|
||||
#define REPLACE 0
|
||||
#define FIND 1
|
||||
#define SPELL 2
|
||||
|
||||
#define UNKNOWN_ACTION -1
|
||||
#define EXTEND_SELECTION 0
|
||||
#define ICON_FOCUSED 1
|
||||
|
||||
#define NO_DELETION_IN_PROGRESS -999
|
||||
|
||||
#ifndef DtUNSPECIFIED
|
||||
#define DtUNSPECIFIED (~0)
|
||||
#endif
|
||||
|
||||
|
||||
#define CLOSE_BUTTON DTWIDGET_GETMESSAGE( \
|
||||
MS_Common, MSG_CLOSE, _DtMsgCommon_0000)
|
||||
|
||||
#define HELP_BUTTON DTWIDGET_GETMESSAGE( \
|
||||
MS_Common, MSG_HELP, _DtMsgCommon_0001)
|
||||
|
||||
#define FORMAT_SETTINGS DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_FORMAT_SETTINGS, _DtMsgEditor_0000)
|
||||
|
||||
#define RIGHT_MARGIN DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_RIGHT_MARGIN, _DtMsgEditor_0001)
|
||||
|
||||
#define LEFT_MARGIN DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_LEFT_MARGIN, _DtMsgEditor_0002)
|
||||
|
||||
#define LEFT_ALIGN DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_LEFT_ALIGN, _DtMsgEditor_0003)
|
||||
|
||||
#define RIGHT_ALIGN DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_RIGHT_ALIGN, _DtMsgEditor_0004)
|
||||
|
||||
#define JUSTIFY DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_JUSTIFY, _DtMsgEditor_0005)
|
||||
|
||||
#define CENTER DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_CENTER, _DtMsgEditor_0006)
|
||||
|
||||
#define PARAGRAPH DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_PARAGRAPH, _DtMsgEditor_0007)
|
||||
|
||||
#define ALL DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_ALL, _DtMsgEditor_0008)
|
||||
|
||||
#define SPELL_TITLE DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_SPELL_TITLE, _DtMsgEditor_0009)
|
||||
|
||||
#define FIND_TITLE DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_FIND_TITLE, _DtMsgEditor_0010)
|
||||
|
||||
#define MISSPELLED DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_MISSPELLED, _DtMsgEditor_0011)
|
||||
|
||||
#define FIND_LABEL DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_FIND_LABEL, _DtMsgEditor_0012)
|
||||
|
||||
#define CHANGE_LABEL DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_CHANGE_LABEL, _DtMsgEditor_0013)
|
||||
|
||||
#define FIND_BUTTON DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_FIND_BUTTON, _DtMsgEditor_0014)
|
||||
|
||||
#define CHANGE_BUTTON DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_CHANGE_BUTTON, _DtMsgEditor_0015)
|
||||
|
||||
#define CHNG_ALL_BUTTON DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_CHNG_ALL_BUTTON, _DtMsgEditor_0016)
|
||||
|
||||
#define NO_FIND DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_NO_FIND, _DtMsgEditor_0017)
|
||||
|
||||
#define INFO_TITLE DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_INFO_TITLE, _DtMsgEditor_0018)
|
||||
|
||||
#define LINE DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_LINE, _DtMsgEditor_0019)
|
||||
|
||||
#define TOTAL DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_TOTAL, _DtMsgEditor_0020)
|
||||
|
||||
#define OVR DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_OVR, _DtMsgEditor_0021)
|
||||
|
||||
#define INS DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_INS, _DtMsgEditor_0022)
|
||||
|
||||
#define BAD_FILTER DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_FILTER_ERROR, _DtMsgEditor_0023)
|
||||
|
||||
#define BAD_FILTER2 DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_FILTER_ERROR2, _DtMsgEditor_0024)
|
||||
|
||||
#define ERROR_TITLE DTWIDGET_GETMESSAGE( \
|
||||
MS_Editor, EDITOR_ERROR_TITLE, _DtMsgEditor_0025)
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Structures
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
typedef struct _AdjRec {
|
||||
int bflag; /* -b (blanks) option */
|
||||
int cflag; /* -c (center) option */
|
||||
int jflag; /* -j (justify) option */
|
||||
int rflag; /* -r (right justify) */
|
||||
int tabsize; /* tab size in use */
|
||||
long margin;
|
||||
FILE *infp; /* file pointer for unformatted data */
|
||||
FILE *outfp; /* file pointer for formatted data */
|
||||
} AdjRec, *AdjRecPtr;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Deleted text structure definition
|
||||
*
|
||||
****************************************************************/
|
||||
typedef struct _DtEditorUndoRec {
|
||||
char *deletedText;
|
||||
XmTextPosition deletionStart;
|
||||
XmTextPosition insertStart;
|
||||
int insertionLength;
|
||||
} DtEditorUndoRec;
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Data structures for miscellaneous edit information
|
||||
*
|
||||
****************************************************************/
|
||||
typedef struct _DtEditorEditStuff
|
||||
{
|
||||
int blinkRate,
|
||||
maxLength;
|
||||
short columns, rows;
|
||||
XmTextPosition cursorPos,
|
||||
topCharacter;
|
||||
Boolean autoShowCursorPos,
|
||||
cursorPosVisible,
|
||||
editable,
|
||||
overstrikeMode,
|
||||
scrollHorizontal,
|
||||
scrollLeft,
|
||||
scrollTop,
|
||||
scrollVertical,
|
||||
wordWrap;
|
||||
Pixel background,
|
||||
foreground;
|
||||
int fontWidth, /* widest font, used for formatting */
|
||||
fontHeight; /* font height; used for WM size hints */
|
||||
|
||||
DtEditorUndoRec undo; /* holds deleted text for undo */
|
||||
|
||||
Boolean loadingAllNewData,
|
||||
unreadChanges; /* Data changed since read by app? */
|
||||
|
||||
SetSelectionProc setSelection;
|
||||
} DtEditorEditStuff;
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Data structures for Search
|
||||
*
|
||||
****************************************************************/
|
||||
typedef struct _DtEditorSearchWidgets {
|
||||
Widget formDlg,
|
||||
listLbl,
|
||||
spellList,
|
||||
findLbl,
|
||||
findText,
|
||||
replaceLbl,
|
||||
replaceText,
|
||||
separator,
|
||||
findBtn,
|
||||
replaceBtn,
|
||||
replaceAllBtn,
|
||||
closeBtn,
|
||||
helpBtn;
|
||||
} DtEditorSearchWidgets;
|
||||
|
||||
typedef struct _DtEditorSearchStuff {
|
||||
DtEditorSearchWidgets widgets;
|
||||
int search_dialog_mode;
|
||||
char *search_string, /* last string searched for */
|
||||
*replace_string, /* last replacement string */
|
||||
*misspelled_string, /* last misspelled word selected */
|
||||
*spellFilter;
|
||||
Boolean misspelled_found;
|
||||
Dimension buttonHeight;
|
||||
XmString spellTitle,
|
||||
fndChngTitle,
|
||||
changeAllButtonLabel,
|
||||
changeButtonLabel,
|
||||
changeFieldLabel,
|
||||
findButtonLabel,
|
||||
findFieldLabel,
|
||||
misspelledListLabel;
|
||||
} DtEditorSearchStuff;
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Data structures for Format
|
||||
*
|
||||
****************************************************************/
|
||||
typedef struct _DtEditorFormatWidgets {
|
||||
Widget format_dialog,
|
||||
right_label,
|
||||
left_label,
|
||||
rightMargField, /* format right margin text field */
|
||||
leftMargField, /* format left margin text field */
|
||||
radio_box,
|
||||
left_just, /* format type toggle button */
|
||||
right_just, /* format type toggle button */
|
||||
both_just, /* format type toggle button */
|
||||
center, /* format type toggle button */
|
||||
separator,
|
||||
paragraph,
|
||||
all,
|
||||
close,
|
||||
help;
|
||||
} DtEditorFormatWidgets;
|
||||
|
||||
typedef struct _DtEditorFormatStuff {
|
||||
DtEditorFormatWidgets widgets;
|
||||
XmString centerToggleLabel,
|
||||
formatAllButtonLabel,
|
||||
formatParaButtonLabel,
|
||||
formatDialogTitle,
|
||||
justifyToggleLabel,
|
||||
leftAlignToggleLabel,
|
||||
leftMarginFieldLabel,
|
||||
rightAlignToggleLabel,
|
||||
rightMarginFieldLabel;
|
||||
} DtEditorFormatStuff;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Data structures for the Status Line
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
typedef struct _status {
|
||||
Boolean showStatusLine;
|
||||
int currentLine,
|
||||
lastLine;
|
||||
XmString ovr,
|
||||
ins,
|
||||
currentLineLabel,
|
||||
totalLineLabel;
|
||||
Widget statusArea,
|
||||
lineLabel,
|
||||
lineText,
|
||||
totalLabel,
|
||||
totalText,
|
||||
overstrikeLabel,
|
||||
messageText;
|
||||
} DtEditorStatusStuff;
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Data structures for holding warning dialogs
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
typedef struct _textlibwarning {
|
||||
Widget warningDialog;
|
||||
XmString infoDialogTitle;
|
||||
} DtEditorWarningStuff;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Class Part structure definition
|
||||
*
|
||||
****************************************************************/
|
||||
typedef struct _DtEditorClassPart
|
||||
{
|
||||
int ignore;
|
||||
} DtEditorClassPart;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Full Class Record declaration
|
||||
*
|
||||
****************************************************************/
|
||||
typedef struct _DtEditorClassRec
|
||||
{
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
XmBulletinBoardClassPart bulletin_board_class;
|
||||
XmFormClassPart form_class;
|
||||
DtEditorClassPart editor_class;
|
||||
} DtEditorClassRec;
|
||||
|
||||
externalref DtEditorClassRec dtEditorClassRec;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Resources added by the Editor widget
|
||||
*
|
||||
****************************************************************/
|
||||
typedef struct _DtEditorPart
|
||||
{
|
||||
Display *display;
|
||||
Widget topLevelShell,
|
||||
/*
|
||||
* scrolled text widget
|
||||
*/
|
||||
text;
|
||||
Dimension width; /* the text widget width */
|
||||
|
||||
/* All data for Edit functions */
|
||||
DtEditorEditStuff editStuff;
|
||||
/* All data for Search functions */
|
||||
DtEditorSearchStuff searchStuff;
|
||||
/* All data for Format functions */
|
||||
DtEditorFormatStuff formatStuff;
|
||||
/* All data for warning dialogs functions */
|
||||
DtEditorWarningStuff warningStuff;
|
||||
/* All data for the status line */
|
||||
DtEditorStatusStuff statusStuff;
|
||||
|
||||
XtAppContext app_context;
|
||||
|
||||
/*
|
||||
* The editor widget's callbacks
|
||||
*/
|
||||
|
||||
Boolean textSelectCbCalled;
|
||||
XtCallbackList textSelect;
|
||||
XtCallbackList textDeselect;
|
||||
|
||||
} DtEditorPart;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Full Instance Record declaration
|
||||
*
|
||||
****************************************************************/
|
||||
typedef struct _DtEditorRec
|
||||
{
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
XmBulletinBoardPart bulletin_board;
|
||||
XmFormPart form;
|
||||
DtEditorPart editor;
|
||||
} DtEditorRec;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* MACRO DEFINITIONS
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
/*
|
||||
* Class and Instance Macros
|
||||
*/
|
||||
|
||||
/*
|
||||
* Note: DtEditor utilizes the bulletin board's dialog_title and
|
||||
* text_translations fields to hold its dialogTitle and textTranslations
|
||||
* resources
|
||||
*/
|
||||
#define E_dialogTitle(m) (m -> bulletin_board.dialog_title)
|
||||
#define E_textTranslations(m) (m -> bulletin_board.text_translations)
|
||||
#define E_buttonFontList(m) (m -> bulletin_board.button_font_list)
|
||||
#define E_labelFontList(m) (m -> bulletin_board.label_font_list)
|
||||
#define E_textFontList(m) (m -> bulletin_board.text_font_list)
|
||||
|
||||
#define M_app_context(m) (m -> editor.app_context)
|
||||
#define M_display(m) (m -> editor.display)
|
||||
#define M_topLevelShell(m) (m -> editor.topLevelShell)
|
||||
#define M_text(m) (m -> editor.text)
|
||||
#define M_textWidth(m) (m -> editor.width)
|
||||
|
||||
/* callbacks */
|
||||
#define M_textSelect(m) (m -> editor.textSelect)
|
||||
#define M_textDeselect(m) (m -> editor.textDeselect)
|
||||
#define M_textSelectCbCalled(m) (m -> editor.textSelectCbCalled)
|
||||
|
||||
/* editStuff - scrolled text resources */
|
||||
#define M_autoShowCursorPos(m) (m->editor.editStuff.autoShowCursorPos)
|
||||
#define M_blinkRate(m) (m -> editor.editStuff.blinkRate)
|
||||
#define M_columns(m) (m -> editor.editStuff.columns)
|
||||
#define M_cursorPos(m) (m -> editor.editStuff.cursorPos)
|
||||
#define M_cursorPosVisible(m) (m -> editor.editStuff.cursorPosVisible)
|
||||
#define M_editable(m) (m -> editor.editStuff.editable)
|
||||
#define M_fontWidth(m) (m -> editor.editStuff.fontWidth)
|
||||
#define M_fontHeight(m) (m -> editor.editStuff.fontHeight)
|
||||
#define M_maxLength(m) (m -> editor.editStuff.maxLength)
|
||||
#define M_overstrikeMode(m) (m -> editor.editStuff.overstrikeMode)
|
||||
#define M_rows(m) (m -> editor.editStuff.rows)
|
||||
#define M_scrollHorizontal(m) (m -> editor.editStuff.scrollHorizontal)
|
||||
#define M_scrollLeftSide(m) (m -> editor.editStuff.scrollLeft)
|
||||
#define M_scrollTopSide(m) (m -> editor.editStuff.scrollTop)
|
||||
#define M_scrollVertical(m) (m -> editor.editStuff.scrollVertical)
|
||||
#define M_topCharacter(m) (m -> editor.editStuff.topCharacter)
|
||||
#define M_wordWrap(m) (m -> editor.editStuff.wordWrap)
|
||||
#define M_textBackground(m) (m -> editor.editStuff.background)
|
||||
#define M_textForeground(m) (m -> editor.editStuff.foreground)
|
||||
|
||||
/* editStuff - scrolled text related data */
|
||||
#define M_deletionStart(m) (m -> editor.editStuff.undo.deletionStart)
|
||||
#define M_deletedText(m) (m -> editor.editStuff.undo.deletedText)
|
||||
#define M_insertStart(m) (m -> editor.editStuff.undo.insertStart)
|
||||
#define M_insertionLength(m) (m -> editor.editStuff.undo.insertionLength)
|
||||
#define M_loadingAllNewData(m) (m -> editor.editStuff.loadingAllNewData)
|
||||
#define M_unreadChanges(m) (m -> editor.editStuff.unreadChanges)
|
||||
#define M_setSelection(m) (m -> editor.editStuff.setSelection)
|
||||
|
||||
/* searchStuff */
|
||||
#define M_search_dialogMode(m) (m ->editor.searchStuff.search_dialog_mode)
|
||||
#define M_spellTitle(m) (m -> editor.searchStuff.spellTitle)
|
||||
#define M_fndChngTitle(m) (m -> editor.searchStuff.fndChngTitle)
|
||||
#define E_changeAllButtonLabel(m) (m->editor.searchStuff.changeAllButtonLabel)
|
||||
#define E_changeButtonLabel(m) (m->editor.searchStuff.changeButtonLabel)
|
||||
#define E_changeFieldLabel(m) (m->editor.searchStuff.changeFieldLabel)
|
||||
#define E_findButtonLabel(m) (m->editor.searchStuff.findButtonLabel)
|
||||
#define E_findFieldLabel(m) (m->editor.searchStuff.findFieldLabel)
|
||||
#define E_misspelledListLabel(m) (m->editor.searchStuff.misspelledListLabel)
|
||||
#define M_search_string(m) (m -> editor.searchStuff.search_string)
|
||||
#define M_replace_string(m) (m -> editor.searchStuff.replace_string)
|
||||
#define M_misspelled_string(m) (m -> editor.searchStuff.misspelled_string)
|
||||
#define M_misspelled_found(m) (m -> editor.searchStuff.misspelled_found)
|
||||
#define M_spellFilter(m) (m -> editor.searchStuff.spellFilter)
|
||||
#define M_replaceText(m) (m -> editor.searchStuff.widgets.replaceText)
|
||||
#define M_findText(m) (m -> editor.searchStuff.widgets.findText)
|
||||
#define M_search_replaceLbl(m) (m -> editor.searchStuff.widgets.replaceLbl)
|
||||
#define M_search_buttonHeight(m) (m -> editor.searchStuff.buttonHeight)
|
||||
#define M_search_dialog(m) (m -> editor.searchStuff.widgets.formDlg)
|
||||
#define M_search_closeBtn(m) (m -> editor.searchStuff.widgets.closeBtn)
|
||||
#define M_search_helpBtn(m) (m -> editor.searchStuff.widgets.helpBtn)
|
||||
#define M_search_findBtn(m) (m -> editor.searchStuff.widgets.findBtn)
|
||||
#define M_search_replaceBtn(m) (m -> editor.searchStuff.widgets.replaceBtn)
|
||||
#define M_search_replaceAllBtn(m)\
|
||||
(m -> editor.searchStuff.widgets.replaceAllBtn)
|
||||
#define M_search_spellList(m) (m -> editor.searchStuff.widgets.spellList)
|
||||
#define M_search_listLbl(m) (m -> editor.searchStuff.widgets.listLbl)
|
||||
#define M_search_findLbl(m) (m -> editor.searchStuff.widgets.findLbl)
|
||||
#define M_search_separator(m) (m -> editor.searchStuff.widgets.separator)
|
||||
|
||||
/* formatStuff */
|
||||
#define E_format_centerToggleLabel(m) (m->editor.formatStuff.centerToggleLabel)
|
||||
#define E_format_formatAllButtonLabel(m)\
|
||||
(m->editor.formatStuff.formatAllButtonLabel)
|
||||
#define E_format_formatParagraphButtonLabel(m)\
|
||||
(m->editor.formatStuff.formatParaButtonLabel)
|
||||
#define E_format_dialogTitle(m) (m->editor.formatStuff.formatDialogTitle)
|
||||
#define E_format_justifyToggleLabel(m)\
|
||||
(m->editor.formatStuff.justifyToggleLabel)
|
||||
#define E_format_leftAlignToggleLabel(m)\
|
||||
(m->editor.formatStuff.leftAlignToggleLabel)
|
||||
#define E_format_leftMarginFieldLabel(m)\
|
||||
(m->editor.formatStuff.leftMarginFieldLabel)
|
||||
#define E_format_rightAlignToggleLabel(m)\
|
||||
(m->editor.formatStuff.rightAlignToggleLabel)
|
||||
#define E_format_rightMarginFieldLabel(m)\
|
||||
(m->editor.formatStuff.rightMarginFieldLabel)
|
||||
#define M_format_all(m) (m -> editor.formatStuff.widgets.all)
|
||||
#define M_format_bothJust(m) (m -> editor.formatStuff.widgets.both_just)
|
||||
#define M_format_center(m) (m -> editor.formatStuff.widgets.center)
|
||||
#define M_format_close(m) (m -> editor.formatStuff.widgets.close)
|
||||
#define M_format_dialog(m) (m -> editor.formatStuff.widgets.format_dialog)
|
||||
#define M_format_help(m) (m -> editor.formatStuff.widgets.help)
|
||||
#define M_format_leftJust(m) (m -> editor.formatStuff.widgets.left_just)
|
||||
#define M_format_leftLabel(m) (m -> editor.formatStuff.widgets.left_label)
|
||||
#define M_format_leftMarginField(m) (m -> editor.formatStuff.widgets.leftMargField)
|
||||
#define M_format_paragraph(m) (m -> editor.formatStuff.widgets.paragraph)
|
||||
#define M_format_radioBox(m) (m -> editor.formatStuff.widgets.radio_box)
|
||||
#define M_format_rightJust(m) (m -> editor.formatStuff.widgets.right_just)
|
||||
#define M_format_rightLabel(m) (m -> editor.formatStuff.widgets.right_label)
|
||||
#define M_format_rightMarginField(m) (m -> editor.formatStuff.widgets.rightMargField)
|
||||
#define M_format_separator(m) (m -> editor.formatStuff.widgets.separator)
|
||||
|
||||
/* statusStuff */
|
||||
#define M_status_showStatusLine(m) (m -> editor.statusStuff.showStatusLine)
|
||||
#define M_status_currentLine(m) (m -> editor.statusStuff.currentLine)
|
||||
#define M_status_lastLine(m) (m -> editor.statusStuff.lastLine)
|
||||
#define M_status_overstrikeLabel(m) (m -> editor.statusStuff.ovr)
|
||||
#define M_status_insertLabel(m) (m -> editor.statusStuff.ins)
|
||||
#define E_status_currentLineLabel(m) (m -> editor.statusStuff.currentLineLabel)
|
||||
#define E_status_totalLineCountLabel(m) (m->editor.statusStuff.totalLineLabel)
|
||||
#define M_status_statusArea(m) (m -> editor.statusStuff.statusArea)
|
||||
#define M_status_lineLabel(m) (m -> editor.statusStuff.lineLabel)
|
||||
#define M_status_lineText(m) (m -> editor.statusStuff.lineText)
|
||||
#define M_status_totalLabel(m) (m -> editor.statusStuff.totalLabel)
|
||||
#define M_status_totalText(m) (m -> editor.statusStuff.totalText)
|
||||
#define M_status_overstrikeWidget(m) (m->editor.statusStuff.overstrikeLabel)
|
||||
#define M_status_messageText(m) (m -> editor.statusStuff.messageText)
|
||||
|
||||
/* warningStuff */
|
||||
#define M_gen_warning(m) (m ->editor.warningStuff.warningDialog)
|
||||
#define E_infoDialogTitle(m) (m ->editor.warningStuff.infoDialogTitle)
|
||||
|
||||
/*
|
||||
* Misc macros
|
||||
*/
|
||||
#define M_editor(m) ((DtEditorWidget) m ->core.parent -> core.parent)
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Private library functions
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
/*** library-private functions in Editor.c ***/
|
||||
extern void _DtEditorResetUndo(
|
||||
DtEditorWidget editor);
|
||||
extern void _DtEditorUpdateLineDisplay(
|
||||
DtEditorWidget editor,
|
||||
int currentLine,
|
||||
Boolean forceUpdate );
|
||||
extern int _DtEditorGetLineIndex(
|
||||
XmTextWidget tw,
|
||||
XmTextPosition pos);
|
||||
extern void _DtEditorWarning(
|
||||
DtEditorWidget pPriv,
|
||||
char *mess,
|
||||
unsigned char dialogType);
|
||||
extern DtEditorErrorCode _DtEditorValidateFileAccess(
|
||||
char *fileName,
|
||||
int accessType );
|
||||
extern void _DtEditorHelpSearchCB (
|
||||
Widget w,
|
||||
caddr_t client_data ,
|
||||
caddr_t call_data );
|
||||
extern void _DtEditorHelpSearchSpellCB (
|
||||
Widget w,
|
||||
caddr_t client_data ,
|
||||
caddr_t call_data );
|
||||
extern void _DtEditorHelpSearchFindCB (
|
||||
Widget w,
|
||||
caddr_t client_data ,
|
||||
caddr_t call_data );
|
||||
extern void _DtEditorHelpSearchChangeCB (
|
||||
Widget w,
|
||||
caddr_t client_data ,
|
||||
caddr_t call_data );
|
||||
|
||||
/*** library-private functions in EditAreaData.c ***/
|
||||
|
||||
extern char *_DtEditorGetPointer(
|
||||
char *pString,
|
||||
int startChar);
|
||||
|
||||
/*** library-private functions in EditorCalls.c ***/
|
||||
|
||||
extern void _DtEditorModifyVerifyCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data );
|
||||
|
||||
/*** library-private functions in SearchCalls.c ***/
|
||||
|
||||
extern void _DtEditorSearchMapCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data );
|
||||
extern int _DtEditor_CountCharacters(
|
||||
char *str,
|
||||
int num_count_bytes);
|
||||
extern void _DtEditorDialogSearchCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data );
|
||||
extern void _DtEditorDialogReplaceCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data );
|
||||
extern void _DtEditorDialogReplaceAllCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data );
|
||||
extern void _DtEditorDialogFindCancelCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data );
|
||||
extern void _DtEditorMisspelledSelectCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data );
|
||||
extern void _DtEditorMisspelledDblClickCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data );
|
||||
extern void _DtEditorFindTextChangedCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data );
|
||||
extern void _DtEditorReplaceTextChangedCB(
|
||||
Widget w,
|
||||
caddr_t client_data,
|
||||
caddr_t call_data );
|
||||
extern void _DtEditorSetFindSensitivity(
|
||||
DtEditorWidget pPriv,
|
||||
Boolean sensitivity);
|
||||
extern void _DtEditorSetReplaceSensitivity(
|
||||
DtEditorWidget pPriv,
|
||||
Boolean sensitivity);
|
||||
extern void _DtEditorSetReplaceAllSensitivity(
|
||||
DtEditorWidget pPriv,
|
||||
Boolean sensitivity);
|
||||
|
||||
|
||||
/*** library-private functions in SearchDlg.c ***/
|
||||
extern void _DtEditorSearch(
|
||||
DtEditorWidget pPriv,
|
||||
Boolean spell,
|
||||
Boolean createonly );
|
||||
|
||||
#endif /* _DtEditorP_h */
|
||||
|
||||
4004
cde/lib/DtWidget/Icon.c
Normal file
4004
cde/lib/DtWidget/Icon.c
Normal file
File diff suppressed because it is too large
Load Diff
118
cde/lib/DtWidget/Icon.h
Normal file
118
cde/lib/DtWidget/Icon.h
Normal file
@@ -0,0 +1,118 @@
|
||||
/* $XConsortium: Icon.h /main/4 1995/10/26 09:32:37 rswiston $ */
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: Icon.h
|
||||
***
|
||||
*** project: MotifPlus Widgets
|
||||
***
|
||||
*** description: Public include file for DtIcon gadget class.
|
||||
***
|
||||
***
|
||||
*** (c) Copyright 1990 by Hewlett-Packard Company.
|
||||
***
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _DtIcon_h
|
||||
#define _DtIcon_h
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Dt/DtStrDefs.h>
|
||||
|
||||
#ifndef DtIsIcon
|
||||
#define DtIsIcon(w) XtIsSubclass(w, dtIconGadgetClass)
|
||||
#endif /* DtIsIcon */
|
||||
|
||||
typedef struct _DtIconClassRec * DtIconGadgetClass;
|
||||
typedef struct _DtIconRec * DtIconGadget;
|
||||
typedef struct _DtIconCacheObjRec * DtIconCacheObject;
|
||||
|
||||
|
||||
extern Widget _DtCreateIcon(
|
||||
Widget parent,
|
||||
String name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount) ;
|
||||
extern Boolean _DtIconGetState(
|
||||
Widget w) ;
|
||||
extern void _DtIconSetState(
|
||||
Widget w,
|
||||
Boolean state,
|
||||
Boolean notify) ;
|
||||
extern Drawable _DtIconDraw(
|
||||
Widget widget,
|
||||
Drawable drawable,
|
||||
Position x,
|
||||
Position y,
|
||||
Boolean fill) ;
|
||||
extern Widget _DtDuplicateIcon(
|
||||
Widget parent,
|
||||
Widget widget,
|
||||
XmString string,
|
||||
String pixmap,
|
||||
XtPointer user_data,
|
||||
Boolean underline) ;
|
||||
extern Boolean _DtIconSelectInTitle(
|
||||
Widget widget,
|
||||
Position pt_x,
|
||||
Position pt_y) ;
|
||||
extern XRectangle * _DtIconGetTextExtent(
|
||||
Widget widget) ;
|
||||
extern void _DtIconGetIconRects(
|
||||
DtIconGadget g,
|
||||
unsigned char *flags,
|
||||
XRectangle *rect1,
|
||||
XRectangle *rect2) ;
|
||||
|
||||
|
||||
|
||||
extern WidgetClass dtIconGadgetClass;
|
||||
|
||||
|
||||
#define XmCR_SELECT XmCR_SINGLE_SELECT
|
||||
#define XmCR_DROP 50
|
||||
#define XmCR_POPUP 51
|
||||
#define XmCR_HIGHLIGHT 52
|
||||
#define XmCR_UNHIGHLIGHT 53
|
||||
#define XmCR_SHADOW 54
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int reason;
|
||||
XEvent * event;
|
||||
Boolean set;
|
||||
} DtIconCallbackStruct;
|
||||
|
||||
|
||||
#define XmPIXMAP_TOP 0
|
||||
#define XmPIXMAP_BOTTOM 1
|
||||
#define XmPIXMAP_LEFT 2
|
||||
#define XmPIXMAP_RIGHT 3
|
||||
#define XmPIXMAP_MIDDLE 4
|
||||
|
||||
#define XmSTRING_BOTTOM 0
|
||||
#define XmSTRING_TOP 1
|
||||
#define XmSTRING_RIGHT 2
|
||||
#define XmSTRING_LEFT 3
|
||||
|
||||
#define XmICON_LABEL 0
|
||||
#define XmICON_BUTTON 1
|
||||
#define XmICON_TOGGLE 2
|
||||
#define XmICON_DRAG 3
|
||||
|
||||
#define XmFILL_NONE 0
|
||||
#define XmFILL_PARENT 1
|
||||
#define XmFILL_SELF 2
|
||||
#define XmFILL_TRANSPARENT 3
|
||||
|
||||
#define XmPIXMAP_RECT 0x01
|
||||
#define XmLABEL_RECT 0x02
|
||||
|
||||
#define DtRECTANGLE 0
|
||||
#define DtNON_RECTANGLE 1
|
||||
|
||||
|
||||
#endif /* _XmIcon_h */
|
||||
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
328
cde/lib/DtWidget/IconP.h
Normal file
328
cde/lib/DtWidget/IconP.h
Normal file
@@ -0,0 +1,328 @@
|
||||
/* $XConsortium: IconP.h /main/7 1996/03/29 11:33:23 drk $ */
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: IconP.h
|
||||
***
|
||||
*** project: MotifPlus Widgets
|
||||
***
|
||||
*** description: Private include file for DtIcon gadget class.
|
||||
***
|
||||
***
|
||||
*** (c) Copyright 1990 by Hewlett-Packard Company.
|
||||
***
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _DtIconP_h
|
||||
#define _DtIconP_h
|
||||
|
||||
#include <Xm/ExtObjectP.h>
|
||||
#include <Xm/XmP.h>
|
||||
#include <Xm/GadgetP.h>
|
||||
#include <Dt/Icon.h>
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Cache Class Structure
|
||||
*/
|
||||
|
||||
/* Cache Class Part
|
||||
*/
|
||||
typedef struct _DtIconCacheObjClassPart
|
||||
{
|
||||
int foo;
|
||||
} DtIconCacheObjClassPart;
|
||||
|
||||
/* Cache Full Class Record
|
||||
*/
|
||||
typedef struct _DtIconCacheObjClassRec /* label cache class record */
|
||||
{
|
||||
ObjectClassPart object_class;
|
||||
XmExtClassPart ext_class;
|
||||
DtIconCacheObjClassPart icon_class_cache;
|
||||
} DtIconCacheObjClassRec;
|
||||
|
||||
/* Cache Actual Class
|
||||
*/
|
||||
externalref DtIconCacheObjClassRec dtIconCacheObjClassRec;
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Cache Instance Structure
|
||||
*/
|
||||
|
||||
/* Cache Instance Part
|
||||
*/
|
||||
typedef struct _DtIconCacheObjPart
|
||||
{
|
||||
Dimension margin_width;
|
||||
Dimension margin_height;
|
||||
Dimension string_height;
|
||||
Dimension spacing;
|
||||
Pixel foreground;
|
||||
Pixel background;
|
||||
Pixel arm_color;
|
||||
Boolean fill_on_arm;
|
||||
Boolean recompute_size;
|
||||
Boolean draw_shadow;
|
||||
unsigned char pixmap_position;
|
||||
unsigned char string_position;
|
||||
unsigned char alignment;
|
||||
unsigned char behavior;
|
||||
unsigned char fill_mode;
|
||||
} DtIconCacheObjPart;
|
||||
|
||||
typedef struct _DtIconCacheObjRec
|
||||
{
|
||||
ObjectPart object;
|
||||
XmExtPart ext;
|
||||
DtIconCacheObjPart icon_cache;
|
||||
} DtIconCacheObjRec;
|
||||
|
||||
|
||||
typedef void (*GetPositionProc)(
|
||||
DtIconGadget,
|
||||
Position,
|
||||
Position,
|
||||
Dimension,
|
||||
Dimension,
|
||||
Position *,
|
||||
Position *,
|
||||
Position *,
|
||||
Position *
|
||||
);
|
||||
typedef void (*GetSizeProc)(
|
||||
DtIconGadget,
|
||||
Dimension *,
|
||||
Dimension *
|
||||
);
|
||||
typedef void (*DrawProc)(
|
||||
DtIconGadget,
|
||||
Drawable,
|
||||
Position,
|
||||
Position,
|
||||
Dimension,
|
||||
Dimension,
|
||||
Dimension,
|
||||
Dimension,
|
||||
unsigned char,
|
||||
unsigned char
|
||||
);
|
||||
typedef void (*CallCallbackProc)(
|
||||
DtIconGadget,
|
||||
XtCallbackList,
|
||||
int,
|
||||
XEvent *
|
||||
);
|
||||
typedef void (*UpdateGCsProc)(
|
||||
DtIconGadget
|
||||
);
|
||||
/*-------------------------------------------------------------
|
||||
** Class Structure
|
||||
*/
|
||||
|
||||
/* Class Part
|
||||
*/
|
||||
typedef struct _DtIconClassPart
|
||||
{
|
||||
GetSizeProc get_size;
|
||||
GetPositionProc get_positions;
|
||||
DrawProc draw;
|
||||
CallCallbackProc call_callback;
|
||||
UpdateGCsProc update_gcs;
|
||||
Boolean optimize_redraw;
|
||||
XmCacheClassPartPtr cache_part;
|
||||
caddr_t extension;
|
||||
} DtIconClassPart;
|
||||
|
||||
/* Full Class Record
|
||||
*/
|
||||
typedef struct _DtIconClassRec
|
||||
{
|
||||
RectObjClassPart rect_class;
|
||||
XmGadgetClassPart gadget_class;
|
||||
DtIconClassPart icon_class;
|
||||
} DtIconClassRec;
|
||||
|
||||
/* Actual Class
|
||||
*/
|
||||
externalref DtIconClassRec dtIconClassRec;
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Instance Structure
|
||||
*/
|
||||
|
||||
/* Instance Part
|
||||
*/
|
||||
typedef struct _DtIconPart
|
||||
{
|
||||
Boolean set;
|
||||
Boolean armed;
|
||||
Boolean sync;
|
||||
Boolean underline;
|
||||
unsigned char shadow_type;
|
||||
unsigned char border_type;
|
||||
XtCallbackList callback;
|
||||
XtIntervalId click_timer_id;
|
||||
XButtonEvent * click_event;
|
||||
String image_name;
|
||||
Pixmap pixmap;
|
||||
Pixmap mask;
|
||||
Pixel pixmap_foreground;
|
||||
Pixel pixmap_background;
|
||||
Dimension max_pixmap_width;
|
||||
Dimension max_pixmap_height;
|
||||
XmFontList font_list;
|
||||
XmString string;
|
||||
Dimension string_width;
|
||||
Dimension pixmap_width;
|
||||
Dimension pixmap_height;
|
||||
GC clip_gc;
|
||||
GC normal_gc;
|
||||
GC background_gc;
|
||||
GC armed_gc;
|
||||
GC armed_background_gc;
|
||||
GC parent_background_gc;
|
||||
Pixel saved_parent_background;
|
||||
DtIconCacheObjPart *cache;
|
||||
unsigned char operations;
|
||||
XtCallbackList drop_callback;
|
||||
} DtIconPart;
|
||||
|
||||
/* Full Instance Record
|
||||
*/
|
||||
typedef struct _DtIconRec
|
||||
{
|
||||
ObjectPart object;
|
||||
RectObjPart rectangle;
|
||||
XmGadgetPart gadget;
|
||||
DtIconPart icon;
|
||||
} DtIconRec;
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Class and Instance Macros
|
||||
*/
|
||||
|
||||
/* DtIcon Class Macros
|
||||
*/
|
||||
#define DtInheritGetSize ((GetSizeProc) _XtInherit)
|
||||
#define DtInheritGetPositions ((GetPositionProc) _XtInherit)
|
||||
#define DtInheritDraw ((DrawProc) _XtInherit)
|
||||
#define DtInheritCallCallback ((CallCallbackProc) _XtInherit)
|
||||
#define DtInheritUpdateGCs ((UpdateGCsProc) _XtInherit)
|
||||
|
||||
/*** WARNING: These macros are not thread-safe! ***/
|
||||
#define C_GetSize(wc) \
|
||||
(((DtIconGadgetClass)(wc)) -> icon_class.get_size)
|
||||
#define C_GetPositions(wc) \
|
||||
(((DtIconGadgetClass)(wc)) -> icon_class.get_positions)
|
||||
#define C_Draw(wc) \
|
||||
(((DtIconGadgetClass)(wc)) -> icon_class.draw)
|
||||
#define C_CallCallback(wc) \
|
||||
(((DtIconGadgetClass)(wc)) -> icon_class.call_callback)
|
||||
#define C_OptimizeRedraw(wc) \
|
||||
(((DtIconGadgetClass)(wc)) -> icon_class.optimize_redraw)
|
||||
#define C_UpdateGCs(wc) \
|
||||
(((DtIconGadgetClass)(wc)) -> icon_class.update_gcs)
|
||||
|
||||
/* DtIcon Macros
|
||||
*/
|
||||
|
||||
/*** WARNING: These macros are not thread-safe! ***/
|
||||
#define G_GetSize(g,w,h) \
|
||||
(((DtIconClassRec *)g -> object.widget_class) -> icon_class.get_size) \
|
||||
(g,w,h)
|
||||
#define G_GetPositions(g,w,h,h_t,s_t,p_x,p_y,s_x,s_y) \
|
||||
(((DtIconClassRec *)g -> object.widget_class) -> icon_class.get_positions) \
|
||||
(g,w,h,h_t,s_t,p_x,p_y,s_x,s_y)
|
||||
#define G_Draw(g,d,x,y,w,h,h_t,s_t,s_type,fill) \
|
||||
(((DtIconClassRec *)g -> object.widget_class) -> icon_class.draw) \
|
||||
(g,d,x,y,w,h,h_t,s_t,s_type,fill)
|
||||
#define G_CallCallback(g,cb,r,e) \
|
||||
(((DtIconClassRec *)g -> object.widget_class) -> icon_class.call_callback) \
|
||||
(g,cb,r,e)
|
||||
#define G_UpdateGCs(g) \
|
||||
(((DtIconClassRec *)g -> object.widget_class) -> icon_class.update_gcs) \
|
||||
(g)
|
||||
|
||||
/* Cached Instance Field Macros
|
||||
*/
|
||||
#define G_CachePixmapPosition(co) (((DtIconCacheObject)(co)) -> \
|
||||
icon_cache.pixmap_position)
|
||||
#define G_FillOnArm(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> fill_on_arm)
|
||||
#define G_RecomputeSize(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> recompute_size)
|
||||
#define G_DrawShadow(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> draw_shadow)
|
||||
#define G_PixmapPosition(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> pixmap_position)
|
||||
#define G_StringPosition(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> string_position)
|
||||
#define G_Alignment(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> alignment)
|
||||
#define G_Behavior(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> behavior)
|
||||
#define G_FillMode(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> fill_mode)
|
||||
#define G_MarginWidth(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> margin_width)
|
||||
#define G_MarginHeight(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> margin_height)
|
||||
#define G_StringHeight(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> string_height)
|
||||
#define G_Spacing(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> spacing)
|
||||
#define G_Foreground(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> foreground)
|
||||
#define G_Background(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> background)
|
||||
#define G_ArmColor(g) (((DtIconGadget)(g)) -> \
|
||||
icon.cache -> arm_color)
|
||||
|
||||
/* Non-Cached Instance Field Macros
|
||||
*/
|
||||
#define G_Armed(g) (g -> icon.armed)
|
||||
#define G_Set(g) (g -> icon.set)
|
||||
#define G_Sync(g) (g -> icon.sync)
|
||||
#define G_Callback(g) (g -> icon.callback)
|
||||
#define G_ClickTimerID(g) (g -> icon.click_timer_id)
|
||||
#define G_ClickInterval(g) (g -> icon.click_interval)
|
||||
#define G_ClickEvent(g) (g -> icon.click_event)
|
||||
#define G_ShadowType(g) (g -> icon.shadow_type)
|
||||
#define G_BorderType(g) (g -> icon.border_type)
|
||||
#define G_Pixmap(g) (g -> icon.pixmap)
|
||||
#define G_Mask(g) (g -> icon.mask)
|
||||
#define G_PixmapForeground(g) (g -> icon.pixmap_foreground)
|
||||
#define G_PixmapBackground(g) (g -> icon.pixmap_background)
|
||||
#define G_MaxPixmapWidth(g) (g -> icon.max_pixmap_width)
|
||||
#define G_MaxPixmapHeight(g) (g -> icon.max_pixmap_height)
|
||||
#define G_String(g) (g -> icon.string)
|
||||
#define G_FontList(g) (g -> icon.font_list)
|
||||
#define G_ImageName(g) (g -> icon.image_name)
|
||||
#define G_StringWidth(g) (g -> icon.string_width)
|
||||
#define G_PixmapWidth(g) (g -> icon.pixmap_width)
|
||||
#define G_PixmapHeight(g) (g -> icon.pixmap_height)
|
||||
#define G_BackgroundGC(g) (g -> icon.background_gc)
|
||||
#define G_ArmedGC(g) (g -> icon.armed_gc)
|
||||
#define G_ArmedBackgroundGC(g) (g -> icon.armed_background_gc)
|
||||
#define G_NormalGC(g) (g -> icon.normal_gc)
|
||||
#define G_ClipGC(g) (g -> icon.clip_gc)
|
||||
#define G_Underline(g) (g -> icon.underline)
|
||||
#define G_ParentBackgroundGC(g) (g -> icon.parent_background_gc)
|
||||
#define G_SavedParentBG(g) (g -> icon.saved_parent_background)
|
||||
#define G_Operations(g) (g -> icon.operations)
|
||||
#define G_DropCallback(g) (g -> icon.drop_callback)
|
||||
|
||||
#define Icon_Cache(w) (((DtIconGadget)(w))-> \
|
||||
icon.cache)
|
||||
|
||||
#define Icon_ClassCachePart(w) \
|
||||
(((DtIconGadgetClass)dtIconGadgetClass)->gadget_class.cache_part)
|
||||
|
||||
|
||||
#endif /* _DtIconP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
57
cde/lib/DtWidget/Imakefile
Normal file
57
cde/lib/DtWidget/Imakefile
Normal file
@@ -0,0 +1,57 @@
|
||||
XCOMM $XConsortium: Imakefile /main/8 1996/04/21 19:11:16 drk $
|
||||
#define DoNormalLib NormalLibDtWidget
|
||||
#define DoSharedLib SharedLibDtWidget
|
||||
#define DoDebugLib DebugLibDtWidget
|
||||
#define DoProfileLib ProfileLibDtWidget
|
||||
#define LibName DtWidget
|
||||
#define SoRev SODTWIDGETREV
|
||||
#define IncSubdir Dt
|
||||
|
||||
#include <Threads.tmpl>
|
||||
|
||||
#ifndef DtWidgetDefines
|
||||
# define DtWidgetDefines -DI18N_MSG -DXK_MISCELLANY -DMULTIBYTE
|
||||
#endif
|
||||
DEFINES = DtWidgetDefines
|
||||
INCLUDES = -I.
|
||||
|
||||
#ifdef SharedDtWidgetReqs
|
||||
REQUIREDLIBS = SharedDtWidgetReqs
|
||||
#endif
|
||||
|
||||
HEADERS = \
|
||||
Icon.h IconP.h DtStrDefs.h \
|
||||
SpinBox.h SpinBoxP.h ComboBox.h \
|
||||
ComboBoxP.h MenuButtonP.h MenuButton.h \
|
||||
DialogBox.h DialogBoxP.h DtMsgsP.h \
|
||||
MacrosP.h Control.h ControlP.h \
|
||||
View.h ViewP.h TitleBox.h \
|
||||
TitleBoxP.h EditorP.h Editor.h
|
||||
|
||||
SRCS = \
|
||||
ComboBox.c Control.c DialogBox.c \
|
||||
DtMsgs.c DtStrDefs.c EditAreaData.c \
|
||||
EditCalls.c Editor.c Icon.c \
|
||||
MenuButton.c NewCvt.c SearchCalls.c \
|
||||
SearchDlg.c SpinBox.c TitleBox.c \
|
||||
View.c
|
||||
|
||||
OBJS = \
|
||||
ComboBox.o Control.o DialogBox.o \
|
||||
DtMsgs.o DtStrDefs.o EditAreaData.o \
|
||||
EditCalls.o Editor.o Icon.o \
|
||||
MenuButton.o NewCvt.o SearchCalls.o \
|
||||
SearchDlg.o SpinBox.o TitleBox.o \
|
||||
View.o
|
||||
|
||||
#include <Library.tmpl>
|
||||
|
||||
/* MS Compiler bug, remove when we go to USL compiler */
|
||||
#ifdef SCOArchitecture
|
||||
SpecialFlagsObjectRule(Clock, -Olegtc)
|
||||
#endif
|
||||
|
||||
DependTarget()
|
||||
|
||||
LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP)
|
||||
CppSourceFile(UNIXbindings,UNIXbindings.cpp,$(LOCAL_CPP_DEFINES),)
|
||||
177
cde/lib/DtWidget/MacrosP.h
Normal file
177
cde/lib/DtWidget/MacrosP.h
Normal file
@@ -0,0 +1,177 @@
|
||||
/* $XConsortium: MacrosP.h /main/5 1996/03/27 20:16:40 drk $
|
||||
*
|
||||
* (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.
|
||||
*/
|
||||
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: MacrosP.h
|
||||
***
|
||||
*** project: MotifPlus Widgets
|
||||
***
|
||||
*** description: Private include file with macros for MotifPlus
|
||||
*** widgets and gadgets.
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _DtMacrosP_h
|
||||
#define _DtMacrosP_h
|
||||
|
||||
#define XmUNSPECIFIED_STRING (XmString) 3
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Widget Class Macros
|
||||
*/
|
||||
|
||||
/* Core Class Macros
|
||||
*/
|
||||
/*** WARNING: These macros are not thread-safe! ***/
|
||||
#define C_WidgetClass(wc) (wc -> core_class.widget_class)
|
||||
#define C_Superclass(wc) (wc -> core_class.superclass)
|
||||
#define C_ClassName(wc) (wc -> core_class.class_name)
|
||||
#define C_ClassInited(wc) (wc -> core_class.class_inited)
|
||||
#define C_NumResources(wc) (wc -> core_class.num_resources)
|
||||
|
||||
/* Composite Class Macros
|
||||
*/
|
||||
#ifdef _XtCompositeP_h
|
||||
#define C_ChangeManaged(wc) (wc -> composite_class.change_managed)
|
||||
#endif /* _XtCompositeP_h */
|
||||
|
||||
/* Constraint Class Macros
|
||||
*/
|
||||
#ifdef _XtConstraintP_h
|
||||
#define C_ConstraintResources(wc) (wc -> constraint_class.resources)
|
||||
#define C_ConstraintNumResources(wc) (wc -> constraint_class.num_resources)
|
||||
#endif /* _XtConstraintP_h */
|
||||
|
||||
/* XmGadget Class Macros
|
||||
*/
|
||||
#define XmInheritBorderHighlight ((XtWidgetProc) _XtInherit)
|
||||
#define XmInheritBorderUnhighlight ((XtWidgetProc) _XtInherit)
|
||||
#define XmInheritVisualChange ((XmVisualChangeProc) _XtInherit)
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Primitive Macros
|
||||
*/
|
||||
|
||||
#define P_X(w) (w -> core.x)
|
||||
#define P_Y(w) (w -> core.y)
|
||||
#define P_Width(w) (w -> core.width)
|
||||
#define P_Height(w) (w -> core.height)
|
||||
#define P_BorderWidth(w) (w -> core.border_width)
|
||||
#define P_XrmName(w) (w -> core.xrm_name)
|
||||
#define P_PopupList(w) (w -> core.popup_list)
|
||||
#define P_NumPopups(w) (w -> core.num_popups)
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Gadget Macros
|
||||
*/
|
||||
|
||||
/* Object Macros
|
||||
*/
|
||||
#define G_XrmName(r) (r -> object.xrm_name)
|
||||
#define G_Class(r) (r -> object.widget_class)
|
||||
|
||||
/* RectObject Macros
|
||||
*/
|
||||
#define G_X(r) (r -> rectangle.x)
|
||||
#define G_Y(r) (r -> rectangle.y)
|
||||
#define G_Width(r) (r -> rectangle.width)
|
||||
#define G_Height(r) (r -> rectangle.height)
|
||||
#define G_BorderWidth(r) (r -> rectangle.border_width)
|
||||
|
||||
/* XmGadget Macros
|
||||
*/
|
||||
#define G_HelpCB(g) (g -> gadget.help_callback)
|
||||
#define G_EventMask(g) (g -> gadget.event_mask)
|
||||
#define G_Highlighted(g) (g -> gadget.highlighted)
|
||||
#define G_UnitType(g) (g -> gadget.unit_type)
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Manager Macros
|
||||
*/
|
||||
|
||||
/* Core Macros
|
||||
*/
|
||||
#define M_X(w) (w -> core.x)
|
||||
#define M_Y(w) (w -> core.y)
|
||||
#define M_Width(w) (w -> core.width)
|
||||
#define M_Height(w) (w -> core.height)
|
||||
#define M_BorderWidth(w) (w -> core.border_width)
|
||||
#define M_Background(w) (w -> core.background_pixel)
|
||||
#define M_Sensitive(w) (w->core.sensitive && w->core.ancestor_sensitive)
|
||||
#define M_Name(w) (w -> core.name)
|
||||
#define M_Accelerators(w) (w -> core.accelerators)
|
||||
#define M_TmTranslations(w) (w -> core.tm.translations)
|
||||
#define M_PopupList(w) (w -> core.popup_list)
|
||||
#define M_NumPopups(w) (w -> core.num_popups)
|
||||
|
||||
/* Composite and Constraint Macros
|
||||
*/
|
||||
#define M_Children(m) (m -> composite.children)
|
||||
#define M_NumChildren(m) (m -> composite.num_children)
|
||||
|
||||
/* XmManager Macros
|
||||
*/
|
||||
#ifdef _XmManagerP_h
|
||||
#define M_Foreground(m) (m -> manager.foreground)
|
||||
#define M_HighlightThickness(m) (m -> manager.highlight_thickness)
|
||||
#define M_ShadowThickness(m) (m -> manager.shadow_thickness)
|
||||
#define M_TopShadowGC(m) (m -> manager.top_shadow_GC)
|
||||
#define M_BottomShadowGC(m) (m -> manager.bottom_shadow_GC)
|
||||
#define M_BackgroundGC(m) (m -> manager.background_GC)
|
||||
#define M_SelectedGadget(m) (m -> manager.selected_gadget)
|
||||
#define M_HelpCB(m) (m -> manager.help_callback)
|
||||
#define M_UnitType(m) (m -> manager.unit_type)
|
||||
#endif /* _XmManagerP_h */
|
||||
|
||||
/* XmDrawingArea Macros
|
||||
*/
|
||||
#ifdef _XmDrawingAreaP_h
|
||||
#define M_MarginWidth(m) (m -> drawing_area.margin_width)
|
||||
#define M_MarginHeight(m) (m -> drawing_area.margin_height)
|
||||
#endif /* _XmDrawingAreaP_h */
|
||||
|
||||
/* XmBulletinBoard Macros
|
||||
*/
|
||||
#ifdef _XmBulletinBoardP_h
|
||||
#define M_ButtonFontList(m) (m -> bulletin_board.button_font_list)
|
||||
#define M_LabelFontList(m) (m -> bulletin_board.label_font_list)
|
||||
#define M_TextFontList(m) (m -> bulletin_board.text_font_list)
|
||||
#define M_MarginWidth(m) (m -> bulletin_board.margin_width)
|
||||
#define M_MarginHeight(m) (m -> bulletin_board.margin_height)
|
||||
#endif /* _XmBulletinBoardP_h */
|
||||
|
||||
#ifdef MAYBE
|
||||
/* DtIconBox Macros
|
||||
*/
|
||||
#ifdef _DtIconBoxP_h
|
||||
#define M_Timer(m) (m -> icon_box.timer)
|
||||
#define M_ShellX(m) (m -> icon_box.shell_x)
|
||||
#define M_ShellY(m) (m -> icon_box.shell_y)
|
||||
#define M_DragShell(m) (m -> icon_box.drag_shell)
|
||||
#define M_DragWidget(m) (m -> icon_box.drag_widget)
|
||||
#define M_DragIcon(m) (m -> icon_box.drag_icon)
|
||||
#define M_XCursor(m) (m -> icon_box.x_cursor)
|
||||
#define M_CrossCursor(m) (m -> icon_box.cross_cursor)
|
||||
#endif /* _DtIconBoxP_h */
|
||||
#endif /* MAYBE */
|
||||
|
||||
#endif /* _DtMacrosP_h */
|
||||
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
1045
cde/lib/DtWidget/MenuButton.c
Normal file
1045
cde/lib/DtWidget/MenuButton.c
Normal file
File diff suppressed because it is too large
Load Diff
82
cde/lib/DtWidget/MenuButton.h
Normal file
82
cde/lib/DtWidget/MenuButton.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/* $XConsortium: MenuButton.h /main/3 1995/10/26 09:33:10 rswiston $ */
|
||||
/*
|
||||
* (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 _Dt_MenuButton_h
|
||||
#define _Dt_MenuButton_h
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
|
||||
/* Resources */
|
||||
|
||||
#ifndef DtNcascadingCallback
|
||||
#define DtNcascadingCallback XmNcascadingCallback
|
||||
#endif
|
||||
#ifndef DtNsubMenuId
|
||||
#define DtNsubMenuId XmNsubMenuId
|
||||
#endif
|
||||
#ifndef DtNcascadePixmap
|
||||
#define DtNcascadePixmap XmNcascadePixmap
|
||||
#endif
|
||||
|
||||
#ifndef DtCCallback
|
||||
#define DtCCallback XmCCallback
|
||||
#endif
|
||||
#ifndef DtCPixmap
|
||||
#define DtCPixmap XmCPixmap
|
||||
#endif
|
||||
#ifndef DtCMenuWidget
|
||||
#define DtCMenuWidget XmCMenuWidget
|
||||
#endif
|
||||
|
||||
#ifndef DtCR_CASCADING
|
||||
#define DtCR_CASCADING XmCR_CASCADING
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
|
||||
/* Widget class and instance */
|
||||
|
||||
typedef struct _DtMenuButtonRec * DtMenuButtonWidget;
|
||||
typedef struct _DtMenuButtonClassRec * DtMenuButtonWidgetClass;
|
||||
|
||||
|
||||
/*
|
||||
* Data
|
||||
*/
|
||||
|
||||
/* Widget class record */
|
||||
|
||||
externalref WidgetClass dtMenuButtonWidgetClass;
|
||||
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
|
||||
extern Widget DtCreateMenuButton(
|
||||
Widget parent,
|
||||
char *name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _Dt_MenuButton_h */
|
||||
101
cde/lib/DtWidget/MenuButtonP.h
Normal file
101
cde/lib/DtWidget/MenuButtonP.h
Normal file
@@ -0,0 +1,101 @@
|
||||
/* $XConsortium: MenuButtonP.h /main/3 1995/10/26 09:33:17 rswiston $ */
|
||||
/*
|
||||
* Copyright (C) 1986,1991 Sun Microsystems, Inc
|
||||
* All rights reserved.
|
||||
* Notice of copyright on this source code
|
||||
* product does not indicate publication.
|
||||
*
|
||||
* RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by
|
||||
* the U.S. Government is subject to restrictions as set forth
|
||||
* in subparagraph (c)(1)(ii) of the Rights in Technical Data
|
||||
* and Computer Software Clause at DFARS 252.227-7013 (Oct. 1988)
|
||||
* and FAR 52.227-19 (c) (June 1987).
|
||||
*
|
||||
* Sun Microsystems, Inc., 2550 Garcia Avenue,
|
||||
* Mountain View, California 94043.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _DtMenuButtonP_h
|
||||
#define _DtMenuButtonP_h
|
||||
|
||||
#include "MenuButton.h"
|
||||
#include <Xm/LabelP.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Message Defines
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
#define MB_POST DTWIDGET_GETMESSAGE( \
|
||||
MS_MenuButton, MENU_POST, _DtMsgMenuButton_0000)
|
||||
|
||||
#define MB_PARENT DTWIDGET_GETMESSAGE( \
|
||||
MS_MenuButton, MENU_PARENT, _DtMsgMenuButton_0001)
|
||||
|
||||
#define MB_SUBMENU DTWIDGET_GETMESSAGE( \
|
||||
MS_MenuButton, MENU_SUBMENU, _DtMsgMenuButton_0002)
|
||||
|
||||
|
||||
/* The MenuButton instance record */
|
||||
|
||||
typedef struct
|
||||
{ /* resources */
|
||||
XtCallbackList cascading_callback; /* Cascading callback */
|
||||
Widget submenu; /* the menu to pull down */
|
||||
Pixmap menu_pixmap; /* pixmap for the menu */
|
||||
|
||||
/* internal fields */
|
||||
|
||||
Boolean armed; /* armed flag */
|
||||
Boolean popped_up; /* submenu popped up flag*/
|
||||
XRectangle menu_rect; /* location of menu*/
|
||||
Time last_timestamp; /* last time submenu popped down */
|
||||
Boolean private_submenu;
|
||||
GC gc;
|
||||
} DtMenuButtonPart;
|
||||
|
||||
|
||||
/* Full instance record declaration */
|
||||
|
||||
typedef struct _DtMenuButtonRec
|
||||
{
|
||||
CorePart core;
|
||||
XmPrimitivePart primitive;
|
||||
XmLabelPart label;
|
||||
DtMenuButtonPart menu_button;
|
||||
} DtMenuButtonRec;
|
||||
|
||||
|
||||
/* MenuButton class structure */
|
||||
|
||||
typedef struct {
|
||||
XtPointer extension; /* Pointer to extension record */
|
||||
} DtMenuButtonClassPart;
|
||||
|
||||
|
||||
/* Full class record declaration for MenuButton class */
|
||||
|
||||
typedef struct _DtMenuButtonClassRec {
|
||||
CoreClassPart core_class;
|
||||
XmPrimitiveClassPart primitive_class;
|
||||
XmLabelClassPart label_class;
|
||||
DtMenuButtonClassPart menu_button_class;
|
||||
} DtMenuButtonClassRec;
|
||||
|
||||
|
||||
extern DtMenuButtonClassRec dtMenuButtonClassRec;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtMenuButtonP_h */
|
||||
/* DON'T ADD STUFF AFTER THIS #endif */
|
||||
|
||||
354
cde/lib/DtWidget/NewCvt.c
Normal file
354
cde/lib/DtWidget/NewCvt.c
Normal file
@@ -0,0 +1,354 @@
|
||||
/* $XConsortium: NewCvt.c /main/5 1996/03/26 19:53:53 drk $
|
||||
*
|
||||
* (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.
|
||||
*/
|
||||
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: NewCvt.c
|
||||
***
|
||||
*** project: Motif Widgets
|
||||
***
|
||||
*** description: Source code for new MotifPlus resource converters.
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Include Files
|
||||
*/
|
||||
|
||||
#include <Dt/DialogBox.h>
|
||||
#include <Dt/Icon.h>
|
||||
#include <Dt/TitleBox.h>
|
||||
#include "DtWidgetI.h"
|
||||
|
||||
|
||||
extern void _DtRegisterNewConverters( void ) ;
|
||||
|
||||
/******** Static Function Declarations ********/
|
||||
|
||||
static Boolean _StringsAreEqual(
|
||||
String in_str,
|
||||
String test_str) ;
|
||||
static void _DtCvtStringToBehavior(
|
||||
XrmValuePtr args,
|
||||
Cardinal *num_args,
|
||||
XrmValue *from_val,
|
||||
XrmValue *to_val) ;
|
||||
static void _DtCvtStringToChildType(
|
||||
XrmValuePtr args,
|
||||
Cardinal *num_args,
|
||||
XrmValue *from_val,
|
||||
XrmValue *to_val) ;
|
||||
static void _DtCvtStringToFillMode(
|
||||
XrmValuePtr args,
|
||||
Cardinal *num_args,
|
||||
XrmValue *from_val,
|
||||
XrmValue *to_val) ;
|
||||
static void _DtCvtStringToPixmapPosition(
|
||||
XrmValuePtr args,
|
||||
Cardinal *num_args,
|
||||
XrmValue *from_val,
|
||||
XrmValue *to_val) ;
|
||||
static void _DtCvtStringToStringPosition(
|
||||
XrmValuePtr args,
|
||||
Cardinal *num_args,
|
||||
XrmValue *from_val,
|
||||
XrmValue *to_val) ;
|
||||
static void _DtCvtStringToTitlePosition(
|
||||
XrmValuePtr args,
|
||||
Cardinal *num_args,
|
||||
XrmValue *from_val,
|
||||
XrmValue *to_val) ;
|
||||
|
||||
/******** End Static Function Declarations ********/
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** _DtRegisterNewConverters
|
||||
** Convert MotifPlus resource converters.
|
||||
*/
|
||||
void
|
||||
_DtRegisterNewConverters( void )
|
||||
{
|
||||
static Boolean new_converters_registered = False;
|
||||
|
||||
if (!new_converters_registered)
|
||||
{
|
||||
_DtProcessLock();
|
||||
if (!new_converters_registered)
|
||||
{
|
||||
/* Register new converters. */
|
||||
XtAddConverter (XmRString, XmRBehavior,
|
||||
_DtCvtStringToBehavior, NULL, 0);
|
||||
|
||||
XtAddConverter (XmRString, XmRChildType,
|
||||
_DtCvtStringToChildType, NULL, 0);
|
||||
|
||||
XtAddConverter (XmRString, XmRFillMode,
|
||||
_DtCvtStringToFillMode, NULL, 0);
|
||||
|
||||
XtAddConverter (XmRString, XmRPixmapPosition,
|
||||
_DtCvtStringToPixmapPosition, NULL, 0);
|
||||
|
||||
XtAddConverter (XmRString, XmRStringPosition,
|
||||
_DtCvtStringToStringPosition, NULL, 0);
|
||||
|
||||
XtAddConverter (XmRString, XmRTitlePosition,
|
||||
_DtCvtStringToTitlePosition, NULL, 0);
|
||||
|
||||
new_converters_registered = True;
|
||||
}
|
||||
_DtProcessUnlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** _StringsAreEqual
|
||||
** Compare possibly mixed case string with lowercase string.
|
||||
*/
|
||||
static Boolean
|
||||
_StringsAreEqual(
|
||||
String in_str,
|
||||
String test_str )
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
i = *in_str;
|
||||
j = *test_str;
|
||||
|
||||
if (isupper (i))
|
||||
i = tolower (i);
|
||||
if (i != j) return (False);
|
||||
if (i == 0) return (True);
|
||||
|
||||
in_str++;
|
||||
test_str++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** _DtCvtStringToBehavior
|
||||
** Convert XmRString to XmRBehavior.
|
||||
*/
|
||||
static void
|
||||
_DtCvtStringToBehavior(
|
||||
XrmValuePtr args,
|
||||
Cardinal *num_args,
|
||||
XrmValue *from_val,
|
||||
XrmValue *to_val )
|
||||
{
|
||||
String string = (String) from_val->addr;
|
||||
static unsigned char value;
|
||||
|
||||
to_val->size = sizeof (unsigned char);
|
||||
to_val->addr = (XtPointer) &value;
|
||||
|
||||
if (_StringsAreEqual (string, STR_ICON_LABEL))
|
||||
value = XmICON_LABEL;
|
||||
else if (_StringsAreEqual (string, STR_ICON_BUTTON))
|
||||
value = XmICON_BUTTON;
|
||||
else if (_StringsAreEqual (string, STR_ICON_TOGGLE))
|
||||
value = XmICON_TOGGLE;
|
||||
else if (_StringsAreEqual (string, STR_ICON_DRAG))
|
||||
value = XmICON_DRAG;
|
||||
else
|
||||
{
|
||||
to_val->size = 0;
|
||||
to_val->addr = NULL;
|
||||
XtStringConversionWarning ((String) from_val->addr,
|
||||
XmRBehavior);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** _DtCvtStringToChildType
|
||||
** Convert XmRString to XmRChildType.
|
||||
*/
|
||||
static void
|
||||
_DtCvtStringToChildType(
|
||||
XrmValuePtr args,
|
||||
Cardinal *num_args,
|
||||
XrmValue *from_val,
|
||||
XrmValue *to_val )
|
||||
{
|
||||
String string = (String) from_val->addr;
|
||||
static unsigned char value;
|
||||
|
||||
to_val->size = sizeof (unsigned char);
|
||||
to_val->addr = (XtPointer) &value;
|
||||
|
||||
if (_StringsAreEqual (string, STR_WORK_AREA))
|
||||
value = XmWORK_AREA;
|
||||
else if (_StringsAreEqual (string, STR_TITLE_AREA))
|
||||
value = XmTITLE_AREA;
|
||||
else if (_StringsAreEqual (string, STR_SEPARATOR))
|
||||
value = XmSEPARATOR;
|
||||
else if (_StringsAreEqual (string, STR_BUTTON))
|
||||
value = XmBUTTON;
|
||||
else
|
||||
{
|
||||
to_val->size = 0;
|
||||
to_val->addr = NULL;
|
||||
XtStringConversionWarning ((String) from_val->addr,
|
||||
XmRChildType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** _DtCvtStringToFillMode
|
||||
** Convert XmRString to XmRFillMode.
|
||||
*/
|
||||
static void
|
||||
_DtCvtStringToFillMode(
|
||||
XrmValuePtr args,
|
||||
Cardinal *num_args,
|
||||
XrmValue *from_val,
|
||||
XrmValue *to_val )
|
||||
{
|
||||
String string = (String) from_val->addr;
|
||||
static unsigned char value;
|
||||
|
||||
to_val->size = sizeof (unsigned char);
|
||||
to_val->addr = (XtPointer) &value;
|
||||
|
||||
if (_StringsAreEqual (string, STR_FILL_NONE))
|
||||
value = XmFILL_NONE;
|
||||
else if (_StringsAreEqual (string, STR_FILL_PARENT))
|
||||
value = XmFILL_PARENT;
|
||||
else if (_StringsAreEqual (string, STR_FILL_SELF))
|
||||
value = XmFILL_SELF;
|
||||
else if (_StringsAreEqual (string, STR_FILL_TRANSPARENT))
|
||||
value = XmFILL_TRANSPARENT;
|
||||
else
|
||||
{
|
||||
to_val->size = 0;
|
||||
to_val->addr = NULL;
|
||||
XtStringConversionWarning ((String) from_val->addr,
|
||||
XmRFillMode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** _DtCvtStringToPixmapPosition
|
||||
** Convert string to pixmap position.
|
||||
*/
|
||||
static void
|
||||
_DtCvtStringToPixmapPosition(
|
||||
XrmValuePtr args,
|
||||
Cardinal *num_args,
|
||||
XrmValue *from_val,
|
||||
XrmValue *to_val )
|
||||
{
|
||||
String string = (String) from_val->addr;
|
||||
static unsigned char value;
|
||||
|
||||
to_val->size = sizeof (unsigned char);
|
||||
to_val->addr = (XtPointer) &value;
|
||||
|
||||
if (_StringsAreEqual (string, STR_PIXMAP_TOP))
|
||||
value = XmPIXMAP_TOP;
|
||||
else if (_StringsAreEqual (string, STR_PIXMAP_BOTTOM))
|
||||
value = XmPIXMAP_BOTTOM;
|
||||
else if (_StringsAreEqual (string, STR_PIXMAP_LEFT))
|
||||
value = XmPIXMAP_LEFT;
|
||||
else if (_StringsAreEqual (string, STR_PIXMAP_RIGHT))
|
||||
value = XmPIXMAP_RIGHT;
|
||||
else if (_StringsAreEqual (string, "pixmap_middle"))
|
||||
value = XmPIXMAP_MIDDLE;
|
||||
else
|
||||
{
|
||||
to_val->size = 0;
|
||||
to_val->addr = NULL;
|
||||
XtStringConversionWarning ((String) from_val->addr,
|
||||
XmRPixmapPosition);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** _DtCvtStringToStringPosition
|
||||
** Convert XmRString to XmRStringPosition.
|
||||
*/
|
||||
static void
|
||||
_DtCvtStringToStringPosition(
|
||||
XrmValuePtr args,
|
||||
Cardinal *num_args,
|
||||
XrmValue *from_val,
|
||||
XrmValue *to_val )
|
||||
{
|
||||
String string = (String) from_val->addr;
|
||||
static unsigned char value;
|
||||
|
||||
to_val->size = sizeof (unsigned char);
|
||||
to_val->addr = (XtPointer) &value;
|
||||
|
||||
if (_StringsAreEqual (string, STR_STRING_TOP))
|
||||
value = XmSTRING_TOP;
|
||||
else if (_StringsAreEqual (string, STR_STRING_BOTTOM))
|
||||
value = XmSTRING_BOTTOM;
|
||||
else if (_StringsAreEqual (string, STR_STRING_LEFT))
|
||||
value = XmSTRING_LEFT;
|
||||
else if (_StringsAreEqual (string, STR_STRING_RIGHT))
|
||||
value = XmSTRING_RIGHT;
|
||||
else
|
||||
{
|
||||
to_val->size = 0;
|
||||
to_val->addr = NULL;
|
||||
XtStringConversionWarning ((String) from_val->addr,
|
||||
XmRStringPosition);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** _DtCvtStringToTitlePosition
|
||||
** Convert XmRString to XmRTitlePosition.
|
||||
*/
|
||||
static void
|
||||
_DtCvtStringToTitlePosition(
|
||||
XrmValuePtr args,
|
||||
Cardinal *num_args,
|
||||
XrmValue *from_val,
|
||||
XrmValue *to_val )
|
||||
{
|
||||
String string = (String) from_val->addr;
|
||||
static unsigned char value;
|
||||
|
||||
to_val->size = sizeof (unsigned char);
|
||||
to_val->addr = (XtPointer) &value;
|
||||
|
||||
if (_StringsAreEqual (string, STR_TITLE_TOP))
|
||||
value = XmTITLE_TOP;
|
||||
else if (_StringsAreEqual (string, STR_TITLE_BOTTOM))
|
||||
value = XmTITLE_BOTTOM;
|
||||
else
|
||||
{
|
||||
to_val->size = 0;
|
||||
to_val->addr = NULL;
|
||||
XtStringConversionWarning ((String) from_val->addr,
|
||||
XmRTitlePosition);
|
||||
}
|
||||
}
|
||||
|
||||
1369
cde/lib/DtWidget/SearchCalls.c
Normal file
1369
cde/lib/DtWidget/SearchCalls.c
Normal file
File diff suppressed because it is too large
Load Diff
628
cde/lib/DtWidget/SearchDlg.c
Normal file
628
cde/lib/DtWidget/SearchDlg.c
Normal file
@@ -0,0 +1,628 @@
|
||||
/* $XConsortium: SearchDlg.c /main/4 1996/08/28 16:51:52 drk $ */
|
||||
/**********************************<+>*************************************
|
||||
***************************************************************************
|
||||
**
|
||||
** File: SearchDlg.c
|
||||
**
|
||||
** Project: Editor widget
|
||||
**
|
||||
** Description: Routines which manipulate the dialogs associated with
|
||||
** find/change functions.
|
||||
** -----------
|
||||
**
|
||||
*******************************************************************
|
||||
* (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.
|
||||
********************************************************************
|
||||
**
|
||||
**
|
||||
**************************************************************************
|
||||
**********************************<+>*************************************/
|
||||
#include "EditorP.h"
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/Separator.h>
|
||||
#include <Xm/Form.h>
|
||||
#include <Xm/ScrollBar.h>
|
||||
#include <Xm/List.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/TextF.h>
|
||||
#include <Xm/MwmUtil.h>
|
||||
#include <Dt/DtMsgsP.h>
|
||||
|
||||
static void ManageFind(
|
||||
DtEditorWidget pPriv);
|
||||
static void UnmanageFind(
|
||||
DtEditorWidget pPriv);
|
||||
static void CreateSearchDialog(
|
||||
DtEditorWidget pPriv);
|
||||
|
||||
static void
|
||||
ManageFind(
|
||||
DtEditorWidget pPriv)
|
||||
{
|
||||
Arg al[10];
|
||||
register int ac;
|
||||
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg(al[ac], XmNtopWidget, M_findText(pPriv)); ac++;
|
||||
XtSetArg(al[ac], XmNtopOffset, 10); ac++;
|
||||
XtSetValues(M_search_replaceLbl(pPriv), al, ac);
|
||||
|
||||
XtManageChild(M_search_findLbl(pPriv));
|
||||
XtManageChild(M_findText(pPriv));
|
||||
}
|
||||
|
||||
static void
|
||||
UnmanageFind(
|
||||
DtEditorWidget pPriv)
|
||||
{
|
||||
Arg al[10];
|
||||
register int ac;
|
||||
|
||||
XtUnmanageChild(M_search_findLbl(pPriv));
|
||||
XtUnmanageChild(M_findText(pPriv));
|
||||
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg(al[ac], XmNtopWidget, M_search_spellList(pPriv)); ac++;
|
||||
XtSetArg(al[ac], XmNtopOffset, 10); ac++;
|
||||
XtSetValues(M_search_replaceLbl(pPriv), al, ac);
|
||||
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
*
|
||||
* _DtEditorSearch - Post a dialog asking for search string
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
void
|
||||
_DtEditorSearch(
|
||||
DtEditorWidget pPriv,
|
||||
Boolean spell,
|
||||
Boolean createonly )
|
||||
{
|
||||
Arg al[10]; /* arg list */
|
||||
register int ac; /* arg count */
|
||||
|
||||
/* create the dialog if it is the first time */
|
||||
if ( !M_search_dialog(pPriv) )
|
||||
CreateSearchDialog(pPriv);
|
||||
|
||||
if (!createonly)
|
||||
{
|
||||
/* Prepare to display the dialog */
|
||||
XtUnmanageChild(M_search_dialog(pPriv));
|
||||
/*
|
||||
* Turn off the Find, Change, and Change All buttons.
|
||||
* They will be turned on by the appropriate callback.
|
||||
*/
|
||||
_DtEditorSetFindSensitivity(pPriv, False);
|
||||
_DtEditorSetReplaceSensitivity(pPriv, False);
|
||||
_DtEditorSetReplaceAllSensitivity(pPriv, False);
|
||||
|
||||
/*
|
||||
* Clear the Change To field. If in Find/Change mode it will
|
||||
* be seeded with the last replace string, in Spell mode it will
|
||||
* remain blank.
|
||||
*/
|
||||
XmTextFieldSetString( M_replaceText(pPriv), (char *)NULL );
|
||||
|
||||
if (spell)
|
||||
{
|
||||
/*
|
||||
* Set it up as a Spell dialog
|
||||
*/
|
||||
|
||||
Position y;
|
||||
Dimension height, formHeight;
|
||||
|
||||
M_search_dialogMode(pPriv) = SPELL;
|
||||
|
||||
/*
|
||||
* Set the dialog title.
|
||||
* If DtNdialogTitle has been set then prepend it.
|
||||
*/
|
||||
if ( E_dialogTitle(pPriv) != (XmString)NULL) {
|
||||
|
||||
XmString titleStr = XmStringConcat( E_dialogTitle(pPriv),
|
||||
M_spellTitle(pPriv) );
|
||||
|
||||
XtSetArg(al[0],XmNdialogTitle,titleStr);
|
||||
XtSetValues(M_search_dialog(pPriv), al, 1);
|
||||
|
||||
XmStringFree( titleStr );
|
||||
}
|
||||
else {
|
||||
XtSetArg(al[0],XmNdialogTitle,M_spellTitle(pPriv));
|
||||
XtSetValues(M_search_dialog(pPriv), al, 1);
|
||||
}
|
||||
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_NONE); ac++;
|
||||
XtSetValues(XtParent(M_search_spellList(pPriv)), al, ac);
|
||||
XtManageChild(M_search_listLbl(pPriv));
|
||||
XtManageChild(XtParent(M_search_spellList(pPriv)));
|
||||
|
||||
/*
|
||||
* Select first item in list which will cause its selectCB
|
||||
* to sensitize the Find button and clear the Change To field.
|
||||
*/
|
||||
XmListSelectPos(M_search_spellList(pPriv), 1, True);
|
||||
|
||||
/*
|
||||
* Hide the Find field & label
|
||||
*/
|
||||
UnmanageFind(pPriv);
|
||||
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], XmNy, &y); ac++;
|
||||
XtSetArg(al[ac], XmNheight, &height); ac++;
|
||||
XtGetValues(XtParent(M_search_spellList(pPriv)), al, ac);
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], XmNheight, &formHeight); ac++;
|
||||
XtGetValues(M_search_dialog(pPriv), al, ac);
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNbottomOffset, formHeight - (y + height)); ac++;
|
||||
XtSetValues(XtParent(M_search_spellList(pPriv)), al, ac);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Set it up as a Find/Change dialog
|
||||
*/
|
||||
|
||||
XEvent event;
|
||||
|
||||
M_search_dialogMode(pPriv) = REPLACE;
|
||||
|
||||
/*
|
||||
* Set the dialog title.
|
||||
* If DtNdialogTitle has been set then prepend it.
|
||||
*/
|
||||
ac = 0;
|
||||
if ( E_dialogTitle(pPriv) != (XmString)NULL) {
|
||||
XmString titleStr = XmStringConcat( E_dialogTitle(pPriv),
|
||||
M_fndChngTitle(pPriv) );
|
||||
|
||||
XtSetArg(al[0], XmNdialogTitle, titleStr);
|
||||
XtSetValues(M_search_dialog(pPriv), al, 1);
|
||||
|
||||
XmStringFree( titleStr );
|
||||
}
|
||||
else {
|
||||
XtSetArg( al[0], XmNdialogTitle,M_fndChngTitle(pPriv) );
|
||||
XtSetValues(M_search_dialog(pPriv), al, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Show the Find field & label
|
||||
*/
|
||||
ManageFind(pPriv);
|
||||
|
||||
/*
|
||||
* Seed the Find field with the last string we searched for
|
||||
* and select it. This will cause _DtEditorFindTextChangedCB
|
||||
* to enable the Find & Change All buttons.
|
||||
*/
|
||||
|
||||
if ( M_search_string(pPriv) ) {
|
||||
XmTextFieldSetString(M_findText(pPriv),M_search_string(pPriv));
|
||||
event.xkey.time = XtLastTimestampProcessed(M_display(pPriv));
|
||||
XtCallActionProc( (Widget) M_findText(pPriv), "select-all",
|
||||
&event, (String *)NULL, 0 );
|
||||
}
|
||||
else
|
||||
XmTextFieldSetString( M_findText(pPriv), (char *)NULL );
|
||||
|
||||
/*
|
||||
* Seed the Change To field with the last replacement string.
|
||||
*/
|
||||
|
||||
if ( M_replace_string(pPriv) )
|
||||
XmTextFieldSetString( M_replaceText(pPriv),
|
||||
M_replace_string(pPriv) );
|
||||
|
||||
/*
|
||||
* Hide the list of misspelled words
|
||||
*/
|
||||
XtUnmanageChild(M_search_listLbl(pPriv));
|
||||
XtUnmanageChild(XtParent(M_search_spellList(pPriv)));
|
||||
}
|
||||
|
||||
/*
|
||||
* Display the dialog
|
||||
*/
|
||||
XtManageChild(M_search_dialog(pPriv));
|
||||
}
|
||||
|
||||
if (M_search_dialogMode(pPriv) == SPELL)
|
||||
XmProcessTraversal(M_replaceText(pPriv), XmTRAVERSE_CURRENT);
|
||||
else
|
||||
XmProcessTraversal(M_findText(pPriv), XmTRAVERSE_CURRENT);
|
||||
}
|
||||
|
||||
static void
|
||||
CreateSearchDialog(
|
||||
DtEditorWidget pPriv)
|
||||
{
|
||||
Arg al[10]; /* arg list */
|
||||
register int ac; /* arg count */
|
||||
Pixel textBackground, textForeground;
|
||||
XmString tmpStr1;
|
||||
|
||||
/*
|
||||
* The Find/Change & the Spell dialogs are the same dialog with
|
||||
* various components unmanaged depending upon the mode of the
|
||||
* dialog. There is no reason why these could not be separate
|
||||
* dialogs if they need to be. All of the callbacks and routines
|
||||
* which manipulate these dialogs are aware of the dialog's mode and
|
||||
* could be split into two separate callbacks/routines.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Match the background & foreground colors of the edit window
|
||||
* Don't use DtNtextBackground/Foreground directly because they
|
||||
* will be DtUNSPECIFIED.
|
||||
*/
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], XmNforeground, &textForeground); ac++;
|
||||
XtSetArg(al[ac], XmNbackground, &textBackground); ac++;
|
||||
XtGetValues(M_text(pPriv), al, ac);
|
||||
|
||||
/*
|
||||
* Create the form dialog.
|
||||
*/
|
||||
ac = 0;
|
||||
M_search_dialog(pPriv) = XmCreateFormDialog(M_topLevelShell(pPriv),
|
||||
"findDlg", al, ac);
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], XmNautoUnmanage, False); ac++;
|
||||
XtSetValues(M_search_dialog(pPriv), al, ac);
|
||||
|
||||
/*
|
||||
* When creating the fields & buttons use the appropriate label
|
||||
* resource (e.g. DtNchangeButtonLabel), if it has been set, then
|
||||
* clear the resource to save space. The field or button widget
|
||||
* will contain the actual value & it can be gotten from there,
|
||||
* if it is needed.
|
||||
*
|
||||
* If the appropriate resource has not been set, use its default
|
||||
* value from the message catalog.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Create the list of misspelled words
|
||||
*/
|
||||
ac = 0;
|
||||
if (E_misspelledListLabel(pPriv) != (XmString) DtUNSPECIFIED) {
|
||||
/*
|
||||
* Use the resource value & clear it (to save space).
|
||||
*/
|
||||
|
||||
tmpStr1 = XmStringCopy(E_misspelledListLabel(pPriv));
|
||||
E_misspelledListLabel(pPriv) = (XmString) DtUNSPECIFIED;
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* The resource has not been set so use its default value
|
||||
*/
|
||||
tmpStr1 = XmStringCreateLocalized(MISSPELLED);
|
||||
}
|
||||
XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
|
||||
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNfontList, E_labelFontList(pPriv)); ac++;
|
||||
M_search_listLbl(pPriv) = XmCreateLabelGadget(M_search_dialog(pPriv),
|
||||
"listLbl", al, ac);
|
||||
XmStringFree(tmpStr1);
|
||||
XtManageChild(M_search_listLbl(pPriv));
|
||||
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg(al[ac], XmNtopWidget, M_search_listLbl(pPriv)); ac++;
|
||||
XtSetArg(al[ac], XmNscrollingPolicy, XmAUTOMATIC); ac++;
|
||||
XtSetArg(al[ac], XmNfontList, E_textFontList(pPriv)); ac++;
|
||||
M_search_spellList(pPriv) = XmCreateScrolledList(M_search_dialog(pPriv),
|
||||
"spellList", al, ac);
|
||||
XtManageChild(M_search_spellList(pPriv));
|
||||
XtManageChild(XtParent(M_search_spellList(pPriv)));
|
||||
|
||||
XtAddCallback( M_search_spellList(pPriv), XmNhelpCallback,
|
||||
(XtCallbackProc)_DtEditorHelpSearchSpellCB,
|
||||
(XtPointer)pPriv );
|
||||
|
||||
/*
|
||||
* Create the find field & its label
|
||||
*/
|
||||
ac = 0;
|
||||
if (E_findFieldLabel(pPriv) != (XmString) DtUNSPECIFIED) {
|
||||
/*
|
||||
* Use the resource value & clear it (to save space).
|
||||
*/
|
||||
|
||||
tmpStr1 = XmStringCopy(E_findFieldLabel(pPriv));
|
||||
E_findFieldLabel(pPriv) = (XmString) DtUNSPECIFIED;
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* The resource has not been set so use its default value
|
||||
*/
|
||||
tmpStr1 = XmStringCreateLocalized(FIND_LABEL);
|
||||
}
|
||||
XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNtopOffset, 10); ac++;
|
||||
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNfontList, E_labelFontList(pPriv)); ac++;
|
||||
M_search_findLbl(pPriv) = XmCreateLabelGadget(M_search_dialog(pPriv),
|
||||
"findLbl", al, ac);
|
||||
XmStringFree(tmpStr1);
|
||||
|
||||
ac = 0;
|
||||
XtSetArg (al[ac], XmNbackground, textBackground); ac++;
|
||||
XtSetArg (al[ac], XmNforeground, textForeground); ac++;
|
||||
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg(al[ac], XmNtopWidget, M_search_findLbl(pPriv)); ac++;
|
||||
XtSetArg(al[ac], XmNtopOffset, 5); ac++;
|
||||
XtSetArg(al[ac], XmNfontList, E_textFontList(pPriv)); ac++;
|
||||
M_findText(pPriv) = XmCreateTextField(M_search_dialog(pPriv), "findTxt",
|
||||
al, ac);
|
||||
|
||||
XtAddCallback( M_findText(pPriv), XmNhelpCallback,
|
||||
(XtCallbackProc)_DtEditorHelpSearchFindCB,
|
||||
(XtPointer)pPriv );
|
||||
|
||||
/*
|
||||
* Create the Change To field & its label
|
||||
*/
|
||||
ac = 0;
|
||||
if (E_changeFieldLabel(pPriv) != (XmString) DtUNSPECIFIED) {
|
||||
/*
|
||||
* Use the resource value & clear it (to save space).
|
||||
*/
|
||||
|
||||
tmpStr1 = XmStringCopy(E_changeFieldLabel(pPriv));
|
||||
E_changeFieldLabel(pPriv) = (XmString) DtUNSPECIFIED;
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* The resource has not been set so use its default value
|
||||
*/
|
||||
tmpStr1 = XmStringCreateLocalized(CHANGE_LABEL);
|
||||
}
|
||||
XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
|
||||
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg(al[ac], XmNtopWidget, M_findText(pPriv)); ac++;
|
||||
XtSetArg(al[ac], XmNtopOffset, 10); ac++;
|
||||
XtSetArg(al[ac], XmNfontList, E_labelFontList(pPriv)); ac++;
|
||||
M_search_replaceLbl(pPriv) = XmCreateLabelGadget(M_search_dialog(pPriv),
|
||||
"repLbl", al, ac);
|
||||
XmStringFree(tmpStr1);
|
||||
XtManageChild(M_search_replaceLbl(pPriv));
|
||||
|
||||
ac = 0;
|
||||
XtSetArg (al[ac], XmNbackground, textBackground); ac++;
|
||||
XtSetArg (al[ac], XmNforeground, textForeground); ac++;
|
||||
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg(al[ac], XmNtopWidget, M_search_replaceLbl(pPriv)); ac++;
|
||||
XtSetArg(al[ac], XmNtopOffset, 5); ac++;
|
||||
XtSetArg(al[ac], XmNfontList, E_textFontList(pPriv)); ac++;
|
||||
M_replaceText(pPriv) = XmCreateTextField(M_search_dialog(pPriv), "repTxt",
|
||||
al, ac);
|
||||
XtManageChild(M_replaceText(pPriv));
|
||||
|
||||
XtAddCallback( M_replaceText(pPriv), XmNhelpCallback,
|
||||
(XtCallbackProc)_DtEditorHelpSearchChangeCB,
|
||||
(XtPointer)pPriv );
|
||||
/*
|
||||
* Only enable Change To field if the widget is editable
|
||||
*/
|
||||
XtSetSensitive(M_search_replaceLbl(pPriv), M_editable(pPriv));
|
||||
XtSetSensitive(M_replaceText(pPriv), M_editable(pPriv));
|
||||
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg(al[ac], XmNtopWidget, M_replaceText(pPriv)); ac++;
|
||||
XtSetArg(al[ac], XmNtopOffset, 5); ac++;
|
||||
M_search_separator(pPriv) =
|
||||
XmCreateSeparator(M_search_dialog(pPriv), "separator",
|
||||
al, ac);
|
||||
XtManageChild(M_search_separator(pPriv));
|
||||
|
||||
/*
|
||||
* Create the buttons & their labels
|
||||
*/
|
||||
|
||||
/* Find button */
|
||||
ac = 0;
|
||||
if (E_findButtonLabel(pPriv) != (XmString) DtUNSPECIFIED) {
|
||||
/*
|
||||
* Use the resource value & clear it (to save space).
|
||||
*/
|
||||
|
||||
tmpStr1 = XmStringCopy(E_findButtonLabel(pPriv));
|
||||
E_findButtonLabel(pPriv) = (XmString) DtUNSPECIFIED;
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* The resource has not been set so use its default value
|
||||
*/
|
||||
tmpStr1 = XmStringCreateLocalized(FIND_BUTTON);
|
||||
}
|
||||
XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
|
||||
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
|
||||
XtSetArg(al[ac], XmNleftPosition, 2); ac++;
|
||||
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
|
||||
XtSetArg(al[ac], XmNrightPosition, 33); ac++;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg(al[ac], XmNtopWidget, M_search_separator(pPriv)); ac++;
|
||||
XtSetArg(al[ac], XmNtopOffset, 7); ac++;
|
||||
XtSetArg(al[ac], XmNfontList, E_buttonFontList(pPriv)); ac++;
|
||||
M_search_findBtn(pPriv) = XmCreatePushButtonGadget(M_search_dialog(pPriv),
|
||||
"findBtn", al, ac);
|
||||
XmStringFree(tmpStr1);
|
||||
XtManageChild(M_search_findBtn(pPriv));
|
||||
|
||||
/* Change button */
|
||||
ac = 0;
|
||||
if (E_changeButtonLabel(pPriv) != (XmString) DtUNSPECIFIED) {
|
||||
/*
|
||||
* Use the resource value & clear it (to save space).
|
||||
*/
|
||||
|
||||
tmpStr1 = XmStringCopy(E_changeButtonLabel(pPriv));
|
||||
E_changeButtonLabel(pPriv) = (XmString) DtUNSPECIFIED;
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* The resource has not been set so use its default value
|
||||
*/
|
||||
tmpStr1 = XmStringCreateLocalized(CHANGE_BUTTON);
|
||||
}
|
||||
XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
|
||||
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
|
||||
XtSetArg(al[ac], XmNleftPosition, 35); ac++;
|
||||
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
|
||||
XtSetArg(al[ac], XmNrightPosition, 66); ac++;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg(al[ac], XmNtopWidget, M_search_separator(pPriv)); ac++;
|
||||
XtSetArg(al[ac], XmNtopOffset, 7); ac++;
|
||||
XtSetArg(al[ac], XmNfontList, E_buttonFontList(pPriv)); ac++;
|
||||
M_search_replaceBtn(pPriv) = XmCreatePushButtonGadget(
|
||||
M_search_dialog(pPriv),
|
||||
"replBtn", al, ac);
|
||||
XmStringFree(tmpStr1);
|
||||
XtManageChild(M_search_replaceBtn(pPriv));
|
||||
|
||||
/* Change All button */
|
||||
ac = 0;
|
||||
if (E_changeAllButtonLabel(pPriv) != (XmString) DtUNSPECIFIED) {
|
||||
/*
|
||||
* Use the resource value & clear it (to save space).
|
||||
*/
|
||||
|
||||
tmpStr1 = XmStringCopy(E_changeAllButtonLabel(pPriv));
|
||||
E_changeAllButtonLabel(pPriv) = (XmString) DtUNSPECIFIED;
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* The resource has not been set so use its default value
|
||||
*/
|
||||
tmpStr1 = XmStringCreateLocalized(CHNG_ALL_BUTTON);
|
||||
}
|
||||
XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
|
||||
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
|
||||
XtSetArg(al[ac], XmNleftPosition, 68); ac++;
|
||||
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
|
||||
XtSetArg(al[ac], XmNrightPosition, 98); ac++;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg(al[ac], XmNtopWidget, M_search_separator(pPriv)); ac++;
|
||||
XtSetArg(al[ac], XmNtopOffset, 7); ac++;
|
||||
XtSetArg(al[ac], XmNfontList, E_buttonFontList(pPriv)); ac++;
|
||||
M_search_replaceAllBtn(pPriv) = XmCreatePushButtonGadget(
|
||||
M_search_dialog(pPriv),
|
||||
"replAllBtn", al, ac);
|
||||
XmStringFree(tmpStr1);
|
||||
XtManageChild(M_search_replaceAllBtn(pPriv));
|
||||
|
||||
/* Close button */
|
||||
ac = 0;
|
||||
tmpStr1 = XmStringCreateLocalized(CLOSE_BUTTON);
|
||||
XtSetArg(al[ac], XmNlabelString, tmpStr1); ac++;
|
||||
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
|
||||
XtSetArg(al[ac], XmNleftPosition, 13); ac++;
|
||||
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
|
||||
XtSetArg(al[ac], XmNrightPosition, 43); ac++;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg(al[ac], XmNtopWidget, M_search_findBtn(pPriv)); ac++;
|
||||
XtSetArg(al[ac], XmNtopOffset, 2); ac++;
|
||||
XtSetArg(al[ac], XmNfontList, E_buttonFontList(pPriv)); ac++;
|
||||
M_search_closeBtn(pPriv) = XmCreatePushButtonGadget(M_search_dialog(pPriv),
|
||||
"closeBtn", al, ac);
|
||||
XmStringFree(tmpStr1);
|
||||
XtManageChild(M_search_closeBtn(pPriv));
|
||||
|
||||
ac = 0;
|
||||
tmpStr1 = XmStringCreateLocalized(HELP_BUTTON);
|
||||
XtSetArg (al[ac], XmNlabelString, tmpStr1); ac++;
|
||||
XtSetArg(al[ac], XmNleftAttachment, XmATTACH_POSITION); ac++;
|
||||
XtSetArg(al[ac], XmNleftPosition, 56); ac++;
|
||||
XtSetArg(al[ac], XmNrightAttachment, XmATTACH_POSITION); ac++;
|
||||
XtSetArg(al[ac], XmNrightPosition, 86); ac++;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg(al[ac], XmNtopWidget, M_search_findBtn(pPriv)); ac++;
|
||||
XtSetArg(al[ac], XmNtopOffset, 2); ac++;
|
||||
XtSetArg(al[ac], XmNfontList, E_buttonFontList(pPriv)); ac++;
|
||||
M_search_helpBtn(pPriv) = XmCreatePushButtonGadget(M_search_dialog(pPriv),
|
||||
"helpBtn", al, ac);
|
||||
XmStringFree(tmpStr1);
|
||||
XtManageChild(M_search_helpBtn(pPriv));
|
||||
|
||||
|
||||
XtRemoveAllCallbacks(M_search_spellList(pPriv), XmNbrowseSelectionCallback);
|
||||
XtAddCallback(M_search_spellList(pPriv), XmNbrowseSelectionCallback,
|
||||
(XtCallbackProc) _DtEditorMisspelledSelectCB, pPriv);
|
||||
XtAddCallback(M_search_spellList(pPriv), XmNdefaultActionCallback,
|
||||
(XtCallbackProc) _DtEditorMisspelledDblClickCB, pPriv);
|
||||
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], XmNvisibleItemCount, 4); ac++;
|
||||
XtSetValues(M_search_spellList(pPriv), al, ac);
|
||||
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], XmNheight, &M_search_buttonHeight(pPriv)); ac++;
|
||||
XtGetValues(M_search_helpBtn(pPriv), al, ac);
|
||||
|
||||
ac = 0;
|
||||
XtSetArg(al[ac], XmNbottomAttachment, XmATTACH_FORM); ac++;
|
||||
XtSetArg(al[ac], XmNtopAttachment, XmATTACH_WIDGET); ac++;
|
||||
XtSetArg(al[ac], XmNtopWidget, M_replaceText(pPriv)); ac++;
|
||||
XtSetArg(al[ac], XmNtopOffset, 5); ac++;
|
||||
XtSetArg(al[ac], XmNbottomOffset, 2 * M_search_buttonHeight(pPriv) + 35);
|
||||
ac++;
|
||||
XtSetValues(M_search_separator(pPriv), al, ac);
|
||||
|
||||
XtAddCallback(M_search_findBtn(pPriv), XmNactivateCallback,
|
||||
(XtCallbackProc) _DtEditorDialogSearchCB,
|
||||
(XtPointer) pPriv);
|
||||
XtAddCallback(M_search_replaceBtn(pPriv), XmNactivateCallback,
|
||||
(XtCallbackProc) _DtEditorDialogReplaceCB,
|
||||
(XtPointer) pPriv);
|
||||
XtAddCallback(M_search_replaceAllBtn(pPriv), XmNactivateCallback,
|
||||
(XtCallbackProc) _DtEditorDialogReplaceAllCB,
|
||||
(XtPointer) pPriv);
|
||||
XtAddCallback(M_search_closeBtn(pPriv), XmNactivateCallback,
|
||||
(XtCallbackProc) _DtEditorDialogFindCancelCB,
|
||||
(XtPointer) pPriv);
|
||||
XtAddCallback(M_search_helpBtn(pPriv), XmNactivateCallback,
|
||||
(XtCallbackProc) _DtEditorHelpSearchCB,
|
||||
(XtPointer) pPriv);
|
||||
XtAddCallback(M_search_dialog(pPriv), XmNmapCallback,
|
||||
(XtCallbackProc) _DtEditorSearchMapCB, pPriv);
|
||||
XtAddCallback(M_findText(pPriv), XmNvalueChangedCallback,
|
||||
(XtCallbackProc)_DtEditorFindTextChangedCB, pPriv);
|
||||
XtAddCallback(M_replaceText(pPriv), XmNvalueChangedCallback,
|
||||
(XtCallbackProc)_DtEditorReplaceTextChangedCB, pPriv);
|
||||
XtAddCallback(M_search_dialog(pPriv), XmNhelpCallback,
|
||||
(XtCallbackProc) _DtEditorHelpSearchCB, (XtPointer)pPriv);
|
||||
|
||||
XtSetArg(al[0], XmNdefaultButton, M_search_closeBtn(pPriv));
|
||||
XtSetValues(M_search_dialog(pPriv), al, 1);
|
||||
|
||||
XtRealizeWidget(M_search_dialog(pPriv));
|
||||
} /* end CreateSearchDialog */
|
||||
2653
cde/lib/DtWidget/SpinBox.c
Normal file
2653
cde/lib/DtWidget/SpinBox.c
Normal file
File diff suppressed because it is too large
Load Diff
544
cde/lib/DtWidget/SpinBox.h
Normal file
544
cde/lib/DtWidget/SpinBox.h
Normal file
@@ -0,0 +1,544 @@
|
||||
/* $XConsortium: SpinBox.h /main/4 1995/10/26 09:34:23 rswiston $ */
|
||||
/*
|
||||
* (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
* (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
* (c) Copyright 1993, 1994 Novell, Inc.
|
||||
* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
*/
|
||||
/***********************************************************
|
||||
Copyright 1993 Interleaf, Inc.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software
|
||||
and its documentation for any purpose without fee is granted,
|
||||
provided that the above copyright notice appear in all copies
|
||||
and that both copyright notice and this permission notice appear
|
||||
in supporting documentation, and that the name of Interleaf not
|
||||
be used in advertising or publicly pertaining to distribution of
|
||||
the software without specific written prior permission.
|
||||
|
||||
Interleaf makes no representation about the suitability of this
|
||||
software for any purpose. It is provided "AS IS" without any
|
||||
express or implied warranty.
|
||||
******************************************************************/
|
||||
|
||||
#ifndef _Dt_SpinBox_h
|
||||
#define _Dt_SpinBox_h
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#if defined(DT_USE_XM_SSPINBOX)
|
||||
#include <Xm/SSpinB.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
|
||||
/* Resources */
|
||||
|
||||
#ifndef DtNarrowLayout
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtNarrowLayout XmNarrowLayout
|
||||
# else
|
||||
# define DtNarrowLayout "arrowLayout"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtNarrowSensitivity
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtNarrowSensitivity XmNarrowSensitivity
|
||||
# else
|
||||
# define DtNarrowSensitivity "arrowSensitivity"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtNarrowSize
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtNarrowSize XmNarrowSize
|
||||
# else
|
||||
# define DtNarrowSize "arrowSize"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtNspinBoxChildType
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtNspinBoxChildType XmNspinBoxChildType
|
||||
# else
|
||||
# define DtNspinBoxChildType "spinBoxChildType"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtNposition
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtNposition XmNposition
|
||||
# else
|
||||
# define DtNposition "position"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtNtextField
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtNtextField XmNtextField
|
||||
# else
|
||||
# define DtNtextField "textField"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtNwrap
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtNwrap "wrap"
|
||||
# else
|
||||
# define DtNwrap "wrap"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtNincrementValue
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtNincrementValue XmNincrementValue
|
||||
# else
|
||||
# define DtNincrementValue "incrementValue"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtNmaximumValue
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtNmaximumValue XmNmaximumValue
|
||||
# else
|
||||
# define DtNmaximumValue "maximumValue"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtNminimumValue
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtNminimumValue XmNminimumValue
|
||||
# else
|
||||
# define DtNminimumValue "minimumValue"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtNnumValues
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtNnumValues XmNnumValues
|
||||
# else
|
||||
# define DtNnumValues "numValues"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtNvalues
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtNvalues XmNvalues
|
||||
# else
|
||||
# define DtNvalues "values"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef DtNactivateCallback
|
||||
#define DtNactivateCallback XmNactivateCallback
|
||||
#endif
|
||||
#ifndef DtNalignment
|
||||
#define DtNalignment XmNalignment
|
||||
#endif
|
||||
#ifndef DtNcolumns
|
||||
#define DtNcolumns XmNcolumns
|
||||
#endif
|
||||
#ifndef DtNdecimalPoints
|
||||
#define DtNdecimalPoints XmNdecimalPoints
|
||||
#endif
|
||||
#ifndef DtNeditable
|
||||
#define DtNeditable XmNeditable
|
||||
#endif
|
||||
#ifndef DtNfocusCallback
|
||||
#define DtNfocusCallback XmNfocusCallback
|
||||
#endif
|
||||
#ifndef DtNinitialDelay
|
||||
#define DtNinitialDelay XmNinitialDelay
|
||||
#endif
|
||||
#ifndef DtNlosingFocusCallback
|
||||
#define DtNlosingFocusCallback XmNlosingFocusCallback
|
||||
#endif
|
||||
#ifndef DtNmarginHeight
|
||||
#define DtNmarginHeight XmNmarginHeight
|
||||
#endif
|
||||
#ifndef DtNmarginWidth
|
||||
#define DtNmarginWidth XmNmarginWidth
|
||||
#endif
|
||||
#ifndef DtNmaxLength
|
||||
#define DtNmaxLength XmNmaxLength
|
||||
#endif
|
||||
#ifndef DtNmodifyVerifyCallback
|
||||
#define DtNmodifyVerifyCallback XmNmodifyVerifyCallback
|
||||
#endif
|
||||
#ifndef DtNrecomputeSize
|
||||
#define DtNrecomputeSize XmNrecomputeSize
|
||||
#endif
|
||||
#ifndef DtNrepeatDelay
|
||||
#define DtNrepeatDelay XmNrepeatDelay
|
||||
#endif
|
||||
#ifndef DtNvalueChangedCallback
|
||||
#define DtNvalueChangedCallback XmNvalueChangedCallback
|
||||
#endif
|
||||
|
||||
#ifndef DtCArrowLayout
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCArrowLayout XmCArrowLayout
|
||||
# else
|
||||
# define DtCArrowLayout "ArrowLayout"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtCArrowSensitivity
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCArrowSensitivity XmCArrowSensitivity
|
||||
# else
|
||||
# define DtCArrowSensitivity "ArrowSensitivity"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtCArrowSize
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCArrowSize XmCArrowSize
|
||||
# else
|
||||
# define DtCArrowSize "ArrowSize"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtCSpinBoxChildType
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCSpinBoxChildType XmCSpinBoxChildType
|
||||
# else
|
||||
# define DtCSpinBoxChildType "SpinBoxChildType"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtCPosition
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCPosition XmCPosition
|
||||
# else
|
||||
# define DtCPosition "Position"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtCTextField
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCTextField XmCTextField
|
||||
# else
|
||||
# define DtCTextField "TextField"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtCWrap
|
||||
# define DtCWrap "Wrap"
|
||||
#endif
|
||||
#ifndef DtCIncrementValue
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCIncrementValue XmCIncrementValue
|
||||
# else
|
||||
# define DtCIncrementValue "incrementValue"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtCMaximumValue
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCMaximumValue XmCMaximumValue
|
||||
# else
|
||||
# define DtCMaximumValue "maximumValue"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtCMinimumValue
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCMinimumValue XmCMinimumValue
|
||||
# else
|
||||
# define DtCMinimumValue "minimumValue"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtCNumValues
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCNumValues XmCNumValues
|
||||
# else
|
||||
# define DtCNumValues "numValues"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtCValues
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCValues XmCValues
|
||||
# else
|
||||
# define DtCValues "values"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef DtCAlignment
|
||||
#define DtCAlignment XmCAlignment
|
||||
#endif
|
||||
#ifndef DtCCallback
|
||||
#define DtCCallback XmCCallback
|
||||
#endif
|
||||
#ifndef DtCColumns
|
||||
#define DtCColumns XmCColumns
|
||||
#endif
|
||||
#ifndef DtCDecimalPoints
|
||||
#define DtCDecimalPoints XmCDecimalPoints
|
||||
#endif
|
||||
#ifndef DtCEditable
|
||||
#define DtCEditable XmCEditable
|
||||
#endif
|
||||
#ifndef DtCInitialDelay
|
||||
#define DtCInitialDelay XmCInitialDelay
|
||||
#endif
|
||||
#ifndef DtCItems
|
||||
#define DtCItems XmCItems
|
||||
#endif
|
||||
#ifndef DtCMarginHeight
|
||||
#define DtCMarginHeight XmCMarginHeight
|
||||
#endif
|
||||
#ifndef DtCMarginWidth
|
||||
#define DtCMarginWidth XmCMarginWidth
|
||||
#endif
|
||||
#ifndef DtCMaxLength
|
||||
#define DtCMaxLength XmCMaxLength
|
||||
#endif
|
||||
#ifndef DtCPosition
|
||||
#define DtCPosition XmCPosition
|
||||
#endif
|
||||
#ifndef DtCRecomputeSize
|
||||
#define DtCRecomputeSize XmCRecomputeSize
|
||||
#endif
|
||||
#ifndef DtCRepeatDelay
|
||||
#define DtCRepeatDelay XmCRepeatDelay
|
||||
#endif
|
||||
|
||||
/* Representation types */
|
||||
|
||||
#ifndef DtRIncrementValue
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtRIncrementValue XmRint
|
||||
# else
|
||||
# define DtRIncrementValue "IncrementValue"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtRMaximumValue
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtRMaximumValue XmRint
|
||||
# else
|
||||
# define DtRMaximumValue "MaximumValue"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtRMinimumValue
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtRMinimumValue XmRint
|
||||
# else
|
||||
# define DtRMinimumValue "MinimumValue"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtRNumValues
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtRNumValues XmRint
|
||||
# else
|
||||
# define DtRNumValues "NumValues"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtRValues
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtRValues XmRXmStringTable
|
||||
# else
|
||||
# define DtRValues "Values"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtRArrowSensitivity
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtRArrowSensitivity XmRArrowSensitivity
|
||||
# else
|
||||
# define DtRArrowSensitivity "ArrowSensitivity"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtRArrowLayout
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtRArrowLayout XmRArrowLayout
|
||||
# else
|
||||
# define DtRArrowLayout "ArrowLayout"
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtRSpinBoxChildType
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtRSpinBoxChildType XmRSpinBoxChildType
|
||||
# else
|
||||
# define DtRSpinBoxChildType "SpinBoxChildType"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* DtNarrowLayout values */
|
||||
|
||||
#ifndef DtARROWS_FLAT_BEGINNING
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtARROWS_FLAT_BEGINNING XmARROWS_FLAT_BEGINNING
|
||||
# else
|
||||
# define DtARROWS_FLAT_BEGINNING 4
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtARROWS_FLAT_END
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtARROWS_FLAT_END XmARROWS_FLAT_END
|
||||
# else
|
||||
# define DtARROWS_FLAT_END 3
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtARROWS_SPLIT
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtARROWS_SPLIT XmARROWS_SPLIT
|
||||
# else
|
||||
# define DtARROWS_SPLIT 2
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtARROWS_BEGINNING
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtARROWS_BEGINNING XmARROWS_BEGINNING
|
||||
# else
|
||||
# define DtARROWS_BEGINNING 1
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtARROWS_END
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtARROWS_END XmARROWS_END
|
||||
# else
|
||||
# define DtARROWS_END 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* DtNarrowSensitivity values */
|
||||
|
||||
#ifndef DtARROWS_SENSITIVE
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtARROWS_SENSITIVE XmARROWS_SENSITIVE
|
||||
# else
|
||||
# define DtARROWS_SENSITIVE 3
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtARROWS_DECREMENT_SENSITIVE
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtARROWS_DECREMENT_SENSITIVE XmARROWS_DECREMENT_SENSITIVE
|
||||
# else
|
||||
# define DtARROWS_DECREMENT_SENSITIVE 2
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtARROWS_INCREMENT_SENSITIVE
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtARROWS_INCREMENT_SENSITIVE XmARROWS_INCREMENT_SENSITIVE
|
||||
# else
|
||||
# define DtARROWS_INCREMENT_SENSITIVE 1
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtARROWS_INSENSITIVE
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtARROWS_INSENSITIVE XmARROWS_INSENSITIVE
|
||||
# else
|
||||
# define DtARROWS_INSENSITIVE 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* DtNspinBoxChildType values */
|
||||
|
||||
#ifndef DtNUMERIC
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtNUMERIC XmNUMERIC
|
||||
# else
|
||||
# define DtNUMERIC 3
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef DtSTRING
|
||||
# define DtSTRING XmSTRING
|
||||
#endif
|
||||
|
||||
/* DtNalignment values */
|
||||
|
||||
#ifndef DtALIGNMENT_BEGINNING
|
||||
#define DtALIGNMENT_BEGINNING XmALIGNMENT_BEGINNING
|
||||
#endif
|
||||
#ifndef DtALIGNMENT_CENTER
|
||||
#define DtALIGNMENT_CENTER XmALIGNMENT_CENTER
|
||||
#endif
|
||||
#ifndef DtALIGNMENT_END
|
||||
#define DtALIGNMENT_END XmALIGNMENT_END
|
||||
#endif
|
||||
|
||||
/* Callback reasons */
|
||||
|
||||
#ifndef DtCR_OK
|
||||
# define DtCR_OK XmCR_OK
|
||||
#endif
|
||||
#ifndef DtCR_SPIN_NEXT
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCR_SPIN_NEXT XmCR_SPIN_NEXT
|
||||
# else
|
||||
# define DtCR_SPIN_NEXT 62
|
||||
# endif
|
||||
#endif
|
||||
#ifndef DtCR_SPIN_PRIOR
|
||||
# if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCR_SPIN_PRIOR XmCR_SPIN_PRIOR
|
||||
# else
|
||||
# define DtCR_SPIN_PRIOR 63
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
#if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtSpinBoxCallbackStruct XmSpinBoxCallbackStruct
|
||||
#else
|
||||
typedef struct {
|
||||
int reason;
|
||||
XEvent *event;
|
||||
Widget widget;
|
||||
Boolean doit;
|
||||
int position;
|
||||
XmString value;
|
||||
Boolean crossed_boundary;
|
||||
} DtSpinBoxCallbackStruct;
|
||||
#endif
|
||||
|
||||
/* Widget class and instance */
|
||||
#if defined(DT_USE_XM_SSPINBOX)
|
||||
# define _DtSpinBoxClassRec _XmSimpleSpinBoxClassRec
|
||||
# define _DtSpinBoxRec _XmSimpleSpinBoxRec
|
||||
# define DtSpinBoxWidgetClass XmSimpleSpinBoxWidgetClass
|
||||
# define DtSpinBoxWidget XmSimpleSpinBoxWidget
|
||||
#else
|
||||
typedef struct _DtSpinBoxClassRec *DtSpinBoxWidgetClass;
|
||||
typedef struct _DtSpinBoxRec *DtSpinBoxWidget;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Data
|
||||
*/
|
||||
|
||||
/* Widget class record */
|
||||
#if defined(DT_USE_XM_SSPINBOX)
|
||||
# define dtSpinBoxWidgetClass xmSimpleSpinBoxWidgetClass
|
||||
#else
|
||||
externalref WidgetClass dtSpinBoxWidgetClass;
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
|
||||
#if defined(DT_USE_XM_SSPINBOX)
|
||||
# define DtCreateSpinBox XmCreateSimpleSpinBox
|
||||
# define DtSpinBoxAddItem XmSimpleSpinBoxAddItem
|
||||
# define DtSpinBoxDeletePos XmSimpleSpinBoxDeletePos
|
||||
# define DtSpinBoxSetItem XmSimpleSpinBoxSetItem
|
||||
#else
|
||||
extern Widget DtCreateSpinBox(
|
||||
Widget parent,
|
||||
char *name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount);
|
||||
|
||||
extern void DtSpinBoxAddItem(
|
||||
Widget widget,
|
||||
XmString item,
|
||||
int pos);
|
||||
|
||||
extern void DtSpinBoxDeletePos(
|
||||
Widget widget,
|
||||
int pos);
|
||||
|
||||
extern void DtSpinBoxSetItem(
|
||||
Widget widget,
|
||||
XmString item);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _Dt_SpinBox_h */
|
||||
201
cde/lib/DtWidget/SpinBoxP.h
Normal file
201
cde/lib/DtWidget/SpinBoxP.h
Normal file
@@ -0,0 +1,201 @@
|
||||
/* $XConsortium: SpinBoxP.h /main/4 1996/03/26 19:54:14 drk $ */
|
||||
/*
|
||||
* SpinBoxP.h, Interleaf, 16aug93 2:37pm Version 1.1.
|
||||
*/
|
||||
|
||||
/***********************************************************
|
||||
Copyright 1993 Interleaf, Inc.
|
||||
|
||||
Permission to use, copy, modify, and distribute this software
|
||||
and its documentation for any purpose without fee is granted,
|
||||
provided that the above copyright notice appear in all copies
|
||||
and that both copyright notice and this permission notice appear
|
||||
in supporting documentation, and that the name of Interleaf not
|
||||
be used in advertising or publicly pertaining to distribution of
|
||||
the software without specific written prior permission.
|
||||
|
||||
Interleaf makes no representation about the suitability of this
|
||||
software for any purpose. It is provided "AS IS" without any
|
||||
express or implied warranty.
|
||||
******************************************************************/
|
||||
|
||||
/*
|
||||
* (C) Copyright 1991,1992, 1993
|
||||
* Interleaf, Inc.
|
||||
* 9 Hillside Avenue, Waltham, MA 02154
|
||||
*
|
||||
* SpinBoxP.h:
|
||||
*
|
||||
* Private header file for DtSpinBoxWidget.
|
||||
*/
|
||||
#ifndef _SpinBoxP_h
|
||||
#define _SpinBoxP_h
|
||||
|
||||
#include <Xm/Label.h>
|
||||
#include <Xm/TextFP.h>
|
||||
#include <Xm/ArrowB.h>
|
||||
#include <Xm/ManagerP.h>
|
||||
#include "SpinBox.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* External definitions of syn_resources for our list widget.
|
||||
*/
|
||||
#define SYN_RESOURCE_AA (Widget w, int resource_offset, XtArgVal *value)
|
||||
extern void _DtSpinBoxGetArrowSize SYN_RESOURCE_AA;
|
||||
|
||||
#define ARROW_MULT .45
|
||||
#define ARROW_MIN 13
|
||||
#define MAX_FLOAT_DECIMALS 6
|
||||
#define NUMERIC_LENGTH 128
|
||||
#define MARGIN 2
|
||||
#define LABEL_PADDING 2
|
||||
#define LABEL_SHADOW 2
|
||||
#define TEXT_FIELD_SHADOW 1
|
||||
#define TEXT_CONTEXT_MARGIN 4
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Message Defines
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
#define SB_ARROW_SENSITIVE DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_ARROW_SENSITIVE, _DtMsgSpinBox_0000)
|
||||
|
||||
#define SB_ALIGNMENT DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_ALIGNMENT, _DtMsgSpinBox_0001)
|
||||
|
||||
#define SB_INIT_DELAY DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_INIT_DELAY, _DtMsgSpinBox_0002)
|
||||
|
||||
#define SB_MARGIN_HEIGHT DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_MARGIN_HEIGHT, _DtMsgSpinBox_0003)
|
||||
|
||||
#define SB_MARGIN_WIDTH DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_MARGIN_WIDTH, _DtMsgSpinBox_0004)
|
||||
|
||||
#define SB_ARROW_LAYOUT DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_ARROW_LAYOUT, _DtMsgSpinBox_0005)
|
||||
|
||||
#define SB_REPEAT_DELAY DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_REPEAT_DELAY, _DtMsgSpinBox_0006)
|
||||
|
||||
#define SB_ITEM_COUNT DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_ITEM_COUNT, _DtMsgSpinBox_0007)
|
||||
|
||||
#define SB_POSITION_STRING DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_POSITION_STRING, _DtMsgSpinBox_0008)
|
||||
|
||||
#define SB_POSITION_NUMERIC DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_POSITION_NUMERIC, _DtMsgSpinBox_0009)
|
||||
|
||||
#define SB_DECIMAL_POINTS DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_DECIMAL_POINTS, _DtMsgSpinBox_0010)
|
||||
|
||||
#define SB_MIN_MAX DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_MIN_MAX, _DtMsgSpinBox_0011)
|
||||
|
||||
#define SB_TEXT DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_TEXT, _DtMsgSpinBox_0012)
|
||||
|
||||
#define SB_SET_ITEM DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_SET_ITEM, _DtMsgSpinBox_0013)
|
||||
|
||||
#define SB_LABEL DTWIDGET_GETMESSAGE( \
|
||||
MS_SpinBox, SPIN_LABEL, _DtMsgSpinBox_0014)
|
||||
/*
|
||||
* Class Records
|
||||
*/
|
||||
typedef struct {
|
||||
Boolean junk;
|
||||
} DtSpinBoxClassPart;
|
||||
|
||||
typedef struct _DtSpinBoxClassRec {
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
DtSpinBoxClassPart spin_box_class;
|
||||
} DtSpinBoxClassRec;
|
||||
|
||||
extern DtSpinBoxClassRec dtSpinBoxClassRec;
|
||||
|
||||
|
||||
/*
|
||||
* Instance Record.
|
||||
*/
|
||||
typedef struct _DtSpinBoxPart {
|
||||
/* Private data */
|
||||
Widget label;
|
||||
Widget up_arrow;
|
||||
Widget down_arrow;
|
||||
unsigned char which_arrow;
|
||||
Boolean init_cb;
|
||||
Boolean grabbed;
|
||||
int base;
|
||||
float min, max;
|
||||
float increment, current;
|
||||
char float_format[10];
|
||||
Dimension old_width;
|
||||
Dimension old_height;
|
||||
Dimension label_max_length;
|
||||
Dimension label_max_height;
|
||||
|
||||
/* Resource-related data */
|
||||
unsigned char arrow_sensitivity;
|
||||
short decimal_points;
|
||||
int numeric_increment;
|
||||
int maximum;
|
||||
int minimum;
|
||||
int item_count;
|
||||
int position;
|
||||
unsigned char child_type;
|
||||
XmStringTable items;
|
||||
XtCallbackList activate_callback;
|
||||
unsigned char alignment;
|
||||
unsigned char arrow_layout;
|
||||
Dimension arrow_size;
|
||||
short text_columns;
|
||||
Boolean editable;
|
||||
XtCallbackList focus_callback;
|
||||
unsigned int initial_delay;
|
||||
XtCallbackList losing_focus_callback;
|
||||
Dimension margin_height;
|
||||
Dimension margin_width;
|
||||
int text_max_length;
|
||||
XtCallbackList modify_verify_callback;
|
||||
Boolean recompute_size;
|
||||
unsigned int repeat_delay;
|
||||
Widget text;
|
||||
XtCallbackList value_changed_callback;
|
||||
Boolean wrap;
|
||||
|
||||
/* Spin timer. */
|
||||
XtIntervalId timer;
|
||||
|
||||
/* String list related resources */
|
||||
|
||||
/* Numeric related resources */
|
||||
|
||||
/* TextField resources */
|
||||
} DtSpinBoxPart;
|
||||
|
||||
|
||||
/* Full instance record declaration */
|
||||
typedef struct _DtSpinBoxRec {
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
DtSpinBoxPart spin_box;
|
||||
} DtSpinBoxRec;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _SpinBoxP_h */
|
||||
1241
cde/lib/DtWidget/TitleBox.c
Normal file
1241
cde/lib/DtWidget/TitleBox.c
Normal file
File diff suppressed because it is too large
Load Diff
54
cde/lib/DtWidget/TitleBox.h
Normal file
54
cde/lib/DtWidget/TitleBox.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/* $XConsortium: TitleBox.h /main/4 1995/10/26 09:34:50 rswiston $ */
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: TitleBox.h
|
||||
***
|
||||
*** project: MotifPlus Widgets
|
||||
***
|
||||
*** description: Public include file for DtTitleBox class.
|
||||
***
|
||||
***
|
||||
*** (c) Copyright 1990 by Hewlett-Packard Company.
|
||||
***
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _DtTitleBox_h
|
||||
#define _DtTitleBox_h
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
#include <Dt/DtStrDefs.h>
|
||||
|
||||
#ifndef DtIsTitleBox
|
||||
#define DtIsTitleBox(w) XtIsSubclass(w, DtTitleBoxClass)
|
||||
#endif /* DtIsTitleBox */
|
||||
|
||||
|
||||
/******** Public Function Declarations ********/
|
||||
|
||||
extern Widget _DtCreateTitleBox(
|
||||
Widget parent,
|
||||
char *name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount) ;
|
||||
extern Widget _DtTitleBoxGetTitleArea(
|
||||
Widget w) ;
|
||||
extern Widget _DtTitleBoxGetWorkArea(
|
||||
Widget w) ;
|
||||
|
||||
|
||||
extern WidgetClass dtTitleBoxWidgetClass;
|
||||
|
||||
typedef struct _DtTitleBoxClassRec * DtTitleBoxWidgetClass;
|
||||
typedef struct _DtTitleBoxRec * DtTitleBoxWidget;
|
||||
|
||||
|
||||
#define XmTITLE_TOP 0
|
||||
#define XmTITLE_BOTTOM 1
|
||||
|
||||
#define XmTITLE_AREA 1
|
||||
|
||||
|
||||
#endif /* _DtTitleBox_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
137
cde/lib/DtWidget/TitleBoxP.h
Normal file
137
cde/lib/DtWidget/TitleBoxP.h
Normal file
@@ -0,0 +1,137 @@
|
||||
/* $XConsortium: TitleBoxP.h /main/3 1995/10/26 09:34:57 rswiston $ */
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: TitleBoxP.h
|
||||
***
|
||||
*** project: MotifPlus Widgets
|
||||
***
|
||||
*** description: Private include file for DtTitleBox class.
|
||||
***
|
||||
***
|
||||
*** (c) Copyright 1990 by Hewlett-Packard Company.
|
||||
***
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _DtTitleBoxP_h
|
||||
#define _DtTitleBoxP_h
|
||||
|
||||
#include <Xm/XmP.h>
|
||||
#include <Dt/TitleBox.h>
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Class Structure
|
||||
*/
|
||||
|
||||
/* Class Part
|
||||
*/
|
||||
typedef struct _DtTitleBoxClassPart
|
||||
{
|
||||
caddr_t extension;
|
||||
} DtTitleBoxClassPart;
|
||||
|
||||
/* Full Class Record
|
||||
*/
|
||||
typedef struct _DtTitleBoxClassRec
|
||||
{
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
DtTitleBoxClassPart title_box_class;
|
||||
} DtTitleBoxClassRec;
|
||||
|
||||
/* Actual Class
|
||||
*/
|
||||
extern DtTitleBoxClassRec dtTitleBoxClassRec;
|
||||
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Instance Structure
|
||||
*/
|
||||
|
||||
/* Instance Part
|
||||
*/
|
||||
typedef struct _DtTitleBoxPart
|
||||
{
|
||||
Widget work_area;
|
||||
Widget title_area;
|
||||
XmString title_string;
|
||||
XmFontList font_list;
|
||||
Dimension margin_width;
|
||||
Dimension margin_height;
|
||||
Dimension old_width;
|
||||
Dimension old_height;
|
||||
Dimension old_shadow_thickness;
|
||||
Dimension title_spacing;
|
||||
unsigned char title_position;
|
||||
unsigned char title_alignment;
|
||||
unsigned char shadow_type;
|
||||
} DtTitleBoxPart;
|
||||
|
||||
/* Full Instance Record
|
||||
*/
|
||||
typedef struct _DtTitleBoxRec
|
||||
{
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
DtTitleBoxPart title_box;
|
||||
} DtTitleBoxRec;
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Constraint Structure
|
||||
*/
|
||||
|
||||
/* Constraint Part
|
||||
*/
|
||||
typedef struct _DtTitleBoxConstraintPart
|
||||
{
|
||||
unsigned char child_type;
|
||||
} DtTitleBoxConstraintPart, * DtTitleBoxConstraint;
|
||||
|
||||
/* Full Constraint Record
|
||||
*/
|
||||
typedef struct _DtTitleBoxConstraintRec
|
||||
{
|
||||
XmManagerConstraintPart manager_constraint;
|
||||
DtTitleBoxConstraintPart title_box_constraint;
|
||||
} DtTitleBoxConstraintRec, * DtTitleBoxConstraintPtr;
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Class and Instance Macros
|
||||
*/
|
||||
|
||||
/* DtTitleBox Class Macros
|
||||
*/
|
||||
|
||||
/* DtTitleBox Instance Macros
|
||||
*/
|
||||
#define M_TitleBoxConstraint(w) \
|
||||
(&((DtTitleBoxConstraintPtr) (w)->core.constraints)->title_box_constraint)
|
||||
#define M_WorkArea(m) (m -> title_box.work_area)
|
||||
#define M_TitleArea(m) (m -> title_box.title_area)
|
||||
#define M_TitleString(m) (m -> title_box.title_string)
|
||||
#define M_TitleSpacing(m) (m -> title_box.title_spacing)
|
||||
#define M_TitlePosition(m) (m -> title_box.title_position)
|
||||
#define M_TitleAlignment(m) (m -> title_box.title_alignment)
|
||||
#define M_FontList(m) (m -> title_box.font_list)
|
||||
#define M_ShadowType(m) (m -> title_box.shadow_type)
|
||||
#define M_MarginWidth(m) (m -> title_box.margin_width)
|
||||
#define M_MarginHeight(m) (m -> title_box.margin_height)
|
||||
#define M_OldWidth(m) (m -> title_box.old_width)
|
||||
#define M_OldHeight(m) (m -> title_box.old_height)
|
||||
#define M_OldShadowThickness(m) (m -> title_box.old_shadow_thickness)
|
||||
|
||||
|
||||
#endif /* _DtTitleBoxP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
138
cde/lib/DtWidget/UNIXbindings.cpp
Normal file
138
cde/lib/DtWidget/UNIXbindings.cpp
Normal file
@@ -0,0 +1,138 @@
|
||||
! $XConsortium: UNIXbindings.src /main/2 1995/07/20 12:05:57 drk $
|
||||
!######################################################################
|
||||
!#
|
||||
!# UNIXbindings
|
||||
!#
|
||||
!# Common Desktop Environment (CDE)
|
||||
!#
|
||||
!# Provides EMACS style translations for DtEditor widget applications
|
||||
!# such as Dtpad and Dtmail. Also provides alternates for DtEditor
|
||||
!# widget application menu accelerators which confict with these
|
||||
!# translations.
|
||||
!#
|
||||
!# By default this file is not used by DtEditor widget applications.
|
||||
!# To enable these bindings, include this file in your home directory
|
||||
!# .Xdefaults file and then restart your session. Initially, you can
|
||||
!# include this file simply by inserting a #include directive in your
|
||||
!# .Xdefaults file:
|
||||
!#
|
||||
!# #include "/usr/dt/app-defaults/LANG/UNIXbindings"
|
||||
!#
|
||||
!# where LANG is the value of your $LANG environment variable
|
||||
!# (normally "C").
|
||||
!#
|
||||
!# To modifiy these bindings, insert the contents of this file directly
|
||||
!# in your .Xdefaults file instead of the above include directive.
|
||||
!# Then edit the bindings in your .Xdefaults file (and restart your
|
||||
!# session when done).
|
||||
!#
|
||||
!#
|
||||
!# (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.
|
||||
!#
|
||||
!######################################################################
|
||||
|
||||
|
||||
!######################################################################
|
||||
!# Dtpad overrides for menu accelerators and accelerator text which
|
||||
!# confict with the UNIX bindings.
|
||||
!######################################################################
|
||||
Dtpad*fileMenu.print.acceleratorText:
|
||||
Dtpad*fileMenu.print.accelerator:
|
||||
Dtpad*editMenu.undo.acceleratorText: Ctrl+_
|
||||
Dtpad*editMenu.undo.accelerator: Ctrl<Key>_
|
||||
Dtpad*editMenu.paste.acceleratorText: Shift+Insert
|
||||
Dtpad*editMenu.paste.accelerator: Shift<Key>osfInsert
|
||||
Dtpad*editMenu.findChange.acceleratorText: Ctrl+S
|
||||
Dtpad*editMenu.findChange.accelerator: Ctrl<Key>s
|
||||
|
||||
|
||||
!######################################################################
|
||||
!# Dtmail compose dialog overrides for menu accelerators and accelerator
|
||||
!# text which confict with the UNIX bindings.
|
||||
!######################################################################
|
||||
Dtmail*ComposeDialog*menubar*Edit.Undo.acceleratorText: Ctrl+_
|
||||
Dtmail*ComposeDialog*menubar*Edit.Undo.accelerator: Ctrl<Key>_
|
||||
Dtmail*ComposeDialog*menubar*Edit.Paste.acceleratorText: Shift+Insert
|
||||
Dtmail*ComposeDialog*menubar*Edit.Paste.accelerator: Shift<Key>osfInsert
|
||||
Dtmail*ComposeDialog*menubar*Edit.Find/Change.acceleratorText: Ctrl+S
|
||||
Dtmail*ComposeDialog*menubar*Edit.Find/Change.accelerator: Ctrl<Key>s
|
||||
|
||||
|
||||
!######################################################################
|
||||
!# UNIX Bindings.
|
||||
!#
|
||||
!# The following translations provide (GNU style) EMACS control and
|
||||
!# meta key bindings plus some additional bindings. When appropriate,
|
||||
!# they also allow the Shift key to be used in combination with the
|
||||
!# normal binding to reverse the direction of the operation. For
|
||||
!# example, Ctrl-Shift-F will move the cursor backward a character
|
||||
!# since Ctrl-F normally moves it forward a character.
|
||||
!#
|
||||
!# The additional bindings are:
|
||||
!#
|
||||
!# Ctrl-comma: backward-word Ctrl-Shift-comma: forward-word
|
||||
!# Ctrl-period: forward-word Ctrl-Shift-period: backward-word
|
||||
!# Ctrl-Return: end-of-file Ctrl-Shift-Return: beginning-of-file
|
||||
!#
|
||||
!# NOTES:
|
||||
!#
|
||||
!# o GNU EMACS binds delete-previous-character() rather than
|
||||
!# delete-next-character() to the Delete key.
|
||||
!# o Meta-F is normally the mnemonic for the File menu so the binding
|
||||
!# to forward-word() will be ignored.
|
||||
!#
|
||||
!######################################################################
|
||||
*DtEditor.textTranslations: \
|
||||
c ~s <Key>a: beginning-of-line()\n\
|
||||
c s <Key>a: end-of-line()\n\
|
||||
c ~s <Key>b: backward-character()\n\
|
||||
c s <Key>b: forward-character()\n\
|
||||
c ~s <Key>b: backward-character()\n\
|
||||
c s <Key>b: backward-word()\n\
|
||||
m ~s <Key>b: backward-word()\n\
|
||||
m s <Key>b: forward-word()\n\
|
||||
c ~s <Key>d: delete-next-character()\n\
|
||||
c s <Key>d: delete-previous-character()\n\
|
||||
m ~s <Key>d: kill-next-word()\n\
|
||||
m s <Key>d: kill-previous-word()\n\
|
||||
c ~s <Key>e: end-of-line()\n\
|
||||
c s <Key>e: beginning-of-line()\n\
|
||||
c ~s <Key>f: forward-character()\n\
|
||||
c s <Key>f: backward-character()\n\
|
||||
m ~s <Key>f: forward-word()\n\
|
||||
m s <Key>f: backward-word()\n\
|
||||
c <Key>j: newline-and-indent()\n\
|
||||
c ~s <Key>k: kill-to-end-of-line()\n\
|
||||
c s <Key>k: kill-to-start-of-line()\n\
|
||||
c <Key>l: redraw-display()\n\
|
||||
c <Key>m: newline()\n\
|
||||
c ~s <Key>n: process-down()\n\
|
||||
c s <Key>n: process-up()\n\
|
||||
c <Key>o: newline-and-backup()\n\
|
||||
c ~s <Key>p: process-up()\n\
|
||||
c s <Key>p: process-down()\n\
|
||||
c ~s <Key>u: kill-to-start-of-line()\n\
|
||||
c s <Key>u: kill-to-end-of-line()\n\
|
||||
c ~s <Key>v: next-page()\n\
|
||||
c s <Key>v: previous-page()\n\
|
||||
m ~s <Key>v: previous-page()\n\
|
||||
m s <Key>v: next-page()\n\
|
||||
c <Key>w: kill-selection()\n\
|
||||
c ~s <Key>y: unkill()\n\
|
||||
m <Key>]: forward-paragraph()\n\
|
||||
m <Key>[: backward-paragraph()\n\
|
||||
c ~s <Key>comma: backward-word()\n\
|
||||
c s <Key>comma: forward-word()\n\
|
||||
m <Key>\\<: beginning-of-file()\n\
|
||||
c ~s <Key>period: forward-word()\n\
|
||||
c s <Key>period: backward-word()\n\
|
||||
m <Key>\\>: end-of-file()\n\
|
||||
c ~s <Key>Return: end-of-file()\n\
|
||||
c s <Key>Return: beginning-of-file()\n\
|
||||
~c ~s ~m ~a <Key>osfDelete: delete-previous-character()\n\
|
||||
~c s ~m ~a <Key>osfDelete: delete-next-character()
|
||||
|
||||
!########################### eof ###########################
|
||||
354
cde/lib/DtWidget/View.c
Normal file
354
cde/lib/DtWidget/View.c
Normal file
@@ -0,0 +1,354 @@
|
||||
/* static char rcsid[] =
|
||||
"$XConsortium: View.c /main/6 1996/10/14 10:48:27 pascale $";
|
||||
*/
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: View.c
|
||||
***
|
||||
*** project: MotifPlus Widgets
|
||||
***
|
||||
*** description: Source code for DtView class.
|
||||
***
|
||||
***
|
||||
*** (c) Copyright 1990 by Hewlett-Packard Company.
|
||||
***
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Include Files
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <Xm/DialogS.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/List.h>
|
||||
#include <Xm/SeparatoG.h>
|
||||
#include <Xm/TextF.h>
|
||||
#include <Dt/Control.h>
|
||||
#include <Dt/ViewP.h>
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Public Interface
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
WidgetClass dtViewWidgetClass;
|
||||
|
||||
Widget _DtCreateView ();
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Forward Declarations
|
||||
*/
|
||||
|
||||
#define OFFSET 12
|
||||
#define XmCR_SELECT XmCR_SINGLE_SELECT
|
||||
|
||||
/******** Public Function Declarations ********/
|
||||
|
||||
extern Widget _DtCreateView(
|
||||
Widget parent,
|
||||
String name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount) ;
|
||||
|
||||
/******** End Public Function Declarations ********/
|
||||
|
||||
/******** Static Function Declarations ********/
|
||||
|
||||
|
||||
/******** End Static Function Declarations ********/
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Translations and Actions
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Resource List
|
||||
*/
|
||||
|
||||
/* Define offset macros.
|
||||
*/
|
||||
#define R_Offset(field) \
|
||||
XtOffset (DtViewWidget, view.field)
|
||||
|
||||
static XtResource resources[] =
|
||||
{
|
||||
{
|
||||
XmNleftInset,
|
||||
XmCSpacing, XmRHorizontalDimension, sizeof (Dimension),
|
||||
R_Offset (left_inset), XmRImmediate, (caddr_t) 3
|
||||
},
|
||||
{
|
||||
XmNrightInset,
|
||||
XmCSpacing, XmRHorizontalDimension, sizeof (Dimension),
|
||||
R_Offset (right_inset), XmRImmediate, (caddr_t) 3
|
||||
},
|
||||
{
|
||||
XmNtopInset,
|
||||
XmCSpacing, XmRVerticalDimension, sizeof (Dimension),
|
||||
R_Offset (top_inset), XmRImmediate, (caddr_t) 3
|
||||
},
|
||||
{
|
||||
XmNbottomInset,
|
||||
XmCSpacing, XmRVerticalDimension, sizeof (Dimension),
|
||||
R_Offset (bottom_inset), XmRImmediate, (caddr_t) 3
|
||||
},
|
||||
{
|
||||
XmNwidthIncrement,
|
||||
XmCSpacing, XmRHorizontalDimension, sizeof (Dimension),
|
||||
R_Offset (width_increment), XmRImmediate, (caddr_t) 2
|
||||
},
|
||||
{
|
||||
XmNheightIncrement,
|
||||
XmCSpacing, XmRVerticalDimension, sizeof (Dimension),
|
||||
R_Offset (height_increment), XmRImmediate, (caddr_t) 2
|
||||
},
|
||||
{
|
||||
XmNboxType,
|
||||
XmCBoxType, XmRBoxType, sizeof (unsigned char),
|
||||
R_Offset (box_type),
|
||||
XmRImmediate, (XtPointer) XmBOX_NONE
|
||||
},
|
||||
{
|
||||
XmNsubpanelUnpostOnSelect,
|
||||
XmCSubpanelUnpostOnSelect, XmRBoolean, sizeof (Boolean),
|
||||
R_Offset (subpanel_unpost_on_select),
|
||||
XmRImmediate, (XtPointer) TRUE
|
||||
},
|
||||
{
|
||||
XmNsubpanelTorn,
|
||||
XmCSubpanelTorn, XmRBoolean, sizeof (Boolean),
|
||||
R_Offset (subpanel_torn), XmRImmediate, (XtPointer) FALSE
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Class Record
|
||||
*/
|
||||
DtViewClassRec dtViewClassRec =
|
||||
{
|
||||
/* Core Part
|
||||
*/
|
||||
{
|
||||
(WidgetClass) &xmFormClassRec, /* superclass */
|
||||
"Box", /* class_name */
|
||||
sizeof (DtViewRec), /* widget_size */
|
||||
NULL, /* class_initialize */
|
||||
NULL, /* class_part_initialize*/
|
||||
False, /* class_inited */
|
||||
(XtInitProc) NULL, /* initialize */
|
||||
NULL, /* initialize_hook */
|
||||
XtInheritRealize, /* realize */
|
||||
NULL, /* actions */
|
||||
0, /* num_actions */
|
||||
resources, /* resources */
|
||||
XtNumber (resources), /* num_resources */
|
||||
NULLQUARK, /* xrm_class */
|
||||
True, /* compress_motion */
|
||||
XtExposeCompressMaximal, /* compress_exposure */
|
||||
True, /* compress_enterleave */
|
||||
False, /* visible_interest */
|
||||
NULL, /* destroy */
|
||||
XtInheritResize, /* resize */
|
||||
XtInheritExpose, /* expose */
|
||||
(XtSetValuesFunc) NULL, /* set_values */
|
||||
NULL, /* set_values_hook */
|
||||
XtInheritSetValuesAlmost, /* set_values_almost */
|
||||
NULL, /* get_values_hook */
|
||||
NULL, /* accept_focus */
|
||||
XtVersion, /* version */
|
||||
NULL, /* callback private */
|
||||
XtInheritTranslations, /* tm_table */
|
||||
XtInheritQueryGeometry, /* query_geometry */
|
||||
NULL, /* display_accelerator */
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
/* Composite Part
|
||||
*/
|
||||
{
|
||||
XtInheritGeometryManager, /* geometry_manager */
|
||||
XtInheritChangeManaged, /* change_managed */
|
||||
XtInheritInsertChild, /* insert_child */
|
||||
XtInheritDeleteChild, /* delete_child */
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
/* Constraint Part
|
||||
*/
|
||||
{
|
||||
NULL, /* constraint_resources */
|
||||
0, /* num_constraint_resources */
|
||||
sizeof (DtViewConstraintRec),/* constraint_record */
|
||||
NULL, /* constraint_initialize */
|
||||
NULL, /* constraint_destroy */
|
||||
NULL, /* constraint_set_values */
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
/* XmManager Part
|
||||
*/
|
||||
{
|
||||
XtInheritTranslations, /* default_translations */
|
||||
NULL, /* syn_resources */
|
||||
0, /* num_syn_resources */
|
||||
NULL, /* syn_cont_resources */
|
||||
0, /* num_syn_cont_resources */
|
||||
XmInheritParentProcess, /* parent_process */
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
/* XmBulletinBoard Part
|
||||
*/
|
||||
{
|
||||
False, /* always_install_accelerators*/
|
||||
NULL, /* geo_matrix_create */
|
||||
XmInheritFocusMovedProc, /* focus_moved_proc */
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
/* XmForm Part
|
||||
*/
|
||||
{
|
||||
NULL, /* extension */
|
||||
},
|
||||
|
||||
/* DtView Part
|
||||
*/
|
||||
{
|
||||
NULL, /* extension */
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
WidgetClass dtViewWidgetClass = (WidgetClass) &dtViewClassRec;
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Private Procs
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Action Procs
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Core Procs
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Initialize
|
||||
** Initialize a new widget instance.
|
||||
*/
|
||||
#if 0
|
||||
/* ARGSUSED */
|
||||
static void
|
||||
Initialize(
|
||||
Widget request_w,
|
||||
Widget new_w )
|
||||
{
|
||||
DtViewWidget request = (DtViewWidget) request_w,
|
||||
new = (DtViewWidget) new_w;
|
||||
Pixmap pix;
|
||||
|
||||
/* Validate box type.
|
||||
*/
|
||||
if (M_BoxType (new) != XmBOX_NONE &&
|
||||
M_BoxType (new) != XmBOX_PRIMARY &&
|
||||
M_BoxType (new) != XmBOX_SECONDARY &&
|
||||
M_BoxType (new) != XmBOX_SUBPANEL)
|
||||
{
|
||||
M_BoxType (new) == XmBOX_NONE;
|
||||
}
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** SetValues
|
||||
** Handle changes in resource data.
|
||||
*/
|
||||
#if 0
|
||||
static Boolean
|
||||
SetValues(
|
||||
Widget current_w,
|
||||
Widget request_w,
|
||||
Widget new_w )
|
||||
{
|
||||
DtViewWidget current = (DtViewWidget) current_w,
|
||||
request = (DtViewWidget) request_w,
|
||||
new = (DtViewWidget) new_w;
|
||||
Boolean redraw_flag = False;
|
||||
|
||||
/* Can't change box type.
|
||||
*/
|
||||
if (M_BoxType (new) != M_BoxType (current))
|
||||
{
|
||||
M_BoxType (new) = M_BoxType (current);
|
||||
}
|
||||
|
||||
return (redraw_flag);
|
||||
}
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Composite Procs
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Manager Procs
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* All inherited from superclass.
|
||||
*/
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** View Procs
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Public Entry Points
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** _DtCreateView
|
||||
** Create a new DtView instance.
|
||||
**-------------------------------------------------------------
|
||||
*/
|
||||
Widget
|
||||
_DtCreateView(
|
||||
Widget parent,
|
||||
String name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount )
|
||||
{
|
||||
return (XtCreateWidget (name, dtViewWidgetClass,
|
||||
parent, arglist, argcount));
|
||||
}
|
||||
|
||||
110
cde/lib/DtWidget/View.h
Normal file
110
cde/lib/DtWidget/View.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/* $XConsortium: View.h /main/3 1995/10/26 09:35:11 rswiston $ */
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: View.h
|
||||
***
|
||||
*** project: MotifPlus Widgets
|
||||
***
|
||||
*** description: Public include file for DtView class.
|
||||
***
|
||||
***
|
||||
*** (c) Copyright 1990 by Hewlett-Packard Company.
|
||||
***
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _DtView_h
|
||||
#define _DtView_h
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Temporary location for resource definition. Need to */
|
||||
/* move into the string defs file. */
|
||||
|
||||
#define XmNsubpanelUnpostOnSelect "subpanelUnpostOnSelect"
|
||||
#define XmCSubpanelUnpostOnSelect "SubpanelUnpostOnSelect"
|
||||
#define XmNsubpanelTorn "subpanelTorn"
|
||||
#define XmCSubpanelTorn "SubpanelTorn"
|
||||
|
||||
/* These macros are also defined in DtStrDefs.h */
|
||||
/* Control->View.h */
|
||||
/* Control.c->Control.h->Icon.h->DtStrDefs.h */
|
||||
|
||||
#ifndef XmNleftInset
|
||||
#define XmNleftInset "leftInset"
|
||||
#endif /* XmNleftInset */
|
||||
|
||||
#ifndef XmNrightInset
|
||||
#define XmNrightInset "rightInset"
|
||||
#endif /* XmNrightInset */
|
||||
|
||||
#ifndef XmNtopInset
|
||||
#define XmNtopInset "topInset"
|
||||
#endif /* XmNtopInset */
|
||||
|
||||
#ifndef XmNbottomInset
|
||||
#define XmNbottomInset "bottomInset"
|
||||
#endif /* XmNbottomInset */
|
||||
|
||||
#ifndef XmNwidthIncrement
|
||||
#define XmNwidthIncrement "widthIncrement"
|
||||
#endif /* XmNwidthIncrement */
|
||||
|
||||
#ifndef XmNheightIncrement
|
||||
#define XmNheightIncrement "heightIncrement"
|
||||
#endif /* XmNheightIncrement */
|
||||
|
||||
#ifndef XmNboxType
|
||||
#define XmNboxType "boxType"
|
||||
#endif /* XmNboxType */
|
||||
|
||||
#ifndef XmCBoxType
|
||||
#define XmCBoxType "BoxType"
|
||||
#endif /* XmCBoxType */
|
||||
|
||||
#ifndef XmRBoxType
|
||||
#define XmRBoxType "BoxType"
|
||||
#endif /* XmRBoxType */
|
||||
|
||||
#define XmBOX_NONE 0
|
||||
#define XmBOX_PRIMARY 1
|
||||
#define XmBOX_SECONDARY 2
|
||||
#define XmBOX_SUBPANEL 3
|
||||
#define XmBOX_SWITCH 4
|
||||
|
||||
#ifndef DtIsView
|
||||
#define DtIsView(w) XtIsSubclass(w, dtViewWidgetClass)
|
||||
#endif /* XmIsView */
|
||||
|
||||
|
||||
extern Widget _DtCreateView();
|
||||
|
||||
extern WidgetClass dtViewWidgetClass;
|
||||
|
||||
typedef struct _DtViewClassRec * DtViewWidgetClass;
|
||||
typedef struct _DtViewRec * DtViewWidget;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int reason;
|
||||
XEvent * event;
|
||||
int category_index;
|
||||
XmString category;
|
||||
int item_index;
|
||||
XmString item;
|
||||
} DtViewCallbackStruct;
|
||||
|
||||
#define XmCR_SELECT XmCR_SINGLE_SELECT
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtView_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
136
cde/lib/DtWidget/ViewP.h
Normal file
136
cde/lib/DtWidget/ViewP.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/* $XConsortium: ViewP.h /main/3 1995/10/26 09:35:17 rswiston $ */
|
||||
/**---------------------------------------------------------------------
|
||||
***
|
||||
*** file: ViewP.h
|
||||
***
|
||||
*** project: MotifPlus Widgets
|
||||
***
|
||||
*** description: Private include file for DtView class.
|
||||
***
|
||||
***
|
||||
*** (c) Copyright 1990 by Hewlett-Packard Company.
|
||||
***
|
||||
***
|
||||
***-------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _DtViewP_h
|
||||
#define _DtViewP_h
|
||||
|
||||
#include <Xm/XmP.h>
|
||||
#include <Xm/BulletinBP.h>
|
||||
#include <Xm/FormP.h>
|
||||
#include <Dt/View.h>
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Class Structure
|
||||
*/
|
||||
|
||||
/* Class Part
|
||||
*/
|
||||
typedef struct _DtViewClassPart
|
||||
{
|
||||
caddr_t extension;
|
||||
} DtViewClassPart;
|
||||
|
||||
/* Full Class Record
|
||||
*/
|
||||
typedef struct _DtViewClassRec
|
||||
{
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
XmBulletinBoardClassPart bulletin_board_class;
|
||||
XmFormClassPart form_class;
|
||||
DtViewClassPart view_class;
|
||||
} DtViewClassRec;
|
||||
|
||||
/* Actual Class
|
||||
*/
|
||||
extern DtViewClassRec dtViewClassRec;
|
||||
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Instance Structure
|
||||
*/
|
||||
|
||||
/* Instance Part
|
||||
*/
|
||||
typedef struct _DtViewPart
|
||||
{
|
||||
Dimension width_increment;
|
||||
Dimension height_increment;
|
||||
Dimension left_inset;
|
||||
Dimension right_inset;
|
||||
Dimension top_inset;
|
||||
Dimension bottom_inset;
|
||||
unsigned char box_type;
|
||||
Boolean subpanel_unpost_on_select;
|
||||
Boolean subpanel_torn;
|
||||
} DtViewPart;
|
||||
|
||||
/* Full Instance Record
|
||||
*/
|
||||
typedef struct _DtViewRec
|
||||
{
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
XmBulletinBoardPart bulletin_board;
|
||||
XmFormPart form;
|
||||
DtViewPart view;
|
||||
} DtViewRec;
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Constraint Structure
|
||||
*/
|
||||
|
||||
/* Constraint Part
|
||||
*/
|
||||
typedef struct _DtViewConstraintPart
|
||||
{
|
||||
unsigned char foo_bar;
|
||||
} DtViewConstraintPart, * DtViewConstraint;
|
||||
|
||||
/* Full Constraint Record
|
||||
*/
|
||||
typedef struct _DtViewConstraintRec
|
||||
{
|
||||
XmManagerConstraintPart manager_constraint;
|
||||
XmFormConstraintPart form_constraint;
|
||||
DtViewConstraintPart view_constraint;
|
||||
} DtViewConstraintRec, * DtViewConstraintPtr;
|
||||
|
||||
|
||||
/*-------------------------------------------------------------
|
||||
** Class and Instance Macros
|
||||
*/
|
||||
|
||||
/* DtView Class Macros
|
||||
*/
|
||||
|
||||
/* DtView Instance Macros
|
||||
*/
|
||||
#define M_BottomShadowColor(m) (m -> manager.bottom_shadow_color)
|
||||
#define M_TopShadowColor(m) (m -> manager.top_shadow_color)
|
||||
#define M_HighlightColor(m) (m -> manager.highlight_color)
|
||||
#define M_BackgroundPixmap(m) (m -> core.background_pixmap)
|
||||
#define M_LeftInset(m) (m -> view.left_inset)
|
||||
#define M_RightInset(m) (m -> view.right_inset)
|
||||
#define M_TopInset(m) (m -> view.top_inset)
|
||||
#define M_BottomInset(m) (m -> view.bottom_inset)
|
||||
#define M_BoxType(m) (m -> view.box_type)
|
||||
#define M_WidthIncrement(m) (m -> view.width_increment)
|
||||
#define M_HeightIncrement(m) (m -> view.height_increment)
|
||||
|
||||
|
||||
#endif /* _DtViewP_h */
|
||||
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
250
cde/lib/DtWidget/libDtWidget.elist
Normal file
250
cde/lib/DtWidget/libDtWidget.elist
Normal file
@@ -0,0 +1,250 @@
|
||||
/* $XConsortium: libDtWidget.elist /main/8 1996/06/19 11:38:55 cde-dec $
|
||||
*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 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.
|
||||
*/
|
||||
|
||||
/*************************************************************************
|
||||
* Export list for libDtWidget
|
||||
* This list *must* be updated whenever a change is made to the library API.
|
||||
*
|
||||
* The syntax for the symbol declarations in this list is as follows:
|
||||
* public sym => Public C symbol, i.e., publicized API
|
||||
* publicC++ sym => Public C++ symbol, i.e., publicized API
|
||||
* private sym => Private C symbol, i.e., unpublicized API
|
||||
* privateC++ sym => Private C++ symbol, i.e., unpublicized API
|
||||
* internal sym => Internal C symbol, i.e., not part of API
|
||||
* internalC++ sym => Internal C++ symbol, i.e., not part of API
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
* Public symbols -- available to everyone
|
||||
********************************************************************/
|
||||
|
||||
public DtComboBoxAddItem
|
||||
public DtComboBoxDeletePos
|
||||
public DtComboBoxSelectItem
|
||||
public DtComboBoxSetItem
|
||||
public DtCreateComboBox
|
||||
public DtCreateEditor
|
||||
public DtCreateMenuButton
|
||||
public DtCreateSpinBox
|
||||
public DtEditorAppend
|
||||
public DtEditorAppendFromFile
|
||||
public DtEditorChange
|
||||
public DtEditorCheckForUnsavedChanges
|
||||
public DtEditorClearSelection
|
||||
public DtEditorCopyToClipboard
|
||||
public DtEditorCutToClipboard
|
||||
public DtEditorDeleteSelection
|
||||
public DtEditorDeselect
|
||||
public DtEditorDisableRedisplay
|
||||
public DtEditorEnableRedisplay
|
||||
public DtEditorFind
|
||||
public DtEditorFormat
|
||||
public DtEditorGetContents
|
||||
public DtEditorGetInsertionPosition
|
||||
public DtEditorGetLastPosition
|
||||
public DtEditorGetMessageTextFieldID
|
||||
public DtEditorGetSizeHints
|
||||
public DtEditorGoToLine
|
||||
public DtEditorInsert
|
||||
public DtEditorInsertFromFile
|
||||
public DtEditorInvokeFindChangeDialog
|
||||
public DtEditorInvokeFormatDialog
|
||||
public DtEditorInvokeSpellDialog
|
||||
public DtEditorPasteFromClipboard
|
||||
public DtEditorReplace
|
||||
public DtEditorReplaceFromFile
|
||||
public DtEditorReset
|
||||
public DtEditorSaveContentsToFile
|
||||
public DtEditorSelectAll
|
||||
public DtEditorSetContents
|
||||
public DtEditorSetContentsFromFile
|
||||
public DtEditorSetInsertionPosition
|
||||
public DtEditorTraverseToEditor
|
||||
public DtEditorUndoEdit
|
||||
public DtSpinBoxAddItem
|
||||
public DtSpinBoxDeletePos
|
||||
public DtSpinBoxSetItem
|
||||
public dtComboBoxWidgetClass
|
||||
public dtDialogBoxWidgetClass
|
||||
public dtEditorClassRec
|
||||
public dtEditorWidgetClass
|
||||
public dtMenuButtonWidgetClass
|
||||
public dtSpinBoxWidgetClass
|
||||
|
||||
|
||||
/********************************************************************
|
||||
* Private symbols -- Undocumented APIs that are exported for B.C.
|
||||
* or because privileged applications may need used them.
|
||||
********************************************************************/
|
||||
|
||||
private _AIXJPStrings
|
||||
private _DtComboBoxGetArrowSize
|
||||
private _DtComboBoxGetLabelString
|
||||
private _DtComboBoxGetListFontList
|
||||
private _DtComboBoxGetListItemCount
|
||||
private _DtComboBoxGetListItems
|
||||
private _DtComboBoxGetListMarginHeight
|
||||
private _DtComboBoxGetListMarginWidth
|
||||
private _DtComboBoxGetListSpacing
|
||||
private _DtComboBoxGetListTopItemPosition
|
||||
private _DtComboBoxGetListVisibleItemCount
|
||||
private _DtControlAddDropAnimationImage
|
||||
private _DtControlAddPushAnimationImage
|
||||
private _DtControlDoDropAnimation
|
||||
private _DtControlDoPushAnimation
|
||||
private _DtControlGetMonitorState
|
||||
private _DtControlSetBusy
|
||||
private _DtControlSetFileChanged
|
||||
private _DtCreateControl
|
||||
private _DtCreateDialogBox
|
||||
private _DtCreateIcon
|
||||
private _DtCreateTitleBox
|
||||
private _DtCreateView
|
||||
private _DtDialogBoxGetButton
|
||||
private _DtDialogBoxGetWorkArea
|
||||
private _DtDuplicateIcon
|
||||
private _DtIconDraw
|
||||
private _DtIconGetIconRects
|
||||
private _DtIconGetState
|
||||
private _DtIconGetTextExtent
|
||||
private _DtIconGetTextExtent_r
|
||||
private _DtIconSelectInTitle
|
||||
private _DtIconSetState
|
||||
private _DtSpinBoxGetArrowSize
|
||||
private _DtStrings
|
||||
private _DtTitleBoxGetTitleArea
|
||||
private _DtTitleBoxGetWorkArea
|
||||
private _DtWidgetGetMessage
|
||||
private __DtCreateDialogBoxDialog
|
||||
private dtComboBoxClassRec
|
||||
private dtControlCacheObjClassRec
|
||||
private dtControlClassRec
|
||||
private dtControlGadgetClass
|
||||
private dtDialogBoxClassRec
|
||||
private dtIconCacheObjClassRec
|
||||
private dtIconClassRec
|
||||
private dtIconGadgetClass
|
||||
private dtMenuButtonClassRec
|
||||
private dtSpinBoxClassRec
|
||||
private dtTitleBoxClassRec
|
||||
private dtTitleBoxWidgetClass
|
||||
private dtViewClassRec
|
||||
private dtViewWidgetClass
|
||||
|
||||
|
||||
/********************************************************************
|
||||
* Internal symbols -- not to be used outside the library.
|
||||
********************************************************************/
|
||||
|
||||
internal _DtEditorDialogFindCancelCB
|
||||
internal _DtEditorDialogReplaceAllCB
|
||||
internal _DtEditorDialogReplaceCB
|
||||
internal _DtEditorDialogSearchCB
|
||||
internal _DtEditorFindTextChangedCB
|
||||
internal _DtEditorGetLineIndex
|
||||
internal _DtEditorGetPointer
|
||||
internal _DtEditorHelpSearchCB
|
||||
internal _DtEditorHelpSearchChangeCB
|
||||
internal _DtEditorHelpSearchFindCB
|
||||
internal _DtEditorHelpSearchSpellCB
|
||||
internal _DtEditorMisspelledDblClickCB
|
||||
internal _DtEditorMisspelledSelectCB
|
||||
internal _DtEditorModifyVerifyCB
|
||||
internal _DtEditorReplaceTextChangedCB
|
||||
internal _DtEditorResetUndo
|
||||
internal _DtEditorSearch
|
||||
internal _DtEditorSearchMapCB
|
||||
internal _DtEditorSetFindSensitivity
|
||||
internal _DtEditorSetReplaceAllSensitivity
|
||||
internal _DtEditorSetReplaceSensitivity
|
||||
internal _DtEditorUpdateLineDisplay
|
||||
internal _DtEditorValidateFileAccess
|
||||
internal _DtEditorWarning
|
||||
internal _DtEditor_CountCharacters
|
||||
internal _DtIconRegisterDropsite
|
||||
internal _DtMsgComboBox_0000
|
||||
internal _DtMsgComboBox_0001
|
||||
internal _DtMsgComboBox_0002
|
||||
internal _DtMsgComboBox_0003
|
||||
internal _DtMsgComboBox_0004
|
||||
internal _DtMsgComboBox_0005
|
||||
internal _DtMsgComboBox_0006
|
||||
internal _DtMsgComboBox_0007
|
||||
internal _DtMsgComboBox_0008
|
||||
internal _DtMsgComboBox_0009
|
||||
internal _DtMsgComboBox_0010
|
||||
internal _DtMsgComboBox_0011
|
||||
internal _DtMsgComboBox_0012
|
||||
internal _DtMsgComboBox_0013
|
||||
internal _DtMsgComboBox_0014
|
||||
internal _DtMsgCommon_0000
|
||||
internal _DtMsgCommon_0001
|
||||
internal _DtMsgDialogBox_0000
|
||||
internal _DtMsgDialogBox_0001
|
||||
internal _DtMsgEditor_0000
|
||||
internal _DtMsgEditor_0001
|
||||
internal _DtMsgEditor_0002
|
||||
internal _DtMsgEditor_0003
|
||||
internal _DtMsgEditor_0004
|
||||
internal _DtMsgEditor_0005
|
||||
internal _DtMsgEditor_0006
|
||||
internal _DtMsgEditor_0007
|
||||
internal _DtMsgEditor_0008
|
||||
internal _DtMsgEditor_0009
|
||||
internal _DtMsgEditor_0010
|
||||
internal _DtMsgEditor_0011
|
||||
internal _DtMsgEditor_0012
|
||||
internal _DtMsgEditor_0013
|
||||
internal _DtMsgEditor_0014
|
||||
internal _DtMsgEditor_0015
|
||||
internal _DtMsgEditor_0016
|
||||
internal _DtMsgEditor_0017
|
||||
internal _DtMsgEditor_0018
|
||||
internal _DtMsgEditor_0019
|
||||
internal _DtMsgEditor_0020
|
||||
internal _DtMsgEditor_0021
|
||||
internal _DtMsgEditor_0022
|
||||
internal _DtMsgEditor_0023
|
||||
internal _DtMsgEditor_0024
|
||||
internal _DtMsgEditor_0025
|
||||
internal _DtMsgIcon_0000
|
||||
internal _DtMsgIcon_0001
|
||||
internal _DtMsgIcon_0002
|
||||
internal _DtMsgIcon_0003
|
||||
internal _DtMsgIcon_0004
|
||||
internal _DtMsgIcon_0005
|
||||
internal _DtMsgIndicator_0000
|
||||
internal _DtMsgMenuButton_0000
|
||||
internal _DtMsgMenuButton_0001
|
||||
internal _DtMsgMenuButton_0002
|
||||
internal _DtMsgSpinBox_0000
|
||||
internal _DtMsgSpinBox_0001
|
||||
internal _DtMsgSpinBox_0002
|
||||
internal _DtMsgSpinBox_0003
|
||||
internal _DtMsgSpinBox_0004
|
||||
internal _DtMsgSpinBox_0005
|
||||
internal _DtMsgSpinBox_0006
|
||||
internal _DtMsgSpinBox_0007
|
||||
internal _DtMsgSpinBox_0008
|
||||
internal _DtMsgSpinBox_0009
|
||||
internal _DtMsgSpinBox_0010
|
||||
internal _DtMsgSpinBox_0011
|
||||
internal _DtMsgSpinBox_0012
|
||||
internal _DtMsgSpinBox_0013
|
||||
internal _DtMsgSpinBox_0014
|
||||
internal _DtMsgTitleBox_0000
|
||||
internal _DtMsgTitleBox_0001
|
||||
internal _DtMsgTitleBox_0002
|
||||
internal _DtMsgTitleBox_0003
|
||||
internal _DtMsgTitleBox_0004
|
||||
internal _DtRegisterNewConverters
|
||||
52
cde/lib/DtWidget/mapfile.reorder
Normal file
52
cde/lib/DtWidget/mapfile.reorder
Normal file
@@ -0,0 +1,52 @@
|
||||
# $XConsortium: mapfile.reorder /main/2 1996/11/19 15:00:54 drk $
|
||||
text = LOAD ?RXO;
|
||||
text : .text%GetTopManager : MenuButton.o;
|
||||
text : .text%DrawMenuGlyph : MenuButton.o;
|
||||
text : .text%InitializePosthook : Icon.o;
|
||||
text : .text%Resize : Icon.o;
|
||||
text : .text%Resize : MenuButton.o;
|
||||
text : .text%Initialize : MenuButton.o;
|
||||
text : .text%CalculateMenuGlyphSize : MenuButton.o;
|
||||
text : .text%AdjustMenuButtonSize : MenuButton.o;
|
||||
text : .text%Draw3DShadows : MenuButton.o;
|
||||
text : .text%SetValuesPrehook : Icon.o;
|
||||
text : .text%DrawArrow : MenuButton.o;
|
||||
text : .text%SetValues : Icon.o;
|
||||
text : .text%Redisplay : MenuButton.o;
|
||||
text : .text%GetGC : MenuButton.o;
|
||||
text : .text%SetValues : MenuButton.o;
|
||||
text : .text%ClassInitialize : MenuButton.o;
|
||||
text : .text%IconEnter : Icon.o;
|
||||
text : .text%IconEventHandler : Icon.o;
|
||||
text : .text%BorderHighlight : Icon.o;
|
||||
text : .text%IconArm : Icon.o;
|
||||
text : .text%IconActivate : Icon.o;
|
||||
text : .text%SetValuesPosthook : Icon.o;
|
||||
text : .text%ClickTimeout : Icon.o;
|
||||
text : .text%_DtControlDoPushAnimation : Control.o;
|
||||
text : .text%BusyTimeout : Control.o;
|
||||
text : .text%BorderUnhighlight : Icon.o;
|
||||
text : .text%LocateMenuGlyph : MenuButton.o;
|
||||
text : .text%FileCheckTimeout : Control.o;
|
||||
text : .text%SecondaryObjectCreate : Icon.o;
|
||||
text : .text%IconLeave : Icon.o;
|
||||
text : .text%Draw : Icon.o;
|
||||
text : .text%Redisplay : Icon.o;
|
||||
text : .text%GetMaskGC : Icon.o;
|
||||
text : .text%GetPositions : Icon.o;
|
||||
text : .text%RegisterDropZone : Editor.o;
|
||||
text : .text%DtEditorGetContents : EditAreaData.o;
|
||||
text : .text%getStringValue : EditAreaData.o;
|
||||
text : .text%_DtEditorCopyDataOut : EditAreaData.o;
|
||||
text : .text%CopySubstring : EditAreaData.o;
|
||||
text : .text%ClassInitialize : Icon.o;
|
||||
text : .text%ClassPartInitialize : Icon.o;
|
||||
text : .text%GetSize : Icon.o;
|
||||
text : .text%UpdateGCs : Icon.o;
|
||||
text : .text%DtEditorPasteFromClipboard : EditCalls.o;
|
||||
text : .text%DtEditorReset : Editor.o;
|
||||
text : .text%StringAdd : EditAreaData.o;
|
||||
text : .text%_DtCreateIcon : Icon.o;
|
||||
text : .text%Initialize : Icon.o;
|
||||
text : .text%GetParentBackgroundGC : Icon.o;
|
||||
text : .text%DtCreateMenuButton : MenuButton.o;
|
||||
27
cde/lib/DtWidget/version.c
Normal file
27
cde/lib/DtWidget/version.c
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef lint
|
||||
#ifdef VERBOSE_REV_INFO
|
||||
/* add any additional revision info here */
|
||||
#endif /* VERBOSE_REV_INFO */
|
||||
#endif /* lint */
|
||||
|
||||
/********************************************************
|
||||
|
||||
Copyright (c) 1988 by Hewlett-Packard Company
|
||||
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.
|
||||
|
||||
********************************************************/
|
||||
|
||||
#include <X11/hpversion.h>
|
||||
|
||||
#ifndef lint
|
||||
version_tag("$XConsortium: version.c /main/4 1996/08/30 15:26:32 drk $")
|
||||
#endif /* lint */
|
||||
Reference in New Issue
Block a user