Date: 2005-02-20T12:08:27
   Editor: SimonPepping
   Wiki: XML Graphics - FOP Wiki
   Page: FOPImplementationNotes
   URL: http://wiki.apache.org/xmlgraphics-fop/FOPImplementationNotes

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -164,5 +164,78 @@
 it implements the methods {{{setAreaTreeHandler}}} and {{{activateLayout}}},
 cf. {{{AreaTreeHandler.endPageSequence}}}.
 
+== Markers ==
 
-8 January 2005, SimonPepping
+`LM.addAreas()` calls `LM.addMarkers(starting, isfirst, islast)`. 
+`PageViewport` holds the marker maps `markersFirstStart`,
+`markersFirstAny`, `markersLastStart`, `markersLastEnd`, corresponding to
+the `retrieve-positions` `first-starting-within-page`,
+`first-including-carryover`, `last-starting-within-page`,
+`last-ending-within-page`. In addition `PageViewport` holds the marker map
+`LastAny`, from which a marker is retrieved when there is no marker with
+the requested position `last-*-within-page`. Here first and last refer
+to the position on the page, starting and ending refer to the traits
+`is-first` and `is-last` of the area to which the marker is associated.
+
+The LM obtains the values of `isfirst` and `islast` from the
+BP. `addMarkers` is called twice per `addAreas` call, once at the start
+with the value `starting = true`, before any child areas are returned,
+and once at the end with the value `starting = false`, after all child
+areas have been returned. When `starting == true`,
+`PageViewport.addMarkers` adds the markers to the maps `markers*Start`
+and `markers*Any`; when it is false, the markers are added to the maps
+`markers*End` and `markers*Any`.
+
+Retrieval of markers according to the spec:
+
+`first-starting-within-page`: first qualifying area in the containing
+page which `is-first` (`FirstStarting`); if `null`, then the first
+qualifying area in the containing page (`FirstAny`).
+
+`first-including-carryover`: first qualifying area in the containing
+page (`FirstAny`).
+
+`last-starting-within-page`: last qualifying area in the containing page
+which `is-first` (`LastStarting`); if `null`, then the last qualifying area
+in the containing page (`LastAny`).
+
+`last-ending-within-page`: last qualifying area in the containing page
+which `is-last` (`LastEnding`); if `null`, then the last qualifying area
+in the containing page (`LastAny`).
+
+If the containing page does not have a qualifying area, then the last
+qualifying area of the preceding page is used (`LastAny`), etc. until a
+qualifying area is found within the specified `retrieve-boundary`. (My
+own interpretation; the spec is not clear about preceding pages.)
+
+Scheme of the values of the parameters of an `LM.addMarkers` call, and
+of the addition of markers to the marker maps by
+`PageViewport.addMarkers`, for an area and a child area.  Note that the
+start and end of an area always fall on a single page:
+
+{{{
++----------------------------------------+ First?Starting?
+|     starting is-first is-last          | First?Any
+|                                        | LastStarting?
+|   +-------------------------------+    | // LastAny
+|   |                               |    |
+|   | starting is-first is-last     |    | First?Starting?
+|   |                               |    | First?Any
+|   |                               |    | LastStarting?
+|   |                               |    | // LastAny
+|   |                               |    |
+|   |                               |    |
+|   | !starting is-first is-last    |    | LastEnding?
+|   |                               |    | LastAny
+|   +-------------------------------+    |
+|                                        |
+|     !starting is-first is-last         | LastEnding?
++----------------------------------------+ LastAny
+}}}
+
+`First?` means: Only add if this is the first marker of its class.
+`Starting?` and `Ending?` means: Only add if the area has the trait
+`is-first` or `is-last`.
+
+
+20 February 2005, SimonPepping

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to