134
|
1 ;;; dsssl-flow.el --- DSSSL flow objects
|
|
2 ;; Author: wmperry
|
|
3 ;; Created: 1997/04/18 13:48:10
|
|
4 ;; Version: 1.2
|
|
5 ;; Keywords:
|
|
6
|
|
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
8 ;;; Copyright (c) 1996, 1997 by William M. Perry (wmperry@cs.indiana.edu)
|
|
9 ;;; Copyright (c) 1997 by Free Software Foundation, Inc.
|
|
10 ;;;
|
|
11 ;;; This file is part of GNU Emacs.
|
|
12 ;;;
|
|
13 ;;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
14 ;;; it under the terms of the GNU General Public License as published by
|
|
15 ;;; the Free Software Foundation; either version 2, or (at your option)
|
|
16 ;;; any later version.
|
|
17 ;;;
|
|
18 ;;; GNU Emacs is distributed in the hope that it will be useful,
|
|
19 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21 ;;; GNU General Public License for more details.
|
|
22 ;;;
|
|
23 ;;; You should have received a copy of the GNU General Public License
|
|
24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the
|
|
25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
26 ;;; Boston, MA 02111-1307, USA.
|
|
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
28
|
|
29 (defstruct flow-object
|
|
30 (type 'unknown :read-only t) ; Name of this flow object
|
|
31 (properties nil)
|
|
32 (children nil)
|
|
33 (parent nil)
|
|
34 )
|
|
35
|
|
36 (defstruct dsssl-flow-processor
|
|
37 (name 'unknown :read-only t) ; Name of this processing backend
|
|
38 (init nil) ; initialize the backend
|
|
39 (handler nil) ; handle a single flow object
|
|
40 (sizeof nil) ; get size of a single flow object
|
|
41 (clean nil) ; cleanup instance of backend
|
|
42 )
|
|
43
|
|
44 (defun dsssl-flow-display (flows processor)
|
|
45 (let ((handler (dsssl-flow-processor-handler processor))
|
|
46 (flow-stack (list flows))
|
|
47 (content nil)
|
|
48 (node nil)
|
|
49 (last-object nil)
|
|
50 )
|
|
51 (while flow-stack
|
|
52 (setq content (pop flow-stack))
|
|
53 (dsssl-flow-progress-meter)
|
|
54 ;; Handle the element's content
|
|
55 (while content
|
|
56 (dsssl-flow-progress-meter)
|
|
57 (if (stringp (car content))
|
|
58 (dsssl-flow-handle-string-content (pop content))
|
|
59 (setq node (pop content))
|
|
60 ;; todo: collect all information about this flow object for faster
|
|
61 ;; lookup later.
|
|
62 (push (dsssl-flow-face-for-element node) dsssl-flow-active-faces)
|
|
63 (push (dsssl-flow-voice-for-element node) dsssl-flow-active-voices))
|
|
64 (case (flow-object-type node)
|
|
65 ;; Core DSSL components basic flow object classes
|
|
66 (sequence ; 12.6.1
|
|
67 )
|
|
68 (display-group ; 12.6.2
|
|
69 )
|
|
70 (paragraph ; 12.6.6
|
|
71 )
|
|
72 (paragraph-break ; 12.6.7
|
|
73 )
|
|
74 (external-graphic ; 12.6.15
|
|
75 )
|
|
76 ;; DSSSL options required in DSSSL online
|
|
77 ;; Simple page flow object class
|
|
78 (simple-page-sequence ; 12.6.3
|
|
79 )
|
|
80 ;; Table flow object classes
|
|
81 (table ; 12.6.27.1
|
|
82 )
|
|
83 (table-part ; 12.6.27.2
|
|
84 )
|
|
85 (table-column ; 12.6.27.3
|
|
86 )
|
|
87 (table-row ; 12.6.27.5
|
|
88 )
|
|
89 (table-border ; 12.6.27.7
|
|
90 )
|
|
91 (table-cell ; 12.6.27.6
|
|
92 ;; Do we need to handle table-cell at this level, or is that
|
|
93 ;; something that the display backend needs to handle, and we
|
|
94 ;; just query that in the `table-row' processor?
|
|
95 )
|
|
96 ;; Online display flow object classes
|
|
97 (vertical-scroll ; 12.6.28.1
|
|
98 )
|
|
99 (multi-mode ; 12.6.28.2
|
|
100 )
|
|
101 (marginalia ; 12.6.28.4
|
|
102 )
|
|
103 ;; Emacs/W3 specific flow objects
|
|
104 (applet ; Wow, Java
|
|
105 )
|
|
106 (script ; Scripts
|
|
107 (w3-handle-empty-tag))
|
|
108 (form-element ; Any form element
|
|
109 )
|
|
110 ;; pinhead, flame, and cookie can now all be handled by
|
|
111 ;; a stud-muffing DSSSL stylesheet - hooray!
|
|
112
|
|
113 ;; Generic formatting - all things that can be fully specified
|
|
114 ;; by a CSS stylesheet.
|
|
115 (otherwise
|
|
116 ;; handle the content
|
|
117 (dsssl-flow-handle-content node)))))))
|
|
118
|
|
119 (provide 'dsssl-flow)
|