text.datatype Reference

BOOPSI datatype class reference for text.datatype, synthesised from the AmigaOS NDK 3.2 Release 4 (Autodocs/text).

Class properties

Property Value
Display name text.datatype
Group ID GID_TEXT = MAKE_ID('t','e','x','t') (text)
Superclass (root)
File format root text class
Methods declared 16

Description

The text.datatype is the super-class for any text related classes.

Methods

Each method is declared in the autodoc METHODS block. Method implementations are inherited from the superclass unless noted otherwise in the parent's autodoc.

Method Purpose
OM_NEW Create a new text object.
OM_UPDATE adjusts attributes of the object. The method is of type struct opSet , and the following attributes are currently supported: DTA_TopVert: line number of the topmost line DTA_TopHoriz: column number of the first visible column DTA_VisibleVert: number of visible lines DTA_VisibleHoriz: numer of visible columns DTA_Sync: if the tag value is non-zero, re-renders the contents TDTA_Buffer: pointer to an AllocVec()'d buffer containing the text to show. Lifetime managenemt of the buffer is within the datatype. TDTA_BufferLen: size of the buffer TDTA_WordWrap: currently ignored and reserved. TDTA_WordDelim: Pointer to a NUL-terminated string that contains all ISO-Latin-1 characters that delimit words. Used for word-selection and clipboard handling. By default, this string is "\t -,()<>[];\"".
OM_SET identical to OM_UPDATE.
OM_GET retrieves attributes from an object. In addition to the attributes supported by OM_SET, the following attributes can also be retrieved: DTA_TextAttr: Pointer to a struct TTextAttr that defines the font used for rendering the text. DTA_TextFont: Pointer to a struct TextFont used for rendering. DTA_ObjName: Name of the file or source that is currently being displayed. DTA_Methods: Pointer to an array of methods supported by the datatype. DTA_TriggerMethods: Pointer to an array of struct DTMethods that indicates which additional trigger methods are supported by the object, and are potentially shown in a menu, e.g. in MultiView. Currently, the object supports STM_SEARCH, STM_SEARCH_NEXT and STM_SEARCH_PREV.
GM_RENDER re-render the contents of the text window.
DTM_PROCLAYOUT Layout (remap) the text in the context of the caller.
GM_LAYOUT identical to DTM_PROCLAYOUT.
GM_GOACTIVE tell the object to become active.
GM_HANDLEINPUT processes user interaction.
DTM_CLEARSELECTED resets the selected text region.
DTM_COPY copies the selected text areas into the clipboard.
DTM_WRITE writes the contents into a file or a clipboard. The message is of type "struct dtWrite *". If dtw_Mode is DTWM_RAW and dtw_FileHandle is set, the text is written "as is" into the given file. If dtw_Mode is DTWM_IFF, the file is written as IFF TEXT into the file given in dtw_FileHandle.
DTM_PRINT print the text, the method is of type "struct dtPrint *" and dtp_PIO points to an IORequest over which the text is written.
DTM_REMOVEDTOBJECT removes the seach window GUI.
DTM_TRIGGER triggers user-initiated functions on the object. The method is of type struct dtTrigger *, and dtt_Function is one of the following: STM_ACTIVATE_FIELD,STM_RETRACE,STM_SEARCH: Shows the search window, allowing the user to enter a string to be searched. STM_PREV_FIELD,STM_BROWSE_PREV,STM_SEARCH_PREV: Searches the previous occurance of the user provided string. STM_NEXT_FIELD,STM_BROWSE_NEXT,STM_SEARCH_NEXT: Searches the next occurance of the user provided string.
OM_DISPOSE Dispose the object.

See also

  • <datatypes/textclass.h>

Release history (NDK 3.2 R4)

Excerpted from ReleaseNotes/text-dt-RelNotes in the NDK 3.2 R4 distribution.

-------------------- AmigaOS 3.5/3.9 project -------------------------

text 44.1 (13.3.1999)

- The text colours are now translated for printer output. Foreground
  colour #1 now maps to ANSI colour #9 (= default foreground colour).
  Likewise, background colour #0 now maps to ANSI colour #9 (= default
  background colour). This specifically avoids printing red text.
  Other colours are not translated. It might be a good idea to do this,
  though.

- Text output is now optimized to write only to the bit planes required
  for proper display. Unlike the older versions, the bit plane mask 
  this optimization depends upon is recalculated after every layout 
  process.

text 44.2 (14.3.1999)

- Text style and colour attributes are no longer reset and reprinted
  for every line to go to the printer. The code now sends the attribute
  changes only when necessary.

text 44.3 (14.3.1999)

- Printing code shouldn't assume that it has to set the font colour
  and style attribute when it starts. It no longer does now.

text 44.4 (17.3.1999)

- No longer allocates a TmpRas without checking for memory allocation
  failure. No longer allocates a TmpRas that may turn out too narrow.
  No longer allocates or uses a TmpRas at all, in fact.

