[Oberon] ETHO Display structure.

Jörg Straube joerg.straube at iaeth.ch
Fri Mar 8 16:26:11 CET 2013


Even if I repeat myself, please study the book "The Oberon System" by Martin Reiser

You will learn how the modules Texts, TextFrames and other important modules interact and what a "handler" is and so on.

Basics you need to understand first.


Am 08.03.2013 um 15:52 schrieb eas lab <lab.eas at gmail.com>:

> Someone recently was asking about the Aos Display structure.
> With some much appreciated pointers from Paul Reed I was able to
> extract the following confirmation of the unexpected complexity
> of the algorithm to GetCharAtCursor:--
> TextFrames.LocateChar [with my comments] shows
> # first use the Y-coordinate to get the line
>    LocateLine(F, y, loc);
>    LOOP
> # consult the library re. the bitmap of the char just read
>      R.lib.GetObj(R.lib, ORD(ch), obj);
> # to see how many 'pixels' wide it is
>      dx := obj(Fonts.Char).dx;
> # if adding this char/brick to the line exceeds the X-coordinate
> #    THEN you've 'arrived' ELSE accumulate the X-coordinate
> # and get the next char/brick
>      INC(pos); ox := ox + dx; Texts.Read(R, ch)
> So it needs to step through each variable-width-char of the
> row, consulting the <manufacturers spec> about the char's width,
> to add the char-width to the accumulating line-length,
> until exceeding the X-coordinate.
> What I actually wanted was 'the last char read', which is still
> in the global ch, immediately after TextFrames.LocateChar
> exits; which i've used and confirm/tested.
> TextFrames.LocateChar in fact updates a RECORD which
> has the position/index in the corresponding Text.
> So you'd normally just read-the-Text-at-position to get
> the Char.
> I can't see how to use LocateChar, without modifying the existing TextFrames.Mod
> Firstly because LocateChar is not exported and also because, I want to
> just grab the global ch immediately LocateChar exits, instead of going
> indirectly via the position in <Text that TextFrames> was reading.
> And I don't know how my module would get the Text that TextFrames
> is reading.
> What are the rules/guidline for extending existing code?
> I've never worked 'in a team'.
> == Chris Glur.
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2334 bytes
Desc: not available
Url : https://lists.inf.ethz.ch/pipermail/oberon/attachments/20130308/ab9f5703/attachment.bin 

More information about the Oberon mailing list