Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
575
cde/lib/DtHelp/AIX.lcx
Normal file
575
cde/lib/DtHelp/AIX.lcx
Normal file
@@ -0,0 +1,575 @@
|
||||
!!!!!!!!!!!!!! AIX Locale-Related Translations !!!!!!!!!!!!!!
|
||||
! File: AIX.lcx
|
||||
! Default location: /usr/dt/config/svc/AIX.lcx
|
||||
! Purpose:
|
||||
! Define the AIX-specific set of locale-related translations.
|
||||
! Description:
|
||||
! This file contains the set of all locale-related translations
|
||||
! that can occur during _DtLcxXlateOpToStd() and _DtLcxStdToOp()
|
||||
! calls on AIX platforms. Note that platform-specific tables may
|
||||
! include more than one translation to and from CDE standard
|
||||
! strings if they can be distinguished by version, operation, or
|
||||
! pattern matching.
|
||||
!
|
||||
! It is important that additional CDE standard strings only
|
||||
! be created by the CDE owner of the _DtLcx translation service
|
||||
! and NOT be created by an individual vendor or user. This be because
|
||||
! the purpose of adopting a set of CDE standard strings is to
|
||||
! support interoperability across platforms. If individual vendors
|
||||
! add their own "standard" strings and these strings are not
|
||||
! known on other platforms, then the goal of interoperability
|
||||
! will be defeated.
|
||||
!
|
||||
! If you feel that a new CDE standard string is needed,
|
||||
! contact your CDE representative/vendor with a specific
|
||||
! proposal and justification and have them forward it to
|
||||
! the owner of the CDE _DtLcx service.
|
||||
!
|
||||
! Note that it is allowed for vendors and users to add new
|
||||
! operations for which translations are specified and which
|
||||
! utilize the standard strings. If the operations are of
|
||||
! general utility, please bring them to the attention of
|
||||
! your CDE representative/vendor for forwarding to the
|
||||
! _DtLcx owner.
|
||||
! Invoked by:
|
||||
! This table is used by the _DtLcx translation service
|
||||
! Product: @(#)Cde1
|
||||
! Revision: $XConsortium: AIX.lcx /main/3 1995/10/26 12:15:12 rswiston $
|
||||
! Defects:
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
!!!!!!!!!!!!!!!! translation specification syntax !!!!!!!!!!!!!!!!!!!
|
||||
! Introductory fields:
|
||||
! ====================
|
||||
! The _DtLcx translation specifications have a fixed number of
|
||||
! introductory fields followed by a several standard value
|
||||
! fields and the operation-specific value.
|
||||
! The introductory fields are:
|
||||
! <platform>.<version range>.<operation(s)>.<kind>
|
||||
!
|
||||
! Platform generally is the same string as uname(1) -s.
|
||||
! Version range utilizes normalized version numbers that
|
||||
! are acquired using the 'version' translations.
|
||||
! Operations are one or more comma-separated strings that
|
||||
! uniquely identify the operation associated with the
|
||||
! operation-specific value. This string is specified
|
||||
! as part of the request for a translation.
|
||||
!
|
||||
! Kinds of translations allow the mechanism to support several modes
|
||||
! of operation, each useful for different purposes. When
|
||||
! reading or writing a specification, pay particular attention
|
||||
! to the kind of specification, as this guides the usage of it.
|
||||
!
|
||||
! Specification kinds:
|
||||
! .=. means a valid bi-directional translation requiring the op-value
|
||||
! in the translation specification to exactly match the op-value of
|
||||
! the call to _DtLcxXlateOpToStd(), e.g. foo matches only foo
|
||||
! .~. means a valid bi-directional translation requiring the op-value
|
||||
! in the translation specification to match the beginning of the
|
||||
! op-value of the call to _DtLcxXlateOpToStd(), e.g. foo matches
|
||||
! foo@bar. This is often useful, e.g. for operation-specific
|
||||
! locale strings that may also contain modifier suffixes.
|
||||
! .>. means only from standard to op-specific (generally a
|
||||
! compatibility translation, meaning on op-specific value
|
||||
! that will work for the standard, although that is not
|
||||
! the straight mapping)
|
||||
! .<. means only from op-specific to standard (generally a
|
||||
! regex in the op-value which is used to map a class of
|
||||
! op values to a standard value)
|
||||
! .0. means that translation is not supported and if a translation
|
||||
! request matches the specification, the request will fail.
|
||||
!
|
||||
! Standard values:
|
||||
! ================
|
||||
! _DtLcx defines the order of the standard values in the
|
||||
! translations it utilizes. All translation specifications
|
||||
! must adhere to this order.
|
||||
! <std lang_terr>.<std codeset>.<std modifier>
|
||||
! In CDE 1.0, no modifiers are standard and that
|
||||
! portion of the table is unspecified. This means
|
||||
! that no CDE standard modifiers are available across
|
||||
! platforms. Operations that use only the <std codeset>
|
||||
! should specify the wildcard character ("?") for the
|
||||
! <std lang_terr> value.
|
||||
!
|
||||
! Operation-specific value:
|
||||
! =========================
|
||||
! The operation-specific value is a string that is used
|
||||
! according to the kind of translation. The syntax is
|
||||
! : <op-string>
|
||||
! or : "<op-string>", if it contains white space
|
||||
!
|
||||
! Filling in the table of translations:
|
||||
! =====================================
|
||||
! The person preparing the translation table should know
|
||||
! the minimum version of the target platform that is
|
||||
! be supported. For example, assume that we must
|
||||
! complete the table for all versions 9.00 and higher.
|
||||
!
|
||||
! The objective is then to provide two sets of translations:
|
||||
! a full set of translations from CDE standard locales to
|
||||
! valid platform locales, and a full set of translations
|
||||
! from valid platform locales to some or all CDE standard
|
||||
! locales.
|
||||
!
|
||||
! Translations from CDE standard locales to valid platform
|
||||
! locales must use the .~. .=. or .>. mappings. When there
|
||||
! is a 1:1 mapping between a CDE locale and a platform locale,
|
||||
! use the .~. or .=. mapping. See the comment below to
|
||||
! decide which to use. When there is no 1:1 mapping between
|
||||
! CDE locale and platform locale, use the .>. mapping. This
|
||||
! provides a valid translation from the CDE locale to the
|
||||
! best-suitable platform locale, but never translates from
|
||||
! that platform locale to the CDE locale.
|
||||
!
|
||||
! Translations from every platform locale to the appropriate
|
||||
! CDE locale must use the .~. .=. or .<. mappings.
|
||||
! When there is a 1:1 mapping between a platform locale and
|
||||
! a CDE standard locale, use the .~. or .=. mapping. See the
|
||||
! comment below to decide which to use. If there is a 1:1
|
||||
! mapping, but the platform locale pattern uses a regular
|
||||
! expression, or if more than one platform locale can
|
||||
! be translated to one CDE standard locale, the .<. mapping must
|
||||
! be used.
|
||||
!
|
||||
! If no appropriate CDE standard locale can be found, you have
|
||||
! identified the need for a new CDE standard locale. Refer to
|
||||
! the instructions at the head of this file for how to go about
|
||||
! registering a new CDE standard locale. You should not create
|
||||
! a new "standard" locale (the left hand side of the translation
|
||||
! specification) without registering it with CDE, because this
|
||||
! will hinder the free exchange of information across locales
|
||||
! and platforms.
|
||||
!
|
||||
! The .=. and .~. mappings are similar. The difference is
|
||||
! that the .=. mapping requires an exact string match between
|
||||
! the platform locale and the string provided to the
|
||||
! translation routine. Generally speaking, this mapping
|
||||
! is risky unless exact matchings can be guaranteed in
|
||||
! all DtLcx clients for the particular operation in question.
|
||||
! The .~. mapping is to be preferred, but the .=. translation
|
||||
! is useful in limited situations, where similar strings may
|
||||
! occur.
|
||||
!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
! define this resource to dump debug/test info
|
||||
!*debugDtXlate: True
|
||||
|
||||
!!!!!!!!!!!!!!!! AIX Version Identificaton !!!!!!!!!!!!!!!!!
|
||||
! These translations are used by the _DtXlateGetXlateEnv()
|
||||
! call to determine the version number to use.
|
||||
!
|
||||
! To understand the translation, realize that the
|
||||
! operation-specific regexp(5) pattern on the right
|
||||
! hand side is matched against the strings returned
|
||||
! by uname(2). The best match determines the "normalized"
|
||||
! version number of the platform, which should range from
|
||||
! 001 and up. By convention, major release numbers
|
||||
! map to centuries and minor release numbers to within
|
||||
! the century.
|
||||
!
|
||||
! To determine the string that the regular expression on the
|
||||
! right hand side is matching against, use uname(1) and run
|
||||
! 'uname -r' and 'uname -v' and note the strings. During execution,
|
||||
! the strings returned by this command are retrieved and
|
||||
! concatenated "rv"--in that order, no extra spaces.
|
||||
! This is the string that the pattern must match.
|
||||
!
|
||||
! Sometimes this string may not be intuitive. For example,
|
||||
! note that AIX 3.2 returns 2 for 'uname -r' and 3 for 'uname -v'.
|
||||
! So the pattern string must be 23, not 32. Do not go by
|
||||
! the order of 'uname -rv' or 'uname -vr', as that is not used.
|
||||
!!
|
||||
AIX.?.version.<.320: "[2-9]3"
|
||||
AIX.?.version.<.300: "[01]3"
|
||||
AIX.?.version.<.410: "[1-9]4"
|
||||
AIX.?.version.<.400: "04"
|
||||
|
||||
|
||||
!!!!!!!!!!!!!!!! AIX-specific setlocale translations !!!!!!!!!!!!!!!!!!!
|
||||
! These translations are for the string returned by the
|
||||
! getlocale() or setlocale(LC_xxx,NULL) operations, but not
|
||||
! setlocale(LC_ALL,NULL) operation.
|
||||
!
|
||||
! It provides translations from AIX operation-specific
|
||||
vvvv! to CDE standard strings and back again.
|
||||
!
|
||||
! Some language,territory combinations have the following comments:
|
||||
! (1) These ISO territory names may be subject to change
|
||||
! However, their CDE names will continue to be supported
|
||||
! (2) No ISO "territory" name exists for the Arabic-speaking regions of the
|
||||
! world as a whole. Vendors have sometimes supplied their own.
|
||||
! Those names, when conformant to the ISO model, will be adopted for CDE.
|
||||
!
|
||||
!Platform Operation Lang_Terr Op-Value Language,Territory Who has
|
||||
!--- --------- ----- -------- ------------------ -------
|
||||
! Version Kind Codeset
|
||||
! ---- - ---------
|
||||
|
||||
|
||||
! setlocales Compliance
|
||||
AIX.320+.setlocale.~.C.IBM-850: C ! setlocales compliance ,IBM
|
||||
AIX.320+.setlocale.~.POSIX.IBM-850: POSIX ! setlocales compliance ,IBM
|
||||
AIX.410+.setlocale.~.C.ISO-8859-1: C ! setlocales compliance ,IBM, HP, Sun , USL
|
||||
AIX.410+.setlocale.~.POSIX.ISO-8859-1: POSIX ! setlocales compliance ,IBM, HP, Sun , USL
|
||||
|
||||
! W European/Americas, Latin 1 codeset
|
||||
AIX.320+.setlocale.~.da_DK.ISO-8859-1: da_DK !.ISO8859-1 ! Danish, Denmark XoJIG,IBM, HP, , USL ("da")
|
||||
AIX.320+.setlocale.>.de_AT.ISO-8859-1: de_DE !.ISO8859-1 ! German,Austria XoJIG, , , , USL
|
||||
AIX.320+.setlocale.~.de_CH.ISO-8859-1: de_CH !.ISO8859-1 ! German,Switzerland XoJIG,IBM, , , USL
|
||||
AIX.320+.setlocale.~.de_DE.ISO-8859-1: de_DE !.ISO8859-1 ! German, Germany XoJIG,IBM, HP, Sun ("de"), USL ("de")
|
||||
AIX.320+.setlocale.>.en_AU.ISO-8859-1: en_GB !.ISO8859-1 ! English,Australia , , , , USL
|
||||
AIX.320+.setlocale.>.en_CA.ISO-8859-1: en_US !.ISO8859-1 ! English,Canada XoJIG, , , , USL
|
||||
AIX.320+.setlocale.>.en_DK.ISO-8859-1: en_GB !.ISO8859-1 ! English, Denmark XoJIG, , , , USL
|
||||
AIX.320+.setlocale.~.en_GB.ISO-8859-1: en_GB !.ISO8859-1 ! English, U.K. XoJIG,IBM, HP, , USL ("en")
|
||||
AIX.320+.setlocale.>.en_JP.ISO-8859-1: en_JP !.ISO8859-1 ! English, Japan XoJIG,IBM, , ,
|
||||
AIX.410+.setlocale.>.en_JP.ISO-8859-1: en_US !.ISO8859-1 ! English, Japan XoJIG,IBM, , ,
|
||||
AIX.320+.setlocale.>.en_IE.ISO-8859-1: en_GB !.ISO8859-1 ! English, Ireland XoJIG, , , , USL
|
||||
AIX.320+.setlocale.>.en_MY.ISO-8859-1: en_US !.ISO8859-1 ! English,Malaysia , , , , USL
|
||||
AIX.320+.setlocale.>.en_NZ.ISO-8859-1: en_GB !.ISO8859-1 ! English,New Zealand , , , , USL
|
||||
AIX.320+.setlocale.>.en_KR.ISO-8859-1: en_KR !.ISO8859-1 ! English,Korea , , , , USL
|
||||
AIX.410+.setlocale.>.en_KR.ISO-8859-1: en_US !.ISO8859-1 ! English,Korea ,IBM, , ,
|
||||
AIX.320+.setlocale.>.en_TW.ISO-8859-1: en_TW !.ISO8859-1 ! English,Taiwan , , , , USL
|
||||
AIX.410+.setlocale.>.en_TW.ISO-8859-1: en_US !.ISO8859-1 ! English,Taiwan ,IBM, , ,
|
||||
AIX.320+.setlocale.~.en_US.ISO-8859-1: en_US !.ISO8859-1 ! English, USA XoJIG,IBM, HP, Sun , USL
|
||||
AIX.320+.setlocale.>.es_AR.ISO-8859-1: es_ES !.ISO8859-1 ! Spanish, Argentina , , , Sun , USL
|
||||
AIX.320+.setlocale.>.es_BO.ISO-8859-1: es_ES !.ISO8859-1 ! Spanish, Bolivia , , , Sun
|
||||
AIX.320+.setlocale.>.es_CL.ISO-8859-1: es_ES !.ISO8859-1 ! Spanish, Chile , , , Sun , USL
|
||||
AIX.320+.setlocale.>.es_CO.ISO-8859-1: es_ES !.ISO8859-1 ! Spanish, Columbia , , , Sun
|
||||
AIX.320+.setlocale.>.es_CR.ISO-8859-1: es_ES !.ISO8859-1 ! Spanish, Costa Rica , , , Sun
|
||||
AIX.320+.setlocale.>.es_EC.ISO-8859-1: es_ES !.ISO8859-1 ! Spanish, Ecuador , , , Sun
|
||||
AIX.320+.setlocale.~.es_ES.ISO-8859-1: es_ES !.ISO8859-1 ! Spanish, Spain XoJIG,IBM, HP, Sun , USL
|
||||
AIX.410+.setlocale.~.ca_ES.ISO-8859-1: ca_ES !.ISO8859-1 ! Catalan, Spain XoJIG,IBM, HP, Sun , USL
|
||||
AIX.320+.setlocale.>.es_GT.ISO-8859-1: es_ES !.ISO8859-1 ! Spanish, Guatemala , , , Sun
|
||||
AIX.320+.setlocale.>.es_MX.ISO-8859-1: es_ES !.ISO8859-1 ! Spanish, Mexico , , , Sun , USL
|
||||
AIX.320+.setlocale.>.es_PE.ISO-8859-1: es_ES !.ISO8859-1 ! Spanish, Peru , , , Sun
|
||||
AIX.320+.setlocale.>.es_UY.ISO-8859-1: es_ES !.ISO8859-1 ! Spanish, Uruguay , , , Sun
|
||||
AIX.320+.setlocale.>.es_VE.ISO-8859-1: es_ES !.ISO8859-1 ! Spanish, Venezuela , , , Sun , USL
|
||||
! AIX.320+.setlocale.>.et_EE.ISO-8859-1: ! Estonian, Estonia XoJIG,
|
||||
AIX.320+.setlocale.~.fi_FI.ISO-8859-1: fi_FI !.ISO8859-1 ! Finnish, Finland XoJIG,IBM, HP, , USL ("fi")
|
||||
! AIX.320+.setlocale.>.fo_FO.ISO-8859-1: ! Faroese, Faeroe Island XoJIG,
|
||||
AIX.320+.setlocale.~.fr_BE.ISO-8859-1: fr_BE !.ISO8859-1 ! French,Belgium XoJIG, , , , USL
|
||||
AIX.320+.setlocale.~.fr_CA.ISO-8859-1: fr_CA !.ISO8859-1 ! French, Canada XoJIG,IBM, HP, , USL
|
||||
AIX.320+.setlocale.~.fr_CH.ISO-8859-1: fr_CH !.ISO8859-1 ! French, Switzerland XoJIG,IBM, , , USL
|
||||
AIX.320+.setlocale.~.fr_FR.ISO-8859-1: fr_FR !.ISO8859-1 ! French, France XoJIG,IBM, HP, Sun ("fr"), USL ("fr")
|
||||
AIX.320+.setlocale.~.is_IS.ISO-8859-1: is_IS !.ISO8859-1 ! Icelandic, Iceland XoJIG,IBM, HP, , USL ("is")
|
||||
AIX.320+.setlocale.>.it_CH.ISO-8859-1: it_IT !.ISO8859-1 ! Italian,Switzerland , , , , USL
|
||||
AIX.320+.setlocale.~.it_IT.ISO-8859-1: it_IT !.ISO8859-1 ! Italian, Italy XoJIG,IBM, HP, Sun ("it"), USL ("it")
|
||||
! AIX.320+.setlocale.>.kl_GL.ISO-8859-1: ! Greenlandic, Greenland XoJIG,
|
||||
! AIX.320+.setlocale.>.lt_LT.ISO-8859-1: ! Lithuanian, Lithuania XoJIG,
|
||||
! AIX.320+.setlocale.>.lv_LV.ISO-8859-1: ! Latvian, Latvia XoJIG,
|
||||
AIX.320+.setlocale.~.nl_BE.ISO-8859-1: nl_BE !.ISO8859-1 ! Dutch, Belgium XoJIG,IBM, , , USL
|
||||
AIX.320+.setlocale.~.nl_NL.ISO-8859-1: nl_NL !.ISO8859-1 ! Dutch, The Netherlands XoJIG,IBM, HP, , USL ("nl")
|
||||
AIX.320+.setlocale.~.no_NO.ISO-8859-1: no_NO !.ISO8859-1 ! Norwegian, Norway XoJIG,IBM, HP, , USL ("no")
|
||||
AIX.410+.setlocale.~.pt_BR.ISO-8859-1: pt_BR !.ISO8859-1 ! Portuguese,Brazil , , , , USL
|
||||
AIX.320+.setlocale.~.pt_PT.ISO-8859-1: pt_PT !.ISO8859-1 ! Portuguese, Portugal XoJIG,IBM, HP, , USL
|
||||
AIX.320+.setlocale.>.sv_FI.ISO-8859-1: sv_SE !.ISO8859-1 ! Swedish, Finland XoJIG,
|
||||
AIX.320+.setlocale.~.sv_SE.ISO-8859-1: sv_SE !.ISO8859-1 ! Swedish, Sweden XoJIG,IBM, HP, Sun ("sv"), USL ("sv")
|
||||
|
||||
|
||||
! E European
|
||||
AIX.410+.setlocale.~.cs_CS.ISO-8859-2: cs_CZ !.ISO8859-2 ! Czech(1) ,IBM, HP
|
||||
AIX.320+.setlocale.~.hr_HR.ISO-8859-2: hr_HR !.ISO8859-2 ! Croatian, Croatia ,IBM
|
||||
AIX.320+.setlocale.~.hu_HU.ISO-8859-2: hu_HU !.ISO8859-2 ! Hungarian, Hungry XoJIG,IBM, HP
|
||||
AIX.320+.setlocale.~.pl_PL.ISO-8859-2: pl_PL !.ISO8859-2 ! Polish, Poland XoJIG,IBM, HP
|
||||
AIX.320+.setlocale.~.ro_RO.ISO-8859-2: ro_RO !.ISO8859-2 ! Rumanian, Romania XoJIG,IBM, HP
|
||||
AIX.410+.setlocale.~.sh_YU.ISO-8859-2: sh_SP !.ISO8859-2 ! Serbocroatian, Yugoslavia(1) ,IBM, HP
|
||||
AIX.320+.setlocale.>.sl_CS.ISO-8859-2: sl_SI !.ISO8859-2 ! Slovenian , , HP
|
||||
AIX.320+.setlocale.~.si_SI.ISO-8859-2: sl_SI !.ISO8859-2 ! Slovenian ,IBM,
|
||||
AIX.320+.setlocale.~.sk_SK.ISO-8859-2: sk_SK !.ISO8859-2 ! Slovak ,IBM
|
||||
|
||||
! Cyrillic
|
||||
AIX.320+.setlocale.~.bg_BG.ISO-8859-5: bg_BG !.ISO8859-5 ! Bulgarian, Bulgaria ,IBM, HP
|
||||
AIX.320+.setlocale.~.mk_MK.ISO-8859-5: mk_MK !.ISO8859-5 ! Macedonian ,IBM
|
||||
AIX.320+.setlocale.~.ru_RU.ISO-8859-5: ru_RU !.ISO8859-5 ! Russian(1) ,IBM,
|
||||
AIX.320+.setlocale.>.ru_SU.ISO-8859-5: ru_RU !.ISO8859-5 ! Russian(1) , , HP
|
||||
AIX.410+.setlocale.~.sp_YU.ISO-8859-5: sr_SP !.ISO8859-5 ! Serbian,Yugoslavia(1) ,IBM
|
||||
|
||||
! Arabic
|
||||
AIX.320+.setlocale.>.ar_DZ.ISO-8859-6: ar_AA !.ISO8859-6 ! Arabic(2) , , HP
|
||||
AIX.320+.setlocale.~.ar_SA.ISO-8859-6: ar_AA !.ISO8859-6 ! Arabic(2) ,IBM, HP
|
||||
AIX.320+.setlocale.~.ar_SA.IBM-1046: Ar_AA !.IBM-1046 ! Arabic(2) ,IBM
|
||||
|
||||
! Hebrew
|
||||
AIX.320+.setlocale.~.iw_IL.ISO-8859-8: iw_IL !.ISO8859-8 ! Hebrew, Israel ,IBM, HP
|
||||
AIX.320+.setlocale.~.iw_IL.IBM-856: Iw_IL !.IBM-856 ! Hebrew, Israel ,IBM
|
||||
|
||||
! Greek
|
||||
AIX.320+.setlocale.~.el_GR.ISO-8859-7: el_GR !.ISO8859-7 ! Greek, Greece ,IBM, HP
|
||||
|
||||
! Turkish
|
||||
AIX.320+.setlocale.~.tr_TR.ISO-8859-9: tr_TR !.ISO8859-9 ! Turkish, Turkey ,IBM, HP
|
||||
|
||||
! East Asia
|
||||
AIX.320+.setlocale.~.ja_JP.EUC-JP: ja_JP !.IBM-eucJP ! Japanese, Japan ,IBM, HP, Sun ("ja"), USL
|
||||
AIX.320+.setlocale.~.ja_JP.IBM-932: Ja_JP !.IBM-932 ! Japanese, Japan ,IBM
|
||||
AIX.320+.setlocale.>.ja_JP.HP-SJIS: Ja_JP !.IBM-932 ! Japanese, Japan aka japanese 15 , , HP,
|
||||
AIX.320+.setlocale.~.ko_KR.EUC-KR: ko_KR !.IBM-eucKR ! Korean, Korea ,IBM, HP, Sun ("ko"), USL
|
||||
AIX.320+.setlocale.~.zh_CN.EUC-CN: zh_CN !.IBM-eucCN ! Chinese, China ,IBM, , Sun ("zh"), USL
|
||||
AIX.320+.setlocale.>.zh_CN.HP-15CN: zh_CN !.IBM-eucCN ! Chinese, China , , HP
|
||||
AIX.320+.setlocale.~.zh_CN.UTF-8: ZH_CN !.UTF-8 ! Chinese, China ,IBM,
|
||||
AIX.320+.setlocale.~.zh_TW.EUC-TW: zh_TW !.IBM-eucTW ! Chinese, Taiwan ,IBM, HP, Sun , USL
|
||||
AIX.320+.setlocale.>.zh_TW.HP-BIG5: Zh_TW !.big5 ! Chinese, Taiwan ,IBM, HP, ,
|
||||
! AIX.320+.setlocale.>.zh_TW.HP-CCDC: ! Chinese, Taiwan , , HP, ,
|
||||
! AIX.320+.setlocale.>.ja_JP.HP-KANA8: ! Japanese, Japan , , HP, ,
|
||||
|
||||
|
||||
! Thai
|
||||
AIX.320+.setlocale.~.th_TH.TIS-620: th_TH !.TIS-620 ! Thai, Thailand ,IBM, HP
|
||||
|
||||
|
||||
! W European/Americas, IBM-850 codeset
|
||||
AIX.320+.setlocale.~.da_DK.IBM-850: Da_DK ! Danish, Denmark ,IBM,
|
||||
AIX.320+.setlocale.>.de_AT.IBM-850: De_DE ! German,Austria , ,
|
||||
AIX.320+.setlocale.~.de_CH.IBM-850: De_CH ! German,Switzerland ,IBM,
|
||||
AIX.320+.setlocale.~.de_DE.IBM-850: De_DE ! German, Germany ,IBM,
|
||||
AIX.320+.setlocale.>.en_AU.IBM-850: En_GB ! English,Australia , ,
|
||||
AIX.320+.setlocale.>.en_CA.IBM-850: En_US ! English,Canada , ,
|
||||
AIX.320+.setlocale.>.en_DK.IBM-850: En_GB ! English, Denmark , ,
|
||||
AIX.320+.setlocale.~.en_GB.IBM-850: En_GB ! English, U.K. ,IBM,
|
||||
AIX.320+.setlocale.~.en_JP.IBM-850: En_JP ! English, Japan ,IBM,
|
||||
AIX.320+.setlocale.>.en_IE.IBM-850: En_GB ! English, Ireland , ,
|
||||
AIX.320+.setlocale.>.en_MY.IBM-850: En_US ! English,Malaysia , ,
|
||||
AIX.320+.setlocale.>.en_NZ.IBM-850: En_GB ! English,New Zealand , ,
|
||||
AIX.320+.setlocale.>.en_KR.IBM-850: En_GB ! English,Korea , ,
|
||||
AIX.320+.setlocale.>.en_TW.IBM-850: En_GB ! English,Taiwan , ,
|
||||
AIX.320+.setlocale.~.en_US.IBM-850: En_US ! English, USA ,IBM,
|
||||
AIX.320+.setlocale.>.es_AR.IBM-850: Es_ES ! Spanish, Argentina , ,
|
||||
AIX.320+.setlocale.>.es_BO.IBM-850: Es_ES ! Spanish, Bolivia , ,
|
||||
AIX.320+.setlocale.>.es_CL.IBM-850: Es_ES ! Spanish, Chile , ,
|
||||
AIX.320+.setlocale.>.es_CO.IBM-850: Es_ES ! Spanish, Columbia , ,
|
||||
AIX.320+.setlocale.>.es_CR.IBM-850: Es_ES ! Spanish, Costa Rica , ,
|
||||
AIX.320+.setlocale.>.es_EC.IBM-850: Es_ES ! Spanish, Ecuador , ,
|
||||
AIX.320+.setlocale.~.es_ES.IBM-850: Es_ES ! Spanish, Spain ,IBM,
|
||||
AIX.410+.setlocale.~.ca_ES.IBM-850: Ca_ES ! Catalan, Spain ,IBM,
|
||||
AIX.320+.setlocale.>.es_GT.IBM-850: Es_ES ! Spanish, Guatemala , ,
|
||||
AIX.320+.setlocale.>.es_MX.IBM-850: Es_ES ! Spanish, Mexico , ,
|
||||
AIX.320+.setlocale.>.es_PE.IBM-850: Es_ES ! Spanish, Peru , ,
|
||||
AIX.320+.setlocale.>.es_UY.IBM-850: Es_ES ! Spanish, Uruguay , ,
|
||||
AIX.320+.setlocale.>.es_VE.IBM-850: Es_ES ! Spanish, Venezuela , ,
|
||||
! AIX.320+.setlocale.>.et_EE.IBM-850: ! Estonian, Estonia ,
|
||||
AIX.320+.setlocale.~.fi_FI.IBM-850: Fi_FI ! Finnish, Finland ,IBM,
|
||||
! AIX.320+.setlocale.>.fo_FO.IBM-850: ! Faroese, Faeroe Island ,
|
||||
AIX.320+.setlocale.~.fr_BE.IBM-850: Fr_BE ! French,Belgium , ,
|
||||
AIX.320+.setlocale.~.fr_CA.IBM-850: Fr_CA ! French, Canada ,IBM,
|
||||
AIX.320+.setlocale.~.fr_CH.IBM-850: Fr_CH ! French, Switzerland ,IBM,
|
||||
AIX.320+.setlocale.~.fr_FR.IBM-850: Fr_FR ! French, France ,IBM,
|
||||
AIX.320+.setlocale.~.is_IS.IBM-850: Is_IS ! Icelandic, Iceland ,IBM,
|
||||
AIX.320+.setlocale.>.it_CH.IBM-850: It_IT ! Italian,Switzerland , ,
|
||||
AIX.320+.setlocale.~.it_IT.IBM-850: It_IT ! Italian, Italy ,IBM,
|
||||
! AIX.320+.setlocale.>.kl_GL.IBM-850: ! Greenlandic, Greenland ,
|
||||
! AIX.320+.setlocale.>.lt_LT.IBM-850: ! Lithuanian, Lithuania ,
|
||||
! AIX.320+.setlocale.>.lv_LV.IBM-850: ! Latvian, Latvia ,
|
||||
AIX.320+.setlocale.~.nl_BE.IBM-850: Nl_BE ! Dutch, Belgium ,IBM,
|
||||
AIX.320+.setlocale.~.nl_NL.IBM-850: Nl_NL ! Dutch, The Netherlands ,IBM,
|
||||
AIX.320+.setlocale.~.no_NO.IBM-850: No_NO ! Norwegian, Norway ,IBM,
|
||||
AIX.320+.setlocale.>.pt_BR.IBM-850: Pt_PT ! Portuguese,Brazil , ,
|
||||
AIX.320+.setlocale.~.pt_PT.IBM-850: Pt_PT ! Portuguese, Portugal ,IBM,
|
||||
AIX.320+.setlocale.>.sv_FI.IBM-850: Sv_SE ! Swedish, Finland ,
|
||||
vvAIX.320+.setlocale.~.sv_SE.IBM-850: Sv_SE ! Swedish, Sweden ,IBM,
|
||||
|
||||
|
||||
! codesets supported for iconv(1,3) & nl_langinfo and above
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.ISO-8859-1: ISO8859-1
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.ISO-8859-2: ISO8859-2
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.ISO-8859-5: ISO8859-5
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.ISO-8859-6: ISO8859-6
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.ISO-8859-7: ISO8859-7
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.ISO-8859-8: ISO8859-8
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.ISO-8859-9: ISO8859-9
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.EUC-KR: IBM-eucKR
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.EUC-JP: IBM-eucJP
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.EUC-TW: IBM-eucTW
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.EUC-CN: IBM-eucCN
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).>.?.HP-15CN: IBM-eucCN
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.IBM-437: IBM-437
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.IBM-850: IBM-850
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.IBM-856: IBM-856
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.IBM-932: IBM-932
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).>.?.HP-SJIS: IBM-932
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.IBM-1046: IBM-1046
|
||||
AIX.320+.iconv1,iconv3,nl_langinfo(CODESET).=.?.UTF-8: UTF-8
|
||||
AIX.320+.iconv1,iconv3.>.?.ISO-2022-JP: fold7
|
||||
AIX.320+.iconv1,iconv3.>.?.ISO-2022-KR: fold7
|
||||
AIX.320+.iconv1,iconv3.>.?.ISO-2022-TW: fold7
|
||||
AIX.320+.iconv1,iconv3.>.?.ISO-2022-CN: fold7
|
||||
AIX.320+.iconv1,iconv3.>.?.HP-BIG5: big5
|
||||
AIX.320+.iconv1,iconv3.>.?.TIS-620: TIS-620
|
||||
|
||||
! codesets not supported by AIX iconv(1,3)
|
||||
! AIX.?.iconv1,iconv3.~.?.UCS-2:
|
||||
! AIX.?.iconv1,iconv3.~.?.HP-ARABIC8:
|
||||
! AIX.?.iconv1,iconv3.~.?.HP-GREEK8:
|
||||
! AIX.?.iconv1,iconv3.~.?.HP-HEBREW8
|
||||
! AIX.?.iconv1,iconv3.~.?.HP-ROMAN8:
|
||||
! AIX.?.iconv1,iconv3.~.?.HP-TURKISH8:
|
||||
! AIX.?.iconv1,iconv3.~.?.HP-KANA8:
|
||||
! AIX.?.iconv1,iconv3.~.?.HP-CCDC:
|
||||
|
||||
! multibyte codesets
|
||||
! This translation provides an alternative to a call to
|
||||
! using setlocale() and MB_CUR_MAX to determine this.
|
||||
AIX.320+.multibyte.=.?.EUC-KR: 2
|
||||
AIX.320+.multibyte.=.?.HP-SJIS: 2
|
||||
AIX.320+.multibyte.=.?.IBM-932: 2
|
||||
AIX.320+.multibyte.=.?.EUC-JP: 3
|
||||
! AIX.?.multibyte.~.?.HP-CCDC: 2
|
||||
AIX.320+.multibyte.>.?.HP-BIG5: 2
|
||||
AIX.320+.multibyte.=.?.EUC-TW: 4
|
||||
AIX.320+.multibyte.=.?.TIS-620: 2
|
||||
AIX.320+.multibyte.=.?.EUC-CN: 2
|
||||
AIX.320+.multibyte.=.?.HP-15CN: 2
|
||||
AIX.320+.multibyte.=.?.EUC-KR: 2
|
||||
AIX.320+.multibyte.=.?.UTF-8: 3
|
||||
|
||||
|
||||
! Translations from predefined CCDF-locales to CDE Standard Locales
|
||||
AIX.320+.ccdf.=.?.ISO-8859-1: ISO8859-1
|
||||
AIX.320+.ccdf.=.?.ISO-8859-2: ISO8859-2
|
||||
AIX.320+.ccdf.=.?.ISO-8859-5: ISO8859-5
|
||||
AIX.320+.ccdf.=.?.ISO-8859-6: ISO8859-6
|
||||
AIX.320+.ccdf.=.?.ISO-8859-7: ISO8859-7
|
||||
AIX.320+.ccdf.=.?.ISO-8859-8: ISO8859-8
|
||||
AIX.320+.ccdf.=.?.ISO-8859-9: ISO8859-9
|
||||
AIX.320+.ccdf.=.?.EUC-JP: IBM-eucJP
|
||||
AIX.320+.ccdf.=.?.EUC-KR: IBM-eucKR
|
||||
AIX.320+.ccdf.=.?.EUC-TW: IBM-eucTW
|
||||
AIX.320+.ccdf.=.?.EUC-CN: IBM-eucCN
|
||||
AIX.320+.ccdf.>.?.IBM-932: IBM-932
|
||||
AIX.320+.ccdf.>.?.HP-SJIS: IBM-932
|
||||
AIX.320+.ccdf.=.?.IBM-1046: IBM-1046
|
||||
AIX.320+.ccdf.=.?.IBM-850: IBM-850
|
||||
AIX.320+.ccdf.=.?.IBM-856: IBM-856
|
||||
AIX.320+.ccdf.=.?.HP-BIG5: big5
|
||||
AIX.320+.ccdf.=.?.TIS-620: TIS-620
|
||||
AIX.320+.ccdf.=.?.UTF-8: UTF-8
|
||||
AIX.320+.ccdf.=.?.DT-SYMBOL-1: symbol !!! standard Dt symbol font
|
||||
|
||||
! These CDE standard locales may have CCDF-locales, but they are defined by localizers
|
||||
AIX.320+.ccdf.>.?.HP-ROMAN8: ISO8859-1
|
||||
AIX.320+.ccdf.>.?.HP-ARABIC8: ISO8859-6
|
||||
AIX.320+.ccdf.>.?.HP-GREEK8: ISO8859-8
|
||||
AIX.320+.ccdf.>.?.HP-HEBREW8: ISO8859-7
|
||||
AIX.320+.ccdf.>.?.HP-TURKISH8: ISO8859-9
|
||||
AIX.320+.ccdf.>.?.HP-KANA8: IBM-932
|
||||
AIX.320+.ccdf.>.?.HP-CCDC: IBM-eucCN
|
||||
|
||||
|
||||
|
||||
! Codesets that require multibyte parsing to avoid confusion with shell special chars
|
||||
AIX.?.dtkshSpecialParse.=.ja_JP.HP-JIS: True
|
||||
AIX.?.dtkshSpecialParse.=.ja_JP.HP-SJIS: True
|
||||
AIX.?.dtkshSpecialParse.=.ja_JP.IBM-932: True
|
||||
AIX.?.dtkshSpecialParse.=.zh_TW.HP-BIG5: True
|
||||
AIX.?.dtkshSpecialParse.=.zh_TW.HP-CCDC: True
|
||||
|
||||
|
||||
!! When content is exchanged with other platforms, the interchange codeset
|
||||
!! may be different that the codeset used locally. In CDE1, these translations
|
||||
!! are used by dtmail, but other clients may use the same translations
|
||||
!! in the future. For example, to improve interoperability of 8-bit mail,
|
||||
!! the mail messages of users working in codesets such as HP-ROMAN8 or IBM-850
|
||||
!! are translated to the interchangeCodeset (in this case, ISO-8859-1) before
|
||||
!! they are sent. Similarly, the mail of Japanese users is translated to JIS
|
||||
!! before it is sent.
|
||||
!!
|
||||
!! --------------------------------------------------------------------
|
||||
!! AIX does provide the fold7 conversion which is an ISO 2022 encoding
|
||||
!! of every code set supported by a locale... so ... the name
|
||||
!! ISO-2022-xx ( where xx is JP, CN, KR, TW)
|
||||
!! can be used for any of the following interchangeCodeset... but it has
|
||||
!! been left as is in case 8-bit mail is supported...
|
||||
!! --------------------------------------------------------------------
|
||||
!!
|
||||
AIX.?.interchangeCodeset.~.?.ISO-8859-1: ISO-8859-1 ! ISO Latin 1
|
||||
!AIX.?.interchangeCodeset.>.?.HP-ROMAN8: ISO-8859-1 ! HP Roman8
|
||||
AIX.?.interchangeCodeset.>.?.IBM-850: ISO-8859-1 ! PC (Multi-lingual)
|
||||
AIX.?.interchangeCodeset.>.?.IBM-437: ISO-8859-1 ! PC (US)
|
||||
AIX.?.interchangeCodeset.~.?.ISO-8859-2: ISO-8859-2 ! ISO Latin 2
|
||||
AIX.?.interchangeCodeset.~.?.ISO-8859-5: ISO-8859-5 ! ISO Latin/Cyrillic
|
||||
AIX.?.interchangeCodeset.~.?.ISO-8859-6: ISO-8859-6 ! ISO Latin/Arabic
|
||||
!AIX.?.interchangeCodeset.>.?.HP-ARABIC8: ISO-8859-6 ! HP Arabic8
|
||||
AIX.?.interchangeCodeset.>.?.IBM-1046: ISO-8859-6 ! PC Arabic Code Set
|
||||
AIX.?.interchangeCodeset.~.?.ISO-8859-8: ISO-8859-8 ! ISO Latin/Hebrew
|
||||
!AIX.?.interchangeCodeset.>.?.HP-HEBREW8: ISO-8859-8 ! HP Hebrew8
|
||||
AIX.?.interchangeCodeset.>.?.IBM-856: ISO-8859-8 ! PC Hebrew
|
||||
AIX.?.interchangeCodeset.~.?.ISO-8859-7: ISO-8859-7 ! ISO Latin/Greek
|
||||
!AIX.?.interchangeCodeset.>.?.HP-GREEK8: ISO-8859-7 ! HP Greek8
|
||||
AIX.?.interchangeCodeset.~.?.ISO-8859-9: ISO-8859-9 ! ISO Latin 5
|
||||
!AIX.?.interchangeCodeset.>.?.HP-TURKISH8: ISO-8859-9 ! HP Turkish8
|
||||
AIX.?.interchangeCodeset.~.?.EUC-JP: ISO-2022-JP ! Japanese EUC
|
||||
!AIX.?.interchangeCodeset.>.?.HP-SJIS: ISO-2022-JP ! HP Japanese Shift JIS
|
||||
AIX.?.interchangeCodeset.>.?.IBM-932: ISO-2022-JP ! PC Japanese Shift JIS
|
||||
!AIX.?.interchangeCodeset.>.?.HP-KANA8: ISO-2022-JP ! HP Japanese Katakana8
|
||||
! uncomment when ISO-2022-KR is supported by iconv
|
||||
AIX.?.interchangeCodeset.~.?.EUC-KR: ISO-2022-KR ! Korean EUC
|
||||
! uncomment when ISO-2022-CN is supported by iconv
|
||||
AIX.?.interchangeCodeset.~.?.EUC-CN: ISO-2022-CN ! China Chinese EUC
|
||||
AIX.?.interchangeCodeset.>.?.HP-15CN: ISO-2022-CN ! HP Chinese EUC
|
||||
! uncomment when ISO-2022-TW is supported by iconv
|
||||
AIX.?.interchangeCodeset.~.?.EUC-TW: ISO-2022-TW ! Taiwan Chinese EUC
|
||||
AIX.?.interchangeCodeset.>.?.HP-BIG5: ISO-2022-TW ! HP Big5 Chinese
|
||||
AIX.?.interchangeCodeset.>.?.HP-CCDC: ISO-2022-TW ! HP CCDC Chinese
|
||||
AIX.?.interchangeCodeset.~.?.TIS-620: TIS-620 ! Thai
|
||||
AIX.?.interchangeCodeset.>.?.UCS-2: ISO-2022-JP ! Unicode
|
||||
AIX.?.interchangeCodeset.~.?.UTF-8: ISO-2022-JP ! multibyte Unicode
|
||||
!! Codeset identifiers for use with MIME messages. The .~. translations
|
||||
!! are used by dtmail and adhere to the MIME standard, RFC 1521.
|
||||
!! Note that the MIME standard states that codeset identifiers are
|
||||
!! case-insensitive. The operation-specific values on the right-hand-side
|
||||
!! of the translations below, however, ARE case sensitive. Before
|
||||
!! doing a OpToStd translation, first convert the MIME codeset identifier
|
||||
!! to uppercase. Alternatively, one could provide lower-case versions
|
||||
!! of the translations (right-hand-side only should be in lower-case).
|
||||
AIX.?.mime.~.?.ISO-8859-1: ISO-8859-1 ! ISO Latin 1
|
||||
AIX.?.mime.~.?.HP-ROMAN8: X-HP-ROMAN8 ! HP Roman8
|
||||
AIX.?.mime.~.?.IBM-437: X-IBM-437 ! PC (US)
|
||||
AIX.?.mime.~.?.IBM-850: X-IBM-850 ! PC (Multi-lingual)
|
||||
AIX.?.mime.~.?.ISO-8859-2: ISO-8859-2 ! ISO Latin 2
|
||||
AIX.?.mime.~.?.ISO-8859-5: ISO-8859-5 ! ISO Latin/Cyrillic
|
||||
AIX.?.mime.~.?.ISO-8859-6: ISO-8859-6 ! ISO Latin/Arabic
|
||||
AIX.?.mime.~.?.HP-ARABIC8: X-HP-ARABIC8 ! HP Arabic8
|
||||
AIX.?.mime.~.?.IBM-1046: X-IBM-1046 ! PC Arabic Code Set
|
||||
AIX.?.mime.~.?.ISO-8859-8: ISO-8859-8 ! ISO Latin/Hebrew
|
||||
AIX.?.mime.~.?.HP-HEBREW8: X-HP-HEBREW8 ! HP Hebrew8
|
||||
AIX.?.mime.~.?.IBM-856: X-IBM-856 ! PC Hebrew
|
||||
AIX.?.mime.~.?.ISO-8859-7: ISO-8859-7 ! ISO Latin/Greek
|
||||
AIX.?.mime.~.?.HP-GREEK8: X-HP-GREEK8 ! HP Greek8
|
||||
AIX.?.mime.~.?.ISO-8859-9: ISO-8859-9 ! ISO Latin 5
|
||||
AIX.?.mime.~.?.HP-TURKISH8: X-HP-TURKISH8 ! HP Turkish8
|
||||
AIX.?.mime.~.?.EUC-JP: X-EUC-JP ! Japanese EUC
|
||||
AIX.?.mime.~.?.ISO-2022-JP: ISO-2022-JP ! Japanese JIS with 7-bit encoding per ISO-2022-JP
|
||||
AIX.?.mime.~.?.HP-SJIS: X-HP-SJIS ! HP Japanese Shift JIS
|
||||
AIX.?.mime.~.?.IBM-932: X-IBM-932 ! PC Japanese Shift JIS
|
||||
AIX.?.mime.~.?.HP-KANA8: X-HP-KANA8 ! HP Japanese Katakana8
|
||||
AIX.?.mime.~.?.EUC-KR: X-EUC-KR ! Korean EUC
|
||||
AIX.?.mime.~.?.ISO-2022-KR: ISO-2022-KR ! Korean with 7-bit encoding per ISO-2022-KR
|
||||
AIX.?.mime.~.?.EUC-CN: X-EUC-CN ! China Chinese EUC
|
||||
AIX.?.mime.~.?.ISO-2022-CN: ISO-2022-CN ! China Chinese with 7-bit encoding per ISO-2022-CN
|
||||
AIX.?.mime.~.?.HP-15CN: X-HP-15CN ! HP China Chinese EUC
|
||||
AIX.?.mime.~.?.EUC-TW: X-EUC-TW ! Taiwan Chinese EUC
|
||||
AIX.?.mime.~.?.ISO-2022-TW: ISO-2022-TW ! Taiwan Chinese with 7-bit encoding per ISO-2022-TW
|
||||
AIX.?.mime.~.?.HP-BIG5: X-HP-BIG5 ! HP Big5 Taiwan Chinese
|
||||
AIX.?.mime.~.?.HP-CCDC: X-HP-CCDC ! HP CCDC Taiwan Chinese
|
||||
AIX.?.mime.~.?.TIS-620: X-TIS-620 ! Thai
|
||||
AIX.?.mime.~.?.UCS-2: X-UCS-2 ! Unicode; group 0, plane 0 of ISO-10646
|
||||
AIX.?.mime.~.?.UCS-4: X-UCS-4 ! ISO-10646
|
||||
AIX.?.mime.~.?.UTF-7: X-UTF-7 ! multibyte encoding of Unicode
|
||||
AIX.?.mime.~.?.UTF-8: X-UTF-8 ! multibyte encoding of Unicode
|
||||
AIX.?.mime.~.?.UTF-16: X-UTF-16 ! multibyte encoding of Unicode
|
||||
|
||||
!! If other mailers are using other codeset identifiers in their MIME
|
||||
!! messages, dtmail will not be able to process them correctly.
|
||||
!! To correct this, additional .<. translations for these identifiers
|
||||
!! can be added to a <platform>.lcx file in the /etc/dt/config/svc
|
||||
!! or $HOME/.dt/config/svc directories. Such translations should read:
|
||||
!! <platform>.100+.mime.<.?.<CDE std codeset>: <mailer identifier for the codeset>
|
||||
!!
|
||||
!! ***NEVER*** use a .~. translation, such as we use above, as this could
|
||||
!! cause dtmail to send unexpected identifier strings by overriding the
|
||||
!! above definition. Further, never use .=. or .>. translations.
|
||||
!!
|
||||
!! These two identifiers are in common usage, as they derive from RFC1521.
|
||||
AIX.?.mime.<.?.ISO-8859-1: us-ascii ! ISO Latin 1
|
||||
AIX.?.mime.<.?.ISO-8859-1: US-ASCII ! ISO Latin 1
|
||||
2646
cde/lib/DtHelp/Access.c
Normal file
2646
cde/lib/DtHelp/Access.c
Normal file
File diff suppressed because it is too large
Load Diff
80
cde/lib/DtHelp/Access.h
Normal file
80
cde/lib/DtHelp/Access.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/* $XConsortium: Access.h /main/7 1995/12/18 16:29:36 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Access.h
|
||||
**
|
||||
** Project: Run Time Project File Access
|
||||
**
|
||||
** Description: Header file for Access.h
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpAccess_h
|
||||
#define _DtHelpAccess_h
|
||||
|
||||
/****************************************************************************
|
||||
* Public Defines
|
||||
****************************************************************************/
|
||||
#ifndef True
|
||||
#define True 1
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
#ifndef False
|
||||
#define False 0
|
||||
#endif
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
typedef void* _DtHelpVolumeHdl;
|
||||
|
||||
/****************************************************************************
|
||||
* Semi-Private Externals
|
||||
****************************************************************************/
|
||||
extern int _DtHelpCeCompressPathname ( char *basePath );
|
||||
extern char *_DtHelpCeTraceFilenamePath ( char *file_path );
|
||||
extern char *_DtHelpCeTracePathName ( char *path );
|
||||
|
||||
/****************************************************************************
|
||||
* Semi-Public Externals
|
||||
****************************************************************************/
|
||||
extern int _DtHelpCloseVolume (
|
||||
_DtHelpVolumeHdl vol );
|
||||
extern int _DtHelpCeFindId (
|
||||
_DtHelpVolumeHdl vol,
|
||||
char *target_id,
|
||||
int fd,
|
||||
char **ret_name,
|
||||
int *ret_offset );
|
||||
extern int _DtHelpCeFindKeyword (
|
||||
_DtHelpVolumeHdl vol,
|
||||
char *target,
|
||||
char ***ret_ids );
|
||||
extern int _DtHelpCeGetKeywordList (
|
||||
_DtHelpVolumeHdl vol,
|
||||
char ***ret_keywords );
|
||||
extern int _DtHelpCeGetTopTopicId (
|
||||
_DtHelpVolumeHdl vol,
|
||||
char **ret_idString );
|
||||
extern char *_DtHelpCeGetVolumeName(
|
||||
_DtHelpVolumeHdl vol);
|
||||
extern char *_DtHelpGetVolumeLocale (
|
||||
_DtHelpVolumeHdl volume);
|
||||
extern int _DtHelpOpenVolume (
|
||||
char *volFile,
|
||||
_DtHelpVolumeHdl*retVol );
|
||||
extern int _DtHelpCeUpVolumeOpenCnt (
|
||||
_DtHelpVolumeHdl volume);
|
||||
#endif /* _DtHelpAccess_h */
|
||||
1620
cde/lib/DtHelp/AccessCCDF.c
Normal file
1620
cde/lib/DtHelp/AccessCCDF.c
Normal file
File diff suppressed because it is too large
Load Diff
95
cde/lib/DtHelp/AccessCCDFI.h
Normal file
95
cde/lib/DtHelp/AccessCCDFI.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/* $XConsortium: AccessCCDFI.h /main/6 1995/12/18 16:29:46 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: AccessCCDFI.h
|
||||
**
|
||||
** Project: Run Time Project File Access
|
||||
**
|
||||
** Description: Header file for AccessCCDF.h
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpAccessCcdfI_h
|
||||
#define _DtHelpAccessCcdfI_h
|
||||
|
||||
/******************************************************************************
|
||||
* Resource Database Access Routines
|
||||
******************************************************************************/
|
||||
extern char *_DtHelpCeGetResourceString(
|
||||
XrmDatabase db,
|
||||
char *topic,
|
||||
char *res_class,
|
||||
char *res_name);
|
||||
extern char **_DtHelpCeGetResourceStringArray(
|
||||
XrmDatabase db,
|
||||
char *topic,
|
||||
char *res_class,
|
||||
char *res_name);
|
||||
|
||||
/******************************************************************************
|
||||
* CCDF Access Functions
|
||||
******************************************************************************/
|
||||
extern void _DtHelpCeCloseCcdfVolume(
|
||||
_DtHelpVolume vol);
|
||||
extern int _DtHelpCeFindCcdfId(
|
||||
_DtHelpVolume vol,
|
||||
char *target_id,
|
||||
char **ret_name,
|
||||
int *ret_offset);
|
||||
extern int _DtHelpCeGetCcdfDocStamp(
|
||||
_DtHelpVolume vol,
|
||||
char **ret_doc,
|
||||
char **ret_time);
|
||||
extern int _DtHelpCeFindCcdfKeyword(
|
||||
_DtHelpVolume vol,
|
||||
char *target_id,
|
||||
char ***ret_ids );
|
||||
extern int _DtHelpCeGetCcdfIdPath(
|
||||
_DtHelpVolume vol,
|
||||
char *target_id,
|
||||
char ***ret_ids );
|
||||
extern int _DtHelpCeGetCcdfKeywordList (
|
||||
_DtHelpVolume vol);
|
||||
extern int _DtHelpCeGetCcdfTopicChildren (
|
||||
_DtHelpVolume vol,
|
||||
char *topic_id,
|
||||
char ***retTopics);
|
||||
extern int _DtHelpCeGetCcdfTopicParent (
|
||||
_DtHelpVolume vol,
|
||||
char *topic_id,
|
||||
char **retTopics);
|
||||
extern int _DtHelpCeGetCcdfTopTopic (
|
||||
_DtHelpVolume vol,
|
||||
char **ret_topic);
|
||||
extern int _DtHelpCeGetCcdfVolIdList (
|
||||
_DtHelpVolume vol,
|
||||
char ***retTopics);
|
||||
extern char *_DtHelpCeGetCcdfVolLocale (
|
||||
_DtHelpVolume vol);
|
||||
extern char *_DtHelpCeGetCcdfVolTitle(
|
||||
_DtHelpVolume vol);
|
||||
extern int _DtHelpCeGetCcdfVolumeAbstract (
|
||||
_DtHelpVolume vol,
|
||||
char **ret_abs);
|
||||
extern int _DtHelpCeGetCcdfVolumeTitle(
|
||||
_DtHelpVolume vol,
|
||||
char **ret_title);
|
||||
extern int _DtHelpCeMapCcdfTargetToId (
|
||||
_DtHelpVolume vol,
|
||||
const char *target_id,
|
||||
char **ret_id);
|
||||
extern int _DtHelpCeOpenCcdfVolume (
|
||||
_DtHelpVolume vol);
|
||||
extern int _DtHelpCeRereadCcdfVolume (
|
||||
_DtHelpVolume vol);
|
||||
#endif /* _DtHelpAccessCcdfI_h */
|
||||
49
cde/lib/DtHelp/AccessCCDFP.h
Normal file
49
cde/lib/DtHelp/AccessCCDFP.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* $XConsortium: AccessCCDFP.h /main/4 1995/12/18 16:29:51 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: AccessCCDFP.h
|
||||
**
|
||||
** Project: Run Time Project File Access
|
||||
**
|
||||
**
|
||||
** Description: Private header file for AccessCCDFP.h
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtAccessCcdfP_h
|
||||
#define _DtAccessCcdfP_h
|
||||
|
||||
/*
|
||||
* The following structure holds loaded volumes. The fields of this
|
||||
* structure should not be accessed by any code outside of the volume
|
||||
* module.
|
||||
*/
|
||||
struct _CcdfVolumeInfo {
|
||||
XrmDatabase volDb; /* A pointer to the Resource Manager */
|
||||
/* database that was loaded from the */
|
||||
/* volume file. */
|
||||
|
||||
char **topicList; /* A pointer to a string array containing */
|
||||
/* the locationIDs for all of the topics */
|
||||
/* in the volume. This array is not created */
|
||||
/* until the first time it is needed. */
|
||||
|
||||
char *keywordFile; /* A pointer to the name of the keyword */
|
||||
/* file. This name is generated by */
|
||||
/* adding "k" to the end of volFile. */
|
||||
/* This filename is not generated until */
|
||||
/* the first time it is needed. */
|
||||
};
|
||||
|
||||
typedef struct _CcdfVolumeInfo *CcdfVolumePtr;
|
||||
|
||||
#endif /* _DtAccessCcdfP_h */
|
||||
117
cde/lib/DtHelp/AccessI.h
Normal file
117
cde/lib/DtHelp/AccessI.h
Normal file
@@ -0,0 +1,117 @@
|
||||
/* $XConsortium: AccessI.h /main/7 1995/12/18 16:29:56 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: AccessI.h
|
||||
**
|
||||
** Project: Run Time Project File Access
|
||||
**
|
||||
** Description: Header file for Access.h
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpAccessI_h
|
||||
#define _DtHelpAccessI_h
|
||||
|
||||
|
||||
#ifndef _XtIntrinsic_h
|
||||
/*
|
||||
* typedef Boolean
|
||||
*/
|
||||
#ifdef CRAY
|
||||
typedef long Boolean;
|
||||
#else
|
||||
typedef char Boolean;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _XLIB_H_
|
||||
#ifndef True
|
||||
#define True 1
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
#ifndef False
|
||||
#define False 0
|
||||
#endif
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
* Semi-Public Structures
|
||||
******************************************************************************/
|
||||
typedef struct {
|
||||
char match;
|
||||
char *substitution;
|
||||
} _DtSubstitutionRec;
|
||||
|
||||
typedef struct _dtHelpCeLockInfo {
|
||||
int fd;
|
||||
_DtHelpVolumeHdl volume;
|
||||
} _DtHelpCeLockInfo;
|
||||
|
||||
/******************************************************************************
|
||||
* Semi-Public Access Functions
|
||||
******************************************************************************/
|
||||
extern char *_DtHelpCeExpandPathname (
|
||||
char *spec,
|
||||
char *filename,
|
||||
char *type,
|
||||
char *suffix,
|
||||
char *lang,
|
||||
_DtSubstitutionRec *subs,
|
||||
int num );
|
||||
extern int _DtHelpCeFileOpenAndSeek(
|
||||
char *filename,
|
||||
int offset,
|
||||
int fd,
|
||||
BufFilePtr *ret_file,
|
||||
time_t *ret_time);
|
||||
extern int _DtHelpCeGetDocStamp (
|
||||
_DtHelpVolumeHdl volume,
|
||||
char **ret_doc,
|
||||
char **ret_time);
|
||||
extern int _DtHelpCeGetLangSubParts (
|
||||
char *lang,
|
||||
char **subLang,
|
||||
char **subTer,
|
||||
char **subCodeSet );
|
||||
extern int _DtHelpCeGetTopicChildren(
|
||||
_DtHelpVolumeHdl volume,
|
||||
char *topic_id,
|
||||
char ***ret_childs);
|
||||
extern int _DtHelpGetTopicTitle(
|
||||
_DtHelpVolumeHdl volume,
|
||||
char *target_id,
|
||||
char **ret_title);
|
||||
extern int _DtHelpCeGetUncompressedFileName (
|
||||
char *name,
|
||||
char **ret_name);
|
||||
extern const char *_DtHelpCeGetVolumeCharSet (
|
||||
_DtHelpVolumeHdl volume);
|
||||
extern int _DtHelpCeGetVolumeFlag (
|
||||
_DtHelpVolumeHdl volume);
|
||||
extern int _DtHelpCeIsTopTopic(
|
||||
_DtHelpVolumeHdl volume,
|
||||
const char *id);
|
||||
extern int _DtHelpCeLockVolume(
|
||||
_DtHelpVolumeHdl volume,
|
||||
_DtHelpCeLockInfo *ret_info);
|
||||
extern int _DtHelpCeMapTargetToId (
|
||||
_DtHelpVolumeHdl volume,
|
||||
char *target_id,
|
||||
char **ret_id);
|
||||
extern int _DtHelpCeUnlockVolume(_DtHelpCeLockInfo lock_info);
|
||||
#endif /* _DtHelpAccessI_h */
|
||||
67
cde/lib/DtHelp/AccessP.h
Normal file
67
cde/lib/DtHelp/AccessP.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/* $XConsortium: AccessP.h /main/5 1995/12/18 16:30:01 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: AccessP.h
|
||||
**
|
||||
** Project: Run Time Project File Access
|
||||
**
|
||||
**
|
||||
** Description: Private header file for Access.h
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtAccessP_h
|
||||
#define _DtAccessP_h
|
||||
|
||||
#include <sys/stat.h>
|
||||
typedef void* SdlVolumeHandle;
|
||||
typedef void* CcdfVolumeHandle;
|
||||
|
||||
typedef union _dthelpVolumes {
|
||||
SdlVolumeHandle sdl_vol;
|
||||
CcdfVolumeHandle ccdf_vol;
|
||||
} DtHelpVols;
|
||||
|
||||
/*
|
||||
* The following structure holds loaded volumes. The fields of this
|
||||
* structure should not be accessed by any code outside of the volume
|
||||
* module.
|
||||
*/
|
||||
struct _DtHelpVolumeRec {
|
||||
short sdl_flag; /* The type of volume */
|
||||
char *volFile; /* The name of the volume file in the */
|
||||
/* form it was passed to _DtVolumeOpen. */
|
||||
|
||||
char **keywords; /* A pointer to a string array */
|
||||
/* containing all of the keywords in */
|
||||
/* sorted order. This field is not loaded */
|
||||
/* until it is needed. */
|
||||
|
||||
char ***keywordTopics; /* A pointer to an array of string */
|
||||
/* arrays. Each string array specifies */
|
||||
/* the list of topics which contain the */
|
||||
/* corresponding keyword. This field is */
|
||||
/* not loaded until it is needed. */
|
||||
|
||||
DtHelpVols vols; /* Handles to format specific volume info */
|
||||
int openCount; /* A count of the number of times this */
|
||||
/* volume has been opened. */
|
||||
|
||||
time_t check_time; /* Time this volume was last modified */
|
||||
struct _DtHelpVolumeRec *nextVol;
|
||||
/* A pointer to the next volume, used to */
|
||||
/* chain all of the open volumes together. */
|
||||
};
|
||||
|
||||
typedef struct _DtHelpVolumeRec *_DtHelpVolume;
|
||||
|
||||
#endif /* _DtAccessP_h */
|
||||
1432
cde/lib/DtHelp/AccessSDL.c
Normal file
1432
cde/lib/DtHelp/AccessSDL.c
Normal file
File diff suppressed because it is too large
Load Diff
80
cde/lib/DtHelp/AccessSDLI.h
Normal file
80
cde/lib/DtHelp/AccessSDLI.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/* $XConsortium: AccessSDLI.h /main/6 1995/12/18 16:30:06 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: AccessSDLI.h
|
||||
**
|
||||
** Project: Run Time Project File Access
|
||||
**
|
||||
** Description: Header file for Access.h
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpAccessSDLI_h
|
||||
#define _DtHelpAccessSDLI_h
|
||||
|
||||
/****************************************************************************
|
||||
* Semi-Private Routines
|
||||
****************************************************************************/
|
||||
extern void _DtHelpCeCleanSdlVolume(
|
||||
_DtHelpVolumeHdl volume );
|
||||
extern void _DtHelpCeCloseSdlVolume (
|
||||
_DtHelpVolumeHdl volume);
|
||||
extern int _DtHelpCeFindSdlId (
|
||||
_DtHelpVolumeHdl vol,
|
||||
char *target_id,
|
||||
int fd,
|
||||
char **ret_name,
|
||||
int *ret_offset );
|
||||
extern int _DtHelpCeGetSdlDocStamp (
|
||||
_DtHelpVolumeHdl volume,
|
||||
char **ret_doc,
|
||||
char **ret_time);
|
||||
extern char *_DtHelpCeGetSdlHomeTopicId (_DtHelpVolumeHdl vol);
|
||||
extern int _DtHelpCeGetSdlIdPath (
|
||||
_DtHelpVolumeHdl volume,
|
||||
char *target_id,
|
||||
char ***ret_ids);
|
||||
extern _DtCvSegment *_DtHelpCeMapSdlIdToElement(
|
||||
_DtHelpVolumeHdl vol,
|
||||
char *target_id,
|
||||
int fd);
|
||||
extern int _DtHelpCeGetSdlKeywordList (
|
||||
_DtHelpVolumeHdl volume);
|
||||
extern int _DtHelpCeGetSdlTopicChildren(
|
||||
_DtHelpVolumeHdl volume,
|
||||
char *target_id,
|
||||
char ***ret_ids);
|
||||
extern const char *_DtHelpCeGetSdlVolCharSet (
|
||||
_DtHelpVolumeHdl volume);
|
||||
extern char *_DtHelpCeGetSdlVolLanguage (
|
||||
_DtHelpVolumeHdl volume);
|
||||
extern char *_DtHelpCeGetSdlVolumeAsciiAbstract (
|
||||
_DtHelpVolumeHdl volume);
|
||||
extern char *_DtHelpCeGetSdlVolumeLocale (
|
||||
_DtHelpVolumeHdl volume);
|
||||
extern CESDLVolume *_DtHelpCeGetSdlVolumePtr(
|
||||
_DtHelpVolumeHdl volume );
|
||||
extern _DtCvSegment *_DtHelpCeMapSdlIdToSegment(
|
||||
_DtHelpVolumeHdl vol,
|
||||
const char *target_id,
|
||||
int fd);
|
||||
extern void _DtHelpCeInitSdlVolume(
|
||||
_DtHelpVolumeHdl volume );
|
||||
extern int _DtHelpCeMapIdToSdlTopicId(
|
||||
_DtHelpVolumeHdl vol,
|
||||
const char *target_id,
|
||||
char **ret_id);
|
||||
extern int _DtHelpCeOpenSdlVolume(
|
||||
_DtHelpVolumeHdl volume );
|
||||
extern int _DtHelpCeRereadSdlVolume(
|
||||
_DtHelpVolumeHdl volume );
|
||||
#endif /* _DtHelpAccessSDLI_h */
|
||||
291
cde/lib/DtHelp/AccessSDLP.h
Normal file
291
cde/lib/DtHelp/AccessSDLP.h
Normal file
@@ -0,0 +1,291 @@
|
||||
/* $XConsortium: AccessSDLP.h /main/7 1995/12/18 16:30:11 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: AccessSDLP.h
|
||||
**
|
||||
** Project: Run Time Project File Access
|
||||
**
|
||||
** Description: Header file for Access.h
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpAccessSDLP_h
|
||||
#define _DtHelpAccessSDLP_h
|
||||
|
||||
#include "CanvasSegP.h"
|
||||
#include "SDLI.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Structure
|
||||
****************************************************************************/
|
||||
/*
|
||||
* The following structure holds the sdl document specific information
|
||||
*/
|
||||
typedef struct _sdlDocInfo {
|
||||
char *language;
|
||||
char *char_set;
|
||||
char *first_pg;
|
||||
char *doc_id;
|
||||
char *timestamp;
|
||||
char *sdldtd;
|
||||
} SDLDocInfo;
|
||||
|
||||
/*
|
||||
* The following structure holds the id specific information
|
||||
*/
|
||||
typedef struct _sdlIdInfo {
|
||||
SdlOption type;
|
||||
char *rssi;
|
||||
int rlevel;
|
||||
int offset;
|
||||
} SDLIdInfo;
|
||||
|
||||
/*
|
||||
* The following structure holds the toss style specific information
|
||||
*/
|
||||
typedef struct _sdlTossInfo {
|
||||
unsigned long enum_values;
|
||||
unsigned long num_values;
|
||||
unsigned long str1_values;
|
||||
unsigned long str2_values;
|
||||
|
||||
enum SdlElement el_type;
|
||||
SdlOption clan;
|
||||
char *ssi;
|
||||
union
|
||||
{
|
||||
char *str;
|
||||
char *colj;
|
||||
char *enter;
|
||||
} str1;
|
||||
union
|
||||
{
|
||||
char *str;
|
||||
char *colw;
|
||||
char *exit;
|
||||
} str2;
|
||||
int rlevel;
|
||||
_DtHelpFontHints font_specs;
|
||||
} SDLTossInfo;
|
||||
|
||||
/*
|
||||
* The following structure holds the entry or index specific strings
|
||||
*/
|
||||
typedef struct _sdlEntryInfo {
|
||||
char *main;
|
||||
char *locs;
|
||||
char *syns;
|
||||
char *sort;
|
||||
} SDLEntryInfo;
|
||||
|
||||
/*
|
||||
* The following structure holds loaded volumes. The fields of this
|
||||
* structure should not be accessed by any code outside of the volume
|
||||
* module.
|
||||
*/
|
||||
typedef struct _sdlVolume {
|
||||
SDLDocInfo *sdl_info; /* A pointer to the SDL doc info */
|
||||
_DtCvSegment *toss; /* A pointer to the Table of Styles */
|
||||
/* and Semantics withing the volume */
|
||||
_DtCvSegment *loids; /* A pointer to the List of Ids */
|
||||
_DtCvSegment *index; /* A pointer to the List of Keywords */
|
||||
_DtCvSegment *title; /* A pointer to the document head */
|
||||
_DtCvSegment *snb; /* A pointer to the document's snb */
|
||||
_DtCvPointer client_data; /* data that must be used to free the title
|
||||
and snb */
|
||||
void (*destroy_region)(); /* The destroy region routine specified
|
||||
when the title was read */
|
||||
short minor_no; /* The minor number of the sdl version */
|
||||
short title_processed; /* If the title has already been searched for */
|
||||
|
||||
} CESDLVolume;
|
||||
|
||||
/****************************************************************************
|
||||
* Private Macros
|
||||
****************************************************************************/
|
||||
/*********************/
|
||||
/* SDLDocInfo macros */
|
||||
/*********************/
|
||||
|
||||
#ifndef _SdlDocInfoPtrCharSet
|
||||
#define _SdlDocInfoPtrCharSet(x) ((x)->char_set)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlDocInfoPtrDocId
|
||||
#define _SdlDocInfoPtrDocId(x) ((x)->doc_id)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlDocInfoPtrFirstPg
|
||||
#define _SdlDocInfoPtrFirstPg(x) ((x)->first_pg)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlDocInfoPtrLanguage
|
||||
#define _SdlDocInfoPtrLanguage(x) ((x)->language)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlDocInfoPtrSdlDtd
|
||||
#define _SdlDocInfoPtrSdlDtd(x) ((x)->sdldtd)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlDocInfoPtrStamp
|
||||
#define _SdlDocInfoPtrStamp(x) ((x)->timestamp)
|
||||
#endif
|
||||
|
||||
/***********************/
|
||||
/* SDLEntryInfo macros */
|
||||
/***********************/
|
||||
|
||||
#ifndef _SdlSegEntryInfo
|
||||
#define _SdlSegEntryInfo(x) ((FrmtPrivInfoPtr(x))->entry)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlSegToSdlEntryInfo
|
||||
#define _SdlSegToSdlEntryInfo(x) ((SDLEntryInfo *) _SdlSegEntryInfo(x))
|
||||
#endif
|
||||
|
||||
/********************/
|
||||
/* SDLIdInfo macros */
|
||||
/********************/
|
||||
|
||||
#ifndef _SdlIdInfoPtrOffset
|
||||
#define _SdlIdInfoPtrOffset(x) ((x)->offset)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlIdInfoPtrRlevel
|
||||
#define _SdlIdInfoPtrRlevel(x) ((x)->rlevel)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlIdInfoPtrRssi
|
||||
#define _SdlIdInfoPtrRssi(x) ((x)->rssi)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlIdInfoPtrType
|
||||
#define _SdlIdInfoPtrType(x) ((x)->type)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlSegToSdlIdInfoPtr
|
||||
#define _SdlSegToSdlIdInfoPtr(x) \
|
||||
((SDLIdInfo *)((FrmtPrivInfoPtr(x))->id_info))
|
||||
#endif
|
||||
|
||||
#ifndef _SdlSegToSdlIdInfoRssi
|
||||
#define _SdlSegToSdlIdInfoRssi(x) \
|
||||
(((SDLIdInfo *)((FrmtPrivInfoPtr(x))->id_info))->rssi)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlSegToSdlIdInfoType
|
||||
#define _SdlSegToSdlIdInfoType(x) \
|
||||
(((SDLIdInfo *)((FrmtPrivInfoPtr(x))->id_info))->type)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlSegToSdlIdInfoLevel
|
||||
#define _SdlSegToSdlIdInfoLevel(x) \
|
||||
(((SDLIdInfo *)((FrmtPrivInfoPtr(x))->id_info))->rlevel)
|
||||
#endif
|
||||
|
||||
/**********************/
|
||||
/* SDLTossInfo macros */
|
||||
/**********************/
|
||||
|
||||
#ifndef _SdlTossInfoPtrFlag1
|
||||
#define _SdlTossInfoPtrFlag1(x) ((x)->enum_values)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrFlag2
|
||||
#define _SdlTossInfoPtrFlag2(x) ((x)->num_values)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrFlag3
|
||||
#define _SdlTossInfoPtrFlag3(x) ((x)->str1_values)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrFlag4
|
||||
#define _SdlTossInfoPtrFlag4(x) ((x)->str2_values)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrEnter
|
||||
#define _SdlTossInfoPtrEnter(x) ((x)->str1.enter)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrExit
|
||||
#define _SdlTossInfoPtrExit(x) ((x)->str2.exit)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrColJ
|
||||
#define _SdlTossInfoPtrColJ(x) ((x)->str1.colj)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrColW
|
||||
#define _SdlTossInfoPtrColW(x) ((x)->str2.colw)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrRlevel
|
||||
#define _SdlTossInfoPtrRlevel(x) ((x)->rlevel)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrStr1
|
||||
#define _SdlTossInfoPtrStr1(x) ((x)->str1.str)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrStr2
|
||||
#define _SdlTossInfoPtrStr2(x) ((x)->str2.str)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrSsi
|
||||
#define _SdlTossInfoPtrSsi(x) ((x)->ssi)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrFontSpecs
|
||||
#define _SdlTossInfoPtrFontSpecs(x) ((x)->font_specs)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrClan
|
||||
#define _SdlTossInfoPtrClan(x) ((x)->clan)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlTossInfoPtrType
|
||||
#define _SdlTossInfoPtrType(x) ((x)->el_type)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlSegTossInfo
|
||||
#define _SdlSegTossInfo(x) ((FrmtPrivInfoPtr(x))->toss)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlSegPtrToTossInfo
|
||||
#define _SdlSegPtrToTossInfo(x) ((SDLTossInfo *) _SdlSegTossInfo(x))
|
||||
#endif
|
||||
|
||||
#ifndef _SdlSegPtrToTossType
|
||||
#define _SdlSegPtrToTossType(x) ((_SdlSegPtrToTossInfo(x))->el_type)
|
||||
#endif
|
||||
|
||||
/*****************/
|
||||
/* Volume macros */
|
||||
/*****************/
|
||||
|
||||
#ifndef _SdlVolumeMinorNumber
|
||||
#define _SdlVolumeMinorNumber(x) ((x)->minor_no)
|
||||
#endif
|
||||
|
||||
/*******************/
|
||||
/* Language macros */
|
||||
/*******************/
|
||||
|
||||
#ifndef _SdlSegLangChar
|
||||
#define _SdlSegLangChar(x) ((FrmtPrivInfoPtr(x))->lang_char)
|
||||
#endif
|
||||
|
||||
#ifndef _SdlSegPtrToLangChar
|
||||
#define _SdlSegPtrToLangChar(x) ((char **)_SdlSegLangChar(x))
|
||||
#endif
|
||||
|
||||
#endif /* _DtHelpAccessSDLP_h */
|
||||
427
cde/lib/DtHelp/Actions.c
Normal file
427
cde/lib/DtHelp/Actions.c
Normal file
@@ -0,0 +1,427 @@
|
||||
/* $XConsortium: Actions.c /main/8 1996/10/30 10:03:40 pascale $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Actions.c
|
||||
**
|
||||
** Project: Display Area Library
|
||||
**
|
||||
** Description: This body of code handles the actions for the
|
||||
** Display Area.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/*
|
||||
* system includes
|
||||
*/
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
/*
|
||||
* CanvasEngine
|
||||
*/
|
||||
#include "CanvasP.h"
|
||||
|
||||
/*
|
||||
* private includes
|
||||
*/
|
||||
#include "DisplayAreaP.h"
|
||||
#include "DisplayAreaI.h"
|
||||
#include "ActionsI.h"
|
||||
#include "CallbacksI.h"
|
||||
|
||||
#ifdef NLS16
|
||||
#endif
|
||||
|
||||
/******** Private Function Declarations ********/
|
||||
/******** End Private Function Declarations ********/
|
||||
|
||||
/******** End Private Defines ********/
|
||||
|
||||
/******** Private Variable Declarations ********/
|
||||
|
||||
/******** End Private Variable Declarations ********/
|
||||
|
||||
/******************************************************************************
|
||||
* Private Functions
|
||||
******************************************************************************/
|
||||
/******************************************************************************
|
||||
* Semi Public Functions
|
||||
*****************************************************************************/
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpCopyAction
|
||||
*
|
||||
* _DtHelpCopyAction - Copy the current info to the clipboard
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpCopyAction (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params)
|
||||
{
|
||||
Arg args[2];
|
||||
XtPointer userData;
|
||||
|
||||
XtSetArg(args[0], XmNuserData, &userData);
|
||||
XtGetValues(widget, args, 1);
|
||||
|
||||
_DtHelpInitiateClipboard(userData);;
|
||||
|
||||
} /* End _DtHelpCopyAction */
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpDeSelectAll
|
||||
*
|
||||
* _DtHelpDeSelectAll - Deselects the information in the widget.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpDeSelectAll (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params)
|
||||
{
|
||||
Arg args[2];
|
||||
XtPointer userData;
|
||||
|
||||
XtSetArg(args[0], XmNuserData, &userData);
|
||||
XtGetValues(widget, args, 1);
|
||||
|
||||
if (userData != NULL)
|
||||
_DtHelpClearSelection (userData);
|
||||
|
||||
} /* End _DtHelpDeSelectAll */
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpSelectAll
|
||||
*
|
||||
* _DtHelpSelectAll - Selects all the information in the widget.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpSelectAll (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params)
|
||||
{
|
||||
Arg args[2];
|
||||
XtPointer userData;
|
||||
|
||||
XtSetArg(args[0], XmNuserData, &userData);
|
||||
XtGetValues(widget, args, 1);
|
||||
|
||||
if (userData != NULL)
|
||||
{
|
||||
DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) userData;
|
||||
|
||||
_DtCanvasMoveTraversal(pDAS->canvas, _DtCvTRAVERSAL_OFF, False, True,
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
_DtHelpGetClearSelection (widget, userData);
|
||||
_DtCanvasProcessSelection(pDAS->canvas, 0, 0, _DtCvSELECTION_START);
|
||||
_DtCanvasProcessSelection(pDAS->canvas, pDAS->dispUseWidth,
|
||||
pDAS->maxYpos, _DtCvSELECTION_END);
|
||||
_DtCanvasMoveTraversal(pDAS->canvas, _DtCvTRAVERSAL_ON, False, True,
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
pDAS->text_selected = True;
|
||||
}
|
||||
|
||||
} /* End _DtHelpSelectAll */
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpActivateLink
|
||||
*
|
||||
* _DtHelpSelectAll - Selects all the information in the widget.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpActivateLink (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params)
|
||||
{
|
||||
Arg args[2];
|
||||
DtHelpDispAreaStruct *pDAS;
|
||||
_DtCvLinkInfo ceHyper;
|
||||
DtHelpHyperTextStruct callData;
|
||||
|
||||
XtSetArg(args[0], XmNuserData, &pDAS);
|
||||
XtGetValues(widget, args, 1);
|
||||
|
||||
if (pDAS == NULL)
|
||||
return;
|
||||
|
||||
if (! pDAS->dtinfo)
|
||||
{
|
||||
if (_DtCvSTATUS_OK == _DtCanvasGetCurLink(pDAS->canvas, &ceHyper))
|
||||
{
|
||||
callData.reason = XmCR_ACTIVATE;
|
||||
callData.event = event;
|
||||
callData.window = XtWindow (pDAS->dispWid);
|
||||
callData.specification = ceHyper.specification;
|
||||
callData.hyper_type = ceHyper.hyper_type;
|
||||
callData.window_hint = ceHyper.win_hint;
|
||||
(*(pDAS->hyperCall)) (pDAS, pDAS->clientData, &callData);
|
||||
}
|
||||
}
|
||||
else /* dtinfo context */
|
||||
{
|
||||
_DtCvPointer mark_enclosure = NULL;
|
||||
|
||||
_DtCvStatus status;
|
||||
|
||||
status = _DtCanvasGetCurTraversal(pDAS->canvas, &ceHyper,
|
||||
&mark_enclosure);
|
||||
|
||||
if (status == _DtCvSTATUS_LINK)
|
||||
{
|
||||
callData.reason = XmCR_ACTIVATE;
|
||||
callData.event = event;
|
||||
callData.window = XtWindow (pDAS->dispWid);
|
||||
callData.specification = ceHyper.specification;
|
||||
callData.hyper_type = ceHyper.hyper_type;
|
||||
callData.window_hint = ceHyper.win_hint;
|
||||
(*(pDAS->hyperCall)) (pDAS, pDAS->clientData, &callData);
|
||||
}
|
||||
else if (status == _DtCvSTATUS_MARK)
|
||||
{
|
||||
callData.reason = XmCR_ACTIVATE;
|
||||
callData.event = event;
|
||||
callData.window = XtWindow (pDAS->dispWid);
|
||||
callData.specification = mark_enclosure;
|
||||
callData.hyper_type = -1; /* signifies it's a mark */
|
||||
callData.window_hint = 0;
|
||||
(*(pDAS->hyperCall)) (pDAS, pDAS->clientData, &callData);
|
||||
}
|
||||
|
||||
/* otherwise do nothing */
|
||||
}
|
||||
|
||||
} /* End _DtHelpActivateLink */
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpPageUpOrDown
|
||||
*
|
||||
* _DtHelpPageUpOrDown - Selects all the information in the widget.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpPageUpOrDown (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params)
|
||||
{
|
||||
int keyPressed;
|
||||
_DtCvUnit newY;
|
||||
_DtCvUnit diff;
|
||||
Arg args[2];
|
||||
XtPointer userData;
|
||||
|
||||
XtSetArg(args[0], XmNuserData, &userData);
|
||||
XtGetValues(widget, args, 1);
|
||||
|
||||
if (userData != NULL)
|
||||
{
|
||||
DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) userData;
|
||||
|
||||
diff = pDAS->dispUseHeight - pDAS->lineHeight;
|
||||
|
||||
keyPressed = atoi(*params);
|
||||
if (keyPressed == 0)
|
||||
diff = -diff;
|
||||
|
||||
newY = pDAS->firstVisible + diff;
|
||||
|
||||
/*
|
||||
* Is the new Y position too large?
|
||||
* If so, adjust.
|
||||
*/
|
||||
if (newY + ((int)pDAS->dispUseHeight) > pDAS->maxYpos)
|
||||
newY = pDAS->maxYpos - pDAS->dispUseHeight;
|
||||
|
||||
/*
|
||||
* Is the new Y before the begining?
|
||||
* If so, zero it.
|
||||
*/
|
||||
if (newY < 0)
|
||||
newY = 0;
|
||||
|
||||
if (newY != pDAS->firstVisible)
|
||||
{
|
||||
pDAS->firstVisible = newY;
|
||||
XtSetArg(args[0], XmNvalue, newY);
|
||||
XtSetValues (pDAS->vertScrollWid, args, 1);
|
||||
|
||||
if (pDAS->vScrollNotify)
|
||||
(pDAS->vScrollNotify)(pDAS->clientData, pDAS->firstVisible);
|
||||
|
||||
_DtHelpCleanAndDrawWholeCanvas (userData);
|
||||
}
|
||||
}
|
||||
|
||||
} /* End _DtHelpPageUpOrDown */
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpPageLeftOrRight
|
||||
*
|
||||
* _DtHelpPageLeftOrRight - Selects all the information in the widget.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpPageLeftOrRight (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params)
|
||||
{
|
||||
int keyPressed;
|
||||
_DtCvUnit newX;
|
||||
_DtCvUnit diff;
|
||||
Arg args[2];
|
||||
XtPointer userData;
|
||||
|
||||
XtSetArg(args[0], XmNuserData, &userData);
|
||||
XtGetValues(widget, args, 1);
|
||||
|
||||
if (userData != NULL)
|
||||
{
|
||||
DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) userData;
|
||||
|
||||
diff = pDAS->dispUseWidth - ((int) pDAS->charWidth / 10);
|
||||
|
||||
keyPressed = atoi(*params);
|
||||
if (keyPressed == 0)
|
||||
diff = -diff;
|
||||
|
||||
newX = pDAS->virtualX + diff;
|
||||
|
||||
/*
|
||||
* Is the new X position too large?
|
||||
* If so, adjust.
|
||||
*/
|
||||
if (newX + ((int)pDAS->dispUseWidth) > pDAS->maxX)
|
||||
newX = pDAS->maxX - pDAS->dispUseWidth;
|
||||
|
||||
/*
|
||||
* Is the new X before the begining?
|
||||
* If so, zero it.
|
||||
*/
|
||||
if (newX < 0)
|
||||
newX = 0;
|
||||
|
||||
if (newX != pDAS->virtualX)
|
||||
{
|
||||
pDAS->virtualX = newX;
|
||||
XtSetArg(args[0], XmNvalue, newX);
|
||||
XtSetValues (pDAS->horzScrollWid, args, 1);
|
||||
|
||||
_DtHelpCleanAndDrawWholeCanvas (userData);
|
||||
}
|
||||
}
|
||||
|
||||
} /* End _DtHelpPageLeftOrRight */
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpNextLink
|
||||
*
|
||||
* _DtHelpNextLink - Moves the traversal to the requested hypertext link.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpNextLink (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params)
|
||||
{
|
||||
_DtCvTraversalCmd cmd = _DtCvTRAVERSAL_NEXT;
|
||||
_DtCvUnit diff;
|
||||
_DtCvUnit newY;
|
||||
_DtCvUnit newX;
|
||||
_DtCvUnit height;
|
||||
_DtCvUnit top;
|
||||
Arg args[2];
|
||||
XtPointer userData;
|
||||
|
||||
XtSetArg(args[0], XmNuserData, &userData);
|
||||
XtGetValues(widget, args, 1);
|
||||
|
||||
if (userData != NULL)
|
||||
{
|
||||
DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) userData;
|
||||
|
||||
switch(atoi(*params))
|
||||
{
|
||||
case 0: cmd = _DtCvTRAVERSAL_PREV;
|
||||
break;
|
||||
case 2: cmd = _DtCvTRAVERSAL_TOP;
|
||||
break;
|
||||
case 3: cmd = _DtCvTRAVERSAL_BOTTOM;
|
||||
break;
|
||||
}
|
||||
|
||||
if (_DtCvSTATUS_OK == _DtCanvasMoveTraversal(pDAS->canvas, cmd, False,
|
||||
(XtIsRealized(pDAS->dispWid) ? True : False),
|
||||
NULL, &newX, &newY, NULL, &height))
|
||||
{
|
||||
/*
|
||||
* take into account our traversal indicator
|
||||
*/
|
||||
newY -= pDAS->lineThickness;
|
||||
height += (2 * pDAS->lineThickness);
|
||||
|
||||
top = pDAS->firstVisible;
|
||||
diff = ((int) pDAS->dispUseHeight) * 2 / 3;
|
||||
if (newY < top)
|
||||
{
|
||||
top = newY;
|
||||
if (cmd == _DtCvTRAVERSAL_TOP && newY <= diff)
|
||||
top = 0;
|
||||
}
|
||||
else if (newY + height > top + ((int) pDAS->dispUseHeight))
|
||||
{
|
||||
top = newY + height - ((int) pDAS->dispUseHeight);
|
||||
if (cmd == _DtCvTRAVERSAL_BOTTOM &&
|
||||
newY >= (pDAS->maxYpos - diff))
|
||||
top = pDAS->maxYpos - pDAS->dispUseHeight;
|
||||
}
|
||||
|
||||
if (top != pDAS->firstVisible)
|
||||
{
|
||||
pDAS->firstVisible = top;
|
||||
|
||||
if (top + ((int)pDAS->dispUseHeight) > pDAS->maxYpos)
|
||||
{
|
||||
pDAS->firstVisible = pDAS->maxYpos - pDAS->dispUseHeight;
|
||||
if (pDAS->firstVisible < 0)
|
||||
pDAS->firstVisible = 0;
|
||||
}
|
||||
|
||||
XtSetArg (args[0], XmNvalue, pDAS->firstVisible);
|
||||
XtSetValues (pDAS->vertScrollWid, args, 1);
|
||||
|
||||
if (pDAS->vScrollNotify)
|
||||
(pDAS->vScrollNotify)(pDAS->clientData, pDAS->firstVisible);
|
||||
|
||||
/*
|
||||
* re-draw the information
|
||||
*/
|
||||
_DtHelpCleanAndDrawWholeCanvas (userData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} /* End _DtHelpNextLink */
|
||||
68
cde/lib/DtHelp/ActionsI.h
Normal file
68
cde/lib/DtHelp/ActionsI.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* $XConsortium: ActionsI.h /main/5 1995/12/08 13:00:31 cde-hal $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: ActionsI.h
|
||||
**
|
||||
** Project: Display area routines
|
||||
**
|
||||
** Description: Header file for Actions.c
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpActionsI_h
|
||||
#define _DtHelpActionsI_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*****************************************************************************
|
||||
* Semi Public Routines
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpActivateLink (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params);
|
||||
extern void _DtHelpCopyAction (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params);
|
||||
extern void _DtHelpDeSelectAll (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params);
|
||||
extern void _DtHelpNextLink (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params);
|
||||
extern void _DtHelpPageLeftOrRight (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params);
|
||||
extern void _DtHelpPageUpOrDown (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params);
|
||||
extern void _DtHelpSelectAll (
|
||||
Widget widget,
|
||||
XEvent *event,
|
||||
String *params,
|
||||
Cardinal *num_params);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _DtHelpActionsI_h */
|
||||
345
cde/lib/DtHelp/AsciiSpc.c
Normal file
345
cde/lib/DtHelp/AsciiSpc.c
Normal file
@@ -0,0 +1,345 @@
|
||||
/* $TOG: AsciiSpc.c /main/6 1999/02/24 12:04:30 mgreess $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: AsciiSpc.c
|
||||
**
|
||||
** Project: Cde Help Library
|
||||
**
|
||||
** Description: This file resolves an <spc> spec into an ascii
|
||||
** representation of the special character.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/*
|
||||
* system includes
|
||||
*/
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* private includes
|
||||
*/
|
||||
#include "AsciiSpcI.h"
|
||||
|
||||
#ifdef NLS16
|
||||
#endif
|
||||
|
||||
/******** Private Function Declarations ********/
|
||||
|
||||
/******** End Public Function Declarations ********/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private variables and defines.
|
||||
*
|
||||
*****************************************************************************/
|
||||
typedef struct {
|
||||
const char *symbol;
|
||||
const char *spc_string;
|
||||
} SpecialSymbolTable;
|
||||
|
||||
|
||||
static SpecialSymbolTable SpcTable[] =
|
||||
{
|
||||
/*
|
||||
* comment out the entries that map to a blank.
|
||||
* The last entry will catch them and map them to a blank
|
||||
* anyway. This will shorten the table by quite a bit.
|
||||
*/
|
||||
/*{"[aacute]", " " }, /*ISOlat1, small a, acute accent */
|
||||
/*{"[acirc ]", " " }, /*ISOlat1, small a, circumflex */
|
||||
/*{"[aelig ]", " " }, /*ISOlat1, small ae diphthong */
|
||||
/*{"[agrave]", " " }, /*ISOlat1, small a, grave accent */
|
||||
/*{"[alpha ]", " " }, /*ISOgrk3, Greek, small alpha */
|
||||
/*{"[aleph ]", " " }, /*ISOtech, aleph, Hebrews */
|
||||
{"[amp ]", "&" }, /*ISOnum , ampersand */
|
||||
{"[and ]", "^" }, /*ISOtech, wedge, logical and */
|
||||
/*{"[ang ]", " " }, /*ISOamso, angle */
|
||||
/*{"[angst ]", " " }, /*ISOtech, Angstrom, cap A, ring */
|
||||
{"[ap ]", "~=" }, /*ISOtech, approximately equal */
|
||||
{"[apos ]", "'" }, /*ISOnum , apostrophe */
|
||||
/*{"[aring ]", " " }, /*ISOlat1, small a, ring */
|
||||
{"[ast ]", "*" }, /*ISOnum , asterisk */
|
||||
/*{"[atilde]", " " }, /*ISOlat1, small a, tilde */
|
||||
/*{"[auml ]", " " }, /*ISOlat1, small a, umlaut mark */
|
||||
/*{"[beta ]", " " }, /*ISOgrk3, Greek, small beta */
|
||||
/*{"[blank ]", " " }, /*ISOpub , significant blank */
|
||||
/*{"[bottom]", " " }, /*ISOtech, bottom symbol */
|
||||
{"[bsol ]", "\\" }, /*ISOnum , backslash, rev solidus*/
|
||||
{"[bull ]", "*" }, /*ISOpub , round bullet,filled */
|
||||
/*{"[brvbar]", "|" }, /*ISOnum , broken vertical bar */
|
||||
/*{"[cap ]", " " }, /*ISOtech, intersection */
|
||||
/*{"[ccedil]", " " }, /*ISOlat1, small c, cedilla */
|
||||
/*{"[cent ]", " " }, /*ISOnum , cent sign */
|
||||
/*{"[chi ]", " " }, /*ISOgrk3, Greek, small chi */
|
||||
/*{"[clubs ]", " " }, /*ISOpub , clubs suit symbol */
|
||||
{"[colon ]", ":" }, /*ISOnum , colon */
|
||||
{"[comma ]", "," }, /*ISOnum , comma */
|
||||
{"[commat]", "@" }, /*ISOnum , commercial at */
|
||||
/*{"[cong ]", " " }, /*ISOtech, congruent with */
|
||||
/*{"[copy ]", " " }, /*ISOnum , copyright symbol */
|
||||
{"[cup ]", "U" }, /*ISOtech, union or logical sum */
|
||||
/*{"[curren]", " " }, /*ISOnum , general currency sign */
|
||||
/*{"[darr ]", " " }, /*ISOnum , downward arrow */
|
||||
/*{"[dArr ]", " " }, /*ISOamsa, down double arrow */
|
||||
{"[dash ]", "-" }, /*ISOpub , dash */
|
||||
/*{"[deg ]", " " }, /*ISOnum , degree sign */
|
||||
/*{"[delta ]", " " }, /*ISOgrk3, Greek, small delta */
|
||||
/*{"[diams ]", " " }, /*ISOpub , diamond suit symbol */
|
||||
{"[divide]", "/" }, /*ISOnum , divide sign */
|
||||
{"[dollar]", "$" }, /*ISOnum , dollar sign */
|
||||
/*{"[eacute]", " " }, /*ISOlat1, small e, acute accent */
|
||||
/*{"[ecirc ]", " " }, /*ISOlat1, small e, circumflex */
|
||||
/*{"[egrave]", " " }, /*ISOlat1, small e, grave accent */
|
||||
/*{"[empty ]", " " }, /*ISOamso, empty string, o/slash */
|
||||
/*{"[epsiv ]", " " }, /*ISOgrk3, Greek,sm epsilon, var */
|
||||
{"[equals]", "=" }, /*ISOnum , equals sign */
|
||||
/*{"[equiv ]", " " }, /*ISOtech, identical with */
|
||||
/*{"[eta ]", " " }, /*ISOgrk3, Greek, small eta */
|
||||
/*{"[eth ]", " " }, /*ISOlat1, small eth, Icelandic */
|
||||
/*{"[euml ]", " " }, /*ISOlat1, small e, umlaut mark */
|
||||
{"[excl ]", "!" }, /*ISOnum , exclamation mark */
|
||||
/*{"[exist ]", " " }, /*ISOtech, at least one exists */
|
||||
/*{"[forall]", " " }, /*ISOtech, for all */
|
||||
{"[frac12]", "1/2" }, /*ISOnum , fraction one-half */
|
||||
{"[frac13]", "1/3" }, /*ISOnum , fraction one-third */
|
||||
{"[frac14]", "1/4" }, /*ISOnum , fraction one-quarter */
|
||||
{"[frac15]", "1/5" }, /*ISOnum , fraction one-fifth */
|
||||
{"[frac16]", "1/6" }, /*ISOnum , fraction one-sixth */
|
||||
{"[frac18]", "1/8" }, /*ISOnum , fraction one-eight */
|
||||
{"[frac23]", "2/3" }, /*ISOnum , fraction two-thirds */
|
||||
{"[frac25]", "2/5" }, /*ISOnum , fraction two-fifths */
|
||||
{"[frac34]", "3/4" }, /*ISOnum , fraction three-quarter*/
|
||||
{"[frac35]", "3/5" }, /*ISOnum , fraction three-fifths */
|
||||
{"[frac38]", "3/8" }, /*ISOnum , fraction three-eights */
|
||||
{"[frac45]", "4/5" }, /*ISOnum , fraction four-fifths */
|
||||
{"[frac56]", "5/6" }, /*ISOnum , fraction five-sixths */
|
||||
{"[frac58]", "5/8" }, /*ISOnum , fraction five-eights */
|
||||
{"[frac78]", "7/8" }, /*ISOnum , fraction seven-eights */
|
||||
/*{"[gamma ]", " " }, /*ISOgrk3, Greek, small gamma */
|
||||
{"[ge ]", ">=" }, /*ISOtech, greater-than-or-equal */
|
||||
{"[gt ]", ">" }, /*ISOnum , greater than sign */
|
||||
{"[half ]", "1/2" }, /*ISOnum , fraction one-half */
|
||||
{"[harr ]", "<-->" }, /*ISOamsa, left & right arrow */
|
||||
{"[hArr ]", "<<==>>" }, /*ISOamsa, l & r double arrow */
|
||||
/*{"[hearts]", " " }, /*ISOpub , hearts suit symbol */
|
||||
{"[hellip]", "..." }, /*ISOpub , ellipsis(horizontal) */
|
||||
{"[horbar]", "--" }, /*ISOnum , horizontal bar */
|
||||
{"[hyphen]", "-" }, /*ISOnum , hyphen */
|
||||
/*{"[iacute]", " " }, /*ISOlat1, small i, acute accent */
|
||||
/*{"[icirc ]", " " }, /*ISOlat1, small i, circumflex */
|
||||
/*{"[iexcl ]", " " }, /*ISOnum , inverted ! mark */
|
||||
/*{"[igrave]", " " }, /*ISOlat1, small i, grave accent */
|
||||
/*{"[image ]", " " }, /*ISOamso,imaginary number symbol*/
|
||||
/*{"[infin ]", " " }, /*ISOtech, infinity */
|
||||
/*{"[int ]", " " }, /*ISOtech, intergral operator */
|
||||
/*{"[iota ]", " " }, /*ISOgrk3, Greek, small iota */
|
||||
/*{"[iquest]", " " }, /*ISOnum , inverted ? mark */
|
||||
/*{"[isin ]", " " }, /*ISOtech, set membership */
|
||||
/*{"[iuml ]", " " }, /*ISOlat1, small i, umlaut mark */
|
||||
/*{"[kappa ]", " " }, /*ISOgrk3, Greek, small kappa */
|
||||
/*{"[lambda]", " " }, /*ISOgrk3, Greek, small lambda */
|
||||
/*{"[lang ]", " " }, /*ISOtech, left angle bracket */
|
||||
{"[laquo ]", "<<" }, /*ISOnum , left angle quotation */
|
||||
{"[larr ]", "<--" }, /*ISOnum , leftward arrow */
|
||||
{"[lArr ]", "<==" }, /*ISOtech, is implied by */
|
||||
{"[lcub ]", "{" }, /*ISOnum , left curly brace */
|
||||
{"[ldquo ]", "\"" }, /*ISOnum , left double quote */
|
||||
{"[le ]", "=<" }, /*ISOtech, less-than-or-equal */
|
||||
{"[lowbar]", "_" }, /*ISOnum , low line */
|
||||
{"[lpar ]", "(" }, /*ISOnum , left parenthesis */
|
||||
{"[lsqb ]", "[" }, /*ISOnum , left square bracket */
|
||||
{"[lsquo ]", "`" }, /*ISOnum , left single quote */
|
||||
{"[lsquor]", "," }, /*ISOnum,rising single quote(low)*/
|
||||
{"[lt ]", "<" }, /*ISOnum , less-than sign */
|
||||
{"[mdash ]", "--" }, /*ISOpub , em dash(long dash) */
|
||||
/*{"[micro ]", " " }, /*ISOnum , micro */
|
||||
/*{"[middot]", " " }, /*ISOnum , middle dot */
|
||||
{"[minus ]", "-" }, /*ISOtech, minus sign */
|
||||
{"[mldr ]", "...." }, /*ISOpub , em leader */
|
||||
{"[mnplus]", "-/+" }, /*ISOtech, minus-or-plus sign */
|
||||
/*{"[mu ]", " " }, /*ISOgrk3, Greek, small mu */
|
||||
/*{"[nabla ]", " " }, /*ISOtech, del, Hamilton operator*/
|
||||
{"[nbsp ]", " " }, /*ISOnum , no break space */
|
||||
{"[ndash ]", "-" }, /*ISOpub , en dash(short dash) */
|
||||
{"[ne ]", "!=" }, /*ISOtech, not equal */
|
||||
/*{"[ni ]", " " }, /*ISOtech, contains */
|
||||
{"[nldr ]", ".." }, /*ISOpub , double baseline dot */
|
||||
/*{"[not ]", " " }, /*ISOnum , not */
|
||||
/*{"[notin ]", " " }, /*ISOtech, negated set membership*/
|
||||
/*{"[ntilde]", " " }, /*ISOlat1, small N, tilde */
|
||||
/*{"[nu ]", " " }, /*ISOgrk3, Greek, small nu */
|
||||
{"[num ]", "#" }, /*ISOnum , number sign */
|
||||
/*{"[oacute]", " " }, /*ISOlat1, small o, acute accent */
|
||||
/*{"[ocirc ]", " " }, /*ISOlat1, small o, circumflex */
|
||||
/*{"[ograve]", " " }, /*ISOlat1, small o, grave accent */
|
||||
/*{"[ohm ]", " " }, /*ISOnum , ohm */
|
||||
/*{"[omega ]", " " }, /*ISOgrk3, Greek, small omega */
|
||||
/*{"[oplus ]", " " }, /*ISOamsb, plus sign in circle */
|
||||
{"[or ]", "V" }, /*ISOtech, vee, logical or */
|
||||
/*{"[ordf ]", " " }, /*ISOnum , ordinal indicator, fem*/
|
||||
/*{"[ordm ]", " " }, /*ISOnum , ordinal indicator,male*/
|
||||
/*{"[oslash]", " " }, /*ISOlat1, small o, slash */
|
||||
/*{"[osol ]", " " }, /*ISOamsb, slash in circle */
|
||||
/*{"[otilde]", " " }, /*ISOlat1, small o, tilde */
|
||||
/*{"[otimes]", " " }, /*ISOamsb,multiply sign in circle*/
|
||||
/*{"[ouml ]", " " }, /*ISOlat1, small o, umlaut mark */
|
||||
/*{"[over ]", " " }, /*made up, over symbol */
|
||||
{"[par ]", "||" }, /*ISOtech, parallel */
|
||||
/*{"[para ]", " " }, /*ISOnum , paragraph sign */
|
||||
/*{"[part ]", " " }, /*ISOtech, partial differential */
|
||||
{"[percnt]", "%" }, /*ISOnum , percent sign */
|
||||
{"[period]", "." }, /*ISOnum , full stop, period */
|
||||
/*{"[perp ]", " " }, /*ISOtech, perpendicular */
|
||||
/*{"[phis ]", " " }, /*ISOgrk3, Greek, small phi */
|
||||
/*{"[pi ]", " " }, /*ISOgrk3, Greek, small pi */
|
||||
/*{"[piv ]", " " }, /*ISOgrk3, Greek, small pi, var */
|
||||
{"[plus ]", "+" }, /*ISOnum , plus sign */
|
||||
{"[plusmn]", "+/-" }, /*ISOnum , plus or minus sign */
|
||||
{"[pound ]", "#" }, /*ISOnum , pound sign */
|
||||
{"[prime ]", "\'" }, /*ISOtech, prime or minute */
|
||||
/*{"[prop ]", " " }, /*ISOtech, proportional to */
|
||||
/*{"[psi ]", " " }, /*ISOgrk3, Greek, small psi */
|
||||
{"[quest ]", "?" }, /*ISOnum , question mark */
|
||||
{"[quot ]", "'" }, /*ISOnum , quote mark */
|
||||
/*{"[radic ]", " " }, /*ISOtech, radical */
|
||||
/*{"[rang ]", " " }, /*ISOtech, right angle bracket */
|
||||
{"[raquo ]", ">>" }, /*ISOnum , right angle quotation */
|
||||
{"[rarr ]", "-->" }, /*ISOnum , rightward arrow */
|
||||
{"[rArr ]", "==>>" }, /*ISOtech, right double arrow */
|
||||
{"[rcub ]", "}" }, /*ISOnum , right curly brace */
|
||||
{"[rdquo ]", "\"" }, /*ISOnum , right double quote */
|
||||
/*{"[real ]", " " }, /*ISOamso, real number symbol */
|
||||
/*{"[reg ]", " " }, /*ISOnum,circledR,registered sign*/
|
||||
/*{"[rho ]", " " }, /*ISOgrk3, Greek, small rho */
|
||||
{"[rpar ]", ")" }, /*ISOnum , right parenthesis */
|
||||
{"[rsqb ]", "]" }, /*ISOnum , right square bracket */
|
||||
{"[rsquo ]", "'" }, /*ISOnum , right single quote */
|
||||
/*{"[sect ]", " " }, /*ISOnum , section sign */
|
||||
{"[semi ]", ";" }, /*ISOnum , semicolon */
|
||||
{"[shy ]", "-" }, /*ISOnum , soft hypen */
|
||||
/*{"[sigma ]", " " }, /*ISOgrk3, Greek, small sigma */
|
||||
{"[sim ]", "~" }, /*ISOtech, similar to */
|
||||
{"[sime ]", "~=" }, /*ISOtech, similar, equals */
|
||||
{"[sol ]", "/" }, /*ISOnum , solidus */
|
||||
/*{"[spades]", " " }, /*ISOpub , spades suit symbol */
|
||||
/*{"[sub ]", " " }, /*ISOtech, subset/is implied by */
|
||||
/*{"[sung ]", " " }, /*ISOnum , musical note(sung txt)*/
|
||||
/*{"[sube ]", " " }, /*ISOtech, subset, equals */
|
||||
/*{"[sup ]", " " }, /*ISOtech, superset or implies */
|
||||
/*{"[sup1 ]", " " }, /*ISOnum , superscript one */
|
||||
/*{"[sup2 ]", " " }, /*ISOnum , superscript two */
|
||||
/*{"[sup3 ]", " " }, /*ISOnum , superscript three */
|
||||
/*{"[supe ]", " " }, /*ISOtech, superset, equals */
|
||||
/*{"[szlig ]", " " }, /*ISOlat1, small sharp s, German */
|
||||
/*{"[tau ]", " " }, /*ISOgrk3, Greek, small tau */
|
||||
/*{"[there4]", " " }, /*ISOtech, therefore */
|
||||
/*{"[thetas]", " " }, /*ISOgrk3, Greek, small theta */
|
||||
/*{"[thetav]", " " }, /*ISOgrk3, Greek, small theta,var*/
|
||||
/*{"[thorn ]", " " }, /*ISOlat1, small thorn, Icelandic*/
|
||||
{"[times ]", "x" }, /*ISOnum , multipy sign */
|
||||
{"[tprime]", "'''" }, /*ISOtech, triple prime */
|
||||
/*{"[trade ]", " " }, /*ISOnum , trade mark sign */
|
||||
/*{"[uacute]", " " }, /*ISOlat1, small u, acute accent */
|
||||
/*{"[ucirc ]", " " }, /*ISOlat1, small u, circumflex */
|
||||
/*{"[ugrave]", " " }, /*ISOlat1, small u, grave accent */
|
||||
/*{"[uarr ]", " " }, /*ISOnum , upward arrow */
|
||||
/*{"[uArr ]", " " }, /*ISOamsa, up double arrow */
|
||||
/*{"[upsi ]", " " }, /*ISOgrk3, Greek, small upsilon */
|
||||
/*{"[uuml ]", " " }, /*ISOlat1, small u, umlaut mark */
|
||||
{"[vellip]", ".\n.\n.\n" }, /*ISOpub , vertical ellipsis */
|
||||
{"[verbar]", "|" }, /*ISOnum , vertical bar */
|
||||
/*{"[weierp]", " " }, /*ISOamso, Weierstrass p */
|
||||
/*{"[xi ]", " " }, /*ISOgrk3, Greek, small xi */
|
||||
/*{"[yacute]", " " }, /*ISOlat1, small y, acute accent */
|
||||
/*{"[yen ]", " " }, /*ISOnum , yen sign */
|
||||
/*{"[yuml ]", " " }, /*ISOlat1, small y, umlaut mark */
|
||||
/*{"[zeta ]", " " }, /*ISOgrk3, Greek, small zeta */
|
||||
/*{"[Aacute]", " " }, /*ISOlat1, capital a,acute accent*/
|
||||
/*{"[Acirc ]", " " }, /*ISOlat1, capital a,circumflex */
|
||||
/*{"[AElig ]", " " }, /*ISOlat1, capital ae diphthong */
|
||||
/*{"[Agrave]", " " }, /*ISOlat1, capital a,grave accent*/
|
||||
/*{"[Aring ]", " " }, /*ISOlat1, capital a,ring */
|
||||
/*{"[Atilde]", " " }, /*ISOlat1, capital a,tilde */
|
||||
/*{"[Auml ]", " " }, /*ISOlat1, capital a,umlaut mark */
|
||||
/*{"[Ccedil]", " " }, /*ISOlat1, capital c, cedilla */
|
||||
/*{"[Delta ]", " " }, /*ISOgrk3, Greek, large delta */
|
||||
/*{"[Dot ]", " " }, /*ISOtech, dieresis or umlaut mrk*/
|
||||
/*{"[DotDot]", " " }, /*ISOtech, four dots above */
|
||||
/*{"[Eacute]", " " }, /*ISOlat1, capital E,acute accent*/
|
||||
/*{"[Ecirc ]", " " }, /*ISOlat1, capital E,circumflex */
|
||||
/*{"[Egrave]", " " }, /*ISOlat1, capital E,grave accent*/
|
||||
/*{"[ETH ]", " " }, /*ISOlat1, capital Eth, Icelandic*/
|
||||
/*{"[Euml ]", " " }, /*ISOlat1, capital E,umlaut mark */
|
||||
/*{"[Gamma ]", " " }, /*ISOgrk3, Greek, large gamma */
|
||||
/*{"[Iacute]", " " }, /*ISOlat1, capital I,acute accent*/
|
||||
/*{"[Icirc ]", " " }, /*ISOlat1, capital I,circumflex */
|
||||
/*{"[Igrave]", " " }, /*ISOlat1, capital I,grave accent*/
|
||||
/*{"[Iuml ]", " " }, /*ISOlat1, capital I,umlaut mark */
|
||||
/*{"[Lambda]", " " }, /*ISOgrk3, Greek, large lambda */
|
||||
/*{"[Ntilde]", " " }, /*ISOlat1, capital N, tilde */
|
||||
/*{"[Oacute]", " " }, /*ISOlat1, capital O,acute accent*/
|
||||
/*{"[Ocirc ]", " " }, /*ISOlat1, capital O,circumflex */
|
||||
/*{"[Ograve]", " " }, /*ISOlat1, capital O,grave accent*/
|
||||
/*{"[Omega ]", " " }, /*ISOgrk3, Greek, large omega */
|
||||
/*{"[Oslash]", " " }, /*ISOlat1, capital O, slash */
|
||||
/*{"[Otilde]", " " }, /*ISOlat1, capital O, tilde */
|
||||
/*{"[Ouml ]", " " }, /*ISOlat1, capital O,umlaut mark */
|
||||
/*{"[Pi ]", " " }, /*ISOgrk3, Greek, large pi */
|
||||
{"[Prime ]", "\"" }, /*ISOtech, double prime/second */
|
||||
/*{"[Phi ]", " " }, /*ISOgrk3, Greek, large phi */
|
||||
/*{"[Psi ]", " " }, /*ISOgrk3, Greek, large psi */
|
||||
/*{"[Sigma ]", " " }, /*ISOgrk3, Greek, large sigma */
|
||||
/*{"[Theta ]", " " }, /*ISOgrk3, Greek, large theta */
|
||||
/*{"[THORN ]", " " }, /*ISOlat1,capital THORN,Icelandic*/
|
||||
/*{"[Uacute]", " " }, /*ISOgrk3, Greek, large theta */
|
||||
/*{"[Ucirc ]", " " }, /*ISOlat1, capital U,acute accent*/
|
||||
/*{"[Ugrave]", " " }, /*ISOlat1, capital U,circumflex */
|
||||
/*{"[Upsi ]", " " }, /*ISOgrk3, Greek, large upsilon */
|
||||
/*{"[Uuml ]", " " }, /*ISOlat1, capital U,umlaut mark */
|
||||
{"[Verbar]", "||" }, /*ISOtech, dbl vertical bar */
|
||||
/*{"[Xi ]", " " }, /*ISOgrk3, Greek, large xi */
|
||||
/*{"[Yacute]", " " }, /*ISOlat1, capital Y,acute accent*/
|
||||
{ NULL , " " }, /* default character to use */
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Semi Public functions
|
||||
*
|
||||
******************************************************************************/
|
||||
/*****************************************************************************
|
||||
* Function: const char *_DtHelpCeResolveSpcToAscii ();
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Returns:
|
||||
*
|
||||
* Purpose:
|
||||
*
|
||||
*****************************************************************************/
|
||||
const char *
|
||||
_DtHelpCeResolveSpcToAscii (
|
||||
const char *spc_symbol)
|
||||
{
|
||||
register int i = 0;
|
||||
|
||||
if (NULL == spc_symbol)
|
||||
return NULL;
|
||||
|
||||
while (NULL != SpcTable[i].symbol &&
|
||||
0 != strcmp(SpcTable[i].symbol, spc_symbol))
|
||||
i++;
|
||||
|
||||
if (SpcTable[i].symbol != NULL)
|
||||
return (SpcTable[i].spc_string);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
45
cde/lib/DtHelp/AsciiSpcI.h
Normal file
45
cde/lib/DtHelp/AsciiSpcI.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* $XConsortium: AsciiSpcI.h /main/4 1995/10/26 12:17:10 rswiston $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: AsciiSpcI.h
|
||||
**
|
||||
** Project:
|
||||
**
|
||||
** Description: Public Header file for AsciiSpc.c
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
#ifndef _DtHelpAsciiSpc_h
|
||||
#define _DtHelpAsciiSpc_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******** Public Defines Declarations ********/
|
||||
|
||||
/******** Public Typedef Declarations ********/
|
||||
|
||||
/******** Public Structures Declarations ********/
|
||||
|
||||
/******** Public Macro Declarations ********/
|
||||
|
||||
/******** Semi-Private Function Declarations ********/
|
||||
extern const char *_DtHelpCeResolveSpcToAscii(
|
||||
const char *spc_symbol);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _DtHelpAsciiSpc_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
1706
cde/lib/DtHelp/CCDFUtil.c
Normal file
1706
cde/lib/DtHelp/CCDFUtil.c
Normal file
File diff suppressed because it is too large
Load Diff
130
cde/lib/DtHelp/CCDFUtilI.h
Normal file
130
cde/lib/DtHelp/CCDFUtilI.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/* $XConsortium: CCDFUtilI.h /main/5 1995/10/26 12:17:26 rswiston $ */
|
||||
/*************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: CCDFUtilI.h
|
||||
**
|
||||
** Project: Un*x Desktop Help
|
||||
**
|
||||
** Description: Header file for CCDFUtil.c
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _CECCDFUtilI_h
|
||||
#define _CECCDFUtilI_h
|
||||
|
||||
/*****************************************************************************
|
||||
* Parsing flags and macros
|
||||
*****************************************************************************/
|
||||
#define CCDF_ABBREV_CMD (1 << 0)
|
||||
#define CCDF_FIGURE_CMD (1 << 1)
|
||||
#define CCDF_FONT_CMD (1 << 2)
|
||||
#define CCDF_FORMAT_END (1 << 3)
|
||||
#define CCDF_GRAPHIC_CMD (1 << 4)
|
||||
#define CCDF_ID_CMD (1 << 5)
|
||||
#define CCDF_LABEL_CMD (1 << 6)
|
||||
#define CCDF_LINK_CMD (1 << 7)
|
||||
#define CCDF_NEWLINE_CMD (1 << 8)
|
||||
#define CCDF_OCTAL_CMD (1 << 9)
|
||||
#define CCDF_PARAGRAPH_CMD (1 << 10)
|
||||
#define CCDF_TITLE_CMD (1 << 11)
|
||||
#define CCDF_TOPIC_CMD (1 << 12)
|
||||
|
||||
#define CCDF_NO_CMDS 0
|
||||
#define CCDF_ALL_CMDS ~(0)
|
||||
#define CCDF_ALLOW_CMD(x, y) ((x) & (y))
|
||||
#define CCDF_NOT_ALLOW_CMD(x, y) ((~(x)) & (y))
|
||||
|
||||
/****************************************************************************
|
||||
* Semi Public Routines
|
||||
****************************************************************************/
|
||||
extern int _DtHelpCeGetCcdfAbbrevCmd(
|
||||
BufFilePtr in_file,
|
||||
char *in_buf,
|
||||
int in_size,
|
||||
int cur_mb_len,
|
||||
char **in_ptr,
|
||||
char **ret_string);
|
||||
extern int _DtHelpCeSkipCcdfAbbrev(
|
||||
BufFilePtr in_file,
|
||||
char *in_buf,
|
||||
char **in_ptr,
|
||||
int in_size,
|
||||
int cur_mb_len);
|
||||
extern int _DtHelpCeCheckNextCcdfCmd(
|
||||
char *token,
|
||||
BufFilePtr in_file,
|
||||
char *in_buf,
|
||||
int in_size,
|
||||
int cur_mb_len,
|
||||
char **in_ptr);
|
||||
extern int _DtHelpCeGetCcdfEndMark(
|
||||
BufFilePtr file,
|
||||
char *buffer,
|
||||
char **buf_ptr,
|
||||
int buf_size,
|
||||
int cur_mb_len);
|
||||
extern int _DtHelpCeGetCcdfFontType(
|
||||
char *code);
|
||||
extern int _DtHelpCeGetCcdfValueParam(
|
||||
BufFilePtr in_file,
|
||||
char *in_buf,
|
||||
int in_size,
|
||||
char **in_ptr,
|
||||
_DtCvValue flag,
|
||||
int cur_mb_len,
|
||||
int *ret_value);
|
||||
extern int _DtHelpCeGetCcdfStrParam(
|
||||
BufFilePtr in_file,
|
||||
char *in_buf,
|
||||
int in_size,
|
||||
int cur_mb_len,
|
||||
char **in_ptr,
|
||||
_DtCvValue flag,
|
||||
_DtCvValue eat_escape,
|
||||
_DtCvValue ignore_quotes,
|
||||
_DtCvValue less_test,
|
||||
char **ret_string);
|
||||
extern int _DtHelpCeGetCcdfTopicAbbrev(
|
||||
void *dpy,
|
||||
BufFilePtr in_file,
|
||||
char *in_buf,
|
||||
char **in_ptr,
|
||||
int in_size,
|
||||
int cur_mb_len,
|
||||
char **ret_title,
|
||||
char **ret_charSet,
|
||||
char **ret_abbrev);
|
||||
extern int _DtHelpCeGetCcdfTopicCmd(
|
||||
void *dpy,
|
||||
BufFilePtr in_file,
|
||||
char *in_buf,
|
||||
char **in_ptr,
|
||||
int in_size,
|
||||
int cur_mb_len,
|
||||
char **ret_charSet);
|
||||
extern int _DtHelpCeGetCcdfCmd(
|
||||
int current,
|
||||
char *in_buf,
|
||||
char **in_ptr,
|
||||
BufFilePtr in_file,
|
||||
int size,
|
||||
int allowed);
|
||||
extern int _DtHelpCeSkipToNextCcdfToken(
|
||||
BufFilePtr in_file,
|
||||
char *in_buf,
|
||||
int in_size,
|
||||
int cur_mb_len,
|
||||
char **in_ptr,
|
||||
_DtCvValue flag );
|
||||
|
||||
#endif /* _CECCDFUtilI_h */
|
||||
544
cde/lib/DtHelp/CDE.lcx
Normal file
544
cde/lib/DtHelp/CDE.lcx
Normal file
@@ -0,0 +1,544 @@
|
||||
!!!!!!!!!!!!!! CDE Standard Lang_Terr and Codeset Strings !!!!!!!!!!!!!!
|
||||
! File: CDE.lcx
|
||||
! Default location: /usr/dt/config/svc/CDE.lcx
|
||||
! Purpose:
|
||||
! Define the CDE standard set of locale-related strings.
|
||||
! Description:
|
||||
! This file contains the set of all locale-related strings that
|
||||
! may result from a _DtLcxXlateOpToStd() call on any platform,
|
||||
! anywhere. Note that platform-specific tables may include
|
||||
! more than one translation to and from CDE standard strings
|
||||
! if they can be distinguished by version, operation, or
|
||||
! pattern matching, but that no new CDE standard strings are
|
||||
! present in platform-specific tables.
|
||||
!
|
||||
! The strings are organized as a table in format useful to
|
||||
! _DtLcx. This allows a developer to query both a platform-
|
||||
! specific table and this standard table as part of a
|
||||
! _DtLcxXlateOpToStd() sequence, enabling the op-specific
|
||||
! value to infact have already been translated to a CDE
|
||||
! standard value.
|
||||
!
|
||||
! It is important that additional CDE standard strings only
|
||||
! be created by the CDE owner of the _DtLcx translation service
|
||||
! and NOT be created by an individual vendor. This be because
|
||||
! the purpose of adopting a set of CDE standard strings is to
|
||||
! support interoperability across platforms. If individual vendors
|
||||
! add their own "standard" strings and these strings are not
|
||||
! known on other platforms, then the goal of interoperability
|
||||
! will be defeated.
|
||||
!
|
||||
! If you feel that a new CDE standard string is needed,
|
||||
! contact your CDE representative/vendor with a specific
|
||||
! proposal and justification and have them forward it to
|
||||
! the owner of the CDE _DtLcx service.
|
||||
!
|
||||
! Note that it is allowed for vendors and users to add new
|
||||
! operations for which translations are specified and which
|
||||
! utilize the standard strings. If the operations are of
|
||||
! general utility, please bring them to the attention of
|
||||
! your CDE representative/vendor for forwarding to the
|
||||
! _DtLcx owner.
|
||||
! Invoked by:
|
||||
! This table is used by the _DtLcx translation service
|
||||
! Product: @(#)CDE1
|
||||
! Revision: $XConsortium: CDE.lcx /main/4 1996/07/03 11:09:44 mgreess $
|
||||
! Defects:
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!! Unified List of Language and Territory abbreviations
|
||||
!!! Update: February 15, 1995
|
||||
!!!
|
||||
!!! Name Language,Territory
|
||||
!!! ------ ---------------------
|
||||
!!! C Standards compliance
|
||||
!!! POSIX Standards compliance
|
||||
!!!
|
||||
!!! /* W European/Americas */
|
||||
!!! ca_ES Catalan, Spain
|
||||
!!! da_DK Danish, Denmark
|
||||
!!! de_AT German, Austria
|
||||
!!! de_CH German, Switzerland
|
||||
!!! de_DE German, Germany
|
||||
!!! en_AU English, Australia
|
||||
!!! en_CA English, Canada
|
||||
!!! en_DK English, Denmark
|
||||
!!! en_GB English, U.K.
|
||||
!!! en_IE English, Ireland
|
||||
!!! en_MY English, Malaysia
|
||||
!!! en_NZ English, New Zealand
|
||||
!!! en_US English, USA
|
||||
!!! es_AR Spanish, Argentina
|
||||
!!! es_BO Spanish, Bolivia
|
||||
!!! es_CL Spanish, Chile
|
||||
!!! es_CO Spanish, Columbia
|
||||
!!! es_CR Spanish, Costa Rica
|
||||
!!! es_EC Spanish, Ecuador
|
||||
!!! es_ES Spanish, Spain
|
||||
!!! es_GT Spanish, Guatemala
|
||||
!!! es_MX Spanish, Mexico
|
||||
!!! es_PE Spanish, Peru
|
||||
!!! es_UY Spanish, Uruguay
|
||||
!!! es_VE Spanish, Venezuela
|
||||
!!! et_EE Estonian, Estonia
|
||||
!!! fi_FI Finnish, Finland
|
||||
!!! fo_FO Faroese, Faeroe Island
|
||||
!!! fr_BE French, Belgium
|
||||
!!! fr_CA French, Canada
|
||||
!!! fr_CH French, Switzerland
|
||||
!!! fr_FR French, France
|
||||
!!! is_IS Icelandic, Iceland
|
||||
!!! it_CH Italian, Switzerland
|
||||
!!! it_IT Italian, Italy
|
||||
!!! kl_GL Greenlandic, Greenland
|
||||
!!! lt_LT Lithuanian, Lithuania
|
||||
!!! lv_LV Latvian, Latvia
|
||||
!!! nl_BE Dutch, Belgium
|
||||
!!! nl_NL Dutch, The Netherlands
|
||||
!!! no_NO Norwegian, Norway
|
||||
!!! pt_BR Portuguese, Brazil
|
||||
!!! pt_PT Portuguese, Portugal
|
||||
!!! sv_FI Swedish, Finland
|
||||
!!! sv_SE Swedish, Sweden
|
||||
!!!
|
||||
!!! /* E European */
|
||||
!!! cs_CS (1) Czech
|
||||
!!! hr_HR Croatian, Croatia
|
||||
!!! hu_HU Hungarian, Hungry
|
||||
!!! pl_PL Polish, Poland
|
||||
!!! ro_RO Rumanian, Romania
|
||||
!!! sh_YU (1) Serbocroatian, Yugoslavia
|
||||
!!! si_CS (1) Slovenian
|
||||
!!! si_SI (1) Slovenian
|
||||
!!! sk_SK Slovak
|
||||
!!!
|
||||
!!! /* Cyrillic */
|
||||
!!! bg_BG Bulgarian, Bulgaria
|
||||
!!! mk_MK Macedonian
|
||||
!!! ru_RU (1) Russian
|
||||
!!! ru_SU (1) Russian
|
||||
!!! sp_YU (1) Serbian, Yugoslavia
|
||||
!!!
|
||||
!!! /* Arabic */
|
||||
!!! ar_SA (2) Arabic
|
||||
!!! ar_DZ (2) Arabic
|
||||
!!!
|
||||
!!! /* Hebrew */
|
||||
!!! iw_IL Hebrew, Israel
|
||||
!!!
|
||||
!!! /* Greek */
|
||||
!!! el_GR Greek, Greece
|
||||
!!!
|
||||
!!! /* Turkish */
|
||||
!!! tr_TR Turkish, Turkey
|
||||
!!!
|
||||
!!! /* East Asia */
|
||||
!!! ja_JP Japanese, Japan
|
||||
!!! ko_KR Korean, Korea
|
||||
!!! zh_CN Chinese, China
|
||||
!!! zh_TW Chinese, Taiwan
|
||||
!!!
|
||||
!!! /* Thai */
|
||||
!!! th_TH Thai, Thailand
|
||||
!!!
|
||||
!!! ================================================================
|
||||
!!! NOTES:
|
||||
!!!
|
||||
!!! 1> These territory names may be subject to change
|
||||
!!!
|
||||
!!! 2> No ISO "territory" name exists for the Arabic-speaking regions of the
|
||||
!!! world as a whole. Vendors have sometimes supplied their own.
|
||||
!!!
|
||||
!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!!! Unified List of Common Codeset Names
|
||||
!!! Update: February 16, 1995
|
||||
!!!
|
||||
!!! Name Codeset
|
||||
!!! ------ --------------
|
||||
!!! ! W European/Americas,
|
||||
!!! ISO-8859-1 ISO Latin 1
|
||||
!!! HP-ROMAN8 HP Roman8
|
||||
!!! IBM-437 PC (US): IBM PC Code Page 437
|
||||
!!! IBM-850 PC (Multi-lingual): IBM PC Code Page 850
|
||||
!!!
|
||||
!!! ! E European
|
||||
!!! ISO-8859-2 ISO Latin 2
|
||||
!!!
|
||||
!!! ! Cyrillic
|
||||
!!! ISO-8859-5 ISO Latin/Cyrillic
|
||||
!!!
|
||||
!!! ! Arabic
|
||||
!!! ISO-8859-6 ISO Latin/Arabic
|
||||
!!! HP-ARABIC8 HP Arabic8
|
||||
!!! IBM-1046 PC Arabic Code Set
|
||||
!!!
|
||||
!!! ! Hebrew
|
||||
!!! ISO-8859-8 ISO Latin/Hebrew
|
||||
!!! HP-HEBREW8 HP Hebrew8
|
||||
!!! IBM-856 PC Hebrew
|
||||
!!!
|
||||
!!! ! Greek
|
||||
!!! ISO-8859-7 ISO Latin/Greek
|
||||
!!! HP-GREEK8 HP Greek8
|
||||
!!!
|
||||
!!! ! Turkish
|
||||
!!! ISO-8859-9 ISO Latin 5
|
||||
!!! HP-TURKISH8 HP Turkish8
|
||||
!!!
|
||||
!!! ! Japan
|
||||
!!! EUC-JP Japanese EUC: JIS X0201, X0208-1990, X0212-1990
|
||||
!!! ISO-2022-JP Japanese JIS: JIS X0201, X0208-1990, X0212-1990 in form ISO-2022-JP (a 7 bit encoding)
|
||||
!!! HP-SJIS HP Japanese Shift JIS: JIS X0208-1990 + UDC, VDC for HP user
|
||||
!!! IBM-932 PC Japanese Shift JIS: JIS X0208-1990 + UDC, VDC for PC user
|
||||
!!! HP-KANA8 HP Japanese Katakana8: JIS X0201
|
||||
!!!
|
||||
!!! ! Korea
|
||||
!!! EUC-KR Korean EUC: KS C 5601
|
||||
!!! ISO-2022-KR Korean EUC in form ISO-2022-KR (a 7 bit encoding)
|
||||
!!!
|
||||
!!! ! Taiwan
|
||||
!!! EUC-TW Taiwan Chinese EUC: CNS-11643-1992 (Taiwan 4-byte EUC)
|
||||
!!! ISO-2022-TW Taiwan Chinese EUC in form ISO-2022-TW (a 7 bit encoding)
|
||||
!!! HP-BIG5 HP Big5 Chinese (Taiwan)
|
||||
!!! HP-CCDC HP CCDC Chinese (Taiwan)
|
||||
!!!
|
||||
!!! ! China
|
||||
!!! EUC-CN China Chinese EUC: GB2312 + UDC
|
||||
!!! ISO-2022-CN China Chinese EUC in form ISO-2022-CN (a 7 bit encoding)
|
||||
!!! HP-15CN HP EUC-CN: GB2312 + UDCs
|
||||
!!!
|
||||
!!! ! Thai
|
||||
!!! TIS-620 Thai
|
||||
!!!
|
||||
!!! ! ISO-10646
|
||||
!!! ! UCS = Universal character set; UTF = UCS Tranformation Format
|
||||
!!! UCS-2 Unicode (2-byte ISO-10646, group 0, plane 0)
|
||||
!!! UCS-4 4-byte ISO-10646
|
||||
!!! UTF-7 multibyte encoding of Unicode
|
||||
!!! UTF-8 multibyte encoding of Unicode
|
||||
!!! UTF-16 multibyte encoding of Unicode
|
||||
!!!
|
||||
!!! ! Symbol charsets
|
||||
!!! DT-SYMBOL-1 standard CDE Desktop symbol font
|
||||
!!!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
!!!!!!!!!!!!!!!! CDE Version Identificaton !!!!!!!!!!!!!!!!!
|
||||
! This translation is used by the _DtXlateGetXlateEnv()
|
||||
! call to determine the version number to use. It
|
||||
! is unlikely that this translation will be used, since
|
||||
! there is no "CDE" platform, but it is provided for
|
||||
! the unlikely possibility.
|
||||
!
|
||||
CDE.?.version.<.100: ".*" !! any CDE value
|
||||
|
||||
! uncomment this resource to debug/test the translation db
|
||||
!*debugDtXlate: True
|
||||
|
||||
!!!!!!!!!!!!!!!! CDE standard locale-related strings !!!!!!!!!!!!!!!!!!!
|
||||
! Unified list of locales and codesets
|
||||
! Based on October, 14 1993, unified list of presently supported locales
|
||||
!
|
||||
! Some language,territory combinations have the following comments:
|
||||
! (1) These ISO territory names may be subject to change
|
||||
! However, their CDE names will continue to be supported
|
||||
! (2) No ISO "territory" name exists for the Arabic-speaking regions of the
|
||||
! world as a whole. Vendors have sometimes supplied their own.
|
||||
! Those names, when conformant to the ISO model, will be adopted for CDE.
|
||||
!
|
||||
!Platform Operation Lang_Terr Translation Language,Territory Who has
|
||||
!--- --------- ----- ----------- ------------------ -------
|
||||
! Version Kind Codeset
|
||||
! ---- - ---------
|
||||
|
||||
! Standards Compliance, Latin 1 codeset
|
||||
CDE.100+.standard.=.C.ISO-8859-1: C.ISO-8859-1 ! Standards compliance ,IBM, HP, Sun , USL
|
||||
CDE.100+.standard.=.POSIX.ISO-8859-1: POSIX.ISO-8859-1 ! Standards compliance ,IBM, HP, Sun , USL
|
||||
|
||||
! W European/Americas, Latin 1 codeset
|
||||
CDE.100+.standard.=.da_DK.ISO-8859-1: da_DK.ISO-8859-1 ! Danish, Denmark XoJIG,IBM, HP, , USL ("da")
|
||||
CDE.100+.standard.=.de_AT.ISO-8859-1: de_AT.ISO-8859-1 ! German,Austria XoJIG, , , , USL
|
||||
CDE.100+.standard.=.de_CH.ISO-8859-1: de_CH.ISO-8859-1 ! German,Switzerland XoJIG,IBM, , , USL
|
||||
CDE.100+.standard.=.de_DE.ISO-8859-1: de_DE.ISO-8859-1 ! German, Germany XoJIG,IBM, HP, Sun ("de"), USL ("de")
|
||||
CDE.100+.standard.=.en_AU.ISO-8859-1: en_AU.ISO-8859-1 ! English,Australia , , , , USL
|
||||
CDE.100+.standard.=.en_CA.ISO-8859-1: en_CA.ISO-8859-1 ! English,Canada XoJIG, , , , USL
|
||||
CDE.100+.standard.=.en_DK.ISO-8859-1: en_DK.ISO-8859-1 ! English, Denmark XoJIG, , , , USL
|
||||
CDE.100+.standard.=.en_GB.ISO-8859-1: en_GB.ISO-8859-1 ! English, U.K. XoJIG,IBM, HP, , USL ("en")
|
||||
CDE.100+.standard.=.en_JP.ISO-8859-1: en_JP.ISO-8859-1 ! English, Japan XoJIG,IBM, , ,
|
||||
CDE.100+.standard.=.en_IE.ISO-8859-1: en_IE.ISO-8859-1 ! English, Ireland XoJIG, , , , USL
|
||||
CDE.100+.standard.=.en_KR.ISO-8859-1: en_KR.ISO-8859-1 ! English, Korea XoJIG,IBM, , ,
|
||||
CDE.100+.standard.=.en_MY.ISO-8859-1: en_MY.ISO-8859-1 ! English,Malaysia , , , , USL
|
||||
CDE.100+.standard.=.en_NZ.ISO-8859-1: en_NZ.ISO-8859-1 ! English,New Zealand , , , , USL
|
||||
CDE.100+.standard.=.en_TW.ISO-8859-1: en_TW.ISO-8859-1 ! English, Taiwan XoJIG,IBM, , ,
|
||||
CDE.100+.standard.=.en_US.ISO-8859-1: en_US.ISO-8859-1 ! English, USA XoJIG,IBM, HP, Sun , USL
|
||||
CDE.100+.standard.=.es_AR.ISO-8859-1: es_AR.ISO-8859-1 ! Spanish, Argentina , , , Sun , USL
|
||||
CDE.100+.standard.=.es_BO.ISO-8859-1: es_BO.ISO-8859-1 ! Spanish, Bolivia , , , Sun
|
||||
CDE.100+.standard.=.es_CL.ISO-8859-1: es_CL.ISO-8859-1 ! Spanish, Chile , , , Sun , USL
|
||||
CDE.100+.standard.=.es_CO.ISO-8859-1: es_CO.ISO-8859-1 ! Spanish, Columbia , , , Sun
|
||||
CDE.100+.standard.=.es_CR.ISO-8859-1: es_CR.ISO-8859-1 ! Spanish, Costa Rica , , , Sun
|
||||
CDE.100+.standard.=.es_EC.ISO-8859-1: es_EC.ISO-8859-1 ! Spanish, Ecuador , , , Sun
|
||||
CDE.100+.standard.=.es_ES.ISO-8859-1: es_ES.ISO-8859-1 ! Spanish, Spain XoJIG,IBM, HP, Sun , USL
|
||||
CDE.100+.standard.=.es_GT.ISO-8859-1: es_GT.ISO-8859-1 ! Spanish, Guatemala , , , Sun
|
||||
CDE.100+.standard.=.es_MX.ISO-8859-1: es_MX.ISO-8859-1 ! Spanish, Mexico , , , Sun , USL
|
||||
CDE.100+.standard.=.es_PE.ISO-8859-1: es_PE.ISO-8859-1 ! Spanish, Peru , , , Sun
|
||||
CDE.100+.standard.=.es_UY.ISO-8859-1: es_UY.ISO-8859-1 ! Spanish, Uruguay , , , Sun
|
||||
CDE.100+.standard.=.es_VE.ISO-8859-1: es_VE.ISO-8859-1 ! Spanish, Venezuela , , , Sun , USL
|
||||
CDE.100+.standard.=.et_EE.ISO-8859-1: et_EE.ISO-8859-1 ! Estonian, Estonia XoJIG,
|
||||
CDE.100+.standard.=.fi_FI.ISO-8859-1: fi_FI.ISO-8859-1 ! Finnish, Finland XoJIG,IBM, HP, , USL ("fi")
|
||||
CDE.100+.standard.=.fo_FO.ISO-8859-1: fo_FO.ISO-8859-1 ! Faroese, Faeroe Island XoJIG,
|
||||
CDE.100+.standard.=.fr_BE.ISO-8859-1: fr_BE.ISO-8859-1 ! French,Belgium XoJIG, , , , USL
|
||||
CDE.100+.standard.=.fr_CA.ISO-8859-1: fr_CA.ISO-8859-1 ! French, Canada XoJIG,IBM, HP, , USL
|
||||
CDE.100+.standard.=.fr_CH.ISO-8859-1: fr_CH.ISO-8859-1 ! French, Switzerland XoJIG,IBM, , , USL
|
||||
CDE.100+.standard.=.fr_FR.ISO-8859-1: fr_FR.ISO-8859-1 ! French, France XoJIG,IBM, HP, Sun ("fr"), USL ("fr")
|
||||
CDE.100+.standard.=.is_IS.ISO-8859-1: is_IS.ISO-8859-1 ! Icelandic, Iceland XoJIG,IBM, HP, , USL ("is")
|
||||
CDE.100+.standard.=.it_CH.ISO-8859-1: it_CH.ISO-8859-1 ! Italian,Switzerland , , , , USL
|
||||
CDE.100+.standard.=.it_IT.ISO-8859-1: it_IT.ISO-8859-1 ! Italian, Italy XoJIG,IBM, HP, Sun ("it"), USL ("it")
|
||||
CDE.100+.standard.=.kl_GL.ISO-8859-1: kl_GL.ISO-8859-1 ! Greenlandic, Greenland XoJIG,
|
||||
CDE.100+.standard.=.lt_LT.ISO-8859-1: lt_LT.ISO-8859-1 ! Lithuanian, Lithuania XoJIG,
|
||||
CDE.100+.standard.=.lv_LV.ISO-8859-1: lv_LV.ISO-8859-1 ! Latvian, Latvia XoJIG,
|
||||
CDE.100+.standard.=.nl_BE.ISO-8859-1: nl_BE.ISO-8859-1 ! Dutch, Belgium XoJIG,IBM, , , USL
|
||||
CDE.100+.standard.=.nl_NL.ISO-8859-1: nl_NL.ISO-8859-1 ! Dutch, The Netherlands XoJIG,IBM, HP, , USL ("nl")
|
||||
CDE.100+.standard.=.no_NO.ISO-8859-1: no_NO.ISO-8859-1 ! Norwegian, Norway XoJIG,IBM, HP, , USL ("no")
|
||||
CDE.100+.standard.=.pt_BR.ISO-8859-1: pt_BR.ISO-8859-1 ! Portuguese,Brazil , , , , USL
|
||||
CDE.100+.standard.=.pt_PT.ISO-8859-1: pt_PT.ISO-8859-1 ! Portuguese, Portugal XoJIG,IBM, HP, , USL
|
||||
CDE.100+.standard.=.sv_FI.ISO-8859-1: sv_FI.ISO-8859-1 ! Swedish, Finland XoJIG,
|
||||
CDE.100+.standard.=.sv_SE.ISO-8859-1: sv_SE.ISO-8859-1 ! Swedish, Sweden XoJIG,IBM, HP, Sun ("sv"), USL ("sv")
|
||||
|
||||
! Standards Compliance, HP-ROMAN8 codeset
|
||||
CDE.100+.standard.=.C.HP-ROMAN8: C.HP-ROMAN8 ! Standards compliance , , HP,
|
||||
CDE.100+.standard.=.POSIX.HP-ROMAN8: POSIX.HP-ROMAN8 ! Standards compliance , , HP,
|
||||
|
||||
! W European/Americas, HP-ROMAN8 codeset
|
||||
CDE.100+.standard.=.da_DK.HP-ROMAN8: da_DK.HP-ROMAN8 ! Danish, Denmark , , HP,
|
||||
CDE.100+.standard.=.de_AT.HP-ROMAN8: de_AT.HP-ROMAN8 ! German,Austria , , ,
|
||||
CDE.100+.standard.=.de_CH.HP-ROMAN8: de_CH.HP-ROMAN8 ! German,Switzerland , , ,
|
||||
CDE.100+.standard.=.de_DE.HP-ROMAN8: de_DE.HP-ROMAN8 ! German, Germany , , HP,
|
||||
CDE.100+.standard.=.en_AU.HP-ROMAN8: en_AU.HP-ROMAN8 ! English,Australia , , ,
|
||||
CDE.100+.standard.=.en_CA.HP-ROMAN8: en_CA.HP-ROMAN8 ! English,Canada , , ,
|
||||
CDE.100+.standard.=.en_DK.HP-ROMAN8: en_DK.HP-ROMAN8 ! English, Denmark , , ,
|
||||
CDE.100+.standard.=.en_GB.HP-ROMAN8: en_GB.HP-ROMAN8 ! English, U.K. , , HP,
|
||||
CDE.100+.standard.=.en_JP.HP-ROMAN8: en_JP.HP-ROMAN8 ! English, Japan , , ,
|
||||
CDE.100+.standard.=.en_IE.HP-ROMAN8: en_IE.HP-ROMAN8 ! English, Ireland , , ,
|
||||
CDE.100+.standard.=.en_KR.HP-ROMAN8: en_KR.HP-ROMAN8 ! English, Korea , , ,
|
||||
CDE.100+.standard.=.en_MY.HP-ROMAN8: en_MY.HP-ROMAN8 ! English,Malaysia , , ,
|
||||
CDE.100+.standard.=.en_NZ.HP-ROMAN8: en_NZ.HP-ROMAN8 ! English,New Zealand , , ,
|
||||
CDE.100+.standard.=.en_TW.HP-ROMAN8: en_TW.HP-ROMAN8 ! English, Taiwan , , ,
|
||||
CDE.100+.standard.=.en_US.HP-ROMAN8: en_US.HP-ROMAN8 ! English, USA , , HP,
|
||||
CDE.100+.standard.=.es_AR.HP-ROMAN8: es_AR.HP-ROMAN8 ! Spanish, Argentina , , ,
|
||||
CDE.100+.standard.=.es_BO.HP-ROMAN8: es_BO.HP-ROMAN8 ! Spanish, Bolivia , , ,
|
||||
CDE.100+.standard.=.es_CL.HP-ROMAN8: es_CL.HP-ROMAN8 ! Spanish, Chile , , ,
|
||||
CDE.100+.standard.=.es_CO.HP-ROMAN8: es_CO.HP-ROMAN8 ! Spanish, Columbia , , ,
|
||||
CDE.100+.standard.=.es_CR.HP-ROMAN8: es_CR.HP-ROMAN8 ! Spanish, Costa Rica , , ,
|
||||
CDE.100+.standard.=.es_EC.HP-ROMAN8: es_EC.HP-ROMAN8 ! Spanish, Ecuador , , ,
|
||||
CDE.100+.standard.=.es_ES.HP-ROMAN8: es_ES.HP-ROMAN8 ! Spanish, Spain , , HP,
|
||||
CDE.100+.standard.=.es_GT.HP-ROMAN8: es_GT.HP-ROMAN8 ! Spanish, Guatemala , , ,
|
||||
CDE.100+.standard.=.es_MX.HP-ROMAN8: es_MX.HP-ROMAN8 ! Spanish, Mexico , , ,
|
||||
CDE.100+.standard.=.es_PE.HP-ROMAN8: es_PE.HP-ROMAN8 ! Spanish, Peru , , ,
|
||||
CDE.100+.standard.=.es_UY.HP-ROMAN8: es_UY.HP-ROMAN8 ! Spanish, Uruguay , , ,
|
||||
CDE.100+.standard.=.es_VE.HP-ROMAN8: es_VE.HP-ROMAN8 ! Spanish, Venezuela , , ,
|
||||
CDE.100+.standard.=.et_EE.HP-ROMAN8: et_EE.HP-ROMAN8 ! Estonian, Estonia ,
|
||||
CDE.100+.standard.=.fi_FI.HP-ROMAN8: fi_FI.HP-ROMAN8 ! Finnish, Finland , , HP,
|
||||
CDE.100+.standard.=.fo_FO.HP-ROMAN8: fo_FO.HP-ROMAN8 ! Faroese, Faeroe Island ,
|
||||
CDE.100+.standard.=.fr_BE.HP-ROMAN8: fr_BE.HP-ROMAN8 ! French,Belgium , , ,
|
||||
CDE.100+.standard.=.fr_CA.HP-ROMAN8: fr_CA.HP-ROMAN8 ! French, Canada , , HP,
|
||||
CDE.100+.standard.=.fr_CH.HP-ROMAN8: fr_CH.HP-ROMAN8 ! French, Switzerland , , ,
|
||||
CDE.100+.standard.=.fr_FR.HP-ROMAN8: fr_FR.HP-ROMAN8 ! French, France , , HP,
|
||||
CDE.100+.standard.=.is_IS.HP-ROMAN8: is_IS.HP-ROMAN8 ! Icelandic, Iceland , , HP,
|
||||
CDE.100+.standard.=.it_CH.HP-ROMAN8: it_CH.HP-ROMAN8 ! Italian,Switzerland , , ,
|
||||
CDE.100+.standard.=.it_IT.HP-ROMAN8: it_IT.HP-ROMAN8 ! Italian, Italy , , HP,
|
||||
CDE.100+.standard.=.kl_GL.HP-ROMAN8: kl_GL.HP-ROMAN8 ! Greenlandic, Greenland ,
|
||||
CDE.100+.standard.=.lt_LT.HP-ROMAN8: lt_LT.HP-ROMAN8 ! Lithuanian, Lithuania ,
|
||||
CDE.100+.standard.=.lv_LV.HP-ROMAN8: lv_LV.HP-ROMAN8 ! Latvian, Latvia ,
|
||||
CDE.100+.standard.=.nl_BE.HP-ROMAN8: nl_BE.HP-ROMAN8 ! Dutch, Belgium , , ,
|
||||
CDE.100+.standard.=.nl_NL.HP-ROMAN8: nl_NL.HP-ROMAN8 ! Dutch, The Netherlands , , HP,
|
||||
CDE.100+.standard.=.no_NO.HP-ROMAN8: no_NO.HP-ROMAN8 ! Norwegian, Norway , , HP,
|
||||
CDE.100+.standard.=.pt_BR.HP-ROMAN8: pt_BR.HP-ROMAN8 ! Portuguese,Brazil , , ,
|
||||
CDE.100+.standard.=.pt_PT.HP-ROMAN8: pt_PT.HP-ROMAN8 ! Portuguese, Portugal , , HP,
|
||||
CDE.100+.standard.=.sv_FI.HP-ROMAN8: sv_FI.HP-ROMAN8 ! Swedish, Finland ,
|
||||
CDE.100+.standard.=.sv_SE.HP-ROMAN8: sv_SE.HP-ROMAN8 ! Swedish, Sweden , , HP,
|
||||
|
||||
|
||||
! Standards Compliance, IBM-437 codeset
|
||||
CDE.100+.standard.=.C.IBM-437: C.IBM-437 ! Standards compliance ,IBM,
|
||||
CDE.100+.standard.=.POSIX.IBM-437: POSIX.IBM-437 ! Standards compliance ,IBM,
|
||||
|
||||
! Standards Compliance, IBM-850 codeset
|
||||
CDE.100+.standard.=.C.IBM-850: C.IBM-850 ! Standards compliance ,IBM,
|
||||
CDE.100+.standard.=.POSIX.IBM-850: POSIX.IBM-850 ! Standards compliance ,IBM,
|
||||
|
||||
! W European/Americas, IBM-850 codeset
|
||||
CDE.100+.standard.=.da_DK.IBM-850: da_DK.IBM-850 ! Danish, Denmark ,IBM,
|
||||
CDE.100+.standard.=.de_AT.IBM-850: de_AT.IBM-850 ! German,Austria , ,
|
||||
CDE.100+.standard.=.de_CH.IBM-850: de_CH.IBM-850 ! German,Switzerland ,IBM,
|
||||
CDE.100+.standard.=.de_DE.IBM-850: de_DE.IBM-850 ! German, Germany ,IBM,
|
||||
CDE.100+.standard.=.en_AU.IBM-850: en_AU.IBM-850 ! English,Australia , ,
|
||||
CDE.100+.standard.=.en_CA.IBM-850: en_CA.IBM-850 ! English,Canada , ,
|
||||
CDE.100+.standard.=.en_DK.IBM-850: en_DK.IBM-850 ! English, Denmark , ,
|
||||
CDE.100+.standard.=.en_GB.IBM-850: en_GB.IBM-850 ! English, U.K. ,IBM,
|
||||
CDE.100+.standard.=.en_JP.IBM-850: en_JP.IBM-850 ! English, Japan ,IBM,
|
||||
CDE.100+.standard.=.en_IE.IBM-850: en_IE.IBM-850 ! English, Ireland , ,
|
||||
CDE.100+.standard.=.en_KR.IBM-850: en_KR.IBM-850 ! English, Korea ,IBM,
|
||||
CDE.100+.standard.=.en_MY.IBM-850: en_MY.IBM-850 ! English,Malaysia , ,
|
||||
CDE.100+.standard.=.en_NZ.IBM-850: en_NZ.IBM-850 ! English,New Zealand , ,
|
||||
CDE.100+.standard.=.en_TW.IBM-850: en_TW.IBM-850 ! English, Taiwan ,IBM,
|
||||
CDE.100+.standard.=.en_US.IBM-850: en_US.IBM-850 ! English, USA ,IBM,
|
||||
CDE.100+.standard.=.es_AR.IBM-850: es_AR.IBM-850 ! Spanish, Argentina , ,
|
||||
CDE.100+.standard.=.es_BO.IBM-850: es_BO.IBM-850 ! Spanish, Bolivia , ,
|
||||
CDE.100+.standard.=.es_CL.IBM-850: es_CL.IBM-850 ! Spanish, Chile , ,
|
||||
CDE.100+.standard.=.es_CO.IBM-850: es_CO.IBM-850 ! Spanish, Columbia , ,
|
||||
CDE.100+.standard.=.es_CR.IBM-850: es_CR.IBM-850 ! Spanish, Costa Rica , ,
|
||||
CDE.100+.standard.=.es_EC.IBM-850: es_EC.IBM-850 ! Spanish, Ecuador , ,
|
||||
CDE.100+.standard.=.es_ES.IBM-850: es_ES.IBM-850 ! Spanish, Spain ,IBM,
|
||||
CDE.100+.standard.=.es_GT.IBM-850: es_GT.IBM-850 ! Spanish, Guatemala , ,
|
||||
CDE.100+.standard.=.es_MX.IBM-850: es_MX.IBM-850 ! Spanish, Mexico , ,
|
||||
CDE.100+.standard.=.es_PE.IBM-850: es_PE.IBM-850 ! Spanish, Peru , ,
|
||||
CDE.100+.standard.=.es_UY.IBM-850: es_UY.IBM-850 ! Spanish, Uruguay , ,
|
||||
CDE.100+.standard.=.es_VE.IBM-850: es_VE.IBM-850 ! Spanish, Venezuela , ,
|
||||
CDE.100+.standard.=.et_EE.IBM-850: et_EE.IBM-850 ! Estonian, Estonia ,
|
||||
CDE.100+.standard.=.fi_FI.IBM-850: fi_FI.IBM-850 ! Finnish, Finland ,IBM,
|
||||
CDE.100+.standard.=.fo_FO.IBM-850: fo_FO.IBM-850 ! Faroese, Faeroe Island ,
|
||||
CDE.100+.standard.=.fr_BE.IBM-850: fr_BE.IBM-850 ! French,Belgium , ,
|
||||
CDE.100+.standard.=.fr_CA.IBM-850: fr_CA.IBM-850 ! French, Canada ,IBM,
|
||||
CDE.100+.standard.=.fr_CH.IBM-850: fr_CH.IBM-850 ! French, Switzerland ,IBM,
|
||||
CDE.100+.standard.=.fr_FR.IBM-850: fr_FR.IBM-850 ! French, France ,IBM,
|
||||
CDE.100+.standard.=.is_IS.IBM-850: is_IS.IBM-850 ! Icelandic, Iceland ,IBM,
|
||||
CDE.100+.standard.=.it_CH.IBM-850: it_CH.IBM-850 ! Italian,Switzerland , ,
|
||||
CDE.100+.standard.=.it_IT.IBM-850: it_IT.IBM-850 ! Italian, Italy ,IBM,
|
||||
CDE.100+.standard.=.kl_GL.IBM-850: kl_GL.IBM-850 ! Greenlandic, Greenland ,
|
||||
CDE.100+.standard.=.lt_LT.IBM-850: lt_LT.IBM-850 ! Lithuanian, Lithuania ,
|
||||
CDE.100+.standard.=.lv_LV.IBM-850: lv_LV.IBM-850 ! Latvian, Latvia ,
|
||||
CDE.100+.standard.=.nl_BE.IBM-850: nl_BE.IBM-850 ! Dutch, Belgium ,IBM,
|
||||
CDE.100+.standard.=.nl_NL.IBM-850: nl_NL.IBM-850 ! Dutch, The Netherlands ,IBM,
|
||||
CDE.100+.standard.=.no_NO.IBM-850: no_NO.IBM-850 ! Norwegian, Norway ,IBM,
|
||||
CDE.100+.standard.=.pt_BR.IBM-850: pt_BR.IBM-850 ! Portuguese,Brazil , ,
|
||||
CDE.100+.standard.=.pt_PT.IBM-850: pt_PT.IBM-850 ! Portuguese, Portugal ,IBM,
|
||||
CDE.100+.standard.=.sv_FI.IBM-850: sv_FI.IBM-850 ! Swedish, Finland ,
|
||||
CDE.100+.standard.=.sv_SE.IBM-850: sv_SE.IBM-850 ! Swedish, Sweden ,IBM,
|
||||
|
||||
! E European
|
||||
CDE.100+.standard.=.cs_CS.ISO-8859-2: cs_CS.ISO-8859-2 ! Czech(1) ,IBM, HP
|
||||
CDE.100+.standard.=.hr_HR.ISO-8859-2: hr_HR.ISO-8859-2 ! Croatian, Croatia ,IBM
|
||||
CDE.100+.standard.=.hu_HU.ISO-8859-2: hu_HU.ISO-8859-2 ! Hungarian, Hungry XoJIG,IBM, HP
|
||||
CDE.100+.standard.=.pl_PL.ISO-8859-2: pl_PL.ISO-8859-2 ! Polish, Poland XoJIG,IBM, HP
|
||||
CDE.100+.standard.=.ro_RO.ISO-8859-2: ro_RO.ISO-8859-2 ! Rumanian, Romania XoJIG,IBM, HP
|
||||
CDE.100+.standard.=.sh_YU.ISO-8859-2: sh_YU.ISO-8859-2 ! Serbocroatian, Yugoslavia(1) ,IBM, HP
|
||||
CDE.100+.standard.=.sl_CS.ISO-8859-2: sl_CS.ISO-8859-2 ! Slovenian ,IBM, HP
|
||||
CDE.100+.standard.=.si_SI.ISO-8859-2: sl_CS.ISO-8859-2 ! Slovenian ,IBM, HP
|
||||
CDE.100+.standard.=.sk_SK.ISO-8859-2: sk_SK.ISO-8859-2 ! Slovak ,IBM
|
||||
|
||||
! Cyrillic
|
||||
CDE.100+.standard.=.bg_BG.ISO-8859-5: bg_BG.ISO-8859-5 ! Bulgarian, Bulgaria ,IBM, HP
|
||||
CDE.100+.standard.=.mk_MK.ISO-8859-5: mk_MK.ISO-8859-5 ! Macedonian ,IBM
|
||||
CDE.100+.standard.=.ru_RU.ISO-8859-5: ru_RU.ISO-8859-5 ! Russian(1) ,IBM, HP
|
||||
CDE.100+.standard.=.ru_SU.ISO-8859-5: ru_SU.ISO-8859-5 ! Russian(1) ,IBM, HP
|
||||
CDE.100+.standard.=.sp_YU.ISO-8859-5: sp_YU.ISO-8859-5 ! Serbian,Yugoslavia(1) ,IBM
|
||||
|
||||
! Arabic
|
||||
CDE.100+.standard.=.ar_DZ.ISO-8859-6: ar_DZ.ISO-8859-6 ! Arabic(2) ,IBM, HP
|
||||
CDE.100+.standard.=.ar_DZ.HP-ARABIC8: ar_DZ.HP-ARABIC8 ! Arabic(2) , , HP
|
||||
CDE.100+.standard.=.ar_SA.ISO-8859-6: ar_SA.ISO-8859-6 ! Arabic(2) ,IBM, HP
|
||||
CDE.100+.standard.=.ar_SA.HP-ARABIC8: ar_SA.HP-ARABIC8 ! Arabic(2) , , HP
|
||||
|
||||
! Hebrew
|
||||
CDE.100+.standard.=.iw_IL.ISO-8859-8: iw_IL.ISO-8859-8 ! Hebrew, Israel ,IBM, HP
|
||||
CDE.100+.standard.=.iw_IL.HP-HEBREW8: iw_IL.HP-HEBREW8 ! Hebrew, Israel , , HP
|
||||
|
||||
! Greek
|
||||
CDE.100+.standard.=.el_GR.ISO-8859-7: el_GR.ISO-8859-7 ! Greek, Greece ,IBM, HP
|
||||
CDE.100+.standard.=.el_GR.HP-GREEK8: el_GR.HP-GREEK8 ! Greek, Greece , , HP
|
||||
|
||||
! Turkish
|
||||
CDE.100+.standard.=.tr_TR.ISO-8859-9: tr_TR.ISO-8859-9 ! Turkish, Turkey ,IBM, HP
|
||||
CDE.100+.standard.=.tr_TR.HP-TURKISH8: tr_TR.HP-TURKISH8 ! Turkish, Turkey , , HP
|
||||
|
||||
! East Asia
|
||||
CDE.100+.standard.=.ja_JP.EUC-JP: ja_JP.EUC-JP ! Japanese, Japan ,IBM, HP, Sun ("ja"), USL
|
||||
CDE.100+.standard.=.ja_JP.ISO-2022-JP: ja_JP.ISO-2022-JP ! Japanese, Japan ,IBM, HP, SUN , ???
|
||||
CDE.100+.standard.=.ja_JP.IBM-932: ja_JP.IBM-932 ! Japanese, Japan ,IBM,
|
||||
CDE.100+.standard.=.ja_JP.HP-SJIS: ja_JP.HP-SJIS ! Japanese, Japan , , HP, ,
|
||||
CDE.100+.standard.=.ja_JP.HP-KANA8: ja_JP.HP-KANA8 ! Japanese, Japan , , HP, ,
|
||||
CDE.100+.standard.=.ko_KR.EUC-KR: ko_KR.EUC-KR ! Korean, Korea ,IBM, HP, Sun ("ko"), USL
|
||||
CDE.100+.standard.=.ko_KR.ISO-2022-KR: ko_KR.ISO-2022-KR ! Korean, Korea ,???, ??, SUN , ???
|
||||
CDE.100+.standard.=.zh_CN.EUC-CN: zh_CN.EUC-CN ! Chinese, China ,IBM, HP, Sun ("zh"), USL
|
||||
CDE.100+.standard.=.zh_CN.UTF-8: zh_CN.UTF-8 ! Chinese, China ,IBM, , ,
|
||||
CDE.100+.standard.=.zh_CN.ISO-2022-CN: zh_CN.ISO-2022-CN ! Chinese, China ,IBM, ??, SUN , ???
|
||||
CDE.100+.standard.=.zh_CN.HP-15CN: zh_CN.HP-15CN ! Chinese, China , , HP
|
||||
CDE.100+.standard.=.zh_TW.EUC-TW: zh_TW.EUC-TW ! Chinese, Taiwan ,IBM, HP, Sun , USL
|
||||
CDE.100+.standard.=.zh_TW.ISO-2022-TW: zh_TW.ISO-2022-TW ! Chinese, Taiwan ,IBM, ??, SUN , ???
|
||||
CDE.100+.standard.=.zh_TW.HP-BIG5: zh_TW.HP-BIG5 ! Chinese, Taiwan , , HP, ,
|
||||
CDE.100+.standard.=.zh_TW.HP-CCDC: zh_TW.HP-CCDC ! Chinese, Taiwan , , HP, ,
|
||||
|
||||
! Thai
|
||||
CDE.100+.standard.=.th_TH.TIS-620: th_TH.TIS-620 ! Thai, Thailand ,IBM, HP
|
||||
|
||||
! Needs to be commmunicated to CDE coordinator.
|
||||
! Unicode
|
||||
CDE.100+.standard.=.UNIVERAL.UTF-8: UNIVERSAL.UTF-8 ! Multilingual, Unicode ,IBM, HP
|
||||
|
||||
! Symbol charsets
|
||||
CDE.100+.standard.=.?.DT-SYMBOL-1: DT-SYMBOL-1 ! standard CDE Desktop symbol font
|
||||
|
||||
!! Codeset identifiers for use with MIME messages. The .~. translations
|
||||
!! are used by dtmail and adhere to the MIME standard, RFC 1521.
|
||||
!! Note that the MIME standard states that codeset identifiers are
|
||||
!! case-insensitive. The operation-specific values on the right-hand-side
|
||||
!! of the translations below, however, ARE case sensitive. Before
|
||||
!! doing a OpToStd translation, first convert the MIME codeset identifier
|
||||
!! to uppercase. Alternatively, one could provide lower-case versions
|
||||
!! of the translations (right-hand-side only should be in lower-case).
|
||||
CDE.100+.mime.~.?.ISO-8859-1: ISO-8859-1 ! ISO Latin 1
|
||||
CDE.100+.mime.~.?.HP-ROMAN8: X-HP-ROMAN8 ! HP Roman8
|
||||
CDE.100+.mime.~.?.IBM-437: X-IBM-437 ! PC (US)
|
||||
CDE.100+.mime.~.?.IBM-850: X-IBM-850 ! PC (Multi-lingual)
|
||||
CDE.100+.mime.~.?.ISO-8859-2: ISO-8859-2 ! ISO Latin 2
|
||||
CDE.100+.mime.~.?.ISO-8859-5: ISO-8859-5 ! ISO Latin/Cyrillic
|
||||
CDE.100+.mime.~.?.ISO-8859-6: ISO-8859-6 ! ISO Latin/Arabic
|
||||
CDE.100+.mime.~.?.HP-ARABIC8: X-HP-ARABIC8 ! HP Arabic8
|
||||
CDE.100+.mime.~.?.IBM-1046: X-IBM-1046 ! PC Arabic Code Set
|
||||
CDE.100+.mime.~.?.ISO-8859-8: ISO-8859-8 ! ISO Latin/Hebrew
|
||||
CDE.100+.mime.~.?.HP-HEBREW8: X-HP-HEBREW8 ! HP Hebrew8
|
||||
CDE.100+.mime.~.?.IBM-856: X-IBM-856 ! PC Hebrew
|
||||
CDE.100+.mime.~.?.ISO-8859-7: ISO-8859-7 ! ISO Latin/Greek
|
||||
CDE.100+.mime.~.?.HP-GREEK8: X-HP-GREEK8 ! HP Greek8
|
||||
CDE.100+.mime.~.?.ISO-8859-9: ISO-8859-9 ! ISO Latin 5
|
||||
CDE.100+.mime.~.?.HP-TURKISH8: X-HP-TURKISH8 ! HP Turkish8
|
||||
CDE.100+.mime.~.?.EUC-JP: X-EUC-JP ! Japanese EUC
|
||||
CDE.100+.mime.~.?.ISO-2022-JP: ISO-2022-JP ! Japanese JIS with 7-bit encoding per ISO-2022-JP
|
||||
CDE.100+.mime.~.?.HP-SJIS: X-HP-SJIS ! HP Japanese Shift JIS
|
||||
CDE.100+.mime.~.?.IBM-932: X-IBM-932 ! PC Japanese Shift JIS
|
||||
CDE.100+.mime.~.?.HP-KANA8: X-HP-KANA8 ! HP Japanese Katakana8
|
||||
CDE.100+.mime.~.?.EUC-KR: X-EUC-KR ! Korean EUC
|
||||
CDE.100+.mime.~.?.ISO-2022-KR: ISO-2022-KR ! Korean with 7-bit encoding per ISO-2022-KR
|
||||
CDE.100+.mime.~.?.EUC-CN: X-EUC-CN ! China Chinese EUC
|
||||
CDE.100+.mime.~.?.ISO-2022-CN: ISO-2022-CN ! China Chinese with 7-bit encoding per ISO-2022-CN
|
||||
CDE.100+.mime.~.?.HP-15CN: X-HP-15CN ! HP China Chinese EUC
|
||||
CDE.100+.mime.~.?.EUC-TW: X-EUC-TW ! Taiwan Chinese EUC
|
||||
CDE.100+.mime.~.?.ISO-2022-TW: ISO-2022-TW ! Taiwan Chinese with 7-bit encoding per ISO-2022-TW
|
||||
CDE.100+.mime.~.?.HP-BIG5: X-HP-BIG5 ! HP Big5 Taiwan Chinese
|
||||
CDE.100+.mime.~.?.HP-CCDC: X-HP-CCDC ! HP CCDC Taiwan Chinese
|
||||
CDE.100+.mime.~.?.TIS-620: X-TIS-620 ! Thai
|
||||
CDE.100+.mime.~.?.UCS-2: X-UCS-2 ! Unicode; group 0, plane 0 of ISO-10646
|
||||
CDE.100+.mime.~.?.UCS-4: X-UCS-4 ! ISO-10646
|
||||
CDE.100+.mime.~.?.UTF-7: X-UTF-7 ! multibyte encoding of Unicode
|
||||
CDE.100+.mime.~.?.UTF-8: X-UTF-8 ! multibyte encoding of Unicode
|
||||
CDE.100+.mime.~.?.UTF-16: X-UTF-16 ! multibyte encoding of Unicode
|
||||
|
||||
!! If other mailers are using other codeset identifiers in their MIME
|
||||
!! messages, dtmail will not be able to process them correctly.
|
||||
!! To correct this, additional .<. translations for these identifiers
|
||||
!! can be added to a <platform>.lcx file in the /etc/dt/config/svc
|
||||
!! or $HOME/.dt/config/svc directories. Such translations should read:
|
||||
!! <platform>.100+.mime.<.?.<CDE std codeset>: <mailer identifier for the codeset>
|
||||
!!
|
||||
!! ***NEVER*** use a .~. translation, such as we use above, as this could
|
||||
!! cause dtmail to send unexpected identifier strings by overriding the
|
||||
!! above definition. Further, never use .=. or .>. translations.
|
||||
!!
|
||||
!! These two identifiers are in common usage, as they derive from RFC1521.
|
||||
CDE.100+.mime.<.?.ISO-8859-1: us-ascii ! ISO Latin 1
|
||||
CDE.100+.mime.<.?.ISO-8859-1: US-ASCII ! ISO Latin 1
|
||||
1564
cde/lib/DtHelp/Callbacks.c
Normal file
1564
cde/lib/DtHelp/Callbacks.c
Normal file
File diff suppressed because it is too large
Load Diff
101
cde/lib/DtHelp/CallbacksI.h
Normal file
101
cde/lib/DtHelp/CallbacksI.h
Normal file
@@ -0,0 +1,101 @@
|
||||
/* $XConsortium: CallbacksI.h /main/7 1996/02/27 20:06:41 cde-hal $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: CallbacksTG.h
|
||||
**
|
||||
** Project: TextGraphic Display routines
|
||||
**
|
||||
**
|
||||
** Description: Header file for CallbacksTG.h
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpCallbacksI_h
|
||||
#define _DtHelpCallbacksI_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*****************************************************************************
|
||||
* Semi Public Routines
|
||||
*****************************************************************************/
|
||||
extern Boolean _DtHelpCancelSelection(
|
||||
XtPointer client_data);
|
||||
extern void _DtHelpCleanAndDrawWholeCanvas(
|
||||
XtPointer client_data);
|
||||
extern void _DtHelpSearchMoveTraversal(
|
||||
XtPointer client_data,
|
||||
int search_hit_index);
|
||||
|
||||
/*****************************************************************************
|
||||
* Public Routines
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpClearSelection (
|
||||
XtPointer client_data );
|
||||
extern void _DtHelpClickOrSelectCB (
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data );
|
||||
extern void _DtHelpEndSelectionCB (
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data );
|
||||
extern void _DtHelpEnterLeaveCB (
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XEvent *event );
|
||||
extern void _DtHelpExposeCB (
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data );
|
||||
extern void _DtHelpFocusCB (
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XEvent *event );
|
||||
extern void _DtHelpGetClearSelection (
|
||||
Widget widget,
|
||||
XtPointer client_data);
|
||||
extern void _DtHelpHorzScrollCB (
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data );
|
||||
extern void _DtHelpInitiateClipboard (
|
||||
XtPointer client_data );
|
||||
extern void _DtHelpLoseSelectionCB (
|
||||
Widget widget,
|
||||
Atom *selection );
|
||||
extern void _DtHelpMoveBtnFocusCB (
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XEvent *event );
|
||||
extern void _DtHelpMouseMoveCB (
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XEvent *event );
|
||||
extern void _DtHelpResizeCB (
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data );
|
||||
extern void _DtHelpVertScrollCB (
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data );
|
||||
extern void _DtHelpVisibilityCB (
|
||||
Widget widget,
|
||||
XtPointer client_data,
|
||||
XEvent *event );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _DtHelpCallbacksI_h */
|
||||
2852
cde/lib/DtHelp/Canvas.c
Normal file
2852
cde/lib/DtHelp/Canvas.c
Normal file
File diff suppressed because it is too large
Load Diff
98
cde/lib/DtHelp/CanvasError.h
Normal file
98
cde/lib/DtHelp/CanvasError.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/* $XConsortium: CanvasError.h /main/3 1995/10/26 12:18:11 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: CanvasError.h
|
||||
**
|
||||
** Project: CacheCreeek (Rivers) Project.
|
||||
**
|
||||
**
|
||||
** Description: Private defines CE errors.
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _CECanvasError_h
|
||||
#define _CECanvasError_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* library generated errors in the system variable 'errno'
|
||||
*/
|
||||
#define CEErrorReported 0
|
||||
#define CEErrorExceedMaxSize -1
|
||||
#define CEErrorIllegalDatabaseFile -2
|
||||
#define CEErrorIllegalKeyword -3
|
||||
#define CEErrorIllegalPath -4
|
||||
#define CEErrorIllegalResource -5
|
||||
#define CEErrorLocIdNotFound -6
|
||||
#define CEErrorMalloc -7
|
||||
|
||||
#define CEErrorMissingAbstractRes -10
|
||||
#define CEErrorMissingFilenameRes -11
|
||||
#define CEErrorMissingFileposRes -12
|
||||
#define CEErrorMissingKeywordsRes -13
|
||||
#define CEErrorMissingTitleRes -14
|
||||
#define CEErrorMissingTopTopicRes -15
|
||||
#define CEErrorMissingTopicList -16
|
||||
#define CEErrorNoKeywordList -17
|
||||
|
||||
/*
|
||||
* Formatting errors.
|
||||
*/
|
||||
#define CEErrorMissingTopicCmd -20
|
||||
#define CEErrorMissingTitleCmd -21
|
||||
|
||||
#define CEErrorFormattingCmd -30
|
||||
#define CEErrorFormattingId -31
|
||||
#define CEErrorFormattingLabel -32
|
||||
#define CEErrorFormattingLink -33
|
||||
#define CEErrorFormattingTitle -34
|
||||
#define CEErrorFormattingValue -35
|
||||
#define CEErrorFormattingOption -36
|
||||
|
||||
#define CEErrorHyperType -40
|
||||
#define CEErrorHyperSpec -41
|
||||
#define CEErrorHyperNotFound -42
|
||||
#define CEErrorHyperTitle -43
|
||||
|
||||
#define CEErrorIllegalInfo -45
|
||||
#define CEErrorReadEmpty -46
|
||||
#define CEErrorFileSeek -47
|
||||
|
||||
#define CEErrorParagraphValue -50
|
||||
#define CEErrorParagraphOption -51
|
||||
#define CEErrorTopicSyntax -52
|
||||
#define CEErrorFontSpec -53
|
||||
|
||||
#define CEErrorAbbrevSyntax -60
|
||||
#define CEErrorTitleSyntax -61
|
||||
#define CEErrorFigureSyntax -62
|
||||
#define CEErrorGraphicSyntax -63
|
||||
#define CEErrorFontSyntax -64
|
||||
#define CEErrorIdSyntax -65
|
||||
#define CEErrorLabelSyntax -66
|
||||
#define CEErrorLinkSyntax -67
|
||||
#define CEErrorNewLineSyntax -68
|
||||
#define CEErrorParagraphSyntax -69
|
||||
#define CEErrorOctalSyntax -70
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _CECanvasError_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
298
cde/lib/DtHelp/CanvasI.h
Normal file
298
cde/lib/DtHelp/CanvasI.h
Normal file
@@ -0,0 +1,298 @@
|
||||
/* $XConsortium: CanvasI.h /main/18 1996/10/21 13:59:51 cde-hp $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: CanvasI.h
|
||||
**
|
||||
** Project:
|
||||
**
|
||||
** Description: Public Header file for Canvas.c
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
#ifndef _DtCanvasI_h
|
||||
#define _DtCanvasI_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/******** Internal Defines Declarations ********/
|
||||
#define _DtCvLINE_HORZ 0
|
||||
#define _DtCvLINE_VERT 1
|
||||
|
||||
/******** Internal Enum Declarations ********/
|
||||
enum _dtCvTraversalType
|
||||
{
|
||||
_DtCvTraversalNone,
|
||||
_DtCvTraversalLink,
|
||||
_DtCvTraversalMark
|
||||
};
|
||||
|
||||
/******** Internal Typedef Declarations ********/
|
||||
|
||||
#if !defined(_DtCvLinkMgrP_h) && !defined(_DtCvLinkMgrI_h)
|
||||
typedef struct _dtCvLinkDb* _DtCvLinkDb;
|
||||
#endif
|
||||
|
||||
typedef enum _dtCvTraversalType _DtCvTraversalType;
|
||||
|
||||
/* adding this typedef so that debugging can access the structure */
|
||||
typedef struct _dtCvSegment _DtCvSegmentI;
|
||||
typedef struct _dtCvSegPts _DtCvSegPtsI;
|
||||
|
||||
/******** Internal Structures Declarations ********/
|
||||
|
||||
typedef struct _dtCvDspLine {
|
||||
_DtCvValue processed;
|
||||
_DtCvUnit text_x;
|
||||
_DtCvUnit max_x;
|
||||
_DtCvUnit baseline;
|
||||
_DtCvUnit descent;
|
||||
_DtCvUnit ascent;
|
||||
int byte_index;
|
||||
int length;
|
||||
_DtCvSegmentI *seg_ptr;
|
||||
} _DtCvDspLine;
|
||||
|
||||
typedef struct _dtCvLineSeg {
|
||||
_DtCvValue processed;
|
||||
short dir;
|
||||
_DtCvUnit pos_x;
|
||||
_DtCvUnit max_x;
|
||||
_DtCvUnit pos_y;
|
||||
_DtCvUnit max_y;
|
||||
_DtCvUnit width;
|
||||
_DtCvPointer data;
|
||||
} _DtCvLineSeg;
|
||||
|
||||
typedef struct _dtCvPointData {
|
||||
_DtCvUnit x;
|
||||
_DtCvUnit y; /* baseline of the line */
|
||||
int line_idx;
|
||||
int char_idx;
|
||||
} _DtCvPointData;
|
||||
|
||||
typedef struct _dtCvMarkData {
|
||||
_DtCvValue on;
|
||||
_DtCvPointer client_data;
|
||||
_DtCvPointData beg;
|
||||
_DtCvPointData end;
|
||||
} _DtCvMarkData;
|
||||
|
||||
typedef struct _dtCvTraversalInfo {
|
||||
_DtCvValue active;
|
||||
_DtCvTraversalType type; /* the type of the traversal */
|
||||
int idx; /* the index into the approp. struct */
|
||||
/* either the txt_lst or marks */
|
||||
_DtCvUnit x_pos; /* x pos on the line. */
|
||||
_DtCvUnit y_pos; /* top y pos of bounding box */
|
||||
_DtCvUnit width; /* width of link on 1st line only */
|
||||
_DtCvUnit height; /* height of 1st line bounding box */
|
||||
_DtCvSegmentI *seg_ptr; /* ptr to first seg of link */
|
||||
} _DtCvTraversalInfo;
|
||||
|
||||
typedef struct _dtCvSearchData {
|
||||
int idx; /* the line index of the search hit */
|
||||
_DtCvDspLine *lst; /* pointer to the text line list */
|
||||
} _DtCvSearchData;
|
||||
|
||||
typedef struct _dtCanvasStruct {
|
||||
int error;
|
||||
int txt_cnt; /* maximum used in txt_list */
|
||||
int txt_max; /* maximum in txt_list */
|
||||
|
||||
int line_cnt; /* maximum used in line_lst */
|
||||
int line_max; /* maximum in line_lst */
|
||||
int mark_cnt; /* mark counter */
|
||||
int mark_max; /* maximum in mark_lst */
|
||||
|
||||
int trav_cnt; /* maximum used in trav_lst */
|
||||
int trav_max; /* maximum in trav_lst */
|
||||
int cur_trav; /* traversal indicator */
|
||||
|
||||
int search_cnt;
|
||||
int search_max;
|
||||
|
||||
int brk_cnt; /* the number of page breaks */
|
||||
int brk_max; /* the maxium entries */
|
||||
|
||||
short mb_length; /* The maximum length of a char */
|
||||
|
||||
_DtCvUnit max_x; /* The maximum x position */
|
||||
_DtCvUnit max_y; /* The maximum y position */
|
||||
_DtCvValue constraint; /* Indicates if the right
|
||||
boundary can be breached */
|
||||
_DtCvValue trav_on; /* Indicates if the traversal
|
||||
is on or off. */
|
||||
_DtCvPointer client_data;
|
||||
_DtCvMetrics metrics;
|
||||
_DtCvSpaceMetrics link_info;
|
||||
_DtCvSpaceMetrics traversal_info;
|
||||
_DtCvLocale locale;
|
||||
|
||||
_DtCvSegmentI *element_lst;
|
||||
_DtCvDspLine *txt_lst;
|
||||
_DtCvLineSeg *line_lst;
|
||||
_DtCvTraversalInfo *trav_lst;
|
||||
_DtCvLinkDb link_data;
|
||||
_DtCvPointData select_start;
|
||||
_DtCvPointData select_end;
|
||||
_DtCvMarkData *marks;
|
||||
_DtCvSearchData *searchs;
|
||||
_DtCvUnit *pg_breaks;
|
||||
_DtCvVirtualInfo virt_functions;
|
||||
|
||||
} _DtCanvasStruct;
|
||||
|
||||
/******** Internal Structure Typedef Declarations ********/
|
||||
typedef struct _dtCvPointData _DtCvSelectData;
|
||||
|
||||
/******** Internal Macros Declarations ********/
|
||||
|
||||
#define _DtCvHasTraversal(x) ((x) & _DtCvTRAVERSAL_FLAG)
|
||||
|
||||
/*
|
||||
* segment type access
|
||||
*/
|
||||
#define _DtCvIsTypeNoop(x) \
|
||||
((((x) & _DtCvPRIMARY_MASK) == _DtCvNOOP) ? 1 : 0)
|
||||
|
||||
/*
|
||||
* Is a flag set
|
||||
*/
|
||||
#define _DtCvIsSegVisibleLink(x) _DtCvIsSegHyperText(x)
|
||||
#define _DtCvIsSegALink(x) \
|
||||
(_DtCvIsSegHyperText(x) || _DtCvIsSegGhostLink(x))
|
||||
|
||||
#define _DtCvIsMarkMaskOn(x) \
|
||||
(((x) & _DtCvACTIVATE_MARK_ON) ? _DtCvTRUE : _DtCvFALSE)
|
||||
|
||||
/*
|
||||
* remove masks
|
||||
*/
|
||||
#define _DtCvRemoveBeginFlags(x) x &= ~(_DtCvTRAVERSAL_BEGIN | \
|
||||
_DtCvLINK_BEGIN | \
|
||||
_DtCvMARK_BEGIN | \
|
||||
_DtCvSEARCH_BEGIN)
|
||||
#define _DtCvSetSearchEnd(x,seg) x |= ((seg)->type & _DtCvSEARCH_END)
|
||||
#define _DtCvSetSearchBegin(x,seg) x |= ((seg)->type & _DtCvSEARCH_BEGIN)
|
||||
#define _DtCvClearSearchFlags(x) x &= ~(_DtCvSEARCH_FLAG | \
|
||||
_DtCvSEARCH_BEGIN | \
|
||||
_DtCvSEARCH_END)
|
||||
|
||||
#define _DtCvClearLinkFlags(x) x &= ~(_DtCvLINK_FLAG | \
|
||||
_DtCvLINK_BEGIN | \
|
||||
_DtCvLINK_END | \
|
||||
_DtCvLINK_POP_UP | \
|
||||
_DtCvLINK_NEW_WINDOW)
|
||||
|
||||
#define _DtCvClearProcessed(x) (x).processed = False
|
||||
#define _DtCvSetProcessed(x) (x).processed = True
|
||||
#define _DtCvIsProcessed(x) (x).processed
|
||||
#define _DtCvIsNotProcessed(x) ((False == (x).processed) ? True : False)
|
||||
#define _DtCvStraddlesPt(pt,min,max) ((min) <= (pt) && (pt) <= (max))
|
||||
|
||||
/******** Internal Function Declarations ********/
|
||||
extern _DtCvUnit _DtCvAdjustForSuperSub(
|
||||
_DtCanvasStruct *canvas,
|
||||
_DtCvSegmentI *p_seg,
|
||||
_DtCvUnit start_x,
|
||||
_DtCvUnit *script_x,
|
||||
_DtCvUnit *super_width,
|
||||
_DtCvUnit *super_y,
|
||||
_DtCvUnit *sub_width,
|
||||
_DtCvUnit *sub_y,
|
||||
_DtCvValue *super_flag,
|
||||
_DtCvValue *sub_flag);
|
||||
extern _DtCvUnit _DtCvAdvanceXOfLine (
|
||||
_DtCanvasStruct *canvas,
|
||||
_DtCvSegmentI *p_seg,
|
||||
_DtCvUnit x_pos,
|
||||
int *link_idx,
|
||||
_DtCvValue *link_flag);
|
||||
extern _DtCvStatus _DtCvCheckInfringement (
|
||||
_DtCvUnit tst_top,
|
||||
_DtCvUnit tst_bot,
|
||||
_DtCvUnit obj_top,
|
||||
_DtCvUnit obj_bot);
|
||||
extern void _DtCvCheckLineMarks (
|
||||
_DtCanvasStruct *canvas,
|
||||
int line_idx,
|
||||
int char_idx,
|
||||
int length,
|
||||
_DtCvUnit dst_x,
|
||||
_DtCvFlags check_flags,
|
||||
int *ret_len,
|
||||
_DtCvFlags *ret_old,
|
||||
_DtCvFlags *ret_new);
|
||||
extern void _DtCvClearInternalUse (
|
||||
_DtCvSegmentI *list,
|
||||
_DtCvStatus flag);
|
||||
extern _DtCvUnit _DtCvDrawSegments(
|
||||
_DtCanvasStruct *canvas,
|
||||
_DtCvDspLine line,
|
||||
_DtCvSegmentI *p_seg,
|
||||
int start_char,
|
||||
int count,
|
||||
int *prev_lnk,
|
||||
_DtCvUnit txt_x,
|
||||
_DtCvUnit sel_x,
|
||||
_DtCvUnit *scriptX,
|
||||
_DtCvUnit *super_width,
|
||||
_DtCvUnit *super_y,
|
||||
_DtCvUnit *sub_width,
|
||||
_DtCvUnit *sub_y,
|
||||
_DtCvValue *last_was_sub,
|
||||
_DtCvValue *last_was_super,
|
||||
_DtCvValue *last_link_vis,
|
||||
_DtCvFlags old_flag,
|
||||
_DtCvFlags new_flag,
|
||||
_DtCvElemType trav_flag,
|
||||
_DtCvPointer trav_data);
|
||||
extern int _DtCvGetCharIdx(
|
||||
_DtCanvasStruct *canvas,
|
||||
_DtCvDspLine line,
|
||||
_DtCvUnit find_x);
|
||||
extern _DtCvUnit _DtCvGetStartXOfLine(
|
||||
_DtCvDspLine *line,
|
||||
_DtCvSegmentI **pSeg);
|
||||
extern void _DtCvGetWidthOfSegment(
|
||||
_DtCanvasStruct *canvas,
|
||||
_DtCvSegmentI *p_seg,
|
||||
int start,
|
||||
int max_cnt,
|
||||
int *ret_cnt,
|
||||
_DtCvUnit *ret_w,
|
||||
_DtCvValue *ret_trimmed);
|
||||
extern _DtCvValue _DtCvModifyXpos(
|
||||
_DtCvSpaceMetrics info,
|
||||
_DtCvSegmentI *seg,
|
||||
_DtCvValue tst_result,
|
||||
_DtCvValue old_result,
|
||||
int idx,
|
||||
_DtCvUnit *x_pos);
|
||||
extern void _DtCvSkipLineChars(
|
||||
_DtCanvasStruct *canvas,
|
||||
_DtCvSegmentI *p_seg,
|
||||
int start,
|
||||
int max_cnt,
|
||||
int use_len,
|
||||
int *ret_start,
|
||||
_DtCvSegmentI **ret_seg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtCanvasI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
254
cde/lib/DtHelp/CanvasOs.c
Normal file
254
cde/lib/DtHelp/CanvasOs.c
Normal file
@@ -0,0 +1,254 @@
|
||||
/* $XConsortium: CanvasOs.c /main/5 1996/05/09 03:40:38 drk $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: UtilSDL.c
|
||||
**
|
||||
** Project: Cde Help System
|
||||
**
|
||||
** Description: Utility functions for parsing an SDL volume.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/*
|
||||
* system includes
|
||||
*/
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
/*
|
||||
* Canvas Engine includes
|
||||
*/
|
||||
#include "CanvasP.h"
|
||||
|
||||
/*
|
||||
* private includes
|
||||
*/
|
||||
#include "bufioI.h"
|
||||
#include "CanvasOsI.h"
|
||||
|
||||
#ifdef NLS16
|
||||
#endif
|
||||
|
||||
/******** Private Function Declarations ********/
|
||||
/******** End Private Function Declarations ********/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private defines.
|
||||
*
|
||||
*****************************************************************************/
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private macros.
|
||||
*
|
||||
*****************************************************************************/
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private data.
|
||||
*
|
||||
*****************************************************************************/
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private Functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
/******************************************************************************
|
||||
*
|
||||
* Semi Public Functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*********************************************************************
|
||||
* Function: _DtCvRunInterp
|
||||
*
|
||||
* _DtCvRunInterp calls a script and maybe gets data.
|
||||
*
|
||||
*********************************************************************/
|
||||
int
|
||||
_DtCvRunInterp(
|
||||
int (*filter_exec)(),
|
||||
_DtCvPointer client_data,
|
||||
char *interp,
|
||||
char *data,
|
||||
char **ret_data)
|
||||
{
|
||||
int result;
|
||||
int myFd;
|
||||
FILE *myFile;
|
||||
int size;
|
||||
int writeBufSize = 0;
|
||||
char *writeBuf = NULL;
|
||||
char *ptr;
|
||||
char *fileName;
|
||||
char *newData;
|
||||
char readBuf[BUFSIZ];
|
||||
BufFilePtr myBufFile;
|
||||
|
||||
/*
|
||||
* ask for permission to run the interperator command.
|
||||
*/
|
||||
newData = data;
|
||||
if (filter_exec != NULL && (*filter_exec)(client_data,data,&newData) != 0)
|
||||
return -1;
|
||||
|
||||
/*
|
||||
* open a temporary file to write the data to.
|
||||
*/
|
||||
fileName = tempnam(NULL, NULL);
|
||||
if (fileName == NULL)
|
||||
{
|
||||
if (newData != data)
|
||||
free(newData);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* write the data to file.
|
||||
*/
|
||||
result = -1;
|
||||
myFd = open(fileName, O_WRONLY | O_CREAT | O_TRUNC);
|
||||
if (myFd != -1)
|
||||
{
|
||||
/*
|
||||
* write the data to the file
|
||||
*/
|
||||
result = write(myFd, newData, strlen(newData));
|
||||
|
||||
if (result != -1)
|
||||
{
|
||||
/*
|
||||
* change the access permissions so the interpreter can read
|
||||
* the file.
|
||||
*/
|
||||
result = fchmod(myFd, S_IRUSR | S_IRGRP | S_IROTH);
|
||||
}
|
||||
|
||||
/*
|
||||
* close the file.
|
||||
*/
|
||||
close(myFd);
|
||||
}
|
||||
|
||||
if (newData != data)
|
||||
free(newData);
|
||||
|
||||
if (result == -1)
|
||||
{
|
||||
unlink(fileName);
|
||||
free(fileName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* create the system command string with its parameters
|
||||
*/
|
||||
ptr = (char *) malloc(sizeof(interp) + strlen(fileName) + 1);
|
||||
if (!ptr)
|
||||
{
|
||||
unlink(fileName);
|
||||
free(fileName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
strcpy (ptr, interp);
|
||||
strcat (ptr, " ");
|
||||
strcat (ptr, fileName);
|
||||
|
||||
myFile = popen(ptr, "r");
|
||||
|
||||
/*
|
||||
* free the command
|
||||
*/
|
||||
free (ptr);
|
||||
|
||||
/*
|
||||
* check for problems
|
||||
*/
|
||||
if (!myFile) /* couldn't create execString process */
|
||||
{
|
||||
unlink(fileName);
|
||||
free(fileName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* create a file handler for the pipe.
|
||||
*/
|
||||
myBufFile = _DtHelpCeCreatePipeBufFile(myFile);
|
||||
if (myBufFile == NULL)
|
||||
{
|
||||
(void) pclose(myFile); /* don't check for error, it was popen'd */
|
||||
unlink(fileName);
|
||||
free(fileName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* read the file the pipe writes to until the pipe finishes.
|
||||
* Create a string from the results
|
||||
*/
|
||||
do {
|
||||
readBuf[0] = '\0';
|
||||
ptr = readBuf;
|
||||
|
||||
result = _DtHelpCeGetNxtBuf(myBufFile, readBuf, &ptr, BUFSIZ);
|
||||
|
||||
if (result > 0)
|
||||
{
|
||||
size = strlen(readBuf);
|
||||
if (writeBuf == NULL)
|
||||
writeBuf = (char *) malloc (size + 1);
|
||||
else
|
||||
writeBuf = (char *) realloc (writeBuf, writeBufSize + size + 1);
|
||||
|
||||
if (writeBuf != NULL)
|
||||
{
|
||||
writeBuf[writeBufSize] = '\0';
|
||||
strcat(writeBuf, readBuf);
|
||||
writeBufSize += size;
|
||||
}
|
||||
else
|
||||
result = -1;
|
||||
}
|
||||
} while (result != -1 && !feof(FileStream(myBufFile)));
|
||||
|
||||
/*
|
||||
* close the pipe
|
||||
*/
|
||||
_DtHelpCeBufFileClose (myBufFile, True);
|
||||
|
||||
if (result == -1)
|
||||
{
|
||||
if (writeBuf != NULL)
|
||||
free(writeBuf);
|
||||
|
||||
writeBuf = NULL;
|
||||
}
|
||||
else
|
||||
result = 0;
|
||||
|
||||
/*
|
||||
* unlink the temporary file and free the memory.
|
||||
*/
|
||||
unlink(fileName);
|
||||
free(fileName);
|
||||
|
||||
/*
|
||||
* return the data
|
||||
*/
|
||||
*ret_data = writeBuf;
|
||||
|
||||
return result;
|
||||
|
||||
} /* End _DtCvRunInterp */
|
||||
54
cde/lib/DtHelp/CanvasOsI.h
Normal file
54
cde/lib/DtHelp/CanvasOsI.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/* $XConsortium: CanvasOsI.h /main/3 1996/05/09 03:40:52 drk $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: CanvasOsI.h
|
||||
**
|
||||
** Project:
|
||||
**
|
||||
** Description: Public Header file for Canvas.c
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
#ifndef _DtCanvasOsI_h
|
||||
#define _DtCanvasOsI_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/******** Internal Defines Declarations ********/
|
||||
|
||||
/******** Internal Enum Declarations ********/
|
||||
|
||||
/******** Internal Typedef Declarations ********/
|
||||
|
||||
/******** Internal Structures Declarations ********/
|
||||
|
||||
/******** Internal Define Declarations ********/
|
||||
|
||||
/******** Internal Macros Declarations ********/
|
||||
|
||||
/******** Internal Function Declarations ********/
|
||||
extern int _DtCvRunInterp(
|
||||
int (*filter)(),
|
||||
_DtCvPointer client_data,
|
||||
char *interp,
|
||||
char *data,
|
||||
char **ret_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtCanvasOsI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
492
cde/lib/DtHelp/CanvasP.h
Normal file
492
cde/lib/DtHelp/CanvasP.h
Normal file
@@ -0,0 +1,492 @@
|
||||
/* $TOG: CanvasP.h /main/17 1999/10/14 13:19:41 mgreess $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: CanvasP.h
|
||||
**
|
||||
** Project: Cde Help System
|
||||
**
|
||||
** Description: Private Header file for the UI independent core engine
|
||||
** of the help system. It contains function prototypes,
|
||||
** structure definitions, typedefs, etc.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
*****************************************************************************
|
||||
*************************************<+>*************************************/
|
||||
#ifndef _DtCanvasP_h
|
||||
#define _DtCanvasP_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******** Public Re-defines ********/
|
||||
#if !defined(_AIX) && !defined(USL)
|
||||
#define _DtCvStrCaseCmp(s1,s2) strcasecmp(s1,s2)
|
||||
#define _DtCvStrNCaseCmp(s1,s2, n) strncasecmp(s1,s2,n)
|
||||
#else
|
||||
#define _DtCvStrCaseCmp(s1,s2) _DtHelpCeStrCaseCmp(s1,s2)
|
||||
#define _DtCvStrNCaseCmp(s1,s2,n) _DtHelpCeStrNCaseCmp(s1,s2, n)
|
||||
#endif /* _AIX or USL */
|
||||
|
||||
/******** Public Defines Declarations ********/
|
||||
/*
|
||||
* true, false and null
|
||||
*/
|
||||
#ifndef Null
|
||||
#define Null 0
|
||||
#endif
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
#ifndef False
|
||||
#define False 0
|
||||
#endif
|
||||
#ifndef True
|
||||
#define True 1
|
||||
#endif
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Get Selection Type Declarations
|
||||
*/
|
||||
#define _DtCvSELECTED_TEXT (1 << 0)
|
||||
#define _DtCvSELECTED_REGION (1 << 1)
|
||||
#define _DtCvSELECTED_ALL (~((unsigned int) 0))
|
||||
|
||||
/*
|
||||
* hypertext link types
|
||||
*/
|
||||
#define _DtCvLinkType_Execute 3
|
||||
#define _DtCvLinkType_ManPage 4
|
||||
#define _DtCvLinkType_AppDefine 5
|
||||
#define _DtCvLinkType_SameVolume 6
|
||||
#define _DtCvLinkType_CrossLink 7
|
||||
#define _DtCvLinkType_TextFile 8
|
||||
|
||||
/*
|
||||
* hypertext window hints
|
||||
*/
|
||||
#define _DtCvWindowHint_PopupWindow 1
|
||||
#define _DtCvWindowHint_CurrentWindow 2
|
||||
#define _DtCvWindowHint_NewWindow 3
|
||||
#define _DtCvWindowHint_Original 4
|
||||
|
||||
/*********************
|
||||
* Rendering flags
|
||||
*********************/
|
||||
|
||||
/*
|
||||
* Rendering flags - Link
|
||||
*/
|
||||
#define _DtCvLINK_FLAG (0x01 << 0)
|
||||
#define _DtCvLINK_BEGIN (0x01 << 1)
|
||||
#define _DtCvLINK_END (0x01 << 2)
|
||||
|
||||
#define _DtCvLINK_POP_UP (0x01 << 3)
|
||||
#define _DtCvLINK_NEW_WINDOW (0x01 << 4)
|
||||
|
||||
/*
|
||||
* Rendering flags - Search
|
||||
*
|
||||
* a gap is left for the search flags on a segment in CanvasSegP.h. If these
|
||||
* change value, the other values must move to accommodate it. */
|
||||
#define _DtCvSEARCH_FLAG (0x01 << 5)
|
||||
#define _DtCvSEARCH_BEGIN (0x01 << 6)
|
||||
#define _DtCvSEARCH_END (0x01 << 7)
|
||||
#define _DtCvSEARCH_CURR (0x01 << 8)
|
||||
|
||||
/*
|
||||
* Rendering flags - Mark
|
||||
*/
|
||||
#define _DtCvMARK_FLAG (0x01 << 9)
|
||||
#define _DtCvMARK_BEGIN (0x01 << 10)
|
||||
#define _DtCvMARK_END (0x01 << 11)
|
||||
#define _DtCvMARK_ON (0x01 << 12)
|
||||
|
||||
/*
|
||||
* Rendering flags - Traversal
|
||||
*/
|
||||
#define _DtCvTRAVERSAL_FLAG (0x01 << 13)
|
||||
#define _DtCvTRAVERSAL_BEGIN (0x01 << 14)
|
||||
#define _DtCvTRAVERSAL_END (0x01 << 15)
|
||||
|
||||
/*
|
||||
* Rendering flags - Application defined flags.
|
||||
*/
|
||||
#define _DtCvAPP_FIELD_OFFSET (16)
|
||||
#define _DtCvAPP_FIELD_MASK (0x0f << _DtCvAPP_FIELD_OFFSET)
|
||||
#define _DtCvAPP_FIELD_S_MASK (0x03 << _DtCvAPP_FIELD_OFFSET)
|
||||
#define _DtCvAPP_FLAG1 (0x01 << (_DtCvAPP_FIELD_OFFSET + 0))
|
||||
#define _DtCvAPP_FLAG2 (0x01 << (_DtCvAPP_FIELD_OFFSET + 1))
|
||||
#define _DtCvAPP_FLAG3 (0x01 << (_DtCvAPP_FIELD_OFFSET + 2))
|
||||
#define _DtCvAPP_FLAG4 (0x01 << (_DtCvAPP_FIELD_OFFSET + 3))
|
||||
|
||||
/*
|
||||
* Rendering flags - Selection
|
||||
*/
|
||||
#define _DtCvSELECTED_FLAG (0x01 << 20)
|
||||
#define _DtCvEND_OF_LINE (0x01 << 21)
|
||||
|
||||
/*
|
||||
* Activation masks
|
||||
*/
|
||||
#define _DtCvACTIVATE_SELECTION (0x01 << 0)
|
||||
#define _DtCvACTIVATE_MARK (0x01 << 1)
|
||||
#define _DtCvDEACTIVATE (0x01 << 2)
|
||||
#define _DtCvACTIVATE_MARK_ON (0x01 << 3)
|
||||
#define _DtCvACTIVATE_MARK_OFF (0x01 << 4)
|
||||
|
||||
/******** Public Enum Declarations ********/
|
||||
|
||||
/*
|
||||
* Element types
|
||||
*/
|
||||
enum _dtCvElemType
|
||||
{
|
||||
_DtCvBAD_TYPE,
|
||||
_DtCvCANVAS_TYPE,
|
||||
_DtCvLINE_TYPE,
|
||||
_DtCvLINK_TYPE,
|
||||
_DtCvLOCALE_TYPE,
|
||||
_DtCvMARK_TYPE,
|
||||
_DtCvREGION_TYPE,
|
||||
_DtCvSTRING_TYPE,
|
||||
_DtCvTRAVERSAL_TYPE
|
||||
};
|
||||
|
||||
typedef enum _dtCvElemType _DtCvElemType;
|
||||
|
||||
/*
|
||||
* Canvas Engine values. Either parameters or return values.
|
||||
*/
|
||||
enum _dtCvValue
|
||||
{
|
||||
/*
|
||||
* status types. i.e. True/False, Ok/Bad, etc.
|
||||
*/
|
||||
_DtCvFALSE = False,
|
||||
_DtCvSTATUS_OK = False,
|
||||
_DtCvTRUE = True,
|
||||
_DtCvSTATUS_BAD = True,
|
||||
_DtCvSTATUS_ID_BAD,
|
||||
_DtCvSTATUS_NONE,
|
||||
_DtCvSTATUS_LINK,
|
||||
_DtCvSTATUS_MARK,
|
||||
/*
|
||||
* Render types
|
||||
*/
|
||||
_DtCvRENDER_PARTIAL,
|
||||
_DtCvRENDER_COMPLETE,
|
||||
/*
|
||||
* Traversal defines
|
||||
*/
|
||||
_DtCvTRAVERSAL_OFF,
|
||||
_DtCvTRAVERSAL_ON,
|
||||
_DtCvTRAVERSAL_TOP,
|
||||
_DtCvTRAVERSAL_NEXT,
|
||||
_DtCvTRAVERSAL_PREV,
|
||||
_DtCvTRAVERSAL_BOTTOM,
|
||||
_DtCvTRAVERSAL_ID,
|
||||
_DtCvTRAVERSAL_MARK,
|
||||
/*
|
||||
* processing a selection types
|
||||
*/
|
||||
_DtCvSELECTION_CLEAR,
|
||||
_DtCvSELECTION_START,
|
||||
_DtCvSELECTION_UPDATE,
|
||||
_DtCvSELECTION_END,
|
||||
/*
|
||||
* honor the right boundary when laying out information
|
||||
*/
|
||||
_DtCvUSE_BOUNDARY,
|
||||
_DtCvUSE_BOUNDARY_MOVE,
|
||||
_DtCvIGNORE_BOUNDARY
|
||||
};
|
||||
|
||||
typedef enum _dtCvValue _DtCvValue;
|
||||
typedef enum _dtCvValue _DtCvStatus;
|
||||
typedef enum _dtCvValue _DtCvRenderType;
|
||||
typedef enum _dtCvValue _DtCvTraversalCmd;
|
||||
typedef enum _dtCvValue _DtCvSelectMode;
|
||||
|
||||
/*
|
||||
* line wrap mode types.
|
||||
*/
|
||||
enum _dtCvModeType
|
||||
{
|
||||
_DtCvModeWrapNone,
|
||||
_DtCvModeWrapDown,
|
||||
_DtCvModeWrapUp
|
||||
};
|
||||
|
||||
typedef enum _dtCvModeType _DtCvModeType;
|
||||
|
||||
/******** Public Typedef Declarations ********/
|
||||
typedef void* _DtCvPointer;
|
||||
typedef void* _DtCvHandle;
|
||||
|
||||
typedef int _DtCvUnit;
|
||||
|
||||
typedef unsigned long _DtCvFlags;
|
||||
|
||||
typedef struct _dtCvSegPts _DtCvSegPts;
|
||||
typedef struct _dtCvSegment _DtCvSegment;
|
||||
|
||||
/******** Public Structures Declarations ********/
|
||||
typedef struct _dtCvMetrics {
|
||||
_DtCvUnit width; /* max width of canvas area */
|
||||
_DtCvUnit height; /* max height of canvas area */
|
||||
_DtCvUnit top_margin; /* top margin to allow for */
|
||||
_DtCvUnit side_margin; /* left margin to allow for */
|
||||
_DtCvUnit line_height; /* the height of an average line of */
|
||||
/* text */
|
||||
_DtCvUnit horiz_pad_hint; /* the optimul spacing to use if */
|
||||
/* lines have to be squeezed for */
|
||||
/* _DtCvUSE_BOUNDARY */
|
||||
} _DtCvMetrics;
|
||||
|
||||
typedef struct _dtCvSpaceMetrics {
|
||||
_DtCvUnit space_before;
|
||||
_DtCvUnit space_after;
|
||||
_DtCvUnit space_above;
|
||||
_DtCvUnit space_below;
|
||||
} _DtCvSpaceMetrics;
|
||||
|
||||
typedef struct _dtCvLocale {
|
||||
_DtCvModeType line_wrap_mode; /* specifies the wrap mode */
|
||||
const wchar_t *cant_begin_chars; /* specifies the characters */
|
||||
/* that can't begin a line */
|
||||
const wchar_t *cant_end_chars; /* specifies the characters */
|
||||
/* that can't end a line */
|
||||
} _DtCvLocale;
|
||||
|
||||
typedef struct _dtCvStringInfo {
|
||||
const void *string;
|
||||
int byte_len;
|
||||
int wc;
|
||||
_DtCvPointer font_ptr;
|
||||
_DtCvPointer csd;
|
||||
} _DtCvStringInfo;
|
||||
|
||||
typedef struct _dtCvLineInfo {
|
||||
_DtCvUnit x2;
|
||||
_DtCvUnit y2;
|
||||
_DtCvUnit width;
|
||||
_DtCvPointer data;
|
||||
} _DtCvLineInfo;
|
||||
|
||||
typedef struct _dtCvRenderInfo {
|
||||
_DtCvPointer info;
|
||||
_DtCvUnit box_x;
|
||||
_DtCvUnit box_y;
|
||||
_DtCvUnit box_height;
|
||||
_DtCvUnit box_width;
|
||||
} _DtCvRenderInfo;
|
||||
|
||||
typedef struct _dtCvLinkInfo {
|
||||
char *specification;
|
||||
char *description;
|
||||
int hyper_type;
|
||||
int win_hint;
|
||||
_DtCvUnit offset_x;
|
||||
_DtCvUnit offset_y;
|
||||
} _DtCvLinkInfo;
|
||||
|
||||
typedef struct _dtCvPointInfo {
|
||||
_DtCvPointer client_data;
|
||||
_DtCvSegPts **segs;
|
||||
} _DtCvPointInfo;
|
||||
|
||||
/******** Public Structure Typedef Declarations ********/
|
||||
typedef struct _dtCvTopicInfo* _DtCvTopicPtr;
|
||||
|
||||
/******** Public Prototyped Procedures ********/
|
||||
typedef void (*_DtCvGetMetrics)(
|
||||
_DtCvPointer /* client_data */,
|
||||
_DtCvElemType /* elem_type */,
|
||||
_DtCvPointer /* ret_metrics */
|
||||
);
|
||||
|
||||
typedef void (*_DtCvRenderElem)(
|
||||
_DtCvPointer /* client_data */,
|
||||
_DtCvElemType /* elem_type */,
|
||||
_DtCvUnit /* x */,
|
||||
_DtCvUnit /* y */,
|
||||
int /* link_type */,
|
||||
_DtCvFlags /* old_flags */,
|
||||
_DtCvFlags /* new_flags */,
|
||||
_DtCvElemType /* trav_type */,
|
||||
_DtCvPointer /* trav_data */,
|
||||
_DtCvPointer /* data */
|
||||
);
|
||||
|
||||
typedef _DtCvUnit (*_DtCvGetElemWidth)(
|
||||
_DtCvPointer /* client_data */,
|
||||
_DtCvElemType /* elem_type */,
|
||||
_DtCvPointer /* data */
|
||||
);
|
||||
|
||||
typedef void (*_DtCvGetFontMetrics)(
|
||||
_DtCvPointer /* client_data */,
|
||||
_DtCvPointer /* font_ptr */,
|
||||
_DtCvUnit* /* *ret_ascent */,
|
||||
_DtCvUnit* /* *ret_descent */,
|
||||
_DtCvUnit* /* *ret_width */,
|
||||
_DtCvUnit* /* *ret_super */,
|
||||
_DtCvUnit* /* *ret_sub */
|
||||
);
|
||||
|
||||
typedef _DtCvStatus (*_DtCvBuildSelection)(
|
||||
_DtCvPointer /* client_data */,
|
||||
_DtCvElemType /* elem_type */,
|
||||
unsigned int /* mask */,
|
||||
_DtCvPointer* /* prev_info */,
|
||||
_DtCvUnit /* space */,
|
||||
_DtCvUnit /* width */,
|
||||
_DtCvFlags /* flags */,
|
||||
_DtCvPointer /* data */
|
||||
);
|
||||
|
||||
typedef int (*_DtCvFilterExecCmd)(
|
||||
_DtCvPointer /* client_data */,
|
||||
const char* /* cmd */,
|
||||
char** /* ret_cmd */
|
||||
);
|
||||
|
||||
/******** Public Structures Declarations ********/
|
||||
typedef struct _dtCvVirtualInfo {
|
||||
_DtCvGetMetrics get_metrics;
|
||||
_DtCvRenderElem render_elem;
|
||||
_DtCvGetElemWidth get_width;
|
||||
_DtCvGetFontMetrics get_font_metrics;
|
||||
_DtCvBuildSelection build_selection;
|
||||
_DtCvFilterExecCmd exec_cmd_filter;
|
||||
} _DtCvVirtualInfo;
|
||||
|
||||
typedef struct _dtCvMarkPos {
|
||||
_DtCvPointer client_data;
|
||||
_DtCvUnit x1;
|
||||
_DtCvUnit y1;
|
||||
_DtCvUnit baseline1;
|
||||
_DtCvUnit x2;
|
||||
_DtCvUnit y2;
|
||||
_DtCvUnit baseline2;
|
||||
} _DtCvMarkPos;
|
||||
|
||||
/******** Public Macro Declarations ********/
|
||||
|
||||
/******** Semi-Public Function Declarations ********/
|
||||
extern int _DtCvGetSearchLineMetrics(
|
||||
_DtCvHandle canvas_handle,
|
||||
int search_hit_index,
|
||||
_DtCvUnit* baseline,
|
||||
_DtCvUnit* descent,
|
||||
_DtCvUnit* ascent);
|
||||
|
||||
/******** Public Function Declarations ********/
|
||||
extern _DtCvStatus _DtCanvasActivatePts(
|
||||
_DtCvHandle canvas_handle,
|
||||
unsigned int mask,
|
||||
_DtCvPointInfo *info,
|
||||
_DtCvUnit *ret_y1,
|
||||
_DtCvUnit *ret_y2);
|
||||
extern void _DtCanvasClean(
|
||||
_DtCvHandle canvas_handle);
|
||||
extern _DtCvHandle _DtCanvasCreate(
|
||||
_DtCvVirtualInfo virt_info,
|
||||
_DtCvPointer client_data);
|
||||
extern void _DtCanvasDestroy(
|
||||
_DtCvHandle canvas_handle);
|
||||
extern _DtCvStatus _DtCanvasGetCurLink(
|
||||
_DtCvHandle canvas_handle,
|
||||
_DtCvLinkInfo *ret_info);
|
||||
extern _DtCvStatus _DtCanvasGetCurTraversal(
|
||||
_DtCvHandle canvas_handle,
|
||||
_DtCvLinkInfo *ret_info,
|
||||
_DtCvPointer *ret_data);
|
||||
extern _DtCvStatus _DtCanvasGetMarkPositions(
|
||||
_DtCvHandle canvas_handle,
|
||||
_DtCvMarkPos ***ret_pos);
|
||||
extern _DtCvStatus _DtCanvasGetPosLink(
|
||||
_DtCvHandle canvas_handle,
|
||||
_DtCvUnit x1,
|
||||
_DtCvUnit y1,
|
||||
_DtCvUnit x2,
|
||||
_DtCvUnit y2,
|
||||
_DtCvLinkInfo *ret_info);
|
||||
extern _DtCvStatus _DtCanvasGetSelection(
|
||||
_DtCvHandle canvas_handle,
|
||||
unsigned int mask,
|
||||
_DtCvPointer *ret_select);
|
||||
extern _DtCvStatus _DtCanvasGetSelectionPoints(
|
||||
_DtCvHandle canvas_handle,
|
||||
_DtCvSegPts ***ret_segs,
|
||||
_DtCvUnit *ret_y1,
|
||||
_DtCvUnit *ret_y2);
|
||||
extern _DtCvStatus _DtCanvasGetSpotInfo(
|
||||
_DtCvHandle canvas_handle,
|
||||
_DtCvUnit x,
|
||||
_DtCvUnit y,
|
||||
_DtCvSegment **ret_seg,
|
||||
_DtCvUnit *ret_offx,
|
||||
_DtCvUnit *ret_offy,
|
||||
_DtCvElemType *ret_element);
|
||||
extern _DtCvStatus _DtCanvasMoveTraversal(
|
||||
_DtCvHandle canvas_handle,
|
||||
_DtCvTraversalCmd cmd,
|
||||
_DtCvValue wrap,
|
||||
_DtCvValue render,
|
||||
_DtCvPointer rid,
|
||||
_DtCvUnit *ret_x,
|
||||
_DtCvUnit *ret_y,
|
||||
_DtCvUnit *ret_baseline,
|
||||
_DtCvUnit *ret_height);
|
||||
extern void _DtCanvasProcessSelection (
|
||||
_DtCvHandle canvas_handle,
|
||||
_DtCvUnit x,
|
||||
_DtCvUnit y,
|
||||
_DtCvSelectMode mode);
|
||||
extern void _DtCanvasRender(
|
||||
_DtCvHandle canvas_handle,
|
||||
_DtCvUnit x1,
|
||||
_DtCvUnit y1,
|
||||
_DtCvUnit x2,
|
||||
_DtCvUnit y2,
|
||||
_DtCvRenderType flag,
|
||||
_DtCvValue pg_break,
|
||||
_DtCvUnit *max_y,
|
||||
_DtCvUnit *next_y);
|
||||
extern _DtCvStatus _DtCanvasResize(
|
||||
_DtCvHandle canvas_handle,
|
||||
_DtCvValue force,
|
||||
_DtCvUnit *ret_width,
|
||||
_DtCvUnit *ret_height);
|
||||
extern _DtCvStatus _DtCanvasSetTopic(
|
||||
_DtCvHandle canvas_handle,
|
||||
_DtCvTopicPtr topic_handle,
|
||||
_DtCvValue honor_size,
|
||||
_DtCvUnit *ret_width,
|
||||
_DtCvUnit *ret_height,
|
||||
_DtCvUnit *ret_y);
|
||||
extern void _DtCanvasLoadMetrics(
|
||||
_DtCvHandle canvas_handle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _DtCanvasP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
532
cde/lib/DtHelp/CanvasSegP.h
Normal file
532
cde/lib/DtHelp/CanvasSegP.h
Normal file
@@ -0,0 +1,532 @@
|
||||
/* $XConsortium: CanvasSegP.h /main/19 1996/10/04 18:30:19 rswiston $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: CanvasSegP.h
|
||||
**
|
||||
** Project:
|
||||
**
|
||||
** Description: Public Header file for Canvas Engine
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
#ifndef _DtCanvasSegP_h
|
||||
#define _DtCanvasSegP_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******** Public Defines Declarations ********/
|
||||
/*****************************************************************************
|
||||
* Some bits in passed in as a _DtCvFlags and the 'type' in _DtCvSegment
|
||||
* must match because they are passed straight thought from the segment
|
||||
* to the application. The following map is to help prevent colisions.
|
||||
*
|
||||
* (-------------------------> _DtCvEND_OF_LINE
|
||||
* | (-----------------------> _DtCvSELECTED_FLAG
|
||||
* | |
|
||||
* | | (-------------------------> _DtCvAPP_FLAG4 \
|
||||
* | | | (-----------------------> _DtCvAPP_FLAG3 \
|
||||
* | | | | (---------------------> _DtCvAPP_FLAG2 / _DtCvAPP_FIELD
|
||||
* | | | | | (-------------------> _DtCvAPP_FLAG1 /
|
||||
* | | | | | |
|
||||
* | | | | | | (---------------------> _DtCvTRAVERSAL_END
|
||||
* | | | | | | | (-------------------> _DtCvTRAVERSAL_BEGIN
|
||||
* | | | | | | | | (-----------------> _DtCvTRAVERSAL_FLAG
|
||||
* | | | | | | | | |
|
||||
* | | | | | | | | | (-------------------> _DtCvMARK_ON
|
||||
* | | | | | | | | | | (-----------------> _DtCvMARK_END
|
||||
* | | | | | | | | | | | (---------------> _DtCvMARK_BEGIN
|
||||
* | | | | | | | | | | | | (-------------> _DtCvMARK_FLAG
|
||||
* | | | | | | | | | | | | |
|
||||
* | | | | | | | | | | | | | (-------------> _DtCvSEARCH_CURR
|
||||
* | | | | | | | | | | | | | | (-----------> _DtCvSEARCH_END
|
||||
* | | | | | | | | | | | | | | | (---------> _DtCvSEARCH_BEGIN
|
||||
* | | | | | | | | | | | | | | | | (-------> _DtCvSEARCH_FLAG
|
||||
* | | | | | | | | | | | | | | | | |
|
||||
* | | | | | | | | | | | | | | | | | (---------> _DtCvLINK_NEW_WINDOW
|
||||
* | | | | | | | | | | | | | | | | | | (-------> _DtCvLINK_POP_UP
|
||||
* | | | | | | | | | | | | | | | | | | | (-----> _DtCvLINK_END
|
||||
* | | | | | | | | | | | | | | | | | | | | (---> _DtCvLINK_BEGIN
|
||||
* | | | | | | | | | | | | | | | | | | | | | (-> _DtCvLINK_FLAG
|
||||
* | | | | | | | | | | | | | | | | | | | | | |
|
||||
* v v v v v v#v v v v v v v v#v v v v v v v v
|
||||
* 1 0 9 8 7 6#5 4 3 2 1 0 9 8#7 6 5 4 3 2 1 0
|
||||
* ------------#---------------#----------------
|
||||
* |.|.|.|.|.|.#.|.|.|.|.|.|.|.#.|.|.|.|.|.|.|.|
|
||||
* ------------#---------------#----------------
|
||||
* ^ ^ ^ ^ ^#^ ^ ^ ^ ^ ^ ^ ^#^ ^ ^ ^ ^^^^^
|
||||
* | | | | | | | | | | | | | | | | | \|/
|
||||
* | | | | | | | | | | | | | | | | | |
|
||||
* | | | | | | | | | | | | | | | | | (-> Segment type
|
||||
* | | | | | | | | | | | | | | | | (-----> _DtCvWIDE_CHAR
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* | | | | | | | | | | | | | | | (-----> _DtCvSEARCH_FLAG
|
||||
* | | | | | | | | | | | | | | (-------> _DtCvSEARCH_BEGIN
|
||||
* | | | | | | | | | | | | | (---------> _DtCvSEARCH_END
|
||||
* | | | | | | | | | | | | (-----------> _DtCvSEARCH_CURR
|
||||
* | | | | | | | | | | | |
|
||||
* | | | | | | | | | | | (---------> _DtCvCONTROLLER/_DtCvBLOCK_LINE/
|
||||
* | | | | | | | | | | | _DtCvNEW_LINE
|
||||
* | | | | | | | | | | (-----------> _DtCvSUB_SCRIPT
|
||||
* | | | | | | | | | (-------------> _DtCvSUPER_SCRIPT
|
||||
* | | | | | | | | (---------------> _DtCvGHOST_LINK
|
||||
* | | | | | | | (-----------------> _DtCvHYPER_TEXT
|
||||
* | | | | | | (-------------------> _DtCvNON_BREAK
|
||||
* | | | | | (---------------------> _DtCvIN_LINE
|
||||
* | | | | |
|
||||
* | | | | (---------------> _DtCvAPP_FLAG1 \
|
||||
* | | | (-----------------> _DtCvAPP_FLAG2 \ _DtCvAPP_FIELD
|
||||
* | | (-------------------> _DtCvAPP_FLAG3 /
|
||||
* | (---------------------> _DtCvAPP_FLAG4 /
|
||||
* |
|
||||
* (------------------> _DtCvPAGE_BREAK
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
* segment types
|
||||
*/
|
||||
#define _DtCvNOOP (0x00)
|
||||
#define _DtCvCONTAINER (0x01)
|
||||
#define _DtCvLINE (0x02)
|
||||
#define _DtCvMARKER (0x03)
|
||||
#define _DtCvREGION (0x04)
|
||||
#define _DtCvSTRING (0x05)
|
||||
#define _DtCvTABLE (0x06)
|
||||
|
||||
#define _DtCvPRIMARY_MASK (0x07)
|
||||
#define _DtCvSHIFT_PAST_PRIMARY 3
|
||||
|
||||
/*
|
||||
* character size manipulation
|
||||
*/
|
||||
#define _DtCvWIDE_CHAR (0x01 << _DtCvSHIFT_PAST_PRIMARY)
|
||||
|
||||
/*
|
||||
* segment flags
|
||||
*/
|
||||
/* leave a gap for the search flags defined in CanvasP.h */
|
||||
#define _DtCvSHIFT_TO_FLAGS 9
|
||||
|
||||
/* container only */
|
||||
#define _DtCvCONTROLLER (0x01 << (_DtCvSHIFT_TO_FLAGS + 0))
|
||||
|
||||
/* line type */
|
||||
#define _DtCvBLOCK_LINE (0x01 << (_DtCvSHIFT_TO_FLAGS + 0))
|
||||
|
||||
/* string & region (_DtCvNEW_LINE works on _DtCvNOOP too) */
|
||||
#define _DtCvNEW_LINE (0x01 << (_DtCvSHIFT_TO_FLAGS + 0))
|
||||
#define _DtCvSUB_SCRIPT (0x01 << (_DtCvSHIFT_TO_FLAGS + 1))
|
||||
#define _DtCvSUPER_SCRIPT (0x01 << (_DtCvSHIFT_TO_FLAGS + 2))
|
||||
#define _DtCvGHOST_LINK (0x01 << (_DtCvSHIFT_TO_FLAGS + 3))
|
||||
#define _DtCvHYPER_TEXT (0x01 << (_DtCvSHIFT_TO_FLAGS + 4))
|
||||
#define _DtCvNON_BREAK (0x01 << (_DtCvSHIFT_TO_FLAGS + 5))
|
||||
|
||||
/* region only */
|
||||
#define _DtCvIN_LINE (0x01 << (_DtCvSHIFT_TO_FLAGS + 6))
|
||||
|
||||
/* application flags - defined in CanvasP.h (starting at 16th bit for 4 bits) */
|
||||
|
||||
/* valid on any segment */
|
||||
#define _DtCvPAGE_BREAK (0x01 << (_DtCvSHIFT_TO_FLAGS + 11))
|
||||
|
||||
/* highlight macros */
|
||||
#define HILITE_OVERLINE 0
|
||||
#define HILITE_STRIKETHROUGH 1
|
||||
#define HILITE_UNDERLINE 2
|
||||
|
||||
/******** Public Enum Declarations ********/
|
||||
enum _dtCvFrmtOption
|
||||
{
|
||||
_DtCvOPTION_BAD,
|
||||
/*
|
||||
* string breaking types
|
||||
*/
|
||||
_DtCvLITERAL,
|
||||
_DtCvDYNAMIC,
|
||||
/*
|
||||
* table border types
|
||||
*/
|
||||
_DtCvBORDER_NONE,
|
||||
_DtCvBORDER_FULL,
|
||||
_DtCvBORDER_HORZ,
|
||||
_DtCvBORDER_VERT,
|
||||
_DtCvBORDER_TOP,
|
||||
_DtCvBORDER_BOTTOM,
|
||||
_DtCvBORDER_LEFT,
|
||||
_DtCvBORDER_RIGHT,
|
||||
_DtCvBORDER_TOP_LEFT,
|
||||
_DtCvBORDER_TOP_RIGHT,
|
||||
_DtCvBORDER_BOTTOM_LEFT,
|
||||
_DtCvBORDER_BOTTOM_RIGHT,
|
||||
/*
|
||||
* controller horizontal orientation
|
||||
*/
|
||||
_DtCvJUSTIFY_LEFT_CORNER,
|
||||
_DtCvJUSTIFY_LEFT, /* also container horizontal text placement */
|
||||
_DtCvJUSTIFY_LEFT_MARGIN,
|
||||
_DtCvJUSTIFY_CENTER, /* also container horiz/vert text placement */
|
||||
_DtCvJUSTIFY_RIGHT_MARGIN,
|
||||
_DtCvJUSTIFY_RIGHT, /* also container horizontal text placement */
|
||||
_DtCvJUSTIFY_RIGHT_CORNER,
|
||||
/*
|
||||
* extra container horizontal text placement
|
||||
*/
|
||||
_DtCvJUSTIFY_NUM,
|
||||
_DtCvJUSTIFY_CHAR,
|
||||
/*
|
||||
* inherit the parent's horizontal text placement
|
||||
*/
|
||||
_DtCvINHERIT,
|
||||
/*
|
||||
* controller vertical orientation, includes _DtCvJUSTIFY_CENTER
|
||||
*/
|
||||
_DtCvJUSTIFY_TOP, /* also container vertical text placement */
|
||||
_DtCvJUSTIFY_BOTTOM, /* also container vertical text placement */
|
||||
/*
|
||||
* controller flow types
|
||||
*/
|
||||
_DtCvWRAP,
|
||||
_DtCvWRAP_NONE,
|
||||
_DtCvWRAP_JOIN
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
hilite_overline = 0x01 << HILITE_OVERLINE,
|
||||
hilite_strikethrough = 0x01 << HILITE_STRIKETHROUGH,
|
||||
hilite_underline = 0x01 << HILITE_UNDERLINE
|
||||
} text_hilite_t;
|
||||
|
||||
/******** Public Enum Typedef Declarations ********/
|
||||
typedef enum _dtCvFrmtOption _DtCvFrmtOption;
|
||||
|
||||
/******** Public Structures Declarations ********/
|
||||
typedef struct _dtCvLine {
|
||||
_DtCvUnit width;
|
||||
_DtCvPointer data;
|
||||
} _DtCvLine;
|
||||
|
||||
#ifdef __osf__
|
||||
typedef struct _dtCvSegment * _DtCvSegmentPointer;
|
||||
#endif
|
||||
|
||||
typedef struct _dtCvContainer {
|
||||
char *id;
|
||||
char *justify_char;
|
||||
_DtCvFrmtOption type;
|
||||
_DtCvFrmtOption border;
|
||||
_DtCvFrmtOption justify;
|
||||
_DtCvFrmtOption vjustify;
|
||||
_DtCvFrmtOption orient;
|
||||
_DtCvFrmtOption vorient;
|
||||
_DtCvFrmtOption flow;
|
||||
int percent;
|
||||
_DtCvUnit leading;
|
||||
_DtCvUnit fmargin;
|
||||
_DtCvUnit lmargin;
|
||||
_DtCvUnit rmargin;
|
||||
_DtCvUnit tmargin;
|
||||
_DtCvUnit bmargin;
|
||||
_DtCvLine bdr_info;
|
||||
#ifdef __osf__
|
||||
_DtCvSegmentPointer seg_list;
|
||||
#else
|
||||
struct _dtCvSegment *seg_list;
|
||||
#endif
|
||||
} _DtCvContainer;
|
||||
|
||||
typedef struct _DtCvString {
|
||||
void *string;
|
||||
_DtCvPointer font;
|
||||
} _DtCvString;
|
||||
|
||||
typedef struct _dtCvRegion {
|
||||
_DtCvPointer info;
|
||||
_DtCvUnit width;
|
||||
_DtCvUnit height;
|
||||
_DtCvUnit ascent;
|
||||
} _DtCvRegion;
|
||||
|
||||
typedef struct _dtCvTable {
|
||||
int num_cols;
|
||||
char **col_w;
|
||||
_DtCvFrmtOption *col_justify;
|
||||
char *justify_chars;
|
||||
char **cell_ids;
|
||||
struct _dtCvSegment **cells;
|
||||
} _DtCvTable;
|
||||
|
||||
typedef union _dtCvSegHandles {
|
||||
_DtCvContainer container;
|
||||
_DtCvString string;
|
||||
_DtCvRegion region;
|
||||
_DtCvTable table;
|
||||
_DtCvLine rule;
|
||||
char *marker;
|
||||
} _DtCvSegHandles;
|
||||
|
||||
struct _dtCvSegment {
|
||||
unsigned long type;
|
||||
int link_idx;
|
||||
_DtCvSegHandles handle;
|
||||
struct _dtCvSegment *next_seg;
|
||||
struct _dtCvSegment *next_disp;
|
||||
_DtCvPointer client_use;
|
||||
_DtCvPointer internal_use;
|
||||
};
|
||||
|
||||
struct _dtCvSegPts {
|
||||
struct _dtCvSegment *segment;
|
||||
int offset;
|
||||
int len;
|
||||
};
|
||||
|
||||
#ifdef __osf__
|
||||
typedef struct _dtCvLinkDb * _DtCvLinkDbPointer;
|
||||
#endif
|
||||
|
||||
typedef struct _dtCvTopicInfo {
|
||||
char *id_str;
|
||||
struct _dtCvSegment *seg_list;
|
||||
_DtCvPointInfo **mark_list;
|
||||
#ifdef __osf__
|
||||
_DtCvLinkDbPointer link_data;
|
||||
#else
|
||||
struct _dtCvLinkDb *link_data;
|
||||
#endif
|
||||
} _DtCvTopicInfo;
|
||||
|
||||
typedef struct _dtCvStringClientData {
|
||||
unsigned int vcc;
|
||||
unsigned int vclen;
|
||||
|
||||
unsigned int hilite_type;
|
||||
|
||||
char* bg_color;
|
||||
char* fg_color;
|
||||
unsigned long bg_pixel;
|
||||
unsigned long fg_pixel;
|
||||
} _DtCvStringClientData;
|
||||
|
||||
typedef struct _dtCvRegionClientData {
|
||||
_DtCvPointer GraphicHandle;
|
||||
} _DtCvRegionClientData;
|
||||
|
||||
typedef union _dtCvClientData {
|
||||
_DtCvRegionClientData region;
|
||||
_DtCvStringClientData string;
|
||||
} _DtCvClientData;
|
||||
|
||||
/******** Public Structure Typedef Declarations ********/
|
||||
|
||||
/******** Public Prototyped Procedures ********/
|
||||
|
||||
/******** Public Macro Declarations ********/
|
||||
/*
|
||||
* set segment type
|
||||
*/
|
||||
#define _DtCvSetTypeToContainer(x) \
|
||||
(((x) & ~(_DtCvPRIMARY_MASK)) | _DtCvCONTAINER)
|
||||
#define _DtCvSetTypeToLine(x) \
|
||||
(((x) & ~(_DtCvPRIMARY_MASK)) | _DtCvLINE)
|
||||
#define _DtCvSetTypeToMarker(x) \
|
||||
(((x) & ~(_DtCvPRIMARY_MASK)) | _DtCvMARKER)
|
||||
#define _DtCvSetTypeToNoop(x) \
|
||||
(((x) & ~(_DtCvPRIMARY_MASK)) | _DtCvNOOP)
|
||||
#define _DtCvSetTypeToRegion(x) \
|
||||
(((x) & ~(_DtCvPRIMARY_MASK)) | _DtCvREGION)
|
||||
#define _DtCvSetTypeToString(x) \
|
||||
(((x) & ~(_DtCvPRIMARY_MASK)) | _DtCvSTRING)
|
||||
#define _DtCvSetTypeToTable(x) \
|
||||
(((x) & ~(_DtCvPRIMARY_MASK)) | _DtCvTABLE)
|
||||
/*
|
||||
* set segment flags
|
||||
*/
|
||||
#define _DtCvSetTypeToBlockLine(x) ((x) | _DtCvBLOCK_LINE)
|
||||
#define _DtCvSetTypeToController(x) ((x) | _DtCvCONTROLLER)
|
||||
#define _DtCvSetTypeToGhostLink(x) ((x) | _DtCvGHOST_LINK)
|
||||
#define _DtCvSetTypeToHyperText(x) ((x) | _DtCvHYPER_TEXT)
|
||||
#define _DtCvSetTypeToInLine(x) ((x) | _DtCvIN_LINE)
|
||||
#define _DtCvSetTypeToNewLine(x) ((x) | _DtCvNEW_LINE)
|
||||
#define _DtCvSetTypeToNonBreak(x) ((x) | _DtCvNON_BREAK)
|
||||
#define _DtCvSetTypeToSearch(x) ((x) | _DtCvSEARCH_FLAG)
|
||||
#define _DtCvSetTypeToSearchBegin(x) ((x) | _DtCvSEARCH_BEGIN)
|
||||
#define _DtCvSetTypeToSearchEnd(x) ((x) | _DtCvSEARCH_END)
|
||||
#define _DtCvSetTypeToSubScript(x) ((x) | _DtCvSUB_SCRIPT)
|
||||
#define _DtCvSetTypeToSuperScript(x) ((x) | _DtCvSUPER_SCRIPT)
|
||||
|
||||
/*
|
||||
* set character size
|
||||
*/
|
||||
#define _DtCvSetTypeToWideChar(x) ((x) | _DtCvWIDE_CHAR)
|
||||
|
||||
/*
|
||||
* set application flags and/or field
|
||||
*/
|
||||
#define _DtCvSetAppFlag1(x) ((x) | _DtCvAPP_FLAG1)
|
||||
#define _DtCvSetAppFlag2(x) ((x) | _DtCvAPP_FLAG2)
|
||||
#define _DtCvSetAppFlag3(x) ((x) | _DtCvAPP_FLAG3)
|
||||
#define _DtCvSetAppFlag4(x) ((x) | _DtCvAPP_FLAG4)
|
||||
#define _DtCvSetAppField(x,y) \
|
||||
(((x) & ~(_DtCvAPP_FIELD_MASK)) | \
|
||||
((y & _DtCvAPP_FIELD_MASK) << _DtCvAPP_FIELD_OFFSET))
|
||||
#define _DtCvSetAppFieldSmall(x,y) \
|
||||
(((x) & ~(_DtCvAPP_FIELD_S_MASK)) | \
|
||||
((y & _DtCvAPP_FIELD_S_MASK) << _DtCvAPP_FIELD_OFFSET))
|
||||
|
||||
/*
|
||||
* get the application field value
|
||||
*/
|
||||
#define _DtCvGetAppField(x) \
|
||||
(((x) & _DtCvAPP_FIELD_MASK) >> _DtCvAPP_FIELD_OFFSET)
|
||||
#define _DtCvGetAppFieldSmall(x) \
|
||||
(((x) & _DtCvAPP_FIELD_S_MASK) >> _DtCvAPP_FIELD_OFFSET)
|
||||
|
||||
/******** Semi-Public Macro Declarations ********/
|
||||
/*
|
||||
* get segment type
|
||||
*/
|
||||
#define _DtCvPrimaryTypeOfSeg(x) ((x->type) & _DtCvPRIMARY_MASK)
|
||||
#define _DtCvIsSegContainer(x) \
|
||||
(((((x)->type) & _DtCvPRIMARY_MASK) == _DtCvCONTAINER) ? 1 : 0)
|
||||
#define _DtCvIsSegLine(x) \
|
||||
(((((x)->type) & _DtCvPRIMARY_MASK) == _DtCvLINE) ? 1 : 0)
|
||||
#define _DtCvIsSegMarker(x) \
|
||||
(((((x)->type) & _DtCvPRIMARY_MASK) == _DtCvMARKER) ? 1 : 0)
|
||||
#define _DtCvIsSegNoop(x) \
|
||||
(((((x)->type) & _DtCvPRIMARY_MASK) == _DtCvNOOP) ? 1 : 0)
|
||||
#define _DtCvIsSegRegion(x) \
|
||||
(((((x)->type) & _DtCvPRIMARY_MASK) == _DtCvREGION) ? 1 : 0)
|
||||
#define _DtCvIsSegString(x) \
|
||||
(((((x)->type) & _DtCvPRIMARY_MASK) == _DtCvSTRING) ? 1 : 0)
|
||||
#define _DtCvIsSegTable(x) \
|
||||
(((((x)->type) & _DtCvPRIMARY_MASK) == _DtCvTABLE) ? 1 : 0)
|
||||
|
||||
/*
|
||||
* get segment flags
|
||||
*/
|
||||
#define _DtCvIsSegController(x) \
|
||||
((((x)->type) & _DtCvCONTROLLER) ? 1 : 0)
|
||||
#define _DtCvIsSegBlockLine(x) \
|
||||
((((x)->type) & _DtCvBLOCK_LINE) ? 1 : 0)
|
||||
#define _DtCvIsSegGhostLink(x) \
|
||||
((((x)->type) & _DtCvGHOST_LINK) ? 1 : 0)
|
||||
#define _DtCvIsSegHyperText(x) \
|
||||
((((x)->type) & _DtCvHYPER_TEXT) ? 1 : 0)
|
||||
#define _DtCvIsSegInLine(x) \
|
||||
((((x)->type) & _DtCvIN_LINE) ? 1 : 0)
|
||||
#define _DtCvIsSegNewLine(x) \
|
||||
((((x)->type) & _DtCvNEW_LINE) ? 1 : 0)
|
||||
#define _DtCvIsSegNonBreakingChar(x) \
|
||||
((((x)->type) & _DtCvNON_BREAK) ? 1 : 0)
|
||||
#define _DtCvIsSegPageBreak(x) \
|
||||
((((x)->type) & _DtCvPAGE_BREAK) ? 1 : 0)
|
||||
#define _DtCvIsSegRegChar(x) \
|
||||
((((x)->type) & _DtCvWIDE_CHAR) ? 0 : 1)
|
||||
#define _DtCvIsSegSubScript(x) \
|
||||
((((x)->type) & _DtCvSUB_SCRIPT) ? 1 : 0)
|
||||
#define _DtCvIsSegSuperScript(x) \
|
||||
((((x)->type) & _DtCvSUPER_SCRIPT) ? 1 : 0)
|
||||
#define _DtCvIsSegWideChar(x) \
|
||||
((((x)->type) & _DtCvWIDE_CHAR) ? 1 : 0)
|
||||
/*
|
||||
* segment access
|
||||
*/
|
||||
#define _DtCvNextSeg(x) ((x)->next_seg)
|
||||
#define _DtCvNextDisp(x) ((x)->next_disp)
|
||||
|
||||
/*
|
||||
* container access
|
||||
*/
|
||||
#define _DtCvContainerOfSeg(x) \
|
||||
((x)->handle.container)
|
||||
#define _DtCvContainerBMarginOfSeg(x) \
|
||||
((x)->handle.container.bmargin)
|
||||
#define _DtCvContainerBorderOfSeg(x) \
|
||||
((x)->handle.container.border)
|
||||
#define _DtCvContainerFlowOfSeg(x) \
|
||||
((x)->handle.container.flow)
|
||||
#define _DtCvContainerFMarginOfSeg(x) \
|
||||
((x)->handle.container.fmargin)
|
||||
#define _DtCvContainerIdOfSeg(x) \
|
||||
((x)->handle.container.id)
|
||||
#define _DtCvContainerJustifyCharOfSeg(x) \
|
||||
((x)->handle.container.justify_char)
|
||||
#define _DtCvContainerJustifyOfSeg(x) \
|
||||
((x)->handle.container.justify)
|
||||
#define _DtCvContainerLeadingOfSeg(x) \
|
||||
((x)->handle.container.leading)
|
||||
#define _DtCvContainerLineWidthOfSeg(x) \
|
||||
((x)->handle.container.bdr_info.width)
|
||||
#define _DtCvContainerLineDataOfSeg(x) \
|
||||
((x)->handle.container.bdr_info.data)
|
||||
#define _DtCvContainerListOfSeg(x) \
|
||||
((x)->handle.container.seg_list)
|
||||
#define _DtCvContainerLMarginOfSeg(x) \
|
||||
((x)->handle.container.lmargin)
|
||||
#define _DtCvContainerOrientOfSeg(x) \
|
||||
((x)->handle.container.orient)
|
||||
#define _DtCvContainerPercentOfSeg(x) \
|
||||
((x)->handle.container.percent)
|
||||
#define _DtCvContainerRMarginOfSeg(x) \
|
||||
((x)->handle.container.rmargin)
|
||||
#define _DtCvContainerTMarginOfSeg(x) \
|
||||
((x)->handle.container.tmargin)
|
||||
#define _DtCvContainerTypeOfSeg(x) \
|
||||
((x)->handle.container.type)
|
||||
#define _DtCvContainerVJustifyOfSeg(x) \
|
||||
((x)->handle.container.vjustify)
|
||||
#define _DtCvContainerVOrientOfSeg(x) \
|
||||
((x)->handle.container.vorient)
|
||||
|
||||
/*
|
||||
* marker access
|
||||
*/
|
||||
#define _DtCvIdOfMarkerSeg(x) ((x)->handle.marker)
|
||||
|
||||
/*
|
||||
* marker access
|
||||
*/
|
||||
#define _DtCvDataOfLineSeg(x) ((x)->handle.rule.data)
|
||||
#define _DtCvWidthOfLineSeg(x) ((x)->handle.rule.width)
|
||||
|
||||
/*
|
||||
* string access
|
||||
*/
|
||||
#define _DtCvStringOfStringSeg(x) ((x)->handle.string.string)
|
||||
#define _DtCvFontOfStringSeg(x) ((x)->handle.string.font)
|
||||
|
||||
/*
|
||||
* region access
|
||||
*/
|
||||
#define _DtCvInfoOfRegionSeg(x) ((x)->handle.region.info)
|
||||
#define _DtCvWidthOfRegionSeg(x) ((x)->handle.region.width)
|
||||
#define _DtCvHeightOfRegionSeg(x) ((x)->handle.region.height)
|
||||
#define _DtCvAscentOfRegionSeg(x) ((x)->handle.region.ascent)
|
||||
|
||||
/*
|
||||
* table access
|
||||
*/
|
||||
#define _DtCvNumColsOfTableSeg(x) ((x)->handle.table.num_cols)
|
||||
#define _DtCvColWOfTableSeg(x) ((x)->handle.table.col_w)
|
||||
#define _DtCvColJustifyOfTableSeg(x) ((x)->handle.table.col_justify)
|
||||
#define _DtCvJustifyCharsOfTableSeg(x) ((x)->handle.table.justify_chars)
|
||||
#define _DtCvCellIdsOfTableSeg(x) ((x)->handle.table.cell_ids)
|
||||
#define _DtCvCellsOfTableSeg(x) ((x)->handle.table.cells)
|
||||
|
||||
/******** Semi-Public Function Declarations ********/
|
||||
/******** Public Function Declarations ********/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtCanvasSegP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
307
cde/lib/DtHelp/CleanUp.c
Normal file
307
cde/lib/DtHelp/CleanUp.c
Normal file
@@ -0,0 +1,307 @@
|
||||
/* $XConsortium: CleanUp.c /main/10 1996/01/29 12:19:40 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: CleanUp.c
|
||||
**
|
||||
** Project: Cde DtHelp
|
||||
**
|
||||
** Description:
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/*
|
||||
* system includes
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
|
||||
/*
|
||||
* Canvas Engine includes
|
||||
*/
|
||||
#include "CanvasP.h"
|
||||
#include "CanvasSegP.h"
|
||||
#include "LinkMgrP.h"
|
||||
|
||||
/*
|
||||
* private includes
|
||||
*/
|
||||
#include "bufioI.h"
|
||||
#include "CleanUpI.h"
|
||||
#include "FontAttrI.h"
|
||||
#include "FormatUtilI.h"
|
||||
#include "RegionI.h"
|
||||
#include "XInterfaceI.h"
|
||||
|
||||
#ifdef NLS16
|
||||
#endif
|
||||
|
||||
/******** Private Function Declarations ********/
|
||||
/******** End Private Function Declarations ********/
|
||||
|
||||
/*****************************************************************************
|
||||
* Private Defines
|
||||
*****************************************************************************/
|
||||
/*****************************************************************************
|
||||
* Private Macros
|
||||
*****************************************************************************/
|
||||
#define AbbrevStr(x) (FrmtPrivInfoPtr(x)->abbrev)
|
||||
#define DupFlag(x) (FrmtPrivInfoPtr(x)->dup_flag)
|
||||
#define MatchInfo(x) (FrmtPrivInfoPtr(x)->match_info)
|
||||
#define TopFlag(x) (FrmtPrivInfoPtr(x)->top_block)
|
||||
/*****************************************************************************
|
||||
* Private Functions
|
||||
*****************************************************************************/
|
||||
static void
|
||||
CheckFreePrivInfo(_DtCvSegment *seg)
|
||||
{
|
||||
/*
|
||||
* free the match information
|
||||
*/
|
||||
if (NULL != MatchInfo(seg))
|
||||
{
|
||||
SdlMatchData *m = (SdlMatchData *)(MatchInfo(seg));
|
||||
|
||||
if (NULL != m->ssi)
|
||||
free(m->ssi);
|
||||
free(m);
|
||||
}
|
||||
|
||||
/*
|
||||
* free any abbreviation
|
||||
*/
|
||||
if (NULL != AbbrevStr(seg))
|
||||
free(AbbrevStr(seg));
|
||||
}
|
||||
|
||||
static void
|
||||
FreePrivateAndSeg(_DtCvSegment *seg)
|
||||
{
|
||||
if (NULL != seg)
|
||||
{
|
||||
/*
|
||||
* free the private information block
|
||||
*/
|
||||
if (NULL != FrmtPrivInfoPtr(seg))
|
||||
free(FrmtPrivInfoPtr(seg));
|
||||
|
||||
/*
|
||||
* free the segment block
|
||||
*/
|
||||
free(seg);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Semi-Private Variables
|
||||
*****************************************************************************/
|
||||
/*****************************************************************************
|
||||
* Semi-Public Functions
|
||||
*****************************************************************************/
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpFreeSegments (_DtCvSegment *seg_list)
|
||||
*
|
||||
* Parameters:
|
||||
* seg_list Specifies the Canvas Engine segment list.
|
||||
*
|
||||
* Returns: Nothing
|
||||
*
|
||||
* Purpose: Free all memory associated with an SDL list.
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpFreeSegments (
|
||||
_DtCvSegment *seg_list,
|
||||
_DtCvStatus unresolved,
|
||||
void (*destroy_region)(),
|
||||
_DtCvPointer client_data)
|
||||
{
|
||||
int i;
|
||||
char dupFlag;
|
||||
char **strs;
|
||||
_DtCvSegment *nextSeg;
|
||||
_DtCvSegment *topSeg = NULL;
|
||||
_DtCvSegment *topTab = NULL;
|
||||
_DtCvSegment **tableSeg;
|
||||
_DtHelpDARegion *pReg;
|
||||
|
||||
while (seg_list != NULL)
|
||||
{
|
||||
dupFlag = DupFlag(seg_list);
|
||||
nextSeg = seg_list->next_seg;
|
||||
switch (_DtCvPrimaryTypeOfSeg(seg_list))
|
||||
{
|
||||
case _DtCvCONTAINER:
|
||||
/*
|
||||
* free the id block.
|
||||
*/
|
||||
if (False == dupFlag &&
|
||||
NULL != _DtCvContainerIdOfSeg(seg_list))
|
||||
free(_DtCvContainerIdOfSeg(seg_list));
|
||||
|
||||
/*
|
||||
* free the contents of the block
|
||||
*/
|
||||
_DtHelpFreeSegments(_DtCvContainerListOfSeg(seg_list),
|
||||
unresolved,
|
||||
destroy_region,
|
||||
client_data);
|
||||
break;
|
||||
|
||||
case _DtCvMARKER:
|
||||
if (False == dupFlag)
|
||||
free(_DtCvIdOfMarkerSeg(seg_list));
|
||||
break;
|
||||
|
||||
case _DtCvREGION:
|
||||
if (False == dupFlag && NULL != destroy_region)
|
||||
(destroy_region)(client_data,
|
||||
_DtCvInfoOfRegionSeg(seg_list));
|
||||
break;
|
||||
|
||||
case _DtCvSTRING:
|
||||
if (False == dupFlag)
|
||||
{
|
||||
free(_DtCvStringOfStringSeg(seg_list));
|
||||
if (True == unresolved &&
|
||||
NULL != _DtCvFontOfStringSeg(seg_list))
|
||||
free(_DtCvFontOfStringSeg(seg_list));
|
||||
}
|
||||
break;
|
||||
|
||||
case _DtCvTABLE:
|
||||
if (True == dupFlag)
|
||||
break;
|
||||
|
||||
/*
|
||||
* free the blocks
|
||||
*/
|
||||
tableSeg = _DtCvCellsOfTableSeg(seg_list);
|
||||
while (NULL != tableSeg && NULL != *tableSeg)
|
||||
{
|
||||
/*
|
||||
* free the id block.
|
||||
*/
|
||||
if (False == DupFlag(*tableSeg)
|
||||
&& NULL != _DtCvContainerIdOfSeg(*tableSeg))
|
||||
free(_DtCvContainerIdOfSeg(*tableSeg));
|
||||
|
||||
/*
|
||||
* free the contents of the block
|
||||
*/
|
||||
_DtHelpFreeSegments(
|
||||
_DtCvContainerListOfSeg(*tableSeg),
|
||||
unresolved,
|
||||
destroy_region,
|
||||
client_data);
|
||||
tableSeg++;
|
||||
}
|
||||
|
||||
/*
|
||||
* free each of the table cells
|
||||
*/
|
||||
tableSeg = _DtCvCellsOfTableSeg(seg_list);
|
||||
while (NULL != tableSeg && NULL != *tableSeg)
|
||||
{
|
||||
if (True == TopFlag(*tableSeg))
|
||||
{
|
||||
FreePrivateAndSeg(topTab);
|
||||
topTab = *tableSeg;
|
||||
}
|
||||
CheckFreePrivInfo(*tableSeg);
|
||||
tableSeg++;
|
||||
}
|
||||
|
||||
FreePrivateAndSeg(topTab);
|
||||
topTab = NULL;
|
||||
|
||||
/*
|
||||
* free the list of cells
|
||||
*/
|
||||
tableSeg = _DtCvCellsOfTableSeg(seg_list);
|
||||
free (tableSeg);
|
||||
|
||||
/*
|
||||
* free the row ids.
|
||||
*/
|
||||
_DtHelpCeFreeStringArray(
|
||||
_DtCvCellIdsOfTableSeg(seg_list));
|
||||
|
||||
/*
|
||||
* free the column justification and width.
|
||||
*/
|
||||
free((void *) _DtCvColJustifyOfTableSeg(seg_list));
|
||||
strs = _DtCvColWOfTableSeg(seg_list);
|
||||
for (i = 0;
|
||||
NULL != strs && i < _DtCvNumColsOfTableSeg(seg_list);
|
||||
i++, strs++)
|
||||
free((void *) *strs);
|
||||
if (NULL != _DtCvColWOfTableSeg(seg_list))
|
||||
free((void *) _DtCvColWOfTableSeg(seg_list));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
CheckFreePrivInfo(seg_list);
|
||||
if (True == TopFlag(seg_list))
|
||||
{
|
||||
FreePrivateAndSeg(topSeg);
|
||||
topSeg = seg_list;
|
||||
}
|
||||
seg_list = nextSeg;
|
||||
}
|
||||
|
||||
FreePrivateAndSeg(topSeg);
|
||||
|
||||
} /* End _DtHelpFreeSegments */
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpDestroyTopicData (
|
||||
* _DtCvSegment *seg_list)
|
||||
*
|
||||
* Parameters:
|
||||
* seg_list Specifies the SDL segment list.
|
||||
*
|
||||
* Returns: Nothing
|
||||
*
|
||||
* Purpose: Free all memory associated with an SDL list.
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpDestroyTopicData (
|
||||
_DtCvTopicInfo *topic,
|
||||
void (*destroy_region)(),
|
||||
_DtCvPointer client_data)
|
||||
{
|
||||
if (NULL != topic)
|
||||
{
|
||||
/*
|
||||
* free the segment list
|
||||
*/
|
||||
_DtHelpFreeSegments(topic->seg_list, _DtCvFALSE,
|
||||
destroy_region, client_data);
|
||||
|
||||
/*
|
||||
* free the id string
|
||||
*/
|
||||
if (NULL != topic->id_str)
|
||||
free(topic->id_str);
|
||||
|
||||
/*
|
||||
* free the database
|
||||
*/
|
||||
_DtLinkDbDestroy(topic->link_data);
|
||||
|
||||
/*
|
||||
* free the structure
|
||||
*/
|
||||
free(topic);
|
||||
}
|
||||
|
||||
} /* End _DtHelpDestroyTopicData */
|
||||
29
cde/lib/DtHelp/CleanUpI.h
Normal file
29
cde/lib/DtHelp/CleanUpI.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/* $XConsortium: CleanUpI.h /main/8 1996/01/29 12:19:46 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
** File: CleanUpI.h
|
||||
** Project: Common Desktop Environment
|
||||
**
|
||||
** (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 _DtHelpCleanUpI_h
|
||||
#define _DtHelpCleanUpI_h
|
||||
|
||||
/******** Public Function Declarations ********/
|
||||
extern void _DtHelpFreeSegments(
|
||||
_DtCvSegment *seg_list,
|
||||
_DtCvStatus unresolved,
|
||||
void (*destroy_region)(),
|
||||
_DtCvPointer client_data);
|
||||
extern void _DtHelpDestroyTopicData(
|
||||
_DtCvTopicPtr topic,
|
||||
void (*destroy_region)(),
|
||||
_DtCvPointer client_data);
|
||||
/******** End Public Function Declarations ********/
|
||||
|
||||
#endif /* _DtHelpCleanUpI_h */
|
||||
501
cde/lib/DtHelp/CvString.c
Normal file
501
cde/lib/DtHelp/CvString.c
Normal file
@@ -0,0 +1,501 @@
|
||||
/* $XConsortium: CvString.c /main/4 1996/08/30 15:28:00 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: CvString.c
|
||||
**
|
||||
** Project: Cde DtHelp
|
||||
**
|
||||
** Description: Semi private string functions - can be platform dependent.
|
||||
** These routines are straight C code. They do not require
|
||||
** includes to know about the Canvas Engine, the Help
|
||||
** dialogs or anything else.
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*
|
||||
* system includes
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* private includes
|
||||
*/
|
||||
#include "CvStringI.h"
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private variables and defines.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define REALLOC_INCR 10
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Semi Public Functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
/******************************************************************************
|
||||
* Function: _DtCvStrLen (const void *p1, int type)
|
||||
*
|
||||
* Paramenters:
|
||||
* p1 Specifies the string or wide char array to process.
|
||||
* type Specifies the type p1 is. 0 indicaates a string.
|
||||
* non-zero indicates a wide char array.
|
||||
* Returns:
|
||||
* >= 0 If p1 is non-null.
|
||||
* -1 If p1 is null.
|
||||
*
|
||||
* Purpose:
|
||||
* Returns in number of characters in p1.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtCvStrLen (
|
||||
const void *p1,
|
||||
int type )
|
||||
{
|
||||
int len = 0;
|
||||
const char *s1;
|
||||
const wchar_t *wcs;
|
||||
|
||||
if (0 == type)
|
||||
return (strlen((const char *) p1));
|
||||
|
||||
wcs = (wchar_t *) p1;
|
||||
while (0 != *wcs)
|
||||
{
|
||||
wcs++;
|
||||
len++;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: _DtCvStrPtr (const void *p1, int type, int count)
|
||||
*
|
||||
* Paramenters:
|
||||
* p1 Specifies the string or wide char array to process.
|
||||
* type Specifies the type p1 is. 0 indicaates a string.
|
||||
* non-zero indicates a wide char array.
|
||||
* count Specifies an index into p1.
|
||||
* Returns:
|
||||
* ptr If everything works okay.
|
||||
* NULL If problems.
|
||||
*
|
||||
* Purpose:
|
||||
* Get to a point in the wide character or char string.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void *
|
||||
_DtCvStrPtr (
|
||||
const void *p1,
|
||||
int type,
|
||||
int count)
|
||||
{
|
||||
|
||||
if (0 == type)
|
||||
return ((void *) (((char *) p1) + count));
|
||||
|
||||
return ((void *) (((wchar_t *) p1) + count));
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: _DtCvChar (const void *p1, int type, int count)
|
||||
*
|
||||
* Paramenters:
|
||||
* p1 Specifies the string or wide char array to process.
|
||||
* type Specifies the type p1 is. 0 indicaates a string.
|
||||
* non-zero indicates a wide char array.
|
||||
* count Specifies an index into p1.
|
||||
* Returns:
|
||||
* value If everything works okay.
|
||||
* (wchar_t) -1 If problems.
|
||||
*
|
||||
* Purpose:
|
||||
* Get a character value.
|
||||
*
|
||||
*****************************************************************************/
|
||||
wchar_t
|
||||
_DtCvChar (
|
||||
const void *p1,
|
||||
int type,
|
||||
int count)
|
||||
{
|
||||
wchar_t value = (wchar_t) -1;
|
||||
|
||||
if (0 == type)
|
||||
value = *(((char *) p1) + count);
|
||||
else
|
||||
value = *(((wchar_t *) p1) + count);
|
||||
|
||||
return (value);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: _DtCvStrcspn (const void *s1, const char *s2, type, &ret_len)
|
||||
*
|
||||
* Returns in 'ret_len' the length of the initial segment of string
|
||||
* s1 which consists entirely of characters not found in string s2.
|
||||
*
|
||||
* if type is 0, then s1 is a char* string.
|
||||
* if type is not 0, then s1 is a wchar_t* string.
|
||||
*
|
||||
* s2 cannot be more than 15 characters if looking a wide character
|
||||
* string in s1.
|
||||
*
|
||||
* Returns:
|
||||
* -1 If found an invalid character.
|
||||
* 0 If found a character in string s2
|
||||
* 1 If found the null byte character.
|
||||
* 2 s2 contained more than 15 characters, but found one of the
|
||||
* first fifteen characters in string s2.
|
||||
* 3 s2 contained more than 15 characters, and didn't find any
|
||||
* of the first fifteen characters in string s2.
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtCvStrcspn (
|
||||
const void *s1,
|
||||
const char *s2,
|
||||
int type,
|
||||
int *ret_len )
|
||||
{
|
||||
size_t num;
|
||||
wchar_t widec[16];
|
||||
const wchar_t *wcp;
|
||||
const wchar_t *wcp2;
|
||||
|
||||
if (NULL == s1)
|
||||
{
|
||||
*ret_len = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((0 == type && '\0' == *((char *) s1)) ||
|
||||
(0 != type && 0 == *((wchar_t *) s1)))
|
||||
{
|
||||
*ret_len = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (NULL == s2 || '\0' == *s2)
|
||||
{
|
||||
*ret_len = _DtCvStrLen (s1, type);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (0 == type)
|
||||
{
|
||||
/*
|
||||
* no need to go through any hassle, just use the 3C function
|
||||
*/
|
||||
*ret_len = strcspn ((char *) s1, s2);
|
||||
if ('\0' == ((char *) s1)[*ret_len])
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* convert the test string into a wide char array
|
||||
*/
|
||||
num = mbstowcs(widec, s2, 16);
|
||||
if ((size_t) -1 == num)
|
||||
return -1;
|
||||
|
||||
/*
|
||||
* force a null termination of the array
|
||||
*/
|
||||
widec[15] = 0;
|
||||
|
||||
/*
|
||||
* if greater than 15 characters were converted, set the flag to 2
|
||||
*/
|
||||
num = ((num > 15) ? 2 : 0);
|
||||
|
||||
wcp = s1;
|
||||
while (0 != *wcp)
|
||||
{
|
||||
wcp2 = widec;
|
||||
while (0 != *wcp2)
|
||||
{
|
||||
if (*wcp2 == *wcp)
|
||||
{
|
||||
*ret_len = wcp - (wchar_t *) s1;
|
||||
return 0 + num;
|
||||
}
|
||||
wcp2++;
|
||||
}
|
||||
wcp++;
|
||||
}
|
||||
|
||||
*ret_len = wcp - (wchar_t *) s1;
|
||||
return 1 + num;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Function: void **_DtCvAddPtrToArray (void **array, void *ptr)
|
||||
*
|
||||
* Parameters: array A pointer to a NULL-terminated array
|
||||
* of pointers.
|
||||
* ptr The pointer which is to be added to
|
||||
* the end of the array.
|
||||
*
|
||||
* Returns: A pointer to the NULL-terminated array created
|
||||
* by adding 'ptr' to the end of 'array'.
|
||||
*
|
||||
* Purpose: Add a new element to a NULL-terminated array of pointers.
|
||||
* These are typed as "void *" so that they can be used with
|
||||
* pointers to any type of data.
|
||||
*
|
||||
****************************************************************************/
|
||||
void **
|
||||
_DtCvAddPtrToArray (
|
||||
void **array,
|
||||
void *ptr)
|
||||
{
|
||||
|
||||
void **nextP = NULL;
|
||||
int numElements;
|
||||
|
||||
/* If this is the first item for the array, malloc the array and set
|
||||
nextP to point to the first element. */
|
||||
if (array == NULL || *array == NULL) {
|
||||
array = (void **) malloc (REALLOC_INCR * sizeof (void *));
|
||||
|
||||
nextP = array;
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
/* Find the NULL pointer at the end of the array. */
|
||||
numElements = 0;
|
||||
for (nextP = array; *nextP != NULL; nextP++)
|
||||
numElements++;
|
||||
|
||||
/* The array always grows by chunks of size REALLOC_INCR. So see if
|
||||
it currently is an exact multiple of REALLOC_INCR size (remember to
|
||||
count the NULL pointer). If it is then it must be full, so realloc
|
||||
another chunk. Also remember to move 'nextP' because the array
|
||||
will probably move in memory. */
|
||||
if ((numElements + 1) % REALLOC_INCR == 0) {
|
||||
array = (void **) realloc (array,
|
||||
(numElements + 1 + REALLOC_INCR) * sizeof (void *));
|
||||
if (array)
|
||||
nextP = array + numElements;
|
||||
else
|
||||
nextP = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (nextP)
|
||||
{
|
||||
*nextP++ = ptr;
|
||||
*nextP = NULL;
|
||||
}
|
||||
|
||||
return (array);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtCvFreeArray (void **array)
|
||||
*
|
||||
* Parameters: array A pointer to the NULL-terminated
|
||||
* string array which is to be freed.
|
||||
*
|
||||
* Return Value: 0 if successful, -1 if a failure occurs
|
||||
*
|
||||
* Purpose: Free the memory used for a NULL-terminated string array.
|
||||
*
|
||||
******************************************************************************/
|
||||
int
|
||||
_DtCvFreeArray (void **array)
|
||||
{
|
||||
void **next;
|
||||
|
||||
if (array == NULL)
|
||||
return -1;
|
||||
|
||||
for (next = array; *next != NULL; next++)
|
||||
free (*next);
|
||||
|
||||
free (array);
|
||||
return (0);
|
||||
}
|
||||
|
||||
#if defined(_AIX) || defined (USL) || defined(__uxp__)
|
||||
/*****************************************************************************
|
||||
* Function: _DtCvStrCaseCmp
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: IBM and USL do not support the 'strcasecmp' routine. This takes it's
|
||||
* place.
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtCvStrCaseCmp (
|
||||
const char *s1,
|
||||
const char *s2)
|
||||
{
|
||||
int c1;
|
||||
int c2;
|
||||
int result = 0;
|
||||
|
||||
if (s1 == s2) return 0;
|
||||
if (NULL == s1) return -1;
|
||||
if (NULL == s2) return 1;
|
||||
|
||||
|
||||
while (result == 0 && *s1 != '\0' && *s2 != '\0')
|
||||
{
|
||||
c1 = (unsigned char) *s1;
|
||||
c2 = (unsigned char) *s2;
|
||||
|
||||
if (isupper(c1))
|
||||
c1 = _tolower(c1);
|
||||
if (isupper(c2))
|
||||
c2 = _tolower(c2);
|
||||
|
||||
result = c1 - c2;
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
|
||||
if (result == 0 && (*s1 != '\0' || *s2 != '\0'))
|
||||
{
|
||||
c1 = (unsigned char) *s1;
|
||||
c2 = (unsigned char) *s2;
|
||||
|
||||
if (isupper(c1))
|
||||
c1 = _tolower(c1);
|
||||
if (isupper(c2))
|
||||
c2 = _tolower(c2);
|
||||
|
||||
result = c1 - c2;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif /* _AIX or USL */
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtCvStrNCaseCmpLatin1()
|
||||
*
|
||||
* Purpose: Does not use the tolower() functions to determine the lower
|
||||
* case of a character. On some platforms, using tolower() on
|
||||
* the upper case of a typical Latin1 character does not match
|
||||
* it's Latin1 one lower case.
|
||||
*
|
||||
* This routine is to be used only when we want to map strict
|
||||
* Latin1 characters to it's lower case. I.e. when we -know-
|
||||
* the data is in English.
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtCvStrNCaseCmpLatin1 (
|
||||
const char *s1,
|
||||
const char *s2,
|
||||
size_t n)
|
||||
{
|
||||
int c1;
|
||||
int c2;
|
||||
int result = 0;
|
||||
|
||||
if (s1 == s2 || n < 1) return 0;
|
||||
if (NULL == s1) return -1;
|
||||
if (NULL == s2) return 1;
|
||||
|
||||
|
||||
while (result == 0 && *s1 != '\0' && *s2 != '\0' && n > 0)
|
||||
{
|
||||
c1 = (unsigned char) *s1;
|
||||
c2 = (unsigned char) *s2;
|
||||
|
||||
c1 = _DtCvToLower(c1);
|
||||
c2 = _DtCvToLower(c2);
|
||||
|
||||
result = c1 - c2;
|
||||
s1++;
|
||||
s2++;
|
||||
n--;
|
||||
}
|
||||
|
||||
if (result == 0 && n > 0 && (*s1 != '\0' || *s2 != '\0'))
|
||||
{
|
||||
c1 = (unsigned char) *s1;
|
||||
c2 = (unsigned char) *s2;
|
||||
|
||||
c1 = _DtCvToLower(c1);
|
||||
c2 = _DtCvToLower(c2);
|
||||
|
||||
result = c1 - c2;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtCvStrCaseCmpLatin1
|
||||
*
|
||||
* Purpose: Does not use the tolower() functions to determine the lower
|
||||
* case of a character. On some platforms, using tolower() on
|
||||
* the upper case of a typical Latin1 character does not match
|
||||
* it's Latin1 one lower case.
|
||||
*
|
||||
* This routine is to be used only when we want to map strict
|
||||
* Latin1 characters to it's lower case. I.e. when we -know-
|
||||
* the data is in English.
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtCvStrCaseCmpLatin1 (
|
||||
const char *s1,
|
||||
const char *s2)
|
||||
{
|
||||
int c1;
|
||||
int c2;
|
||||
int result = 0;
|
||||
|
||||
if (s1 == s2) return 0;
|
||||
if (NULL == s1) return -1;
|
||||
if (NULL == s2) return 1;
|
||||
|
||||
|
||||
while (result == 0 && *s1 != '\0' && *s2 != '\0')
|
||||
{
|
||||
c1 = (unsigned char) *s1;
|
||||
c2 = (unsigned char) *s2;
|
||||
|
||||
c1 = _DtCvToLower(c1);
|
||||
c2 = _DtCvToLower(c2);
|
||||
|
||||
result = c1 - c2;
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
|
||||
if (result == 0 && (*s1 != '\0' || *s2 != '\0'))
|
||||
{
|
||||
c1 = (unsigned char) *s1;
|
||||
c2 = (unsigned char) *s2;
|
||||
|
||||
c1 = _DtCvToLower(c1);
|
||||
c2 = _DtCvToLower(c2);
|
||||
|
||||
result = c1 - c2;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
72
cde/lib/DtHelp/CvStringI.h
Normal file
72
cde/lib/DtHelp/CvStringI.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* $XConsortium: CvStringI.h /main/3 1996/08/30 13:37:59 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: CvStringI.h
|
||||
**
|
||||
** Project: Cde DtHelp
|
||||
**
|
||||
** Description: Header file for CvString.c
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtCvStringI_h
|
||||
#define _DtCvStringI_h
|
||||
|
||||
/*****************************************************************************
|
||||
* Macro defines
|
||||
*****************************************************************************/
|
||||
#define _DtCvToLower(c) (('A' <= (c) && (c) <= 'Z') ? (c) + 'a' - 'A' : (c))
|
||||
|
||||
/*****************************************************************************
|
||||
* Extern defines
|
||||
*****************************************************************************/
|
||||
#if !defined(_AIX) && !defined(USL) || defined(__uxp__)
|
||||
#define _DtCvStrCaseCmp(s1,s2) strcasecmp(s1,s2)
|
||||
#endif /* _AIX or USL */
|
||||
|
||||
extern void **_DtCvAddPtrToArray (
|
||||
void **array,
|
||||
void *ptr);
|
||||
extern wchar_t _DtCvChar (
|
||||
const void *p1,
|
||||
int type,
|
||||
int count);
|
||||
extern int _DtCvFreeArray (void **array);
|
||||
extern int _DtCvStrcspn(
|
||||
const void *s1,
|
||||
const char *s2,
|
||||
int type,
|
||||
int *ret_len);
|
||||
extern int _DtCvStrLen (
|
||||
const void *p1,
|
||||
int type);
|
||||
extern void *_DtCvStrPtr (
|
||||
const void *p1,
|
||||
int type,
|
||||
int count);
|
||||
|
||||
#if defined(_AIX) || defined(USL) || defined(__uxp__)
|
||||
extern int _DtCvStrCaseCmp(
|
||||
const char *s1,
|
||||
const char *s2);
|
||||
#endif /* _AIX or USL */
|
||||
extern int _DtCvStrCaseCmpLatin1(
|
||||
const char *s1,
|
||||
const char *s2);
|
||||
extern int _DtCvStrNCaseCmpLatin1(
|
||||
const char *s1,
|
||||
const char *s2,
|
||||
size_t n);
|
||||
|
||||
#endif /* _DtCvStringI_h */
|
||||
53
cde/lib/DtHelp/CvtToArrayP.h
Normal file
53
cde/lib/DtHelp/CvtToArrayP.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* $XConsortium: CvtToArrayP.h /main/3 1996/05/09 03:41:33 drk $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: CvtToArrayP.h
|
||||
**
|
||||
** Project: Cde Help System
|
||||
**
|
||||
** Description: Private header file. Contains defines for converting
|
||||
** a format specific file to a chunked string.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
*****************************************************************************
|
||||
*************************************<+>*************************************/
|
||||
#ifndef _DtHelpCvtToArrayP_h
|
||||
#define _DtHelpCvtToArrayP_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******** Public Defines Declarations ********/
|
||||
/*********************************
|
||||
* Title Chunk types
|
||||
*********************************/
|
||||
#define DT_HELP_CE_END 0
|
||||
#define DT_HELP_CE_STRING (1 << 0)
|
||||
#define DT_HELP_CE_CHARSET (1 << 1)
|
||||
#define DT_HELP_CE_FONT_PTR (1 << 2)
|
||||
#define DT_HELP_CE_SPC (1 << 3)
|
||||
#define DT_HELP_CE_NEWLINE (1 << 4)
|
||||
|
||||
/******** Public Typedef Declarations ********/
|
||||
/******** Public Enum Declarations ********/
|
||||
/******** Public Structures Declarations ********/
|
||||
/******** Public Prototype Procedures ********/
|
||||
|
||||
/******** Public Macro Declarations ********/
|
||||
|
||||
/******** Public Function Declarations ********/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtHelpCvtToArrayP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
231
cde/lib/DtHelp/Destroy.c
Normal file
231
cde/lib/DtHelp/Destroy.c
Normal file
@@ -0,0 +1,231 @@
|
||||
/* $XConsortium: Destroy.c /main/12 1996/03/18 14:08:16 cde-hal $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Destroy.c
|
||||
**
|
||||
** Project: Cde Help System
|
||||
**
|
||||
** Description: This code frees the information associated with
|
||||
** a Display Area.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/*
|
||||
* system includes
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <X11/Xatom.h>
|
||||
|
||||
/*
|
||||
* Canvas Engine
|
||||
*/
|
||||
#include "CanvasP.h"
|
||||
|
||||
/*
|
||||
* private includes
|
||||
*/
|
||||
#include "DisplayAreaP.h"
|
||||
#include "CallbacksI.h"
|
||||
#include "DestroyI.h"
|
||||
#include "FontI.h"
|
||||
#include "GraphicsI.h"
|
||||
#include "HyperTextI.h"
|
||||
#include "StringFuncsI.h"
|
||||
|
||||
#ifdef NLS16
|
||||
#endif
|
||||
|
||||
/******** Private Function Declarations ********/
|
||||
/******** End Public Function Declarations ********/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* These are the public routines available.
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*********************************************************************
|
||||
* Function: _DtHelpDisplayAreaClean
|
||||
*
|
||||
* _DtHelpDisplayAreaClean deallocates all paragraph, font, and
|
||||
* graphic information associated with it.
|
||||
*
|
||||
*********************************************************************/
|
||||
void
|
||||
_DtHelpDisplayAreaClean (XtPointer client_data)
|
||||
{
|
||||
int n;
|
||||
Arg args[5];
|
||||
Atom xa_primary = XA_PRIMARY;
|
||||
DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) client_data;
|
||||
|
||||
/*
|
||||
* remove the selection if necessary
|
||||
*/
|
||||
_DtHelpLoseSelectionCB (pDAS->dispWid, &xa_primary);
|
||||
|
||||
/*
|
||||
* clean the canvas
|
||||
*/
|
||||
if (NULL != pDAS->canvas)
|
||||
_DtCanvasClean (pDAS->canvas);
|
||||
|
||||
/*
|
||||
* clean the slate
|
||||
*/
|
||||
if (XtIsRealized (pDAS->dispWid))
|
||||
XClearArea(XtDisplay(pDAS->dispWid), XtWindow(pDAS->dispWid),
|
||||
pDAS->decorThickness, pDAS->decorThickness,
|
||||
pDAS->dispUseWidth, pDAS->dispUseHeight, False);
|
||||
|
||||
pDAS->toc_flag &= ~(_DT_HELP_TOC_ON);
|
||||
|
||||
/*
|
||||
* reset any scrollbars that are managed.
|
||||
*/
|
||||
n = 0;
|
||||
XtSetArg (args[n], XmNvalue , 0); ++n;
|
||||
XtSetArg (args[n], XmNsliderSize , 1); ++n;
|
||||
XtSetArg (args[n], XmNmaximum , 1); ++n;
|
||||
XtSetArg (args[n], XmNpageIncrement, 1); ++n;
|
||||
|
||||
if (pDAS->vertScrollWid && XtIsManaged (pDAS->vertScrollWid))
|
||||
XtSetValues (pDAS->vertScrollWid, args, n);
|
||||
|
||||
if (pDAS->horzScrollWid && XtIsManaged (pDAS->horzScrollWid))
|
||||
XtSetValues (pDAS->horzScrollWid, args, n);
|
||||
|
||||
} /* End _DtHelpDisplayAreaClean */
|
||||
|
||||
/*********************************************************************
|
||||
* Function: _DtHelpDisplayAreaDestroyCB
|
||||
*
|
||||
* _DtHelpDisplayAreaDestroyCB deallocates all information
|
||||
* associated with it.
|
||||
*
|
||||
*********************************************************************/
|
||||
void
|
||||
_DtHelpDisplayAreaDestroyCB (
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data)
|
||||
{
|
||||
int i;
|
||||
int strIdx;
|
||||
XrmName xrmList[_DtHelpFontQuarkNumber];
|
||||
Display *dpy;
|
||||
DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) client_data;
|
||||
Boolean usedDef = False;
|
||||
|
||||
/*
|
||||
* do the gross cleaning
|
||||
*/
|
||||
_DtHelpDisplayAreaClean(client_data);
|
||||
|
||||
if (NULL != pDAS->canvas)
|
||||
_DtCanvasDestroy (pDAS->canvas);
|
||||
|
||||
dpy = XtDisplay(pDAS->dispWid);
|
||||
/*
|
||||
* Free the gc's
|
||||
*/
|
||||
XFreeGC (dpy, pDAS->normalGC);
|
||||
XFreeGC (dpy, pDAS->pixmapGC);
|
||||
XFreeGC (dpy, pDAS->invertGC);
|
||||
if (pDAS->def_pix != NULL &&
|
||||
XmDestroyPixmap(XDefaultScreenOfDisplay(dpy), pDAS->def_pix) == False)
|
||||
XFreePixmap(dpy, pDAS->def_pix);
|
||||
if (pDAS->context != NULL)
|
||||
{
|
||||
_DtGrDestroyContext(pDAS->context);
|
||||
XtFree((char *) pDAS->context);
|
||||
}
|
||||
|
||||
/*
|
||||
* destroy the widgets.
|
||||
*/
|
||||
XtDestroyWidget(pDAS->dispWid);
|
||||
|
||||
if (pDAS->horzScrollWid != NULL)
|
||||
XtDestroyWidget(pDAS->horzScrollWid);
|
||||
if (pDAS->vertScrollWid != NULL)
|
||||
XtDestroyWidget(pDAS->vertScrollWid);
|
||||
|
||||
/*
|
||||
* free the special characters
|
||||
*/
|
||||
if (pDAS->spc_chars != NULL)
|
||||
free ((char *) pDAS->spc_chars);
|
||||
|
||||
/*
|
||||
* free the font info.
|
||||
*/
|
||||
_DtHelpGetStringQuarks(xrmList);
|
||||
if (__DtHelpFontIndexGet(pDAS, xrmList, &strIdx) != 0)
|
||||
usedDef = True;
|
||||
|
||||
if (pDAS->font_info.def_font_db != NULL)
|
||||
XrmDestroyDatabase(pDAS->font_info.def_font_db);
|
||||
if (pDAS->font_info.font_idx_db != NULL)
|
||||
XrmDestroyDatabase(pDAS->font_info.font_idx_db);
|
||||
if (pDAS->font_info.exact_fonts != NULL)
|
||||
{
|
||||
_DtHelpCeFreeStringArray(pDAS->font_info.exact_fonts);
|
||||
free(pDAS->font_info.exact_idx);
|
||||
}
|
||||
if (pDAS->font_info.font_structs != NULL)
|
||||
{
|
||||
/*
|
||||
* if the string index is a positive number, this
|
||||
* indicates that the string font is a font not
|
||||
* a font set and it wouldn't be freed in this
|
||||
* routine.
|
||||
*/
|
||||
for (i = 0; i < pDAS->font_info.struct_cnt; i++)
|
||||
{
|
||||
if (usedDef == True || i != strIdx)
|
||||
XFreeFont(dpy, pDAS->font_info.font_structs[i]);
|
||||
}
|
||||
free(pDAS->font_info.font_structs);
|
||||
}
|
||||
if (pDAS->font_info.font_sets != NULL)
|
||||
{
|
||||
/*
|
||||
* if the string index is a negative number, this turns
|
||||
* it to positive and the tests will succeed.
|
||||
*
|
||||
* if the string index was a font not a fontset, then
|
||||
* this will turn the value negative and the test
|
||||
* will never succeed.
|
||||
*/
|
||||
strIdx = (-strIdx) - 1;
|
||||
for (i = 0; i < pDAS->font_info.set_cnt; i++)
|
||||
{
|
||||
if (usedDef == True || i != strIdx)
|
||||
XFreeFontSet(dpy, pDAS->font_info.font_sets[i]);
|
||||
}
|
||||
free(pDAS->font_info.font_sets);
|
||||
free(pDAS->font_info.fs_metrics);
|
||||
}
|
||||
|
||||
/*
|
||||
* free the locale dependant information
|
||||
*/
|
||||
if (NULL != pDAS->cant_begin_chars)
|
||||
free (pDAS->cant_begin_chars);
|
||||
if (NULL != pDAS->cant_end_chars)
|
||||
free (pDAS->cant_end_chars);
|
||||
|
||||
/*
|
||||
* destroy the display area pointer
|
||||
*/
|
||||
XtFree ((char *) pDAS);
|
||||
|
||||
} /* End DtHelpDisplayAreaDestroy */
|
||||
32
cde/lib/DtHelp/DestroyI.h
Normal file
32
cde/lib/DtHelp/DestroyI.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/* $XConsortium: DestroyI.h /main/5 1995/10/26 12:18:47 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: DestroyTG.h
|
||||
**
|
||||
** Project: TextGraphic Display routines
|
||||
**
|
||||
** Description: Header file for SetListTG.h
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpDestroyI_h
|
||||
#define _DtHelpDestroyI_h
|
||||
|
||||
extern void _DtHelpDisplayAreaClean (
|
||||
XtPointer client_data);
|
||||
extern void _DtHelpDisplayAreaDestroyCB (
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data);
|
||||
|
||||
#endif /* _DtHelpDestroyI_h */
|
||||
31
cde/lib/DtHelp/DisplayAreaI.h
Normal file
31
cde/lib/DtHelp/DisplayAreaI.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* $XConsortium: DisplayAreaI.h /main/2 1996/05/09 03:41:47 drk $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: DisplayAreaI.h
|
||||
**
|
||||
** Project: Cde Help System
|
||||
**
|
||||
** Description: Defines the Display Area structures and defines.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpDisplayAreaI_h
|
||||
#define _DtHelpDisplayAreaI_h
|
||||
|
||||
typedef struct {
|
||||
int reason;
|
||||
XEvent *event;
|
||||
Window window;
|
||||
char *specification;
|
||||
int hyper_type;
|
||||
int window_hint;
|
||||
} DtHelpHyperTextStruct;
|
||||
|
||||
#endif /* _DtHelpDisplayAreaI_h */
|
||||
242
cde/lib/DtHelp/DisplayAreaP.h
Normal file
242
cde/lib/DtHelp/DisplayAreaP.h
Normal file
@@ -0,0 +1,242 @@
|
||||
/* $XConsortium: DisplayAreaP.h /main/18 1996/08/13 11:35:51 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: DisplayAreaP.h
|
||||
**
|
||||
** Project: Cde Help System
|
||||
**
|
||||
** Description: Defines the Display Area structures and defines.
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*
|
||||
* (c) Copyright 1996 Digital Equipment Corporation.
|
||||
* (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992,
|
||||
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 1993, 1994, 1996 Novell, Inc.
|
||||
* (c) Copyright 1996 FUJITSU LIMITED.
|
||||
* (c) Copyright 1996 Hitachi.
|
||||
*/
|
||||
|
||||
#ifndef _DtHelpDisplayAreaP_h
|
||||
#define _DtHelpDisplayAreaP_h
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <Xm/XmP.h>
|
||||
#include <Dt/CanvasP.h>
|
||||
#include <DtI/GraphicsP.h>
|
||||
|
||||
/*
|
||||
* Traversal flags
|
||||
*/
|
||||
#define _DT_HELP_SHADOW_TRAVERSAL (1 << 0)
|
||||
#define _DT_HELP_NOT_INITIALIZED (1 << 1)
|
||||
#define _DT_HELP_TRAVERSAL_DRAWN (1 << 2)
|
||||
#define _DT_HELP_DRAW_TOC_IND (1 << 3)
|
||||
#define _DT_HELP_CLEAR_TOC_IND (1 << 4)
|
||||
#define _DT_HELP_TOC_ON (1 << 5)
|
||||
|
||||
/*
|
||||
* enum states for selection
|
||||
*/
|
||||
enum _DtHelpSelectState
|
||||
{
|
||||
_DtHelpNothingDoing,
|
||||
_DtHelpCopyOrLink,
|
||||
_DtHelpSelectingText
|
||||
};
|
||||
|
||||
/*
|
||||
* Whether the display area has the focus or not
|
||||
*/
|
||||
#define _DT_HELP_FOCUS_FLAG 0x04
|
||||
|
||||
typedef struct {
|
||||
int used;
|
||||
int num_pixels;
|
||||
Pixmap pix;
|
||||
Pixmap mask;
|
||||
Dimension width;
|
||||
Dimension height;
|
||||
Pixel *pixels;
|
||||
} DtHelpGraphicStruct;
|
||||
|
||||
typedef struct {
|
||||
_DtCvPointer font_ptr;
|
||||
int spc_idx;
|
||||
} DtHelpSpecialChars;
|
||||
|
||||
typedef struct _dtHelpDAFontMetrics {
|
||||
_DtCvUnit ascent; /* Maximum ascent */
|
||||
_DtCvUnit descent; /* Maximum descent */
|
||||
_DtCvUnit average_width; /* Average width of a character */
|
||||
_DtCvUnit super; /* Offset from baseline for super scripts */
|
||||
_DtCvUnit sub; /* Offset from baseline for sub scripts */
|
||||
} _DtHelpDAFontMetrics;
|
||||
|
||||
typedef struct {
|
||||
short inited;
|
||||
_DtHelpDAFontMetrics fm;
|
||||
} DtHelpDAFSMetrics;
|
||||
|
||||
typedef struct _DtHelpDAfontInfo {
|
||||
char **exact_fonts; /* the list of fonts specified by the
|
||||
toss element rather than hints. */
|
||||
XrmDatabase def_font_db; /* The default font resource db */
|
||||
XrmDatabase font_idx_db; /* Which font index goes with which
|
||||
set of font resources */
|
||||
XFontStruct **font_structs; /* The font structures opened */
|
||||
XFontSet *font_sets; /* The font sets opened */
|
||||
DtHelpDAFSMetrics *fs_metrics;
|
||||
|
||||
XrmQuark lang_charset; /* the char set for current lang */
|
||||
int *exact_idx; /* The indexes for the exact fonts */
|
||||
int max_structs; /* the max number of font_structs */
|
||||
int max_sets; /* The max number of font_sets */
|
||||
int struct_cnt; /* the cur number of font_structs */
|
||||
int set_cnt; /* The cur number of font_sets */
|
||||
int def_idx; /* The default index */
|
||||
} DtHelpDAFontInfo;
|
||||
|
||||
/*
|
||||
* SelectionScroll structure
|
||||
*/
|
||||
typedef struct {
|
||||
int horizontal_reason;
|
||||
int vertical_reason;
|
||||
} SelectionScrollStruct;
|
||||
|
||||
/*
|
||||
* DisplayArea structure
|
||||
*/
|
||||
typedef struct _dtHelpDispAreaStruct {
|
||||
Widget dispWid; /* The text and graphic area. */
|
||||
Widget vertScrollWid; /* The vertical scroll bar */
|
||||
Widget horzScrollWid; /* The horizontal scroll bar */
|
||||
Boolean vertIsMapped;
|
||||
Boolean horzIsMapped;
|
||||
short neededFlags; /* _DtHelpAS_NEEDED flags */
|
||||
short nl_to_space; /* are newlines in multibyte */
|
||||
/* strings turned into spaces? */
|
||||
|
||||
Dimension formWidth; /* Pixel width of the parent area */
|
||||
Dimension formHeight; /* Pixel height of the parent area */
|
||||
Dimension dispWidth; /* Pixel width of the display area */
|
||||
Dimension dispHeight; /* Pixel height of the display area */
|
||||
Dimension dispUseHeight; /* Pixel height of the display area
|
||||
minus the decor margin. */
|
||||
Dimension dispUseWidth; /* Pixel width of the display area
|
||||
minus the decor margin. */
|
||||
Dimension marginWidth; /* Pixel padding at the left and
|
||||
right of the display area. */
|
||||
Dimension marginHeight; /* Pixel padding at the top and
|
||||
bottom of the display area. */
|
||||
|
||||
short decorThickness; /* the shadow thickness plus highlight
|
||||
thickness of the display area */
|
||||
|
||||
void (*hyperCall)(); /* The hypertext callback */
|
||||
void (*resizeCall)(); /* The resize callback */
|
||||
int (*exec_filter)(); /* The execution filter callback */
|
||||
XtPointer clientData; /* The client's data for the callback */
|
||||
|
||||
Pixel traversalColor; /* The client's traversal color */
|
||||
Pixel foregroundColor; /* The client's foreground color */
|
||||
Pixel backgroundColor; /* The client's foreground color */
|
||||
Pixel searchColor; /* The client's search hilite color */
|
||||
GC pixmapGC;
|
||||
GC normalGC;
|
||||
GC invertGC;
|
||||
Pixmap def_pix; /* the default 'missing pixmap' */
|
||||
Dimension def_pix_width; /* the width of the default pixmap */
|
||||
Dimension def_pix_height; /* the height of the default pixmap */
|
||||
_DtGrContext *context; /* image converter context */
|
||||
|
||||
Colormap colormap; /* The colormap to use */
|
||||
Visual *visual; /* The visual to use */
|
||||
|
||||
DtHelpDAFontInfo font_info; /* The font information */
|
||||
|
||||
int depth; /* The depth of the window */
|
||||
|
||||
int fontAscent;
|
||||
int lineHeight;
|
||||
int leading;
|
||||
long charWidth; /* The average size of a character */
|
||||
int moveThreshold; /* The number of pixels that must
|
||||
be moved before a copy-paste
|
||||
action occurs. */
|
||||
int underLine;
|
||||
int lineThickness; /* For traversal box and underline */
|
||||
int firstVisible; /* The absolute number of the first
|
||||
line visible in the window. */
|
||||
int nextNonVisible; /* The absolute number of the first
|
||||
line non visible, next to the last
|
||||
visible window. */
|
||||
int visibleCount; /* The number of lines viewable */
|
||||
int maxYpos; /* Maximum Y positioning */
|
||||
|
||||
int virtualX; /* The virtual x of the window */
|
||||
int maxX; /* The max virtual x of a line */
|
||||
|
||||
int max_spc; /* The maximum special characters */
|
||||
int cur_spc; /* The current unused structure */
|
||||
int timerX; /* Used for button clicks/selections */
|
||||
int timerY; /* Used for button clicks/selections */
|
||||
int scr_timer_x; /* Used for button clicks/selections */
|
||||
int scr_timer_y; /* Used for button clicks/selections */
|
||||
int vert_init_scr; /* The initial vert scrolling timeout*/
|
||||
int vert_rep_scr; /* The repeat vert scrolling timeout */
|
||||
int horz_init_scr; /* The initial horz scrolling timeout*/
|
||||
int horz_rep_scr; /* The repeat horz scrolling timeout */
|
||||
_DtCvUnit toc_width; /* The width of the toc indicator */
|
||||
_DtCvUnit toc_height; /* The height of the toc indicator */
|
||||
_DtCvUnit toc_y; /* The y coordinate of the toc */
|
||||
_DtCvUnit toc_base; /* The baseline coordinate of the toc*/
|
||||
|
||||
Time anchor_time; /* Indicates the primary selection
|
||||
time. */
|
||||
Boolean primary; /* Indicates if this widget has the
|
||||
primary selection */
|
||||
Boolean text_selected; /* Indicates if the selection has
|
||||
occurred */
|
||||
enum _DtHelpSelectState select_state;
|
||||
/* Indicates the state of the current
|
||||
selection. */
|
||||
short toc_flag; /* Indicates if the traversal indicator
|
||||
is always on. */
|
||||
_DtCvPointer toc_indicator; /* The indicator used in the toc */
|
||||
|
||||
XtIntervalId scr_timer_id;
|
||||
SelectionScrollStruct scr_timer_data;
|
||||
DtHelpSpecialChars *spc_chars; /* Structure containing the spc chars */
|
||||
_DtCvHandle canvas;
|
||||
_DtCvTopicPtr lst_topic;
|
||||
wchar_t *cant_begin_chars; /* characters that cannot */
|
||||
/* begin a line of text */
|
||||
wchar_t *cant_end_chars; /* characters that cannot */
|
||||
/* end a line of text */
|
||||
|
||||
short dtinfo; /* Indicates if being used by dtinfo */
|
||||
Pixmap stipple; /* stippled pixmap */
|
||||
|
||||
/* callback to be called whenever you manipulate the display */
|
||||
/* area's vertical scrollbar directly using XtSetValues, */
|
||||
/* because the application (dtinfo) has callbacks on the */
|
||||
/* scrollbar, these do not get called when we adjust it with */
|
||||
/* XtSetValues() */
|
||||
void (*vScrollNotify)(void *,unsigned int);
|
||||
|
||||
/* dtinfo requires this for doing link previews */
|
||||
void (*armCallback)(void*);
|
||||
|
||||
_DtCvValue honor_size; /* Layout parameter for _DtCvSetTopic */
|
||||
_DtCvRenderType render_type; /* Render type performed on expose */
|
||||
unsigned short media_resolution; /* used for scaling images */
|
||||
|
||||
} DtHelpDispAreaStruct;
|
||||
|
||||
#endif /* _DtHelpDisplayAreaP_h */
|
||||
375
cde/lib/DtHelp/DtHelp.msg
Normal file
375
cde/lib/DtHelp/DtHelp.msg
Normal file
@@ -0,0 +1,375 @@
|
||||
$
|
||||
$ COMPONENT_NAME: desktop
|
||||
$
|
||||
$ FUNCTIONS: mnemonic
|
||||
$ name
|
||||
$
|
||||
$ ORIGINS: 27,118,119,120,121
|
||||
$
|
||||
$ This module contains IBM CONFIDENTIAL code. -- (IBM
|
||||
$ Confidential Restricted when combined with the aggregated
|
||||
$ modules for this product)
|
||||
$ OBJECT CODE ONLY SOURCE MATERIALS
|
||||
$
|
||||
$ (C) COPYRIGHT International Business Machines Corp. 1995
|
||||
$ All Rights Reserved
|
||||
$ US Government Users Restricted Rights - Use, duplication or
|
||||
$ disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
||||
$
|
||||
$ *************************************<+>*************************************
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ ** File: dthelp.msg
|
||||
$ **
|
||||
$ ** Project: CDE 1.0 Help
|
||||
$ **
|
||||
$ ** Description:
|
||||
$ ** -----------
|
||||
$ ** This file is the source for the message catalog for DtHelp
|
||||
$ **
|
||||
$ **
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ ** (c) Copyright 1990 Hewlett-Packard Company
|
||||
$ ** All Rights reserved
|
||||
$ **
|
||||
$ **
|
||||
$ ** There are two 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.
|
||||
$ **
|
||||
$ ** 2) Messages that should not be localized.
|
||||
$ ** These messages are marked with DO NOT TRANSLATE THESE MESSAGES.
|
||||
$ **
|
||||
$ *****************************************************************************
|
||||
$ **
|
||||
$ **
|
||||
$ ** ------------------------- MODIFICATION RECORD --------------------------
|
||||
$ * Major Mods, 3/26/92 in preperation for the NLS package release on the
|
||||
$ * 27th. (Mike Wilson).
|
||||
$ *
|
||||
$ * Major Mods, 6/10/94 in prep for Cde Message Catalog Freeze
|
||||
$ *
|
||||
$ ** ----------------------- MODIFICATION RECORD END ------------------------
|
||||
$ *****************************************************************************
|
||||
$ *************************************<+>*************************************
|
||||
|
||||
$set 2
|
||||
$ ***** Module: HelpDialog.c and a few from HelpQuickD.c *****
|
||||
$
|
||||
$ These Messages appear in the pulldown menus for Cde Help General Help
|
||||
$ dialog widget.
|
||||
$
|
||||
$ They come in pairs where the first is the menu name (e.g. 1 Print...) and the
|
||||
$ second is the mnemonic (e.g. 2 P).
|
||||
$
|
||||
$ Messages 1 through 6 are the pulldown menus for the File menu.
|
||||
1 Print...
|
||||
2 P
|
||||
3 Close
|
||||
4 C
|
||||
5 New Window...
|
||||
6 W
|
||||
$ Messages 7 through 8 are the pulldown menus for the Edit menu.
|
||||
7 Copy
|
||||
8 C
|
||||
$ Messages 9 through 10 are the pulldown menus for the Search menu.
|
||||
9 Index...
|
||||
10 I
|
||||
$ Messages 11 through 16 are the pulldown menus for the Navigate menu.
|
||||
11 Home Topic
|
||||
12 T
|
||||
13 Backtrack
|
||||
14 B
|
||||
15 History...
|
||||
16 H
|
||||
$ Messages 17 through 28 are the pulldown menus for the Help menu.
|
||||
17 Overview - Using Help
|
||||
18 v
|
||||
19 Table Of Contents
|
||||
20 C
|
||||
21 Tasks
|
||||
22 T
|
||||
23 Reference
|
||||
24 R
|
||||
25 Mouse and Keyboard
|
||||
26 M
|
||||
27 About Help
|
||||
28 A
|
||||
$
|
||||
$ Messages 29 through 36 are the menu labels and mnemonics for for the
|
||||
$ Help Dialog.
|
||||
29 File
|
||||
30 F
|
||||
31 Search
|
||||
32 S
|
||||
33 Navigate
|
||||
34 N
|
||||
35 Help
|
||||
36 H
|
||||
37 Edit
|
||||
38 E
|
||||
$
|
||||
$
|
||||
$ >>>>> Skip #39 through #49
|
||||
$
|
||||
$ Messages 50 through 55 are used to display formatting errors within the
|
||||
$ help dialog and quick help dialog widgets.
|
||||
$
|
||||
50 String data could not be formatted.
|
||||
51 Dynamic string data could not be formatted.
|
||||
52 Man Page could not be formatted. The requested Man Page is either not \
|
||||
present, or corrupt.
|
||||
53 Text file data could not be formatted. The requested text file is either \
|
||||
not present, or corrupt.
|
||||
54 Help topic could not be formatted.
|
||||
55 Nonexistent location ID:
|
||||
$
|
||||
$ Messages 56 and 67 are displayed when a hypertext link type is selected but
|
||||
$ not supported within the current application.
|
||||
$
|
||||
56 The selected Hypertext link is not supported within this application.
|
||||
57 Links to Man Pages are not supported by this application.
|
||||
$
|
||||
$ Messages 58 through 62 are used when bad or null help volumes or
|
||||
$ locationId's are used.
|
||||
$
|
||||
58 The requested online help is either not installed or not in the proper help search path. For information on installing online help, consult the documentation for the product.\n
|
||||
59 No location ID specified.
|
||||
60 No help volume specified.
|
||||
61 Help Volume:
|
||||
62 Location ID:
|
||||
$
|
||||
$ >>>>> Skip #63 through #69
|
||||
$
|
||||
$
|
||||
$ Message 70 is used when a null value for DtNtopicTitle is used.
|
||||
$
|
||||
70 Nonexistent Topic Title.
|
||||
$
|
||||
$ New messages added after early msg cat freeze; not in order
|
||||
80 The specified help type is invalid.
|
||||
|
||||
|
||||
|
||||
$set 3
|
||||
$ **** Module: History.c ****
|
||||
$ These messages are used as labels for the History Dialog.
|
||||
1 Help - History Browser
|
||||
2 Help Volumes Visited:
|
||||
3 Close
|
||||
4 Help
|
||||
5 Help Files
|
||||
6 Man Pages
|
||||
7 Help Messages
|
||||
8 Help Topics Visited:
|
||||
9 Help Files Visited:
|
||||
10 Man Pages Visited:
|
||||
11 Help Messages Visited:
|
||||
|
||||
|
||||
$set 4
|
||||
$ ***** Module: Print.c *****
|
||||
$ These messages are used as labels for the Print Dialog.
|
||||
$ 1: dialog title
|
||||
1 Help - Print
|
||||
$ 10-12: standard printer dialog labels
|
||||
10 Printer:
|
||||
11 Copies:
|
||||
12 Banner Page Title:
|
||||
$ 20-25: paper size label and sizes
|
||||
20 Paper Size:
|
||||
21 Letter 8.5 x 11 in
|
||||
22 Legal 8.5 x 14 in
|
||||
23 Executive 7.25 x 10.5 in
|
||||
24 A4 210 x 297 mm
|
||||
25 B5 182 x 257 mm
|
||||
$ 30-33: help volume-specific printing options
|
||||
30 Topics To Print
|
||||
31 Current Topic
|
||||
32 Current and Subtopics
|
||||
33 Table of Contents and Index
|
||||
34 All Topics in Volume
|
||||
|
||||
$ 40-42: buttons at bottom of dialog
|
||||
40 Print
|
||||
41 Cancel
|
||||
42 Help
|
||||
|
||||
$ These messages are used to describe the kind of content to be printed
|
||||
$ 50 "Help Volume: "
|
||||
50 Help Volume:
|
||||
51 Help Message
|
||||
52 Help File
|
||||
|
||||
$ 53 "Manual Page: "
|
||||
53 Manual Page:
|
||||
54 Error message
|
||||
|
||||
$ Don't translate message 60 unless it is not an empty string
|
||||
$ This is the default value that goes in the Printer field
|
||||
$ 60 " "
|
||||
60
|
||||
|
||||
$ Don't translate message 61
|
||||
$ This is the default value that goes in the Copies field
|
||||
61 1
|
||||
|
||||
|
||||
$set 5
|
||||
$ ***** Module: GlobSearch.c *****
|
||||
$ Message 1 is the label used to label the dialog
|
||||
1 Help - Index Search
|
||||
2 Search
|
||||
3 Current
|
||||
$ DO NOT TRANSLATE MESSAGE 4; it is no longer used
|
||||
$ " (%s)"
|
||||
4 (%s)
|
||||
5 All Volumes
|
||||
6 Selected
|
||||
7 Select Volumes...
|
||||
8 Show
|
||||
9 Complete Index
|
||||
10 Entries with:
|
||||
11 Goto
|
||||
12 Start Search
|
||||
13 Continue Search
|
||||
14 Stop Search
|
||||
15 Close
|
||||
16 Help
|
||||
17 Scanning for volumes... Found %d
|
||||
18 Searching... Volumes remaining: %d
|
||||
19 No index entries found
|
||||
20 Complete Index
|
||||
21 Entries with \"%s\"
|
||||
22 No volumes selected
|
||||
23 Select search options above
|
||||
$ Do NOT translate messages 25-31
|
||||
$ " "
|
||||
25
|
||||
26 +
|
||||
27 -
|
||||
$ " +"
|
||||
28 +
|
||||
$ " -"
|
||||
29 -
|
||||
$ 30 " "
|
||||
30
|
||||
$ 31 " "
|
||||
31
|
||||
$ DO translate messages 32 and above
|
||||
$ kind of topic messages
|
||||
32 Help Message
|
||||
33 Help File
|
||||
34 Manual Page
|
||||
35 Unknown Format
|
||||
$ specialized title of Search Volume Selection dialog
|
||||
40 Help - Search Volume Selection
|
||||
$ additional messages (late addition caused this ordering)
|
||||
50 No index entries found. Try All Volumes.
|
||||
51 No index entries found. Try another word.
|
||||
$ additional messages (later addition caused this ordering)
|
||||
$ These messages are the braces that go around the current volume name
|
||||
$ in the index search dialog. They are kept in the message catalog
|
||||
$ in case they need to be localized.
|
||||
60 (
|
||||
61 )
|
||||
|
||||
|
||||
$set 6
|
||||
$ ***** Module: HelpAccess.c *****
|
||||
$ These messages are used for the Help on Help dialog in Cde Help widgets.
|
||||
1 Help On Help
|
||||
2 Print ...
|
||||
3 Close
|
||||
4 Help On Help not provided for this application!
|
||||
5 Backtrack
|
||||
6 Help ...
|
||||
|
||||
|
||||
$set 7
|
||||
$ ***** Module: Main.c & Util.c & (dthelpview CDE 1.0 *****
|
||||
$ These messages are used by the dthelpview program. They need to be
|
||||
$ localized for dthelpview, however, they are not directly used by libDtHelp
|
||||
$ Messages 1 through 7 are command line usage response messages.
|
||||
$ Do NOT translate the option name (e.g. -helpVolume). DO translate
|
||||
$ the argument descriptor name (e.g. <Help Volume File>)
|
||||
1 Usage: %s...\n
|
||||
2 \t-helpVolume <Help Volume File>\n
|
||||
3 \t-locationId <ID>\n
|
||||
5 \t-file <ASCII Text File>\n
|
||||
6 \t-man\n
|
||||
7 \t-manPage <Unix Man Page>\n\n\n
|
||||
$ man page dialog
|
||||
11 Man Page
|
||||
12 Man Page:
|
||||
13 Show Man Page
|
||||
$ button labels
|
||||
16 Exit
|
||||
17 Close
|
||||
18 Backtrack
|
||||
19 Print ...
|
||||
$ title of helpview window
|
||||
20 Help Viewer
|
||||
|
||||
|
||||
$set 8
|
||||
$ ***** Module: HelpUtil.c *****
|
||||
$ Message 1 is the label used in the definition link dialog box
|
||||
$ (e.g. Quick help close button)
|
||||
2 Close
|
||||
3 Internal Error: Could not grab the mouse\nDtHelpReturnSelectedWidget aborted.\n
|
||||
4 Internal Error: Could not grab the keyboard\nDtHelpReturnSelectedWidget() aborted.\n
|
||||
5 Help Error
|
||||
$ Messages 10 and up were added after message catalogs were taken
|
||||
$ for translation. They are not in any order or chosen location.
|
||||
10 Execute Anyway
|
||||
11 Don't Execute
|
||||
12 The help volume wanted to execute a command alias.\nThe alias '%s' is not defined.
|
||||
13 The help volume wanted to execute a command.\nFor security reasons, automatic command execution is turned off.\nThe command is: %s
|
||||
14 The help volume wanted to execute a command as the root user, but the\nhome directory of \"%s\" ($HOME) does not match the root\nuser's home directory. This could result in executing unexpected\ncommands.\n\nThe command is: \"%s\"\n\nNote: to avoid this in the future:\n execute \"su - root\" rather than \"su root\".\n
|
||||
$ End Message set 8
|
||||
|
||||
|
||||
$set 9
|
||||
$ ***** Module: PathArea.c *****
|
||||
$ These messages are used in the general Help Dialog Widget.
|
||||
$ Message 1 is the label used to label Topic Tree Area
|
||||
1 Volume:
|
||||
$ Messages 2 though 5 are used in the Button Box area of our general
|
||||
$ help dialog.
|
||||
2 Backtrack
|
||||
3 History...
|
||||
4 Index...
|
||||
5 Top Level
|
||||
|
||||
|
||||
$set 10
|
||||
$ ***** Module: VolSelect.c *****
|
||||
$ Message 1 is the default label used to label the volume selection dialog.
|
||||
1 Help - Volume Selection
|
||||
2 Help Volumes
|
||||
3 Select one or more help volumes
|
||||
4 Close
|
||||
5 Help
|
||||
|
||||
|
||||
$set 11
|
||||
$ ***** Module: HelpQuickD.c *****
|
||||
$ These messages are used as labels for the quick help dialog.
|
||||
1 Close
|
||||
2 More ...
|
||||
3 Backtrack
|
||||
4 Print ...
|
||||
5 Help ...
|
||||
|
||||
$set 99
|
||||
$ DO NOT TRANSLATE THESE MESSAGES
|
||||
$ DO NOT CHANGE THESE MESSAGES
|
||||
$ DO NOT LOCALIZE THESE MESSAGES
|
||||
$ These messages are used for the version information.
|
||||
1 @(#)version_goes_here
|
||||
2 \n@(#)Message catalog source $XConsortium: DtHelp.msg /main/3 1995/10/26 12:19:02 rswiston $
|
||||
|
||||
131
cde/lib/DtHelp/Environ_c.c
Normal file
131
cde/lib/DtHelp/Environ_c.c
Normal file
@@ -0,0 +1,131 @@
|
||||
/****************************<+>*************************************
|
||||
********************************************************************
|
||||
**
|
||||
** File: Environ_c.c
|
||||
**
|
||||
** $XConsortium: Environ_c.c /main/6 1995/12/18 16:31:33 cde-hp $
|
||||
**
|
||||
** Project: libCliSrv Library
|
||||
**
|
||||
** Description: Return the value of the DTUSERSESSION environ-
|
||||
** ment variable or create it if it doesn't exist.
|
||||
** If malloc fails, NULL is returned.
|
||||
**
|
||||
**(c) Copyright 1992,1993,1994 by 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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
char * _DtCliSrvGetDtUserSession()
|
||||
{
|
||||
char * envVar = getenv("DTUSERSESSION");
|
||||
char * ret_envVar = NULL;
|
||||
|
||||
/* See if the environment variable exists */
|
||||
|
||||
if (envVar == NULL) {
|
||||
|
||||
/* It doesn't, so it needs to be constructed. Use LOGNAME, which
|
||||
* always seems to be set, and DISPLAY, which may or may not be
|
||||
* set.
|
||||
*/
|
||||
|
||||
char pipedata[BUFSIZ];
|
||||
char logname_local[8];
|
||||
char * logname = getenv("LOGNAME");
|
||||
|
||||
if (logname == NULL) {
|
||||
strcpy(logname_local,"generic");
|
||||
logname = logname_local;
|
||||
}
|
||||
|
||||
/* determine DISPLAY and screen number */
|
||||
|
||||
{
|
||||
char screen[BUFSIZ];
|
||||
char * display = NULL;
|
||||
char * localDisplayVar = getenv("DISPLAY");
|
||||
|
||||
if (localDisplayVar == NULL) {
|
||||
|
||||
/* run uname to get the display name */
|
||||
|
||||
FILE *pp;
|
||||
display = pipedata;
|
||||
|
||||
pp = popen("uname -n", "r");
|
||||
if (NULL == pp) {
|
||||
perror("uname -n");
|
||||
return NULL;
|
||||
}
|
||||
*display = 0;
|
||||
fgets(display, BUFSIZ, pp);
|
||||
while (isspace(display[strlen(display)-1]))
|
||||
display[strlen(display)-1] = 0;
|
||||
pclose(pp);
|
||||
}
|
||||
else {
|
||||
display = malloc(strlen(localDisplayVar) + 1);
|
||||
strcpy(display, localDisplayVar);
|
||||
}
|
||||
|
||||
|
||||
/* Now determine the screen number. Throw away .0 */
|
||||
|
||||
{
|
||||
char * s = strchr(display,':');
|
||||
if (s && strlen(s) < (size_t)BUFSIZ) {
|
||||
strcpy(screen,s+1);
|
||||
*s = 0;
|
||||
if ((s = strchr(screen,'.')) && *(s+1) == '0')
|
||||
*s = 0;
|
||||
}
|
||||
else {
|
||||
strcpy(screen,"0");
|
||||
}
|
||||
}
|
||||
envVar = malloc(strlen(logname) + strlen(display) + strlen(screen) + 3);
|
||||
if (envVar)
|
||||
sprintf (envVar, "%s-%s-%s", logname, display, screen);
|
||||
|
||||
return envVar;
|
||||
}
|
||||
}
|
||||
|
||||
ret_envVar = malloc(strlen(envVar) + 1);
|
||||
if (ret_envVar)
|
||||
strcpy(ret_envVar, envVar);
|
||||
return ret_envVar;
|
||||
|
||||
}
|
||||
|
||||
#ifdef TEST
|
||||
int main ()
|
||||
{
|
||||
char * value;
|
||||
|
||||
value = _DtCliSrvGetDtUserSession();
|
||||
|
||||
printf("DTUSERSESSION will be set to: %s\n", value);
|
||||
|
||||
free(value);
|
||||
|
||||
printf("value has been freed\n");
|
||||
}
|
||||
|
||||
/*******************************************************
|
||||
Test cases: DTUSERSESSION LOGNAME DISPLAY
|
||||
-------------------------------------------------
|
||||
set - -
|
||||
unset userfoo unset
|
||||
unset userfoo hostname:0
|
||||
unset userfoo hostname:0.0
|
||||
unset userfoo hostname:0.1
|
||||
********************************************************/
|
||||
#endif
|
||||
671
cde/lib/DtHelp/FileListUtils.c
Normal file
671
cde/lib/DtHelp/FileListUtils.c
Normal file
@@ -0,0 +1,671 @@
|
||||
/* $TOG: FileListUtils.c /main/11 1999/10/14 13:17:49 mgreess $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: FileListUtils.c
|
||||
**
|
||||
** Project: DtHelp library
|
||||
**
|
||||
** Description: Locates and lists all files (volumes) accessible via the
|
||||
** known paths
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/*
|
||||
* system includes
|
||||
*/
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h> /* MAXPATHLEN */
|
||||
#include <limits.h>
|
||||
#define X_INCLUDE_DIRENT_H
|
||||
#define XOS_USE_XT_LOCKING
|
||||
#include <X11/Xos_r.h>
|
||||
#include <Dt/Help.h>
|
||||
|
||||
/*
|
||||
* private includes
|
||||
*/
|
||||
#include "bufioI.h" /* for AccessI.h */
|
||||
#include "Access.h"
|
||||
#include "AccessI.h"
|
||||
#include "StringFuncsI.h"
|
||||
#include "FileUtilsI.h"
|
||||
#include "FileListUtilsI.h"
|
||||
#include "HelposI.h"
|
||||
|
||||
/******** constants *********/
|
||||
#define LANG_C_STR "C"
|
||||
#define EOS '\0'
|
||||
|
||||
/******** types *********/
|
||||
|
||||
/******** public global variables *********/
|
||||
|
||||
/******** variables *********/
|
||||
static const char * PeriodStr = ".";
|
||||
static const char * DirSlashStr = "/";
|
||||
static const char * PathSeparator = ":";
|
||||
|
||||
/******** functions *********/
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: GetExtension()
|
||||
*
|
||||
* locate the '.' of the filename extension, if present
|
||||
*
|
||||
*****************************************************************************/
|
||||
static char * GetExtension(
|
||||
char * filename)
|
||||
{
|
||||
char * ext;
|
||||
if (_DtHelpCeStrrchr(filename,PeriodStr,MB_CUR_MAX,&ext) == 0 ) return ext;
|
||||
else return ""; /* do NOT return a NULL*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: SpecialStrcmp()
|
||||
*
|
||||
* Tests the args for NULL pointers. If both are NULL or if
|
||||
* both aren't NULL and are the same string, then returns 0.
|
||||
* If one arg is NULL and other isn't, or if strings are
|
||||
* different, returns -1 or +1.
|
||||
*
|
||||
*****************************************************************************/
|
||||
static int SpecialStrcmp(
|
||||
const char * str1,
|
||||
const char * str2)
|
||||
{
|
||||
if(NULL == str1)
|
||||
{
|
||||
if(NULL == str2) return 0; /* str1 == str2 */
|
||||
return -1; /* str1 < str2 */
|
||||
}
|
||||
if(NULL == str2) return 1; /* str1 > str2 */
|
||||
return(strcmp(str1,str2)); /* str1 ? str2 */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: FileInfoMatchesP()
|
||||
*
|
||||
* Compares the info of an existing file entry with test file info
|
||||
* and determines whether they match.
|
||||
* Returns: True or False
|
||||
*
|
||||
*****************************************************************************/
|
||||
static Boolean FileInfoMatchesP(
|
||||
_DtHelpFileEntry file1,
|
||||
_DtHelpFileEntry file2,
|
||||
int compareFlags)
|
||||
{
|
||||
/* no duplicate files allowed: compare doc stamps */
|
||||
/* note: currently am not comparing nameKey nor returning
|
||||
a placement (-1,+1) val from the compare. */
|
||||
if ( ( (compareFlags & _DtHELP_FILE_NAME) == 0
|
||||
|| SpecialStrcmp(file1->fileName,file2->fileName) == 0)
|
||||
&& ( (compareFlags & _DtHELP_FILE_TITLE) == 0
|
||||
|| SpecialStrcmp(file1->fileTitle,file2->fileTitle) == 0)
|
||||
&& ( (compareFlags & _DtHELP_FILE_IDSTR) == 0
|
||||
|| SpecialStrcmp(file1->docId,file2->docId) == 0)
|
||||
&& ( (compareFlags & _DtHELP_FILE_TIME) == 0
|
||||
|| SpecialStrcmp(file1->timeStamp,file2->timeStamp) == 0) )
|
||||
return True;
|
||||
return False;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpFileIsSameP()
|
||||
*
|
||||
* Compares the info of two files and determines whether they match.
|
||||
* Returns: True or False
|
||||
*
|
||||
*****************************************************************************/
|
||||
Boolean _DtHelpFileIsSameP(
|
||||
char * fileName1,
|
||||
char * fileName2,
|
||||
_DtHelpFileInfoProc infoProc,
|
||||
int compareFlags,
|
||||
XtPointer pDisplayArea)
|
||||
{
|
||||
_DtHelpFileRec file1, file2;
|
||||
char * fileName;
|
||||
Boolean ret;
|
||||
|
||||
/* get filenames without path */
|
||||
if (_DtHelpCeStrrchr(fileName1, DirSlashStr, MB_CUR_MAX, &fileName) == 0)
|
||||
fileName1 = fileName + 1;
|
||||
if (_DtHelpCeStrrchr(fileName2, DirSlashStr, MB_CUR_MAX, &fileName) == 0)
|
||||
fileName2 = fileName + 1;
|
||||
|
||||
/* init the structs */
|
||||
memset(&file1,0,sizeof(file1));
|
||||
memset(&file2,0,sizeof(file2));
|
||||
file1.fileName = fileName1;
|
||||
file2.fileName = fileName2;
|
||||
|
||||
/* get info on the files */
|
||||
(*infoProc)(pDisplayArea,fileName1,NULL,NULL,
|
||||
&file1.docId,&file1.timeStamp,&file1.nameKey,
|
||||
NULL,NULL);
|
||||
(*infoProc)(pDisplayArea,fileName2,NULL,NULL,
|
||||
&file2.docId,&file2.timeStamp,&file2.nameKey,
|
||||
NULL,NULL);
|
||||
|
||||
ret = FileInfoMatchesP(&file1,&file2,compareFlags);
|
||||
|
||||
XtFree(file1.docId);
|
||||
XtFree(file1.timeStamp);
|
||||
XtFree(file2.docId);
|
||||
XtFree(file2.timeStamp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: ScanDirForFiles
|
||||
*
|
||||
* scan a directory looking for files with a matching suffix
|
||||
* returns number of files found in this directory
|
||||
*
|
||||
*****************************************************************************/
|
||||
static int ScanDirForFiles(
|
||||
char * dirpath,
|
||||
const char * suffixList[],
|
||||
_DtHelpFileList * in_out_list,
|
||||
XmFontList * io_fontList,
|
||||
Boolean * ret_mod,
|
||||
int foundFilesCnt,
|
||||
_DtHelpFileInfoProc infoProc,
|
||||
XtPointer pDisplayArea,
|
||||
int compareFlags,
|
||||
int sortFlags,
|
||||
_DtHelpFileScanProcCB scanProc,
|
||||
XtPointer clientData)
|
||||
{
|
||||
int count = 0;
|
||||
char fullName [MAXPATHLEN + 2];
|
||||
char *ptr;
|
||||
DIR *pDir;
|
||||
struct dirent *result;
|
||||
_Xreaddirparams dirEntryBuf;
|
||||
|
||||
/* open the directory */
|
||||
pDir = opendir (dirpath);
|
||||
if (pDir == NULL) return 0; /* RETURN */
|
||||
|
||||
/* build the pathname */
|
||||
strcpy (fullName, dirpath);
|
||||
strcat (fullName, DirSlashStr);
|
||||
ptr = fullName + strlen (fullName);
|
||||
|
||||
/*
|
||||
* Scan through the files looking for matching suffixes
|
||||
*/
|
||||
while ((result = _XReaddir(pDir, dirEntryBuf)) != NULL) {
|
||||
const char * matchedSuffix;
|
||||
char * ext;
|
||||
|
||||
/* Skip over any "." and ".." entries. */
|
||||
if ((strcmp(result->d_name, ".") == 0) ||
|
||||
(strcmp(result->d_name, "..") == 0))
|
||||
continue;
|
||||
|
||||
/* get working values */
|
||||
ext = GetExtension (result->d_name);
|
||||
matchedSuffix = ""; /* default (==>no suffix to match) */
|
||||
|
||||
/* try to match with a suffix, if specified */
|
||||
if (NULL != suffixList)
|
||||
{
|
||||
const char * * pSuffix;
|
||||
matchedSuffix = NULL;
|
||||
for (pSuffix = suffixList;
|
||||
NULL != *pSuffix && NULL == matchedSuffix;
|
||||
pSuffix++ )
|
||||
{
|
||||
if (strcmp(ext,*pSuffix) == 0)
|
||||
matchedSuffix = *pSuffix;
|
||||
}
|
||||
}
|
||||
|
||||
/* and a match is found */
|
||||
if ( NULL != matchedSuffix )
|
||||
{
|
||||
Boolean mod;
|
||||
|
||||
/* then generate the full path and add to the list */
|
||||
strcpy (ptr, result->d_name);
|
||||
if (_DtHelpFileListAddFile(in_out_list,io_fontList,&mod,
|
||||
fullName,ptr,infoProc,compareFlags,sortFlags,pDisplayArea))
|
||||
{
|
||||
count++;
|
||||
if (scanProc) (*scanProc)(count + foundFilesCnt,clientData);
|
||||
}
|
||||
*ret_mod |= mod; /* accumulate mods */
|
||||
}
|
||||
} /* while more entries */
|
||||
|
||||
/* close the directory stream */
|
||||
closedir(pDir);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Function: _DtHelpFileListGetMatch ()
|
||||
*
|
||||
* Parameters:
|
||||
* fileListHead head of the list
|
||||
* fullFilePath fullFilePath to file to find
|
||||
* infoProc will deliver info on the file
|
||||
* pDisplayArea used to interpret vol info
|
||||
*
|
||||
* Returns: pointer to matching _DtHelpFileList entry
|
||||
* or NULL if none is found
|
||||
*
|
||||
* Purpose: Looks for a file list entry for the file
|
||||
* identified by fullFilePath.
|
||||
* The infoProc routine gets info about the file
|
||||
* to be matched, and uses that when comparing
|
||||
* with the file list. This allows more
|
||||
* than one file with the same name to be in
|
||||
* the list and be discriminated on the basis
|
||||
* of the info.
|
||||
*
|
||||
*****************************************************************************/
|
||||
_DtHelpFileList _DtHelpFileListGetMatch (
|
||||
_DtHelpFileList fileListHead,
|
||||
char * fullFilePath,
|
||||
_DtHelpFileInfoProc infoProc,
|
||||
int compareFlags,
|
||||
XtPointer pDisplayArea)
|
||||
{
|
||||
_DtHelpFileList next;
|
||||
_DtHelpFileRec file;
|
||||
|
||||
/* zero the record */
|
||||
memset (&file,0,sizeof(file));
|
||||
|
||||
if (NULL == fileListHead || NULL == fullFilePath) return NULL; /* RETURN */
|
||||
|
||||
/* get filename without path */
|
||||
file.fileName = fullFilePath;
|
||||
if (_DtHelpCeStrrchr(fullFilePath,DirSlashStr,MB_CUR_MAX,&file.fileName) == 0)
|
||||
file.fileName++;
|
||||
|
||||
/* if an info proc, use it, otherwise make due */
|
||||
if (infoProc)
|
||||
(*infoProc)(pDisplayArea,fullFilePath,
|
||||
NULL,NULL,&file.docId,&file.timeStamp,&file.nameKey,
|
||||
NULL,NULL);
|
||||
else
|
||||
file.nameKey = _DtHelpCeStrHashToKey(file.fileName);
|
||||
|
||||
next = NULL;
|
||||
while ( (next = _DtHelpFileListGetNext(fileListHead, next)) != NULL )
|
||||
{
|
||||
if ( FileInfoMatchesP(next,&file,compareFlags) )
|
||||
break; /* next is the matching entry */
|
||||
}
|
||||
|
||||
/* fileName is part of fullFilePath */
|
||||
XtFree(file.docId);
|
||||
XtFree(file.timeStamp);
|
||||
return next;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpFileListGetNext ()
|
||||
*
|
||||
* Parameters:
|
||||
* fileListHead head of the list
|
||||
* curFile current entry in the list
|
||||
*
|
||||
* Returns: pointer to next _DtHelpFileList entry
|
||||
* or NULL if end of list has been reached
|
||||
*
|
||||
* Purpose: Gets the next file in the list
|
||||
*
|
||||
*****************************************************************************/
|
||||
_DtHelpFileList _DtHelpFileListGetNext (
|
||||
_DtHelpFileList fileListHead,
|
||||
_DtHelpFileList curFile)
|
||||
{
|
||||
/* could do a sanity test on curFile here */
|
||||
if ( curFile ) return curFile->next;
|
||||
else return fileListHead;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpFileFreeEntry ()
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Purpose: free the contents of an entry
|
||||
*
|
||||
*****************************************************************************/
|
||||
void _DtHelpFileFreeEntry (
|
||||
_DtHelpFileEntry entry)
|
||||
{
|
||||
if(NULL == entry) return;
|
||||
XmStringFree(entry->fileTitleXmStr);
|
||||
XtFree(entry->docId);
|
||||
XtFree(entry->timeStamp);
|
||||
XtFree(entry->fileTitle);
|
||||
XtFree((char *) entry->fileName);
|
||||
XtFree((char *) entry->fullFilePath);
|
||||
XtFree((char *) entry->clientData);
|
||||
XtFree((char *) entry);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpFileListAddFile ()
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Returns: True if added a new entry
|
||||
* False if entry not added because already present
|
||||
* or an error occurred
|
||||
*
|
||||
*
|
||||
* errno Values:
|
||||
* 0 no error
|
||||
* ENOMEM memory allocation error
|
||||
*
|
||||
* Purpose: adds a file to the file list if its not already present
|
||||
*
|
||||
*****************************************************************************/
|
||||
Boolean _DtHelpFileListAddFile (
|
||||
_DtHelpFileList * in_out_list,
|
||||
XmFontList * io_fontList,
|
||||
Boolean * ret_mod,
|
||||
char * fullFilePath,
|
||||
char * fileName,
|
||||
_DtHelpFileInfoProc infoProc,
|
||||
int compareFlags,
|
||||
int sortFlags,
|
||||
XtPointer pDisplayArea)
|
||||
{
|
||||
_DtHelpFileList next;
|
||||
_DtHelpFileList prev;
|
||||
_DtHelpFileList newList;
|
||||
_DtHelpFileRec addFile;
|
||||
char * actualPath;
|
||||
char empty = 0;
|
||||
int nameKey = 0;
|
||||
typedef int (*_CEStrcollProc)(const char *,const char *);
|
||||
extern _CEStrcollProc _DtHelpCeGetStrcollProc();
|
||||
_CEStrcollProc strcollfn = _DtHelpCeGetStrcollProc();
|
||||
|
||||
/* init the variable */
|
||||
memset(&addFile, 0, sizeof(addFile));
|
||||
|
||||
/* if no full file path, go look for it */
|
||||
if (NULL == fullFilePath || fullFilePath[0] == EOS)
|
||||
return False; /* RETURN : incomplete file spec */
|
||||
|
||||
/* trace any links; _DtHelpFileTraceLinks may chg actualPath ptr */
|
||||
actualPath = XtNewString(fullFilePath);
|
||||
if ( _DtHelpFileTraceLinks(&actualPath) == False )
|
||||
{
|
||||
XtFree(actualPath);
|
||||
return False; /* RETURN: invalid file */
|
||||
}
|
||||
fullFilePath = actualPath;
|
||||
|
||||
/* if no filespec, get it */
|
||||
if (NULL == fileName)
|
||||
{
|
||||
fileName = fullFilePath;
|
||||
if(_DtHelpCeStrrchr(fullFilePath, DirSlashStr, MB_CUR_MAX,&fileName)==0)
|
||||
fileName++;
|
||||
}
|
||||
addFile.fileName = fileName;
|
||||
|
||||
/* if an info proc, use it, otherwise make due */
|
||||
if (infoProc)
|
||||
{
|
||||
(*infoProc)(pDisplayArea,fullFilePath,
|
||||
&addFile.fileTitle,&addFile.fileTitleXmStr,
|
||||
&addFile.docId,&addFile.timeStamp,&addFile.nameKey,
|
||||
io_fontList,ret_mod);
|
||||
}
|
||||
else
|
||||
{
|
||||
nameKey = _DtHelpCeStrHashToKey(fileName);
|
||||
}
|
||||
|
||||
/* look for prior existance and position */
|
||||
next = prev = NULL;
|
||||
while ( (next = _DtHelpFileListGetNext(*in_out_list, next)) != NULL )
|
||||
{
|
||||
if ( FileInfoMatchesP(next,&addFile,compareFlags) )
|
||||
{
|
||||
XtFree(addFile.docId);
|
||||
XtFree(addFile.timeStamp);
|
||||
XtFree(addFile.fileTitle);
|
||||
XmStringFree(addFile.fileTitleXmStr);
|
||||
XtFree(fullFilePath);
|
||||
return False; /* RETURN : repeat entry */
|
||||
}
|
||||
|
||||
/* insert lexically according to title */
|
||||
/* use case insensitive NLS collating for ordering */
|
||||
if ( (sortFlags & _DtHELP_FILE_TITLE)
|
||||
&& (*strcollfn) (addFile.fileTitle, next->fileTitle) <= 0 )
|
||||
break; /* BREAK: insert after prev, before next */
|
||||
|
||||
/* FIX: add support for other sorting here */
|
||||
/* if ( (sortFlags & _DtHELP_FILE_DIR) */
|
||||
/* if ( (sortFlags & _DtHELP_FILE_TIME) */
|
||||
/* if ( (sortFlags & _DtHELP_FILE_IDSTR) */
|
||||
/* if ( (sortFlags & _DtHELP_FILE_LOCALE) */
|
||||
|
||||
prev = next; /* save ref to prior entry */
|
||||
}
|
||||
/* if dup not found, fall thru, with prev valid */
|
||||
|
||||
/* no matching path, so create, initialize, and append to list */
|
||||
newList = (_DtHelpFileList) XtCalloc(1, sizeof(_DtHelpFileRec));
|
||||
if (NULL == newList)
|
||||
{
|
||||
XtFree(addFile.docId);
|
||||
XtFree(addFile.timeStamp);
|
||||
XtFree(addFile.fileTitle);
|
||||
XmStringFree(addFile.fileTitleXmStr);
|
||||
XtFree(fullFilePath);
|
||||
return False; /* RETURN : error */
|
||||
}
|
||||
|
||||
/* init the contents */
|
||||
newList->fullFilePath = fullFilePath; /* copy made earlier */
|
||||
newList->fileName = XtNewString(addFile.fileName);
|
||||
newList->nameKey = addFile.nameKey;
|
||||
newList->docId = (addFile.docId == &empty ? NULL : addFile.docId);
|
||||
newList->timeStamp = (addFile.timeStamp == &empty ? NULL : addFile.timeStamp);
|
||||
newList->fileTitle = addFile.fileTitle;
|
||||
newList->fileTitleXmStr = addFile.fileTitleXmStr;
|
||||
if (next) newList->next = next;
|
||||
if (prev) prev->next = newList;
|
||||
else *in_out_list = newList;
|
||||
|
||||
return True; /* created new entry */
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpFileListScanPaths ()
|
||||
*
|
||||
* Parameters:
|
||||
* type: subdirectories to search (%T)
|
||||
* suffix: extension of the files to find (%S)
|
||||
* searchHomeDir: boolean flag
|
||||
* in_out_list: manages list of files generated
|
||||
*
|
||||
* Returns: count of files added to the list or -1
|
||||
*
|
||||
* errno Values:
|
||||
* EINVAL
|
||||
*
|
||||
* Purpose: Scans all paths of given type looking for files with the suffixes
|
||||
*
|
||||
*****************************************************************************/
|
||||
int _DtHelpFileListScanPaths (
|
||||
_DtHelpFileList * in_out_list,
|
||||
XmFontList * io_fontList,
|
||||
Boolean * ret_mod,
|
||||
char * type,
|
||||
const char * suffixList[],
|
||||
Boolean searchHomeDir,
|
||||
_DtHelpFileInfoProc infoProc,
|
||||
XtPointer pDisplayArea,
|
||||
int sysPathCompareFlags,
|
||||
int otherPathCompareFlags,
|
||||
int sortFlags,
|
||||
_DtHelpFileScanProcCB scanProc,
|
||||
XtPointer clientData)
|
||||
{
|
||||
char *loc;
|
||||
char *ptr;
|
||||
char *pathName;
|
||||
struct stat status;
|
||||
char *curPath;
|
||||
int curPathIndex;
|
||||
int foundFilesCnt;
|
||||
int compareFlags;
|
||||
char * paths[_DtHELP_FILE_NUM_PATHS];
|
||||
char ** scannedPaths = NULL;
|
||||
int scannedPathsCnt = 0;
|
||||
|
||||
/* get the search paths */
|
||||
_DtHelpFileGetSearchPaths( paths, searchHomeDir );
|
||||
|
||||
/* get the locale */
|
||||
loc = _DtHelpGetLocale();
|
||||
if (NULL == loc || EOS == loc[0]) loc = strdup(LANG_C_STR);
|
||||
|
||||
/* zero found */
|
||||
if (scanProc) (*scanProc)(0,clientData);
|
||||
|
||||
/* outer loop is once for each path */
|
||||
foundFilesCnt = 0;
|
||||
for ( curPathIndex = 0;
|
||||
curPathIndex < _DtHELP_FILE_NUM_PATHS;
|
||||
curPathIndex++ )
|
||||
{
|
||||
curPath = paths[curPathIndex];
|
||||
if (NULL == curPath) continue;
|
||||
|
||||
/* set the comparison flags */
|
||||
/* This enables implementation of different policies for
|
||||
listing files that are found, e.g. only list the first file
|
||||
of a given name found in the SYS search path, while listing
|
||||
same named files that have different times & ids in the
|
||||
USER PATH. */
|
||||
compareFlags = sysPathCompareFlags;
|
||||
if (_DtHELP_FILE_SYS_PATH != curPathIndex)
|
||||
compareFlags = otherPathCompareFlags;
|
||||
|
||||
/* find the files in that path */
|
||||
do
|
||||
{
|
||||
char * slashptr;
|
||||
/* look for next subpath separator and insert and EOS if found */
|
||||
if (_DtHelpCeStrchr(curPath,PathSeparator,MB_CUR_MAX,&ptr)==0)
|
||||
*ptr = EOS;
|
||||
|
||||
/* generate the (directory) path using all the variables
|
||||
and fix it up to remove the unwanted stuff involving the filename*/
|
||||
pathName = _DtHelpCeExpandPathname(curPath,
|
||||
NULL, type, NULL, loc, NULL, 0);
|
||||
if( pathName
|
||||
&& _DtHelpCeStrrchr(pathName,DirSlashStr,MB_CUR_MAX,&slashptr) == 0)
|
||||
slashptr[0] = EOS;
|
||||
|
||||
/* restore the subpath separator and advance past it */
|
||||
if (ptr) *ptr++ = *PathSeparator;
|
||||
|
||||
/* if its a directory; scan for matching files in it */
|
||||
if ( pathName != NULL
|
||||
&& *pathName != EOS
|
||||
&& access (pathName, R_OK | X_OK) == 0
|
||||
&& stat (pathName, &status) == 0
|
||||
&& S_ISDIR(status.st_mode)) /* a dir */
|
||||
{
|
||||
int i;
|
||||
/* check that we haven't already scanned it */
|
||||
for ( i=0; i<scannedPathsCnt; i++ )
|
||||
if (strcmp(scannedPaths[i],pathName) == 0) break;
|
||||
|
||||
/* scan it if haven't already */
|
||||
if ( i == scannedPathsCnt )
|
||||
{
|
||||
foundFilesCnt += ScanDirForFiles(
|
||||
pathName,suffixList,
|
||||
in_out_list,io_fontList,ret_mod,
|
||||
foundFilesCnt,infoProc,pDisplayArea,
|
||||
compareFlags,sortFlags,scanProc,clientData);
|
||||
|
||||
/* add to list of scanned */
|
||||
scannedPaths = (char **) XtRealloc((char *)scannedPaths,
|
||||
(scannedPathsCnt+1) * sizeof(char *) );
|
||||
scannedPaths[scannedPathsCnt++] = strdup(pathName);
|
||||
} /* if haven' scanned already */
|
||||
} /* if a directory */
|
||||
#if 0
|
||||
else
|
||||
{
|
||||
printf("Unknown dir: %s\n", pathName);
|
||||
printf("Access: %d, stat: %d, IS_DIR: %d, mode: %x\n",
|
||||
access (pathName, R_OK | X_OK),
|
||||
stat (pathName, &status),
|
||||
S_ISDIR(status.st_mode),
|
||||
status.st_mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pathName) free (pathName);
|
||||
curPath = ptr;
|
||||
} while (curPath && *curPath); /* while more subpaths */
|
||||
} /* for all paths */
|
||||
|
||||
/* free all scanned paths */
|
||||
while ( scannedPathsCnt-- > 0 ) XtFree(scannedPaths[scannedPathsCnt]);
|
||||
XtFree((char *)scannedPaths);
|
||||
|
||||
XtFree(loc);
|
||||
return foundFilesCnt;
|
||||
}
|
||||
|
||||
116
cde/lib/DtHelp/FileListUtilsI.h
Normal file
116
cde/lib/DtHelp/FileListUtilsI.h
Normal file
@@ -0,0 +1,116 @@
|
||||
/* $XConsortium: FileListUtilsI.h /main/5 1995/10/26 12:19:25 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: FileListUtilsI.h
|
||||
**
|
||||
** Project: DtHelp Project
|
||||
**
|
||||
** Description: File locating and handling utilities
|
||||
**
|
||||
**
|
||||
** (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 _FileListUtilsI_h
|
||||
#define _FileListUtilsI_h
|
||||
|
||||
#include <Xm/XmP.h>
|
||||
|
||||
typedef struct _DtHelpFileRec {
|
||||
struct _DtHelpFileRec * next; /* next file in list */
|
||||
char * fileName; /* basename plus extensions */
|
||||
char * fullFilePath; /* full path of the file */
|
||||
int nameKey; /* used for quick identity compare*/
|
||||
char * fileTitle; /* comparable title of file */
|
||||
XmString fileTitleXmStr; /* displayable title of file */
|
||||
char * docId; /* string identifying doc */
|
||||
char * timeStamp; /* string with time of doc */
|
||||
void * clientData; /* data assoc with the file */
|
||||
unsigned int fileSelected:1; /* file selected for activity */
|
||||
unsigned int reservedFlag1:1;
|
||||
unsigned int reservedFlag2:1;
|
||||
unsigned int reservedFlag3:1;
|
||||
unsigned int clientFlag1:1;
|
||||
unsigned int clientFlag2:1;
|
||||
unsigned int clientFlag3:1;
|
||||
unsigned int clientFlag4:1;
|
||||
} _DtHelpFileRec, * _DtHelpFileEntry, * _DtHelpFileList;
|
||||
|
||||
typedef void (*_DtHelpFileScanProcCB)(
|
||||
int count,
|
||||
XtPointer clientData);
|
||||
|
||||
typedef Boolean (*_DtHelpFileInfoProc)(
|
||||
XtPointer pDisplayArea, /* in: display area in use */
|
||||
char * volumePath, /* in: full path to file */
|
||||
char ** ret_title, /* out: mallocd doc title string */
|
||||
XmString * ret_titleXmStr,/* out: mallocd doc title XmStr */
|
||||
char ** ret_docId, /* out: mallocd doc Id string */
|
||||
char ** ret_timeStamp, /* out: mallocd doc time string */
|
||||
int * ret_nameKey, /* out: hash value for fast discimination */
|
||||
XmFontList * io_fontList, /* io: fontList for title */
|
||||
Boolean * ret_mod); /* out: has font list been changed */
|
||||
|
||||
|
||||
/* Bitwise-ORable flags that affect the comparisons
|
||||
done when comparing two files. */
|
||||
typedef enum {
|
||||
_DtHELP_FILE_NAME = 0x01,
|
||||
_DtHELP_FILE_DIR = 0x02,
|
||||
_DtHELP_FILE_TITLE = 0x04,
|
||||
_DtHELP_FILE_TIME = 0x08,
|
||||
_DtHELP_FILE_IDSTR = 0x10,
|
||||
_DtHELP_FILE_LOCALE = 0x20
|
||||
} _DtHelpFileAttributes;
|
||||
|
||||
Boolean _DtHelpFileListAddFile (
|
||||
_DtHelpFileList * in_out_list,
|
||||
XmFontList * io_fontList,
|
||||
Boolean * ret_mod,
|
||||
char * fullFilePath,
|
||||
char * fileName,
|
||||
_DtHelpFileInfoProc infoProc,
|
||||
int compareFlags,
|
||||
int sortFlags,
|
||||
XtPointer pDisplayArea);
|
||||
_DtHelpFileList _DtHelpFileListGetMatch (
|
||||
_DtHelpFileList fileListHead,
|
||||
char * fullFilePath,
|
||||
_DtHelpFileInfoProc infoProc,
|
||||
int compareFlags,
|
||||
XtPointer pDisplayArea);
|
||||
Boolean _DtHelpFileIsSameP(
|
||||
char * fileName1,
|
||||
char * fileName2,
|
||||
_DtHelpFileInfoProc infoProc,
|
||||
int compareFlags,
|
||||
XtPointer pDisplayArea);
|
||||
_DtHelpFileList _DtHelpFileListGetNext (
|
||||
_DtHelpFileList fileListHead,
|
||||
_DtHelpFileList curFile);
|
||||
int _DtHelpFileListScanPaths (
|
||||
_DtHelpFileList * in_out_list,
|
||||
XmFontList * io_fontList,
|
||||
Boolean * ret_mod,
|
||||
char * type,
|
||||
const char * suffixList[],
|
||||
Boolean searchHomeDir,
|
||||
_DtHelpFileInfoProc infoProc,
|
||||
XtPointer pDisplayArea,
|
||||
int sysPathCompareFlags,
|
||||
int otherPathCompareFlags,
|
||||
int sortFlags,
|
||||
_DtHelpFileScanProcCB scanProc,
|
||||
XtPointer clientData);
|
||||
void _DtHelpFileFreeEntry (
|
||||
_DtHelpFileEntry entry);
|
||||
|
||||
#endif /* _FileListUtilsI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
|
||||
651
cde/lib/DtHelp/FileUtils.c
Normal file
651
cde/lib/DtHelp/FileUtils.c
Normal file
@@ -0,0 +1,651 @@
|
||||
/* $TOG: FileUtils.c /main/8 1998/07/28 15:37:38 mgreess $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: FileUtils.c
|
||||
**
|
||||
** Project: File locating
|
||||
**
|
||||
** Description: Locates files (volumes) accessible via the
|
||||
** known paths
|
||||
**
|
||||
** NOTE: this file must remain free of Xt & Xm calls.
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/*
|
||||
* system includes
|
||||
*/
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/param.h> /* MAXPATHLEN */
|
||||
|
||||
#include <Dt/Help.h>
|
||||
|
||||
/*
|
||||
* private includes
|
||||
*/
|
||||
#include "bufioI.h" /* for AccessI.h */
|
||||
#include "Access.h" /* CompressPathname */
|
||||
#include "AccessI.h" /* ExpandPathname */
|
||||
#include "HelpP.h" /* for DtDEFAULT_xxx */
|
||||
#include "HelposI.h" /* for search path access */
|
||||
#include "StringFuncsI.h"
|
||||
#include "FileUtilsI.h"
|
||||
#include "Lock.h"
|
||||
|
||||
/******** constants *********/
|
||||
#define LANG_C_STR "C"
|
||||
#define DIR_SLASH '/'
|
||||
#define EOS '\0'
|
||||
|
||||
/******** types *********/
|
||||
|
||||
/******** public global variables *********/
|
||||
const char * _DtHelpFileSuffixList[3] = {
|
||||
DtHelpSDL_VOL_SUFFIX,
|
||||
DtHelpCCDF_VOL_SUFFIX,
|
||||
NULL };
|
||||
|
||||
/******** variables *********/
|
||||
static const char * EmptyStr = "";
|
||||
#ifdef not_used
|
||||
static const char * PeriodStr = ".";
|
||||
#endif
|
||||
static const char * DirSlashStr = "/";
|
||||
static const char * PathSeparator = ":";
|
||||
static const _DtHelpCeDirStruct DefCacheDir = { NULL, ENOTDIR, 0, NULL };
|
||||
|
||||
static _DtHelpCeDirStruct *CachedDirs = NULL;
|
||||
|
||||
/******** functions *********/
|
||||
#define MyNewString(s) (NULL != s ? strdup((char *)s) : NULL)
|
||||
#define MyRealloc(p,s) (NULL != (p) ? realloc((char *)p,s) : malloc(s) )
|
||||
#define MyMalloc(s) malloc(s)
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: MyFree()
|
||||
*
|
||||
* locate the '.' of the filename extension, if present
|
||||
*
|
||||
*****************************************************************************/
|
||||
static void MyFree(char * ptr)
|
||||
{
|
||||
if(ptr) free(ptr);
|
||||
}
|
||||
|
||||
|
||||
#ifdef not_used
|
||||
/*****************************************************************************
|
||||
* Function: GetExtension()
|
||||
*
|
||||
* locate the '.' of the filename extension, if present
|
||||
*
|
||||
*****************************************************************************/
|
||||
static char * GetExtension(
|
||||
char * filename)
|
||||
{
|
||||
char * ext;
|
||||
if (_DtHelpCeStrrchr(filename,PeriodStr,MB_CUR_MAX,&ext) == 0 ) return ext;
|
||||
else return ""; /* do NOT return a NULL*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: SpecialStrcmp()
|
||||
*
|
||||
* Tests the args for NULL pointers. If both are NULL or if
|
||||
* both aren't NULL and are the same string, then returns 0.
|
||||
* If one arg is NULL and other isn't, or if strings are
|
||||
* different, returns -1 or +1.
|
||||
*
|
||||
*****************************************************************************/
|
||||
static int SpecialStrcmp(
|
||||
const char * str1,
|
||||
const char * str2)
|
||||
{
|
||||
if(NULL == str1)
|
||||
{
|
||||
if(NULL == str2) return 0; /* str1 == str2 */
|
||||
return -1; /* str1 < str2 */
|
||||
}
|
||||
if(NULL == str2) return 1; /* str1 > str2 */
|
||||
return(strcmp(str1,str2)); /* str1 ? str2 */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* Function: _DtHelpFileTraceLinks (pathName)
|
||||
*
|
||||
* Purpose: Traces pathname through all symbolic links
|
||||
* until a real file is found or the link is
|
||||
* found to be invalid.
|
||||
*
|
||||
* Returns: True if file found at end of link, False if not
|
||||
*
|
||||
* Memory: pathName must point to a malloc'd string. The string
|
||||
* may be freed by the function and pathName assigned a pointer
|
||||
* to a different string specifying a different path to the same file.
|
||||
* If a file is found, foundPath is set to the same pointer
|
||||
* as pathName, otherwise it is set to NULL.
|
||||
***********************************************************************/
|
||||
Boolean
|
||||
_DtHelpFileTraceLinks (
|
||||
char * * pPathName)
|
||||
{
|
||||
int result = 0;
|
||||
char curBuf;
|
||||
char * linkPath;
|
||||
char * filePath;
|
||||
char buf [2][MAXPATHLEN+2]; /* 2K+ bytes on stack */
|
||||
|
||||
if ( NULL == *pPathName ) return False; /* RETURN */
|
||||
|
||||
/* init */
|
||||
strcpy(buf[0],*pPathName);
|
||||
linkPath = buf[0]; /* will be assigned to filePath below */
|
||||
curBuf = 1; /* next valid buf */
|
||||
|
||||
/* find out if this path is a symbolic link */
|
||||
while ( result >= 0 )
|
||||
{
|
||||
/* exchange buffer ptrs and toggle index */
|
||||
filePath = linkPath;
|
||||
linkPath = buf[curBuf % 2];
|
||||
curBuf++;
|
||||
|
||||
/* get the link info */
|
||||
result = readlink (filePath, linkPath, MAXPATHLEN);
|
||||
|
||||
/* check for the result of the readlink call */
|
||||
if (result == -1)
|
||||
{
|
||||
/* if newPath is not a symbolic link, errno != EINVAL */
|
||||
if (errno != EINVAL)
|
||||
return False; /* RETURN */
|
||||
|
||||
/* filePath is not a sym link ==> a real file or directory */
|
||||
/* so return filePath in caller-owned memory */
|
||||
if ( curBuf != 1 ) /* curBuf == 1 when pPathName is a file */
|
||||
{
|
||||
/*
|
||||
* pPathName had memory allocated before this function was called.
|
||||
* only increase the memory if needed.
|
||||
*/
|
||||
if ( strlen (*pPathName) < strlen(filePath) )
|
||||
*pPathName = (char *)realloc((void *)*pPathName, (sizeof(char)
|
||||
* (strlen(filePath) +1)));
|
||||
|
||||
strcpy(*pPathName, filePath);
|
||||
}
|
||||
/* printf("actual is: %s\n", filePath); ** DBG */
|
||||
return True; /* RETURN */
|
||||
} /* if an error */
|
||||
else
|
||||
{ /* no error--handle the link */
|
||||
|
||||
/* if the path is absolute, just take it as such */
|
||||
linkPath [result] = EOS; /* for safety */
|
||||
|
||||
/* is path relative to current directory? */
|
||||
if ( linkPath[0] != DIR_SLASH )
|
||||
{
|
||||
char * slash = NULL;
|
||||
|
||||
/* get last slash in the current file path */
|
||||
if(_DtHelpCeStrrchr(filePath,DirSlashStr,MB_CUR_MAX,&slash) == 0)
|
||||
{ /* there is a path comonent in filePath; use it with linkPath */
|
||||
strcpy(++slash,linkPath);
|
||||
strcpy(linkPath,filePath); /* leave result in linkPath */
|
||||
}
|
||||
} /* if path is relative */
|
||||
/* printf("traced to: %s\n", linkPath); ** DBG */
|
||||
} /* if no error */
|
||||
} /* while result >= 0 */
|
||||
return False; /* RETURN */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* Function: _DtHelpFileTraceToFile (pathName, accessMode, foundPath)
|
||||
*
|
||||
* Memory: pPathName must point to a malloc'd string. The string
|
||||
* may be freed by the function and pathName assigned a pointer
|
||||
* to a different string specifying a different path to the same file.
|
||||
* If a file is found, foundPath is set to the same pointer
|
||||
* as pathName, otherwise it is set to NULL.
|
||||
* Returns:
|
||||
* True: file found
|
||||
* False: file not found or error
|
||||
***********************************************************************/
|
||||
Boolean
|
||||
_DtHelpFileTraceToFile (
|
||||
char * * pPathName,
|
||||
int accessMode,
|
||||
char * * pFoundPath)
|
||||
{
|
||||
struct stat status;
|
||||
char * pathName = *pPathName; /* avoid indirection */
|
||||
|
||||
*pFoundPath = NULL;
|
||||
if ( pathName == NULL || pathName[0] == EOS )
|
||||
return False;
|
||||
|
||||
/* if it's a file, trace its links */
|
||||
if ( access (pathName, accessMode) == 0
|
||||
&& stat (pathName, &status) == 0
|
||||
&& S_ISREG(status.st_mode) ) /* a file */
|
||||
{
|
||||
/* trace any links */
|
||||
if ( _DtHelpFileTraceLinks(pPathName) == False )
|
||||
{
|
||||
/* don't free pPathName here */
|
||||
return False; /* RETURN: no file */
|
||||
}
|
||||
pathName = *pPathName;
|
||||
|
||||
/* find out if its an accessible file */
|
||||
if ( pathName != NULL
|
||||
&& pathName[0] != EOS
|
||||
&& access (pathName, accessMode) == 0
|
||||
&& stat (pathName, &status) == 0
|
||||
&& S_ISREG(status.st_mode)) /* a file */
|
||||
{
|
||||
/* point foundPath at the path */
|
||||
*pFoundPath = pathName;
|
||||
return True; /* RETURN: its a file */
|
||||
} /* if a valid path */
|
||||
} /* if a path */
|
||||
|
||||
#if 0
|
||||
printf("Unknown file: %s\n", pathName);
|
||||
printf("Access: %d, stat: %d, IS_REG: %d, mode: %x\n",
|
||||
access (pathName, accessMode),
|
||||
stat (pathName, &status),
|
||||
S_ISREG(status.st_mode),
|
||||
status.st_mode);
|
||||
#endif
|
||||
|
||||
/* its not a file */
|
||||
*pFoundPath = NULL;
|
||||
return False;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpFileGetSearchPaths ()
|
||||
*
|
||||
* Parameters:
|
||||
* paths: caller array size _DtHELP_FILE_NUM_PATHS in which
|
||||
* to store ptrs to the private path strings
|
||||
* searchHomeDir: boolean flag
|
||||
*
|
||||
* Memory:
|
||||
* the memory pointed to by the array is NOT owned by the
|
||||
* caller and should not be freed or modified
|
||||
*
|
||||
* Purpose: make the search paths available
|
||||
*
|
||||
*****************************************************************************/
|
||||
void _DtHelpFileGetSearchPaths(
|
||||
char * paths[],
|
||||
Boolean searchHomeDir)
|
||||
{
|
||||
static char * pathsSet[_DtHELP_FILE_NUM_PATHS];
|
||||
char tmpPath[MAXPATHLEN + 2];
|
||||
|
||||
/* get user's home directory; is used in _DtHELP_FILE_USER_PATH as well */
|
||||
if (NULL == pathsSet[_DtHELP_FILE_HOME_PATH])
|
||||
{
|
||||
_DtHelpOSGetHomeDirName(tmpPath, sizeof(tmpPath));
|
||||
pathsSet[_DtHELP_FILE_HOME_PATH] = strdup(tmpPath);
|
||||
}
|
||||
if (searchHomeDir)
|
||||
paths[_DtHELP_FILE_HOME_PATH] = pathsSet[_DtHELP_FILE_HOME_PATH];
|
||||
else
|
||||
paths[_DtHELP_FILE_HOME_PATH] = NULL;
|
||||
|
||||
/* generate the user path */
|
||||
if (NULL == pathsSet[_DtHELP_FILE_USER_PATH])
|
||||
pathsSet[_DtHELP_FILE_USER_PATH] = _DtHelpGetUserSearchPath();
|
||||
paths[_DtHELP_FILE_USER_PATH] = pathsSet[_DtHELP_FILE_USER_PATH];
|
||||
|
||||
/* get the system search path */
|
||||
if (NULL == pathsSet[_DtHELP_FILE_SYS_PATH])
|
||||
pathsSet[_DtHELP_FILE_SYS_PATH] = _DtHelpGetSystemSearchPath();
|
||||
paths[_DtHELP_FILE_SYS_PATH] = pathsSet[_DtHELP_FILE_SYS_PATH];
|
||||
}
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Function: char * _DtHelpFileLocate ()
|
||||
*
|
||||
* Parameters:
|
||||
* type: subdirectories to search (%T)
|
||||
* base: basename of the file
|
||||
* suffix: extension of the file to find (%S)
|
||||
* searchCurDir: boolean flag
|
||||
* accessMode: constant value from access(2)
|
||||
*
|
||||
* Returns: malloc'd path of the located file or NULL if none located
|
||||
*
|
||||
* errno Values:
|
||||
* EINVAL
|
||||
*
|
||||
* Purpose: Scans all paths of given type looking for a matching file
|
||||
* If file contains a valid absolute path, that is also
|
||||
* acceptible.
|
||||
*
|
||||
* FIX: merge _DtHelpFileLocate() and _DtHelpFileListScanPaths()
|
||||
*****************************************************************************/
|
||||
char * _DtHelpFileLocate (
|
||||
char * type,
|
||||
char * filespec,
|
||||
const char * suffixList[],
|
||||
Boolean searchCurDir,
|
||||
int accessMode)
|
||||
{
|
||||
char * loc;
|
||||
char * ptr;
|
||||
char * pathName;
|
||||
char * curPath;
|
||||
char * base;
|
||||
int curPathIndex;
|
||||
char * foundPath;
|
||||
const char empty = 0;
|
||||
const char * sufList[2];
|
||||
#define NUM_BUGS 1
|
||||
_DtSubstitutionRec bugFixSubs [NUM_BUGS];
|
||||
char * paths[_DtHELP_FILE_NUM_PATHS];
|
||||
char tmpPath[MAXPATHLEN + 2];
|
||||
const char * * pSuffix;
|
||||
char * eos = NULL;
|
||||
char * slash = NULL;
|
||||
|
||||
/* test args */
|
||||
if (NULL == filespec) return NULL;
|
||||
|
||||
/* init suffix list to empty if not specified */
|
||||
if (suffixList == NULL)
|
||||
{
|
||||
sufList[0] = ∅
|
||||
sufList[1] = NULL;
|
||||
suffixList = sufList; /* override initial argument setting */
|
||||
}
|
||||
|
||||
/*** first look for file as specified ***/
|
||||
/* if filespec begins with . or .. then stop after the cwd path */
|
||||
if ( ( MB_CUR_MAX == 1
|
||||
|| mblen(filespec, MB_CUR_MAX) == 1) /* 1st char is 1 byte */
|
||||
&& *filespec == '/') /* and its a / */
|
||||
{
|
||||
/* _DtHelpFileTraceToFile() needs a malloc'd string */
|
||||
/* 10: leaves room for add'l suffixes */
|
||||
pathName = MyMalloc(sizeof(char) * (strlen(filespec)+10));
|
||||
pathName = strcpy(pathName,filespec);
|
||||
_DtHelpCeCompressPathname(pathName); /* compress out relative paths */
|
||||
if ( _DtHelpFileTraceToFile(&pathName,accessMode,&foundPath) )
|
||||
return foundPath; /* RETURN */
|
||||
|
||||
/* test all suffixes */
|
||||
eos = pathName + strlen(pathName);
|
||||
for ( pSuffix = suffixList; NULL != *pSuffix; pSuffix++ )
|
||||
{
|
||||
strcpy(eos,(char *) *pSuffix);
|
||||
/*recall: _DtHelpFileTraceToFile() requires pathName to be malloc'd*/
|
||||
if ( _DtHelpFileTraceToFile(&pathName,accessMode,&foundPath) )
|
||||
return foundPath; /* RETURN: found */
|
||||
} /* for all suffixes */
|
||||
|
||||
MyFree(pathName);
|
||||
}
|
||||
|
||||
/*** second, check if its relative to the current directory ***/
|
||||
/* if filespec begins with . or .. then stop after the cwd path */
|
||||
if ( searchCurDir
|
||||
|| ( MB_CUR_MAX == 1
|
||||
|| mblen(filespec, MB_CUR_MAX) == 1) /* 1st char is 1 byte */
|
||||
&& *filespec == '.') /* and its a . */
|
||||
{ /* we're looking at a cwd-relative path; ignore others */
|
||||
/*** this is monstrously inefficient--but it shouldn't get called often ***/
|
||||
|
||||
/* get user's current working directory */
|
||||
if (getcwd(tmpPath, MAXPATHLEN) == NULL) return NULL; /* RETURN: error */
|
||||
|
||||
/* make path end in a slash */
|
||||
eos = tmpPath + strlen(tmpPath);
|
||||
_DtHelpCeStrrchr(tmpPath,DirSlashStr,MB_CUR_MAX,&slash);
|
||||
if ( slash != (eos - 1) ) { *eos++ = DIR_SLASH; *eos = EOS; }
|
||||
|
||||
/* make a malloc'd copy of the path with room to grow */
|
||||
slash = filespec + strlen(filespec);
|
||||
pathName = malloc(sizeof(char) *
|
||||
((eos-tmpPath) + (slash-filespec) + 50) ); /* 50: arbitrary */
|
||||
if (NULL == pathName) return NULL; /* RETURN: error */
|
||||
strcpy(pathName,tmpPath);
|
||||
|
||||
/* cat on the relative path */
|
||||
strcat(pathName,filespec);
|
||||
|
||||
/* compress out any relative paths */
|
||||
_DtHelpCeCompressPathname(pathName);
|
||||
|
||||
/* see if we find the file now */
|
||||
/* recall: _DtHelpFileTraceToFile() requires pathName to be malloc'd */
|
||||
if ( _DtHelpFileTraceToFile(&pathName,accessMode,&foundPath) )
|
||||
return foundPath; /* RETURN: found */
|
||||
|
||||
/* test all suffixes */
|
||||
eos = pathName + strlen(pathName);
|
||||
for ( pSuffix = suffixList; NULL != *pSuffix; pSuffix++ )
|
||||
{
|
||||
strcpy(eos,(char *) *pSuffix);
|
||||
/* recall: _DtHelpFileTraceToFile() requires pathName to be malloc'd */
|
||||
if ( _DtHelpFileTraceToFile(&pathName,accessMode,&foundPath) )
|
||||
return foundPath; /* RETURN: found */
|
||||
} /* for all suffixes */
|
||||
MyFree(pathName);
|
||||
return NULL; /* RETURN: error */
|
||||
} /* filespec is a relative path or search cur dir */
|
||||
|
||||
/*** third look in search path directories ***/
|
||||
|
||||
/* get the search paths */
|
||||
_DtHelpFileGetSearchPaths( paths, False );
|
||||
|
||||
/*** prep variables to pass through the path search loop ***/
|
||||
/* we're not looking at a cwd-relative path and
|
||||
we know that 'filespec' isn't a valid path to a volume
|
||||
(from _DtHelpFileTraceToFile), so just pick off the
|
||||
basename of the spec */
|
||||
base = filespec;
|
||||
if ( _DtHelpCeStrrchr(filespec,DirSlashStr,MB_CUR_MAX,&ptr) == 0 )
|
||||
base = ++ptr; /* begin past the slash */
|
||||
|
||||
/* Have to support %H explicitly */
|
||||
bugFixSubs[0].match = 'H';
|
||||
bugFixSubs[0].substitution = base;
|
||||
|
||||
/* get the LANG value */
|
||||
loc = _DtHelpGetLocale();
|
||||
if (NULL == loc || EOS == loc[0]) loc = strdup(LANG_C_STR);
|
||||
|
||||
/* outer loop is once for each path */
|
||||
foundPath = NULL;
|
||||
for ( curPathIndex = 0;
|
||||
curPathIndex < _DtHELP_FILE_NUM_PATHS && NULL == foundPath;
|
||||
curPathIndex++ )
|
||||
{
|
||||
curPath = paths[curPathIndex];
|
||||
if (NULL == curPath) continue; /* continue */
|
||||
|
||||
/* look for the file in that path */
|
||||
if (NULL != curPath) do
|
||||
{
|
||||
/* look for next subpath separator and insert and EOS if found */
|
||||
if (_DtHelpCeStrchr(curPath,PathSeparator,MB_CUR_MAX,&ptr)==0)
|
||||
*ptr = EOS;
|
||||
|
||||
/* compress that path */
|
||||
strcpy(tmpPath,curPath);
|
||||
_DtHelpCeCompressPathname(tmpPath);
|
||||
|
||||
/* test all suffixes */
|
||||
for ( pSuffix = suffixList, foundPath = NULL;
|
||||
NULL == foundPath && NULL != *pSuffix;
|
||||
pSuffix++ )
|
||||
{
|
||||
/* generate the (directory) path using all the variables and fix
|
||||
it up to remove the unwanted stuff involving the filename */
|
||||
pathName = _DtHelpCeExpandPathname (curPath, base, type,
|
||||
(char *) *pSuffix, loc, bugFixSubs, NUM_BUGS);
|
||||
|
||||
if ( _DtHelpFileTraceToFile(&pathName,accessMode,&foundPath)==False
|
||||
&& NULL != pathName)
|
||||
free(pathName);
|
||||
|
||||
} /* for all suffixes */
|
||||
|
||||
/* restore the subpath separator and advance past it */
|
||||
if (ptr) *ptr++ = *PathSeparator;
|
||||
|
||||
curPath = ptr;
|
||||
} while (curPath && *curPath && NULL == foundPath);
|
||||
/* do while more subpaths */
|
||||
|
||||
} /* for all paths */
|
||||
|
||||
MyFree(loc);
|
||||
return foundPath;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpCeCheckAndCacheDir (char *dir)
|
||||
*
|
||||
* Parameters:
|
||||
* dir Specifies the directory to test.
|
||||
*
|
||||
* Returns: 0 if the directory exists.
|
||||
* ENOTDIR if the directory is invalid.
|
||||
*
|
||||
* Purpose: To check a directory only once and remember the result.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtHelpCeCheckAndCacheDir (char *dir)
|
||||
{
|
||||
int result = ENOTDIR;
|
||||
_DtHelpCeDirStruct *curDir = CachedDirs;
|
||||
_DtHelpCeDirStruct *prevDir = NULL;
|
||||
struct stat buf;
|
||||
|
||||
_DtHelpProcessLock();
|
||||
|
||||
if (dir == NULL || *dir == '\0')
|
||||
return ENOTDIR;
|
||||
|
||||
/*
|
||||
* search the cached directories
|
||||
*/
|
||||
while (curDir != NULL && strcmp(curDir->dir_name, dir))
|
||||
{
|
||||
prevDir = curDir;
|
||||
curDir = curDir->next_dir;
|
||||
}
|
||||
|
||||
/*
|
||||
* was the directory found in the cache? If so, return the type.
|
||||
*/
|
||||
if (curDir != NULL)
|
||||
result = curDir->type;
|
||||
else
|
||||
{
|
||||
/*
|
||||
* new directory - malloc room for this entry.
|
||||
*/
|
||||
result = ENOMEM;
|
||||
curDir = (_DtHelpCeDirStruct *) malloc(sizeof(_DtHelpCeDirStruct));
|
||||
if (curDir != NULL)
|
||||
{
|
||||
/*
|
||||
* initialize the new entry. I.E. type starts out ENOTDIR.
|
||||
*/
|
||||
*curDir = DefCacheDir;
|
||||
curDir->dir_name = strdup(dir);
|
||||
if (curDir->dir_name != NULL)
|
||||
{
|
||||
/*
|
||||
* put this entry in the list
|
||||
*/
|
||||
if (prevDir != NULL)
|
||||
prevDir->next_dir = curDir;
|
||||
else
|
||||
CachedDirs = curDir;
|
||||
|
||||
/*
|
||||
* is this a directory?
|
||||
*/
|
||||
if (access(dir, R_OK) == 0 &&
|
||||
stat(dir, &buf) == 0 && S_ISDIR(buf.st_mode))
|
||||
curDir->type = 0;
|
||||
|
||||
/*
|
||||
* return the result of the tests.
|
||||
*/
|
||||
result = curDir->type;
|
||||
}
|
||||
else
|
||||
free(curDir);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This should never happen, but just in case the directory
|
||||
* can't be cached, go ahead and check it anyway.
|
||||
*/
|
||||
if (result == ENOMEM && access(dir, R_OK) == 0 &&
|
||||
stat(dir, &buf) == 0 && S_ISDIR(buf.st_mode))
|
||||
result = 0;
|
||||
|
||||
_DtHelpProcessUnlock();
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef not_done
|
||||
/******************************************************************************
|
||||
* Function: _DtHelpCeDirStruct *_DtHelpCeGetCachedDirs (void)
|
||||
*
|
||||
* Parameters: none.
|
||||
*
|
||||
* Returns: A pointer to the cached directories.
|
||||
*
|
||||
* Purpose: To allow access to the cached directories.
|
||||
*
|
||||
*****************************************************************************/
|
||||
_DtHelpCeDirStruct *
|
||||
_DtHelpCeGetCachedDirs (void)
|
||||
{
|
||||
return CachedDirs;
|
||||
}
|
||||
#endif /* not_done */
|
||||
62
cde/lib/DtHelp/FileUtilsI.h
Normal file
62
cde/lib/DtHelp/FileUtilsI.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/* $XConsortium: FileUtilsI.h /main/5 1995/10/26 12:19:41 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: FileUtilsI.h
|
||||
**
|
||||
** Project: DtHelp Project
|
||||
**
|
||||
** Description: File locating and handling utilities
|
||||
**
|
||||
** (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 _DtHelpFileUtilsI_h
|
||||
#define _DtHelpFileUtilsI_h
|
||||
|
||||
#define DtHelpVOLUME_TYPE "volumes" /* dir for %T in XtResolvePathname */
|
||||
#define DtHelpCCDF_VOL_SUFFIX ".hv" /* possible basename suffix */
|
||||
#define DtHelpSDL_VOL_SUFFIX ".sdl" /* possible basename suffix */
|
||||
|
||||
/* array indices and size for use with _DtHelpFileGetSearchPaths() */
|
||||
#define _DtHELP_FILE_USER_PATH 0
|
||||
#define _DtHELP_FILE_SYS_PATH 1
|
||||
#define _DtHELP_FILE_HOME_PATH 2
|
||||
#define _DtHELP_FILE_NUM_PATHS 3
|
||||
|
||||
typedef struct _dtHelpCeDirStruct {
|
||||
char *dir_name;
|
||||
int type;
|
||||
int user_flag;
|
||||
struct _dtHelpCeDirStruct *next_dir;
|
||||
} _DtHelpCeDirStruct;
|
||||
|
||||
/* list of suffixes that help volumes may have */
|
||||
extern const char * _DtHelpFileSuffixList[];
|
||||
|
||||
extern int _DtHelpCeCheckAndCacheDir(char *dir);
|
||||
extern void _DtHelpFileGetSearchPaths(
|
||||
char * paths[],
|
||||
Boolean searchHomeDir);
|
||||
extern char *_DtHelpFileLocate (
|
||||
char * type,
|
||||
char * base,
|
||||
const char * suffixList[],
|
||||
Boolean searchCurDir,
|
||||
int accessMode);
|
||||
extern Boolean _DtHelpFileTraceLinks (
|
||||
char * * pPathName);
|
||||
extern Boolean _DtHelpFileTraceToFile (
|
||||
char * * pPathName,
|
||||
int accessMode,
|
||||
char * * pFoundPath);
|
||||
|
||||
#endif /* _DtHelpFileUtilsI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
|
||||
1055
cde/lib/DtHelp/Font.c
Normal file
1055
cde/lib/DtHelp/Font.c
Normal file
File diff suppressed because it is too large
Load Diff
213
cde/lib/DtHelp/FontAttr.c
Normal file
213
cde/lib/DtHelp/FontAttr.c
Normal file
@@ -0,0 +1,213 @@
|
||||
/* $XConsortium: FontAttr.c /main/8 1996/01/29 12:19:57 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Font.c
|
||||
**
|
||||
** Project: Text Graphic Display Library
|
||||
**
|
||||
** Description: Semi private format utility functions that do not
|
||||
** require the Display Area, Motif, Xt or X11.
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
/*
|
||||
* system includes
|
||||
*/
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* private includes
|
||||
*/
|
||||
#include "FontAttrI.h"
|
||||
|
||||
#ifdef NLS16
|
||||
#endif
|
||||
|
||||
/******** Private Function Declarations ********/
|
||||
/******** End Public Function Declarations ********/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private variables and defines.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
static _DtHelpFontHints DefaultFontAttrs =
|
||||
{
|
||||
"C",
|
||||
"ISO-8859-1",
|
||||
10, 0, /* pointsz, setsize */
|
||||
NULL, /* color */
|
||||
NULL, NULL, NULL, NULL, /* xlfd strings */
|
||||
NULL, NULL, NULL, NULL, /* MS-Win strings */
|
||||
_DtHelpFontStyleSanSerif,
|
||||
_DtHelpFontSpacingProp ,
|
||||
_DtHelpFontWeightMedium ,
|
||||
_DtHelpFontSlantRoman ,
|
||||
_DtHelpFontSpecialNone ,
|
||||
NULL
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private Functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
static int
|
||||
HintDuplicate(char **string)
|
||||
{
|
||||
if (NULL != *string)
|
||||
{
|
||||
*string = strdup(*string);
|
||||
if (NULL == *string)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Semi Public Functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
/******************************************************************************
|
||||
* Function: void _DtHelpCeCopyDefFontAttrList (char **font_attr)
|
||||
*
|
||||
* Parameters: font_attr Specifies the font attribute list
|
||||
*
|
||||
* Return Value: void
|
||||
*
|
||||
* Purpose: Initialize a font attribute list to the default.
|
||||
* Sets '_DtMB_LEN_MAX' to the default character size.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpCeCopyDefFontAttrList (_DtHelpFontHints *font_attr )
|
||||
{
|
||||
*font_attr = DefaultFontAttrs;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: void _DtHelpFreeFontHints (
|
||||
*
|
||||
* Parameters: font_hints Specifies the font hint structure
|
||||
*
|
||||
* Return Value: void
|
||||
*
|
||||
* Purpose: frees the strings in the font structure.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpFreeFontHints (_DtHelpFontHints *font_hints )
|
||||
{
|
||||
/*
|
||||
* do the language and charset
|
||||
*/
|
||||
if (NULL != font_hints->language)
|
||||
free(font_hints->language);
|
||||
if (NULL != font_hints->char_set)
|
||||
free(font_hints->char_set);
|
||||
|
||||
/*
|
||||
* do the color
|
||||
*/
|
||||
if (NULL != font_hints->color)
|
||||
free(font_hints->color);
|
||||
|
||||
/*
|
||||
* do the xlfd fonts
|
||||
*/
|
||||
if (NULL != font_hints->xlfd)
|
||||
free(font_hints->xlfd);
|
||||
if (NULL != font_hints->xlfdb)
|
||||
free(font_hints->xlfdb);
|
||||
if (NULL != font_hints->xlfdi)
|
||||
free(font_hints->xlfdi);
|
||||
if (NULL != font_hints->xlfdib)
|
||||
free(font_hints->xlfdib);
|
||||
|
||||
/*
|
||||
* do the ms-windows fonts
|
||||
*/
|
||||
if (NULL != font_hints->typenam)
|
||||
free(font_hints->typenam);
|
||||
if (NULL != font_hints->typenamb)
|
||||
free(font_hints->typenamb);
|
||||
if (NULL != font_hints->typenami)
|
||||
free(font_hints->typenami);
|
||||
if (NULL != font_hints->typenamib)
|
||||
free(font_hints->typenamib);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: void _DtHelpDupFontHints (
|
||||
*
|
||||
* Parameters: font_hints Specifies the font hint structure
|
||||
*
|
||||
* Return Value: 0 for successful, -1 if failures.
|
||||
*
|
||||
* Purpose: to the dup the strings in the font hint structure.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtHelpDupFontHints (_DtHelpFontHints *font_hints )
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
/*
|
||||
* do the language and charset
|
||||
*/
|
||||
if (-1 == HintDuplicate(&(font_hints->language)))
|
||||
result = -1;
|
||||
if (-1 == HintDuplicate(&(font_hints->char_set)))
|
||||
result = -1;
|
||||
|
||||
/*
|
||||
* do the color
|
||||
*/
|
||||
if (-1 == HintDuplicate(&(font_hints->color)))
|
||||
result = -1;
|
||||
|
||||
/*
|
||||
* do the xlfd fonts
|
||||
*/
|
||||
if (-1 == HintDuplicate(&(font_hints->xlfd)))
|
||||
result = -1;
|
||||
if (-1 == HintDuplicate(&(font_hints->xlfdb)))
|
||||
result = -1;
|
||||
if (-1 == HintDuplicate(&(font_hints->xlfdi)))
|
||||
result = -1;
|
||||
if (-1 == HintDuplicate(&(font_hints->xlfdib)))
|
||||
result = -1;
|
||||
|
||||
/*
|
||||
* do the ms-windows fonts
|
||||
*/
|
||||
if (-1 == HintDuplicate(&(font_hints->typenam)))
|
||||
result = -1;
|
||||
if (-1 == HintDuplicate(&(font_hints->typenamb)))
|
||||
result = -1;
|
||||
if (-1 == HintDuplicate(&(font_hints->typenami)))
|
||||
result = -1;
|
||||
if (-1 == HintDuplicate(&(font_hints->typenamib)))
|
||||
result = -1;
|
||||
|
||||
if (-1 == result)
|
||||
_DtHelpFreeFontHints(font_hints);
|
||||
|
||||
return result;
|
||||
}
|
||||
169
cde/lib/DtHelp/FontAttrI.h
Normal file
169
cde/lib/DtHelp/FontAttrI.h
Normal file
@@ -0,0 +1,169 @@
|
||||
/* $XConsortium: FontAttrI.h /main/7 1995/12/06 18:36:56 cde-hp $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
** File: FontAttrI.h
|
||||
** Project: Common Desktop Environment
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpFontAttrI_h
|
||||
#define _DtHelpFontAttrI_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******** Public Defines Declarations ********/
|
||||
/*
|
||||
* font attributes
|
||||
*/
|
||||
#define _CEFONT_CHAR_SET 6
|
||||
#define _CEFONT_LANG_TER 5
|
||||
#define _CEFONT_TYPE 4
|
||||
#define _CEFONT_WEIGHT 3
|
||||
#define _CEFONT_ANGLE 2
|
||||
#define _CEFONT_SIZE 1
|
||||
#define _CEFONT_SPACING 0
|
||||
|
||||
#define _CEFONT_END 7
|
||||
|
||||
#define _CEFontAttrNumber 8
|
||||
|
||||
/******** Public Enum Declarations ********/
|
||||
enum _dtHelpFontValue
|
||||
{
|
||||
_DtHelpFontValueBad,
|
||||
/* styles */
|
||||
_DtHelpFontStyleSerif ,
|
||||
_DtHelpFontStyleSanSerif ,
|
||||
_DtHelpFontStyleSymbol,
|
||||
/* spacing */
|
||||
_DtHelpFontSpacingMono ,
|
||||
_DtHelpFontSpacingProp ,
|
||||
/* weights */
|
||||
_DtHelpFontWeightMedium ,
|
||||
_DtHelpFontWeightBold ,
|
||||
/* slant */
|
||||
_DtHelpFontSlantRevItalic ,
|
||||
_DtHelpFontSlantItalic ,
|
||||
_DtHelpFontSlantRoman ,
|
||||
/* special */
|
||||
_DtHelpFontSpecialUnderLine,
|
||||
_DtHelpFontSpecialStrikeOut,
|
||||
_DtHelpFontSpecialNone
|
||||
};
|
||||
|
||||
/******** Public Typedef Declarations ********/
|
||||
|
||||
typedef enum _dtHelpFontValue _DtHelpFontValue;
|
||||
|
||||
/******** Public Structures Declarations ********/
|
||||
|
||||
typedef struct _dtHelpFontHints {
|
||||
char *language;
|
||||
char *char_set;
|
||||
int pointsz; /* height of font in points */
|
||||
int set_width; /* width of font in points */
|
||||
char *color; /* 1 of 42 UDT colors or 'RGB:rrrr/gggg/bbbb */
|
||||
char *xlfd; /* xlfd name for use on X Window System */
|
||||
char *xlfdb; /* xlfd name for use on X Window System */
|
||||
char *xlfdi; /* xlfd name for use on X Window System */
|
||||
char *xlfdib; /* xlfd name for use on X Window System */
|
||||
char *typenam; /* typeface spec for MS-Windows interface */
|
||||
char *typenamb; /* typeface spec for MS-Windows interface */
|
||||
char *typenami; /* typeface spec for MS-Windows interface */
|
||||
char *typenamib; /* typeface spec for MS-Windows interface */
|
||||
_DtHelpFontValue style; /* font style */
|
||||
_DtHelpFontValue spacing; /* font spacing */
|
||||
_DtHelpFontValue weight; /* font weight */
|
||||
_DtHelpFontValue slant; /* font slant */
|
||||
_DtHelpFontValue special; /* special characteristics */
|
||||
void *expand; /* reserved pointer for later expansion */
|
||||
} _DtHelpFontHints;
|
||||
|
||||
/******** Public Structure Typedef Declarations ********/
|
||||
|
||||
/******** Public Prototyped Procedures ********/
|
||||
|
||||
/******** Public Macro Declarations ********/
|
||||
#ifndef _DtHelpFontHintsColor
|
||||
#define _DtHelpFontHintsColor(x) ((x).color)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontHintsLang
|
||||
#define _DtHelpFontHintsLang(x) ((x).language)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontHintsCharSet
|
||||
#define _DtHelpFontHintsCharSet(x) ((x).char_set)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontHintsPtSize
|
||||
#define _DtHelpFontHintsPtSize(x) ((x).pointsz)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontHintsWeight
|
||||
#define _DtHelpFontHintsWeight(x) ((x).weight)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontHintsXlfd
|
||||
#define _DtHelpFontHintsXlfd(x) ((x).xlfd)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontHintsXlfdb
|
||||
#define _DtHelpFontHintsXlfdb(x) ((x).xlfdb)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontHintsXlfdi
|
||||
#define _DtHelpFontHintsXlfdi(x) ((x).xlfdi)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontHintsXlfdib
|
||||
#define _DtHelpFontHintsXlfdib(x) ((x).xlfdib)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontHintsTypeNam
|
||||
#define _DtHelpFontHintsTypeNam(x) ((x).typenam)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontHintsTypeNamb
|
||||
#define _DtHelpFontHintsTypeNamb(x) ((x).typenamb)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontHintsTypeNami
|
||||
#define _DtHelpFontHintsTypeNami(x) ((x).typenami)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontHintsTypeNamib
|
||||
#define _DtHelpFontHintsTypeNamib(x) ((x).typenamib)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontPtrPtSize
|
||||
#define _DtHelpFontPtrPtSize(x) ((x)->pointsz)
|
||||
#endif
|
||||
|
||||
#ifndef _DtHelpFontPtrWeight
|
||||
#define _DtHelpFontPtrWeight(x) ((x)->weight)
|
||||
#endif
|
||||
|
||||
/******** Semi-Public Function Declarations ********/
|
||||
|
||||
/******** Public Function Declarations ********/
|
||||
extern void _DtHelpCeCopyDefFontAttrList(_DtHelpFontHints *font_attr );
|
||||
extern int _DtHelpDupFontHints(_DtHelpFontHints *font_attr );
|
||||
extern void _DtHelpFreeFontHints(_DtHelpFontHints *font_attr );
|
||||
|
||||
/******** End Public Function Declarations ********/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtHelpFontAttrI_h */
|
||||
103
cde/lib/DtHelp/FontI.h
Normal file
103
cde/lib/DtHelp/FontI.h
Normal file
@@ -0,0 +1,103 @@
|
||||
/* $XConsortium: FontI.h /main/6 1995/12/08 13:00:51 cde-hal $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: FontI.h
|
||||
**
|
||||
** Project: TextGraphic Display routines
|
||||
**
|
||||
** Description: Header file for Font.c
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtFontI_h
|
||||
#define _DtFontI_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/****************************************************************************
|
||||
* Semi Public Defines
|
||||
****************************************************************************/
|
||||
/*
|
||||
* resource database types
|
||||
*/
|
||||
#define _DtHelpXrmInt 0
|
||||
#define _DtHelpXrmQuark 1
|
||||
|
||||
/*
|
||||
* font quarks
|
||||
*/
|
||||
#define _DT_HELP_FONT_CHAR_SET 6
|
||||
#define _DT_HELP_FONT_LANG_TER 5
|
||||
#define _DT_HELP_FONT_TYPE 4
|
||||
#define _DT_HELP_FONT_WEIGHT 3
|
||||
#define _DT_HELP_FONT_ANGLE 2
|
||||
#define _DT_HELP_FONT_SIZE 1
|
||||
#define _DT_HELP_FONT_SPACING 0
|
||||
|
||||
#define _DT_HELP_FONT_END 7
|
||||
|
||||
#define _DtHelpFontQuarkNumber 8
|
||||
|
||||
/****************************************************************************
|
||||
* Semi Public Structures
|
||||
****************************************************************************/
|
||||
/****************************************************************************
|
||||
* Semi Public Routines
|
||||
****************************************************************************/
|
||||
extern void _DtHelpCopyDefaultList(XrmName *xrm_list);
|
||||
extern int __DtHelpDefaultFontIndexGet (
|
||||
DtHelpDispAreaStruct *pDAS);
|
||||
extern void _DtHelpGetStringQuarks(XrmName *xrm_list);
|
||||
extern int __DtHelpFontCharSetQuarkGet(
|
||||
DtHelpDispAreaStruct *pDAS,
|
||||
int font_index,
|
||||
XrmQuark *ret_quark);
|
||||
extern void __DtHelpFontDatabaseInit (
|
||||
DtHelpDispAreaStruct *pDAS,
|
||||
XtPointer default_font,
|
||||
XmFontType entry_type,
|
||||
XFontStruct *user_font);
|
||||
extern int __DtHelpFontIndexGet (
|
||||
DtHelpDispAreaStruct *pDAS,
|
||||
XrmQuarkList xrm_list,
|
||||
int *ret_idx);
|
||||
extern int __DtHelpFontLangQuarkGet(
|
||||
DtHelpDispAreaStruct *pDAS,
|
||||
int font_index,
|
||||
XrmQuark *ret_quark);
|
||||
extern void __DtHelpFontMetrics (
|
||||
DtHelpDAFontInfo font_info,
|
||||
int font_index,
|
||||
_DtCvUnit *ret_ascent,
|
||||
_DtCvUnit *ret_descent,
|
||||
_DtCvUnit *ret_char_width,
|
||||
_DtCvUnit *ret_super,
|
||||
_DtCvUnit *ret_sub);
|
||||
extern XFontSet __DtHelpFontSetGet (
|
||||
DtHelpDAFontInfo font_info,
|
||||
int font_index );
|
||||
extern XFontStruct *__DtHelpFontStructGet (
|
||||
DtHelpDAFontInfo font_info,
|
||||
int font_index);
|
||||
extern int _DtHelpGetExactFontIndex(
|
||||
DtHelpDispAreaStruct *pDAS,
|
||||
const char *lang,
|
||||
const char *char_set,
|
||||
char *xlfd_spec,
|
||||
int *ret_idx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _DtHelpFontI_h */
|
||||
1219
cde/lib/DtHelp/Format.c
Normal file
1219
cde/lib/DtHelp/Format.c
Normal file
File diff suppressed because it is too large
Load Diff
5452
cde/lib/DtHelp/FormatCCDF.c
Normal file
5452
cde/lib/DtHelp/FormatCCDF.c
Normal file
File diff suppressed because it is too large
Load Diff
68
cde/lib/DtHelp/FormatCCDFI.h
Normal file
68
cde/lib/DtHelp/FormatCCDFI.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* $XConsortium: FormatCCDFI.h /main/5 1995/10/26 12:20:47 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: FormatCCDFI.h
|
||||
**
|
||||
** Project: TextGraphic Display routines
|
||||
**
|
||||
** Description: Header file for Format.c
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpFormatCCDFI_h
|
||||
#define _DtHelpFormatCCDFI_h
|
||||
|
||||
typedef void* VarHandle;
|
||||
|
||||
extern int _DtHelpCeGetCcdfTitleChunks(
|
||||
_DtHelpVolumeHdl volume,
|
||||
char *loc_id,
|
||||
_FrmtUiInfo *ui_info,
|
||||
void ***ret_chunks);
|
||||
extern int _DtHelpCeFrmtCcdfPathAndChildren(
|
||||
_DtHelpVolumeHdl volume,
|
||||
char *loc_id,
|
||||
_FrmtUiInfo *ui_info,
|
||||
_DtCvTopicPtr *ret_handle );
|
||||
extern int _DtHelpCeGetCcdfVolTitleChunks(
|
||||
_DtHelpVolumeHdl volume,
|
||||
_FrmtUiInfo *ui_info,
|
||||
void ***ret_chunks);
|
||||
extern int _DtHelpCeFrmtCcdfTopic (
|
||||
_DtHelpVolumeHdl volume,
|
||||
char *filename,
|
||||
int offset,
|
||||
char *id_string,
|
||||
_FrmtUiInfo *ui_info,
|
||||
_DtCvTopicPtr *ret_topic);
|
||||
extern int __DtHelpCeGetParagraphList (
|
||||
VarHandle var_handle,
|
||||
int make_cont,
|
||||
_DtCvFrmtOption type,
|
||||
_DtCvTopicPtr *ret_handle);
|
||||
extern int __DtHelpCeProcessString(
|
||||
VarHandle var_handle,
|
||||
BufFilePtr my_file,
|
||||
_DtCvFrmtOption frmt_type,
|
||||
char *scan_string,
|
||||
char *in_string,
|
||||
int in_size,
|
||||
int fnt_flags,
|
||||
int ret_on_nl,
|
||||
_DtHelpFontHints *font_attr);
|
||||
extern VarHandle __DtHelpCeSetUpVars (
|
||||
char *lang,
|
||||
char *code_set,
|
||||
_FrmtUiInfo *ui_info);
|
||||
|
||||
#endif /* _DtHelpFormatCCDFI_h */
|
||||
82
cde/lib/DtHelp/FormatI.h
Normal file
82
cde/lib/DtHelp/FormatI.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/* $XConsortium: FormatI.h /main/5 1995/10/26 12:20:54 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: FormatI.h
|
||||
**
|
||||
** Project: TextGraphic Display routines
|
||||
**
|
||||
** Description: Header file for Format.c
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpFormatI_h
|
||||
#define _DtHelpFormatI_h
|
||||
|
||||
extern int _DtHelpFormatAsciiFile (
|
||||
XtPointer client_data,
|
||||
char *filename,
|
||||
XtPointer *ret_topic);
|
||||
extern int _DtHelpFormatAsciiString (
|
||||
XtPointer client_data,
|
||||
char *input_string,
|
||||
XtPointer *ret_topic);
|
||||
extern int _DtHelpFormatAsciiStringDynamic (
|
||||
XtPointer client_data,
|
||||
char *input_string,
|
||||
XtPointer *ret_topic);
|
||||
extern int _DtFormatGetParagraphList(
|
||||
XtPointer *ret_topic);
|
||||
extern int _DtHelpFormatIndexEntries (
|
||||
XtPointer client_data,
|
||||
_DtHelpVolumeHdl volume,
|
||||
int *ret_cnt,
|
||||
XmString **ret_words,
|
||||
XmFontList *ret_list,
|
||||
Boolean *ret_mod);
|
||||
extern void _DtFormatInitializeFontQuarks(
|
||||
char **font_attr );
|
||||
extern int _DtFormatInitializeVariables(
|
||||
char *input_string,
|
||||
int grow_size );
|
||||
extern int _DtFormatProcessString (
|
||||
char **input_string,
|
||||
int seg_type,
|
||||
char **font_attr );
|
||||
extern int _DtHelpFormatToc (
|
||||
XtPointer client_data,
|
||||
_DtHelpVolumeHdl volume,
|
||||
char *id_string,
|
||||
char *ret_id,
|
||||
XtPointer *ret_handle);
|
||||
extern int _DtHelpFormatTopic (
|
||||
XtPointer client_data,
|
||||
_DtHelpVolumeHdl volume,
|
||||
char *id_string,
|
||||
Boolean look_at_id,
|
||||
XtPointer *ret_handle);
|
||||
extern int _DtHelpFormatTopicTitle (
|
||||
XtPointer client_data,
|
||||
_DtHelpVolumeHdl volume,
|
||||
char *location_id,
|
||||
XmString *ret_title,
|
||||
XmFontList *ret_list,
|
||||
Boolean *ret_mod);
|
||||
extern int _DtHelpFormatVolumeTitle (
|
||||
XtPointer client_data,
|
||||
_DtHelpVolumeHdl volume,
|
||||
XmString *ret_title,
|
||||
XmFontList *ret_list,
|
||||
Boolean *ret_mod);
|
||||
|
||||
#endif /* _DtHelpFormatI_h */
|
||||
893
cde/lib/DtHelp/FormatMan.c
Normal file
893
cde/lib/DtHelp/FormatMan.c
Normal file
@@ -0,0 +1,893 @@
|
||||
/* $TOG: FormatMan.c /main/14 1999/10/14 15:06:59 mgreess $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: FormatMan.c
|
||||
**
|
||||
** Project: Text Graphic Display Library
|
||||
**
|
||||
** Description: This body of formats the input into a form understood by
|
||||
** a Display Area.
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/*
|
||||
* system includes
|
||||
*/
|
||||
#include <errno.h>
|
||||
#if defined(sun)
|
||||
#include <sys/utsname.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#include <locale.h>
|
||||
#include <nl_types.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
/*
|
||||
* Canvas Engine
|
||||
*/
|
||||
#include "CanvasP.h"
|
||||
#include "CanvasSegP.h"
|
||||
|
||||
/*
|
||||
* private includes
|
||||
*/
|
||||
#include "bufioI.h"
|
||||
#include "DisplayAreaP.h"
|
||||
#include "Access.h"
|
||||
#include "CleanUpI.h"
|
||||
#include "FontAttrI.h"
|
||||
#include "FormatUtilI.h"
|
||||
#include "FormatCCDFI.h"
|
||||
#include "FormatManI.h"
|
||||
#include "HelpXlate.h"
|
||||
#include "XInterfaceI.h"
|
||||
|
||||
#ifdef NLS16
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private variables and defines.
|
||||
*
|
||||
*****************************************************************************/
|
||||
enum State {
|
||||
Char,
|
||||
Bold,
|
||||
BoldDone,
|
||||
Italic,
|
||||
BoldItalic,
|
||||
BoldItalicDone};
|
||||
|
||||
#define STDOUT_FD (1) /* File descriptor for std. output. */
|
||||
#define STDERR_FD (1) /* File descriptor for std. error. */
|
||||
|
||||
#define PIPE_OUT (0) /* The output end of a pipe. */
|
||||
#define PIPE_IN (1) /* The input end of a pipe. */
|
||||
|
||||
static char *ScanString = "<\n\\ ";
|
||||
static char *EndToken = "</>";
|
||||
static char *BoldToken = "<weight bold>";
|
||||
static char *ItalicToken = "<angle italic>";
|
||||
|
||||
static int EndTokenSize = 3;
|
||||
static int BoldTokenSize = 13;
|
||||
static int ItalicTokenSize = 14;
|
||||
|
||||
/******** Private Function Declarations ********/
|
||||
static int FormatManPage(
|
||||
VarHandle my_vars,
|
||||
BufFilePtr in_file,
|
||||
char *in_buf,
|
||||
int in_size,
|
||||
_DtHelpFontHints *font_attr,
|
||||
char **out_buf,
|
||||
int *out_size,
|
||||
int *out_max );
|
||||
/******** End Public Function Declarations ********/
|
||||
|
||||
#define FileStream(f) ((FILE *)(f)->hidden)
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private Functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*********************************************************************
|
||||
* Procedure: GetNextState (char c, wchar_t wide_c, int length, char *str,
|
||||
* wchar_t ret_wc, int ret_wc_len, char ret_str_ptr,
|
||||
* Boolean ret_flag)
|
||||
*
|
||||
* Parameters: wide_c Specifies the wide char value of the
|
||||
* previous character.
|
||||
* length Specifies the length in bytes of the
|
||||
* previous character.
|
||||
* str Specifies the pointer to the string of
|
||||
* bytes to be processed next.
|
||||
* ret_wc Returns the wide character that is to be
|
||||
* italicized iff the state returned is Italic.
|
||||
* ret_wc_len Returns the length in bytes of ret_wc.
|
||||
* ret_str_ptr Returns the pointer to the next character
|
||||
* after the bold or italic character.
|
||||
* ret_flag Returns whether we have encountered a
|
||||
* + followed by a _, to convert to +/-
|
||||
*
|
||||
* Returns: Bold, Italic, Char
|
||||
*
|
||||
* Purpose: To determine if the sequence of characters represent
|
||||
* a bold or italic character.
|
||||
*
|
||||
*********************************************************************/
|
||||
static enum State
|
||||
GetNextState (
|
||||
char c,
|
||||
wchar_t wide_c,
|
||||
int len,
|
||||
char *str,
|
||||
char *ret_c,
|
||||
wchar_t *ret_wc,
|
||||
int *ret_wc_len,
|
||||
char **ret_str_ptr,
|
||||
Boolean *ret_flag )
|
||||
{
|
||||
register int i = len;
|
||||
|
||||
/* check to see if we have the pattern of a bold + followed by a bold _
|
||||
purpose is to eventually convert this to +/-
|
||||
This is a hack because the nroff output produced for the sequence
|
||||
of a + with an _ UNDER it, as in indicating statistical significance,
|
||||
looks like a bold +, backspace, and then a bold _.
|
||||
However, the nroff output indicates <c>bs_ as an italic, so
|
||||
this sequence has to be treated as a special case. */
|
||||
|
||||
if (*str == '+')
|
||||
{
|
||||
if (str[7] == '\010' && str[8] == '_' &&
|
||||
str[9] == '\010' && str[10] == '_' &&
|
||||
str[11] == '\010' && str[12] == '_' &&
|
||||
str[13] == '\010' && str[14] == '_' )
|
||||
{
|
||||
*ret_flag = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/* We need to eat the bold '_' -- continuation of aforementioned hack */
|
||||
if (TRUE == *ret_flag)
|
||||
{
|
||||
if (c == '+' &&
|
||||
str[0] == '\010' && str[1] == '_' &&
|
||||
str[2] == '\010' && str[3] == '_' &&
|
||||
str[4] == '\010' && str[5] == '_' &&
|
||||
str[6] == '\010' && str[7] == '_' )
|
||||
{
|
||||
*ret_flag = FALSE;
|
||||
*ret_str_ptr = str + 8;
|
||||
return Bold;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* check for multi-byte italic which is '_ _bsbs<c>'
|
||||
*/
|
||||
if (len == 1 && c == '_' && mblen (str, MB_CUR_MAX) == 1 && *str == '_')
|
||||
{
|
||||
str++;
|
||||
i++;
|
||||
}
|
||||
|
||||
/*
|
||||
* check for backspaces equal to the number of bytes making up wide_c.
|
||||
*/
|
||||
while (i)
|
||||
{
|
||||
if (mblen (str, MB_CUR_MAX) != 1 || *str != '\010')
|
||||
return Char;
|
||||
i--;
|
||||
str++;
|
||||
}
|
||||
|
||||
/*
|
||||
* convert the next character
|
||||
*/
|
||||
*ret_wc_len = mbtowc(ret_wc, str, MB_CUR_MAX);
|
||||
|
||||
/*
|
||||
* check for validity
|
||||
*/
|
||||
if ((*ret_wc_len) < 1)
|
||||
return Char;
|
||||
|
||||
/*
|
||||
* check to make sure the next character is equal to the first character
|
||||
* if so, the sequence was <c>bs<c> indicating a bold character.
|
||||
*/
|
||||
if (*ret_wc_len == len && *ret_wc == wide_c)
|
||||
{
|
||||
/*
|
||||
* Do not set the return string ptr prior to this return.
|
||||
* If the user specifies the same variable for both the str and
|
||||
* ret_str_ptr, then we will overwrite it improperly if the
|
||||
* sequence is not an italic or bold.
|
||||
*/
|
||||
*ret_str_ptr = str + *ret_wc_len;
|
||||
return Bold;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check to see if the sequence is _bs<c> for italics.
|
||||
* If so, take the next character for the ret_c (even if it
|
||||
* is a multi-byte character). ret_wc, and ret_wc_len are
|
||||
* already set from the mbtowc call. Move the ptr to after
|
||||
* the processed character.
|
||||
*/
|
||||
if (len == 1 && c == '_')
|
||||
{
|
||||
*ret_c = *str;
|
||||
*ret_str_ptr = str + *ret_wc_len;
|
||||
return Italic;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check to see if the sequence is <c>bs_ for italics.
|
||||
* If so, return the given c for the ret_c (even if it
|
||||
* is a multi-byte character). Set ret_wc and ret_wc_len
|
||||
* to the passed in wide character and wide character len.
|
||||
* Move the ptr to after the underscore.
|
||||
*/
|
||||
if (*ret_wc_len == 1 && *str == '_')
|
||||
{
|
||||
*ret_c = c;
|
||||
*ret_str_ptr = str + *ret_wc_len;
|
||||
*ret_wc = wide_c;
|
||||
*ret_wc_len = len;
|
||||
return Italic;
|
||||
}
|
||||
|
||||
/*
|
||||
* failed all the tests.
|
||||
* It could be a character followed by backspaces
|
||||
* followed by another character (which would cause over-
|
||||
* striking), but we don't know how to deal with this.
|
||||
*/
|
||||
return Char;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Formatting a man page is done based on the current input and the
|
||||
* current state of the processing.
|
||||
*
|
||||
* Note:
|
||||
* Bold multi-byte characters have one backspace per byte. Therefore,
|
||||
* a two-byte character would be be followed by two backspaces
|
||||
* and the same two-bytes to indicate that the character is to
|
||||
* be a bold character.
|
||||
* Italic characters can either be preceeded by a backspace/underline
|
||||
* or followed by a backspace/underline. I.E. _bsAB<bs_
|
||||
* would be an italic capitol A, a regular capital B and
|
||||
* an italic less than sign.
|
||||
* All backslashes and less than signs are output with a backslash
|
||||
* preceeding them.
|
||||
*
|
||||
* The following characters have special meaning in the state table:
|
||||
* <c> indicates a character.
|
||||
* <?> indicates the next character in the sequence.
|
||||
* <_> indicates an underscore character.
|
||||
* bs indicates a backspace character.
|
||||
* nl indicates a new-line character.
|
||||
*
|
||||
* Cur State Cur Sequence Action New State
|
||||
* ------------------------------------------------------------------------
|
||||
* Char <c>bs<c><?> Bold -> buf Bold
|
||||
* <c> -> buf
|
||||
* lastChar = <c>
|
||||
* incr to <?>
|
||||
*
|
||||
* <_>bs<c><?> Italic -> buf Italic
|
||||
* <c> -> buf
|
||||
* incr to <?>
|
||||
*
|
||||
* <c>bs<_><?> Italic -> buf Italic
|
||||
* <c> -> buf
|
||||
* incr to <?>
|
||||
*
|
||||
* nl<?> dump buf Char
|
||||
* incr to <?>
|
||||
*
|
||||
* <c><?> <c> -> buf Char
|
||||
* incr to <b>
|
||||
*
|
||||
* Bold bs<c><?>
|
||||
* <c> = lastChar skip to <?> Bold
|
||||
*
|
||||
* nl<?> <\> -> buf Char
|
||||
* dump buf
|
||||
* incr to <?>
|
||||
*
|
||||
* <c><?> <\> -> buf BoldDone
|
||||
*
|
||||
* BoldDone <c>bs<c><?> erase <\> Bold
|
||||
* <c> -> buf
|
||||
* lastChar = <c>
|
||||
* incr to <?>
|
||||
*
|
||||
* <_>bs<c><?> Italic -> buf Italic
|
||||
* <c> -> buf
|
||||
* incr to <?>
|
||||
*
|
||||
* <c>bs<_><?> Italic -> buf Italic
|
||||
* <c> -> buf
|
||||
* incr to <?>
|
||||
*
|
||||
* nl<?> dump buf Char
|
||||
* incr to <?>
|
||||
*
|
||||
* <c><?> <c> -> buf Char
|
||||
* incr to <?>
|
||||
*
|
||||
* Italic <c>bs<c><?> <\> -> buf Char
|
||||
*
|
||||
* <_>bs<c><?> <c> -> buf Italic
|
||||
* incr to <?>
|
||||
*
|
||||
* <c>bs<_><?> <c> -> buf Italic
|
||||
* incr to <?>
|
||||
*
|
||||
* bs<c><?> erase lastChar BoldItalic
|
||||
* Bold -> buf
|
||||
* <c> -> buf
|
||||
* lastChar = <c>
|
||||
* incr to <?>
|
||||
*
|
||||
* nl<?> <\> -> buf Char
|
||||
* dump buf
|
||||
* incr to <?>
|
||||
*
|
||||
* <c><?> </> -> buf Char
|
||||
*
|
||||
* BoldItalic bs<c><?> skip to <?> BoldItalic
|
||||
*
|
||||
* <c><?> <\> -> buf BoldItalicDone
|
||||
*
|
||||
* BoldItalicDone _bs<c>bs<c><?> erase <\> ItalicBold
|
||||
* <c> -> buf
|
||||
* lastChar = <c>
|
||||
* inc to <?>
|
||||
*
|
||||
* _bs<c><?> <c> -> buf Italic
|
||||
* lastChar = <c>
|
||||
* inc to <?>
|
||||
*
|
||||
* <c><?> <\> ->buf Char
|
||||
* <c> -> buf
|
||||
* lastChar = <c>
|
||||
* inc to <?>
|
||||
*
|
||||
******************************************************************************/
|
||||
/******************************************************************************
|
||||
* Function: RemoveToken
|
||||
******************************************************************************/
|
||||
static void
|
||||
RemoveToken(
|
||||
int size,
|
||||
char **out_buf,
|
||||
int *out_size)
|
||||
{
|
||||
*out_size = *out_size - size;
|
||||
|
||||
if (size == 1 &&
|
||||
((*out_buf)[*out_size] == '\\' || (*out_buf)[*out_size] == '<'))
|
||||
*out_size = *out_size - 1;
|
||||
|
||||
(*out_buf)[*out_size] = '\0';
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* Function: WriteToken
|
||||
*********************************************************************/
|
||||
static int
|
||||
WriteToken(
|
||||
char *token,
|
||||
int size,
|
||||
char **out_buf,
|
||||
int *out_size,
|
||||
int *out_max )
|
||||
{
|
||||
char *ptr = token;
|
||||
|
||||
return (_DtHelpCeAddStrToBuf(&ptr, out_buf, out_size, out_max, size, 128));
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* Function: WriteOutChar
|
||||
*********************************************************************/
|
||||
static int
|
||||
WriteOutChar(
|
||||
int last_len,
|
||||
wchar_t last_wc,
|
||||
char c,
|
||||
char **out_buf,
|
||||
int *out_size,
|
||||
int *out_max,
|
||||
Boolean flag)
|
||||
{
|
||||
char *ptr;
|
||||
char temp[10];
|
||||
|
||||
if (last_len == 1 && c == '<')
|
||||
ptr = "\\<";
|
||||
else if (last_len == 1 && c == '\\')
|
||||
ptr = "\\\\";
|
||||
else
|
||||
{
|
||||
(void) wctomb (temp, last_wc);
|
||||
temp[last_len] = '\0';
|
||||
ptr = temp;
|
||||
}
|
||||
|
||||
/* here is the conversion for the bold '+' followed by bold '_'
|
||||
part of a hack to treat this special character sequence */
|
||||
if (flag && c == '+')
|
||||
ptr = "+/-";
|
||||
|
||||
return (_DtHelpCeAddStrToBuf(&ptr, out_buf, out_size, out_max,
|
||||
strlen(ptr), 128));
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* Function: FormatManPage
|
||||
*
|
||||
* FormatManPage is the top entry point for formating man pages
|
||||
* into a form understood by a display area.
|
||||
*
|
||||
*********************************************************************/
|
||||
static int
|
||||
FormatManPage(
|
||||
VarHandle my_vars,
|
||||
BufFilePtr in_file,
|
||||
char *in_buf,
|
||||
int in_size,
|
||||
_DtHelpFontHints *font_attr,
|
||||
char **out_buf,
|
||||
int *out_size,
|
||||
int *out_max )
|
||||
{
|
||||
int italicCnt = 0;
|
||||
int result = 0;
|
||||
int cread;
|
||||
int lastLen;
|
||||
int checkLen;
|
||||
int retWCLen;
|
||||
wchar_t lastWC;
|
||||
wchar_t retWC;
|
||||
char *rloc = in_buf;
|
||||
char *retStrPtr;
|
||||
char c;
|
||||
char retC;
|
||||
Boolean flag = False;
|
||||
enum State newState;
|
||||
enum State state = Char;
|
||||
|
||||
cread = strlen (rloc);
|
||||
|
||||
do
|
||||
{
|
||||
/*
|
||||
* while I can read information process; loop.
|
||||
*/
|
||||
while (result != -1 && cread > 0)
|
||||
{
|
||||
/**
|
||||
* check for the size of the character
|
||||
**/
|
||||
checkLen = mblen(rloc, MB_CUR_MAX);
|
||||
|
||||
/*
|
||||
* if we hit a null character before we've run out of characters,
|
||||
* we've got corrupt data.
|
||||
*/
|
||||
if (checkLen == 0)
|
||||
return -1;
|
||||
|
||||
if (checkLen > 0)
|
||||
{
|
||||
/*
|
||||
* check for end of line
|
||||
*/
|
||||
if (checkLen == 1 && *rloc == '\n')
|
||||
{
|
||||
cread--;
|
||||
if (state == Bold || state == Italic)
|
||||
result = WriteToken(EndToken, EndTokenSize,
|
||||
out_buf, out_size, out_max);
|
||||
|
||||
if (result != -1)
|
||||
result = _DtHelpCeAddCharToBuf (&rloc, out_buf,
|
||||
out_size, out_max, 128);
|
||||
if (result != -1)
|
||||
{
|
||||
result = __DtHelpCeProcessString(
|
||||
my_vars, NULL,
|
||||
_DtCvLITERAL,
|
||||
ScanString,
|
||||
*out_buf,
|
||||
*out_size,
|
||||
0,
|
||||
False,
|
||||
font_attr);
|
||||
*out_size = 0;
|
||||
(*out_buf)[0] = '\0';
|
||||
state = Char;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case Char:
|
||||
case BoldDone:
|
||||
case BoldItalicDone:
|
||||
/*
|
||||
* get the character and wide character
|
||||
* representation of the next character.
|
||||
*/
|
||||
c = *rloc;
|
||||
lastLen = mbtowc (&lastWC, rloc, MB_CUR_MAX);
|
||||
|
||||
/*
|
||||
* skip past this character.
|
||||
*/
|
||||
rloc = rloc + lastLen;
|
||||
cread = cread - lastLen;
|
||||
|
||||
/*
|
||||
* Check ahead for bold or italic sequences
|
||||
*/
|
||||
newState = GetNextState (c, lastWC, lastLen,
|
||||
rloc,
|
||||
&retC, &retWC, &retWCLen,
|
||||
&retStrPtr, &flag);
|
||||
|
||||
if (newState == Bold)
|
||||
{
|
||||
if (state == BoldDone)
|
||||
RemoveToken(EndTokenSize, out_buf, out_size);
|
||||
else
|
||||
result = WriteToken(BoldToken,
|
||||
BoldTokenSize,
|
||||
out_buf, out_size,
|
||||
out_max);
|
||||
|
||||
/*
|
||||
* skip the backspaces and the extra
|
||||
* copy of the character.
|
||||
*/
|
||||
cread = cread - (retStrPtr - rloc);
|
||||
rloc = retStrPtr;
|
||||
}
|
||||
else if (newState == Italic)
|
||||
{
|
||||
if (state != BoldItalicDone)
|
||||
result = WriteToken(ItalicToken,
|
||||
ItalicTokenSize,
|
||||
out_buf, out_size,
|
||||
out_max);
|
||||
|
||||
/*
|
||||
* skip the blanks after the current
|
||||
* character plus the character after
|
||||
* that. The returned wide character
|
||||
* is the character that is to be
|
||||
* italicized.
|
||||
*/
|
||||
cread = cread - (retStrPtr - rloc);
|
||||
rloc = retStrPtr;
|
||||
c = retC;
|
||||
lastWC = retWC;
|
||||
lastLen = retWCLen;
|
||||
italicCnt = 1;
|
||||
|
||||
if (state == BoldItalicDone &&
|
||||
GetNextState (c, lastWC, lastLen, rloc,
|
||||
&retC, &retWC, &retWCLen,
|
||||
&retStrPtr, &flag) == Bold)
|
||||
{
|
||||
RemoveToken(EndTokenSize, out_buf, out_size);
|
||||
newState = BoldItalic;
|
||||
}
|
||||
}
|
||||
else if (state == BoldItalicDone)
|
||||
result = WriteToken(EndToken, EndTokenSize,
|
||||
out_buf, out_size,
|
||||
out_max);
|
||||
|
||||
state = newState;
|
||||
|
||||
|
||||
result = WriteOutChar(lastLen, lastWC, c,
|
||||
out_buf, out_size, out_max, flag);
|
||||
break;
|
||||
|
||||
case BoldItalic:
|
||||
case Bold:
|
||||
if (GetNextState (c, lastWC, lastLen, rloc,
|
||||
&retC, &retWC, &retWCLen,
|
||||
&retStrPtr, &flag) == Bold)
|
||||
{
|
||||
/* skip backspaces and copy characters */
|
||||
cread = cread - (retStrPtr - rloc);
|
||||
rloc = retStrPtr;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = WriteToken(EndToken, EndTokenSize,
|
||||
out_buf, out_size, out_max);
|
||||
if (state == BoldItalic)
|
||||
state = BoldItalicDone;
|
||||
else
|
||||
state = BoldDone;
|
||||
}
|
||||
break;
|
||||
|
||||
case Italic:
|
||||
c = *rloc;
|
||||
newState = GetNextState (c, lastWC, lastLen,
|
||||
rloc,
|
||||
&retC, &retWC, &retWCLen,
|
||||
&retStrPtr, &flag);
|
||||
|
||||
if (newState == Italic)
|
||||
{
|
||||
italicCnt++;
|
||||
cread = cread - (retStrPtr - rloc);
|
||||
rloc = retStrPtr;
|
||||
c = retC;
|
||||
lastWC = retWC;
|
||||
lastLen = retWCLen;
|
||||
|
||||
result = WriteOutChar(lastLen, lastWC, c,
|
||||
out_buf, out_size, out_max, flag);
|
||||
}
|
||||
else if (italicCnt == 1 && lastWC == retWC
|
||||
&& newState == Bold)
|
||||
{
|
||||
RemoveToken(lastLen, out_buf, out_size);
|
||||
|
||||
result = WriteToken(BoldToken,
|
||||
BoldTokenSize,
|
||||
out_buf, out_size,
|
||||
out_max);
|
||||
|
||||
cread = cread - (retStrPtr - rloc);
|
||||
rloc = retStrPtr;
|
||||
c = retC;
|
||||
lastWC = retWC;
|
||||
lastLen = retWCLen;
|
||||
|
||||
result = WriteOutChar(lastLen, lastWC, c,
|
||||
out_buf, out_size, out_max, flag);
|
||||
|
||||
state = BoldItalic;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = WriteToken(EndToken,
|
||||
EndTokenSize,
|
||||
out_buf, out_size,
|
||||
out_max);
|
||||
state = Char;
|
||||
italicCnt = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cread < (3 * ((int) MB_CUR_MAX)) &&
|
||||
!feof (FileStream(in_file)))
|
||||
cread = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/**
|
||||
* if it is an invalid character - skip.
|
||||
* But be careful.
|
||||
* If this is the start of a multi-byte character,
|
||||
* I must save it and try again on the next read.
|
||||
**/
|
||||
if (cread < ((int) MB_CUR_MAX))
|
||||
cread = 0;
|
||||
else
|
||||
{
|
||||
/*
|
||||
* otherwise we've got corrupt data.
|
||||
*/
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (result != -1 && !feof(FileStream(in_file)))
|
||||
{
|
||||
if (_DtHelpCeGetNxtBuf (in_file, in_buf, &rloc, in_size) == -1)
|
||||
result = -1;
|
||||
|
||||
if (result != -1)
|
||||
cread = strlen (rloc);
|
||||
}
|
||||
} while (result != -1 && cread > 0);
|
||||
|
||||
return(result);
|
||||
|
||||
} /* End FormatManPage */
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Public Functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*********************************************************************
|
||||
* Function: _DtHelpFormatManPage
|
||||
*
|
||||
* _DtHelpFormatManPage formats a man page
|
||||
* into a form understood by a display area.
|
||||
*
|
||||
*********************************************************************/
|
||||
int
|
||||
_DtHelpFormatManPage(
|
||||
XtPointer client_data,
|
||||
char *man_spec,
|
||||
XtPointer *ret_handle)
|
||||
{
|
||||
int result = -1;
|
||||
FILE *myFile;
|
||||
int writeBufSize = 0;
|
||||
int writeBufMax = 0;
|
||||
char *ptr;
|
||||
char *writeBuf = NULL;
|
||||
char readBuf[BUFSIZ];
|
||||
_DtHelpFontHints fontAttr;
|
||||
VarHandle myVars;
|
||||
_DtCvTopicInfo *topicStruct;
|
||||
BufFilePtr myBufFile;
|
||||
static char manString[] = "man ";
|
||||
static char devNullString[] = " 2>/dev/null";
|
||||
_DtCvTopicPtr topic = NULL;
|
||||
DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) client_data;
|
||||
_FrmtUiInfo myUiInfo = { NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 1, False };
|
||||
|
||||
/*
|
||||
* fill out the ui information
|
||||
*/
|
||||
myUiInfo.load_font = _DtHelpDAResolveFont;
|
||||
myUiInfo.client_data = (_DtCvPointer) pDAS;
|
||||
myUiInfo.avg_char = (int)(pDAS->charWidth / 10 +
|
||||
((pDAS->charWidth % 10) ? 1 : 0));
|
||||
myUiInfo.nl_to_space = pDAS->nl_to_space;
|
||||
|
||||
/*
|
||||
* pre-append the man command to man specification
|
||||
*/
|
||||
ptr = (char *) malloc(sizeof(manString) + strlen(man_spec) +
|
||||
sizeof(devNullString) - 1);
|
||||
if (!ptr)
|
||||
return -1;
|
||||
strcpy (ptr, manString);
|
||||
strcat (ptr, man_spec);
|
||||
strcat (ptr, devNullString);
|
||||
|
||||
myFile = popen(ptr, "r");
|
||||
|
||||
/*
|
||||
* free the man command
|
||||
*/
|
||||
free (ptr);
|
||||
|
||||
/*
|
||||
* check for problems
|
||||
*/
|
||||
if (!myFile) /* couldn't create man(1) process */
|
||||
return -1;
|
||||
|
||||
/*
|
||||
* make sure we don't try to read compressed.
|
||||
*/
|
||||
myBufFile = _DtHelpCeCreatePipeBufFile(myFile);
|
||||
if (myBufFile == NULL)
|
||||
{
|
||||
(void) pclose(myFile); /* don't check for error, it was popen'd */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* get the font quark list - but force to mono-space
|
||||
*/
|
||||
_DtHelpCeCopyDefFontAttrList (&fontAttr);
|
||||
fontAttr.spacing = _DtHelpFontSpacingMono;
|
||||
_DtHelpCeXlateOpToStdLocale(DtLCX_OPER_SETLOCALE,setlocale(LC_CTYPE,NULL),
|
||||
NULL, &(fontAttr.language), &(fontAttr.char_set));
|
||||
|
||||
myVars = __DtHelpCeSetUpVars(fontAttr.language, fontAttr.char_set, &myUiInfo);
|
||||
if (myVars == NULL)
|
||||
{
|
||||
free(fontAttr.language);
|
||||
free(fontAttr.char_set);
|
||||
_DtHelpCeBufFileClose (myBufFile, True);
|
||||
return -1;
|
||||
}
|
||||
|
||||
readBuf[0] = '\0';
|
||||
ptr = readBuf;
|
||||
|
||||
result = _DtHelpCeGetNxtBuf (myBufFile, readBuf, &ptr, BUFSIZ);
|
||||
if (result > 0)
|
||||
result = FormatManPage (myVars, myBufFile,
|
||||
readBuf,
|
||||
BUFSIZ,
|
||||
&fontAttr,
|
||||
&writeBuf,
|
||||
&writeBufSize,
|
||||
&writeBufMax );
|
||||
|
||||
if ((result != -1) && writeBufSize)
|
||||
result = __DtHelpCeProcessString(myVars, NULL, _DtCvLITERAL,
|
||||
ScanString, writeBuf, writeBufSize,
|
||||
0, False, &fontAttr);
|
||||
|
||||
/*
|
||||
* free the buffer
|
||||
*/
|
||||
if (writeBuf)
|
||||
free (writeBuf);
|
||||
|
||||
/*
|
||||
* close the pipe
|
||||
*/
|
||||
_DtHelpCeBufFileClose (myBufFile, True);
|
||||
|
||||
/*
|
||||
* clean up the last segment.
|
||||
*/
|
||||
if (result != -1)
|
||||
__DtHelpCeGetParagraphList (myVars, True, _DtCvLITERAL, &topic);
|
||||
|
||||
topicStruct = (_DtCvTopicInfo *) (topic);
|
||||
|
||||
/*
|
||||
* did we have any paragraphs to format?
|
||||
*/
|
||||
if (topic != NULL && NULL == topicStruct->seg_list
|
||||
|| NULL == _DtCvContainerListOfSeg(topicStruct->seg_list))
|
||||
{
|
||||
_DtHelpFreeSegments(topicStruct->seg_list, _DtCvFALSE,
|
||||
NULL, (_DtCvPointer) pDAS);
|
||||
free ((char *) topicStruct);
|
||||
topic = NULL;
|
||||
errno = ENOENT; /* we'll just assume no man page existed */
|
||||
result = -1;
|
||||
}
|
||||
|
||||
free(fontAttr.language);
|
||||
free(fontAttr.char_set);
|
||||
free(myVars);
|
||||
|
||||
*ret_handle = (_DtCvPointer) topic;
|
||||
|
||||
return (result);
|
||||
|
||||
} /* End _DtHelpFormatManPage */
|
||||
31
cde/lib/DtHelp/FormatManI.h
Normal file
31
cde/lib/DtHelp/FormatManI.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* $XConsortium: FormatManI.h /main/5 1995/10/26 12:21:24 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: FormatManI.h
|
||||
**
|
||||
** Project: TextGraphic Display routines
|
||||
**
|
||||
** Description: Header file for FormatMan.c
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtFormatManI_h
|
||||
#define _DtFormatManI_h
|
||||
|
||||
extern int _DtHelpFormatManPage (
|
||||
XtPointer client_data,
|
||||
char *man_spec,
|
||||
XtPointer *ret_handle );
|
||||
|
||||
#endif /* _DtFormatManI_h */
|
||||
10587
cde/lib/DtHelp/FormatSDL.c
Normal file
10587
cde/lib/DtHelp/FormatSDL.c
Normal file
File diff suppressed because it is too large
Load Diff
75
cde/lib/DtHelp/FormatSDLI.h
Normal file
75
cde/lib/DtHelp/FormatSDLI.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/* $XConsortium: FormatSDLI.h /main/5 1995/10/26 12:22:04 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
** File: FormatSDLI.h
|
||||
** Project: Common Desktop Environment
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpFormatSDLI_h
|
||||
#define _DtHelpFormatSDLI_h
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
/******** Semi-Private Function Declarations ********/
|
||||
extern int _DtHelpCeFrmtSDLTitleToAscii(
|
||||
_DtHelpVolumeHdl volume_handle,
|
||||
int offset,
|
||||
char **ret_title,
|
||||
char **ret_abbrev);
|
||||
extern char *_DtHelpCeFrmtSdlVolumeAbstractToAscii(
|
||||
_DtHelpVolumeHdl volume);
|
||||
extern int _DtHelpCeFrmtSdlPathAndChildren(
|
||||
_DtHelpVolumeHdl volume,
|
||||
_FrmtUiInfo *ui_info,
|
||||
int fd,
|
||||
char *target_id,
|
||||
_DtCvTopicPtr *ret_handle);
|
||||
extern int _DtHelpCeGetSdlTitleChunks(
|
||||
_DtHelpVolumeHdl volume,
|
||||
char *loc_id,
|
||||
_FrmtUiInfo *ui_info,
|
||||
void ***ret_chunks);
|
||||
extern int _DtHelpCeGetSdlVolIds(
|
||||
_DtHelpVolumeHdl volume,
|
||||
int fd,
|
||||
_DtCvSegment **ret_loids);
|
||||
extern int _DtHelpCeGetSdlVolIndex(
|
||||
_DtHelpVolumeHdl volume);
|
||||
extern int _DtHelpCeGetSdlVolTitleChunks(
|
||||
_DtHelpVolumeHdl volume,
|
||||
_FrmtUiInfo *ui_info,
|
||||
void ***ret_chunks);
|
||||
extern int _DtHelpCeFrmtSDLVolTitleToAscii(
|
||||
_DtHelpVolumeHdl volume,
|
||||
_FrmtUiInfo *ui_info,
|
||||
char **ret_title);
|
||||
extern _DtCvSegment *_DtHelpCeGetSdlVolToss(
|
||||
_DtHelpVolumeHdl volume,
|
||||
int fd);
|
||||
extern _DtCvSegment *_DtHelpCeMapIdToLoidEntry(
|
||||
_DtCvSegment *id_segs,
|
||||
char *target_id);
|
||||
extern int _DtHelpCeFrmtSdlVolumeInfo(
|
||||
char *filename,
|
||||
_DtHelpVolumeHdl volume,
|
||||
time_t *ret_time);
|
||||
extern const SDLAttribute *_DtHelpCeGetSdlAttributeList(void);
|
||||
extern int _DtHelpCeParseSdlTopic(
|
||||
_DtHelpVolumeHdl volume,
|
||||
_FrmtUiInfo *ui_info,
|
||||
int fd,
|
||||
int offset,
|
||||
char *id_string,
|
||||
int rich_text,
|
||||
_DtCvTopicPtr *ret_handle);
|
||||
|
||||
/******** End Public Function Declarations ********/
|
||||
|
||||
#endif /* _DtHelpFormatSDLI_h */
|
||||
1524
cde/lib/DtHelp/FormatTerm.c
Normal file
1524
cde/lib/DtHelp/FormatTerm.c
Normal file
File diff suppressed because it is too large
Load Diff
819
cde/lib/DtHelp/FormatUtil.c
Normal file
819
cde/lib/DtHelp/FormatUtil.c
Normal file
@@ -0,0 +1,819 @@
|
||||
/* $XConsortium: FormatUtil.c /main/9 1996/11/01 10:12:14 drk $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: FormatUtil.c
|
||||
**
|
||||
** Project: Text Graphic Display Library
|
||||
**
|
||||
**
|
||||
** Description: Semi private format utility functions that do not
|
||||
** require the Display Area, Motif, Xt or X11.
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/*
|
||||
* system includes
|
||||
*/
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <X11/Xos.h>
|
||||
#ifdef X_NOT_STDC_ENV
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Canvas Engine includes
|
||||
*/
|
||||
#include "CanvasP.h"
|
||||
#include "CanvasSegP.h"
|
||||
|
||||
/*
|
||||
* private includes
|
||||
*/
|
||||
#include "CanvasError.h"
|
||||
#include "bufioI.h"
|
||||
#include "FormatUtilI.h"
|
||||
|
||||
#if defined(NLS16) || !defined(NO_MESSAGE_CATALOG)
|
||||
#include <nl_types.h>
|
||||
#endif
|
||||
|
||||
#ifndef NL_CAT_LOCALE
|
||||
static const int NL_CAT_LOCALE = 0;
|
||||
#endif
|
||||
|
||||
/******** Private Function Declarations ********/
|
||||
/******** End Private Function Declarations ********/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private variables and defines.
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define GROW_SIZE 5
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private Functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
/******************************************************************************
|
||||
*
|
||||
* Semi Public Functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpCeAddOctalToBuf (char *src, char **dst,
|
||||
* int *dst_size,
|
||||
* int *dst_max, int grow_size)
|
||||
*
|
||||
* Parameters:
|
||||
* src Specifies a pointer to a string.
|
||||
* dst Specifies a pointer to the buffer to
|
||||
* to hold the information.
|
||||
* dst_size Specifies the current size of 'dst'.
|
||||
* Returns the new size of 'dst'.
|
||||
* dst_max Specifies the current maximum size of 'dst'.
|
||||
* Returns the new maximum size of 'dst'.
|
||||
* grow_size Specifies the minimum grow size of 'dst'
|
||||
* when a malloc/realloc occurs.
|
||||
* If this is less than one, 'dst' will
|
||||
* grow only large enough to hold
|
||||
* the new character.
|
||||
*
|
||||
* Returns: 0 if successful, -1 if errors.
|
||||
*
|
||||
* errno Values:
|
||||
* EINVAL
|
||||
* CEErrorMalloc
|
||||
*
|
||||
* Purpose: (Re-)Allocates, if necessary, enough memory to hold the old
|
||||
* information plus the byte.
|
||||
* Coverts the 0xXX value pointed to by src to a 0-256 by value.
|
||||
* Appends the character to the buffer pointed to 'dst'.
|
||||
* Updates 'dst_size' to include the new character.
|
||||
* Updates 'dst_max' to the new size of 'dst' if a
|
||||
* malloc/realloc occurred.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtHelpCeAddOctalToBuf(
|
||||
char *src,
|
||||
char **dst,
|
||||
int *dst_size,
|
||||
int *dst_max,
|
||||
int grow_size )
|
||||
{
|
||||
char tmp;
|
||||
char *dstPtr;
|
||||
unsigned long value;
|
||||
|
||||
if (src == NULL ||
|
||||
dst == NULL || dst_size == NULL || dst_max == NULL ||
|
||||
(*dst == NULL && (*dst_size || *dst_max)))
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
dstPtr = *dst;
|
||||
if ((*dst_size + 2) >= *dst_max)
|
||||
{
|
||||
if (grow_size > *dst_size + 3 - *dst_max)
|
||||
*dst_max = *dst_max + grow_size;
|
||||
else
|
||||
*dst_max = *dst_size + 3;
|
||||
|
||||
if (dstPtr)
|
||||
dstPtr = (char *) realloc ((void *) dstPtr, *dst_max);
|
||||
else
|
||||
{
|
||||
dstPtr = (char *) malloc (sizeof(char) * (*dst_max));
|
||||
*dst_size = 0;
|
||||
}
|
||||
*dst = dstPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
* check to see if we have good memory
|
||||
*/
|
||||
if (!dstPtr)
|
||||
{
|
||||
errno = CEErrorMalloc;
|
||||
return -1;
|
||||
}
|
||||
|
||||
tmp = src[4];
|
||||
src[4] = '\0';
|
||||
value = strtoul (src, NULL, 16);
|
||||
src[4] = tmp;
|
||||
|
||||
if ((value == ULONG_MAX && errno == ERANGE) || value > 255 || value < 1)
|
||||
{
|
||||
errno = CEErrorFormattingValue;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* copy the source into the destination
|
||||
*/
|
||||
dstPtr[*dst_size] = (char ) value;
|
||||
|
||||
/*
|
||||
* adjust the pointers.
|
||||
*/
|
||||
*dst_size = *dst_size + 1;
|
||||
|
||||
/*
|
||||
* null the end of the buffer.
|
||||
*/
|
||||
dstPtr[*dst_size] = '\0';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int __CEAppendCharToInfo (char **src, char **dst, int *dst_size,
|
||||
* int *dst_max, int grow_size)
|
||||
*
|
||||
* Parameters:
|
||||
* src Specifies a pointer to a string.
|
||||
* dst Specifies a pointer to the buffer to
|
||||
* to hold the information.
|
||||
* dst_size Specifies the current size of 'dst'.
|
||||
* Returns the new size of 'dst'.
|
||||
* dst_max Specifies the current maximum size of 'dst'.
|
||||
* Returns the new maximum size of 'dst'.
|
||||
* grow_size Specifies the minimum grow size of 'dst'
|
||||
* when a malloc/realloc occurs.
|
||||
* If this is less than one, 'dst' will
|
||||
* grow only large enough to hold
|
||||
* the new character.
|
||||
*
|
||||
* Returns: 0 if successful, -1 if errors.
|
||||
*
|
||||
* errno Values:
|
||||
* EINVAL
|
||||
* CEErrorMalloc
|
||||
*
|
||||
* Purpose: (Re-)Allocates, if necessary, enough memory to hold the old
|
||||
* information plus the new.
|
||||
* Appends the character pointed to by 'src' to the buffer
|
||||
* pointed to 'dst'.
|
||||
* Updates 'src' to point to the next character after the
|
||||
* one appended to 'dst'.
|
||||
* Updates 'dst_size' to include the new character.
|
||||
* Updates 'dst_max' to the new size of 'dst' if a
|
||||
* malloc/realloc occurred.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtHelpCeAddCharToBuf(
|
||||
char **src,
|
||||
char **dst,
|
||||
int *dst_size,
|
||||
int *dst_max,
|
||||
int grow_size )
|
||||
{
|
||||
char *srcPtr;
|
||||
char *dstPtr;
|
||||
|
||||
if (src == NULL || *src == NULL ||
|
||||
dst == NULL || dst_size == NULL || dst_max == NULL ||
|
||||
(*dst == NULL && (*dst_size || *dst_max)))
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
srcPtr = *src;
|
||||
dstPtr = *dst;
|
||||
if ((*dst_size + 2) >= *dst_max)
|
||||
{
|
||||
if (grow_size > *dst_size + 3 - *dst_max)
|
||||
*dst_max = *dst_max + grow_size;
|
||||
else
|
||||
*dst_max = *dst_size + 3;
|
||||
|
||||
if (dstPtr)
|
||||
dstPtr = (char *) realloc ((void *) dstPtr, *dst_max);
|
||||
else
|
||||
{
|
||||
dstPtr = (char *) malloc (*dst_max);
|
||||
*dst_size = 0;
|
||||
}
|
||||
*dst = dstPtr;
|
||||
}
|
||||
|
||||
/*
|
||||
* check to see if we have good memory
|
||||
*/
|
||||
if (!dstPtr)
|
||||
{
|
||||
errno = CEErrorMalloc;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* copy the source into the destination
|
||||
*/
|
||||
dstPtr[*dst_size] = *srcPtr++;
|
||||
|
||||
/*
|
||||
* adjust the pointers.
|
||||
*/
|
||||
*src = srcPtr;
|
||||
*dst_size = *dst_size + 1;
|
||||
|
||||
/*
|
||||
* null the end of the buffer.
|
||||
*/
|
||||
dstPtr[*dst_size] = '\0';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpCeAddStrToBuf (char **src, char **dst, int *dst_size,
|
||||
* int *dst_max, int copy_size, int grow_size)
|
||||
*
|
||||
* Parameters:
|
||||
* src Specifies a pointer to a string.
|
||||
* dst Specifies a pointer to the buffer to
|
||||
* to hold the information.
|
||||
* dst_size Specifies the current size of 'dst'.
|
||||
* Returns the new size of 'dst'.
|
||||
* dst_max Specifies the current maximum size of 'dst'.
|
||||
* Returns the new maximum size of 'dst'.
|
||||
* copy_size Specifies the number of characters to
|
||||
* copy from 'src' to 'dst'.
|
||||
* grow_size Specifies the minimum grow size of 'dst'
|
||||
* when a malloc/realloc occurs.
|
||||
* If this is less than one, 'dst' will
|
||||
* grow only large enough to hold
|
||||
* the new character.
|
||||
*
|
||||
* Returns: 0 if successful, -1 if errors.
|
||||
*
|
||||
* errno Values:
|
||||
* EINVAL
|
||||
* CEErrorMalloc
|
||||
*
|
||||
* Purpose: Copys 'copy_size' number of characters of 'src'
|
||||
* to 'dst'.
|
||||
* Updates 'src', to point after 'copy_size' number of
|
||||
* characters.
|
||||
* Updates the 'dst_size' to reflect the number of characters
|
||||
* copied.
|
||||
* If required, increments dst_max and (re)allocs memory
|
||||
* to hold the extra 'copy_size' number of characters.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtHelpCeAddStrToBuf (
|
||||
char **src,
|
||||
char **dst,
|
||||
int *dst_size,
|
||||
int *dst_max,
|
||||
int copy_size,
|
||||
int grow_size )
|
||||
{
|
||||
char *srcPtr;
|
||||
char *dstPtr;
|
||||
|
||||
/*
|
||||
* check the input
|
||||
*/
|
||||
if (src == NULL || *src == NULL || (((int)strlen(*src)) < copy_size)
|
||||
|| dst == NULL || dst_size == NULL || dst_max == NULL
|
||||
|| (*dst == NULL && (*dst_size || *dst_max)))
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
srcPtr = *src;
|
||||
dstPtr = *dst;
|
||||
|
||||
if ((*dst_size + copy_size + 1) >= *dst_max)
|
||||
{
|
||||
if (grow_size > (*dst_size + copy_size + 2 - *dst_max))
|
||||
*dst_max = *dst_max + grow_size;
|
||||
else
|
||||
*dst_max = *dst_size + copy_size + 2;
|
||||
|
||||
if (dstPtr)
|
||||
dstPtr = (char *) realloc ((void *) dstPtr, *dst_max);
|
||||
else
|
||||
{
|
||||
dstPtr = (char *) malloc (*dst_max);
|
||||
*dst_size = 0;
|
||||
}
|
||||
*dst = dstPtr;
|
||||
}
|
||||
|
||||
if (!dstPtr)
|
||||
{
|
||||
errno = CEErrorMalloc;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* make sure there is a null byte to append to.
|
||||
*/
|
||||
dstPtr[*dst_size] = '\0';
|
||||
|
||||
/*
|
||||
* copy the source into the destination
|
||||
*/
|
||||
strncat (dstPtr, srcPtr, copy_size);
|
||||
|
||||
/*
|
||||
* adjust the pointers
|
||||
*/
|
||||
*src = srcPtr + copy_size;
|
||||
*dst_size = *dst_size + copy_size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpCeGetNxtBuf (FILE *file, char *dst, char **src,
|
||||
* int max_size)
|
||||
*
|
||||
* Parameters:
|
||||
* file Specifies a stream to read from.
|
||||
* dst Specifies the buffer where new information
|
||||
* is placed.
|
||||
* src Specifies a pointer into 'dst'. If there
|
||||
* is information left over, it
|
||||
* is moved to the begining of 'dst'.
|
||||
* Returns 'src' pointing to 'dst'.
|
||||
* max_size Specifies the maximum size of 'dst'.
|
||||
*
|
||||
* Returns: 0 if this is the last buffer that can be read for the topic.
|
||||
* -1 if errors.
|
||||
* >0 if more to be read.
|
||||
*
|
||||
* errno Values:
|
||||
* read (2) Errors set via a read call.
|
||||
* EINVAL
|
||||
* CEErrorReadEmpty
|
||||
*
|
||||
* Purpose: Reads the next buffer of information.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtHelpCeGetNxtBuf(
|
||||
BufFilePtr file,
|
||||
char *dst,
|
||||
char **src,
|
||||
int max_size)
|
||||
{
|
||||
int leftOver;
|
||||
int result;
|
||||
|
||||
if (file == NULL)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
(void ) strcpy (dst, (*src));
|
||||
leftOver = strlen (dst);
|
||||
|
||||
result = _DtHelpCeReadBuf (file, &(dst[leftOver]), (max_size - leftOver));
|
||||
|
||||
/*
|
||||
* check to see if we ran into trouble reading this buffer
|
||||
* of information. If not reset the pointer to the beginning
|
||||
* of the buffer.
|
||||
*/
|
||||
if (result != -1)
|
||||
*src = dst;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpCeReadBuf (FILE *file, char *buffer, int size)
|
||||
*
|
||||
* Parameters: FILE Specifies the stream to read from.
|
||||
* buffer Specifies a buffer to read information
|
||||
* into.
|
||||
* size Specifies the maximum number of bytes
|
||||
* 'buffer' can contain. It should never be
|
||||
* larger than 'buffer' can hold, but it can
|
||||
* be smaller.
|
||||
*
|
||||
* Returns: 0 if this is the last buffer that can be read for the topic.
|
||||
* -1 if errors.
|
||||
* >0 if more to be read.
|
||||
*
|
||||
* errno Values:
|
||||
* read (2) Errors set via a read call.
|
||||
*
|
||||
* Purpose: Get size-1 number of bytes into a buffer and possibly
|
||||
* check for page markers imbedded within the text.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtHelpCeReadBuf(
|
||||
BufFilePtr file,
|
||||
char *buffer,
|
||||
int size)
|
||||
{
|
||||
int flag;
|
||||
|
||||
/*
|
||||
* take into account the last byte must be an end of string marker.
|
||||
*/
|
||||
size--;
|
||||
|
||||
flag = _DtHelpCeBufFileRd(file, buffer, size);
|
||||
|
||||
if (flag != -1)
|
||||
buffer[flag] = '\0';
|
||||
|
||||
return flag;
|
||||
|
||||
} /* End _DtHelpCeReadBuf */
|
||||
|
||||
/******************************************************************************
|
||||
* Function: char *_DtHelpGetNxtToken (char *str, char **retToken)
|
||||
*
|
||||
* Parameters:
|
||||
* str The string (in memory) which is being
|
||||
* parsed.
|
||||
* retToken Returns the next token from the input.
|
||||
* Valid tokens are strings of non-whitespace
|
||||
* characters, newline ("\n"), and
|
||||
* end-of-data (indicated by a zero length
|
||||
* string).
|
||||
*
|
||||
* A NULL value indicates an error.
|
||||
*
|
||||
* Newline or zero length strings are
|
||||
* not owned by the caller.
|
||||
*
|
||||
* Otherwise, the memory for the returned
|
||||
* token is owned by the caller.
|
||||
*
|
||||
* Return Value: Returns the pointer to the next unparsed character in
|
||||
* the input string. A NULL value indicates an error.
|
||||
*
|
||||
* errno Values:
|
||||
* EINVAL
|
||||
* CEErrorMalloc
|
||||
*
|
||||
* Purpose: Parse tokens in resource string values.
|
||||
*
|
||||
*****************************************************************************/
|
||||
char *
|
||||
_DtHelpGetNxtToken (
|
||||
char *str,
|
||||
char **retToken)
|
||||
{
|
||||
int len = 1;
|
||||
char *start;
|
||||
char *token;
|
||||
short quote = False;
|
||||
short done = False;
|
||||
|
||||
if (retToken) *retToken = NULL; /* tested in caller code */
|
||||
|
||||
if (str == NULL || *str == '\0' || retToken == NULL)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Find the next token in the string. The parsing rules are:
|
||||
|
||||
- Whitespace (except for \n) separates tokens.
|
||||
- \n is a token itself.
|
||||
- The \0 at the end of the string is a token.
|
||||
*/
|
||||
|
||||
/* Skip all of the whitespace (except for \n). */
|
||||
while (*str && (*str != '\n') && isspace (*str))
|
||||
str++;
|
||||
|
||||
/* Str is pointing at the start of the next token. Depending on the
|
||||
type of token, malloc the memory and copy the token value. */
|
||||
if (*str == '\0')
|
||||
token = str;
|
||||
|
||||
else if (*str == '\n') {
|
||||
token = str;
|
||||
str++;
|
||||
}
|
||||
|
||||
else {
|
||||
/* We have some non-whitespace characters. Find the end of */
|
||||
/* them and copy them into new memory. */
|
||||
if ((MB_CUR_MAX == 1 || mblen (str, MB_CUR_MAX) == 1) && *str == '\"')
|
||||
{
|
||||
/*
|
||||
* found a quoted token - skip the quote.
|
||||
*/
|
||||
quote = True;
|
||||
str++;
|
||||
}
|
||||
|
||||
start = str;
|
||||
while (*str && !done)
|
||||
{
|
||||
/*
|
||||
* get the length of the item.
|
||||
*/
|
||||
len = 1;
|
||||
if (MB_CUR_MAX != 1)
|
||||
{
|
||||
len = mblen (str, MB_CUR_MAX);
|
||||
if (len < 0)
|
||||
len = 1;
|
||||
}
|
||||
if (len == 1)
|
||||
{
|
||||
/*
|
||||
* check for the token terminator
|
||||
*/
|
||||
if ((quote && *str == '\"') ||
|
||||
(!quote && (isspace (*str) || *str == '\n')))
|
||||
done = True;
|
||||
else
|
||||
str++;
|
||||
}
|
||||
else
|
||||
str += len;
|
||||
}
|
||||
|
||||
/*
|
||||
* determine the length of the token.
|
||||
*/
|
||||
token = (char *) malloc ((str - start + 1) * sizeof (char));
|
||||
if (token)
|
||||
{
|
||||
strncpy (token, start, str - start);
|
||||
*(token + (str - start)) = '\0';
|
||||
}
|
||||
else
|
||||
errno = CEErrorMalloc;
|
||||
|
||||
/*
|
||||
* skip the quote terminator
|
||||
*/
|
||||
if (quote && len == 1 && *str == '\"')
|
||||
str++;
|
||||
}
|
||||
|
||||
*retToken = token;
|
||||
return (str);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: _DtCvSegment *_DtHelpAllocateSegments(int malloc_size)
|
||||
*
|
||||
* Parameters:
|
||||
* malloc_size Specifies the number of segments to
|
||||
* allocate if 'alloc_size' is NULL or less
|
||||
* than 1 or if '*next_seg' is NULL. The
|
||||
* first one is returned to the caller with
|
||||
* the rest in 'next_seg' if 'next_seg' is
|
||||
* non-NULL.
|
||||
*
|
||||
* Return Value:
|
||||
* non-null If succeeds.
|
||||
* Null If failure.
|
||||
*
|
||||
* Purpose: Allocate a block of segments, zeros the structures, and
|
||||
* sets the link_idx of each structure to -1.
|
||||
*
|
||||
*****************************************************************************/
|
||||
_DtCvSegment *
|
||||
_DtHelpAllocateSegments (
|
||||
int malloc_size)
|
||||
{
|
||||
int i;
|
||||
_DtCvSegment *newSeg;
|
||||
FrmtPrivateInfo *p;
|
||||
|
||||
/*
|
||||
* don't allow zero or negative allocations
|
||||
*/
|
||||
if (malloc_size < 1)
|
||||
malloc_size = 1;
|
||||
|
||||
/*
|
||||
* allocate the block of segments
|
||||
*/
|
||||
newSeg = (_DtCvSegment *) calloc (sizeof(_DtCvSegment), malloc_size);
|
||||
if (NULL != newSeg)
|
||||
{
|
||||
/*
|
||||
* now allocate the same number of private information structures
|
||||
*/
|
||||
p = (FrmtPrivateInfo *) calloc (sizeof(FrmtPrivateInfo), malloc_size);
|
||||
if (NULL != p)
|
||||
{
|
||||
/*
|
||||
* mark the first item as the top block. Since it will be
|
||||
* attached to the first segment, it marks both the segment
|
||||
* and the private information blocks for later frees.
|
||||
*/
|
||||
p->top_block = True;
|
||||
for (i = 0; i < malloc_size; i++)
|
||||
{
|
||||
/*
|
||||
* invalidate the link index and attach a private
|
||||
* information structure to each segment
|
||||
*/
|
||||
newSeg[i].link_idx = -1;
|
||||
newSeg[i].client_use = p++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* had trouble allocating the private information.
|
||||
* free the new segment list and return NULL as an error.
|
||||
*/
|
||||
free(newSeg);
|
||||
newSeg = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return newSeg;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpFmtFindBreak (char *ptr, int mb_len, int *num_chars)
|
||||
*
|
||||
* Parameters:
|
||||
* ptr Specifies the string to check.
|
||||
* mb_len Specifies if the sequence should be single
|
||||
* byte or multi-byte.
|
||||
* num_chars Returns the character count.
|
||||
*
|
||||
* Returns number of bytes in the sequence.
|
||||
*
|
||||
* errno Values:
|
||||
*
|
||||
* Purpose: Find a length of 'ptr' comprised of multi or single byte
|
||||
* characters.
|
||||
*
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtHelpFmtFindBreak (
|
||||
char *ptr,
|
||||
int mb_len,
|
||||
int *num_chars)
|
||||
{
|
||||
int len = 0;
|
||||
int numChars = 0;
|
||||
int mySize;
|
||||
short done = 0;
|
||||
|
||||
while (0 == done && '\0' != *ptr)
|
||||
{
|
||||
mySize = mblen(ptr, MB_CUR_MAX);
|
||||
done = 1;
|
||||
if (0 < mySize &&
|
||||
((1 != mb_len && 1 != mySize) || (1 == mb_len && 1 == mySize)))
|
||||
{
|
||||
numChars++;
|
||||
ptr += mySize;
|
||||
len += mySize;
|
||||
done = 0;
|
||||
}
|
||||
}
|
||||
|
||||
*num_chars = numChars;
|
||||
return len;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: _DtHelpLoadMultiInfo
|
||||
*
|
||||
* Returns: Loads the multi-byte formatting table for the current locale.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpLoadMultiInfo (
|
||||
wchar_t **cant_begin_chars,
|
||||
wchar_t **cant_end_chars,
|
||||
short *nl_to_space)
|
||||
{
|
||||
#ifndef NO_MESSAGE_CATALOG
|
||||
int len;
|
||||
char *ptr;
|
||||
nl_catd cat_fd;
|
||||
|
||||
cat_fd = catopen ("fmt_tbl", NL_CAT_LOCALE);
|
||||
if (cat_fd != ((nl_catd) -1))
|
||||
{
|
||||
/*
|
||||
* Get the list of characters that can't begin a line.
|
||||
*/
|
||||
ptr = catgets (cat_fd, 1, 1, "");
|
||||
len = strlen (ptr) + 1;
|
||||
*cant_begin_chars = (wchar_t *) malloc (len * sizeof (wchar_t));
|
||||
if (NULL != *cant_begin_chars &&
|
||||
mbstowcs(*cant_begin_chars, ptr, len) == -1)
|
||||
{
|
||||
free (*cant_begin_chars);
|
||||
*cant_begin_chars = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the list of characters that can't end a line.
|
||||
*/
|
||||
ptr = catgets (cat_fd, 1, 2, "");
|
||||
len = strlen (ptr) + 1;
|
||||
*cant_end_chars = (wchar_t *) malloc (len * sizeof (wchar_t));
|
||||
if (*cant_end_chars != NULL &&
|
||||
mbstowcs(*cant_end_chars, ptr, len) == -1)
|
||||
{
|
||||
free (*cant_end_chars);
|
||||
*cant_end_chars = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the spacing flag. I.E. when does a internal newline
|
||||
* get turned into a space.
|
||||
* 1 means all the time.
|
||||
* 0 means only between a multibyte string and
|
||||
* a singlebyte string.
|
||||
*/
|
||||
ptr = catgets (cat_fd, 1, 3, "1");
|
||||
*nl_to_space = atoi(ptr);
|
||||
|
||||
catclose (cat_fd);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
*cant_begin_chars = NULL;
|
||||
*cant_end_chars = NULL;
|
||||
*nl_to_space = 1;
|
||||
}
|
||||
}
|
||||
110
cde/lib/DtHelp/FormatUtilI.h
Normal file
110
cde/lib/DtHelp/FormatUtilI.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/* $XConsortium: FormatUtilI.h /main/9 1996/05/09 03:42:14 drk $ */
|
||||
/*************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: FormatUtilI.h
|
||||
**
|
||||
** Project: TextGraphic Display routines
|
||||
**
|
||||
**
|
||||
** Description: Header file for FormatUtil.c
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpFormatUtilI_h
|
||||
#define _DtHelpFormatUtilI_h
|
||||
|
||||
/******** Semi-Private Structure Declarations ********/
|
||||
typedef struct sdlMatchData {
|
||||
int clan;
|
||||
int level;
|
||||
char *ssi;
|
||||
} SdlMatchData;
|
||||
|
||||
typedef struct _frmtUiInfo {
|
||||
_DtCvValue (*load_graphic)();
|
||||
_DtCvValue (*resolve_spc)();
|
||||
void (*load_font)();
|
||||
int (*exec_filter)();
|
||||
void (*destroy_region)();
|
||||
_DtCvPointer client_data;
|
||||
_DtCvUnit line_width;
|
||||
_DtCvUnit line_height;
|
||||
_DtCvUnit leading;
|
||||
int avg_char;
|
||||
short nl_to_space;
|
||||
} _FrmtUiInfo;
|
||||
|
||||
typedef struct _frmtPrivateInfo {
|
||||
char top_block;
|
||||
char dup_flag;
|
||||
int sdl_el_type;
|
||||
int interp;
|
||||
void *match_info;
|
||||
void *id_info;
|
||||
void *doc_info;
|
||||
void *entry;
|
||||
void *toss;
|
||||
void *lang_char;
|
||||
char *abbrev;
|
||||
} FrmtPrivateInfo;
|
||||
|
||||
/******** Semi-Private Function Declarations ********/
|
||||
extern int _DtHelpCeAddCharToBuf (
|
||||
char **src,
|
||||
char **dst,
|
||||
int *dst_size,
|
||||
int *dst_max,
|
||||
int grow_size );
|
||||
extern int _DtHelpCeAddOctalToBuf(
|
||||
char *src,
|
||||
char **dst,
|
||||
int *dst_size,
|
||||
int *dst_max,
|
||||
int grow_size );
|
||||
extern int _DtHelpCeAddStrToBuf (
|
||||
char **src,
|
||||
char **dst,
|
||||
int *dst_size,
|
||||
int *dst_max,
|
||||
int copy_size,
|
||||
int grow_size );
|
||||
extern _DtCvSegment *_DtHelpAllocateSegments (
|
||||
int malloc_size);
|
||||
extern int _DtHelpCeGetMbLen(
|
||||
char *lang,
|
||||
char *char_set);
|
||||
extern int _DtHelpCeGetNxtBuf(
|
||||
BufFilePtr file,
|
||||
char *dst,
|
||||
char **src,
|
||||
int max_size);
|
||||
extern char * _DtHelpGetNxtToken (
|
||||
char *str,
|
||||
char **retToken);
|
||||
extern int _DtHelpCeReadBuf(
|
||||
BufFilePtr file,
|
||||
char *buffer,
|
||||
int size);
|
||||
extern int _DtHelpFmtFindBreak(
|
||||
char *ptr,
|
||||
int mb_len,
|
||||
int *num_chars);
|
||||
extern void _DtHelpLoadMultiInfo(
|
||||
wchar_t **cant_begin_chars,
|
||||
wchar_t **cant_end_chars,
|
||||
short *nl_to_space);
|
||||
|
||||
/******** Semi-Private Macro Declarations ********/
|
||||
#define FrmtPrivInfoPtr(x) ((FrmtPrivateInfo *) (x)->client_use)
|
||||
|
||||
#endif /* _DtHelpFormatUtilI_h */
|
||||
263
cde/lib/DtHelp/GenUtils.c
Normal file
263
cde/lib/DtHelp/GenUtils.c
Normal file
@@ -0,0 +1,263 @@
|
||||
/* $XConsortium: GenUtils.c /main/10 1996/05/09 03:42:28 drk $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: GenUtils.c
|
||||
**
|
||||
** Project: CDEnext Info Access.
|
||||
**
|
||||
** Description: This module contains non public routines used only by
|
||||
** CDE 1.0 dthelpgen. If any of these routines are
|
||||
** renamed or modified to remove or add parameters, the
|
||||
** original routine should be moved to Obsolete.c, a new
|
||||
** routine created (and named differently), and the old
|
||||
** routine should call the new routine.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/*
|
||||
* system includes
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xresource.h>
|
||||
|
||||
/*
|
||||
* Canvas Engine includes
|
||||
*/
|
||||
#include "CanvasP.h"
|
||||
#include "CanvasSegP.h"
|
||||
|
||||
/*
|
||||
* private includes
|
||||
*/
|
||||
#include "bufioI.h" /* for FormatUtilI.h */
|
||||
#include "GenUtilsP.h"
|
||||
#include "FontAttrI.h"
|
||||
#include "Access.h"
|
||||
#include "AccessP.h"
|
||||
#include "AccessSDLP.h"
|
||||
#include "AccessSDLI.h"
|
||||
#include "AccessCCDFP.h"
|
||||
#include "AccessCCDFI.h"
|
||||
#include "SDLI.h"
|
||||
#include "FormatUtilI.h"
|
||||
#include "FormatSDLI.h"
|
||||
#include "Lock.h"
|
||||
|
||||
#ifdef NLS16
|
||||
#endif
|
||||
|
||||
/******** Private Defines ********/
|
||||
/******** Private Function Declarations ********/
|
||||
static void DefCvsMetrics(
|
||||
_DtCvPointer client_data,
|
||||
_DtCvElemType elem_type,
|
||||
_DtCvPointer ret_metrics);
|
||||
/******** Private Macro Declarations ********/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private variables used within this file.
|
||||
*
|
||||
*******************************************************************************/
|
||||
static _DtCvVirtualInfo MyVirtInfo =
|
||||
{
|
||||
DefCvsMetrics, /* void (*_CEGet_DtCvMetrics)(); */
|
||||
NULL, /* void (*_DtCvRenderElem)(); */
|
||||
NULL, /* DefCvsStrWidth, _DtCvUnit (*_DtCvGetElemWidth)(); */
|
||||
NULL, /* DefCvsFontMetrics, void (*_DtCvGetFontMetrics)(); */
|
||||
NULL, /* VStatus (*_DtCvBuildSelection)(); */
|
||||
};
|
||||
|
||||
static const _DtCvSpaceMetrics defLinkMetrics = { 0, 0, 0, 0 };
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Private functions
|
||||
*
|
||||
******************************************************************************/
|
||||
/*****************************************************************************
|
||||
* Function: void DefCvsMetrics ();
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Returns:
|
||||
*
|
||||
* Purpose:
|
||||
*
|
||||
*****************************************************************************/
|
||||
static void
|
||||
DefCvsMetrics (
|
||||
_DtCvPointer client_data,
|
||||
_DtCvElemType elem_type,
|
||||
_DtCvPointer ret_metrics)
|
||||
{
|
||||
_DtCvSpaceMetrics *retLink = (_DtCvSpaceMetrics *) ret_metrics;
|
||||
|
||||
if (_DtCvCANVAS_TYPE == elem_type)
|
||||
{
|
||||
_DtCvMetrics *retCanvas = (_DtCvMetrics *) ret_metrics;
|
||||
|
||||
retCanvas->width = 1;
|
||||
retCanvas->height = 1;
|
||||
retCanvas->top_margin = 0;
|
||||
retCanvas->side_margin = 0;
|
||||
retCanvas->line_height = 1;
|
||||
retCanvas->horiz_pad_hint = 1;
|
||||
}
|
||||
else if (_DtCvLINK_TYPE == elem_type || _DtCvTRAVERSAL_TYPE == elem_type)
|
||||
*retLink = defLinkMetrics;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Semi-Public Functions
|
||||
******************************************************************************/
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpCeGetVolumeTitle(_DtHelpVolume vol, char **retTitle);
|
||||
*
|
||||
* Parameters: vol Specifies the loaded volume.
|
||||
* retTitle Returns the title of the volume. This string is
|
||||
* owned by the caller and must be freed.
|
||||
*
|
||||
* Return Value: 0 if successful, -1 if a failure occurs
|
||||
*
|
||||
* Purpose: Get the title of a volume.
|
||||
*
|
||||
* Used by: dthelpgen 1.0
|
||||
*
|
||||
******************************************************************************/
|
||||
int
|
||||
_DtHelpCeGetVolumeTitle (
|
||||
CanvasHandle canvas,
|
||||
VolumeHandle volume,
|
||||
char **ret_title)
|
||||
{
|
||||
_FrmtUiInfo myUiInfo;
|
||||
_DtHelpVolume vol = (_DtHelpVolume)volume;
|
||||
int result;
|
||||
|
||||
/*
|
||||
* set up my UI information
|
||||
*/
|
||||
myUiInfo.load_graphic = NULL;
|
||||
myUiInfo.resolve_spc = NULL;
|
||||
myUiInfo.load_font = NULL;
|
||||
myUiInfo.destroy_region = NULL;
|
||||
myUiInfo.exec_filter = NULL;
|
||||
myUiInfo.client_data = NULL;
|
||||
/* since we're going for a string, set avg_char width to 1 */
|
||||
myUiInfo.line_width = 0;
|
||||
myUiInfo.line_height = 0;
|
||||
myUiInfo.leading = 0;
|
||||
myUiInfo.avg_char = 1;
|
||||
myUiInfo.nl_to_space = 0;
|
||||
|
||||
/*
|
||||
* What type of volume is it?
|
||||
*/
|
||||
_DtHelpProcessLock();
|
||||
if (0 == _DtHelpCeGetVolumeFlag(volume))
|
||||
{
|
||||
result = _DtHelpCeGetCcdfVolumeTitle(vol, ret_title);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = _DtHelpCeFrmtSDLVolTitleToAscii(volume, &myUiInfo, ret_title);
|
||||
}
|
||||
_DtHelpProcessUnlock();
|
||||
return result;
|
||||
}
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpCeGetAsciiVolumeAbstract (_DtHelpVolume vol, char **a
|
||||
bstract);
|
||||
*
|
||||
* Parameters: vol Specifies the loaded volume.
|
||||
* abstract Returns the abstract of the volume. This string
|
||||
* is owned by the caller and should be freed.
|
||||
*
|
||||
* Return Value: 0 if successful, -1 if a failure occurs
|
||||
*
|
||||
* Purpose: Get the abstract of a volume.
|
||||
*
|
||||
* Used by: dthelpgen 1.0
|
||||
*
|
||||
******************************************************************************/
|
||||
int
|
||||
_DtHelpCeGetAsciiVolumeAbstract (
|
||||
CanvasHandle canvas,
|
||||
VolumeHandle volume,
|
||||
char **retAbs)
|
||||
{
|
||||
_DtHelpVolume vol = (_DtHelpVolume)volume;
|
||||
int result;
|
||||
|
||||
/*
|
||||
* What type of volume is it?
|
||||
*/
|
||||
_DtHelpProcessLock();
|
||||
if (0 == _DtHelpCeGetVolumeFlag(volume))
|
||||
{
|
||||
result = _DtHelpCeGetCcdfVolumeAbstract(vol, retAbs);
|
||||
_DtHelpProcessUnlock();
|
||||
return result;
|
||||
}
|
||||
|
||||
*retAbs = _DtHelpCeGetSdlVolumeAsciiAbstract(volume);
|
||||
if (*retAbs == NULL)
|
||||
{
|
||||
_DtHelpProcessUnlock();
|
||||
return (-1);
|
||||
}
|
||||
|
||||
_DtHelpProcessUnlock();
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: CanvasHandle _DtHelpCeCreateDefCanvas (void);
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Returns: A handle to the canvas or NULL if an error occurs.
|
||||
*
|
||||
* Purpose: Create a canvas and attach the appropriate virtual functions
|
||||
* to the canvas.
|
||||
*****************************************************************************/
|
||||
CanvasHandle
|
||||
_DtHelpCeCreateDefCanvas (void)
|
||||
{
|
||||
return (_DtCanvasCreate(MyVirtInfo, NULL));
|
||||
|
||||
} /* End _DtHelpCeCreateDefCanvas */
|
||||
|
||||
/******************************************************************************
|
||||
* Function: char *_DtHelpCeGetNxtToken (char *str, char **retToken)
|
||||
*
|
||||
* Parameters:
|
||||
* Return Value: Returns the pointer to the next unparsed character in
|
||||
* the input string. A NULL value indicates an error.
|
||||
*
|
||||
* errno Values:
|
||||
* EINVAL
|
||||
* CEErrorMalloc
|
||||
*
|
||||
* Purpose: Parse tokens in resource string values.
|
||||
*
|
||||
*****************************************************************************/
|
||||
char *
|
||||
_DtHelpCeGetNxtToken (
|
||||
char *str,
|
||||
char **retToken)
|
||||
{
|
||||
return (_DtHelpGetNxtToken(str, retToken));
|
||||
}
|
||||
48
cde/lib/DtHelp/GenUtilsP.h
Normal file
48
cde/lib/DtHelp/GenUtilsP.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* $XConsortium: GenUtilsP.h /main/3 1996/05/09 03:42:42 drk $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: GenUtilsP.h
|
||||
**
|
||||
** Project: CDEnext Info Access
|
||||
**
|
||||
** Description: Header file for GenUtils.c
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpGenUtilsP_h
|
||||
#define _DtHelpGenUtilsP_h
|
||||
|
||||
/****************************************************************************
|
||||
* Public Defines
|
||||
****************************************************************************/
|
||||
#ifndef _DtHelpObsoleteP_h
|
||||
typedef void* CanvasHandle;
|
||||
typedef void* VolumeHandle;
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Semi-Public Externals
|
||||
****************************************************************************/
|
||||
extern CanvasHandle _DtHelpCeCreateDefCanvas(void);
|
||||
extern int _DtHelpCeGetAsciiVolumeAbstract (
|
||||
CanvasHandle canvas,
|
||||
VolumeHandle volume,
|
||||
char **retAbs);
|
||||
extern char *_DtHelpCeGetNxtToken (
|
||||
char *str,
|
||||
char **retToken);
|
||||
extern int _DtHelpCeGetVolumeTitle(
|
||||
CanvasHandle canvas,
|
||||
VolumeHandle volume,
|
||||
char **ret_title);
|
||||
#endif /* _DtHelpGenUtilsP_h */
|
||||
1237
cde/lib/DtHelp/GifUtils.c
Normal file
1237
cde/lib/DtHelp/GifUtils.c
Normal file
File diff suppressed because it is too large
Load Diff
124
cde/lib/DtHelp/GifUtilsI.h
Normal file
124
cde/lib/DtHelp/GifUtilsI.h
Normal file
@@ -0,0 +1,124 @@
|
||||
/* $XConsortium: GifUtilsI.h /main/3 1996/05/09 03:42:55 drk $ */
|
||||
#ifndef _DtGifUtilsI_h
|
||||
#define _DtGifUtilsI_h
|
||||
|
||||
/* Include files */
|
||||
#include <X11/Xlib.h>
|
||||
#include "GraphicsP.h"
|
||||
|
||||
/* Enumerated values */
|
||||
enum op_t { DO_COLOR, DO_GREY };
|
||||
|
||||
/* Type definitions */
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned long pixel;
|
||||
|
||||
/* Data structures */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long pixel;
|
||||
unsigned short red, green, blue;
|
||||
unsigned short grey;
|
||||
} GifColors;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
XImage *f_ximage;
|
||||
Display *f_dpy;
|
||||
int f_screen;
|
||||
Colormap f_cmap;
|
||||
Drawable f_drawable;
|
||||
GC f_gc;
|
||||
Visual *f_visual;
|
||||
unsigned int f_ncells;
|
||||
unsigned int f_nplanes;
|
||||
unsigned long f_black;
|
||||
unsigned long f_white;
|
||||
unsigned long f_fg;
|
||||
unsigned long f_bg;
|
||||
int f_dft_depth;
|
||||
int f_visual_class;
|
||||
int f_color_map_constructed;
|
||||
int f_do_visual;
|
||||
int bits_per_pixel ;
|
||||
int colors_per_pixel;
|
||||
int total_colors ;
|
||||
int f_total_greys;
|
||||
int f_init_total_greys;
|
||||
Boolean f_allow_reduced_colors;
|
||||
Boolean f_color_reduction_used;
|
||||
GifColors GifCMap[64];
|
||||
unsigned long GifGMap[32];
|
||||
} GifObj;
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/* Initializes a gif object structure */
|
||||
enum _DtGrLoadStatus InitGifObject(
|
||||
GifObj *g,
|
||||
Display *dpy,
|
||||
Drawable drawable,
|
||||
Screen *screen,
|
||||
int depth,
|
||||
Colormap colormap,
|
||||
Visual *visual,
|
||||
GC gc,
|
||||
enum _DtGrColorModel colorModel,
|
||||
Boolean allowReducedColors
|
||||
);
|
||||
|
||||
/* Deletes resources associated with a gif object structure */
|
||||
void DeleteGifObjectResources(
|
||||
GifObj *g
|
||||
);
|
||||
|
||||
/* Converts a gif buffer to an X pixmap */
|
||||
Pixmap gif_to_pixmap(
|
||||
GifObj *g,
|
||||
byte *inbuf,
|
||||
unsigned int buflen,
|
||||
Dimension *w,
|
||||
Dimension *h,
|
||||
Pixel fg,
|
||||
Pixel bg,
|
||||
float ratio
|
||||
);
|
||||
|
||||
/* Creates a raw PPM-style image from a GIF buffer */
|
||||
pixel **create_raw_image(
|
||||
byte *inbuf,
|
||||
unsigned int buflen,
|
||||
int *width,
|
||||
int *height,
|
||||
int imageNumber
|
||||
);
|
||||
|
||||
/* Creates an X pixmap from a raw PPM-style image */
|
||||
Pixmap create_pixmap(
|
||||
GifObj *g,
|
||||
pixel **image,
|
||||
int width,
|
||||
int height,
|
||||
Pixel fg,
|
||||
Pixel bg,
|
||||
float ratio
|
||||
);
|
||||
|
||||
/* Frees raw image data */
|
||||
void free_raw_image(
|
||||
pixel **image
|
||||
);
|
||||
|
||||
/* Allocates X pixels needed for the color cube */
|
||||
int allocate_colors(
|
||||
GifObj *g
|
||||
);
|
||||
|
||||
/* Allocates X pixels needed for greyscale rendering */
|
||||
int allocate_greys(
|
||||
GifObj *g
|
||||
);
|
||||
|
||||
#endif /* _DtGifUtilsI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
5251
cde/lib/DtHelp/GlobSearch.c
Normal file
5251
cde/lib/DtHelp/GlobSearch.c
Normal file
File diff suppressed because it is too large
Load Diff
41
cde/lib/DtHelp/GlobSearchI.h
Normal file
41
cde/lib/DtHelp/GlobSearchI.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* $XConsortium: GlobSearchI.h /main/4 1995/10/26 12:22:45 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: GlobSearchI.h
|
||||
**
|
||||
** Project: DtHelp Project
|
||||
**
|
||||
** Description: Builds and displays an instance of a DtHelp GlobSearch
|
||||
** Dialog.
|
||||
**
|
||||
**
|
||||
** (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 _GlobSearchI_h
|
||||
#define _GlobSearchI_h
|
||||
|
||||
/* global var */
|
||||
extern char _DtHelpDefaultSrchHitPrefixFont[];
|
||||
|
||||
void _DtHelpGlobSrchDisplayDialog(
|
||||
Widget owner,
|
||||
char * searchWord,
|
||||
char * curVolume);
|
||||
void _DtHelpGlobSrchUpdateCurVol(
|
||||
Widget widget);
|
||||
void _DtHelpGlobSrchCleanAndClose(
|
||||
_DtHelpGlobSearchStuff * srch,
|
||||
Boolean destroy);
|
||||
void _DtHelpGlobSrchInitVars(
|
||||
_DtHelpGlobSearchStuff * srch);
|
||||
|
||||
#endif /* _GlobSearchI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
94
cde/lib/DtHelp/GlobSearchP.h
Normal file
94
cde/lib/DtHelp/GlobSearchP.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/* $XConsortium: GlobSearchP.h /main/4 1995/10/26 12:22:52 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: GlobSearchP.h
|
||||
**
|
||||
** Project: DtHelp Project
|
||||
**
|
||||
** Description: Builds and displays an instance of a DtHelp GlobSearch
|
||||
** Dialog.
|
||||
**
|
||||
**
|
||||
** (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 _GlobSearchP_h
|
||||
#define _GlobSearchP_h
|
||||
|
||||
#include "Access.h"
|
||||
#include "FileListUtilsI.h"
|
||||
#include "StringFuncsI.h" /* for _CEStrcollProc */
|
||||
|
||||
typedef enum {
|
||||
_DtHelpGlobSrchVolumeUndef = 0,
|
||||
_DtHelpGlobSrchCurVolume = 1,
|
||||
_DtHelpGlobSrchSelectedVolumes,
|
||||
_DtHelpGlobSrchAllVolumes
|
||||
} _DtHelpGlobSrchSources;
|
||||
|
||||
typedef enum {
|
||||
_DtHelpGlobSrchSearchThisVolume = 32,
|
||||
_DtHelpGlobSrchNothingDone = 0,
|
||||
_DtHelpGlobSrchTopicSearchInProgress = 1,
|
||||
_DtHelpGlobSrchTopicSearchDone = 2,
|
||||
_DtHelpGlobSrchIndexSearchInProgress = 4,
|
||||
_DtHelpGlobSrchIndexSearchDone = 8,
|
||||
_DtHelpGlobSrchEverySearchDone = 15
|
||||
} _DtHelpGlobSrchState;
|
||||
|
||||
/* maintained for each volume searched thus far */
|
||||
/* this data is stored in a struct pointed to by 'clientData' in _DtHelpFileList */
|
||||
typedef struct _DtHelpGlobSrchVol {
|
||||
unsigned int searchThisVolume:1;
|
||||
unsigned int nothingDone:1;
|
||||
unsigned int topicSearchInProgress:1;
|
||||
unsigned int topicSearchDone:1;
|
||||
unsigned int indexSearchInProgress:1;
|
||||
unsigned int indexSearchDone:1;
|
||||
unsigned int searchCompleted:1;
|
||||
unsigned int showVolInList:1; /* show vol in srchResultList? */
|
||||
unsigned int zeroHitsOk:1; /* show vol with zero hits? */
|
||||
unsigned int hitsDisplayed:1; /* are hits shown in list? */
|
||||
unsigned int showHitsWithVol:1; /* show hits of the volume? */
|
||||
unsigned int gatheredFullIndex:1; /* full index was gathered */
|
||||
unsigned int gotLocale:1; /* got locale already */
|
||||
struct _DtHelpGlobSrchHit * hitListHead;
|
||||
struct _DtHelpGlobSrchHit * hitListTail;
|
||||
int hitCnt; /* number hits for this volume */
|
||||
int startPosition; /* position of volume item */
|
||||
int nextVolPosition; /* pos of next vol with hits */
|
||||
size_t searchedCnt; /* number items searched thus far */
|
||||
char * * indexEntriesList;/* entries for searching */
|
||||
XmString * indexXmStrsList; /* entries for display */
|
||||
XmString * curIndexXmStr; /* position in indexXmStrsList */
|
||||
_DtHelpVolumeHdl volHandle;
|
||||
char * stdLocale; /* CDE standard locale of the volume */
|
||||
char * iconv3Codeset; /* iconv-compatible codeset of volume locale */
|
||||
_CEStrcollProc strcollProc; /* proc to do string coll */
|
||||
} _DtHelpGlobSrchVol;
|
||||
|
||||
/* maintained for each location hit encountered */
|
||||
typedef struct _DtHelpGlobSrchHit {
|
||||
struct _DtHelpGlobSrchHit * next;
|
||||
_DtHelpFileEntry volume;
|
||||
int indexKey; /* hash value for quick compares */
|
||||
XmString indexTitle; /* title used for display */
|
||||
char * indexEntry; /* string used for retrieval */
|
||||
char ** topicIdList; /* list of topic ids of this index */
|
||||
char ** topicFileList;/* list of files of the topics */
|
||||
XmString * topicTitles; /* list of titles of the topics */
|
||||
short topicCnt; /* number of topics in the list */
|
||||
unsigned int topicsLoaded:1; /* loaded topics of this index*/
|
||||
unsigned int topicsDisplayed:1; /* are topics shown in list */
|
||||
unsigned int showTopicsWithHit:1;/* show topics if showing hit?*/
|
||||
} _DtHelpGlobSrchHit;
|
||||
|
||||
#endif /* _GlobSearchP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
3038
cde/lib/DtHelp/Graphics.c
Normal file
3038
cde/lib/DtHelp/Graphics.c
Normal file
File diff suppressed because it is too large
Load Diff
49
cde/lib/DtHelp/GraphicsI.h
Normal file
49
cde/lib/DtHelp/GraphicsI.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* $XConsortium: GraphicsI.h /main/6 1996/03/27 16:27:58 lehors $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: GraphicsI.h
|
||||
**
|
||||
** Project: Cde Help System
|
||||
**
|
||||
** Description: Internal header file for Graphics.c
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
#ifndef _DtGraphicsI_h
|
||||
#define _DtGraphicsI_h
|
||||
|
||||
/*
|
||||
* Semi-Public Routines
|
||||
*/
|
||||
extern Pixmap _DtHelpProcessGraphic(
|
||||
Display *dpy,
|
||||
Drawable drawable,
|
||||
int screen,
|
||||
int depth,
|
||||
GC gc,
|
||||
Pixmap *def_pix,
|
||||
Dimension *def_pix_width,
|
||||
Dimension *def_pix_height,
|
||||
_DtGrContext *context,
|
||||
Colormap colormap,
|
||||
Visual *visual,
|
||||
Pixel fore_ground,
|
||||
Pixel back_ground,
|
||||
char *filename,
|
||||
unsigned short media_resolution,
|
||||
Dimension *pixmapWidth,
|
||||
Dimension *pixmapHeight,
|
||||
Pixmap *ret_mask,
|
||||
Pixel **ret_colors,
|
||||
int *ret_number );
|
||||
|
||||
#endif /* _DtGraphisI.h */
|
||||
175
cde/lib/DtHelp/GraphicsP.h
Normal file
175
cde/lib/DtHelp/GraphicsP.h
Normal file
@@ -0,0 +1,175 @@
|
||||
/* $XConsortium: GraphicsP.h /main/4 1996/05/09 03:43:09 drk $ */
|
||||
#ifndef _DtGraphicsP_h
|
||||
#define _DtGraphicsP_h
|
||||
|
||||
#include <stdio.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* Input stream data structures
|
||||
*/
|
||||
|
||||
/* Stream source types */
|
||||
enum _DtGrStreamType { _DtGrNONE, _DtGrBUFFER, _DtGrFILE };
|
||||
|
||||
/* Stream file data */
|
||||
typedef struct
|
||||
{
|
||||
FILE *fileptr;
|
||||
char *filename;
|
||||
char *uncompressed_filename;
|
||||
} _DtGrFile;
|
||||
|
||||
/* Stream buffer data */
|
||||
typedef struct
|
||||
{
|
||||
const char *base;
|
||||
long size;
|
||||
char *current;
|
||||
char *end;
|
||||
} _DtGrBuffer;
|
||||
|
||||
/* Stream data */
|
||||
typedef struct
|
||||
{
|
||||
enum _DtGrStreamType type;
|
||||
union
|
||||
{
|
||||
_DtGrFile file;
|
||||
_DtGrBuffer buffer;
|
||||
} source;
|
||||
} _DtGrStream;
|
||||
|
||||
/*
|
||||
* Input stream function prototypes
|
||||
*/
|
||||
|
||||
/* Open a file stream */
|
||||
int _DtGrOpenFile(
|
||||
_DtGrStream *stream,
|
||||
const char *path
|
||||
);
|
||||
|
||||
/* Open a buffer stream */
|
||||
int _DtGrOpenBuffer(
|
||||
_DtGrStream *stream,
|
||||
const char *buffer,
|
||||
int buffer_size
|
||||
);
|
||||
|
||||
/* Close a stream */
|
||||
int _DtGrCloseStream(
|
||||
_DtGrStream *stream
|
||||
);
|
||||
|
||||
/* Reads data from a stream into a buffer */
|
||||
size_t _DtGrRead(
|
||||
void *buffer,
|
||||
size_t size,
|
||||
size_t num_items,
|
||||
_DtGrStream *stream
|
||||
);
|
||||
|
||||
/* Sets the position of the next input operation on a stream */
|
||||
int _DtGrSeek(
|
||||
_DtGrStream *stream,
|
||||
long offset,
|
||||
int whence
|
||||
);
|
||||
|
||||
/* Reads a character from a stream and advances the stream position */
|
||||
int _DtGrGetChar(
|
||||
_DtGrStream *stream
|
||||
);
|
||||
|
||||
/* Reads a string from a stream and advances the stream position */
|
||||
char *_DtGrGetString(
|
||||
char *buffer,
|
||||
int num_bytes,
|
||||
_DtGrStream *stream
|
||||
);
|
||||
|
||||
/*
|
||||
* Inline graphics data structures
|
||||
*/
|
||||
|
||||
enum _DtGrColorModel { _DtGrCOLOR, _DtGrGRAY_SCALE, _DtGrBITONAL };
|
||||
enum _DtGrLoadStatus { _DtGrSUCCESS, _DtGrCOLOR_REDUCE,_DtGrCONVERT_FAILURE,
|
||||
_DtGrOPEN_FAILED, _DtGrFILE_INVALID, _DtGrNO_MEMORY,
|
||||
_DtGrCOLOR_FAILED };
|
||||
|
||||
/* Context structure used by image type converters */
|
||||
typedef struct {
|
||||
char *image_type;
|
||||
XPointer context;
|
||||
} _DtGrContext;
|
||||
|
||||
typedef enum _DtGrLoadStatus (*_DtGrLoadProc)(
|
||||
_DtGrStream *stream,
|
||||
Screen *screen,
|
||||
int depth,
|
||||
Colormap colormap,
|
||||
Visual *visual,
|
||||
Pixel foreground,
|
||||
Pixel background,
|
||||
GC gc,
|
||||
enum _DtGrColorModel color_model,
|
||||
Boolean allow_reduced_colors,
|
||||
Dimension *in_out_width,
|
||||
Dimension *in_out_height,
|
||||
unsigned short media_resolution,
|
||||
Pixmap *ret_pixmap,
|
||||
Pixmap *ret_mask,
|
||||
Pixel **ret_colors,
|
||||
int *ret_num_colors,
|
||||
_DtGrContext *context);
|
||||
|
||||
typedef void (*_DtGrDestroyContextProc)(
|
||||
_DtGrContext *context);
|
||||
|
||||
/*
|
||||
* Inline graphics function prototypes
|
||||
*/
|
||||
|
||||
/* Loads an image into a pixmap */
|
||||
enum _DtGrLoadStatus _DtGrLoad(
|
||||
_DtGrStream *stream,
|
||||
char **image_type,
|
||||
Screen *screen,
|
||||
int depth,
|
||||
Colormap colormap,
|
||||
Visual *visual,
|
||||
Pixel foreground,
|
||||
Pixel background,
|
||||
GC gc,
|
||||
enum _DtGrColorModel color_model,
|
||||
Boolean allow_reduced_colors,
|
||||
Dimension *in_out_width,
|
||||
Dimension *in_out_height,
|
||||
unsigned short media_resolution,
|
||||
Pixmap *ret_pixmap,
|
||||
Pixmap *ret_mask,
|
||||
Pixel **ret_colors,
|
||||
int *ret_num_colors,
|
||||
_DtGrContext *context);
|
||||
|
||||
/* Destroys a context */
|
||||
void _DtGrDestroyContext(
|
||||
_DtGrContext *context);
|
||||
|
||||
/* Registers a converter for a graphic type */
|
||||
void _DtGrRegisterConverter(
|
||||
char *image_type,
|
||||
_DtGrLoadProc convert_proc,
|
||||
_DtGrDestroyContextProc destroy_context_proc,
|
||||
_DtGrLoadProc *current_convert_proc,
|
||||
_DtGrDestroyContextProc *current_destroy_proc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _DtGraphicsP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
606
cde/lib/DtHelp/HP-UX.lcx
Normal file
606
cde/lib/DtHelp/HP-UX.lcx
Normal file
@@ -0,0 +1,606 @@
|
||||
!!!!!!!!!!!!!! HP-UX Locale-Related Translations !!!!!!!!!!!!!!
|
||||
! File: HP-UX.lcx
|
||||
! Default location: /usr/dt/config/svc/HP-UX.lcx
|
||||
! Purpose:
|
||||
! Define the HP-specific set of locale-related translations.
|
||||
! Description:
|
||||
! This file contains the set of all locale-related translations
|
||||
! that can occur during _DtLcxXlateOpToStd() and _DtLcxStdToOp()
|
||||
! calls on HP platforms. Note that platform-specific tables may
|
||||
! include more than one translation to and from CDE standard
|
||||
! strings if they can be distinguished by version, operation, or
|
||||
! pattern matching.
|
||||
!
|
||||
! It is important that additional CDE standard strings only
|
||||
! be created by the CDE owner of the _DtLcx translation service
|
||||
! and NOT be created by an individual vendor or user. This be because
|
||||
! the purpose of adopting a set of CDE standard strings is to
|
||||
! support interoperability across platforms. If individual vendors
|
||||
! add their own "standard" strings and these strings are not
|
||||
! known on other platforms, then the goal of interoperability
|
||||
! will be defeated.
|
||||
!
|
||||
! If you feel that a new CDE standard string is needed,
|
||||
! contact your CDE representative/vendor with a specific
|
||||
! proposal and justification and have them forward it to
|
||||
! the owner of the CDE _DtLcx service.
|
||||
!
|
||||
! Note that it is allowed for vendors and users to add new
|
||||
! operations for which translations are specified and which
|
||||
! utilize the standard strings. If the operations are of
|
||||
! general utility, please bring them to the attention of
|
||||
! your CDE representative/vendor for forwarding to the
|
||||
! _DtLcx owner.
|
||||
! Invoked by:
|
||||
! This table is used by the _DtLcx translation service
|
||||
! Product: @(#)Cde1
|
||||
! Revision: $XConsortium: HP-UX.lcx /main/3 1995/10/26 12:23:15 rswiston $
|
||||
! Defects:
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
!!!!!!!!!!!!!!!! translation specification syntax !!!!!!!!!!!!!!!!!!!
|
||||
! Introductory fields:
|
||||
! ====================
|
||||
! The _DtLcx translation specifications have a fixed number of
|
||||
! introductory fields followed by a several standard value
|
||||
! fields and the operation-specific value.
|
||||
! The introductory fields are:
|
||||
! <platform>.<version range>.<operation(s)>.<kind>
|
||||
!
|
||||
! Platform generally is the same string as uname(1) -s.
|
||||
! Version range utilizes normalized version numbers that
|
||||
! are acquired using the 'version' translations.
|
||||
! Operations are one or more comma-separated strings that
|
||||
! uniquely identify the operation associated with the
|
||||
! operation-specific value. This string is specified
|
||||
! as part of the request for a translation.
|
||||
!
|
||||
! Kinds of translations allow the mechanism to support several modes
|
||||
! of operation, each useful for different purposes. When
|
||||
! reading or writing a specification, pay particular attention
|
||||
! to the kind of specification, as this guides the usage of it.
|
||||
!
|
||||
! Specification kinds:
|
||||
! .=. means a valid bi-directional translation requiring the op-value
|
||||
! in the translation specification to exactly match the op-value of
|
||||
! the call to _DtLcxXlateOpToStd(), e.g. foo matches only foo
|
||||
! .~. means a valid bi-directional translation requiring the op-value
|
||||
! in the translation specification to match the beginning of the
|
||||
! op-value of the call to _DtLcxXlateOpToStd(), e.g. foo matches
|
||||
! foo@bar. This is often useful, e.g. for operation-specific
|
||||
! locale strings that may also contain modifier suffixes.
|
||||
! .>. means only from standard to op-specific (generally a
|
||||
! compatibility translation, meaning on op-specific value
|
||||
! that will work for the standard, although that is not
|
||||
! the straight mapping)
|
||||
! .<. means only from op-specific to standard (generally a
|
||||
! regex in the op-value which is used to map a class of
|
||||
! op values to a standard value)
|
||||
! .0. means that translation is not supported and if a translation
|
||||
! request matches the specification, the request will fail.
|
||||
!
|
||||
! Standard values:
|
||||
! ================
|
||||
! _DtLcx defines the order of the standard values in the
|
||||
! translations it utilizes. All translation specifications
|
||||
! must adhere to this order.
|
||||
! <std lang_terr>.<std codeset>.<std modifier>
|
||||
! In CDE 1.0, no modifiers are standardized and that
|
||||
! portion of the table is unspecified. This means
|
||||
! that no CDE standard modifiers are available across
|
||||
! platforms. Operations that use only the <std codeset>
|
||||
! should specify the wildcard character ("?") for the
|
||||
! <std lang_terr> value.
|
||||
!
|
||||
! Operation-specific value:
|
||||
! =========================
|
||||
! The operation-specific value is a string that is used
|
||||
! according to the kind of translation. The syntax is
|
||||
! : <op-string>
|
||||
! or : "<op-string>", if it contains white space
|
||||
!
|
||||
! Filling in the table of translations:
|
||||
! =====================================
|
||||
! The person preparing the translation table should know
|
||||
! the minimum version of the target platform that is
|
||||
! be supported. For example, assume that we must
|
||||
! complete the table for all versions 9.00 and higher.
|
||||
!
|
||||
! The objective is then to provide two sets of translations:
|
||||
! a full set of translations from CDE standard locales to
|
||||
! valid platform locales, and a full set of translations
|
||||
! from valid platform locales to some or all CDE standard
|
||||
! locales.
|
||||
!
|
||||
! Translations from CDE standard locales to valid platform
|
||||
! locales must use the .~. .=. or .>. mappings. When there
|
||||
! is a 1:1 mapping between a CDE locale and a platform locale,
|
||||
! use the .~. or .=. mapping. See the comment below to
|
||||
! decide which to use. When there is no 1:1 mapping between
|
||||
! CDE locale and platform locale, use the .>. mapping. This
|
||||
! provides a valid translation from the CDE locale to the
|
||||
! best-suitable platform locale, but never translates from
|
||||
! that platform locale to the CDE locale.
|
||||
!
|
||||
! Translations from every platform locale to the appropriate
|
||||
! CDE locale must use the .~. .=. or .<. mappings.
|
||||
! When there is a 1:1 mapping between a platform locale and
|
||||
! a CDE standard locale, use the .~. or .=. mapping. See the
|
||||
! comment below to decide which to use. If there is a 1:1
|
||||
! mapping, but the platform locale pattern uses a regular
|
||||
! expression, or if more than one platform locale can
|
||||
! be translated to one CDE standard locale, the .<. mapping must
|
||||
! be used.
|
||||
!
|
||||
! If no appropriate CDE standard locale can be found, you have
|
||||
! identified the need for a new CDE standard locale. Refer to
|
||||
! the instructions at the head of this file for how to go about
|
||||
! registering a new CDE standard locale. You should not create
|
||||
! a new "standard" locale (the left hand side of the translation
|
||||
! specification) without registering it with CDE, because this
|
||||
! will hinder the free exchange of information across locales
|
||||
! and platforms.
|
||||
!
|
||||
! The .=. and .~. mappings are similar. The difference is
|
||||
! that the .=. mapping requires an exact string match between
|
||||
! the platform locale and the string provided to the
|
||||
! translation routine. Generally speaking, this mapping
|
||||
! is risky unless exact matchings can be guaranteed in
|
||||
! all DtLcx clients for the particular operation in question.
|
||||
! The .~. mapping is to be preferred, but the .=. translation
|
||||
! is useful in limited situations, where similar strings may
|
||||
! occur.
|
||||
!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
! uncomment this resource to debug/test the translation db
|
||||
!*debugDtXlate: True
|
||||
|
||||
!!!!!!!!!!!!!!!! HP Version Identificaton !!!!!!!!!!!!!!!!!
|
||||
! These translations are used by the _DtXlateGetXlateEnv()
|
||||
! call to determine the version number to use.
|
||||
!
|
||||
! To understand the translation, realize that the
|
||||
! operation-specific regexp(5) pattern on the right
|
||||
! hand side is matched against the strings returned
|
||||
! by uname(2). The best match determines the "normalized"
|
||||
! version number of the platform, which should range from
|
||||
! 001 and up. By convention, major release numbers
|
||||
! map to centuries and minor release numbers to within
|
||||
! the century.
|
||||
!
|
||||
! To determine the string that the regular expression on the
|
||||
! right hand side is matching against, use uname(1) and run
|
||||
! 'uname -r' and 'uname -v' and note the strings. During execution,
|
||||
! the strings returned by this command are retrieved and
|
||||
! concatenated "rv"--in that order, no extra spaces.
|
||||
! This is the string that the pattern must match.
|
||||
!
|
||||
! Sometimes this string may not be intuitive. For example,
|
||||
! note that AIX 3.2 returns 2 for 'uname -r' and 3 for 'uname -v'.
|
||||
! So the pattern string must be 23, not 32. Do not go by
|
||||
! the order of 'uname -rv' or 'uname -vr', as that is not used.
|
||||
!!!
|
||||
HP-UX.?.version.<.1000: "[A-Z]\\.10\\.00" !! any HPUX 10.00 version
|
||||
HP-UX.?.version.<.1001: "[A-Z]\\.10\\..*" !! any HPUX 10.x version
|
||||
HP-UX.?.version.<.900: "[A-Z]\\.09\\..*" !! any HPUX 9.x version
|
||||
HP-UX.?.version.<.903: "[A-Z]\\.09\\.0[3-9].*" !! any HPUX 9.03-9.09 version
|
||||
HP-UX.?.version.<.910: "[A-Z]\\.09\\.[1-9].*" !! any HPUX 9.1+ version
|
||||
HP-UX.?.version.<.800: "[A-Z]\\.08\\..*" !! any HPUX 8.x version
|
||||
|
||||
|
||||
!!!!!!!!!!!!!!!! HP-specific setlocale translations !!!!!!!!!!!!!!!!!!!
|
||||
! These translations are for the string returned by the
|
||||
! getlocale() or setlocale(LC_xxx,NULL) operations, but not
|
||||
! setlocale(LC_ALL,NULL) operation.
|
||||
!
|
||||
! It provides translations from HP operation-specific
|
||||
! to CDE standard strings and back again.
|
||||
!
|
||||
! Some language,territory combinations have the following comments:
|
||||
! (1) These ISO territory names may be subject to change
|
||||
! However, their CDE names will continue to be supported
|
||||
! (2) No ISO "territory" name exists for the Arabic-speaking regions of the
|
||||
! world as a whole. Vendors have sometimes supplied their own.
|
||||
! Those names, when conformant to the ISO model, will be adopted for CDE.
|
||||
!
|
||||
!Platform Operation Lang_Terr Op-Value Language,Territory Who has
|
||||
!--- --------- ----- -------- ------------------ -------
|
||||
! Version Kind Codeset
|
||||
! ---- - ---------
|
||||
|
||||
! setlocales Compliance
|
||||
HP-UX.700+.setlocale.~.C.HP-ROMAN8: C ! setlocales compliance ,IBM, HP, Sun , USL
|
||||
HP-UX.700+.setlocale.<.C.HP-ROMAN8: C.roman8 ! setlocales compliance ,IBM, HP, Sun , USL
|
||||
HP-UX.700+.setlocale.~.C.ISO-8859-1: C.iso88591 ! setlocales compliance ,IBM, HP, Sun , USL
|
||||
HP-UX.700+.setlocale.~.POSIX.HP-ROMAN8: POSIX ! setlocales compliance ,IBM, HP, Sun , USL
|
||||
HP-UX.700+.setlocale.<.POSIX.HP-ROMAN8: POSIX.roman8 ! setlocales compliance ,IBM, HP, Sun , USL
|
||||
HP-UX.700+.setlocale.~.POSIX.ISO-8859-1: POSIX.iso88591 ! setlocales compliance ,IBM, HP, Sun , USL
|
||||
|
||||
! W European/Americas, Latin 1 codeset
|
||||
HP-UX.700+.setlocale.~.da_DK.ISO-8859-1: danish.iso88591 ! Danish, Denmark XoJIG,IBM, HP, , USL ("da")
|
||||
HP-UX.700+.setlocale.>.de_AT.ISO-8859-1: german.iso88591 ! German,Austria XoJIG, , , , USL
|
||||
HP-UX.700+.setlocale.>.de_CH.ISO-8859-1: german.iso88591 ! German,Switzerland XoJIG,IBM, , , USL
|
||||
HP-UX.700+.setlocale.~.de_DE.ISO-8859-1: german.iso88591 ! German, Germany XoJIG,IBM, HP, Sun ("de"), USL ("de")
|
||||
HP-UX.700+.setlocale.>.en_AU.ISO-8859-1: english.iso88591 ! English,Australia , , , , USL
|
||||
HP-UX.700+.setlocale.>.en_CA.ISO-8859-1: english.iso88591 ! English,Canada XoJIG, , , , USL
|
||||
HP-UX.700+.setlocale.>.en_DK.ISO-8859-1: english.iso88591 ! English, Denmark XoJIG, , , , USL
|
||||
HP-UX.700+.setlocale.>.en_GB.ISO-8859-1: english.iso88591 ! English, U.K. XoJIG,IBM, HP, , USL ("en")
|
||||
HP-UX.700+.setlocale.>.en_JP.ISO-8859-1: english.iso88591 ! English, Japan XoJIG,IBM, , ,
|
||||
HP-UX.700+.setlocale.>.en_IE.ISO-8859-1: english.iso88591 ! English, Ireland XoJIG, , , , USL
|
||||
HP-UX.700+.setlocale.>.en_KR.ISO-8859-1: english.iso88591 ! English,Korea , , , ,
|
||||
HP-UX.700+.setlocale.>.en_MY.ISO-8859-1: english.iso88591 ! English,Malaysia , , , , USL
|
||||
HP-UX.700+.setlocale.>.en_NZ.ISO-8859-1: english.iso88591 ! English,New Zealand , , , , USL
|
||||
HP-UX.700+.setlocale.>.en_TW.ISO-8859-1: english.iso88591 ! English,Taiwan , , , ,
|
||||
HP-UX.700+.setlocale.~.en_US.ISO-8859-1: english.iso88591 ! English, USA XoJIG,IBM, HP, Sun , USL
|
||||
HP-UX.700+.setlocale.>.es_AR.ISO-8859-1: spanish.iso88591 ! Spanish, Argentina , , , Sun , USL
|
||||
HP-UX.700+.setlocale.>.es_BO.ISO-8859-1: spanish.iso88591 ! Spanish, Bolivia , , , Sun
|
||||
HP-UX.700+.setlocale.>.es_CL.ISO-8859-1: spanish.iso88591 ! Spanish, Chile , , , Sun , USL
|
||||
HP-UX.700+.setlocale.>.es_CO.ISO-8859-1: spanish.iso88591 ! Spanish, Columbia , , , Sun
|
||||
HP-UX.700+.setlocale.>.es_CR.ISO-8859-1: spanish.iso88591 ! Spanish, Costa Rica , , , Sun
|
||||
HP-UX.700+.setlocale.>.es_EC.ISO-8859-1: spanish.iso88591 ! Spanish, Ecuador , , , Sun
|
||||
HP-UX.700+.setlocale.~.es_ES.ISO-8859-1: spanish.iso88591 ! Spanish, Spain XoJIG,IBM, HP, Sun , USL
|
||||
HP-UX.700+.setlocale.>.es_GT.ISO-8859-1: spanish.iso88591 ! Spanish, Guatemala , , , Sun
|
||||
HP-UX.700+.setlocale.>.es_MX.ISO-8859-1: spanish.iso88591 ! Spanish, Mexico , , , Sun , USL
|
||||
HP-UX.700+.setlocale.>.es_PE.ISO-8859-1: spanish.iso88591 ! Spanish, Peru , , , Sun
|
||||
HP-UX.700+.setlocale.>.es_UY.ISO-8859-1: spanish.iso88591 ! Spanish, Uruguay , , , Sun
|
||||
HP-UX.700+.setlocale.>.es_VE.ISO-8859-1: spanish.iso88591 ! Spanish, Venezuela , , , Sun , USL
|
||||
! HP-UX.700+.setlocale.>.et_EE.ISO-8859-1: ! Estonian, Estonia XoJIG,
|
||||
HP-UX.700+.setlocale.~.fi_FI.ISO-8859-1: finnish.iso88591 ! Finnish, Finland XoJIG,IBM, HP, , USL ("fi")
|
||||
! HP-UX.700+.setlocale.>.fo_FO.ISO-8859-1: ! Faroese, Faeroe Island XoJIG,
|
||||
HP-UX.700+.setlocale.>.fr_BE.ISO-8859-1: french.iso88591 ! French,Belgium XoJIG, , , , USL
|
||||
HP-UX.700+.setlocale.~.fr_CA.ISO-8859-1: c-french.iso88591 ! French, Canada XoJIG,IBM, HP, , USL
|
||||
HP-UX.700+.setlocale.>.fr_CH.ISO-8859-1: french.iso88591 ! French, Switzerland XoJIG,IBM, , , USL
|
||||
HP-UX.700+.setlocale.~.fr_FR.ISO-8859-1: french.iso88591 ! French, France XoJIG,IBM, HP, Sun ("fr"), USL ("fr")
|
||||
HP-UX.700+.setlocale.~.is_IS.ISO-8859-1: icelandic.iso88591 ! Icelandic, Iceland XoJIG,IBM, HP, , USL ("is")
|
||||
HP-UX.700+.setlocale.>.it_CH.ISO-8859-1: italian.iso88591 ! Italian,Switzerland , , , , USL
|
||||
HP-UX.700+.setlocale.~.it_IT.ISO-8859-1: italian.iso88591 ! Italian, Italy XoJIG,IBM, HP, Sun ("it"), USL ("it")
|
||||
! HP-UX.700+.setlocale.>.kl_GL.ISO-8859-1: ! Greenlandic, Greenland XoJIG,
|
||||
! HP-UX.700+.setlocale.>.lt_LT.ISO-8859-1: ! Lithuanian, Lithuania XoJIG,
|
||||
! HP-UX.700+.setlocale.>.lv_LV.ISO-8859-1: ! Latvian, Latvia XoJIG,
|
||||
HP-UX.700+.setlocale.>.nl_BE.ISO-8859-1: dutch.iso88591 ! Dutch, Belgium XoJIG,IBM, , , USL
|
||||
HP-UX.700+.setlocale.~.nl_NL.ISO-8859-1: dutch.iso88591 ! Dutch, The Netherlands XoJIG,IBM, HP, , USL ("nl")
|
||||
HP-UX.700+.setlocale.~.no_NO.ISO-8859-1: norwegian.iso88591 ! Norwegian, Norway XoJIG,IBM, HP, , USL ("no")
|
||||
HP-UX.700+.setlocale.>.pt_BR.ISO-8859-1: portuguese.iso88591 ! Portuguese,Brazil , , , , USL
|
||||
HP-UX.700+.setlocale.~.pt_PT.ISO-8859-1: portuguese.iso88591 ! Portuguese, Portugal XoJIG,IBM, HP, , USL
|
||||
HP-UX.700+.setlocale.>.sv_FI.ISO-8859-1: swedish.iso88591 ! Swedish, Finland XoJIG,
|
||||
HP-UX.700+.setlocale.~.sv_SE.ISO-8859-1: swedish.iso88591 ! Swedish, Sweden XoJIG,IBM, HP, Sun ("sv"), USL ("sv")
|
||||
|
||||
! W European/Americas, HP-ROMAN8 codeset
|
||||
HP-UX.700+.setlocale.~.da_DK.HP-ROMAN8: danish ! Danish, Denmark , , HP
|
||||
HP-UX.700+.setlocale.~.de_DE.HP-ROMAN8: german ! German, Germany , , HP
|
||||
HP-UX.700+.setlocale.>.en_GB.HP-ROMAN8: english ! English, U.K. , , HP
|
||||
HP-UX.700+.setlocale.~.en_US.HP-ROMAN8: english ! English, USA , , HP
|
||||
HP-UX.700+.setlocale.~.es_ES.HP-ROMAN8: spanish ! Spanish, Spain , , HP
|
||||
HP-UX.700+.setlocale.~.fi_FI.HP-ROMAN8: finnish ! Finnish, Finland , , HP
|
||||
HP-UX.700+.setlocale.~.fr_CA.HP-ROMAN8: c-french ! French, Canada , , HP
|
||||
HP-UX.700+.setlocale.~.fr_FR.HP-ROMAN8: french ! French, France , , HP
|
||||
HP-UX.700+.setlocale.~.is_IS.HP-ROMAN8: icelandic ! Icelandic, Iceland , , HP
|
||||
HP-UX.700+.setlocale.~.it_IT.HP-ROMAN8: italian ! Italian, Italy , , HP
|
||||
HP-UX.700+.setlocale.~.nl_NL.HP-ROMAN8: dutch ! Dutch, The Netherlands , , HP
|
||||
HP-UX.700+.setlocale.~.no_NO.HP-ROMAN8: norwegian ! Norwegian, Norway , , HP
|
||||
HP-UX.700+.setlocale.~.pt_PT.HP-ROMAN8: portuguese ! Portuguese, Portugal , , HP
|
||||
HP-UX.700+.setlocale.~.sv_SE.HP-ROMAN8: swedish ! Swedish, Sweden , , HP
|
||||
|
||||
! E European
|
||||
HP-UX.700+.setlocale.~.cs_CS.ISO-8859-2: czech ! Czech(1) ,IBM, HP
|
||||
! HP-UX.700+.setlocale.>.hr_HR.ISO-8859-2: ! Croatian, Croatia ,IBM
|
||||
HP-UX.700+.setlocale.~.hu_HU.ISO-8859-2: hungarian ! Hungarian, Hungry XoJIG,IBM, HP
|
||||
HP-UX.700+.setlocale.~.pl_PL.ISO-8859-2: polish ! Polish, Poland XoJIG,IBM, HP
|
||||
HP-UX.700+.setlocale.~.ro_RO.ISO-8859-2: rumanian ! Rumanian, Romania XoJIG,IBM, HP
|
||||
HP-UX.700+.setlocale.~.sh_YU.ISO-8859-2: serbocroatian ! Serbocroatian, Yugoslavia(1) ,IBM, HP
|
||||
HP-UX.700+.setlocale.~.sl_CS.ISO-8859-2: slovene ! Slovenian ,IBM, HP
|
||||
HP-UX.700+.setlocale.>.si_SI.ISO-8859-2: slovene ! Slovenian ,IBM, HP
|
||||
! HP-UX.700+.setlocale.>.sk_SK.ISO-8859-2: ! Slovak ,IBM
|
||||
|
||||
! Cyrillic
|
||||
HP-UX.700+.setlocale.~.bg_BG.ISO-8859-5: bulgarian ! Bulgarian, Bulgaria ,IBM, HP
|
||||
! HP-UX.700+.setlocale.>.mk_MK.ISO-8859-5: ! Macedonian ,IBM
|
||||
HP-UX.700+.setlocale.~.ru_RU.ISO-8859-5: russian ! Russian(1) ,IBM, HP
|
||||
HP-UX.700+.setlocale.>.ru_SU.ISO-8859-5: russian ! Russian(1) ,IBM, HP
|
||||
! HP-UX.700+.setlocale.>.sp_YU.ISO-8859-5: ! Serbian,Yugoslavia(1) ,IBM
|
||||
|
||||
! Arabic
|
||||
HP-UX.700+.setlocale.~.ar_DZ.ISO-8859-6: arabic.iso88596 ! Arabic(2) ,IBM, HP
|
||||
HP-UX.700+.setlocale.~.ar_DZ.HP-ARABIC8: arabic-w ! Arabic(2) , , HP
|
||||
HP-UX.700+.setlocale.~.ar_SA.ISO-8859-6: arabic.iso88596 ! Arabic(2) ,IBM, HP
|
||||
HP-UX.700+.setlocale.~.ar_SA.HP-ARABIC8: arabic ! Arabic(2) , , HP
|
||||
|
||||
! Hebrew
|
||||
HP-UX.700+.setlocale.~.iw_IL.ISO-8859-8: hebrew.iso88598 ! Hebrew, Israel ,IBM, HP
|
||||
HP-UX.700+.setlocale.~.iw_IL.HP-HEBREW8: hebrew ! Hebrew, Israel , , HP
|
||||
|
||||
! Greek
|
||||
HP-UX.700+.setlocale.~.el_GR.ISO-8859-7: greek.iso88597 ! Greek, Greece ,IBM, HP
|
||||
HP-UX.700+.setlocale.~.el_GR.HP-GREEK8: greek ! Greek, Greece , , HP
|
||||
|
||||
! Turkish
|
||||
HP-UX.700+.setlocale.~.tr_TR.ISO-8859-9: turkish.iso88599 ! Turkish, Turkey ,IBM, HP
|
||||
HP-UX.700+.setlocale.~.tr_TR.HP-TURKISH8: turkish ! Turkish, Turkey , , HP
|
||||
|
||||
! East Asia
|
||||
HP-UX.700+.setlocale.~.ja_JP.EUC-JP: japanese.euc ! Japanese, Japan ,IBM, HP, Sun ("ja"), USL
|
||||
HP-UX.700+.setlocale.~.ja_JP.HP-SJIS: japanese ! Japanese, Japan aka japanese 15 , , HP,
|
||||
HP-UX.700+.setlocale.>.ja_JP.IBM-932: japanese ! Japanese, Japan ,IBM, HP, Sun ("ja"), USL
|
||||
HP-UX.700+.setlocale.~.ja_JP.HP-KANA8: katakana ! Japanese, Japan , , HP, ,
|
||||
HP-UX.700+.setlocale.<.ja_JP.EUC-JP: ujis ! Japanese, Japan , , HP,
|
||||
HP-UX.700+.setlocale.~.ko_KR.EUC-KR: korean ! Korean, Korea ,IBM, HP, Sun ("ko"), USL
|
||||
HP-UX.700+.setlocale.>.zh_CN.EUC-CN: chinese-s ! Chinese, China ,IBM, , Sun ("zh"), USL
|
||||
HP-UX.700+.setlocale.~.zh_CN.HP-15CN: chinese-s ! Chinese, China , , HP
|
||||
HP-UX.700+.setlocale.~.zh_TW.EUC-TW: zh_TW.eucTW ! Chinese, Taiwan ,IBM, HP, Sun , USL
|
||||
HP-UX.700+.setlocale.~.zh_TW.HP-BIG5: chinese-t.big5 ! Chinese, Taiwan , , HP, ,
|
||||
HP-UX.700+.setlocale.~.zh_TW.HP-CCDC: chinese-t ! Chinese, Taiwan , , HP, ,
|
||||
|
||||
! Thai
|
||||
HP-UX.700+.setlocale.~.th_TH.TIS-620: thai ! Thai, Thailand ,IBM, HP
|
||||
|
||||
! setlocales Compliance; default codeset on 10.01 systems
|
||||
HP-UX.1000+.setlocale.~.C.ISO-8859-1: C ! setlocales compliance ,IBM, HP, Sun , USL
|
||||
HP-UX.1000+.setlocale.~.POSIX.ISO-8859-1: POSIX ! setlocales compliance ,IBM, HP, Sun , USL
|
||||
|
||||
! W European/Americas, Latin 1 codeset
|
||||
HP-UX.1000+.setlocale.>.de_AT.ISO-8859-1: de_DE.iso88591 ! German,Austria XoJIG, , , , USL
|
||||
HP-UX.1000+.setlocale.>.de_CH.ISO-8859-1: de_DE.iso88591 ! German,Switzerland XoJIG,IBM, , , USL
|
||||
HP-UX.1000+.setlocale.~.de_DE.ISO-8859-1: de_DE.iso88591 ! German, Germany XoJIG,IBM, HP, Sun ("de"), USL ("de")
|
||||
HP-UX.1000+.setlocale.>.en_AU.ISO-8859-1: en_GB.iso88591 ! English,Australia , , , , USL
|
||||
HP-UX.1000+.setlocale.>.en_CA.ISO-8859-1: en_US.iso88591 ! English,Canada XoJIG, , , , USL
|
||||
HP-UX.1000+.setlocale.>.en_DK.ISO-8859-1: en_GB.iso88591 ! English, Denmark XoJIG, , , , USL
|
||||
HP-UX.1000+.setlocale.>.en_GB.ISO-8859-1: en_GB.iso88591 ! English, U.K. XoJIG,IBM, HP, , USL ("en")
|
||||
HP-UX.1000+.setlocale.>.en_JP.ISO-8859-1: en_GB.iso88591 ! English, Japan XoJIG,IBM, , ,
|
||||
HP-UX.1000+.setlocale.>.en_IE.ISO-8859-1: en_GB.iso88591 ! English, Ireland XoJIG, , , , USL
|
||||
HP-UX.1000+.setlocale.>.en_MY.ISO-8859-1: en_US.iso88591 ! English,Malaysia , , , , USL
|
||||
HP-UX.1000+.setlocale.>.en_NZ.ISO-8859-1: en_GB.iso88591 ! English,New Zealand , , , , USL
|
||||
HP-UX.1000+.setlocale.~.en_US.ISO-8859-1: en_US.iso88591 ! English, USA XoJIG,IBM, HP, Sun , USL
|
||||
HP-UX.1000+.setlocale.>.es_AR.ISO-8859-1: es_ES.iso88591 ! Spanish, Argentina , , , Sun , USL
|
||||
HP-UX.1000+.setlocale.>.es_BO.ISO-8859-1: es_ES.iso88591 ! Spanish, Bolivia , , , Sun
|
||||
HP-UX.1000+.setlocale.>.es_CL.ISO-8859-1: es_ES.iso88591 ! Spanish, Chile , , , Sun , USL
|
||||
HP-UX.1000+.setlocale.>.es_CO.ISO-8859-1: es_ES.iso88591 ! Spanish, Columbia , , , Sun
|
||||
HP-UX.1000+.setlocale.>.es_CR.ISO-8859-1: es_ES.iso88591 ! Spanish, Costa Rica , , , Sun
|
||||
HP-UX.1000+.setlocale.>.es_EC.ISO-8859-1: es_ES.iso88591 ! Spanish, Ecuador , , , Sun
|
||||
HP-UX.1000+.setlocale.~.es_ES.ISO-8859-1: es_ES.iso88591 ! Spanish, Spain XoJIG,IBM, HP, Sun , USL
|
||||
HP-UX.1000+.setlocale.>.es_GT.ISO-8859-1: es_ES.iso88591 ! Spanish, Guatemala , , , Sun
|
||||
HP-UX.1000+.setlocale.>.es_MX.ISO-8859-1: es_ES.iso88591 ! Spanish, Mexico , , , Sun , USL
|
||||
HP-UX.1000+.setlocale.>.es_PE.ISO-8859-1: es_ES.iso88591 ! Spanish, Peru , , , Sun
|
||||
HP-UX.1000+.setlocale.>.es_UY.ISO-8859-1: es_ES.iso88591 ! Spanish, Uruguay , , , Sun
|
||||
HP-UX.1000+.setlocale.>.es_VE.ISO-8859-1: es_ES.iso88591 ! Spanish, Venezuela , , , Sun , USL
|
||||
! HP-UX.1000+.setlocale.>.et_EE.ISO-8859-1: ! Estonian, Estonia XoJIG,
|
||||
HP-UX.1000+.setlocale.~.fi_FI.ISO-8859-1: fi_FI.iso88591 ! Finnish, Finland XoJIG,IBM, HP, , USL ("fi")
|
||||
! HP-UX.1000+.setlocale.>.fo_FO.ISO-8859-1: ! Faroese, Faeroe Island XoJIG,
|
||||
HP-UX.1000+.setlocale.>.fr_BE.ISO-8859-1: fr_FR.iso88591 ! French,Belgium XoJIG, , , , USL
|
||||
HP-UX.1000+.setlocale.~.fr_CA.ISO-8859-1: fr_CA.iso88591 ! French, Canada XoJIG,IBM, HP, , USL
|
||||
HP-UX.1000+.setlocale.>.fr_CH.ISO-8859-1: fr_FR.iso88591 ! French, Switzerland XoJIG,IBM, , , USL
|
||||
HP-UX.1000+.setlocale.~.fr_FR.ISO-8859-1: fr_FR.iso88591 ! French, France XoJIG,IBM, HP, Sun ("fr"), USL ("fr")
|
||||
HP-UX.1000+.setlocale.~.is_IS.ISO-8859-1: is_IS.iso88591 ! Icelandic, Iceland XoJIG,IBM, HP, , USL ("is")
|
||||
HP-UX.1000+.setlocale.>.it_CH.ISO-8859-1: it_IT.iso88591 ! Italian,Switzerland , , , , USL
|
||||
HP-UX.1000+.setlocale.~.it_IT.ISO-8859-1: it_IT.iso88591 ! Italian, Italy XoJIG,IBM, HP, Sun ("it"), USL ("it")
|
||||
! HP-UX.1000+.setlocale.>.kl_GL.ISO-8859-1: ! Greenlandic, Greenland XoJIG,
|
||||
! HP-UX.1000+.setlocale.>.lt_LT.ISO-8859-1: ! Lithuanian, Lithuania XoJIG,
|
||||
! HP-UX.1000+.setlocale.>.lv_LV.ISO-8859-1: ! Latvian, Latvia XoJIG,
|
||||
HP-UX.1000+.setlocale.>.nl_BE.ISO-8859-1: nl_NL.iso88591 ! Dutch, Belgium XoJIG,IBM, , , USL
|
||||
HP-UX.1000+.setlocale.~.nl_NL.ISO-8859-1: nl_NL.iso88591 ! Dutch, The Netherlands XoJIG,IBM, HP, , USL ("nl")
|
||||
HP-UX.1000+.setlocale.~.no_NO.ISO-8859-1: no_NO.iso88591 ! Norwegian, Norway XoJIG,IBM, HP, , USL ("no")
|
||||
HP-UX.1000+.setlocale.>.pt_BR.ISO-8859-1: pt_PT.iso88591 ! Portuguese,Brazil , , , , USL
|
||||
HP-UX.1000+.setlocale.~.pt_PT.ISO-8859-1: pt_PT.iso88591 ! Portuguese, Portugal XoJIG,IBM, HP, , USL
|
||||
HP-UX.1000+.setlocale.>.sv_FI.ISO-8859-1: sv_SE.iso88591 ! Swedish, Finland XoJIG,
|
||||
HP-UX.1000+.setlocale.~.sv_SE.ISO-8859-1: sv_SE.iso88591 ! Swedish, Sweden XoJIG,IBM, HP, Sun ("sv"), USL ("sv")
|
||||
|
||||
! W European/Americas, HP-ROMAN8 codeset
|
||||
HP-UX.1000+.setlocale.~.da_DK.HP-ROMAN8: da_DK.roman8 ! Danish, Denmark , , HP
|
||||
HP-UX.1000+.setlocale.~.de_DE.HP-ROMAN8: de_DE.roman8 ! German, Germany , , HP
|
||||
HP-UX.1000+.setlocale.~.en_GB.HP-ROMAN8: en_GB.roman8 ! English, U.K. , , HP
|
||||
HP-UX.1000+.setlocale.~.en_US.HP-ROMAN8: en_US.roman8 ! English, USA , , HP
|
||||
HP-UX.1000+.setlocale.~.es_ES.HP-ROMAN8: es_ES.roman8 ! Spanish, Spain , , HP
|
||||
HP-UX.1000+.setlocale.~.fi_FI.HP-ROMAN8: fi_FI.roman8 ! Finnish, Finland , , HP
|
||||
HP-UX.1000+.setlocale.~.fr_CA.HP-ROMAN8: fr_CA.roman8 ! French, Canada , , HP
|
||||
HP-UX.1000+.setlocale.~.fr_FR.HP-ROMAN8: fr_FR.roman8 ! French, France , , HP
|
||||
HP-UX.1000+.setlocale.~.is_IS.HP-ROMAN8: is_IS.roman8 ! Icelandic, Iceland , , HP
|
||||
HP-UX.1000+.setlocale.~.it_IT.HP-ROMAN8: it_IT.roman8 ! Italian, Italy , , HP
|
||||
HP-UX.1000+.setlocale.~.nl_NL.HP-ROMAN8: nl_NL.roman8 ! Dutch, The Netherlands , , HP
|
||||
HP-UX.1000+.setlocale.~.no_NO.HP-ROMAN8: no_NO.roman8 ! Norwegian, Norway , , HP
|
||||
HP-UX.1000+.setlocale.~.pt_PT.HP-ROMAN8: pt_PT.roman8 ! Portuguese, Portugal , , HP
|
||||
HP-UX.1000+.setlocale.~.sv_SE.HP-ROMAN8: sv_SE.roman8 ! Swedish, Sweden , , HP
|
||||
|
||||
! E European
|
||||
HP-UX.1000+.setlocale.~.cs_CS.ISO-8859-2: cs_CS.iso88592 ! Czech(1) ,IBM, HP
|
||||
! HP-UX.1000+.setlocale.>.hr_HR.ISO-8859-2: ! Croatian, Croatia ,IBM
|
||||
HP-UX.1000+.setlocale.~.hu_HU.ISO-8859-2: hu_HU.iso88592 ! Hungarian, Hungry XoJIG,IBM, HP
|
||||
HP-UX.1000+.setlocale.~.pl_PL.ISO-8859-2: pl_PL.iso88592 ! Polish, Poland XoJIG,IBM, HP
|
||||
HP-UX.1000+.setlocale.~.ro_RO.ISO-8859-2: ro_RO.iso88592 ! Rumanian, Romania XoJIG,IBM, HP
|
||||
HP-UX.1000+.setlocale.~.sh_YU.ISO-8859-2: sh_YU.iso88592 ! Serbocroatian, Yugoslavia(1) ,IBM, HP
|
||||
HP-UX.1000+.setlocale.~.sl_CS.ISO-8859-2: sl_CS.iso88592 ! Slovenian ,IBM, HP
|
||||
! HP-UX.1000+.setlocale.>.si_SI.ISO-8859-2: ! Slovenian ,IBM, HP
|
||||
! HP-UX.1000+.setlocale.>.sk_SK.ISO-8859-2: ! Slovak ,IBM
|
||||
|
||||
! Cyrillic
|
||||
HP-UX.1000+.setlocale.~.bg_BG.ISO-8859-5: bg_BG.iso88595 ! Bulgarian, Bulgaria ,IBM, HP
|
||||
! HP-UX.1000+.setlocale.>.mk_MK.ISO-8859-5: ! Macedonian ,IBM
|
||||
HP-UX.1000+.setlocale.>.ru_RU.ISO-8859-5: ru_SU.iso88595 ! Russian(1) ,IBM, HP
|
||||
HP-UX.1000+.setlocale.~.ru_SU.ISO-8859-5: ru_SU.iso88595 ! Russian(1) ,IBM, HP
|
||||
! HP-UX.1000+.setlocale.>.sp_YU.ISO-8859-5: ! Serbian,Yugoslavia(1) ,IBM
|
||||
|
||||
! Arabic
|
||||
HP-UX.1000+.setlocale.>.ar_DZ.ISO-8859-6: ar_SA.iso88596 ! Arabic(2) ,IBM, HP
|
||||
HP-UX.1000+.setlocale.~.ar_DZ.HP-ARABIC8: ar_DZ.arabic8 ! Arabic(2) , , HP
|
||||
HP-UX.1000+.setlocale.~.ar_SA.ISO-8859-6: ar_SA.iso88596 ! Arabic(2) ,IBM, HP
|
||||
HP-UX.1000+.setlocale.~.ar_SA.HP-ARABIC8: ar_SA.arabic8 ! Arabic(2) , , HP
|
||||
|
||||
! Hebrew
|
||||
HP-UX.1000+.setlocale.~.iw_IL.ISO-8859-8: iw_IL.iso88598 ! Hebrew, Israel ,IBM, HP
|
||||
HP-UX.1000+.setlocale.~.iw_IL.HP-HEBREW8: iw_IL.hebrew8 ! Hebrew, Israel , , HP
|
||||
|
||||
! Greek
|
||||
HP-UX.1000+.setlocale.~.el_GR.ISO-8859-7: el_GR.iso88597 ! Greek, Greece ,IBM, HP
|
||||
HP-UX.1000+.setlocale.~.el_GR.HP-GREEK8: el_GR.greek8 ! Greek, Greece , , HP
|
||||
|
||||
! Turkish
|
||||
HP-UX.1000+.setlocale.~.tr_TR.ISO-8859-9: tr_TR.iso88599 ! Turkish, Turkey ,IBM, HP
|
||||
HP-UX.1000+.setlocale.~.tr_TR.HP-TURKISH8: tr_TR.turkish8 ! Turkish, Turkey , , HP
|
||||
|
||||
! East Asia
|
||||
HP-UX.1000+.setlocale.~.ja_JP.EUC-JP: ja_JP.eucJP ! Japanese, Japan ,IBM, HP, Sun ("ja"), USL
|
||||
HP-UX.1000+.setlocale.~.ja_JP.HP-SJIS: ja_JP.SJIS ! Japanese, Japan ,IBM, HP, Sun ("ja"), USL
|
||||
HP-UX.1000+.setlocale.>.ja_JP.IBM-932: ja_JP.SJIS ! Japanese, Japan ,IBM, HP, Sun ("ja"), USL
|
||||
HP-UX.1000+.setlocale.~.ja_JP.HP-KANA8: ja_JP.kana8 ! Japanese, Japan , , HP, ,
|
||||
HP-UX.1000+.setlocale.~.ko_KR.EUC-KR: ko_KR.eucKR ! Korean, Korea ,IBM, HP, Sun ("ko"), USL
|
||||
HP-UX.1000+.setlocale.>.zh_CN.EUC-CN: zh_CN.15CN ! Chinese, China ,IBM, HP, Sun ("zh"), USL
|
||||
HP-UX.1000+.setlocale.~.zh_CN.HP-15CN: zh_CN.15CN ! Chinese, China ,IBM, HP, Sun ("zh"), USL
|
||||
HP-UX.1000+.setlocale.~.zh_TW.EUC-TW: zh_TW.eucTW ! Chinese, Taiwan ,IBM, HP, Sun , USL
|
||||
HP-UX.1000+.setlocale.~.zh_TW.HP-BIG5: zh_TW.big5 ! Chinese, Taiwan , , HP, ,
|
||||
HP-UX.1000+.setlocale.~.zh_TW.HP-CCDC: zh_TW.ccdc ! Chinese, Taiwan , , HP, ,
|
||||
|
||||
! Thai
|
||||
HP-UX.1000+.setlocale.~.th_TH.TIS-620: th_TH.tis620 ! Thai, Thailand ,IBM, HP
|
||||
|
||||
|
||||
! codesets supported for iconv(1,3) on HP-UX 7.0 and above
|
||||
HP-UX.700+.iconv1,iconv3.=.?.HP-ROMAN8: roman8
|
||||
HP-UX.700+.iconv1,iconv3.=.?.ISO-8859-1: iso8859_1
|
||||
HP-UX.700+.iconv1,iconv3.=.?.HP-ARABIC8: arabic8
|
||||
HP-UX.700+.iconv1,iconv3.=.?.HP-GREEK8: greek8
|
||||
HP-UX.700+.iconv1,iconv3.=.?.HP-HEBREW8: hebrew8
|
||||
HP-UX.700+.iconv1,iconv3.=.?.HP-TURKISH8: turkish8
|
||||
HP-UX.700+.iconv1,iconv3.=.?.EUC-KR: korean15
|
||||
HP-UX.700+.iconv1,iconv3.=.?.ISO-2022-JP: jis
|
||||
HP-UX.700+.iconv1,iconv3.<.?.HP-SJIS: japanese15
|
||||
HP-UX.700+.iconv1,iconv3.=.?.HP-SJIS: sjis
|
||||
HP-UX.700+.iconv1,iconv3.=.?.HP-KANA8: kana8
|
||||
HP-UX.700+.iconv1,iconv3.=.?.EUC-JP: ujis
|
||||
HP-UX.700+.iconv1,iconv3.=.?.HP-CCDC: roc15
|
||||
|
||||
! codesets supported by iconv(1,3) after HP-UX 10.0
|
||||
HP-UX.1000+.iconv1,iconv3.~.?.HP-BIG5: big5
|
||||
HP-UX.1000+.iconv1,iconv3.~.?.EUC-TW: eucTW
|
||||
HP-UX.1000+.iconv1,iconv3.~.?.TIS-620: tis620
|
||||
HP-UX.1000+.iconv1,iconv3.>.?.EUC-CN: hp15cn
|
||||
HP-UX.1000+.iconv1,iconv3.~.?.HP-15CN: hp15cn
|
||||
HP-UX.1000+.iconv1,iconv3.~.?.EUC-KR: eucKR
|
||||
HP-UX.1000+.iconv1,iconv3.~.?.ISO-8859-2: iso8859_2
|
||||
HP-UX.1000+.iconv1,iconv3.~.?.ISO-8859-5: iso8859_5
|
||||
HP-UX.1000+.iconv1,iconv3.~.?.ISO-8859-6: iso8859_6
|
||||
HP-UX.1000+.iconv1,iconv3.~.?.ISO-8859-7: iso8859_7
|
||||
HP-UX.1000+.iconv1,iconv3.~.?.ISO-8859-8: iso8859_8
|
||||
HP-UX.1000+.iconv1,iconv3.~.?.ISO-8859-9: iso8859_9
|
||||
HP-UX.1000+.iconv1,iconv3.~.?.IBM-437: cp437
|
||||
HP-UX.1000+.iconv1,iconv3.~.?.IBM-850: cp850
|
||||
|
||||
! codesets not supported by iconv(1,3) through 10.0 HP-UX release
|
||||
!HP-UX.?.iconv1,iconv3.=.?.ISO-2022-KR:
|
||||
!HP-UX.?.iconv1,iconv3.=.?.ISO-2022-TW:
|
||||
!HP-UX.?.iconv1,iconv3.=.?.ISO-2022-CN:
|
||||
!HP-UX.?.iconv1,iconv3.~.?.IBM-856:
|
||||
!HP-UX.?.iconv1,iconv3.~.?.IBM-1046:
|
||||
!HP-UX.?.iconv1,iconv3.~.?.UCS-2:
|
||||
!HP-UX.?.iconv1,iconv3.~.?.UTF-8:
|
||||
|
||||
! codesets supported for nl_langinfo on HP-UX 7.0 and above
|
||||
HP-UX.700-999.nl_langinfo(CODESET).=.?.HP-ROMAN8: ROMAN8
|
||||
HP-UX.700-999.nl_langinfo(CODESET).>.?.?: ROMAN8 !!! nl_langinfo is hardwired to ROMAN8 for all codesets
|
||||
HP-UX.1000+.nl_langinfo(CODESET).=.?.HP-ROMAN8: roman8
|
||||
HP-UX.1000+.nl_langinfo(CODESET).=.?.ISO-8859-1: iso8859_1
|
||||
HP-UX.1000+.nl_langinfo(CODESET).=.?.HP-ARABIC8: arabic8
|
||||
HP-UX.1000+.nl_langinfo(CODESET).=.?.HP-GREEK8: greek8
|
||||
HP-UX.1000+.nl_langinfo(CODESET).=.?.HP-HEBREW8: hebrew8
|
||||
HP-UX.1000+.nl_langinfo(CODESET).=.?.HP-TURKISH8: turkish8
|
||||
HP-UX.1000+.nl_langinfo(CODESET).=.?.EUC-KR: korean15 !!! verify std matches op
|
||||
HP-UX.1000+.nl_langinfo(CODESET).<.?.HP-SJIS: japanese15
|
||||
HP-UX.1000+.nl_langinfo(CODESET).=.?.HP-SJIS: sjis
|
||||
HP-UX.1000+.nl_langinfo(CODESET).=.?.HP-KANA8: kana8
|
||||
HP-UX.1000+.nl_langinfo(CODESET).=.?.EUC-JP: ujis
|
||||
HP-UX.1000+.nl_langinfo(CODESET).=.?.HP-CCDC: roc15 !!! verify std matches op
|
||||
|
||||
! 10.0 and above supported iconv(1) codesets
|
||||
!!! collect and verify this
|
||||
|
||||
! multibyte codesets
|
||||
! This translation provides an alternative to a call to
|
||||
! using setlocale() and MB_CUR_MAX to determine this.
|
||||
HP-UX.?.multibyte.=.?.EUC-KR: 2
|
||||
HP-UX.?.multibyte.=.?.HP-SJIS: 2
|
||||
HP-UX.700+.multibyte.=.?.EUC-JP: 2
|
||||
HP-UX.1000+.multibyte.=.?.EUC-JP: 4
|
||||
HP-UX.?.multibyte.=.?.IBM-932: 2
|
||||
HP-UX.?.multibyte.=.?.HP-CCDC: 2
|
||||
HP-UX.?.multibyte.=.?.HP-BIG5: 2
|
||||
HP-UX.?.multibyte.=.?.EUC-TW: 2
|
||||
HP-UX.?.multibyte.=.?.TIS-620: 2
|
||||
HP-UX.?.multibyte.=.?.EUC-CN: 2
|
||||
HP-UX.?.multibyte.=.?.HP-15CN: 2
|
||||
HP-UX.?.multibyte.=.?.EUC-KR: 2
|
||||
HP-UX.?.multibyte.=.?.EUC-TW: 2
|
||||
|
||||
! Translations from predefined CCDF-locales to CDE Standard Locales
|
||||
HP-UX.700+.ccdf.=.?.HP-ROMAN8: hp-roman8
|
||||
HP-UX.700+.ccdf.=.?.ISO-8859-1: iso8859-1
|
||||
HP-UX.700+.ccdf.=.ko_KR.EUC-KR: hp-korean15
|
||||
HP-UX.700+.ccdf.=.ja_JP.HP-SJIS: hp-japanese15
|
||||
HP-UX.700+.ccdf.=.ja_JP.EUC-JP: hp-japaneseeuc
|
||||
HP-UX.700+.ccdf.=.?.DT-SYMBOL-1: symbol !!! this is the Dt symbol font
|
||||
! These CDE standard locales may have CCDF-locales, but they are defined by localizers
|
||||
! HP-UX.700+.ccdf.=.ar_SA.HP-ARABIC8: arabic8
|
||||
! HP-UX.700+.ccdf.=.el_GR.HP-GREEK8: greek8
|
||||
! HP-UX.700+.ccdf.=.iw_IL.HP-HEBREW8: hebrew8
|
||||
! HP-UX.700+.ccdf.=.tr_TR.HP-TURKISH8: turkish8
|
||||
! HP-UX.700+.ccdf.<.ja_JP.HP-SJIS: sjis
|
||||
! HP-UX.700+.ccdf.=.ja_JP.HP-KANA8: kana8
|
||||
! HP-UX.700+.ccdf.=.ja_JP.EUC-JP: ujis
|
||||
! HP-UX.700+.ccdf.=.zh_CN.HP-CCDC: roc15
|
||||
|
||||
|
||||
! Codesets that require multibyte parsing to avoid confusion with shell special chars
|
||||
HP-UX.?.dtkshSpecialParse.=.ja_JP.HP-SJIS: True
|
||||
HP-UX.?.dtkshSpecialParse.=.ja_JP.IBM-932: True
|
||||
HP-UX.?.dtkshSpecialParse.=.zh_TW.HP-BIG5: True
|
||||
HP-UX.?.dtkshSpecialParse.=.zh_TW.HP-CCDC: True
|
||||
HP-UX.?.dtkshSpecialParse.=.zh_TW.EUC-TW: True
|
||||
|
||||
|
||||
!! When content is exchanged with other platforms, the interchange codeset
|
||||
!! may be different that the codeset used locally. In CDE1, these translations
|
||||
!! are used by dtmail, but other clients may use the same translations
|
||||
!! in the future. For example, to improve interoperability of 8-bit mail,
|
||||
!! the mail messages of users working in codesets such as HP-ROMAN8 or IBM-850
|
||||
!! are translated to the interchangeCodeset (in this case, ISO-8859-1) before
|
||||
!! they are sent. Similarly, the mail of Japanese users is translated to JIS
|
||||
!! before it is sent.
|
||||
HP-UX.?.interchangeCodeset.~.?.ISO-8859-1: ISO-8859-1 ! ISO Latin 1
|
||||
HP-UX.?.interchangeCodeset.>.?.HP-ROMAN8: ISO-8859-1 ! HP Roman8
|
||||
!HP-UX.?.interchangeCodeset.>.?.IBM-850: ISO-8859-1 ! PC (Multi-lingual)
|
||||
!HP-UX.?.interchangeCodeset.>.?.IBM-437: ISO-8859-1 ! PC (US)
|
||||
HP-UX.?.interchangeCodeset.~.?.ISO-8859-2: ISO-8859-2 ! ISO Latin 2
|
||||
HP-UX.?.interchangeCodeset.~.?.ISO-8859-5: ISO-8859-5 ! ISO Latin/Cyrillic
|
||||
HP-UX.?.interchangeCodeset.~.?.ISO-8859-6: ISO-8859-6 ! ISO Latin/Arabic
|
||||
HP-UX.?.interchangeCodeset.>.?.HP-ARABIC8: ISO-8859-6 ! HP Arabic8
|
||||
!HP-UX.?.interchangeCodeset.>.?.IBM-1046: ISO-8859-6 ! PC Arabic Code Set
|
||||
HP-UX.?.interchangeCodeset.~.?.ISO-8859-8: ISO-8859-8 ! ISO Latin/Hebrew
|
||||
HP-UX.?.interchangeCodeset.>.?.HP-HEBREW8: ISO-8859-8 ! HP Hebrew8
|
||||
!HP-UX.?.interchangeCodeset.>.?.IBM-856: ISO-8859-8 ! PC Hebrew
|
||||
HP-UX.?.interchangeCodeset.~.?.ISO-8859-7: ISO-8859-7 ! ISO Latin/Greek
|
||||
HP-UX.?.interchangeCodeset.>.?.HP-GREEK8: ISO-8859-7 ! HP Greek8
|
||||
HP-UX.?.interchangeCodeset.~.?.ISO-8859-9: ISO-8859-9 ! ISO Latin 5
|
||||
HP-UX.?.interchangeCodeset.>.?.HP-TURKISH8: ISO-8859-9 ! HP Turkish8
|
||||
HP-UX.?.interchangeCodeset.~.?.EUC-JP: ISO-2022-JP ! Japanese EUC
|
||||
HP-UX.?.interchangeCodeset.>.?.HP-SJIS: ISO-2022-JP ! HP Japanese Shift JIS
|
||||
!HP-UX.?.interchangeCodeset.>.?.IBM-932: ISO-2022-JP ! PC Japanese Shift JIS
|
||||
HP-UX.?.interchangeCodeset.>.?.HP-KANA8: ISO-2022-JP ! HP Japanese Katakana8
|
||||
! comment when ISO-2022-KR iconv available
|
||||
HP-UX.?.interchangeCodeset.~.?.EUC-KR: EUC-KR ! Korean EUC KSC 5601
|
||||
! uncomment when ISO-2022-KR iconv available
|
||||
!HP-UX.?.interchangeCodeset.~.?.EUC-KR: ISO-2022-KR ! Korean EUC KSC 5601
|
||||
! comment when ISO-2022-CN iconv available
|
||||
HP-UX.?.interchangeCodeset.>.?.EUC-CN: EUC-CN ! China Chinese EUC
|
||||
HP-UX.?.interchangeCodeset.~.?.HP-15CN: EUC-CN ! HP Chinese EUC
|
||||
! uncomment when ISO-2022-CN iconv available
|
||||
!HP-UX.?.interchangeCodeset.>.?.EUC-CN: ISO-2022-CN ! China Chinese EUC
|
||||
!HP-UX.?.interchangeCodeset.~.?.HP-15CN: ISO-2022-CN ! HP Chinese EUC
|
||||
! comment when ISO-2022-TW iconv available
|
||||
HP-UX.?.interchangeCodeset.~.?.EUC-TW: EUC-TW ! Taiwan Chinese EUC
|
||||
HP-UX.?.interchangeCodeset.>.?.HP-BIG5: EUC-TW ! HP Big5 Chinese
|
||||
HP-UX.?.interchangeCodeset.>.?.HP-CCDC: EUC-TW ! HP CCDC Chinese
|
||||
! uncomment when ISO-2022-TW iconv available
|
||||
!HP-UX.?.interchangeCodeset.~.?.EUC-TW: ISO-2022-TW ! Taiwan Chinese EUC
|
||||
!HP-UX.?.interchangeCodeset.>.?.HP-BIG5: ISO-2022-TW ! HP Big5 Chinese
|
||||
!HP-UX.?.interchangeCodeset.>.?.HP-CCDC: ISO-2022-TW ! HP CCDC Chinese
|
||||
HP-UX.?.interchangeCodeset.~.?.TIS-620: TIS-620 ! Thai
|
||||
HP-UX.?.interchangeCodeset.>.?.UCS-2: UTF-8 ! multibyte encoding of Unicode
|
||||
HP-UX.?.interchangeCodeset.~.?.UTF-8: UTF-8 ! multibyte encoding of Unicode
|
||||
|
||||
244
cde/lib/DtHelp/Help.h
Normal file
244
cde/lib/DtHelp/Help.h
Normal file
@@ -0,0 +1,244 @@
|
||||
/* $XConsortium: Help.h /main/3 1995/10/26 12:23:24 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_Help_h
|
||||
#define _Dt_Help_h
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
|
||||
/* Common DtHelp Resources */
|
||||
|
||||
#ifndef DtNcloseCallback
|
||||
#define DtNcloseCallback "closeCallback"
|
||||
#endif
|
||||
#ifndef DtNcolumns
|
||||
#define DtNcolumns XmNcolumns
|
||||
#endif
|
||||
#ifndef DtNexecutionPolicy
|
||||
#define DtNexecutionPolicy "executionPolicy"
|
||||
#endif
|
||||
#ifndef DtNhelpFile
|
||||
#define DtNhelpFile "helpFile"
|
||||
#endif
|
||||
#ifndef DtNhelpOnHelpVolume
|
||||
#define DtNhelpOnHelpVolume "helpOnHelpVolume"
|
||||
#endif
|
||||
#ifndef DtNhelpPrint
|
||||
#define DtNhelpPrint "helpPrint"
|
||||
#endif
|
||||
#ifndef DtNhelpType
|
||||
#define DtNhelpType "helpType"
|
||||
#endif
|
||||
#ifndef DtNhelpVolume
|
||||
#define DtNhelpVolume "helpVolume"
|
||||
#endif
|
||||
#ifndef DtNhyperLinkCallback
|
||||
#define DtNhyperLinkCallback "hyperLinkCallback"
|
||||
#endif
|
||||
#ifndef DtNlocationId
|
||||
#define DtNlocationId "locationId"
|
||||
#endif
|
||||
#ifndef DtNmanPage
|
||||
#define DtNmanPage "manPage"
|
||||
#endif
|
||||
#ifndef DtNminimizeButtons
|
||||
#define DtNminimizeButtons XmNminimizeButtons
|
||||
#endif
|
||||
#ifndef DtNpaperSize
|
||||
#define DtNpaperSize "paperSize"
|
||||
#endif
|
||||
#ifndef DtNprinter
|
||||
#define DtNprinter "printer"
|
||||
#endif
|
||||
#ifndef DtNrows
|
||||
#define DtNrows XmNrows
|
||||
#endif
|
||||
#ifndef DtNscrollBarPolicy
|
||||
#define DtNscrollBarPolicy "scrollBarPolicy"
|
||||
#endif
|
||||
#ifndef DtNstringData
|
||||
#define DtNstringData "stringData"
|
||||
#endif
|
||||
|
||||
#ifndef DtCCallback
|
||||
#define DtCCallback XmCCallback
|
||||
#endif
|
||||
|
||||
#ifndef DtCCloseCallback
|
||||
#define DtCCloseCallback "CloseCallback"
|
||||
#endif
|
||||
#ifndef DtCColumns
|
||||
#define DtCColumns XmCColumns
|
||||
#endif
|
||||
#ifndef DtCExecutionPolicy
|
||||
#define DtCExecutionPolicy "ExecutionPolicy"
|
||||
#endif
|
||||
#ifndef DtCHelpFile
|
||||
#define DtCHelpFile "HelpFile"
|
||||
#endif
|
||||
#ifndef DtCHelpOnHelpVolume
|
||||
#define DtCHelpOnHelpVolume "HelpOnHelpVolume"
|
||||
#endif
|
||||
#ifndef DtCHelpPrint
|
||||
#define DtCHelpPrint "HelpPrint"
|
||||
#endif
|
||||
#ifndef DtCHelpType
|
||||
#define DtCHelpType "HelpType"
|
||||
#endif
|
||||
#ifndef DtCHelpVolume
|
||||
#define DtCHelpVolume "HelpVolume"
|
||||
#endif
|
||||
#ifndef DtCHyperLinkCallback
|
||||
#define DtCHyperLinkCallback "HyperLinkCallback"
|
||||
#endif
|
||||
#ifndef DtCLocationId
|
||||
#define DtCLocationId "LocationId"
|
||||
#endif
|
||||
#ifndef DtCManPage
|
||||
#define DtCManPage "ManPage"
|
||||
#endif
|
||||
#ifndef DtCMinimizeButtons
|
||||
#define DtCMinimizeButtons XmCMinimizeButtons
|
||||
#endif
|
||||
#ifndef DtCPaperSize
|
||||
#define DtCPaperSize "PaperSize"
|
||||
#endif
|
||||
#ifndef DtCPrinter
|
||||
#define DtCPrinter "Printer"
|
||||
#endif
|
||||
#ifndef DtCRows
|
||||
#define DtCRows XmCRows
|
||||
#endif
|
||||
#ifndef DtCScrollBarPolicy
|
||||
#define DtCScrollBarPolicy "ScrollBarPolicy"
|
||||
#endif
|
||||
#ifndef DtCStringData
|
||||
#define DtCStringData "StringData"
|
||||
#endif
|
||||
|
||||
/* Representation types */
|
||||
|
||||
#ifndef DtRDtExecutionPolicy
|
||||
#define DtRDtExecutionPolicy "DtExecutionPolicy"
|
||||
#endif
|
||||
#ifndef DtRDtHelpType
|
||||
#define DtRDtHelpType "DtHelpType"
|
||||
#endif
|
||||
#ifndef DtRDtPaperSize
|
||||
#define DtRDtPaperSize "DtPaperSize"
|
||||
#endif
|
||||
#ifndef DtRDtScrollBarPolicy
|
||||
#define DtRDtScrollBarPolicy "DtScrollBarPolicy"
|
||||
#endif
|
||||
|
||||
/* DtHelpDialogCallbackStruct windowHint field */
|
||||
|
||||
#define DtHELP_POPUP_WINDOW 1
|
||||
#define DtHELP_CURRENT_WINDOW 2
|
||||
#define DtHELP_NEW_WINDOW 3
|
||||
|
||||
/* DtHelpDialogCallbackStruct hyperType field */
|
||||
|
||||
#define DtHELP_LINK_JUMP_NEW 1
|
||||
#define DtHELP_LINK_TOPIC 1
|
||||
#define DtHELP_LINK_MAN_PAGE 4
|
||||
#define DtHELP_LINK_APP_DEFINE 5
|
||||
#define DtHELP_LINK_TEXT_FILE 8
|
||||
|
||||
/* DtHelpDialogCallbackStruct reason field */
|
||||
|
||||
#define DtCR_HELP_LINK_ACTIVATE 1
|
||||
#define DtCR_HELP_CLOSE 2
|
||||
#define DtCR_HELP_HELP 3
|
||||
|
||||
/* Possible values for DtNscrollBarPolicy resource */
|
||||
|
||||
#define DtHELP_NO_SCROLLBARS 0
|
||||
#define DtHELP_STATIC_SCROLLBARS 1
|
||||
#define DtHELP_AS_NEEDED_SCROLLBARS 2
|
||||
|
||||
/* Possible values for DtNexecutionPolicy resource */
|
||||
#define DtHELP_EXECUTE_NONE 0
|
||||
#define DtHELP_EXECUTE_QUERY_ALL 1
|
||||
#define DtHELP_EXECUTE_QUERY_UNALIASED 2
|
||||
#define DtHELP_EXECUTE_ALL 3
|
||||
|
||||
/* Possible values for DtNhelpType resource */
|
||||
|
||||
#define DtHELP_TYPE_TOPIC 0
|
||||
#define DtHELP_TYPE_STRING 1
|
||||
#define DtHELP_TYPE_MAN_PAGE 2
|
||||
#define DtHELP_TYPE_FILE 3
|
||||
#define DtHELP_TYPE_DYNAMIC_STRING 4
|
||||
|
||||
/* Possible values for DtNpaperSize resource */
|
||||
|
||||
#define DtHELP_PAPERSIZE_LETTER 0
|
||||
#define DtHELP_PAPERSIZE_LEGAL 1
|
||||
#define DtHELP_PAPERSIZE_EXECUTIVE 2
|
||||
#define DtHELP_PAPERSIZE_A4 3
|
||||
#define DtHELP_PAPERSIZE_B5 4
|
||||
|
||||
/* DtHelpQuickGetChildGetChild() function */
|
||||
|
||||
#define DtHELP_QUICK_CLOSE_BUTTON 1
|
||||
#define DtHELP_QUICK_PRINT_BUTTON 2
|
||||
#define DtHELP_QUICK_HELP_BUTTON 3
|
||||
#define DtHELP_QUICK_SEPARATOR 4
|
||||
#define DtHELP_QUICK_MORE_BUTTON 5
|
||||
#define DtHELP_QUICK_BACK_BUTTON 6
|
||||
|
||||
/* Return values for DtHelpReturnSelectedWidgetId() */
|
||||
|
||||
#define DtHELP_SELECT_ERROR -1
|
||||
#define DtHELP_SELECT_VALID 0
|
||||
#define DtHELP_SELECT_ABORT 1
|
||||
#define DtHELP_SELECT_INVALID 2
|
||||
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
int reason;
|
||||
XEvent *event;
|
||||
char *locationId;
|
||||
char *helpVolume;
|
||||
char *specification;
|
||||
int hyperType;
|
||||
int windowHint;
|
||||
} DtHelpDialogCallbackStruct;
|
||||
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
|
||||
extern void DtHelpSetCatalogName(
|
||||
char *catFile);
|
||||
|
||||
extern int DtHelpReturnSelectedWidgetId(
|
||||
Widget parent,
|
||||
Cursor cursor,
|
||||
Widget *widget);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _Dt_Help_h */
|
||||
325
cde/lib/DtHelp/HelpAccess.c
Normal file
325
cde/lib/DtHelp/HelpAccess.c
Normal file
@@ -0,0 +1,325 @@
|
||||
/* $XConsortium: HelpAccess.c /main/6 1996/08/28 16:46:12 drk $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: HelpAccess.c
|
||||
**
|
||||
** Project: Cache Creek (Rivers) Project
|
||||
**
|
||||
** Description: This module handles all the help requests within a given
|
||||
** help dialog widget.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/Shell.h>
|
||||
|
||||
#include <Xm/RowColumnP.h>
|
||||
#include <Xm/LabelG.h>
|
||||
#include <Xm/PushBG.h>
|
||||
#include <Xm/CascadeB.h>
|
||||
#include <Xm/CascadeBG.h>
|
||||
|
||||
/* Help Library Includes */
|
||||
#include "DisplayAreaI.h"
|
||||
#include "Access.h"
|
||||
#include "StringFuncsI.h"
|
||||
#include "HelpDialogI.h"
|
||||
#include "HelpDialogP.h"
|
||||
|
||||
#include <Dt/Help.h>
|
||||
#include "HelpI.h"
|
||||
#include "HelposI.h"
|
||||
#include "HelpUtilI.h"
|
||||
#include "HelpQuickD.h"
|
||||
#include "HelpQuickDP.h"
|
||||
#include "HelpQuickDI.h"
|
||||
|
||||
|
||||
|
||||
/******** Static Function Declarations ********/
|
||||
static void CloseOnHelpCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data);
|
||||
static void SetupHelpDialog(
|
||||
Widget parent,
|
||||
char *helpOnHelpVolume,
|
||||
Widget *helpWidget,
|
||||
char *locationId);
|
||||
|
||||
/******** End Static Function Declarations ********/
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: static void CloseOnHelpCB(
|
||||
* Widget w,
|
||||
* XtPointer client_data,
|
||||
* XtPointer call_data);
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: This routine closes the onhelp dialog Widget that we
|
||||
* created for our help on help stuff.
|
||||
*
|
||||
****************************************************************************/
|
||||
static void CloseOnHelpCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data )
|
||||
{
|
||||
|
||||
XtUnmanageChild(w);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: void _DtHelpCB ()
|
||||
*
|
||||
* Parameters: widget
|
||||
* clientData
|
||||
* callData
|
||||
*
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Called when any "F1" key is pressed in a help dialog
|
||||
* widget, or a user selects any of the help buttons in
|
||||
* any of the help dialogs dialogs.
|
||||
*
|
||||
***************************************************************************/
|
||||
void _DtHelpCB(
|
||||
Widget widget,
|
||||
XtPointer clientData,
|
||||
XtPointer callData)
|
||||
{
|
||||
char *errorStr;
|
||||
|
||||
DtHelpListStruct * pHelpInfo = (DtHelpListStruct *) clientData;
|
||||
_DtHelpCommonHelpStuff * help = pHelpInfo->help;
|
||||
|
||||
/* If helpOnHelp resource is set use it, else post an error dialog */
|
||||
if (help->helpOnHelpVolume != NULL)
|
||||
{
|
||||
SetupHelpDialog((Widget)pHelpInfo->widget, help->helpOnHelpVolume,
|
||||
&(help->onHelpDialog), pHelpInfo->locationId);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We have no help available for the help stuff so generate an error */
|
||||
/* Do NOT EVER provide a help button */
|
||||
/* ??? ERROR */
|
||||
errorStr = XtNewString(((char *) _DTGETMESSAGE(6, 4,
|
||||
"Help On Help not provided for this application!")));
|
||||
_DtHelpErrorDialog(XtParent(pHelpInfo->widget), errorStr);
|
||||
XtFree(errorStr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void SetupHelpDialog ();
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Creates or re-uses a help on help quick help widget.
|
||||
*
|
||||
*****************************************************************************/
|
||||
static void SetupHelpDialog(
|
||||
Widget parent,
|
||||
char *helpOnHelpVolume,
|
||||
Widget *helpDialog,
|
||||
char *locationId)
|
||||
{
|
||||
Arg args[10];
|
||||
int n;
|
||||
XmString printString;
|
||||
XmString closeString;
|
||||
XmString backString;
|
||||
XmString helpString;
|
||||
char *title;
|
||||
|
||||
|
||||
if (*helpDialog == NULL)
|
||||
{
|
||||
/* Create the QuickHelpDialog widget for help on help */
|
||||
title = XtNewString(((char *)_DTGETMESSAGE(6, 1, "Help On Help")));
|
||||
printString = XmStringCreateLocalized(((char *)_DTGETMESSAGE
|
||||
(6, 2,"Print ...")));
|
||||
closeString = XmStringCreateLocalized(((char *)_DTGETMESSAGE
|
||||
(6, 3,"Close")));
|
||||
backString = XmStringCreateLocalized(((char *)_DTGETMESSAGE
|
||||
(6, 5,"Backtrack")));
|
||||
|
||||
helpString = XmStringCreateLocalized(((char *)_DTGETMESSAGE
|
||||
(6, 6,"Help ...")));
|
||||
|
||||
n =0;
|
||||
XtSetArg (args[n], DtNhelpType, DtHELP_TYPE_TOPIC); n++;
|
||||
XtSetArg (args[n], XmNtitle, title); n++;
|
||||
XtSetArg (args[n], DtNprintLabelString, printString); n++;
|
||||
XtSetArg (args[n], DtNcloseLabelString, closeString); n++;
|
||||
XtSetArg (args[n], DtNbackLabelString, backString); n++;
|
||||
XtSetArg (args[n], DtNhelpLabelString, helpString); n++;
|
||||
XtSetArg (args[n], DtNhelpVolume,helpOnHelpVolume); n++;
|
||||
XtSetArg (args[n], DtNlocationId, locationId); n++;
|
||||
*helpDialog = DtCreateHelpQuickDialog((Widget)parent,
|
||||
"onHelpDialog", args, n);
|
||||
XmStringFree(printString);
|
||||
XmStringFree(closeString);
|
||||
XmStringFree(backString);
|
||||
XmStringFree(helpString);
|
||||
XtFree((char*) title);
|
||||
|
||||
/* Catch the close callback so we can destroy the widget */
|
||||
XtAddCallback(*helpDialog, DtNcloseCallback,
|
||||
CloseOnHelpCB, (XtPointer) NULL);
|
||||
|
||||
/* Add the popup position callback to our history dialog */
|
||||
XtAddCallback (XtParent(*helpDialog), XmNpopupCallback,
|
||||
(XtCallbackProc)_DtHelpMapCB,
|
||||
(XtPointer)XtParent(parent));
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
n = 0;
|
||||
XtSetArg (args[n], DtNhelpType, DtHELP_TYPE_TOPIC); n++;
|
||||
XtSetArg (args[n], DtNhelpVolume,helpOnHelpVolume); n++;
|
||||
XtSetArg (args[n], DtNlocationId, locationId); n++;
|
||||
XtSetValues(*helpDialog, args, n);
|
||||
|
||||
}
|
||||
|
||||
/* Display the dialog */
|
||||
XtManageChild(*helpDialog);
|
||||
XtMapWidget(XtParent((Widget)*helpDialog));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpListFree (DtHelpListStruct * * pHead);
|
||||
*
|
||||
*
|
||||
* Parameters: pHead Specifies the head pointer to the help list.
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Frees all elements in a Help List.
|
||||
*
|
||||
*****************************************************************************/
|
||||
void _DtHelpListFree(
|
||||
DtHelpListStruct * * pHead)
|
||||
{
|
||||
DtHelpListStruct *pTemp = NULL;
|
||||
DtHelpListStruct *pTmpHead = *pHead;
|
||||
|
||||
while (pTmpHead != NULL)
|
||||
{
|
||||
/* Free up each element in the current node */
|
||||
pTemp = pTmpHead;
|
||||
pTmpHead = pTmpHead->pNext;
|
||||
pTemp->pNext = NULL;
|
||||
|
||||
/* Free the id String */
|
||||
XtFree(pTemp->locationId);
|
||||
|
||||
/* Now, free the whole node */
|
||||
XtFree((char *)pTemp);
|
||||
}
|
||||
*pHead = NULL; /* reset pointer */
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: DtHelpListStruct * _DtHelpListAdd(
|
||||
* char *locationId,
|
||||
* Widget new,
|
||||
* DtHelpListStruct **pHead)
|
||||
*
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Adds an element to the top of the given topicList.
|
||||
*
|
||||
*****************************************************************************/
|
||||
DtHelpListStruct * _DtHelpListAdd(
|
||||
char *locationId,
|
||||
Widget widget,
|
||||
_DtHelpCommonHelpStuff * help,
|
||||
DtHelpListStruct **pHead)
|
||||
{
|
||||
DtHelpListStruct *pTemp=NULL;
|
||||
|
||||
/* Add locationId as first element if pHead = NULL */
|
||||
if (*pHead == NULL)
|
||||
{
|
||||
*pHead = (DtHelpListStruct *) XtMalloc((sizeof(DtHelpListStruct)));
|
||||
|
||||
/* Assign the passed in values to our first element */
|
||||
(*pHead)->locationId = XtNewString(locationId);
|
||||
(*pHead)->widget = widget;
|
||||
(*pHead)->help = help;
|
||||
(*pHead)->pNext = NULL;
|
||||
(*pHead)->pPrevious = NULL;
|
||||
|
||||
}
|
||||
else
|
||||
{ /* We have a list so add the new Help item to the top */
|
||||
pTemp = (DtHelpListStruct *) XtMalloc((sizeof(DtHelpListStruct)));
|
||||
|
||||
pTemp->pNext = (*pHead);
|
||||
pTemp->pPrevious = NULL;
|
||||
|
||||
(*pHead)->pPrevious = pTemp;
|
||||
|
||||
pTemp->locationId = XtNewString(locationId);
|
||||
pTemp->widget = widget;
|
||||
pTemp->help = help;
|
||||
|
||||
/* Re-Assign our head pointer to point to the new head of the list */
|
||||
(*pHead) = pTemp;
|
||||
}
|
||||
|
||||
return (*pHead);
|
||||
}
|
||||
|
||||
142
cde/lib/DtHelp/HelpAccessI.h
Normal file
142
cde/lib/DtHelp/HelpAccessI.h
Normal file
@@ -0,0 +1,142 @@
|
||||
/* $XConsortium: HelpAccessI.h /main/4 1995/10/26 12:23:38 rswiston $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: HelpAccessI.h
|
||||
**
|
||||
** Project: Cache Creek (Rivers) Project:
|
||||
**
|
||||
** Description: Internal header file for HelpAccess.c
|
||||
** -----------
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
#ifndef _HelpAccessI_h
|
||||
#define _HelpAccessI_h
|
||||
|
||||
|
||||
|
||||
|
||||
/* The following Defines are for all the F1 key help requests */
|
||||
|
||||
/* Help Dialog */
|
||||
#define DtHELP_dialogShell_STR "_HOMETOPIC"
|
||||
|
||||
/* Menubar help access */
|
||||
#define DtHELP_onHelpMenu_STR "_HOMETOPIC"
|
||||
#define DtHELP_onTableOfContenseMenu_STR "TABLE-OF-CONTENTS"
|
||||
#define DtHELP_onTasksMenu_STR "TASKS"
|
||||
#define DtHELP_onReferenceMenu_STR "REFERENCE"
|
||||
#define DtHELP_onMouseAndKeysMenu_STR "MOUSE-AND-KEYBOARD"
|
||||
#define DtHELP_onVersionMenu_STR "_COPYRIGHT"
|
||||
|
||||
#define DtHELP_ExecutionPolicy_STR "EXECUTION-POLICY"
|
||||
|
||||
/* Menu Item Id's (F1 Key) */
|
||||
#define DtHELP_FileMenu_STR "HELP-FILE-MENU"
|
||||
#define DtHELP_EditMenu_STR "HELP-EDIT-MENU"
|
||||
#define DtHELP_SearchMenu_STR "HELP-SEARCH-MENU"
|
||||
#define DtHELP_NavigateMenu_STR "HELP-NAVIGATE-MENU"
|
||||
#define DtHELP_HelpMenu_STR "HELP-HELP-MENU"
|
||||
#define DtHELP_PopupMenu_STR "HELP-POPUP-MENU"
|
||||
|
||||
/* Quick Help Dialog help access defines */
|
||||
#define DtHELP_quickHelpShell_STR "QUICK-HELP"
|
||||
#define DtHELP_quickHelpBtn_STR "QUICK-HELP"
|
||||
|
||||
/* History Dialog help access defines */
|
||||
#define DtHELP_historyShell_STR "HISTORY"
|
||||
#define DtHELP_historyHelpBtn_STR "HISTORY"
|
||||
|
||||
/* Printing Dialog help access defines */
|
||||
#define DtHELP_printShell_STR "PRINTING"
|
||||
#define DtHELP_printHelpBtn_STR "PRINTING"
|
||||
|
||||
/* Index Search Dialog help access defines */
|
||||
#define DtHELP_srchIndexShell_STR "INDEX-SEARCH"
|
||||
#define DtHELP_srchIndexHelpBtn_STR "INDEX-SEARCH"
|
||||
|
||||
/* Volume Selection Dialog help access defines */
|
||||
#define DtHELP_volSelectShell_STR "VOLUME-SELECT"
|
||||
#define DtHELP_volSelectHelpBtn_STR "VOLUME-SELECT"
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Function: void _DtHelpCB (widget, clientData, callData)
|
||||
* Widget widget;
|
||||
* XtPointer clientData;
|
||||
* XtPointer callData;
|
||||
*
|
||||
* Parameters: widget
|
||||
* clientData
|
||||
* callData
|
||||
*
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Catches any "F1" key presses in a help dialog widget, or
|
||||
* selects any of the help buttons in any of the help dialogs
|
||||
* dialogs.
|
||||
*
|
||||
***************************************************************************/
|
||||
extern void _DtHelpCB(
|
||||
Widget widget,
|
||||
XtPointer clientData,
|
||||
XtPointer callData);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpListFree (DtHelpListStruct *pHead);
|
||||
*
|
||||
*
|
||||
* Parameters: pHead Specifies the head pointer to the help list.
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Frees all elements in a Help List.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpListFree(
|
||||
DtHelpListStruct * * pHead);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: DtHelpListStruct * _DtHelpListAdd(
|
||||
* char *locationId,
|
||||
* Widget widget,
|
||||
* int widgetType,
|
||||
* DtHelpListStruct *pHead)
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Adds an element to the top of the given topicList.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern DtHelpListStruct * _DtHelpListAdd(
|
||||
char *locationId,
|
||||
Widget widget,
|
||||
_DtHelpCommonHelpStuff * help,
|
||||
DtHelpListStruct **pHead);
|
||||
|
||||
|
||||
|
||||
#endif /* _HelpAccessI_h */
|
||||
/* Do not add anything after this endif. */
|
||||
|
||||
3637
cde/lib/DtHelp/HelpDialog.c
Normal file
3637
cde/lib/DtHelp/HelpDialog.c
Normal file
File diff suppressed because it is too large
Load Diff
95
cde/lib/DtHelp/HelpDialog.h
Normal file
95
cde/lib/DtHelp/HelpDialog.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/* $XConsortium: HelpDialog.h /main/3 1995/10/26 12:24:05 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_HelpDialog_h
|
||||
#define _Dt_HelpDialog_h
|
||||
|
||||
#include <Dt/Help.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
|
||||
/* General Help Dialog-specific Resources */
|
||||
|
||||
#ifndef DtNmarginWidth
|
||||
#define DtNmarginWidth XmNmarginWidth
|
||||
#endif
|
||||
#ifndef DtNmarginHeight
|
||||
#define DtNmarginHeight XmNmarginHeight
|
||||
#endif
|
||||
#ifndef DtNshowNewWindowButton
|
||||
#define DtNshowNewWindowButton "showNewWindowButton"
|
||||
#endif
|
||||
#ifndef DtNtopicTitle
|
||||
#define DtNtopicTitle "topicTitle"
|
||||
#endif
|
||||
#ifndef DtNvisiblePathCount
|
||||
#define DtNvisiblePathCount "visiblePathCount"
|
||||
#endif
|
||||
|
||||
#ifndef DtCCallback
|
||||
#define DtCCallback XmCCallback
|
||||
#endif
|
||||
|
||||
#ifndef DtCMarginWidth
|
||||
#define DtCMarginWidth XmCMarginWidth
|
||||
#endif
|
||||
#ifndef DtCMarginHeight
|
||||
#define DtCMarginHeight XmCMarginHeight
|
||||
#endif
|
||||
#ifndef DtCShowNewWindowButton
|
||||
#define DtCShowNewWindowButton "ShowNewWindowButton"
|
||||
#endif
|
||||
#ifndef DtCTopicTitle
|
||||
#define DtCTopicTitle "TopicTitle"
|
||||
#endif
|
||||
#ifndef DtCVisiblePathCount
|
||||
#define DtCVisiblePathCount "VisiblePathCount"
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
|
||||
/* Widget class and instance */
|
||||
|
||||
typedef struct _DtHelpDialogWidgetClassRec * DtHelpDialogWidgetClass;
|
||||
typedef struct _DtHelpDialogWidgetRec * DtHelpDialogWidget;
|
||||
|
||||
|
||||
/*
|
||||
* Data
|
||||
*/
|
||||
|
||||
/* Widget class record */
|
||||
|
||||
externalref WidgetClass dtHelpDialogWidgetClass;
|
||||
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
|
||||
extern Widget DtCreateHelpDialog(
|
||||
Widget parent,
|
||||
char *name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _Dt_HelpDialog_h */
|
||||
279
cde/lib/DtHelp/HelpDialogI.h
Normal file
279
cde/lib/DtHelp/HelpDialogI.h
Normal file
@@ -0,0 +1,279 @@
|
||||
/* $XConsortium: HelpDialogI.h /main/6 1996/08/28 19:07:35 cde-hp $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: HelpDialogI.h
|
||||
**
|
||||
** Project: Cache Creek (Rivers) Project:
|
||||
**
|
||||
** Description: Internal header file for HelpDialog Widget.
|
||||
** -----------
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
#ifndef _HelpDialogI_h
|
||||
#define _HelpDialogI_h
|
||||
|
||||
#include <Dt/HelpDialog.h>
|
||||
#include "HelpDialogP.h"
|
||||
|
||||
|
||||
/* Update list defines use in _DtHelpUpdateDisplayArea */
|
||||
|
||||
#define DtHISTORY_AND_JUMP 1
|
||||
#define DtHISTORY_ONLY 2
|
||||
#define DtJUMP_ONLY 3
|
||||
|
||||
|
||||
/* Defines for processing a request to "Top Level..." */
|
||||
#define DtBROWSER_HOME _DtHelpDefaultLocationId
|
||||
#define DtBROWSER_NAME "browser.hv"
|
||||
|
||||
|
||||
/* Jump List Max */
|
||||
|
||||
#define DtJUMP_LIST_MAX 999
|
||||
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Current Color Info Structure Definition
|
||||
*
|
||||
****************************************************************/
|
||||
typedef struct _colorStruct {
|
||||
Pixel background;
|
||||
Pixel foreground;
|
||||
Pixel topShadow;
|
||||
Pixel bottomShadow;
|
||||
Pixel select;
|
||||
} ColorStruct;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpUpdateDisplayArea(
|
||||
* char *locationId,
|
||||
* DtHelpDialogWidget nw,
|
||||
* int listUpdateType,
|
||||
* int topicUpdateType);
|
||||
*
|
||||
*
|
||||
* Parameters: locationId
|
||||
*
|
||||
* nw
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Updates the History List for the current help dialog.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpUpdateDisplayArea(
|
||||
char *locationId,
|
||||
DtHelpDialogWidget nw,
|
||||
Boolean vol_changed,
|
||||
int listUpdateType,
|
||||
int topicUpdateType);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpUpdateJumpList(
|
||||
* char *topicInfo,
|
||||
* DtHelpDialogWidget nw);
|
||||
*
|
||||
*
|
||||
* Parameters: topicInfo
|
||||
*
|
||||
* nw
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Updates the History List for the current help dialog.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpUpdateJumpList(
|
||||
char *topicInfo,
|
||||
int topicType,
|
||||
Widget nw);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpDialogHypertextCB(
|
||||
* XtPointer pDisplayAreaStruct,
|
||||
* XtPointer clientData,
|
||||
* DtHelpHyperTextStruct *hyperData)
|
||||
*
|
||||
* Parameters: pDisplayAreaStruct Specifies the curretn display are info.
|
||||
*
|
||||
* hyperData Specifies the current hypertext info
|
||||
* structure.
|
||||
*
|
||||
* clientData Specifies the client data passed into
|
||||
* the hypertext callback.
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Process all hypertext requests in a given Help Dialogs
|
||||
* display area.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpDialogHypertextCB (
|
||||
XtPointer pDisplayAreaStruct,
|
||||
XtPointer clientData,
|
||||
DtHelpHyperTextStruct *hyperData);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpSetupDisplayType(DtHelpDialogWidget nw);
|
||||
* int updateType);
|
||||
*
|
||||
*
|
||||
* Parameters: nw Specifies the current help dialog widget.
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Determins the type of topic the user want's to display
|
||||
* in the current help dialog and sets it up for display.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpSetupDisplayType(
|
||||
DtHelpDialogWidget nw,
|
||||
Boolean vol_changed,
|
||||
int updateType);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpTopicListFree (DtTopicListStruct *pHead);
|
||||
*
|
||||
*
|
||||
* Parameters: pHead Specifies the head pointer to the topic list.
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Frees all elements in a Topic List.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpTopicListFree(
|
||||
DtTopicListStruct *pHead);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: extern void DisplayHistoryCB(
|
||||
* Widget w,
|
||||
* XtPointer client_data,
|
||||
* XtPointer call_data);
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: This routine will cause the history dialog to be
|
||||
* posted.
|
||||
*
|
||||
****************************************************************************/
|
||||
extern void _DtHelpDisplayHistoryCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data );
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: extern void _DtHelpDisplayBackCB(
|
||||
* Widget w,
|
||||
* XtPointer client_data,
|
||||
* XtPointer call_data);
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: This routine will cause the top element in the jump
|
||||
* stack to be displayed.
|
||||
*
|
||||
****************************************************************************/
|
||||
extern void _DtHelpDisplayBackCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: extern void _DtHelpDuplicateWindowCB(
|
||||
* Widget w,
|
||||
* XtPointer client_data,
|
||||
* XtPointer call_data);
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: This routine creates a new help widget by forcing the
|
||||
* equivelent of a Jump New hyper text call
|
||||
*
|
||||
****************************************************************************/
|
||||
extern void _DtHelpDuplicateWindowCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpDisplayIndexCB(
|
||||
* Widget w,
|
||||
* XtPointer client_data,
|
||||
* XtPointer call_data);
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: This routine will cause the index dialog to be
|
||||
* posted.
|
||||
*
|
||||
****************************************************************************/
|
||||
extern void _DtHelpDisplayIndexCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpDisplayBrowserHomeCB(
|
||||
* Widget w,
|
||||
* XtPointer client_data,
|
||||
* XtPointer call_data);
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: This routine will cause the top level of the browser.hv
|
||||
* help volume to be displayed.
|
||||
*
|
||||
****************************************************************************/
|
||||
extern void _DtHelpDisplayBrowserHomeCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpFilterExecCmdCB
|
||||
*
|
||||
* clientData: The general help dialog widget
|
||||
* cmdStr: cmd string to filter
|
||||
* ret_filteredCmdStr: string after filtering. NULL if exec denied
|
||||
*
|
||||
* Return Value: 0: ok, < 0: error
|
||||
*
|
||||
* Purpose: filter an execution command using executionPolicy rsrc
|
||||
*
|
||||
* Memory:
|
||||
* The caller must free memory allocated for the ret_filteredCmdStr
|
||||
*****************************************************************************/
|
||||
extern int _DtHelpFilterExecCmdCB(
|
||||
void * clientData,
|
||||
const char * cmdStr,
|
||||
char * * ret_filteredCmdStr);
|
||||
|
||||
#endif /* _HelpDialogI_h */
|
||||
/* Do not add anything after this endif. */
|
||||
173
cde/lib/DtHelp/HelpDialogImageI.h
Normal file
173
cde/lib/DtHelp/HelpDialogImageI.h
Normal file
@@ -0,0 +1,173 @@
|
||||
/* $XConsortium: HelpDialogImageI.h /main/3 1995/10/26 12:24:20 rswiston $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: HelpDialogImageI.h
|
||||
**
|
||||
** Project: Cache Creek (Rivers) Project:
|
||||
**
|
||||
** Description: Internal image header file for HelpDialog Widget.
|
||||
** -----------
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
#ifndef _HelpDialogImageI_h
|
||||
#define _HelpDialogImageI_h
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Image: Tool Box Back Button (sensatized)
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define back_width 22
|
||||
#define back_height 22
|
||||
static char back_bits[] = {
|
||||
0x00, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x14, 0x00,
|
||||
0xaa, 0x2a, 0x0f, 0x54, 0x55, 0x1f, 0xaa, 0x2a, 0x1f, 0x00, 0x14, 0x1c,
|
||||
0x00, 0x0a, 0x1c, 0x00, 0x04, 0x1c, 0x00, 0x02, 0x1c, 0x40, 0x00, 0x1c,
|
||||
0x60, 0x00, 0x1c, 0x70, 0x00, 0x1c, 0x78, 0x00, 0x1c, 0xfc, 0xff, 0x1f,
|
||||
0xfe, 0xff, 0x1f, 0xfc, 0xff, 0x0f, 0x78, 0x00, 0x00, 0x70, 0x00, 0x00,
|
||||
0x60, 0x00, 0x00, 0x40, 0x00, 0x00};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Image: Tool Box Back Button (de-sensatized)
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define backD_width 22
|
||||
#define backD_height 22
|
||||
static char backD_bits[] = {
|
||||
0x00, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x14, 0x00,
|
||||
0xaa, 0x2a, 0x0a, 0x54, 0x55, 0x15, 0xaa, 0x2a, 0x0a, 0x00, 0x14, 0x14,
|
||||
0x00, 0x0a, 0x08, 0x00, 0x04, 0x14, 0x00, 0x02, 0x08, 0x40, 0x00, 0x14,
|
||||
0x20, 0x00, 0x08, 0x50, 0x00, 0x14, 0x28, 0x00, 0x08, 0x54, 0x55, 0x15,
|
||||
0xaa, 0xaa, 0x0a, 0x54, 0x55, 0x05, 0x28, 0x00, 0x00, 0x50, 0x00, 0x00,
|
||||
0x20, 0x00, 0x00, 0x40, 0x00, 0x00};
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Image: Tool Box Top Button (sensatized)
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define top_width 22
|
||||
#define top_height 22
|
||||
static char top_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x00, 0xfc, 0x7f, 0x00,
|
||||
0xfc, 0x3f, 0x00, 0xfc, 0x1f, 0x00, 0xfc, 0x0f, 0x00, 0xfc, 0x07, 0x00,
|
||||
0xfc, 0x0f, 0x00, 0xfc, 0x1f, 0x00, 0xfc, 0x3f, 0x00, 0x7c, 0x7f, 0x00,
|
||||
0x3c, 0xfe, 0x00, 0x1c, 0xfc, 0x01, 0x0c, 0xf8, 0x03, 0x04, 0xf0, 0x01,
|
||||
0x00, 0xe0, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Image: Tool Box Top Button (de-sensatized)
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define topD_width 22
|
||||
#define topD_height 22
|
||||
static char topD_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xaa, 0x00, 0x54, 0x55, 0x00,
|
||||
0xa8, 0x2a, 0x00, 0x54, 0x15, 0x00, 0xa8, 0x0a, 0x00, 0x54, 0x05, 0x00,
|
||||
0xa8, 0x0a, 0x00, 0x54, 0x15, 0x00, 0xa8, 0x2a, 0x00, 0x54, 0x55, 0x00,
|
||||
0x28, 0xaa, 0x00, 0x14, 0x54, 0x01, 0x08, 0xa8, 0x00, 0x04, 0x50, 0x00,
|
||||
0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Image: Tool Box History Button (sensatized)
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define history_width 22
|
||||
#define history_height 22
|
||||
static char history_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x30, 0x00, 0x00, 0x7e, 0x54, 0x15,
|
||||
0x7e, 0xa8, 0x0a, 0x30, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x10, 0x00, 0x00, 0x30, 0x00, 0x00, 0x7e, 0x54, 0x15, 0x7e, 0xa8, 0x0a,
|
||||
0x30, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
|
||||
0x30, 0x00, 0x00, 0x7e, 0x54, 0x15, 0x7e, 0xa8, 0x0a, 0x30, 0x00, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Image: Tool Box History Button (de-sensatized)
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define historyD_width 22
|
||||
#define historyD_height 22
|
||||
static char historyD_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20, 0x00, 0x00, 0x54, 0x54, 0x15,
|
||||
0x2a, 0xa8, 0x0a, 0x20, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x10, 0x00, 0x00, 0x20, 0x00, 0x00, 0x54, 0x54, 0x15, 0x2a, 0xa8, 0x0a,
|
||||
0x20, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
|
||||
0x20, 0x00, 0x00, 0x54, 0x54, 0x15, 0x2a, 0xa8, 0x0a, 0x20, 0x00, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Image: Tool Box Keyword Index Button (sensatized)
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define key_width 22
|
||||
#define key_height 22
|
||||
static char key_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0e,
|
||||
0x00, 0x00, 0x07, 0x00, 0x80, 0x0f, 0x00, 0xc0, 0x1d, 0x00, 0xe0, 0x38,
|
||||
0x00, 0xf0, 0x11, 0x00, 0xb8, 0x03, 0x00, 0x1c, 0x07, 0x00, 0x0e, 0x02,
|
||||
0x00, 0x07, 0x00, 0x80, 0x03, 0x00, 0xfc, 0x01, 0x00, 0xfe, 0x00, 0x00,
|
||||
0xe6, 0x00, 0x00, 0xc6, 0x00, 0x00, 0xce, 0x00, 0x00, 0xfc, 0x00, 0x00,
|
||||
0x78, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Image: Tool Box Keyword Index Button (de-sensatized)
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define keyD_width 22
|
||||
#define keyD_height 22
|
||||
static char keyD_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0a,
|
||||
0x00, 0x00, 0x05, 0x00, 0x80, 0x0a, 0x00, 0x40, 0x15, 0x00, 0xa0, 0x28,
|
||||
0x00, 0x50, 0x11, 0x00, 0xa8, 0x02, 0x00, 0x14, 0x05, 0x00, 0x0a, 0x02,
|
||||
0x00, 0x05, 0x00, 0x80, 0x02, 0x00, 0x54, 0x01, 0x00, 0xaa, 0x00, 0x00,
|
||||
0x84, 0x00, 0x00, 0x42, 0x00, 0x00, 0x84, 0x00, 0x00, 0x54, 0x00, 0x00,
|
||||
0x28, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
|
||||
|
||||
#endif /* _HelpDialogImageI_h */
|
||||
/* Do not add anything after this endif. */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
370
cde/lib/DtHelp/HelpDialogP.h
Normal file
370
cde/lib/DtHelp/HelpDialogP.h
Normal file
@@ -0,0 +1,370 @@
|
||||
/* $XConsortium: HelpDialogP.h /main/6 1996/04/13 11:55:10 ageorge $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: HelpDialogP.h
|
||||
**
|
||||
** Project: Cache Creek (Rivers) Project:
|
||||
**
|
||||
** Description: Privite Header file for HelpDialog.c
|
||||
** -----------
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
|
||||
#ifndef _DtHelpDialogP_h
|
||||
#define _DtHelpDialogP_h
|
||||
|
||||
#include <Xm/BulletinBP.h>
|
||||
|
||||
#include <Dt/HelpDialog.h>
|
||||
|
||||
#include "FileListUtilsI.h"
|
||||
#include "GlobSearchP.h"
|
||||
|
||||
#define XmDIALOG_SUFFIX "_popup"
|
||||
#define XmDIALOG_SUFFIX_SIZE 6
|
||||
|
||||
|
||||
/* Defines for use in allocation geometry matrix. */
|
||||
#define TB_MAX_WIDGETS_VERT 7
|
||||
#define TB_MAX_NUM_WIDGETS 12
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Topic List Info Structure Definition (History & Jump Back Lists)
|
||||
*
|
||||
****************************************************************/
|
||||
typedef struct _DtTopicListStruct {
|
||||
char *locationId;
|
||||
XmString topicTitleLbl;
|
||||
char *helpVolume;
|
||||
int topicType;
|
||||
int pathLevel;
|
||||
int scrollPosition;
|
||||
struct _DtTopicListStruct *pNext;
|
||||
struct _DtTopicListStruct *pPrevious;
|
||||
} DtTopicListStruct;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Volume List Info: History Dialog only.
|
||||
*
|
||||
****************************************************************/
|
||||
typedef struct _DtHistoryListStruct {
|
||||
XmString itemTitle;
|
||||
int topicType;
|
||||
int totalNodes;
|
||||
struct _DtHistoryListStruct *pNext;
|
||||
struct _DtTopicListStruct *pTopicHead;
|
||||
struct _DtTopicListStruct *pTopicTale;
|
||||
} DtHistoryListStruct;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Help Callback return structure
|
||||
*
|
||||
****************************************************************/
|
||||
typedef struct _DtHelpListStruct {
|
||||
char * locationId;
|
||||
Widget widget;
|
||||
struct _DtHelpCommonHelpStuff * help;
|
||||
struct _DtHelpListStruct * pNext;
|
||||
struct _DtHelpListStruct * pPrevious;
|
||||
} DtHelpListStruct;
|
||||
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Kewword Search entry structure.
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
typedef struct {
|
||||
char * keyWord;
|
||||
Boolean matchesFindPattern;
|
||||
} KeyEntry;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Class Part Structure Definition */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
XtPointer extension; /* Pointer to extension record */
|
||||
} DtHelpDialogWidgetClassPart;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Full class record declaration */
|
||||
|
||||
typedef struct _DtHelpDialogWidgetClassRec
|
||||
{
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
XmBulletinBoardClassPart bulletin_board_class;
|
||||
DtHelpDialogWidgetClassPart selection_box_class;
|
||||
} DtHelpDialogWidgetClassRec;
|
||||
|
||||
externalref DtHelpDialogWidgetClassRec dtHelpDialogWidgetClassRec;
|
||||
|
||||
|
||||
typedef struct _DtHelpDisplayWidgetStuff
|
||||
{
|
||||
short textColumns; /* Columns Resource Value resource */
|
||||
short textRows; /* Rows Resource Value resource */
|
||||
char * locationId; /* Current Topic String resource */
|
||||
char * helpVolume; /* Current Project File resource */
|
||||
char * manPage; /* man page resource */
|
||||
char * stringData; /* string data resource */
|
||||
char * helpFile; /* help file resource */
|
||||
unsigned char scrollBarPolicy; /* Scrollbar policy resource */
|
||||
unsigned char executionPolicy; /* Link/script exec policy resource */
|
||||
XtCallbackList hyperLinkCallback; /* Hypertext Callback resource */
|
||||
_DtHelpVolumeHdl volumeHandle; /* handle of current volume */
|
||||
unsigned char helpType; /* Current displayed file type resource */
|
||||
char * topicTitleStr; /* title of topic */
|
||||
int count; /* Nonexistent topic title count */
|
||||
XmString topicTitleLbl; /* XmString title of topic */
|
||||
Boolean firstTimePopupFlag; /* False, untel we map the widget */
|
||||
|
||||
|
||||
} _DtHelpDisplayWidgetStuff;
|
||||
|
||||
typedef struct _DtHelpCommonHelpStuff
|
||||
{
|
||||
XtPointer pDisplayArea; /* Display widget handle */
|
||||
|
||||
/* for help on help */
|
||||
char * helpOnHelpVolume; /* help on help volume resource */
|
||||
DtHelpListStruct * pHelpListHead; /* Help List Pointer */
|
||||
Widget onHelpDialog; /* help on help dialog */
|
||||
|
||||
char * sysVolumeSearchPath; /* system search path */
|
||||
char * userVolumeSearchPath; /* user search path */
|
||||
|
||||
char * currentHelpFile; /* Current help file */
|
||||
int topicOffset; /* Offset into help file */
|
||||
|
||||
char * topLevelId; /* Toplevel topic volume displayed */
|
||||
int topLevelTopicOffset;
|
||||
} _DtHelpCommonHelpStuff;
|
||||
|
||||
typedef struct _DtHelpGeneralHelpStuff
|
||||
{
|
||||
char * parentId; /* used for "Up" menu */
|
||||
|
||||
Boolean volumeFlag; /* set when to process new vol */
|
||||
|
||||
Widget definitionBox;
|
||||
XtCallbackList closeCallback; /* Window Close Callback */
|
||||
|
||||
Dimension marginHeight;
|
||||
Dimension marginWidth;
|
||||
} _DtHelpGeneralHelpStuff;
|
||||
|
||||
|
||||
typedef struct _DtHelpBrowserStuff
|
||||
{
|
||||
int visiblePathCount; /* Number of path lines shown */
|
||||
XtPointer pTocArea; /* Toc area handle */
|
||||
|
||||
Widget volumeLabel;
|
||||
Widget panedWindow;
|
||||
Widget pathArea;
|
||||
|
||||
Boolean showTopLevelBtn;
|
||||
Widget btnBoxBackBtn;
|
||||
Widget btnBoxHistoryBtn;
|
||||
Widget btnBoxIndexBtn;
|
||||
Widget btnBoxTopLevelBtn;
|
||||
} _DtHelpBrowserStuff;
|
||||
|
||||
typedef struct _DtHelpMenuStuff
|
||||
{
|
||||
Boolean showDupBtn;
|
||||
|
||||
/* Help Dialog Widgets */
|
||||
Widget menuBar;
|
||||
|
||||
Widget topBtn;
|
||||
Widget keyBtn;
|
||||
Widget backBtn;
|
||||
Widget historyBtn;
|
||||
Widget printBtn;
|
||||
Widget closeBtn;
|
||||
Widget helpBtn;
|
||||
Widget newWindowBtn;
|
||||
Widget copyBtn;
|
||||
|
||||
Widget popupMenu;
|
||||
Widget popupBackBtn;
|
||||
Widget popupTopBtn;
|
||||
} _DtHelpMenuStuff;
|
||||
|
||||
typedef struct _DtHelpHistoryStuff
|
||||
{
|
||||
/* Path Area Variables */
|
||||
DtTopicListStruct * pPathListHead;
|
||||
DtTopicListStruct * pPathListTale;
|
||||
int totalPathNodes;
|
||||
|
||||
/* History Dialog Widgets & variables */
|
||||
Widget volumeList; /* Scrolled volume list */
|
||||
Widget topicList; /* Scrolled topic list */
|
||||
Widget historyWidget; /* Top Level History Shell */
|
||||
Widget topicsListLabel;
|
||||
DtHistoryListStruct * pHistoryListHead; /* Head pointer to history */
|
||||
} _DtHelpHistoryStuff;
|
||||
|
||||
typedef struct _DtHelpBacktrackStuff
|
||||
{
|
||||
/* Jump List variables */
|
||||
DtTopicListStruct * pJumpListHead;
|
||||
DtTopicListStruct * pJumpListTale;
|
||||
int totalJumpNodes;
|
||||
int scrollPosition;
|
||||
} _DtHelpBacktrackStuff;
|
||||
|
||||
typedef struct _DtHelpGlobSearchStuff
|
||||
{
|
||||
/* search dialog resource (undocumented) */
|
||||
char * hitPrefixFont; /* hit prefix mono-space font resource */
|
||||
|
||||
/* host application locale settings */
|
||||
char * iconv3Codeset; /* iconv3-ok codeset of app */
|
||||
_DtHelpCeIconvContext iconv3Context; /* from vol to app locale */
|
||||
|
||||
/* File Selection Dialog font list */
|
||||
XmFontList volTitlesFontList; /*font list req'd by font titles*/
|
||||
|
||||
/* Search Dialog Widgets & variables */
|
||||
Widget srchForm;
|
||||
Widget actionBtn;
|
||||
Widget curVolRadBtn;
|
||||
Widget allVolRadBtn;
|
||||
Widget selVolRadBtn;
|
||||
Widget selectBtn;
|
||||
Widget fullIndexRadBtn;
|
||||
Widget containsRadBtn;
|
||||
Widget wordField;
|
||||
Widget statusLabel;
|
||||
Widget resultList;
|
||||
Widget gotoBtn;
|
||||
Widget closeBtn;
|
||||
Widget helpBtn;
|
||||
Widget selectionDlg; /* selectionBox (child of dlg) */
|
||||
char * curVolPath; /* cur vol shown in btn label */
|
||||
char * rawWordStr; /* word as taken from srchWord */
|
||||
char * normWordStr; /* normalized word str */
|
||||
char * localeWordStr; /* after iconv() of NormWordStr */
|
||||
wchar_t wordFieldFirstChar;
|
||||
short wordFieldLen;
|
||||
short statusLineUsage;
|
||||
_DtHelpGlobSrchSources srchSources; /* current state of radio but */
|
||||
_DtHelpFileEntry curSrchVol; /* vol currently being searched */
|
||||
unsigned int hitsFontLoaded:1; /* is font loaded? */
|
||||
unsigned int volScanDone:1; /* is the volume list complete? */
|
||||
unsigned int fullIndex:1; /* state of search */
|
||||
unsigned int readyToStart:1; /* state of search */
|
||||
unsigned int hitsFound:1; /* state of search */
|
||||
unsigned int searchInProgress:1; /* state of search */
|
||||
unsigned int curVolRadBtnSens:1; /* state of curVol sens */
|
||||
short volLeftCnt; /* updated during search */
|
||||
_DtHelpFileList volListHead; /* info on search topics found */
|
||||
XtWorkProcId workProcId; /* ID of search proc */
|
||||
} _DtHelpGlobSearchStuff;
|
||||
|
||||
typedef struct _DtHelpPrintStuff
|
||||
{
|
||||
/* printing resources */
|
||||
char * helpPrint; /* help print command resource */
|
||||
unsigned char paperSize; /* paper size resource */
|
||||
char * printer; /* printer destination resource */
|
||||
char * printVolume; /* volume to print resource */
|
||||
|
||||
/* Print Dialog widgets & variables */
|
||||
Widget printForm; /* Form inside top level print shell */
|
||||
Widget subject; /* label for subject matter to print */
|
||||
Widget printerField; /* text field for printer */
|
||||
Widget copiesField; /* text field for copies */
|
||||
Widget letterBtn; /* menu item for letter paper */
|
||||
Widget legalBtn; /* menu item for legal paper */
|
||||
Widget execBtn; /* menu item for executive paper */
|
||||
Widget a4Btn; /* menu item for A4 paper */
|
||||
Widget b5Btn; /* menu item for B5 paper */
|
||||
Widget paperSizeOptMenu; /* menu item for A4 paper */
|
||||
Widget topicsFrame; /* frame holding print topic selection */
|
||||
Widget curTopicBtn; /* radio btn for cur topic */
|
||||
Widget subTopicsBtn; /* radio btn for cur & sub topics */
|
||||
Widget tocBtn; /* radio btn for table of contents */
|
||||
Widget allTopicsBtn; /* radio btn for all topics */
|
||||
Widget paperTopicsSeparator; /* hidden sep btwn paper size & topic sel */
|
||||
Widget topicsBtnsSeparator; /* sep between topic sel & btns */
|
||||
} _DtHelpPrintStuff;
|
||||
|
||||
|
||||
/* fields for the GeneralHelp widget record */
|
||||
typedef struct
|
||||
{
|
||||
_DtHelpDisplayWidgetStuff display;
|
||||
_DtHelpCommonHelpStuff help;
|
||||
_DtHelpGeneralHelpStuff ghelp;
|
||||
_DtHelpBrowserStuff browser;
|
||||
_DtHelpMenuStuff menu;
|
||||
_DtHelpHistoryStuff history;
|
||||
_DtHelpBacktrackStuff backtr;
|
||||
_DtHelpGlobSearchStuff srch;
|
||||
_DtHelpPrintStuff print;
|
||||
} DtHelpDialogWidgetPart;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Full instance record declaration
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
typedef struct _DtHelpDialogWidgetRec
|
||||
{
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
XmBulletinBoardPart bulletin_board;
|
||||
DtHelpDialogWidgetPart help_dialog;
|
||||
} DtHelpDialogWidgetRec;
|
||||
|
||||
|
||||
|
||||
/******** Private Function Declarations ********/
|
||||
|
||||
extern XmGeoMatrix _DtHelpDialogWidgetGeoMatrixCreate(
|
||||
Widget wid,
|
||||
Widget instigator,
|
||||
XtWidgetGeometry *desired) ;
|
||||
extern Boolean _DtHelpDialogWidgetNoGeoRequest(
|
||||
XmGeoMatrix geoSpec) ;
|
||||
|
||||
/******** End Private Function Declarations ********/
|
||||
|
||||
|
||||
|
||||
#endif /* _XmTemplateBP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
|
||||
101
cde/lib/DtHelp/HelpErrorP.h
Normal file
101
cde/lib/DtHelp/HelpErrorP.h
Normal file
@@ -0,0 +1,101 @@
|
||||
/* $XConsortium: HelpErrorP.h /main/3 1995/10/26 12:24:36 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: DtErrnoP.h
|
||||
**
|
||||
** Project: CacheCreeek (Rivers) Project.
|
||||
**
|
||||
**
|
||||
** Description: Private defines Dt errors.
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtErrnoP_h
|
||||
#define _DtErrnoP_h
|
||||
|
||||
#include "CanvasError.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* library generated errors in the system variable 'errno'
|
||||
*/
|
||||
#define DtErrorReported CEErrorReported
|
||||
#define DtErrorExceedMaxSize CEErrorExceedMaxSize
|
||||
#define DtErrorIllegalDatabaseFile CEErrorIllegalDatabaseFile
|
||||
#define DtErrorIllegalKeyword CEErrorIllegalKeyword
|
||||
#define DtErrorIllegalPath CEErrorIllegalPath
|
||||
#define DtErrorIllegalResource CEErrorIllegalResource
|
||||
#define DtErrorLocIdNotFound CEErrorLocIdNotFound
|
||||
#define DtErrorMalloc CEErrorMalloc
|
||||
|
||||
#define DtErrorMissingAbstractRes CEErrorMissingAbstractRes
|
||||
#define DtErrorMissingFilenameRes CEErrorMissingFilenameRes
|
||||
#define DtErrorMissingFileposRes CEErrorMissingFileposRes
|
||||
#define DtErrorMissingKeywordsRes CEErrorMissingKeywordsRes
|
||||
#define DtErrorMissingTitleRes CEErrorMissingTitleRes
|
||||
#define DtErrorMissingTopTopicRes CEErrorMissingTopTopicRes
|
||||
#define DtErrorMissingTopicList CEErrorMissingTopicList
|
||||
#define DtErrorNoKeywordList CEErrorNoKeywordList
|
||||
|
||||
/*
|
||||
* Formatting errors.
|
||||
*/
|
||||
#define DtErrorMissingTopicCmd CEErrorMissingTopicCmd
|
||||
#define DtErrorMissingTitleCmd CEErrorMissingTitleCmd
|
||||
|
||||
#define DtErrorFormattingCmd CEErrorFormattingCmd
|
||||
#define DtErrorFormattingId CEErrorFormattingId
|
||||
#define DtErrorFormattingLabel CEErrorFormattingLabel
|
||||
#define DtErrorFormattingLink CEErrorFormattingLink
|
||||
#define DtErrorFormattingTitle CEErrorFormattingTitle
|
||||
#define DtErrorFormattingValue CEErrorFormattingValue
|
||||
#define DtErrorFormattingOption CEErrorFormattingOption
|
||||
|
||||
#define DtErrorHyperType CEErrorHyperType
|
||||
#define DtErrorHyperSpec CEErrorHyperSpec
|
||||
#define DtErrorHyperNotFound CEErrorHyperNotFound
|
||||
#define DtErrorHyperTitle CEErrorHyperTitle
|
||||
|
||||
#define DtErrorIllegalInfo CEErrorIllegalInfo
|
||||
#define DtErrorReadEmpty CEErrorReadEmpty
|
||||
#define DtErrorFileSeek CEErrorFileSeek
|
||||
|
||||
#define DtErrorParagraphValue CEErrorParagraphValue
|
||||
#define DtErrorParagraphOption CEErrorParagraphOption
|
||||
#define DtErrorTopicSyntax CEErrorTopicSyntax
|
||||
#define DtErrorFontSpec CEErrorFontSpec
|
||||
|
||||
#define DtErrorAbbrevSyntax CEErrorAbbrevSyntax
|
||||
#define DtErrorTitleSyntax CEErrorTitleSyntax
|
||||
#define DtErrorFigureSyntax CEErrorFigureSyntax
|
||||
#define DtErrorGraphicSyntax CEErrorGraphicSyntax
|
||||
#define DtErrorFontSyntax CEErrorFontSyntax
|
||||
#define DtErrorIdSyntax CEErrorIdSyntax
|
||||
#define DtErrorLabelSyntax CEErrorLabelSyntax
|
||||
#define DtErrorLinkSyntax CEErrorLinkSyntax
|
||||
#define DtErrorNewLineSyntax CEErrorNewLineSyntax
|
||||
#define DtErrorParagraphSyntax CEErrorParagraphSyntax
|
||||
#define DtErrorOctalSyntax CEErrorOctalSyntax
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
#endif /* _DtErrnoP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
56
cde/lib/DtHelp/HelpI.h
Normal file
56
cde/lib/DtHelp/HelpI.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/* $XConsortium: HelpI.h /main/3 1995/10/26 12:24:43 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: HelpI.h
|
||||
**
|
||||
** Project: Display Area library
|
||||
**
|
||||
**
|
||||
** Description: Private header file for macros.
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpI_h
|
||||
#define _DtHelpI_h
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* <<<<<<<<<<<<<<<<<<< Help Dialog Stuff >>>>>>>>>>>>>>>>>>>>*/
|
||||
|
||||
#define VALID_STATUS 0
|
||||
#define NON_VALID_STATUS -1
|
||||
|
||||
|
||||
/* Cleanup Type Defines */
|
||||
|
||||
#define DtCLEAN_FOR_DESTROY 1
|
||||
#define DtCLEAN_FOR_REUSE 2
|
||||
|
||||
|
||||
|
||||
/* Help Volume Search Path Location Environment Variables */
|
||||
|
||||
#define DtSYS_FILE_SEARCH_ENV "DTHELPSEARCHPATH"
|
||||
#define DtUSER_FILE_SEARCH_ENV "DTHELPUSERSEARCHPATH"
|
||||
|
||||
|
||||
|
||||
#endif /* _DtHelpI_h */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
96
cde/lib/DtHelp/HelpP.h
Normal file
96
cde/lib/DtHelp/HelpP.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/* $XConsortium: HelpP.h /main/3 1995/10/26 12:24:50 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: HelpP.h
|
||||
**
|
||||
** Project: CacheCreeek (Rivers) Project.
|
||||
**
|
||||
**
|
||||
** Description: Private header file for Dts.
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHelpP_h
|
||||
#define _DtHelpP_h
|
||||
|
||||
/* Privite Argument Resource Definitions for Help Widget */
|
||||
|
||||
#define DtNshowTopLevelButton "showTopLevelButton"
|
||||
#ifndef XmNshowTopLevelButton
|
||||
#define XmNshowTopLevelButton DtNshowTopLevelButton
|
||||
#endif
|
||||
#define DtCShowTopLevelButton "ShowTopLevelButton"
|
||||
#ifndef XmCShowTopLevelButton
|
||||
#define XmCShowTopLevelButton DtCShowTopLevelButton
|
||||
#endif
|
||||
|
||||
#define DtNsrchHitPrefixFont "srchHitPrefixFont"
|
||||
#ifndef XmNsrchHitPrefixFont
|
||||
#define XmNsrchHitPrefixFont DtNsrchHitPrefixFont
|
||||
#endif
|
||||
#define DtCSrchHitPrefixFont "SrchHitPrefixFont"
|
||||
#ifndef XmCSrchHitPrefixFont
|
||||
#define XmCSrchHitPrefixFont DtCSrchHitPrefixFont
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef CDE_CONFIGURATION_TOP
|
||||
#define CDE_CONFIGURATION_TOP "/etc/dt"
|
||||
#endif
|
||||
|
||||
#ifndef CDE_INSTALLATION_TOP
|
||||
#define CDE_INSTALLATION_TOP "/usr/dt"
|
||||
#endif
|
||||
|
||||
|
||||
#define DtDEFAULT_SYSTEM_PATH \
|
||||
CDE_CONFIGURATION_TOP "/appconfig/help/%L/%H:" \
|
||||
CDE_CONFIGURATION_TOP "/appconfig/help/%L/%H.sdl:" \
|
||||
CDE_CONFIGURATION_TOP "/appconfig/help/%L/%H.hv:" \
|
||||
CDE_CONFIGURATION_TOP "/appconfig/help/C/%H:" \
|
||||
CDE_CONFIGURATION_TOP "/appconfig/help/C/%H.sdl:" \
|
||||
CDE_CONFIGURATION_TOP "/appconfig/help/C/%H.hv:" \
|
||||
CDE_INSTALLATION_TOP "/appconfig/help/%L/%H:" \
|
||||
CDE_INSTALLATION_TOP "/appconfig/help/%L/%H.sdl:" \
|
||||
CDE_INSTALLATION_TOP "/appconfig/help/%L/%H.hv" \
|
||||
CDE_INSTALLATION_TOP "/appconfig/help/C/%H:" \
|
||||
CDE_INSTALLATION_TOP "/appconfig/help/C/%H.sdl:" \
|
||||
CDE_INSTALLATION_TOP "/appconfig/help/C/%H.hv:"
|
||||
|
||||
|
||||
#define DtDEFAULT_USER_PATH_FORMAT \
|
||||
"%s/.dt/help/%s/%%H:" \
|
||||
"%s/.dt/help/%s/%%H.sdl:" \
|
||||
"%s/.dt/help/%s/%%H.hv:" \
|
||||
"%s/.dt/help/%%H:" \
|
||||
"%s/.dt/help/%%H.sdl:" \
|
||||
"%s/.dt/help/%%H.hv"
|
||||
|
||||
/* this path expects a sprintf usage as follows:
|
||||
sprintf(buf,DtDEFAULT_USER_PATH_FORMAT,
|
||||
homedir, dtusersessionname,
|
||||
homedir, dtusersessionname,
|
||||
homedir, dtusersessionname,
|
||||
homedir, homedir, homedir);
|
||||
*/
|
||||
|
||||
/* #define DtVOLUMES_TYPE "volumes" */
|
||||
|
||||
#endif /* _DtHelpP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
2581
cde/lib/DtHelp/HelpQuickD.c
Normal file
2581
cde/lib/DtHelp/HelpQuickD.c
Normal file
File diff suppressed because it is too large
Load Diff
102
cde/lib/DtHelp/HelpQuickD.h
Normal file
102
cde/lib/DtHelp/HelpQuickD.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/* $XConsortium: HelpQuickD.h /main/3 1995/10/26 12:25:25 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_HelpQuickD_h
|
||||
#define _Dt_HelpQuickD_h
|
||||
|
||||
#include <Dt/Help.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
|
||||
/* Quick help dialog-specific Resources */
|
||||
|
||||
#ifndef DtNbackLabelString
|
||||
#define DtNbackLabelString "backLabelString"
|
||||
#endif
|
||||
#ifndef DtNhelpLabelString
|
||||
#define DtNhelpLabelString XmNhelpLabelString
|
||||
#endif
|
||||
#ifndef DtNmoreLabelString
|
||||
#define DtNmoreLabelString "moreLabelString"
|
||||
#endif
|
||||
#ifndef DtNcloseLabelString
|
||||
#define DtNcloseLabelString "closeLabelString"
|
||||
#endif
|
||||
#ifndef DtNprintLabelString
|
||||
#define DtNprintLabelString "printLabelString"
|
||||
#endif
|
||||
|
||||
#ifndef DtCCallback
|
||||
#define DtCCallback XmCCallback
|
||||
#endif
|
||||
|
||||
#ifndef DtCBackLabelString
|
||||
#define DtCBackLabelString "BackLabelString"
|
||||
#endif
|
||||
#ifndef DtCHelpLabelString
|
||||
#define DtCHelpLabelString XmCHelpLabelString
|
||||
#endif
|
||||
#ifndef DtCMoreLabelString
|
||||
#define DtCMoreLabelString "MoreLabelString"
|
||||
#endif
|
||||
#ifndef DtCCloseLabelString
|
||||
#define DtCCloseLabelString "CloseLabelString"
|
||||
#endif
|
||||
#ifndef DtCPrintLabelString
|
||||
#define DtCPrintLabelString "PrintLabelString"
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
|
||||
/* Widget class and instance */
|
||||
|
||||
typedef struct _DtHelpQuickDialogWidgetClassRec * DtHelpQuickDialogWidgetClass;
|
||||
typedef struct _DtHelpQuickDialogWidgetRec * DtHelpQuickDialogWidget;
|
||||
|
||||
|
||||
/*
|
||||
* Data
|
||||
*/
|
||||
|
||||
/* Widget class record */
|
||||
|
||||
externalref WidgetClass dtHelpQuickDialogWidgetClass;
|
||||
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
|
||||
/* tmp backwards compat */
|
||||
#define DtCreateQuickHelpDialog DtCreateHelpQuickDialog
|
||||
|
||||
extern Widget DtCreateHelpQuickDialog(
|
||||
Widget parent,
|
||||
char *name,
|
||||
ArgList arglist,
|
||||
Cardinal argcount);
|
||||
|
||||
extern Widget DtHelpQuickDialogGetChild(
|
||||
Widget widget,
|
||||
unsigned char child);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _Dt_HelpQuickD_h */
|
||||
71
cde/lib/DtHelp/HelpQuickDI.h
Normal file
71
cde/lib/DtHelp/HelpQuickDI.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/* $XConsortium: HelpQuickDI.h /main/6 1996/04/05 14:41:11 mgreess $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: HelpQuickDI.h
|
||||
**
|
||||
** Project: Cache Creek (Rivers) Project:
|
||||
**
|
||||
** Description: Internal header file for QuickHelpDialog Widget.
|
||||
** -----------
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
#ifndef _HelpQuickDI_h
|
||||
#define _HelpQuickDI_h
|
||||
|
||||
#include "DisplayAreaI.h"
|
||||
|
||||
/* General Define for Quick Help Dialog Widget */
|
||||
|
||||
#define DtHELP_TOPIC 1
|
||||
#define DtHELP_STRING 2
|
||||
#define DtMAN_TOPIC 3
|
||||
#define DtFILE_TOPIC 4
|
||||
|
||||
|
||||
/* Access File Expantion Definitions */
|
||||
|
||||
#define DtACCESS_PATH_TYPE "help"
|
||||
#define DtACCESS_PATH_SUFFIX ".rp"
|
||||
|
||||
|
||||
#define DtNULL_TOPIC_STRING "Null Topic"
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpQuickDialogHypertextCB(
|
||||
* DtHelpDispAreaStruct *pDisplayAreaStruct,
|
||||
* XtPointer clientData,
|
||||
* DtHyperTextCallbackStruct *hyperData)
|
||||
*
|
||||
* Parameters: pDisplayAreaStruct Specifies the curretn display are info.
|
||||
*
|
||||
* hyperData Specifies the current hypertext info
|
||||
* structure.
|
||||
*
|
||||
* clientData Specifies the client data passed into
|
||||
* the hypertext callback.
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Process all hypertext requests in a given Help Dialogs
|
||||
* display area.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpQuickDialogHypertextCB (
|
||||
XtPointer pDisplayAreaStruct,
|
||||
XtPointer clientData,
|
||||
DtHelpHyperTextStruct *hyperData);
|
||||
|
||||
|
||||
#endif /* _HelpQuickDI_h */
|
||||
/* Do not add anything after this endif. */
|
||||
155
cde/lib/DtHelp/HelpQuickDP.h
Normal file
155
cde/lib/DtHelp/HelpQuickDP.h
Normal file
@@ -0,0 +1,155 @@
|
||||
/* $XConsortium: HelpQuickDP.h /main/6 1996/04/05 14:41:19 mgreess $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: HelpQuickDP.h
|
||||
**
|
||||
** Project: CDE 1.0 Common Desktop Environment
|
||||
**
|
||||
** Description: Privite Header file for HelpQuickD.c
|
||||
** -----------
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
|
||||
#ifndef _DtHelpQuickDP_h
|
||||
#define _DtHelpQuickDP_h
|
||||
|
||||
#include <Xm/BulletinBP.h>
|
||||
|
||||
#include <Dt/HelpQuickD.h>
|
||||
|
||||
#include "HelpQuickDI.h"
|
||||
#include "HelpDialogP.h"
|
||||
|
||||
|
||||
#define DtNO_JUMP_UPDATE 1
|
||||
#define DtJUMP_UPDATE 2
|
||||
|
||||
|
||||
#define XmDIALOG_SUFFIX "_popup"
|
||||
#define XmDIALOG_SUFFIX_SIZE 6
|
||||
|
||||
|
||||
/* Defines for use in allocation geometry matrix. */
|
||||
#define TB_MAX_WIDGETS_VERT 7
|
||||
#define TB_MAX_NUM_WIDGETS 12
|
||||
|
||||
|
||||
|
||||
/* Class Part Structure Definition */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
XtPointer extension; /* Pointer to extension record */
|
||||
} DtHelpQuickDialogWidgetClassPart;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Full class record declaration */
|
||||
|
||||
typedef struct _DtHelpQuickDialogWidgetClassRec
|
||||
{
|
||||
CoreClassPart core_class;
|
||||
CompositeClassPart composite_class;
|
||||
ConstraintClassPart constraint_class;
|
||||
XmManagerClassPart manager_class;
|
||||
XmBulletinBoardClassPart bulletin_board_class;
|
||||
DtHelpQuickDialogWidgetClassPart selection_box_class;
|
||||
} DtHelpQuickDialogWidgetClassRec;
|
||||
|
||||
externalref DtHelpQuickDialogWidgetClassRec dtHelpQuickDialogWidgetClassRec;
|
||||
|
||||
|
||||
/* fields for the Quick Help widget record */
|
||||
|
||||
/* reuse the CommonHelpStuff structure from HelpDialogP.h */
|
||||
/* reuse the BacktrackStuff structure from HelpDialogP.h */
|
||||
/* reuse the PrintStuff structure from HelpDialogP.h */
|
||||
|
||||
typedef struct _DtHelpQuickHelpStuff
|
||||
{
|
||||
int pad;
|
||||
Widget definitionBox;
|
||||
Boolean minimize_buttons;
|
||||
|
||||
/* Help Dialog Widgets */
|
||||
|
||||
Widget displayAreaFrame;
|
||||
Widget separator;
|
||||
|
||||
Widget closeButton; /* close button */
|
||||
XmString closeLabelString;
|
||||
XtCallbackList closeCallback;
|
||||
|
||||
Widget moreButton; /* Application button */
|
||||
XmString moreLabelString;
|
||||
|
||||
Widget backButton; /* Backtrack button */
|
||||
XmString backLabelString;
|
||||
|
||||
Widget printButton; /* print button */
|
||||
XmString printLabelString;
|
||||
|
||||
Widget helpButton; /* help button */
|
||||
XmString helpLabelString;
|
||||
} _DtHelpQuickHelpStuff;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
_DtHelpDisplayWidgetStuff display;
|
||||
_DtHelpCommonHelpStuff help;
|
||||
_DtHelpQuickHelpStuff qhelp;
|
||||
_DtHelpBacktrackStuff backtr;
|
||||
_DtHelpPrintStuff print;
|
||||
} _DtHelpQuickDialogWidgetPart;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
*
|
||||
* Full instance record declaration
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
typedef struct _DtHelpQuickDialogWidgetRec
|
||||
{
|
||||
CorePart core;
|
||||
CompositePart composite;
|
||||
ConstraintPart constraint;
|
||||
XmManagerPart manager;
|
||||
XmBulletinBoardPart bulletin_board;
|
||||
_DtHelpQuickDialogWidgetPart qhelp_dialog;
|
||||
} DtHelpQuickDialogWidgetRec;
|
||||
|
||||
|
||||
|
||||
/******** Private Function Declarations ********/
|
||||
extern XmGeoMatrix _DtHelpQuickDialogWidgetGeoMatrixCreate(
|
||||
Widget wid,
|
||||
Widget instigator,
|
||||
XtWidgetGeometry *desired) ;
|
||||
extern Boolean _DtHelpQuickDialogWidgetNoGeoRequest(
|
||||
XmGeoMatrix geoSpec) ;
|
||||
extern void _DtHelpQuickDialogGetCloseLabelString(
|
||||
Widget wid,
|
||||
int resource_offset,
|
||||
XtArgVal *value );
|
||||
extern void _DtHelpQuickDialogGetHelpLabelString(
|
||||
Widget wid,
|
||||
int resource_offset,
|
||||
XtArgVal *value );
|
||||
|
||||
/******** End Private Function Declarations ********/
|
||||
|
||||
|
||||
|
||||
#endif /* _DtHelpDialogP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
179
cde/lib/DtHelp/HelpTermP.h
Normal file
179
cde/lib/DtHelp/HelpTermP.h
Normal file
@@ -0,0 +1,179 @@
|
||||
/* $XConsortium: HelpTermP.h /main/4 1995/10/26 12:25:56 rswiston $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: FormatTerm.h
|
||||
**
|
||||
** Project: Cache Creek (Rivers) Project:
|
||||
**
|
||||
** Description: Public Header file for FormatTerm.c, the terminal access
|
||||
** functions.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
#ifndef _DtHelpFormatTermP_h
|
||||
#define _DtHelpFormatTermP_h
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**************************
|
||||
* Link Types and Window
|
||||
* Hints should match what
|
||||
* is in Canvas.h
|
||||
**************************/
|
||||
/**************************
|
||||
* Link Types
|
||||
**************************/
|
||||
|
||||
#ifndef CELinkType_Execute
|
||||
#define CELinkType_Execute 3
|
||||
#endif
|
||||
#ifndef CELinkType_ManPage
|
||||
#define CELinkType_ManPage 4
|
||||
#endif
|
||||
#ifndef CELinkType_AppDefine
|
||||
#define CELinkType_AppDefine 5
|
||||
#endif
|
||||
#ifndef CELinkType_SameVolume
|
||||
#define CELinkType_SameVolume 6
|
||||
#endif
|
||||
#ifndef CELinkType_CrossLink
|
||||
#define CELinkType_CrossLink 7
|
||||
#endif
|
||||
#ifndef CELinkType_TextFile
|
||||
#define CELinkType_TextFile 8
|
||||
#endif
|
||||
|
||||
|
||||
/**************************
|
||||
* Window Hint Kinds
|
||||
**************************/
|
||||
|
||||
#ifndef CEWindowHint_PopupWindow
|
||||
#define CEWindowHint_PopupWindow 1
|
||||
#endif
|
||||
#ifndef CEWindowHint_CurrentWindow
|
||||
#define CEWindowHint_CurrentWindow 2
|
||||
#endif
|
||||
#ifndef CEWindowHint_NewWindow
|
||||
#define CEWindowHint_NewWindow 3
|
||||
#endif
|
||||
|
||||
/******** Public Defines Declarations ********/
|
||||
|
||||
/******** Public Structures Declarations ********/
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Structure: DtHelpHyperLines
|
||||
*
|
||||
* Fields: title Indicates the title of the linked topic.
|
||||
* specification Contains the hypertext link information.
|
||||
* hyper_type Specifies the hypertext links type.
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
typedef struct {
|
||||
char *title;
|
||||
char *specification;
|
||||
int hyper_type;
|
||||
int win_hint;
|
||||
} DtHelpHyperLines;
|
||||
|
||||
|
||||
/******** Public Function Declarations ********/
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: extern void _DtHelpFreeTopicData (
|
||||
* char **helpList,
|
||||
* DtHelpHyperLines *hyperList)
|
||||
*
|
||||
*
|
||||
* Parameters: helpList Specifies the parent widget ID.
|
||||
* hyperList Specifies the name of the created dialog
|
||||
*
|
||||
* Return Value: void.
|
||||
*
|
||||
* Purpose: Free up the info gotten by _DtHelpGetTopicData.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpFreeTopicData (
|
||||
char **helpList,
|
||||
DtHelpHyperLines *hyperList);
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: extern int _DtHelpGetTopicData(
|
||||
* char *helpVolume,
|
||||
* char *locationID,
|
||||
* int maxColumns,
|
||||
* char ***helpList,
|
||||
* DtHelpHyperLines **hyperList);
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
*
|
||||
* Return Value: int value, -1 implies that the function call failed, a
|
||||
* value of 0, implies that the call was successful.
|
||||
*
|
||||
* Purpose: Allows developers to extract semi-formatted ASCII data
|
||||
* from a Cache Creek help file.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern int _DtHelpGetTopicData (
|
||||
char *helpVolume,
|
||||
char *locationID,
|
||||
int maxColumns,
|
||||
char ***helpList,
|
||||
DtHelpHyperLines **hyperList);
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: extern int _DtHelpProcessLinkData(
|
||||
* DtHelpHyperLines *hyperLine,
|
||||
* char **helpVolume,
|
||||
* char **locationId )
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
*
|
||||
* Return Value: int value, -1 implies that the function call failed, a
|
||||
* value of 0, implies that the call was successful.
|
||||
*
|
||||
* Purpose: This function is used in conjunction with the
|
||||
* _DtHelpGetTopicData() function call to provide developers
|
||||
* with a mechanism in which they can traverse Cache Creek
|
||||
* hypertext links. This call will return the file and
|
||||
* locationid information that when used with the
|
||||
* DtGetTopicData function will retrrieve the help text
|
||||
* and new hypertext information associated with the previous
|
||||
* hypertext link information.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern int _DtHelpProcessLinkData (
|
||||
char *ref_volume,
|
||||
DtHelpHyperLines *hyperLine,
|
||||
char **helpVolume,
|
||||
char **locationId);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _DtHelpFormatTermP_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
2451
cde/lib/DtHelp/HelpUtil.c
Normal file
2451
cde/lib/DtHelp/HelpUtil.c
Normal file
File diff suppressed because it is too large
Load Diff
433
cde/lib/DtHelp/HelpUtilI.h
Normal file
433
cde/lib/DtHelp/HelpUtilI.h
Normal file
@@ -0,0 +1,433 @@
|
||||
/* $XConsortium: HelpUtilI.h /main/5 1995/10/26 12:26:30 rswiston $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: HelpUtilI.h
|
||||
**
|
||||
** Project: Rivers Project,
|
||||
**
|
||||
** Description: Internal header file for our HelpUtil module.
|
||||
** -----------
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
|
||||
|
||||
#ifndef _HelpUtilI_h
|
||||
#define _HelpUtilI_h
|
||||
|
||||
|
||||
#include "HelpDialogP.h"
|
||||
|
||||
/* default help4help volume */
|
||||
extern char _DtHelpDefaultHelp4HelpVolume[];
|
||||
extern char _DtHelpDefaultLocationId[];
|
||||
|
||||
/*
|
||||
|
||||
*****************************************************************************
|
||||
* Function: void _DtHelpErrorDialog(parent, message, helpLocationId)
|
||||
*
|
||||
* Parameters: widget Specifies the application's top level widget
|
||||
* message Specifies the desired error message to
|
||||
* display.
|
||||
*
|
||||
* Return Value: None
|
||||
*
|
||||
* Purpose: To display and error message in a motif error dialog.
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
void _DtHelpErrorDialog(
|
||||
Widget parent,
|
||||
char * message);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpFilterExecCmdStr
|
||||
*
|
||||
* Args:
|
||||
* helpWidget: help widget requesting to exec the command
|
||||
* pDisplayStuff: ptr to the DisplayWidget stuff of the help widget
|
||||
* commandStr: command string to execute
|
||||
* ret_cmdStr: the screened & possibly rewritten command is put here
|
||||
* ret_cmdWasAlias: was the command an alias?
|
||||
* ret_execPermitted: if executionPolicy permit exec & ret_cmdStr is valid
|
||||
* ret_queryNeeded: if executionPolicy requires a query before exec
|
||||
*
|
||||
* Description:
|
||||
* ret_cmdStr gets memory owned by the calling function; it should be
|
||||
* freed when no longer needed. The string will be the same as the
|
||||
* commandStr if commandStr was not an alias. If the commandStr
|
||||
* is an alias and if the alias is defined, the ret_cmdStr will be the
|
||||
* value of the alias. If the alias isn't defined, the ret_cmdStr will
|
||||
* be the default command if available, or the alias name otherwise.
|
||||
*
|
||||
* ret_cmdWasAlias will be True if the alias was defined or if the
|
||||
* alias was undefined AND no default command was given.
|
||||
* It will be False if no alias was used or if the alias was undefined
|
||||
* and a default command was present.
|
||||
*
|
||||
* Returns:
|
||||
* True: if execPermitted and a valid command string
|
||||
* False: if if execPermitted is False or invalid command string
|
||||
*
|
||||
* Comments:
|
||||
* This code is written such that we don't need nor want to know
|
||||
* whether it is a general or quick help widget.
|
||||
*
|
||||
* Warning:
|
||||
* command string must be writable; it is written, but left
|
||||
* unchanged when the function exits.
|
||||
*
|
||||
*****************************************************************************/
|
||||
Boolean _DtHelpFilterExecCmdStr(
|
||||
Widget helpWidget,
|
||||
unsigned char executionPolicy,
|
||||
const char * commandStr,
|
||||
char * * ret_cmdStr,
|
||||
Boolean * ret_cmdWasAlias,
|
||||
Boolean * ret_execPermitted,
|
||||
Boolean * ret_queryNeeded,
|
||||
char * hv_path);
|
||||
|
||||
typedef Boolean (*_DtHelpCeWaitProc)(Widget w,void * clientData);
|
||||
|
||||
/*********************************************************************
|
||||
* _DtHelpCeWaitAndProcessEvents
|
||||
*
|
||||
* Purpose:
|
||||
* _DtHelpCeWaitAndProcessEvents will process events and call
|
||||
* the waitProc until waitProc returns False. This function
|
||||
* is useful to put up modal dialogs that must be reponded to
|
||||
* in the midst of executing code that must remain on the call stack.
|
||||
*
|
||||
* Warning:
|
||||
* This function should only be used on modal dialogs.
|
||||
*
|
||||
*********************************************************************/
|
||||
|
||||
void
|
||||
_DtHelpCeWaitAndProcessEvents (
|
||||
Widget w,
|
||||
_DtHelpCeWaitProc waitProc,
|
||||
void * clientData);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpFilterExecCmd
|
||||
*
|
||||
* Args:
|
||||
* helpWidget: help widget requesting to exec the command
|
||||
* command: command string to execute
|
||||
* DtHELP_EXECUTE_???
|
||||
* execPolicy: current policy setting
|
||||
* ret_filteredCmdStr: filtered command string
|
||||
*****************************************************************************/
|
||||
int _DtHelpFilterExecCmd(
|
||||
Widget helpWidget,
|
||||
const char * commandStr,
|
||||
unsigned char executionPolicy,
|
||||
Boolean useQueryDialog,
|
||||
_DtHelpCommonHelpStuff * pHelpStuff,
|
||||
char * * ret_filteredCmdStr,
|
||||
char * hv_path);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpExecFilteredCmd
|
||||
*
|
||||
* Args:
|
||||
* helpWidget: help widget requesting to exec the command
|
||||
* command: command string to execute
|
||||
* modal: is the execution modal (sync) or modeless (async)
|
||||
* helpLocationId: helpOnHelp file location for Help btn in error dialog
|
||||
* pDisplayStuff: ptr to the DisplayWidget stuff of the help widget
|
||||
* pHelpStuff: ptr to the CommonHelp stuff of the help widget
|
||||
*
|
||||
* Comments:
|
||||
* This code is written such that we don't need nor want to know
|
||||
* whether it is a general or quick help widget.
|
||||
*
|
||||
* Warning:
|
||||
* command string must be writable; it is written, but left
|
||||
* unchanged whent the function exits.
|
||||
*
|
||||
* Called by:
|
||||
*****************************************************************************/
|
||||
void _DtHelpExecFilteredCmd(
|
||||
Widget helpWidget,
|
||||
char * commandStr,
|
||||
char * helpLocationId,
|
||||
_DtHelpDisplayWidgetStuff * pDisplayStuff,
|
||||
_DtHelpCommonHelpStuff * pHelpStuff);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: Boolean _DtHelpExpandHelpVolume(DtHelpDialogWidget nw);
|
||||
*
|
||||
*
|
||||
* Parameters: nw Specifies the current help dialog widget.
|
||||
*
|
||||
* Return Value: Boolean.
|
||||
*
|
||||
|
||||
* Description: _DtHelpExpandHelpVolume looks for a $LANG variable in the
|
||||
* helpAccesFile string and if found, replaces it with the
|
||||
* current lang variable.
|
||||
*
|
||||
*****************************************************************************/
|
||||
Boolean _DtHelpExpandHelpVolume(
|
||||
Widget widget,
|
||||
_DtHelpDisplayWidgetStuff * display,
|
||||
_DtHelpCommonHelpStuff * help,
|
||||
_DtHelpPrintStuff * print);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: char *_DtHelpParseIdString(char * specification);
|
||||
*
|
||||
*
|
||||
* Parameters: specification Specifies an author defined help topic.
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Description: This function copies the locationId portion of the
|
||||
* specification and retruns it to the calling routine.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern char *_DtHelpParseIdString(
|
||||
char *specification);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: char *_DtHelpParseAccessFile(char * specification);
|
||||
*
|
||||
*
|
||||
* Parameters: specification Specifies an author defined help topic.
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Description: This function copies the helpAccessFile portion of the
|
||||
* specification and retruns it to the calling routine.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern char *_DtHelpParseAccessFile(
|
||||
char *specification);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpTopicListAddToHead(
|
||||
* char *locationId,
|
||||
* char *topicTitle,
|
||||
* int topicType,
|
||||
* int maxNodex,
|
||||
* char *accessPath,
|
||||
* DtTopicListStruct **pHead,
|
||||
* DtTopicListStruct **pTale,
|
||||
* int *totalNodes)
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Adds an element to the top of the given topicList.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpTopicListAddToHead(
|
||||
char *locationId,
|
||||
XmString topicTitle,
|
||||
int topicType,
|
||||
int maxNodes,
|
||||
char *accessPath,
|
||||
DtTopicListStruct **pHead,
|
||||
DtTopicListStruct **pTale,
|
||||
int *totalNodes,
|
||||
int scrollPosition);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtTopicListDelUeteHead(
|
||||
* DtTopicListStruct *pHead,
|
||||
* DtTopicListStruct *pTale,
|
||||
* totalNodes)
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Delets an element from the top of the given topicList.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpTopicListDeleteHead(
|
||||
DtTopicListStruct **pHead,
|
||||
DtTopicListStruct **pTale,
|
||||
int *totalNodes);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpMapCB(
|
||||
*
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Determins where a new child dialog should be mapped in
|
||||
* relation to its parent.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern XtCallbackProc _DtHelpMapCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data );
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpMapCenteredCB(
|
||||
*
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Determins where the center of our help dialog is and sets
|
||||
* where new child dialog should be mapped such that its centered.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern XtCallbackProc _DtHelpMapCenteredCB(
|
||||
Widget w,
|
||||
XtPointer client_data,
|
||||
XtPointer call_data);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: Boolean _DtHelpResolvePathname(
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: Boolean.
|
||||
*
|
||||
*
|
||||
* Description: _DtHelpResolvePathname attempts to validate and expand a path
|
||||
* to a Cache Creek help access file.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern Boolean _DtHelpResolvePathname(
|
||||
Widget widget,
|
||||
char **fileName,
|
||||
_DtHelpVolumeHdl *volumeHandle,
|
||||
char *sysVolumeSearchPath,
|
||||
char *userVolumeSearchPath);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpDisplayDefinitionBox(
|
||||
* Widget parent,
|
||||
* Widget definitionBox,
|
||||
* char * path,
|
||||
* char * locationId);
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: This routine will create and post the definition box.
|
||||
* (e.g. the Quick Help Dialog widget)
|
||||
*
|
||||
****************************************************************************/
|
||||
extern void _DtHelpDisplayDefinitionBox(
|
||||
Widget parent,
|
||||
Widget **definitionBox,
|
||||
char * path,
|
||||
char * locationId);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpDisplayFormatError()
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: This routine generate and display the proper errror
|
||||
* message to the display area as well as send the proper
|
||||
* error to XmWarning() function.
|
||||
*
|
||||
****************************************************************************/
|
||||
void _DtHelpDisplayFormatError(
|
||||
XtPointer displayArea,
|
||||
Widget widget,
|
||||
char *userError,
|
||||
char *systemError);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpCommonHelpInit()
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: This routine inits common help stuff
|
||||
*
|
||||
****************************************************************************/
|
||||
void _DtHelpInitCommonHelpInit(
|
||||
_DtHelpCommonHelpStuff * help);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpCommonHelpClean()
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: This routine cleans up common help stuff
|
||||
*
|
||||
****************************************************************************/
|
||||
void _DtHelpCommonHelpClean(
|
||||
_DtHelpCommonHelpStuff * help,
|
||||
Boolean destroy);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpSetDlgButtonsWidth
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: This routine cleans up common help stuff
|
||||
*
|
||||
****************************************************************************/
|
||||
void _DtHelpSetButtonPositions(
|
||||
Widget btnList[],
|
||||
int numBtns,
|
||||
Dimension minFormWidth,
|
||||
Dimension btnMargins,
|
||||
Dimension minBetweenBtnSpace);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpXmFontListGetPropertyMax
|
||||
*
|
||||
* Parameters:
|
||||
* fontList: an XmFontList
|
||||
* atom: an XA_xxx value (see Vol 1, chpt 6.2.9)
|
||||
* ret_propertyValue: ptr to long value that will hold the max value
|
||||
*
|
||||
* Return Value:
|
||||
* True: got at least one value
|
||||
* False: unable to get any value
|
||||
*
|
||||
* Purpose:
|
||||
* This function returns the max value of XGetFontProperty calls
|
||||
* for each font in the XmFontList
|
||||
*
|
||||
****************************************************************************/
|
||||
Boolean _DtHelpXmFontListGetPropertyMax(
|
||||
XmFontList fontList,
|
||||
Atom atom,
|
||||
unsigned long *ret_propertyValue);
|
||||
|
||||
#endif /* _HelpUtilI_h */
|
||||
/* Do not add anything after this endif. */
|
||||
|
||||
|
||||
238
cde/lib/DtHelp/HelpXlate.c
Normal file
238
cde/lib/DtHelp/HelpXlate.c
Normal file
@@ -0,0 +1,238 @@
|
||||
/* $XConsortium: HelpXlate.c /main/1 1996/08/22 09:16:03 rswiston $ */
|
||||
/****************************************************************************
|
||||
$FILEBEG$: HelpXlate.c
|
||||
$PROJECT$: Cde 1.0
|
||||
$COMPONENT$: DtXlate service
|
||||
$1LINER$: Implements a translation service using tables and regex search
|
||||
$COPYRIGHT$:
|
||||
(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.
|
||||
$END$
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/param.h> /* MAXPATHLEN */
|
||||
|
||||
/* for Xrm */
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
/*=================================================================
|
||||
$SHAREDBEG$: This header appears in all appropriate DtXlate topics
|
||||
=======================================================$SKIP$======*/
|
||||
/*$INCLUDE$*/
|
||||
#include "HelpXlate.h"
|
||||
#include "Lock.h"
|
||||
/*$END$*/
|
||||
|
||||
static char MyPlatform[_DtPLATFORM_MAX_LEN+1];
|
||||
static _DtXlateDb MyDb = NULL;
|
||||
static int ExecVer;
|
||||
static int CompVer;
|
||||
|
||||
static const char *DfltStdCharset = "ISO-8859-1";
|
||||
static const char *DfltStdLang = "C";
|
||||
|
||||
/*========================================================*/
|
||||
/*================== Private routines ====================*/
|
||||
/*========================================================*/
|
||||
/******************************************************************************
|
||||
* Function: static int OpenLcxDb ()
|
||||
*
|
||||
* Parameters: none
|
||||
*
|
||||
* Return Value: 0: ok
|
||||
* -1: error
|
||||
*
|
||||
* errno Values:
|
||||
*
|
||||
* Purpose: Opens the Ce-private Lcx database
|
||||
*
|
||||
*****************************************************************************/
|
||||
static int
|
||||
OpenLcxDb (void)
|
||||
{
|
||||
time_t time1 = 0;
|
||||
time_t time2 = 0;
|
||||
static short MyProcess = False;
|
||||
static short MyFirst = True;
|
||||
|
||||
/*
|
||||
* wait 30 sec. until another thread or enter is done modifying the table
|
||||
*/
|
||||
while (MyProcess == True)
|
||||
{
|
||||
/* if time out, return */
|
||||
if (time(&time2) == (time_t)-1)
|
||||
return -1;
|
||||
|
||||
if (time1 == 0)
|
||||
time1 = time2;
|
||||
else if (time2 - time1 >= (time_t)30)
|
||||
return -1;
|
||||
}
|
||||
|
||||
_DtHelpProcessLock();
|
||||
if (MyFirst == True)
|
||||
{
|
||||
MyProcess = True;
|
||||
if (_DtLcxOpenAllDbs(&MyDb) == 0 &&
|
||||
_DtXlateGetXlateEnv(MyDb,MyPlatform,&ExecVer,&CompVer) != 0)
|
||||
{
|
||||
_DtLcxCloseDb(&MyDb);
|
||||
MyDb = NULL;
|
||||
}
|
||||
MyFirst = False;
|
||||
MyProcess = False;
|
||||
}
|
||||
_DtHelpProcessUnlock();
|
||||
|
||||
return (MyDb == NULL ? -1 : 0 );
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpCeXlateStdToOpLocale ( char *operation, char *stdLoc
|
||||
ale,
|
||||
* char *dflt_opLocale, char **ret_opLocale
|
||||
)
|
||||
*
|
||||
* Parameters:
|
||||
* operation operation whose locale value will be retrieved
|
||||
* stdLocale standard locale value
|
||||
* dflt_opLocale operation-specific locale-value
|
||||
* This is the default value used in error case
|
||||
* ret_opLocale operation-specific locale-value placed here
|
||||
* Caller must free this string.
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: Gets an operation-specific locale string given the standard string
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpCeXlateStdToOpLocale (
|
||||
char *operation,
|
||||
char *stdLocale,
|
||||
char *dflt_opLocale,
|
||||
char **ret_opLocale)
|
||||
{
|
||||
int result = OpenLcxDb();
|
||||
|
||||
_DtHelpProcessLock();
|
||||
if (result == 0)
|
||||
{
|
||||
(void) _DtLcxXlateStdToOp(MyDb, MyPlatform, CompVer,
|
||||
operation, stdLocale, NULL, NULL, NULL, ret_opLocale);
|
||||
}
|
||||
_DtHelpProcessUnlock();
|
||||
|
||||
/* if translation fails, use a default value */
|
||||
if (ret_opLocale && (result != 0 || *ret_opLocale == NULL))
|
||||
{
|
||||
if (dflt_opLocale) *ret_opLocale = strdup(dflt_opLocale);
|
||||
else if (stdLocale) *ret_opLocale = strdup(stdLocale);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpCeXlateOpToStdLocale (char *operation, char *opLocale
|
||||
,
|
||||
* char **ret_stdLocale, char **ret_stdLang, char **ret_
|
||||
stdSet)
|
||||
*
|
||||
* Parameters:
|
||||
* operation Operation associated with the locale value
|
||||
* opLocale An operation-specific locale string
|
||||
* ret_locale Returns the std locale
|
||||
* Caller must free this string.
|
||||
* ret_stdLang Returns the std language & territory string.
|
||||
* Caller must free this string.
|
||||
* ret_stdSet Returns the std code set string.
|
||||
* Caller must free this string.
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: Gets the standard locale given an operation and its locale
|
||||
*
|
||||
*****************************************************************************/
|
||||
void
|
||||
_DtHelpCeXlateOpToStdLocale (
|
||||
char *operation,
|
||||
char *opLocale,
|
||||
char **ret_stdLocale,
|
||||
char **ret_stdLang,
|
||||
char **ret_stdSet)
|
||||
{
|
||||
int result = OpenLcxDb();
|
||||
|
||||
_DtHelpProcessLock();
|
||||
if (result == 0)
|
||||
{
|
||||
(void) _DtLcxXlateOpToStd(MyDb, MyPlatform, CompVer,
|
||||
operation,opLocale,
|
||||
ret_stdLocale, ret_stdLang, ret_stdSet, NULL);
|
||||
}
|
||||
_DtHelpProcessUnlock();
|
||||
|
||||
/* if failed, give default values */
|
||||
if (ret_stdLocale != NULL && (result != 0 || *ret_stdLocale == NULL))
|
||||
{
|
||||
*ret_stdLocale = malloc(
|
||||
strlen(DfltStdLang)+strlen(DfltStdCharset)+3);
|
||||
sprintf(*ret_stdLocale,"%s.%s",DfltStdLang,DfltStdCharset);
|
||||
}
|
||||
if (ret_stdLang != NULL && (result != 0 || *ret_stdLang == NULL))
|
||||
*ret_stdLang = strdup(DfltStdLang);
|
||||
if (ret_stdSet != NULL && (result != 0 || *ret_stdSet == NULL))
|
||||
*ret_stdSet = strdup(DfltStdCharset);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function: int _DtHelpCeGetMbLen (char *lang, char *char_set)
|
||||
*
|
||||
* Parameters:
|
||||
* lang Represents the language. A NULL value
|
||||
* defaults to "C".
|
||||
* char_set Represents the character set. A NULL
|
||||
* value value defaults to "ISO-8859-1"
|
||||
*
|
||||
* Return Value: Returns the MB_CUR_MAX for the combination
|
||||
* lang.charset.
|
||||
*
|
||||
* errno Values:
|
||||
*
|
||||
* Purpose: To determine the maximum number of bytes required to display
|
||||
* a character if/when the environment is set to 'lang.charset'
|
||||
*
|
||||
*****************************************************************************/
|
||||
int
|
||||
_DtHelpCeGetMbLen (
|
||||
char *lang,
|
||||
char *char_set)
|
||||
{
|
||||
int retLen = 1;
|
||||
|
||||
if (lang == NULL)
|
||||
lang = (char *)DfltStdLang;
|
||||
|
||||
if (char_set == NULL)
|
||||
char_set = (char *)DfltStdCharset;
|
||||
|
||||
_DtHelpProcessLock();
|
||||
if (OpenLcxDb() == 0)
|
||||
{
|
||||
/* if translation is present, lang.charset are a multibyte locale */
|
||||
if (_DtLcxXlateStdToOp(MyDb, MyPlatform, CompVer, DtLCX_OPER_MULTIBYTE,
|
||||
NULL, lang, char_set, NULL, NULL) == 0)
|
||||
retLen = MB_CUR_MAX;
|
||||
}
|
||||
_DtHelpProcessUnlock();
|
||||
|
||||
return retLen;
|
||||
}
|
||||
|
||||
47
cde/lib/DtHelp/HelpXlate.h
Normal file
47
cde/lib/DtHelp/HelpXlate.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/* $XConsortium: HelpXlate.h /main/1 1996/08/22 09:16:20 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: HelpXlate.h
|
||||
**
|
||||
** Project: DtXlate
|
||||
**
|
||||
** Description: DtHelp-specific table-based translation services
|
||||
**
|
||||
** (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 _DtHELP_XLATE_I
|
||||
#define _DtHELP_XLATE_I
|
||||
|
||||
#include <LocaleXlate.h>
|
||||
#include <XlationSvc.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Functions */
|
||||
void _DtHelpCeXlateOpToStdLocale(
|
||||
char *operation,
|
||||
char *opLocale,
|
||||
char **ret_locale,
|
||||
char **ret_lang,
|
||||
char **ret_set);
|
||||
void _DtHelpCeXlateStdToOpLocale(
|
||||
char *operation,
|
||||
char *stdLocale,
|
||||
char *dflt_opLocale,
|
||||
char **ret_opLocale);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*_DtHELP_XLATE_I*/
|
||||
/********* do not put anything below this line ********/
|
||||
382
cde/lib/DtHelp/Helpos.c
Normal file
382
cde/lib/DtHelp/Helpos.c
Normal file
@@ -0,0 +1,382 @@
|
||||
/* $TOG: Helpos.c /main/13 1998/07/30 12:08:32 mgreess $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: Dtos.c
|
||||
**
|
||||
** Project: Rivers Project
|
||||
**
|
||||
** Description: All system/os dependent calls are placed in here.
|
||||
**
|
||||
**
|
||||
** WARNING: Do NOT put any Xt or Xm dependencies in this code.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#define X_INCLUDE_PWD_H
|
||||
#define XOS_USE_XT_LOCKING
|
||||
#include <X11/Xos_r.h>
|
||||
#include <unistd.h>
|
||||
#ifndef _SUN_OS /* don't need the nl_types.h file */
|
||||
# include <nl_types.h>
|
||||
#endif /* ! _SUN_OS */
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/Shell.h>
|
||||
#include <Xm/Xm.h>
|
||||
|
||||
/* Dt Includes */
|
||||
#include <Dt/Help.h>
|
||||
#include <Dt/DtNlUtils.h>
|
||||
|
||||
#include "HelpP.h"
|
||||
#include "HelpI.h"
|
||||
#include "HelposI.h"
|
||||
#include "Lock.h"
|
||||
|
||||
#ifndef NL_CAT_LOCALE
|
||||
static const int NL_CAT_LOCALE = 0;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Global Message Catalog file names */
|
||||
static char *CatFileName=NULL;
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: Boolean _DtHelpOSGetHomeDirName(
|
||||
*
|
||||
*
|
||||
* Parameters: Output string, size of output string
|
||||
*
|
||||
* Return Value: String.
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
*****************************************************************************/
|
||||
void _DtHelpOSGetHomeDirName(
|
||||
String outptr,
|
||||
size_t len)
|
||||
|
||||
/* outptr is allocated outside this function, just filled here. */
|
||||
/* this solution leads to less change in the current (mwm) code */
|
||||
{
|
||||
int uid;
|
||||
static char *ptr = NULL;
|
||||
_Xgetpwparams pwd_buf;
|
||||
struct passwd * pwd_ret;
|
||||
|
||||
_DtHelpProcessLock();
|
||||
if (ptr == NULL) {
|
||||
if((ptr = (char *)getenv("HOME")) == NULL) {
|
||||
if((ptr = (char *)getenv("USER")) != NULL)
|
||||
pwd_ret = _XGetpwnam(ptr, pwd_buf);
|
||||
else {
|
||||
uid = getuid();
|
||||
pwd_ret = _XGetpwuid(uid, pwd_buf);
|
||||
}
|
||||
if (pwd_ret != NULL)
|
||||
ptr = pwd_ret->pw_dir;
|
||||
else
|
||||
ptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (ptr) {
|
||||
strncpy(outptr, ptr, len);
|
||||
outptr[len-1] = '\0'; /* Make sure it is Null terminated */
|
||||
}
|
||||
else
|
||||
outptr[0] = '\0' ;
|
||||
_DtHelpProcessUnlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpGetUserSearchPath(
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: String, owned by caller.
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* Gets the user search path for use
|
||||
* when searching for a volume.
|
||||
* Takes path from the environment,
|
||||
* or uses the default path.
|
||||
*
|
||||
*****************************************************************************/
|
||||
String _DtHelpGetUserSearchPath(void)
|
||||
{
|
||||
String path;
|
||||
char homedir[MAXPATHLEN];
|
||||
String localPath;
|
||||
extern char * _DtCliSrvGetDtUserSession(); /* in libCliSrv */
|
||||
|
||||
localPath = (char *)getenv (DtUSER_FILE_SEARCH_ENV);
|
||||
if (localPath == NULL)
|
||||
{
|
||||
char * session;
|
||||
|
||||
/* Use our default path */
|
||||
_DtHelpOSGetHomeDirName(homedir, sizeof(homedir));
|
||||
session = _DtCliSrvGetDtUserSession();
|
||||
|
||||
path = calloc(1, 3*strlen(session) + 6*strlen(homedir) +
|
||||
strlen(DtDEFAULT_USER_PATH_FORMAT));
|
||||
sprintf(path, DtDEFAULT_USER_PATH_FORMAT,
|
||||
homedir, session, homedir, session, homedir, session,
|
||||
homedir, homedir, homedir);
|
||||
free(session);
|
||||
/* homedir is a local array */
|
||||
|
||||
/* Return our expanded default path */
|
||||
return(path);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Make a local copy for us */
|
||||
localPath = strdup(localPath);
|
||||
|
||||
/* Just Use our local path */
|
||||
return (localPath);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpGetSystemSearchPath(
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: String, owned by caller.
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* Gets the system search path for use
|
||||
* when searching for a volume.
|
||||
* Takes path from the environment,
|
||||
* or uses the default path.
|
||||
*
|
||||
*****************************************************************************/
|
||||
String _DtHelpGetSystemSearchPath(void)
|
||||
{
|
||||
char * path;
|
||||
|
||||
/* try to retrieve env var value */
|
||||
path = getenv(DtSYS_FILE_SEARCH_ENV);
|
||||
|
||||
/* if fail, use default */
|
||||
if (NULL == path)
|
||||
path = DtDEFAULT_SYSTEM_PATH;
|
||||
|
||||
return strdup(path);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void DtHelpSetCatalogName(char *catFile);
|
||||
*
|
||||
*
|
||||
* Parameters: catFile Specifies the name of the message catalog file
|
||||
* to use.
|
||||
*
|
||||
* Return Value: void
|
||||
*
|
||||
*
|
||||
* Description: This function will set the name of the message catalog file
|
||||
* within the Dt help system environment.
|
||||
*
|
||||
* The new name must be of the format <name>.cat and the file
|
||||
* must be installed such that the NLS search path can find it.
|
||||
*
|
||||
* If this function is not called then the default value of
|
||||
* Dt.cat will be used.
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
void DtHelpSetCatalogName(
|
||||
char* catFile)
|
||||
{
|
||||
int len;
|
||||
|
||||
_DtHelpProcessLock();
|
||||
/* Setup our Message Catalog file names */
|
||||
if (catFile == NULL)
|
||||
{
|
||||
/* Setup the short and long versions */
|
||||
#ifdef __ultrix
|
||||
CatFileName = strdup("DtHelp.cat");
|
||||
#else
|
||||
CatFileName = strdup("DtHelp");
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef __ultrix
|
||||
|
||||
/* If we have a full path, just use it */
|
||||
if (*catFile == '/')
|
||||
CatFileName = strdup(catFile);
|
||||
else
|
||||
{
|
||||
/* We don't have a full path, and the ultirx os needs the
|
||||
* ".cat" extention so let's make sure its there.
|
||||
*/
|
||||
if (strcmp(&catFile[strlen(catFile) -4], ".cat") == 0)
|
||||
CatFileName = strdup(catFile);
|
||||
else
|
||||
{
|
||||
/* Create our CatFileName with the extention */
|
||||
CatFileName = malloc (strlen(catFile) + 5);
|
||||
/* +5, 1 for NULL, 4 for ".cat" */
|
||||
strcpy(CatFileName, catFile);
|
||||
strcat(CatFileName, ".cat");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
/* If we have a full path, just use it */
|
||||
if (*catFile == '/')
|
||||
CatFileName = strdup(catFile);
|
||||
else
|
||||
{
|
||||
/* hp-ux os does not work with the ".cat" extention, so
|
||||
* if one exists, remove it.
|
||||
*/
|
||||
|
||||
if (strcmp(&catFile[strlen(catFile) -4], ".cat") != 0)
|
||||
CatFileName = strdup(catFile);
|
||||
else
|
||||
{
|
||||
/* Create our CatFileName with out the extention */
|
||||
len = strlen(catFile) -4;
|
||||
CatFileName = malloc(len +1);
|
||||
strncpy (CatFileName, catFile, len);
|
||||
CatFileName[len]= '\0';
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
_DtHelpProcessUnlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifndef NO_MESSAGE_CATALOG
|
||||
/*****************************************************************************
|
||||
* Function: Boolean _DtHelpGetMessage(
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: char *
|
||||
*
|
||||
*
|
||||
* Description: This function will retreive the requested message from the
|
||||
* cache proper cache creek message catalog file.
|
||||
*
|
||||
*****************************************************************************/
|
||||
char *_DtHelpGetMessage(
|
||||
int set,
|
||||
int n,
|
||||
char *s)
|
||||
{
|
||||
char *msg;
|
||||
char *loc;
|
||||
nl_catd catopen();
|
||||
char *catgets();
|
||||
static int first = 1;
|
||||
static nl_catd nlmsg_fd;
|
||||
|
||||
_DtHelpProcessLock();
|
||||
if ( first )
|
||||
{
|
||||
|
||||
/* Setup our default message catalog names if none have been set! */
|
||||
if (CatFileName == NULL)
|
||||
{
|
||||
/* Setup the short and long versions */
|
||||
#ifdef __ultrix
|
||||
CatFileName = strdup("DtHelp.cat");
|
||||
#else
|
||||
CatFileName = strdup("DtHelp");
|
||||
#endif
|
||||
}
|
||||
|
||||
loc = _DtHelpGetLocale();
|
||||
if (!loc || !(strcmp (loc, "C")))
|
||||
/*
|
||||
* If LANG is not set or if LANG=C, then there
|
||||
* is no need to open the message catalog - just
|
||||
* return the built-in string "s".
|
||||
*/
|
||||
nlmsg_fd = (nl_catd) -1;
|
||||
else
|
||||
nlmsg_fd = catopen(CatFileName, NL_CAT_LOCALE);
|
||||
|
||||
first = 0;
|
||||
}
|
||||
|
||||
msg=catgets(nlmsg_fd,set,n,s);
|
||||
_DtHelpProcessUnlock();
|
||||
return (msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: char * _DtHelpGetLocale(
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: char *
|
||||
*
|
||||
*
|
||||
* Description: Returns the value of LC_MESSAGES from the environ.
|
||||
* If that is NULL, returns the value of LANG form the environ.
|
||||
* If that is NULL, returns NULL.
|
||||
*
|
||||
*****************************************************************************/
|
||||
char *_DtHelpGetLocale()
|
||||
{
|
||||
char *loc;
|
||||
|
||||
loc = setlocale(LC_MESSAGES, NULL);
|
||||
if (NULL == loc || '\0' == loc[0]) loc = getenv("LANG");
|
||||
if (NULL == loc || '\0' == loc[0]) return NULL;
|
||||
|
||||
loc = strdup(loc); /* getenv() returns ptr to private memory */
|
||||
return loc;
|
||||
}
|
||||
|
||||
137
cde/lib/DtHelp/HelposI.h
Normal file
137
cde/lib/DtHelp/HelposI.h
Normal file
@@ -0,0 +1,137 @@
|
||||
/* $TOG: HelposI.h /main/8 1998/07/28 15:38:41 mgreess $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: DtosI.h
|
||||
**
|
||||
** Project: Rivers Project,
|
||||
**
|
||||
** Description: Internal header file for our Dtos.c module
|
||||
** -----------
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
#ifndef _DtosI_h
|
||||
#define _DtosI_h
|
||||
|
||||
|
||||
#ifndef NO_MESSAGE_CATALOG
|
||||
# define _DTGETMESSAGE(set, n, s) _DtHelpGetMessage(set, n, s)
|
||||
#else
|
||||
# define _DTGETMESSAGE(set, n, s) s
|
||||
#endif
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: Boolean _DtHelpOSGetHomeDirName(
|
||||
*
|
||||
*
|
||||
* Parameters: Output string, size of output string buffer
|
||||
*
|
||||
* Return Value: String.
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpOSGetHomeDirName(
|
||||
String outptr,
|
||||
size_t len);
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpGetUserSearchPath(
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: String, owned by caller.
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* Gets the user search path for use
|
||||
* when searching for a volume.
|
||||
* Takes path from the environment,
|
||||
* or uses the default path.
|
||||
*
|
||||
*****************************************************************************/
|
||||
String _DtHelpGetUserSearchPath(void);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: _DtHelpGetSystemSearchPath(
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: String, owned by caller.
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* Gets the system search path for use
|
||||
* when searching for a volume.
|
||||
* Takes path from the environment,
|
||||
* or uses the default path.
|
||||
*
|
||||
*****************************************************************************/
|
||||
String _DtHelpGetSystemSearchPath(void);
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: Boolean _DtHelpGetMessage(
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: char *
|
||||
*
|
||||
*
|
||||
* Description: This function will retreive the requested message from the
|
||||
* cache proper cache creek message catalog file.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern char *_DtHelpGetMessage(
|
||||
int set,
|
||||
int n,
|
||||
char *s);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: char * _DtHelpGetLocale(
|
||||
*
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return Value: char *
|
||||
*
|
||||
*
|
||||
* Description: Returns the value of LC_MESSAGES from the environ.
|
||||
* If that is NULL, returns the value of LANG form the environ.
|
||||
* If that is NULL, returns NULL.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern char *_DtHelpGetLocale(void);
|
||||
|
||||
|
||||
#endif /* _DtosI_h */
|
||||
/* Do not add anything after this endif. */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1117
cde/lib/DtHelp/History.c
Normal file
1117
cde/lib/DtHelp/History.c
Normal file
File diff suppressed because it is too large
Load Diff
84
cde/lib/DtHelp/HistoryI.h
Normal file
84
cde/lib/DtHelp/HistoryI.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/* $XConsortium: HistoryI.h /main/5 1996/08/28 19:08:20 cde-hp $ */
|
||||
/*************************************<+>*************************************
|
||||
*****************************************************************************
|
||||
**
|
||||
** File: HistoryI.h
|
||||
**
|
||||
** Project: Cache Creek (Rivers) Project:
|
||||
**
|
||||
** Description: Internal header file for HistoryI.c
|
||||
** -----------
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
*******************************************************************
|
||||
*************************************<+>*************************************/
|
||||
#ifndef _HistoryI_h
|
||||
#define _HistoryI_h
|
||||
|
||||
|
||||
#define DtHISTORY_LIST_MAX 999 /* ??? This should be a resource ??? */
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpDisplayHistoryInfo(Widget nw);
|
||||
*
|
||||
*
|
||||
* Parameters: nw Specifies the name of the current help dialog
|
||||
* widget.
|
||||
*
|
||||
* Return Value:
|
||||
*
|
||||
* Purpose: Displays the pre-created history dialog.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpDisplayHistoryInfo(
|
||||
Widget nw);
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Function: void _DtHelpUpdateHistoryList(char *locationId,
|
||||
* Widget nw);
|
||||
*
|
||||
*
|
||||
* Parameters: parent Specifies the ID string for the new topic we
|
||||
* are going to display in the HelpDialog widget.
|
||||
*
|
||||
* helpDialogWidget Specifies the current help dialog widget.
|
||||
*
|
||||
* Return Value: Void.
|
||||
*
|
||||
* Purpose: Updates the Path Display area on top of the help
|
||||
* dialog.
|
||||
*
|
||||
*****************************************************************************/
|
||||
extern void _DtHelpUpdateHistoryList(
|
||||
char *locationId,
|
||||
int topicType,
|
||||
Boolean vol_changed,
|
||||
Widget nw);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* _HistoryI_h */
|
||||
/* Do not add anything after this endif. */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
467
cde/lib/DtHelp/HourGlass.c
Normal file
467
cde/lib/DtHelp/HourGlass.c
Normal file
@@ -0,0 +1,467 @@
|
||||
/* $XConsortium: HourGlass.c /main/6 1996/04/13 11:55:39 ageorge $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: HourGlass.c
|
||||
**
|
||||
** Project: coe Dt Utility function
|
||||
**
|
||||
** Description: This module contains a simple function for
|
||||
** creating an hourglass cursor.
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
|
||||
#include "Lock.h"
|
||||
|
||||
#define time32_width 32
|
||||
#define time32_height 32
|
||||
#define time32_x_hot 15
|
||||
#define time32_y_hot 15
|
||||
static unsigned char time32_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f,
|
||||
0x8c, 0x00, 0x00, 0x31, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32,
|
||||
0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32,
|
||||
0x8c, 0x00, 0x00, 0x31, 0x0c, 0x7f, 0xfe, 0x30, 0x0c, 0xfe, 0x7f, 0x30,
|
||||
0x0c, 0xfc, 0x3f, 0x30, 0x0c, 0xf8, 0x1f, 0x30, 0x0c, 0xe0, 0x07, 0x30,
|
||||
0x0c, 0x80, 0x01, 0x30, 0x0c, 0x80, 0x01, 0x30, 0x0c, 0x60, 0x06, 0x30,
|
||||
0x0c, 0x18, 0x18, 0x30, 0x0c, 0x04, 0x20, 0x30, 0x0c, 0x02, 0x40, 0x30,
|
||||
0x0c, 0x01, 0x80, 0x30, 0x8c, 0x00, 0x00, 0x31, 0x4c, 0x80, 0x01, 0x32,
|
||||
0x4c, 0xc0, 0x03, 0x32, 0x4c, 0xf0, 0x1f, 0x32, 0x4c, 0xff, 0xff, 0x32,
|
||||
0xcc, 0xff, 0xff, 0x33, 0x8c, 0xff, 0xff, 0x31, 0xfe, 0xff, 0xff, 0x7f,
|
||||
0xfe, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
#define time32m_width 32
|
||||
#define time32m_height 32
|
||||
static unsigned char time32m_bits[] = {
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xcf, 0x00, 0x00, 0xf3, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76,
|
||||
0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76,
|
||||
0xce, 0x00, 0x00, 0x73, 0x8e, 0x7f, 0xfe, 0x71, 0x0e, 0xff, 0xff, 0x70,
|
||||
0x0e, 0xfe, 0x7f, 0x70, 0x0e, 0xfc, 0x3f, 0x70, 0x0e, 0xf8, 0x1f, 0x70,
|
||||
0x0e, 0xe0, 0x07, 0x70, 0x0e, 0xe0, 0x07, 0x70, 0x0e, 0x78, 0x1e, 0x70,
|
||||
0x0e, 0x1c, 0x38, 0x70, 0x0e, 0x06, 0x60, 0x70, 0x0e, 0x03, 0xc0, 0x70,
|
||||
0x8e, 0x01, 0x80, 0x71, 0xce, 0x00, 0x00, 0x73, 0x6e, 0x80, 0x01, 0x76,
|
||||
0x6e, 0xc0, 0x03, 0x76, 0x6e, 0xf0, 0x1f, 0x76, 0x6e, 0xff, 0xff, 0x76,
|
||||
0xee, 0xff, 0xff, 0x77, 0xcf, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||
|
||||
|
||||
#define time16_x_hot 7
|
||||
#define time16_y_hot 7
|
||||
#define time16_width 16
|
||||
#define time16_height 16
|
||||
static unsigned char time16_bits[] = {
|
||||
0x00, 0x00, 0xfe, 0x7f, 0x14, 0x28, 0x14, 0x28, 0x14, 0x28, 0x24, 0x24,
|
||||
0x44, 0x22, 0x84, 0x21, 0x84, 0x21, 0x44, 0x22, 0x24, 0x24, 0x14, 0x28,
|
||||
0x94, 0x29, 0xd4, 0x2b, 0xfe, 0x7f, 0x00, 0x00};
|
||||
|
||||
#define time16m_width 16
|
||||
#define time16m_height 16
|
||||
static unsigned char time16m_bits[] = {
|
||||
0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f,
|
||||
0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f,
|
||||
0xfe, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff};
|
||||
|
||||
#define noenter32_width 32
|
||||
#define noenter32_height 32
|
||||
#define noenter32_x_hot 15
|
||||
#define noenter32_y_hot 15
|
||||
|
||||
static unsigned char noenter32_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xfc, 0x3f, 0x00,
|
||||
0x00, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0x03,
|
||||
0xe0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0x1f,
|
||||
0xf8, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
|
||||
0xfc, 0xff, 0xff, 0x3f, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60,
|
||||
0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60,
|
||||
0x06, 0x00, 0x00, 0x60, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
|
||||
0xfc, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f,
|
||||
0xf0, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0x03,
|
||||
0x80, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfc, 0x3f, 0x00,
|
||||
0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char noenter32m_bits[] = {
|
||||
0x00, 0xe0, 0x07, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x00,
|
||||
0x80, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07,
|
||||
0xf0, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x3f,
|
||||
0xfc, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f,
|
||||
0xfe, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f,
|
||||
0xfe, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f,
|
||||
0xf8, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0x07,
|
||||
0xc0, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x00,
|
||||
0x00, 0xfc, 0x3f, 0x00, 0x00, 0xe0, 0x07, 0x00};
|
||||
|
||||
#define noenter16_width 16
|
||||
#define noenter16_height 16
|
||||
#define noenter16_x_hot 7
|
||||
#define noenter16_y_hot 7
|
||||
|
||||
static unsigned char noenter16_bits[] = {
|
||||
0x00, 0x00, 0xc0, 0x03, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc, 0x3f, 0xfc, 0x3f,
|
||||
0xfe, 0x7f, 0x02, 0x40, 0x02, 0x40, 0xfe, 0x7f, 0xfc, 0x3f, 0xfc, 0x3f,
|
||||
0xf8, 0x1f, 0xf0, 0x0f, 0xc0, 0x03, 0x00, 0x00};
|
||||
|
||||
static unsigned char noenter16m_bits[] = {
|
||||
0xc0, 0x03, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc, 0x3f, 0xfe, 0x7f, 0xfe, 0x7f,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfe, 0x7f,
|
||||
0xfc, 0x3f, 0xf8, 0x1f, 0xf0, 0x0f, 0xc0, 0x03};
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* Cursor GetNoEnterCursor ()
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Builds and returns the appropriate Hourglass cursor
|
||||
*
|
||||
*
|
||||
* Inputs:
|
||||
* ------
|
||||
* dpy = display
|
||||
*
|
||||
* Outputs:
|
||||
* -------
|
||||
* Return = cursor.
|
||||
*
|
||||
* Comments:
|
||||
* --------
|
||||
* None. (None doesn't count as a comment)
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
static Cursor
|
||||
GetNoEnterCursor(
|
||||
Display *dpy )
|
||||
{
|
||||
char *bits;
|
||||
char *maskBits;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
unsigned int xHotspot;
|
||||
unsigned int yHotspot;
|
||||
Pixmap pixmap;
|
||||
Pixmap maskPixmap;
|
||||
XColor xcolors[2];
|
||||
int scr;
|
||||
unsigned int cWidth;
|
||||
unsigned int cHeight;
|
||||
int useLargeCursors = 0;
|
||||
static Cursor waitCursor=0;
|
||||
|
||||
_DtHelpProcessLock();
|
||||
|
||||
if (waitCursor != 0)
|
||||
{
|
||||
_DtHelpProcessUnlock();
|
||||
return(waitCursor);
|
||||
}
|
||||
|
||||
if (XQueryBestCursor (dpy, DefaultRootWindow(dpy),
|
||||
32, 32, &cWidth, &cHeight))
|
||||
{
|
||||
if ((cWidth >= 32) && (cHeight >= 32))
|
||||
{
|
||||
useLargeCursors = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (useLargeCursors)
|
||||
{
|
||||
width = noenter32_width;
|
||||
height = noenter32_height;
|
||||
bits = (char *) noenter32_bits;
|
||||
maskBits = (char *) noenter32m_bits;
|
||||
xHotspot = noenter32_x_hot;
|
||||
yHotspot = noenter32_y_hot;
|
||||
}
|
||||
else
|
||||
{
|
||||
width = noenter16_width;
|
||||
height = noenter16_height;
|
||||
bits = (char *) noenter16_bits;
|
||||
maskBits = (char *) noenter16m_bits;
|
||||
xHotspot = noenter16_x_hot;
|
||||
yHotspot = noenter16_y_hot;
|
||||
}
|
||||
|
||||
pixmap = XCreateBitmapFromData (dpy,
|
||||
DefaultRootWindow(dpy), bits,
|
||||
width, height);
|
||||
|
||||
|
||||
maskPixmap = XCreateBitmapFromData (dpy,
|
||||
DefaultRootWindow(dpy), maskBits,
|
||||
width, height);
|
||||
|
||||
xcolors[0].pixel = BlackPixelOfScreen(DefaultScreenOfDisplay(dpy));
|
||||
xcolors[1].pixel = WhitePixelOfScreen(DefaultScreenOfDisplay(dpy));
|
||||
|
||||
XQueryColors (dpy,
|
||||
DefaultColormapOfScreen(DefaultScreenOfDisplay
|
||||
(dpy)), xcolors, 2);
|
||||
|
||||
waitCursor = XCreatePixmapCursor (dpy, pixmap, maskPixmap,
|
||||
&(xcolors[0]), &(xcolors[1]),
|
||||
xHotspot, yHotspot);
|
||||
XFreePixmap (dpy, pixmap);
|
||||
XFreePixmap (dpy, maskPixmap);
|
||||
|
||||
_DtHelpProcessUnlock();
|
||||
return (waitCursor);
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* Cursor _DtHelpGetHourGlassCursor ()
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Builds and returns the appropriate Hourglass cursor
|
||||
*
|
||||
*
|
||||
* Inputs:
|
||||
* ------
|
||||
* dpy = display
|
||||
*
|
||||
* Outputs:
|
||||
* -------
|
||||
* Return = cursor.
|
||||
*
|
||||
* Comments:
|
||||
* --------
|
||||
* None. (None doesn't count as a comment)
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
Cursor
|
||||
_DtHelpGetHourGlassCursor(
|
||||
Display *dpy )
|
||||
{
|
||||
char *bits;
|
||||
char *maskBits;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
unsigned int xHotspot;
|
||||
unsigned int yHotspot;
|
||||
Pixmap pixmap;
|
||||
Pixmap maskPixmap;
|
||||
XColor xcolors[2];
|
||||
int scr;
|
||||
unsigned int cWidth;
|
||||
unsigned int cHeight;
|
||||
int useLargeCursors = 0;
|
||||
static Cursor waitCursor=0;
|
||||
|
||||
|
||||
if (waitCursor != 0)
|
||||
return(waitCursor);
|
||||
|
||||
if (XQueryBestCursor (dpy, DefaultRootWindow(dpy),
|
||||
32, 32, &cWidth, &cHeight))
|
||||
{
|
||||
if ((cWidth >= 32) && (cHeight >= 32))
|
||||
{
|
||||
useLargeCursors = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (useLargeCursors)
|
||||
{
|
||||
width = time32_width;
|
||||
height = time32_height;
|
||||
bits = (char *) time32_bits;
|
||||
maskBits = (char *) time32m_bits;
|
||||
xHotspot = time32_x_hot;
|
||||
yHotspot = time32_y_hot;
|
||||
}
|
||||
else
|
||||
{
|
||||
width = time16_width;
|
||||
height = time16_height;
|
||||
bits = (char *) time16_bits;
|
||||
maskBits = (char *) time16m_bits;
|
||||
xHotspot = time16_x_hot;
|
||||
yHotspot = time16_y_hot;
|
||||
}
|
||||
|
||||
pixmap = XCreateBitmapFromData (dpy,
|
||||
DefaultRootWindow(dpy), bits,
|
||||
width, height);
|
||||
|
||||
|
||||
maskPixmap = XCreateBitmapFromData (dpy,
|
||||
DefaultRootWindow(dpy), maskBits,
|
||||
width, height);
|
||||
|
||||
xcolors[0].pixel = BlackPixelOfScreen(DefaultScreenOfDisplay(dpy));
|
||||
xcolors[1].pixel = WhitePixelOfScreen(DefaultScreenOfDisplay(dpy));
|
||||
|
||||
XQueryColors (dpy,
|
||||
DefaultColormapOfScreen(DefaultScreenOfDisplay
|
||||
(dpy)), xcolors, 2);
|
||||
|
||||
waitCursor = XCreatePixmapCursor (dpy, pixmap, maskPixmap,
|
||||
&(xcolors[0]), &(xcolors[1]),
|
||||
xHotspot, yHotspot);
|
||||
XFreePixmap (dpy, pixmap);
|
||||
XFreePixmap (dpy, maskPixmap);
|
||||
|
||||
return (waitCursor);
|
||||
}
|
||||
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* void _DtSetHourGlass
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* sets the window cursor to an hourglass
|
||||
*
|
||||
*
|
||||
* Inputs:
|
||||
* ------
|
||||
* w = Widget
|
||||
*
|
||||
* Outputs:
|
||||
* -------
|
||||
* None
|
||||
*
|
||||
* Comments:
|
||||
* --------
|
||||
* None. (None doesn't count as a comment)
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
|
||||
void
|
||||
_DtHelpTurnOnHourGlass(
|
||||
Widget w )
|
||||
{
|
||||
Cursor cursor;
|
||||
|
||||
cursor = _DtHelpGetHourGlassCursor(XtDisplay(w));
|
||||
|
||||
XDefineCursor(XtDisplay(w), XtWindow(w), cursor);
|
||||
XFlush(XtDisplay(w));
|
||||
}
|
||||
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* void _DtHelpTurnOffHourGlass
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Removed the hourglass cursor from a window
|
||||
*
|
||||
*
|
||||
* Inputs:
|
||||
* ------
|
||||
* w = Widget
|
||||
*
|
||||
* Outputs:
|
||||
* -------
|
||||
* None
|
||||
*
|
||||
* Comments:
|
||||
* --------
|
||||
* None. (None doesn't count as a comment)
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
|
||||
void
|
||||
_DtHelpTurnOffHourGlass(
|
||||
Widget w )
|
||||
{
|
||||
|
||||
XUndefineCursor(XtDisplay(w), XtWindow(w));
|
||||
XFlush(XtDisplay(w));
|
||||
}
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* void _DtHelpTurnOnNoEnter
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* sets the window cursor to a 'no enter' sign
|
||||
*
|
||||
*
|
||||
* Inputs:
|
||||
* ------
|
||||
* w = Widget
|
||||
*
|
||||
* Outputs:
|
||||
* -------
|
||||
* None
|
||||
*
|
||||
* Comments:
|
||||
* --------
|
||||
* None. (None doesn't count as a comment)
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
|
||||
void
|
||||
_DtHelpTurnOnNoEnter(
|
||||
Widget w )
|
||||
{
|
||||
Cursor cursor;
|
||||
|
||||
cursor = GetNoEnterCursor(XtDisplay(w));
|
||||
|
||||
XDefineCursor(XtDisplay(w), XtWindow(w), cursor);
|
||||
XFlush(XtDisplay(w));
|
||||
}
|
||||
|
||||
|
||||
/*************************************<->*************************************
|
||||
*
|
||||
* void _DtHelpTurnOffNoEnter
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* -----------
|
||||
* Removed the 'no enter' cursor from a window
|
||||
*
|
||||
*
|
||||
* Inputs:
|
||||
* ------
|
||||
* w = Widget
|
||||
*
|
||||
* Outputs:
|
||||
* -------
|
||||
* None
|
||||
*
|
||||
* Comments:
|
||||
* --------
|
||||
* None. (None doesn't count as a comment)
|
||||
*
|
||||
*************************************<->***********************************/
|
||||
|
||||
void
|
||||
_DtHelpTurnOffNoEnter(
|
||||
Widget w )
|
||||
{
|
||||
|
||||
XUndefineCursor(XtDisplay(w), XtWindow(w));
|
||||
XFlush(XtDisplay(w));
|
||||
}
|
||||
98
cde/lib/DtHelp/HourGlassI.h
Normal file
98
cde/lib/DtHelp/HourGlassI.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/* $XConsortium: HourGlassI.h /main/5 1995/10/26 12:27:38 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: HourGlassI.h
|
||||
**
|
||||
** Project: Cache Creek
|
||||
**
|
||||
** Description: Internal include file for HourGlass Library.
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
#ifndef _hourglassI_h
|
||||
#define _hourglassI_h
|
||||
|
||||
/* DtHelpGetHourGlassCursor -
|
||||
*
|
||||
* Builds and returns the appropriate HourGlass cursor.
|
||||
*/
|
||||
|
||||
extern Cursor DtHelpGetHourGlassCursor(
|
||||
Display *dpy) ;
|
||||
|
||||
/* DtHelpTurnOnHourGlass -
|
||||
*
|
||||
* Gets and displays an hourglass cursor in the window of the widget
|
||||
* which is passed in to the funciton.
|
||||
*/
|
||||
|
||||
extern void _DtHelpTurnOnHourGlass(
|
||||
Widget w) ;
|
||||
|
||||
/* Widget widget;
|
||||
*
|
||||
* widget is the toplevel shell of the window you want
|
||||
* the hourglass cursor to appear in.
|
||||
*/
|
||||
|
||||
|
||||
/* DtHelpTurnOffHourGlass -
|
||||
*
|
||||
* Removes the hourglass cursor from the window of the widget
|
||||
* which is passed in to the funciton.
|
||||
*/
|
||||
|
||||
extern void _DtHelpTurnOffHourGlass(
|
||||
Widget w) ;
|
||||
|
||||
/* Widget widget;
|
||||
*
|
||||
* widget is the toplevel shell of the window you want
|
||||
* to remove hourglass cursor from.
|
||||
*/
|
||||
|
||||
/* DtHelpTurnOnNoEnter -
|
||||
*
|
||||
* Removes the hourglass cursor from the window of the widget
|
||||
* which is passed in to the funciton.
|
||||
*/
|
||||
|
||||
extern void _DtHelpTurnOnNoEnter(
|
||||
Widget w) ;
|
||||
|
||||
/* Widget widget;
|
||||
*
|
||||
* widget is the toplevel shell of the window you want
|
||||
* to remove hourglass cursor from.
|
||||
*/
|
||||
|
||||
/* DtHelpTurnOffNoEnter -
|
||||
*
|
||||
* Removes the hourglass cursor from the window of the widget
|
||||
* which is passed in to the funciton.
|
||||
*/
|
||||
|
||||
extern void _DtHelpTurnOffNoEnter(
|
||||
Widget w) ;
|
||||
|
||||
/* Widget widget;
|
||||
*
|
||||
* widget is the toplevel shell of the window you want
|
||||
* to remove hourglass cursor from.
|
||||
*/
|
||||
|
||||
|
||||
#endif /* _hourglassI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
334
cde/lib/DtHelp/HyperText.c
Normal file
334
cde/lib/DtHelp/HyperText.c
Normal file
@@ -0,0 +1,334 @@
|
||||
/* $TOG: HyperText.c /main/9 1999/10/14 14:45:38 mgreess $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: HyperText.c
|
||||
**
|
||||
** Project: Text Graphic Display Library
|
||||
**
|
||||
** Description: This body of code does all the work for hypertext links
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
|
||||
/*
|
||||
* system includes
|
||||
*/
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef __hpux
|
||||
#include <time.h>
|
||||
#else /* SUN and IBM */
|
||||
#ifdef _AIX
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <sys/wait.h>
|
||||
#include <Xm/DialogS.h>
|
||||
|
||||
|
||||
/*
|
||||
* Canvas Engine
|
||||
*/
|
||||
#include "CanvasP.h"
|
||||
|
||||
/*
|
||||
* private includes
|
||||
*/
|
||||
#include "HelpErrorP.h"
|
||||
#include "DisplayAreaP.h"
|
||||
#include "DisplayAreaI.h"
|
||||
#include "FontI.h"
|
||||
#include "HourGlassI.h"
|
||||
#include "HyperTextI.h"
|
||||
#include "HelposI.h"
|
||||
|
||||
#ifdef NLS16
|
||||
#endif
|
||||
|
||||
/******** Private Function Declarations ********/
|
||||
static void ProcessEvents (
|
||||
DtHelpDispAreaStruct *pDAS,
|
||||
pid_t child_pid,
|
||||
Boolean child_flag);
|
||||
/******** End Private Function Declarations ********/
|
||||
|
||||
/*********************************************************************
|
||||
* Private Variables
|
||||
*********************************************************************/
|
||||
|
||||
typedef struct {
|
||||
char *link_spec;
|
||||
int type;
|
||||
char *descrip;
|
||||
} HyperList;
|
||||
|
||||
/*********************************************************************
|
||||
* Private Functions
|
||||
*********************************************************************/
|
||||
/*********************************************************************
|
||||
* ProcessEvents
|
||||
*
|
||||
* ProcessEvents will do a select on the socket until the child
|
||||
* dies.
|
||||
*
|
||||
*********************************************************************/
|
||||
static void
|
||||
ProcessEvents (
|
||||
DtHelpDispAreaStruct *pDAS,
|
||||
pid_t child_pid,
|
||||
Boolean child_flag)
|
||||
{
|
||||
int result;
|
||||
|
||||
int rMask;
|
||||
int myFd;
|
||||
pid_t pid;
|
||||
struct timeval *topPtr;
|
||||
struct timeval toStruct;
|
||||
|
||||
Display *dpy = XtDisplay (pDAS->dispWid);
|
||||
XEvent event;
|
||||
|
||||
|
||||
/*
|
||||
* set a small time out.
|
||||
*/
|
||||
toStruct.tv_usec = 500000; /* 500 miliseconds */
|
||||
toStruct.tv_sec = 0;
|
||||
topPtr = &toStruct;
|
||||
|
||||
/*
|
||||
* get the socket's file descriptor
|
||||
*/
|
||||
myFd = ConnectionNumber (dpy);
|
||||
|
||||
do
|
||||
{
|
||||
rMask = (1 << (myFd % 32)); /* on t.o. select will clear */
|
||||
|
||||
if (!XPending(dpy))
|
||||
{
|
||||
#if 0
|
||||
result = select(myFd+1, &rMask, 0, 0, topPtr);
|
||||
#else
|
||||
result = select(myFd+1, ((fd_set *)&rMask), 0, 0, topPtr);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* check to see if the select happened because of
|
||||
* a system interrupt.
|
||||
*/
|
||||
/*
|
||||
* otherwise an exposure event happened.
|
||||
* fall through and XPending will be true,
|
||||
* forcing us to go to the XmUpdateDisplay call.
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* SYSTEM - Use XtDisplatchEvent????
|
||||
*/
|
||||
XNextEvent (dpy, &event);
|
||||
if (event.type == Expose)
|
||||
XmUpdateDisplay (pDAS->dispWid);
|
||||
}
|
||||
|
||||
/*
|
||||
* check to see if the child is still going
|
||||
*/
|
||||
pid = waitpid (child_pid, (int *) 0, WNOHANG);
|
||||
if (pid == child_pid || pid == -1)
|
||||
child_flag = True;
|
||||
|
||||
} while (!child_flag);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* Internal Public Functions
|
||||
*********************************************************************/
|
||||
/*********************************************************************
|
||||
* _DtHelpExecProcedure
|
||||
*
|
||||
* _DtHelpExecProcedure will fork/exec the command passed in. It will
|
||||
* then allow only exposure events to be processed until the
|
||||
* child dies.
|
||||
*
|
||||
*********************************************************************/
|
||||
void
|
||||
_DtHelpExecProcedure (
|
||||
XtPointer client_data,
|
||||
char *cmd )
|
||||
{
|
||||
pid_t pid;
|
||||
XWindowAttributes attr;
|
||||
char *pShell = "sh";
|
||||
Widget shellWidget;
|
||||
Boolean childFlag = False;
|
||||
pid_t childPid;
|
||||
DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) client_data;
|
||||
|
||||
/*
|
||||
* Turn on the wait cursor.
|
||||
*/
|
||||
shellWidget = pDAS->dispWid;
|
||||
while (!XtIsSubclass(shellWidget, xmDialogShellWidgetClass))
|
||||
shellWidget = XtParent(shellWidget);
|
||||
|
||||
_DtHelpTurnOnHourGlass(shellWidget);
|
||||
/*
|
||||
* Get the window event mask via the window attributes. Remember it.
|
||||
* Set the Input to only Exposure events.
|
||||
*/
|
||||
XGetWindowAttributes (XtDisplay(pDAS->dispWid), XtWindow (pDAS->dispWid),
|
||||
&attr);
|
||||
XSelectInput (XtDisplay(pDAS->dispWid), XtWindow (pDAS->dispWid),
|
||||
ExposureMask);
|
||||
|
||||
XSync (XtDisplay(pDAS->dispWid), 0);
|
||||
|
||||
/*
|
||||
* initialize the global flag and variable.
|
||||
*/
|
||||
childPid = -1;
|
||||
childFlag = False;
|
||||
|
||||
/*
|
||||
* fork a child process.
|
||||
*/
|
||||
#ifdef __hpux
|
||||
childPid = vfork ();
|
||||
#else
|
||||
childPid = fork ();
|
||||
#endif /* __hpux */
|
||||
|
||||
/*
|
||||
* If the child, exec the cmd with a shell parent
|
||||
* so if the cmd ends in an ampersand, the command
|
||||
* will be put in the background and the shell will
|
||||
* die and return, creating a SIGCLD for us to catch.
|
||||
*/
|
||||
if (childPid == 0)
|
||||
{
|
||||
execlp (pShell, pShell, "-c", cmd, ((char *) 0));
|
||||
_exit (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check to make sure the vfork was successful.
|
||||
*/
|
||||
if (childPid != -1)
|
||||
{
|
||||
/*
|
||||
* check to see if the child is still going
|
||||
*/
|
||||
pid = waitpid (childPid, (int *) 0, WNOHANG);
|
||||
if (!(pid == childPid || pid == -1))
|
||||
/*
|
||||
* process the exposure events in a special routine.
|
||||
*/
|
||||
ProcessEvents (pDAS, childPid, childFlag);
|
||||
}
|
||||
|
||||
/*
|
||||
* reset the input mask
|
||||
*/
|
||||
XSelectInput (XtDisplay(pDAS->dispWid), XtWindow (pDAS->dispWid),
|
||||
(attr.your_event_mask));
|
||||
/*
|
||||
* turn off the wait cursor
|
||||
*/
|
||||
_DtHelpTurnOffHourGlass(shellWidget);
|
||||
|
||||
} /* End _DtHelpExecProcedure */
|
||||
|
||||
/*********************************************************************
|
||||
* Function: _DtHelpProcessHyperSelection
|
||||
*
|
||||
* Determine if the user selected a segment that is a hypertext
|
||||
* link. If so, call the appropriate function to process it.
|
||||
*
|
||||
*********************************************************************/
|
||||
void
|
||||
_DtHelpProcessHyperSelection (
|
||||
XtPointer client_data,
|
||||
int downX,
|
||||
int downY,
|
||||
XEvent *event )
|
||||
{
|
||||
|
||||
int upX;
|
||||
int upY;
|
||||
|
||||
_DtCvLinkInfo ceHyper;
|
||||
DtHelpHyperTextStruct callData;
|
||||
DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) client_data;
|
||||
|
||||
if (pDAS->hyperCall == NULL)
|
||||
return;
|
||||
|
||||
downY = downY + pDAS->firstVisible - pDAS->decorThickness;
|
||||
downX = downX + pDAS->virtualX - pDAS->decorThickness;
|
||||
upX = event->xbutton.x + pDAS->virtualX - pDAS->decorThickness;
|
||||
upY = event->xbutton.y + pDAS->firstVisible - pDAS->decorThickness;
|
||||
|
||||
/*
|
||||
* turn off the old traversal
|
||||
*/
|
||||
if (pDAS->neededFlags & _DT_HELP_FOCUS_FLAG)
|
||||
{
|
||||
pDAS->toc_flag |= _DT_HELP_DRAW_TOC_IND;
|
||||
_DtCanvasMoveTraversal(pDAS->canvas, _DtCvTRAVERSAL_OFF, False,
|
||||
(XtIsRealized(pDAS->dispWid) ? True : False),
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
if (_DtCvSTATUS_OK ==
|
||||
_DtCanvasGetPosLink(pDAS->canvas,downX,downY,upX,upY,&ceHyper))
|
||||
{
|
||||
/*
|
||||
* turn the traversal on for the selected hyptext link.
|
||||
*/
|
||||
if (pDAS->neededFlags & _DT_HELP_FOCUS_FLAG)
|
||||
{
|
||||
pDAS->toc_flag |= _DT_HELP_DRAW_TOC_IND;
|
||||
_DtCanvasMoveTraversal(pDAS->canvas, _DtCvTRAVERSAL_ID, False,
|
||||
(XtIsRealized(pDAS->dispWid) ? True : False),
|
||||
ceHyper.specification,
|
||||
NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
callData.reason = XmCR_ACTIVATE;
|
||||
callData.event = event;
|
||||
callData.window = XtWindow (pDAS->dispWid);
|
||||
callData.specification = ceHyper.specification;
|
||||
callData.hyper_type = ceHyper.hyper_type;
|
||||
callData.window_hint = ceHyper.win_hint;
|
||||
|
||||
(*(pDAS->hyperCall)) (pDAS, pDAS->clientData, &callData);
|
||||
}
|
||||
else if (pDAS->neededFlags & _DT_HELP_FOCUS_FLAG)
|
||||
/*
|
||||
* turn the traversal back on
|
||||
*/
|
||||
_DtCanvasMoveTraversal(pDAS->canvas, _DtCvTRAVERSAL_ON, False,
|
||||
(XtIsRealized(pDAS->dispWid) ? True : False),
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
} /* End _DtHelpProcessHyperSelection */
|
||||
|
||||
45
cde/lib/DtHelp/HyperTextI.h
Normal file
45
cde/lib/DtHelp/HyperTextI.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* $XConsortium: HyperTextI.h /main/5 1995/10/26 12:28:01 rswiston $ */
|
||||
/************************************<+>*************************************
|
||||
****************************************************************************
|
||||
**
|
||||
** File: HyperText.h
|
||||
**
|
||||
** Project: TextGraphic Display routines
|
||||
**
|
||||
** Description: Header file for HyperText.h
|
||||
**
|
||||
**
|
||||
** (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
|
||||
**
|
||||
** (c) Copyright 1993, 1994 Hewlett-Packard Company
|
||||
** (c) Copyright 1993, 1994 International Business Machines Corp.
|
||||
** (c) Copyright 1993, 1994 Sun Microsystems, Inc.
|
||||
** (c) Copyright 1993, 1994 Novell, Inc.
|
||||
**
|
||||
**
|
||||
**
|
||||
****************************************************************************
|
||||
************************************<+>*************************************/
|
||||
#ifndef _DtHyperTextI_h
|
||||
#define _DtHyperTextI_h
|
||||
|
||||
/*****************************************************************************
|
||||
* Semi-private routines
|
||||
*****************************************************************************/
|
||||
extern int __DtLinkAddToList (
|
||||
char *link,
|
||||
int type,
|
||||
char *description);
|
||||
extern void __DtLinkRemoveFromList ( int link_index );
|
||||
extern char *__DtLinkStringReturn ( int link_index );
|
||||
extern int __DtLinkTypeReturn ( int link_index );
|
||||
extern void _DtHelpExecProcedure (
|
||||
XtPointer client_data,
|
||||
char *cmd );
|
||||
extern void _DtHelpProcessHyperSelection (
|
||||
XtPointer client_data,
|
||||
int downX,
|
||||
int downY,
|
||||
XEvent *event );
|
||||
|
||||
#endif /* _DtHyperTextI_h */
|
||||
188
cde/lib/DtHelp/Imakefile
Normal file
188
cde/lib/DtHelp/Imakefile
Normal file
@@ -0,0 +1,188 @@
|
||||
XCOMM $XConsortium: Imakefile /main/25 1996/11/22 11:17:34 drk $
|
||||
#define DoNormalLib NormalLibDtHelp
|
||||
#define DoSharedLib SharedLibDtHelp
|
||||
#define DoDebugLib DebugLibDtHelp
|
||||
#define DoProfileLib ProfileLibDtHelp
|
||||
#define LibName DtHelp
|
||||
#define SoRev SODTHELPREV
|
||||
#define IncSubdir Dt
|
||||
#define LargePICTable YES
|
||||
|
||||
#include <Threads.tmpl>
|
||||
|
||||
#define IHaveSubdirs
|
||||
#define PassCDebugFlags /**/
|
||||
|
||||
SUBDIRS = il jpeg
|
||||
DONES = il/DONE jpeg/DONE
|
||||
EXTRALIBRARYDEPS = $(DONES)
|
||||
|
||||
MakeSubdirs($(SUBDIRS))
|
||||
ForceSubdirs($(SUBDIRS))
|
||||
DependSubdirs($(SUBDIRS))
|
||||
|
||||
XLATESRC = $(DTSVCSRC)/DtUtil2
|
||||
|
||||
#if defined(LSBBitOrder) && LSBBitOrder
|
||||
BIT_ORDER_DEFINES = -DLSB_BIT_ORDER
|
||||
#endif
|
||||
|
||||
INCLUDES = -I. -I./il -I./jpeg
|
||||
DEFINES = -DDTLIB -DXK_MISCELLANY $(LOCAL_DEFINES) \
|
||||
-DCDE_INSTALLATION_TOP='"$(CDE_INSTALLATION_TOP)"' \
|
||||
-DCDE_CONFIGURATION_TOP='"$(CDE_CONFIGURATION_TOP)"' \
|
||||
-DCDE_USER_TOP='"$(CDE_USER_TOP)"' \
|
||||
-DOSMAJORVERSION=OSMajorVersion \
|
||||
-DOSMINORVERSION=OSMinorVersion \
|
||||
$(ICONV_INBUF_DEFINE) $(BIT_ORDER_DEFINES)
|
||||
|
||||
#ifdef SharedDtHelpReqs
|
||||
REQUIREDLIBS = SharedDtHelpReqs
|
||||
#endif
|
||||
|
||||
HEADERS = \
|
||||
CanvasP.h CanvasSegP.h Help.h \
|
||||
HelpDialog.h HelpDialogP.h HelpP.h \
|
||||
HelpQuickD.h HelpQuickDP.h
|
||||
|
||||
/* These internal headers will go to the DtI directory */
|
||||
I_HEADERS = \
|
||||
Access.h AccessI.h AccessP.h \
|
||||
ActionsI.h CallbacksI.h CanvasI.h \
|
||||
DisplayAreaI.h DisplayAreaP.h FileUtilsI.h \
|
||||
FontAttrI.h FontI.h GifUtilsI.h \
|
||||
GraphicsP.h HelpP.h HelpTermP.h \
|
||||
HelposI.h HourGlassI.h JpegUtilsI.h \
|
||||
LinkMgrP.h RegionI.h SetListI.h \
|
||||
XUICreateI.h XbmUtilsI.h bufioI.h
|
||||
|
||||
LCX_HEADERS = \
|
||||
LocaleXlate.h XlationSvc.h
|
||||
|
||||
SRCS1 = \
|
||||
Actions.c AsciiSpc.c Callbacks.c \
|
||||
Destroy.c Environ_c.c FileListUtils.c \
|
||||
FileUtils.c Font.c Format.c \
|
||||
FormatMan.c FormatTerm.c GifUtils.c \
|
||||
GlobSearch.c Graphics.c HelpAccess.c \
|
||||
HelpDialog.c HelpQuickD.c HelpUtil.c \
|
||||
Helpos.c History.c HourGlass.c \
|
||||
HyperText.c JpegUtils.c Messages.c \
|
||||
PathArea.c Print.c Resize.c \
|
||||
SetList.c VolSelect.c XInterface.c \
|
||||
XUICreate.c XbmUtils.c version.c
|
||||
|
||||
OBJS1 = \
|
||||
Actions.o AsciiSpc.o Callbacks.o \
|
||||
Destroy.o Environ_c.o FileListUtils.o \
|
||||
FileUtils.o Font.o Format.o \
|
||||
FormatMan.o FormatTerm.o GifUtils.o \
|
||||
GlobSearch.o Graphics.o HelpAccess.o \
|
||||
HelpDialog.o HelpQuickD.o HelpUtil.o \
|
||||
Helpos.o History.o HourGlass.o \
|
||||
HyperText.o JpegUtils.o Messages.o \
|
||||
PathArea.o Print.o Resize.o \
|
||||
SetList.o VolSelect.o XInterface.o \
|
||||
XUICreate.o XbmUtils.o version.o
|
||||
|
||||
SRCS2 = \
|
||||
Access.c AccessCCDF.c AccessSDL.c \
|
||||
CCDFUtil.c CleanUp.c FontAttr.c \
|
||||
FormatCCDF.c FormatSDL.c FormatUtil.c \
|
||||
GenUtils.c Obsolete.c StringFuncs.c \
|
||||
UtilSDL.c bufio.c decompress.c
|
||||
|
||||
OBJS2 = \
|
||||
Access.o AccessCCDF.o AccessSDL.o \
|
||||
CCDFUtil.o CleanUp.o FontAttr.o \
|
||||
FormatCCDF.o FormatSDL.o FormatUtil.o \
|
||||
GenUtils.o Obsolete.o StringFuncs.o \
|
||||
UtilSDL.o bufio.o decompress.o
|
||||
|
||||
CVSRCS = \
|
||||
Canvas.c CanvasOs.c CvString.c \
|
||||
Layout.c LayoutUtil.c LinkMgr.c \
|
||||
Selection.c VirtFuncs.c
|
||||
|
||||
CVOBJS = \
|
||||
Canvas.o CanvasOs.o CvString.o \
|
||||
Layout.o LayoutUtil.o LinkMgr.o \
|
||||
Selection.o VirtFuncs.o
|
||||
|
||||
LCXSRCS = \
|
||||
HelpXlate.c
|
||||
|
||||
LCXOBJS = \
|
||||
HelpXlate.o
|
||||
|
||||
/* NOTE!!!
|
||||
* All IO_OBJS and JPEG_OBJS .o's are built in the subdirectories.
|
||||
* Each .o there must have a listing in *OBJS macros below.
|
||||
*/
|
||||
|
||||
IL_OBJS = \
|
||||
il/ilX.o il/ilbigray.o il/ilcodec.o \
|
||||
il/ilcontext.o il/ilconvert.o il/ilcrop.o \
|
||||
il/ildata.o il/ildecompg3.o il/ildecompg4.o \
|
||||
il/ildecompjpeg.o il/ildecomplzw.o il/ildecomppackbits.o \
|
||||
il/ildecompress.o il/ildither.o il/ilformat.o \
|
||||
il/ilgraybi.o il/ilimage.o il/ilinvert.o \
|
||||
il/iljpgdecode.o il/iljpgdecodejif.o il/iljpgdedct.o \
|
||||
il/iljpgdehuff.o il/iljpgutil.o il/ilmap.o \
|
||||
il/ilobject.o il/ilpalette.o il/ilpipe.o \
|
||||
il/ilrwimage.o il/ilscale.o il/ilscalesample.o \
|
||||
il/iltiff.o il/iltiffread.o il/iltruegray.o \
|
||||
il/ilupsample.o il/ilutiljpeg.o il/ilycbcr.o
|
||||
|
||||
JPEG_OBJS = \
|
||||
jpeg/jcomapi.o jpeg/jdmainct.o jpeg/jidctflt.o \
|
||||
jpeg/jdapimin.o jpeg/jdmarker.o jpeg/jidctfst.o \
|
||||
jpeg/jdapistd.o jpeg/jdmaster.o jpeg/jidctint.o \
|
||||
jpeg/jdatasrc.o jpeg/jdmerge.o jpeg/jidctred.o \
|
||||
jpeg/jdcoefct.o jpeg/jdphuff.o jpeg/jmemmgr.o \
|
||||
jpeg/jdcolor.o jpeg/jdpostct.o jpeg/jmemnobs.o \
|
||||
jpeg/jddctmgr.o jpeg/jdsample.o jpeg/jquant1.o \
|
||||
jpeg/jdhuff.o jpeg/jdtrans.o jpeg/jquant2.o \
|
||||
jpeg/jdinput.o jpeg/jerror.o jpeg/jutils.o
|
||||
|
||||
SRCS = $(SRCS1) $(SRCS2) $(CVSRCS) $(LCXSRCS)
|
||||
OBJS = $(OBJS1) $(OBJS2) $(CVOBJS) $(LCXOBJS) $(IL_OBJS) $(JPEG_OBJS)
|
||||
|
||||
#include <Library.tmpl>
|
||||
|
||||
#ifdef HPArchitecture
|
||||
# ifdef __hp9000s300
|
||||
/* Build +O1 due to 300 optimizer bug on all architectures */
|
||||
SpecialSharedObjectRule(Search.o,/**/,+O1)
|
||||
# endif
|
||||
# if OSMajorVersion == 10
|
||||
/* Workaround compiler bug in hp 10.0 WC. Should be removed eventually. */
|
||||
SpecialLibObjectRule(Canvas.o,,+O1)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
LCX_FILES = AIX.lcx CDE.lcx HP-UX.lcx SunOS.lcx
|
||||
LCX_DEST = misc/dtlcx
|
||||
InstallMultiple($(LCX_FILES),$(LCX_DEST))
|
||||
|
||||
BuildIncludes($(I_HEADERS),DtI,..)
|
||||
InstallMultipleFlags($(I_HEADERS),$(INCDIR)/DtI,$(INSTINCFLAGS))
|
||||
|
||||
/* link LocaleXlate XlationSvc headers. */
|
||||
LinkSourceFile(LocaleXlate.h,$(XLATESRC))
|
||||
LinkSourceFile(XlationSvc.h,$(XLATESRC))
|
||||
|
||||
DependTarget()
|
||||
|
||||
clean1:
|
||||
rm -f $(OBJS1)
|
||||
|
||||
clean2:
|
||||
rm -f $(OBJS2)
|
||||
|
||||
cleanlcx:
|
||||
rm -f $(LCXOBJS)
|
||||
|
||||
cleancv:
|
||||
rm -f $(CVOBJS)
|
||||
629
cde/lib/DtHelp/JpegUtils.c
Normal file
629
cde/lib/DtHelp/JpegUtils.c
Normal file
@@ -0,0 +1,629 @@
|
||||
/* $XConsortium: JpegUtils.c /main/3 1996/10/06 19:38:48 rws $ */
|
||||
/*
|
||||
** JpegUtils.c
|
||||
**
|
||||
** This module provides utilities for converting jpeg data associated with
|
||||
** a _DtGrStream into an XImage. The module is based on code from several
|
||||
** of the files from the Independent JPEG library, version 6a (copyright
|
||||
** attached below).
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 1991-1996, Thomas G. Lane.
|
||||
* This file is part of the Independent JPEG Group's software.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
** Include files
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <setjmp.h>
|
||||
#include "GraphicsP.h"
|
||||
#include "jpeglib.h"
|
||||
#include "cdjpeg.h"
|
||||
#include "JpegUtilsI.h"
|
||||
|
||||
/*
|
||||
** Macro definitions
|
||||
*/
|
||||
|
||||
#define BYTESPERSAMPLE 1
|
||||
#define MAX_COLORS 64 /* Not allowed to be higher than 256 */
|
||||
#define BYTE_MAXVAL 0xFF
|
||||
#define XCOL_MAXVAL 0xFFFF
|
||||
#define INTERP_TO_XCOLORSPACE(val) ((XCOL_MAXVAL/BYTE_MAXVAL) * val)
|
||||
#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */
|
||||
|
||||
/*
|
||||
** Type definitions
|
||||
*/
|
||||
|
||||
/*
|
||||
** Custom destination manager structure
|
||||
*/
|
||||
typedef struct {
|
||||
struct djpeg_dest_struct pub; /* public fields */
|
||||
JSAMPROW pixrow; /* decompressor output buffer */
|
||||
XImage *ximage; /* XImage to put pixel info into */
|
||||
} ximg_dest_struct;
|
||||
|
||||
typedef ximg_dest_struct * ximg_dest_ptr;
|
||||
|
||||
/*
|
||||
** Custom source manager structure
|
||||
*/
|
||||
typedef struct {
|
||||
struct jpeg_source_mgr pub; /* public fields */
|
||||
|
||||
_DtGrStream *stream; /* source stream */
|
||||
unsigned long input_buf_size; /* size of input buffer */
|
||||
JOCTET * buffer; /* start of buffer */
|
||||
boolean start_of_file; /* have we gotten any data yet? */
|
||||
} stream_source_mgr;
|
||||
|
||||
typedef stream_source_mgr * stream_src_ptr;
|
||||
|
||||
/*
|
||||
** Custom error handler structure
|
||||
*/
|
||||
|
||||
struct my_error_mgr {
|
||||
struct jpeg_error_mgr pub; /* "public" fields */
|
||||
|
||||
jmp_buf setjmp_buffer; /* for return to caller */
|
||||
};
|
||||
|
||||
typedef struct my_error_mgr * my_error_ptr;
|
||||
|
||||
/*
|
||||
** Routines
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Function my_error_exit
|
||||
*
|
||||
* This routine replaces the standard fatal error handling routine. Instead
|
||||
* of exiting the program, the routine longjmps back to jpeg_to_ximage,
|
||||
* which cleans up and returns a _DtGrCONVERT_FAILURE.
|
||||
*
|
||||
*****************************************************************************/
|
||||
static void my_error_exit (j_common_ptr cinfo)
|
||||
{
|
||||
my_error_ptr myerr = (my_error_ptr) cinfo->err;
|
||||
|
||||
(*cinfo->err->output_message) (cinfo);
|
||||
|
||||
/* Return control to the setjmp point */
|
||||
longjmp(myerr->setjmp_buffer, 1);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Function my_output_message
|
||||
*
|
||||
* This routine replaces the standard error message outputter. Instead
|
||||
* of outputting JPEG library error and warning messages to stderr, it
|
||||
* suppresses them.
|
||||
*
|
||||
*****************************************************************************/
|
||||
static void my_output_message (j_common_ptr cinfo)
|
||||
{
|
||||
char buffer[JMSG_LENGTH_MAX];
|
||||
|
||||
/*
|
||||
** Uncommenting the lines below will cause error and warning messages
|
||||
** from the JPEG library to be displayed to stderr instead of suppressed
|
||||
*/
|
||||
|
||||
/*
|
||||
** Create the message
|
||||
**
|
||||
** (*cinfo->err->format_message) (cinfo, buffer);
|
||||
*/
|
||||
|
||||
/*
|
||||
** Send it to stderr, adding a newline
|
||||
**
|
||||
** fprintf(stderr, "%s\n", buffer);
|
||||
*/
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Function init_source
|
||||
*
|
||||
* This is the custom source manager's initialization routine, called by
|
||||
* jpeg_read_header before any data is actually read. It currently does
|
||||
* nothing.
|
||||
*
|
||||
*****************************************************************************/
|
||||
static void init_source (
|
||||
j_decompress_ptr cinfo)
|
||||
{
|
||||
stream_src_ptr src = (stream_src_ptr) cinfo->src;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Function fill_input_buffer
|
||||
*
|
||||
* This is the custom source manager's fill input buffer routine, called by
|
||||
* the JPEG library whenever it has finished processing the data in the
|
||||
* source buffer and needs it to be refilled with the next chunk of data.
|
||||
*
|
||||
*****************************************************************************/
|
||||
static boolean fill_input_buffer (
|
||||
j_decompress_ptr cinfo)
|
||||
{
|
||||
stream_src_ptr src = (stream_src_ptr) cinfo->src;
|
||||
size_t nbytes;
|
||||
|
||||
/*
|
||||
** Since we always process buffer-based streams in a single chunk, the
|
||||
** only reason read_input_buffer should be called for one is if the data
|
||||
** in the buffer was truncated or otherwise bogus. If this is the case
|
||||
** we set nbytes to zero, allocate a new buffer to hold a fake EOI marker
|
||||
** so the stream buffer isn't overwritten, and let the error-handling
|
||||
** code below take care of things.
|
||||
*/
|
||||
if (src->stream->type == _DtGrBUFFER)
|
||||
{
|
||||
nbytes = 0;
|
||||
src->buffer = (JOCTET *) (*cinfo->mem->alloc_small) (
|
||||
(j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
2 * SIZEOF(JOCTET));
|
||||
}
|
||||
else /* _DtGrFILE, read the next chunk of data */
|
||||
nbytes = _DtGrRead (src->buffer, 1, src->input_buf_size, src->stream);
|
||||
|
||||
if (nbytes <= 0)
|
||||
{
|
||||
if (src->start_of_file) /* Treat empty input file as fatal error */
|
||||
ERREXIT(cinfo, JERR_INPUT_EMPTY);
|
||||
WARNMS(cinfo, JWRN_JPEG_EOF);
|
||||
/* Insert a fake EOI marker */
|
||||
src->buffer[0] = (JOCTET) 0xFF;
|
||||
src->buffer[1] = (JOCTET) JPEG_EOI;
|
||||
nbytes = 2;
|
||||
}
|
||||
|
||||
src->pub.next_input_byte = src->buffer;
|
||||
src->pub.bytes_in_buffer = nbytes;
|
||||
src->start_of_file = FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Function skip_input_data
|
||||
*
|
||||
* This is the custom source manager's skip input data function, called
|
||||
* by the JPEG library when it wants to skip over a potentially large
|
||||
* amount of uninteresting data (such as an APPn marker).
|
||||
*
|
||||
*****************************************************************************/
|
||||
static void skip_input_data (
|
||||
j_decompress_ptr cinfo,
|
||||
long num_bytes)
|
||||
{
|
||||
stream_src_ptr src = (stream_src_ptr) cinfo->src;
|
||||
|
||||
/* Just a dumb implementation for now. Could use fseek() except
|
||||
** it doesn't work on pipes. Not clear that being smart is worth
|
||||
** any trouble anyway --- large skips are infrequent.
|
||||
*/
|
||||
if (num_bytes > 0)
|
||||
{
|
||||
while (num_bytes > (long) src->pub.bytes_in_buffer)
|
||||
{
|
||||
num_bytes -= (long) src->pub.bytes_in_buffer;
|
||||
(void) fill_input_buffer(cinfo);
|
||||
/* note we assume that fill_input_buffer will never return FALSE,
|
||||
** so suspension need not be handled.
|
||||
*/
|
||||
}
|
||||
src->pub.next_input_byte += (size_t) num_bytes;
|
||||
src->pub.bytes_in_buffer -= (size_t) num_bytes;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Function term_source
|
||||
*
|
||||
* This is the custom source manager's termination routine, it currently
|
||||
* does nothing.
|
||||
*
|
||||
*****************************************************************************/
|
||||
static void term_source (
|
||||
j_decompress_ptr cinfo)
|
||||
{
|
||||
/* no work necessary here */
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Function jpeg_stream_src
|
||||
*
|
||||
* This is the custom source manager's creation routine. Most of the custom
|
||||
* source manager code is based on the JPEG library's stdio source manager
|
||||
* code in the jdatasrc.c file included with the JPEG library distribution.
|
||||
*
|
||||
*****************************************************************************/
|
||||
static void jpeg_stream_src (
|
||||
j_decompress_ptr cinfo,
|
||||
_DtGrStream *stream)
|
||||
{
|
||||
stream_src_ptr src;
|
||||
|
||||
/*
|
||||
** Create the custom source manager structure
|
||||
*/
|
||||
cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small) (
|
||||
(j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(stream_source_mgr));
|
||||
src = (stream_src_ptr) cinfo->src;
|
||||
|
||||
src->stream = stream;
|
||||
|
||||
/*
|
||||
** If this is a file-based stream, we need to allocate a buffer to
|
||||
** read data into. If this is a buffer-based stream, we just use the
|
||||
** buffer already attached to the stream. Note that this implies that
|
||||
** we always process buffer-based streams in a single chunk, if there
|
||||
** is ever a reason to do otherwise, this routine and fill_input_buffer
|
||||
** will need to be modified appropriately.
|
||||
*/
|
||||
if (stream->type == _DtGrFILE)
|
||||
{
|
||||
src->buffer = (JOCTET *) (*cinfo->mem->alloc_small) (
|
||||
(j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
INPUT_BUF_SIZE * SIZEOF(JOCTET));
|
||||
src->input_buf_size = INPUT_BUF_SIZE;
|
||||
src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer call */
|
||||
src->pub.next_input_byte = NULL; /* on first read */
|
||||
src->start_of_file = TRUE;
|
||||
}
|
||||
else /* _DtGrBUFFER */
|
||||
{
|
||||
src->buffer = (unsigned char *) stream->source.buffer.base;
|
||||
src->input_buf_size = stream->source.buffer.size;
|
||||
src->pub.bytes_in_buffer = src->input_buf_size;
|
||||
src->pub.next_input_byte = src->buffer;
|
||||
src->start_of_file = FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
** Initialize the method procedures
|
||||
*/
|
||||
src->pub.init_source = init_source;
|
||||
src->pub.fill_input_buffer = fill_input_buffer;
|
||||
src->pub.skip_input_data = skip_input_data;
|
||||
src->pub.resync_to_restart = jpeg_resync_to_restart; /* default method */
|
||||
src->pub.term_source = term_source;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Function copy_pixels
|
||||
*
|
||||
* This routine loops through a scanline of decompressed, quantized
|
||||
* JPEG data and uses XPutPixel to copy the pixel values into the
|
||||
* XImage associated with the destination manager.
|
||||
*
|
||||
*****************************************************************************/
|
||||
static void copy_pixels(
|
||||
j_decompress_ptr cinfo,
|
||||
djpeg_dest_ptr dinfo,
|
||||
JDIMENSION rows_supplied)
|
||||
{
|
||||
register int pixval;
|
||||
register JSAMPROW ptr;
|
||||
register JDIMENSION col;
|
||||
ximg_dest_ptr dest = (ximg_dest_ptr) dinfo;
|
||||
|
||||
ptr = dest->pub.buffer[0];
|
||||
for (col=0; col < cinfo->output_width; col++)
|
||||
{
|
||||
pixval = GETJSAMPLE(*ptr++);
|
||||
XPutPixel(dest->ximage,col,cinfo->output_scanline-1, pixval);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Function start_output_ximg
|
||||
*
|
||||
* This is the data destination manager startup routine, it currently does
|
||||
* nothing.
|
||||
*
|
||||
*****************************************************************************/
|
||||
static void start_output_ximg (
|
||||
j_decompress_ptr cinfo,
|
||||
djpeg_dest_ptr dinfo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Function finish_output_ximg
|
||||
*
|
||||
* This is the data destination manager shutdown routine, it currently does
|
||||
* nothing.
|
||||
*
|
||||
*****************************************************************************/
|
||||
static void finish_output_ximg (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
|
||||
{
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Function init_jpeg_dest_mgr
|
||||
*
|
||||
* This routine allocates and initializes a data destination manager
|
||||
* that the JPEG library will use as a sink for JPEG data after the
|
||||
* data has been decompressed.
|
||||
*
|
||||
*****************************************************************************/
|
||||
djpeg_dest_ptr init_jpeg_dest_mgr (
|
||||
j_decompress_ptr cinfo)
|
||||
{
|
||||
ximg_dest_ptr dest;
|
||||
|
||||
/*
|
||||
** Create module interface object, fill in the method pointers
|
||||
*/
|
||||
dest = (ximg_dest_ptr) (*cinfo->mem->alloc_small) (
|
||||
(j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
SIZEOF(ximg_dest_struct));
|
||||
dest->pub.start_output = start_output_ximg;
|
||||
dest->pub.finish_output = finish_output_ximg;
|
||||
dest->pub.put_pixel_rows = copy_pixels;
|
||||
|
||||
/*
|
||||
** Calculate the output image dimensions so we can allocate the
|
||||
** right amount of space
|
||||
*/
|
||||
jpeg_calc_output_dimensions(cinfo);
|
||||
|
||||
/*
|
||||
** Create a buffer for the JPEG library to write decompressed
|
||||
** scanline data into.
|
||||
*/
|
||||
dest->pixrow = (JSAMPROW) (*cinfo->mem->alloc_small) (
|
||||
(j_common_ptr) cinfo, JPOOL_IMAGE,
|
||||
cinfo->output_width * cinfo->out_color_components );
|
||||
dest->pub.buffer = &dest->pixrow;
|
||||
dest->pub.buffer_height = 1;
|
||||
|
||||
/*
|
||||
** Return the initialized destination manager
|
||||
*/
|
||||
return (djpeg_dest_ptr) dest;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Function jpeg_to_ximage
|
||||
*
|
||||
* This routine converts compressed jpeg data associated with a _DtGrStream
|
||||
* into an XImage.
|
||||
*
|
||||
* No X color allocation is done. The image is quantized down to MAX_COLORS
|
||||
* during decompression, and an array of XColor structures with the red,
|
||||
* green, and blue fields initialized to the colors used in the image is
|
||||
* returned to the caller. Each pixel value in the XImage data is an index
|
||||
* into this array. The caller must use this information to allocate X
|
||||
* color cells and substitute the appropriate pixel values into the XImage
|
||||
* data array before using the XImage.
|
||||
*
|
||||
* The routine makes use of a custom source data manager to allow the JPEG
|
||||
* data source to be a _DtGrStream, a custom data destination manager to
|
||||
* allow the decompressed and post-processed data to be written to an XImage,
|
||||
* and a custom error handler to allow standard _DtGr error codes to be
|
||||
* returned to the caller in the event of a JPEG library error.
|
||||
*
|
||||
*****************************************************************************/
|
||||
enum _DtGrLoadStatus jpeg_to_ximage (
|
||||
_DtGrStream *stream,
|
||||
Screen *screen,
|
||||
Visual *visual,
|
||||
Dimension *in_out_width,
|
||||
Dimension *in_out_height,
|
||||
XImage **ximage,
|
||||
XColor **xcolors,
|
||||
int *ncolors,
|
||||
int *xres)
|
||||
{
|
||||
struct jpeg_decompress_struct cinfo;
|
||||
struct my_error_mgr jerr;
|
||||
djpeg_dest_ptr dest_mgr = NULL;
|
||||
ximg_dest_ptr dest;
|
||||
int i, num_scanlines, nullCount, ximWidth;
|
||||
unsigned char *ximData = NULL;
|
||||
Display *display = DisplayOfScreen(screen);
|
||||
int nplanes = DisplayPlanes(display,XScreenNumberOfScreen(screen));
|
||||
XColor *colors = NULL;
|
||||
|
||||
/*
|
||||
** Initialize the return values
|
||||
*/
|
||||
*ximage = NULL;
|
||||
*xres = *ncolors = *in_out_width = *in_out_height = 0;
|
||||
|
||||
/*
|
||||
** Initialize the jpeg library error handler with our custom routines
|
||||
*/
|
||||
|
||||
cinfo.err = jpeg_std_error(&jerr.pub);
|
||||
jerr.pub.error_exit = my_error_exit;
|
||||
jerr.pub.output_message = my_output_message;
|
||||
|
||||
/*
|
||||
** Establish the setjmp return context for my_error_exit to use
|
||||
*/
|
||||
if (setjmp(jerr.setjmp_buffer))
|
||||
{
|
||||
/* If we get here, the JPEG code has signaled an error. We need to
|
||||
** free memory, clean up the JPEG object, and return a failure code.
|
||||
*/
|
||||
if (*ximage != NULL)
|
||||
XDestroyImage (*ximage);
|
||||
if (colors != NULL)
|
||||
free (colors);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
return (_DtGrCONVERT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
** Create a jpeg decompression object
|
||||
*/
|
||||
jpeg_create_decompress(&cinfo);
|
||||
|
||||
/*
|
||||
** Create a custom source data manager
|
||||
*/
|
||||
jpeg_stream_src(&cinfo, stream);
|
||||
|
||||
/*
|
||||
** Read the jpeg header
|
||||
*/
|
||||
jpeg_read_header(&cinfo, TRUE);
|
||||
if (cinfo.X_density > 0 &&
|
||||
(cinfo.density_unit == 1 || cinfo.density_unit == 2)) {
|
||||
if (cinfo.density_unit == 1)
|
||||
*xres = cinfo.X_density;
|
||||
else
|
||||
*xres = cinfo.X_density * 2.54 + 0.5;
|
||||
}
|
||||
|
||||
/*
|
||||
** Initialize our desired post-processing attributes
|
||||
*/
|
||||
cinfo.quantize_colors = TRUE;
|
||||
cinfo.desired_number_of_colors = MAX_COLORS;
|
||||
|
||||
/*
|
||||
** Create a custom data destination manager to allow our processed data
|
||||
** to be channeled into an XImage.
|
||||
*/
|
||||
dest_mgr = init_jpeg_dest_mgr(&cinfo);
|
||||
|
||||
/*
|
||||
** Initialize the decompression state
|
||||
*/
|
||||
jpeg_start_decompress(&cinfo);
|
||||
(*dest_mgr->start_output) (&cinfo, dest_mgr);
|
||||
|
||||
/*
|
||||
** Create an XImage to hold the processed data
|
||||
*/
|
||||
|
||||
nullCount = (4 - (cinfo.output_width % 4)) & 0x03;
|
||||
ximWidth = cinfo.output_width + nullCount;
|
||||
|
||||
if (nplanes > 8 )
|
||||
ximData = (unsigned char *) malloc(ximWidth *
|
||||
cinfo.output_height * 4 );
|
||||
else
|
||||
ximData = (unsigned char *) malloc(ximWidth * cinfo.output_height );
|
||||
|
||||
if (!ximData)
|
||||
{
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
return (_DtGrNO_MEMORY);
|
||||
}
|
||||
|
||||
*ximage = XCreateImage(display, visual, nplanes,
|
||||
(nplanes == 1) ? XYPixmap : ZPixmap,
|
||||
0, (char *)ximData, cinfo.output_width,
|
||||
cinfo.output_height, 32, 0);
|
||||
|
||||
if (!*ximage)
|
||||
{
|
||||
free (ximData);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
return (_DtGrCONVERT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
** Store the XImage in the custom destination manager
|
||||
*/
|
||||
dest = (ximg_dest_ptr) dest_mgr;
|
||||
dest->ximage = *ximage;
|
||||
|
||||
/*
|
||||
** Process scanlines until there are none left
|
||||
*/
|
||||
|
||||
while (cinfo.output_scanline < cinfo.output_height)
|
||||
{
|
||||
num_scanlines = jpeg_read_scanlines(&cinfo,
|
||||
(JSAMPARRAY)dest_mgr->buffer,
|
||||
dest_mgr->buffer_height);
|
||||
(*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
|
||||
}
|
||||
|
||||
/*
|
||||
** Return the colormap info as an array of XColors which can be
|
||||
** used later for X color allocation purposes.
|
||||
*/
|
||||
|
||||
if (cinfo.actual_number_of_colors)
|
||||
{
|
||||
colors = (XColor *) malloc((unsigned) sizeof(XColor) *
|
||||
cinfo.actual_number_of_colors);
|
||||
if (!colors)
|
||||
{
|
||||
XDestroyImage (*ximage);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
return (_DtGrNO_MEMORY);
|
||||
}
|
||||
for (i=0; i<cinfo.actual_number_of_colors; i++)
|
||||
{
|
||||
if (cinfo.out_color_space == JCS_GRAYSCALE)
|
||||
{
|
||||
colors[i].red = colors[i].green = colors[i].blue =
|
||||
INTERP_TO_XCOLORSPACE(cinfo.colormap[0][i]);
|
||||
}
|
||||
else /* JCS_RGB */
|
||||
{
|
||||
colors[i].red = INTERP_TO_XCOLORSPACE(cinfo.colormap[0][i]);
|
||||
colors[i].green = INTERP_TO_XCOLORSPACE(cinfo.colormap[1][i]);
|
||||
colors[i].blue = INTERP_TO_XCOLORSPACE(cinfo.colormap[2][i]);
|
||||
}
|
||||
}
|
||||
|
||||
*xcolors = colors;
|
||||
*ncolors = cinfo.actual_number_of_colors;
|
||||
}
|
||||
|
||||
/*
|
||||
** Set the other return parameters
|
||||
*/
|
||||
*in_out_width = cinfo.output_width;
|
||||
*in_out_height = cinfo.output_height;
|
||||
|
||||
/*
|
||||
** Shut down the decompression engine and free the allocated memory
|
||||
*/
|
||||
(*dest_mgr->finish_output) (&cinfo, dest_mgr);
|
||||
jpeg_finish_decompress(&cinfo);
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
|
||||
/*
|
||||
** Return success
|
||||
*/
|
||||
return (_DtGrSUCCESS);
|
||||
}
|
||||
26
cde/lib/DtHelp/JpegUtilsI.h
Normal file
26
cde/lib/DtHelp/JpegUtilsI.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/* $XConsortium: JpegUtilsI.h /main/3 1996/10/06 19:37:31 rws $ */
|
||||
#ifndef _DtJpegUtilsI_h
|
||||
#define _DtJpegUtilsI_h
|
||||
|
||||
/* Include files */
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include "GraphicsP.h"
|
||||
|
||||
/* Function prototypes */
|
||||
|
||||
/* Creates a pixmap from a jpeg stream */
|
||||
enum _DtGrLoadStatus jpeg_to_ximage (
|
||||
_DtGrStream *stream,
|
||||
Screen *screen,
|
||||
Visual *visual,
|
||||
Dimension *in_out_width,
|
||||
Dimension *in_out_height,
|
||||
XImage **ximage,
|
||||
XColor **xcolors,
|
||||
int *ncolors,
|
||||
int *xres
|
||||
);
|
||||
|
||||
#endif /* _DtJpegUtilsI_h */
|
||||
/* DON'T ADD ANYTHING AFTER THIS #endif */
|
||||
5690
cde/lib/DtHelp/Layout.c
Normal file
5690
cde/lib/DtHelp/Layout.c
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user