123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566 |
- /*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
- /* $XConsortium: 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 */
|