Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ Developer Release Notes: BeOS Release 4, The Translation Kit

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Developer Release Notes: BeOS Release 4, The Translation Kit


The Translation Kit and Translators
Developer Release Notes
BeOS Release 4


Bug Fixes

  • The BTranslationRoster::Translate() function no longer balks at BPositionIO streams that aren't positioned as byte 0.  The function rewinds the stream for you before translating.

  • The Targa translator can read 32-bit data with alpha.


Formats, Groups, and Extensions

  • Styled text is recognized as a standard type.  Look in TranslatorFormats.h for the new TranslatorStyledTextRecordHeader and TranslatorStyledTextTextHeader structures.  The file also explains the layout of a styled text record.

    The MIME type for the format is "text/x-vnd.Be-stxt".  The four-byte constant ('STXT') is represented by B_STYLED_TEXT_FORMAT.

  • Translator extensions are now identified by constants such as B_TRANSLATOR_EXT_HEADER_ONLY[].  These constants replace the old "kHeaderExtension" style names.  Both sets of constants are defined in TranslatorFormats.h.  The old-style constants are still supported, but their use is discouraged.

  • A number of convenient new constants (such as B_GIF_FORMAT and B_CD_FORMAT) are covers for the four-byte data type values ('GIF ', 'CD  ', etc.).

  • The new B_TRANSLATOR_ANY_TYPE constant is an addition to the TranslatorGroups enum.


BTranslationRoster

  • New GetRefFor() function returns the entry_ref for a given translator_id value.


BTranslationUtils

  • The new GetStyledText() reads styled text data from a BPositionIO object and writes into a BTextView object. PutStyledText() does the opposite.

  • WriteStyledEditFile() is a convenience function that saves styled edit data (taken from a BTextView) as a StyledEdit file.

  • The new GetDefaultSettings() function supports the new DataTranslation preference app, described below.

  • The new AddTranslationItems() is a handy way to augment a BMenu with the format names of all available data translations.  You would use this when you're displaying your app's "Save As..." panel.  Simply pass in a BMenu, the format group that you're interested in (B_TRANSLATOR_BITMAP, B_TRANSLATOR_TEXT, etc), and a model BMessage, and the function does the rest:  It gets the names of the supported formats from all the translators in the translation roster, constructs a new BMenuItem for each, and adds the new items to your menu.  It also adds the translator's type and id to the BMessage that you pass in; this message is sent back to the BMenu's target when an item is selected.  Unless you specify otherwise, the message's command constant is B_TRANSLATION_MENU and its fields are:

    FieldTypeMeaning
    "be:translator" B_INT32_TYPE The translator's id.
    "be:type"B_INT32_TYPE The four-byte value that identifies the format.


Preferences, Tools, and Directories

  • There's a new DataTranslation preference app that...

    • Lists and describes the translators that are loaded into the system.
    • Lets you set translator parameters.
    • Lets you install a new translator:  Simply drop its icon in the DataTranslation window.
    • Hosts your translator add-on's configuration view (this is the view that add-on creators define in the MakeConfig() function).

  • The new translate program lets you translate data files from the command line.  See the Shell Tools section.

  • The Storage Kit's find_directory() function knows how to find...

    • B_BEOS_TRANSLATORS_DIRECTORY.  Contains Be-defined translators.
    • B_COMMON_TRANSLATORS_DIRECTORY.  Installation directory for machine-wide third party translators.
    • B_USER_TRANSLATORS_DIRECTORY.  Installation for user-specific third-party translators.  Currently this is the same as the "COMMON" directory.





BeOS Release 4




Copyright © 1998 Be, Inc.  All rights reserved.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026