text 44.5 (17.3.1999)

- The dispatcher no longer uses inline code for rendering and
  printing as this would apparently lead to bad code being
  generated by the compiler.

- Diked out the unused highlighting code.

text 44.7 (19.5.1999)

- Restored most of the old code. This datatype is too weird to
  work with...

text 44.10 (29.11.1999)

- The code didn't properly cache SysBase, leading to a slowdown. Fixed.

text 44.13 (11.6.2000)

- The main dispatcher routine could apparently crash input.device due
  to too many local data being pushed onto the stack. Chopping the
  long dispatcher routine into single functions appears to have fixed
  the problem. Credit goes to Thomas Richter for finding the problem
  and providing for a remedy.

text 44.18 (11.6.2000)

- Added automatic stack size extension, just to be on the safe side.

text.datatype 44.20 (11.6.2000)

- Fixed a bug in the library close code, which would have led to a
  semaphore being held and released even until after the memory
  allocated for the semaphore had already been deallocated.

- To keep things nice and tidy, also made sure that the library expunge
  code works well with Kickstart 2.04 and below.

text.datatype 45.1 (31.10.00)

- completely rewritten

- now supports marking

- now supports searching.
  To open the requester press 'Return'. To search forward press 'Tab' 
  and to search backwards press the 'Shift Tab' keys.

text.datatype 45.2 (04.11.00)

- had problems with CR+LF text files. Fixed.

- fixed marking problems

- bottom line wasn't erased when scrolled.

- uses now a slightly different library initialisation code
   great thanks to Olaf and Thor

- auto copy, thanks to Allan for the framework

- search can now be case sensitive

text.datatype 45.3 (05.11.00)

- the right of a line wasn't erased. Fixed.

text.datatype 45.4 (10.11.00)

- it was always the first line displayed at start. Fixed.

text.datatype 45.5 (17.11.00) 

- the last line at a end of a text wasn't erased. Fixed.

text.datatype 45.6 (18.11.00)

- when pressing tab in the search requester the string gadget
  gets only deactivated, so the other option can be reached
  with keyboard only

text.datatype 45.7 (23.11.00)

- there was still a last line problem...

-------------------- AmigaOS 3.1.4.(1) project -----------------------

text.datatype 45.1 (14.7.2018)

- In case the init function could not open all libraries, it forgot
  to close them again.

- In case the init function failed, the text.database library was not
  released and hence leaked memory.

text.datatype 45.2 (16.9.2018)

- Similar to all other datatypes, there was another race in LIB_open()
  and LIB_Close().

------------------------ AmigaOS 3.2 project -------------------------

text.datatype 47.1 (31.8.2019)

- This is a backport of the OS 4.x text datatype, with a couple of
  fixes:

- The search window had a couple of race conditions, most notably
  did it access the text data private structures without attempting
  to lock them. Two parallel searches could have created chaos.
  Also, two search windows could have been created simultaneously.

- The search window handling was improved: It now stays open and
  allows interactive search.

- Copy to clipboard was backported from the textclip.library (not
  existing in 3.2)

text.datatype 47.4 (2.10.2019)

- In case damage was accumulated during scrolling, the text datatype
  did not refresh the damaged region and left the damage in the layer
  damage list without refreshing.

- The search window was made somewhat wider, leaving more room for
  localization.

text.datatype 47.5 (23.10.2019)

- Damage handling was still not good and ended a BeginRefresh(), even
  though it should not.

text.datatype 47.6 (01.11.2019)

- Aligned some gadgets of the search window.

text.datatype 47.7 (07.11.2019)

- Realigned all gadgets of the search window, now should scale with 
  all fonts.

- Allowed 7 pixel wide fonts to scale window down a bit for lower end 
  systems.

- Fixed problem with fallback to topaz font when gui window was too 
  small.

text.datatype 47.8 (19.11.2019)

- Fixed a wrong return code of LibExpunge() which could have crashed 
  the system in case the system went low on memory and had to remove 
  the text.datatype from memory.

text.datatype 47.11 (01.08.2020)

- DTM_PRINT was not receiving the correct error codes after printing
  regardless of success or failure. It always returned "CANCEL". Fixed.

text.datatype 47.12 (31.1.2021)

- Now only removes the layer damage that is actually repaired, without
  clearing the whole damage list and the LAYERREFRESH flag.
  Doing so would make a text.datatype object write over window borders
  if its GM_RENDER method was invoked after that area was damaged, but
  before the window's owner could properly refresh it (bug #1218).
  This happened, for example, with text.datatype instances embedded in
  an AmigaGuide document.

text.datatype 47.13 (4.3.2021)

- Dont' do find next/prev unless it is the exact request made.
  This should prevent it searching for text if you press space

Cross-references

Source: AmigaOS NDK 3.2 Release 4, Autodocs/text_dtc.doc, Include_H/datatypes/datatypes.h, ReleaseNotes/text-dt-RelNotes.