annotate lisp/w3/dsssl-flow.el @ 134:34a5b81f86ba r20-2b1

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