Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
/box-table-row-create {            % =>
2
  box-container-create             % => Box
3
  dup box-table-row-setup-methods  % => Box
4
  dup /box-table-row add-type      % => Box
5
} def
6
 
7
/box-table-row-get-baseline {      % => Row
8
  { box-table-cell-get-baseline max }
9
 
10
  2 index get-content
11
  reduce                           % => Row RowBaseline
12
  exch pop
13
} def
14
 
15
/box-table-row-get-colspans {      % => RowIndex Row
16
  [] 0                             % => RowIndex Row Spans I
17
  2 index get-content {            % => RowIndex Row Spans I Cell
18
    dup box-table-cell-get-colspan
19
    1 gt {
20
      4 index                      % => RowIndex Row Spans I Cell Row
21
      2 index                      % => RowIndex Row Spans I Cell Row Col
22
      2 index
23
      box-table-cell-get-colspan   % => RowIndex Row Spans I Cell Row Col Size
24
      cellspan-create              % => RowIndex Row Spans I Cell Span
25
 
26
      exch pop                     % => RowIndex Row Spans I Span
27
      3 2 roll
28
      array-prepend
29
      exch                         % => RowIndex Row Spans' I
30
    } { pop } ifelse
31
 
32
    1 add
33
  } forall                         % => RowIndex Row Spans I
34
  pop                              % => RowIndex Row Spans
35
 
36
  exch pop
37
  exch pop
38
} def
39
 
40
/box-table-row-get-rowspans {      % => RowIndex Row
41
  [] 0                             % => RowIndex Row Spans I
42
  2 index get-content {            % => RowIndex Row Spans I Cell
43
    dup box-table-cell-get-rowspan
44
    1 gt {
45
      4 index                      % => RowIndex Row Spans I Cell Row
46
      2 index                      % => RowIndex Row Spans I Cell Row Col
47
      2 index
48
      box-table-cell-get-rowspan   % => RowIndex Row Spans I Cell Row Col Size
49
      cellspan-create              % => RowIndex Row Spans I Cell Span
50
 
51
      exch pop                     % => RowIndex Row Spans I Span
52
      3 2 roll
53
      array-prepend
54
      exch                         % => RowIndex Row Spans' I
55
    } { pop } ifelse
56
 
57
    1 add
58
  } forall                         % => RowIndex Row Spans I
59
  pop                              % => RowIndex Row Spans
60
 
61
  exch pop
62
  exch pop
63
} def
64
 
65
/box-table-row-get-table-columns-max-widths {
66
  2 copy /get-max-width box-table-row-get-table-columns-xxx-widths
67
  exch pop
68
  exch pop
69
} def
70
 
71
/box-table-row-get-table-columns-min-widths {
72
  2 copy /get-min-width box-table-row-get-table-columns-xxx-widths
73
  exch pop
74
  exch pop
75
} def
76
 
77
/box-table-row-get-table-columns-xxx-widths { % => Context Row Method
78
  []                               % => Context Row Method Widths
79
  2 index get-content {            % => Context Row Method Widths Cell
80
    dup box-table-cell-get-colspan
81
    1 gt {                         % => Context Row Method Widths Cell
82
      pop 0                        % => Context Row Method Widths 0
83
    } {                            % => Context Row Method Widths Cell
84
      4 index exch                 % => Context Row Method Widths Context Cell
85
      3 index call-method          % => Context Row Method Widths W
86
    } ifelse
87
 
88
    exch array-prepend             % => Context Row Method Widths'
89
  } forall                         % => Context Row Method Widths'
90
 
91
  exch pop
92
  exch pop
93
  exch pop
94
} def
95
 
96
/box-table-row-height {            % => Row
97
 
98
  1 index get-content {            % => Row Height Cell
99
    dup box-table-cell-get-rowspan
100
    1 le {
101
      get-full-height
102
      max                          % => Row Height
103
    } {
104
      pop
105
    } ifelse
106
  } forall                         % => Row Height
107
  exch pop
108
} def
109
 
110
/box-table-row-resize {            % => Top Height Row
111
% Do cell vertical-align
112
% Calculate row baseline
113
  dup box-table-row-get-baseline   % => Top Height Row Baseline
114
 
115
% Process cells contained in current row
116
  1 index get-content {            % => Top Height Row Baseline Cell
117
% Offset cell if needed
118
    4 index
119
    1 index get-top-margin sub
120
 
121
    2 index /offset call-method    % => Top Height Row Baseline Cell
122
 
123
% Vertical-align cell (do not apply to rowspans)
124
 
125
    dup box-table-cell-get-rowspan 1 eq {
126
      1 index
127
      4 index
128
      2 index                      % => Top Height Row Baseline Cell Baseline Height Cell
129
      box-table-cell-apply-vertical-align
130
                                   % => Top Height Row Baseline Cell
131
 
132
% Expand cell to full row height
133
      3 index
134
      1 index
135
      put-full-height              % => Top Height Row Baseline Cell
136
 
137
    } if                           % => Top Height Row Baseline Cell
138
 
139
    pop                            % => Top Height Row Baseline
140
  } forall                         % => Top Height Row Baseline
141
 
142
  pop pop pop pop
143
} def
144
 
145
/box-table-row-setup-methods {     % => Box
146
  dup /Methods get
147
  dup /show {box-table-row-show} put
148
  pop pop
149
} def
150
 
151
% Note that we SHOULD owerride the show method inherited from GenericContainerBox,
152
% as it MAY draw row background in case it was set via CSS rules. As row box
153
% is a "fake" box and will never have reasonable size and/or position in the layout,
154
% we should prevent this
155
/box-table-row-show {              % => Viewport Box
156
  dup get-content {                % => Viewport Box Element
157
    dup /visibility get-css-value
158
    /visible eq {
159
      2 index 1 index
160
      /show call-method
161
    } if                           % => Viewport Box Element
162
    pop
163
  } forall
164
  pop pop
165
} def