1 /* $NetBSD: border.c,v 1.14 2010/12/25 09:59:52 blymn Exp $ */
4 * Copyright (c) 2000 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #include <sys/cdefs.h>
34 __RCSID("$NetBSD: border.c,v 1.14 2010/12/25 09:59:52 blymn Exp $");
41 #include "curses_private.h"
43 #ifndef _CURSES_USE_MACROS
47 * Draw a border around stdscr using the specified
48 * delimiting characters.
51 border(chtype left
, chtype right
, chtype top
, chtype bottom
, chtype topleft
,
52 chtype topright
, chtype botleft
, chtype botright
)
54 return wborder(stdscr
, left
, right
, top
, bottom
, topleft
, topright
,
62 * Draw a border around the given window using the specified delimiting
66 wborder(WINDOW
*win
, chtype left
, chtype right
, chtype top
, chtype bottom
,
67 chtype topleft
, chtype topright
, chtype botleft
, chtype botright
)
73 if (!(left
& __CHARTEXT
))
75 if (!(right
& __CHARTEXT
))
77 if (!(top
& __CHARTEXT
))
79 if (!(bottom
& __CHARTEXT
))
81 if (!(topleft
& __CHARTEXT
))
82 topleft
|= ACS_ULCORNER
;
83 if (!(topright
& __CHARTEXT
))
84 topright
|= ACS_URCORNER
;
85 if (!(botleft
& __CHARTEXT
))
86 botleft
|= ACS_LLCORNER
;
87 if (!(botright
& __CHARTEXT
))
88 botright
|= ACS_LRCORNER
;
91 __CTRACE(__CTRACE_INPUT
, "wborder: left = %c, 0x%x\n",
92 left
& __CHARTEXT
, left
& __ATTRIBUTES
);
93 __CTRACE(__CTRACE_INPUT
, "wborder: right = %c, 0x%x\n",
94 right
& __CHARTEXT
, right
& __ATTRIBUTES
);
95 __CTRACE(__CTRACE_INPUT
, "wborder: top = %c, 0x%x\n",
96 top
& __CHARTEXT
, top
& __ATTRIBUTES
);
97 __CTRACE(__CTRACE_INPUT
, "wborder: bottom = %c, 0x%x\n",
98 bottom
& __CHARTEXT
, bottom
& __ATTRIBUTES
);
99 __CTRACE(__CTRACE_INPUT
, "wborder: topleft = %c, 0x%x\n",
100 topleft
& __CHARTEXT
, topleft
& __ATTRIBUTES
);
101 __CTRACE(__CTRACE_INPUT
, "wborder: topright = %c, 0x%x\n",
102 topright
& __CHARTEXT
, topright
& __ATTRIBUTES
);
103 __CTRACE(__CTRACE_INPUT
, "wborder: botleft = %c, 0x%x\n",
104 botleft
& __CHARTEXT
, botleft
& __ATTRIBUTES
);
105 __CTRACE(__CTRACE_INPUT
, "wborder: botright = %c, 0x%x\n",
106 botright
& __CHARTEXT
, botright
& __ATTRIBUTES
);
109 /* Merge window and background attributes */
110 left
|= (left
& __COLOR
) ? (win
->wattr
& ~__COLOR
) : win
->wattr
;
111 left
|= (left
& __COLOR
) ? (win
->battr
& ~__COLOR
) : win
->battr
;
112 right
|= (right
& __COLOR
) ? (win
->wattr
& ~__COLOR
) : win
->wattr
;
113 right
|= (right
& __COLOR
) ? (win
->battr
& ~__COLOR
) : win
->battr
;
114 top
|= (top
& __COLOR
) ? (win
->wattr
& ~__COLOR
) : win
->wattr
;
115 top
|= (top
& __COLOR
) ? (win
->battr
& ~__COLOR
) : win
->battr
;
116 bottom
|= (bottom
& __COLOR
) ? (win
->wattr
& ~__COLOR
) : win
->wattr
;
117 bottom
|= (bottom
& __COLOR
) ? (win
->battr
& ~__COLOR
) : win
->battr
;
118 topleft
|= (topleft
& __COLOR
) ? (win
->wattr
& ~__COLOR
) : win
->wattr
;
119 topleft
|= (topleft
& __COLOR
) ? (win
->battr
& ~__COLOR
) : win
->battr
;
120 topright
|= (topright
& __COLOR
) ? (win
->wattr
& ~__COLOR
) : win
->wattr
;
121 topright
|= (topright
& __COLOR
) ? (win
->battr
& ~__COLOR
) : win
->battr
;
122 botleft
|= (botleft
& __COLOR
) ? (win
->wattr
& ~__COLOR
) : win
->wattr
;
123 botleft
|= (botleft
& __COLOR
) ? (win
->battr
& ~__COLOR
) : win
->battr
;
124 botright
|= (botright
& __COLOR
) ? (win
->wattr
& ~__COLOR
) : win
->wattr
;
125 botright
|= (botright
& __COLOR
) ? (win
->battr
& ~__COLOR
) : win
->battr
;
127 endx
= win
->maxx
- 1;
128 endy
= win
->maxy
- 1;
129 fp
= win
->alines
[0]->line
;
130 lp
= win
->alines
[endy
]->line
;
133 for (i
= 1; i
< endy
; i
++) {
134 win
->alines
[i
]->line
[0].ch
= (wchar_t) left
& __CHARTEXT
;
135 win
->alines
[i
]->line
[0].attr
= (attr_t
) left
& __ATTRIBUTES
;
136 win
->alines
[i
]->line
[endx
].ch
= (wchar_t) right
& __CHARTEXT
;
137 win
->alines
[i
]->line
[endx
].attr
= (attr_t
) right
& __ATTRIBUTES
;
139 for (i
= 1; i
< endx
; i
++) {
140 fp
[i
].ch
= (wchar_t) top
& __CHARTEXT
;
141 fp
[i
].attr
= (attr_t
) top
& __ATTRIBUTES
;
142 lp
[i
].ch
= (wchar_t) bottom
& __CHARTEXT
;
143 lp
[i
].attr
= (attr_t
) bottom
& __ATTRIBUTES
;
147 if (!(win
->maxx
== LINES
&& win
->maxy
== COLS
&&
148 (win
->flags
& __SCROLLOK
) && (win
->flags
& __SCROLLWIN
))) {
149 fp
[0].ch
= (wchar_t) topleft
& __CHARTEXT
;
150 fp
[0].attr
= (attr_t
) topleft
& __ATTRIBUTES
;
151 fp
[endx
].ch
= (wchar_t) topright
& __CHARTEXT
;
152 fp
[endx
].attr
= (attr_t
) topright
& __ATTRIBUTES
;
153 lp
[0].ch
= (wchar_t) botleft
& __CHARTEXT
;
154 lp
[0].attr
= (attr_t
) botleft
& __ATTRIBUTES
;
155 lp
[endx
].ch
= (wchar_t) botright
& __CHARTEXT
;
156 lp
[endx
].attr
= (attr_t
) botright
& __ATTRIBUTES
;
160 #else /* HAVE_WCHAR */
161 cchar_t ls
, rs
, ts
, bs
, tl
, tr
, bl
, br
;
162 cchar_t
*lsp
, *rsp
, *tsp
, *bsp
, *tlp
, *trp
, *blp
, *brp
;
164 #define S(in, out, def) \
165 if (in & __CHARTEXT) { \
166 __cursesi_chtype_to_cchar(in, &out); \
168 memcpy(&out, def, sizeof(cchar_t)); \
169 out.attributes |= in & __ATTRIBUTES; \
173 S(left
, ls
, WACS_VLINE
);
174 S(right
, rs
, WACS_VLINE
);
175 S(top
, ts
, WACS_HLINE
);
176 S(bottom
, bs
, WACS_HLINE
);
177 S(topleft
, tl
, WACS_ULCORNER
);
178 S(topright
, tr
, WACS_URCORNER
);
179 S(botleft
, bl
, WACS_LLCORNER
);
180 S(botright
, br
, WACS_LRCORNER
);
182 return wborder_set(win
, lsp
, rsp
, tsp
, bsp
, tlp
, trp
, blp
, brp
);
183 #endif /* HAVE_WCHAR */
186 int border_set(const cchar_t
*ls
, const cchar_t
*rs
, const cchar_t
*ts
,
187 const cchar_t
*bs
, const cchar_t
*tl
, const cchar_t
*tr
,
188 const cchar_t
*bl
, const cchar_t
*br
)
193 return wborder_set(stdscr
, ls
, rs
, ts
, bs
, tl
, tr
, bl
, br
);
194 #endif /* HAVE_WCHAR */
197 int wborder_set(WINDOW
*win
, const cchar_t
*ls
, const cchar_t
*rs
,
198 const cchar_t
*ts
, const cchar_t
*bs
,
199 const cchar_t
*tl
, const cchar_t
*tr
,
200 const cchar_t
*bl
, const cchar_t
*br
)
205 int endy
, endx
, i
, j
, k
, cw
, pcw
, tlcw
, blcw
, trcw
, brcw
;
206 cchar_t left
, right
, bottom
, top
, topleft
, topright
, botleft
, botright
;
209 if ( ls
&& wcwidth( ls
->vals
[ 0 ]))
210 memcpy( &left
, ls
, sizeof( cchar_t
));
212 memcpy( &left
, WACS_VLINE
, sizeof( cchar_t
));
213 if ( rs
&& wcwidth( rs
->vals
[ 0 ]))
214 memcpy( &right
, rs
, sizeof( cchar_t
));
216 memcpy( &right
, WACS_VLINE
, sizeof( cchar_t
));
217 if ( ts
&& wcwidth( ts
->vals
[ 0 ]))
218 memcpy( &top
, ts
, sizeof( cchar_t
));
220 memcpy( &top
, WACS_HLINE
, sizeof( cchar_t
));
221 if ( bs
&& wcwidth( bs
->vals
[ 0 ]))
222 memcpy( &bottom
, bs
, sizeof( cchar_t
));
224 memcpy( &bottom
, WACS_HLINE
, sizeof( cchar_t
));
225 if ( tl
&& wcwidth( tl
->vals
[ 0 ]))
226 memcpy( &topleft
, tl
, sizeof( cchar_t
));
228 memcpy( &topleft
, WACS_ULCORNER
, sizeof( cchar_t
));
229 if ( tr
&& wcwidth( tr
->vals
[ 0 ]))
230 memcpy( &topright
, tr
, sizeof( cchar_t
));
232 memcpy( &topright
, WACS_URCORNER
, sizeof( cchar_t
));
233 if ( bl
&& wcwidth( bl
->vals
[ 0 ]))
234 memcpy( &botleft
, bl
, sizeof( cchar_t
));
236 memcpy( &botleft
, WACS_LLCORNER
, sizeof( cchar_t
));
237 if ( br
&& wcwidth( br
->vals
[ 0 ]))
238 memcpy( &botright
, br
, sizeof( cchar_t
));
240 memcpy( &botright
, WACS_LRCORNER
, sizeof( cchar_t
));
243 __CTRACE(__CTRACE_INPUT
, "wborder_set: left = %c, 0x%x\n",
244 left
.vals
[0], left
.attributes
);
245 __CTRACE(__CTRACE_INPUT
, "wborder_set: right = %c, 0x%x\n",
246 right
.vals
[0], right
.attributes
);
247 __CTRACE(__CTRACE_INPUT
, "wborder_set: top = %c, 0x%x\n",
248 top
.vals
[0], top
.attributes
);
249 __CTRACE(__CTRACE_INPUT
, "wborder_set: bottom = %c, 0x%x\n",
250 bottom
.vals
[0], bottom
.attributes
);
251 __CTRACE(__CTRACE_INPUT
, "wborder_set: topleft = %c, 0x%x\n",
252 topleft
.vals
[0], topleft
.attributes
);
253 __CTRACE(__CTRACE_INPUT
, "wborder_set: topright = %c, 0x%x\n",
254 topright
.vals
[0], topright
.attributes
);
255 __CTRACE(__CTRACE_INPUT
, "wborder_set: botleft = %c, 0x%x\n",
256 botleft
.vals
[0], botleft
.attributes
);
257 __CTRACE(__CTRACE_INPUT
, "wborder_set: botright = %c, 0x%x\n",
258 botright
.vals
[0], botright
.attributes
);
261 /* Merge window attributes */
262 left
.attributes
|= (left
.attributes
& __COLOR
) ?
263 (win
->wattr
& ~__COLOR
) : win
->wattr
;
264 right
.attributes
|= (right
.attributes
& __COLOR
) ?
265 (win
->wattr
& ~__COLOR
) : win
->wattr
;
266 top
.attributes
|= (top
.attributes
& __COLOR
) ?
267 (win
->wattr
& ~__COLOR
) : win
->wattr
;
268 bottom
.attributes
|= (bottom
.attributes
& __COLOR
) ?
269 (win
->wattr
& ~__COLOR
) : win
->wattr
;
270 topleft
.attributes
|= (topleft
.attributes
& __COLOR
) ?
271 (win
->wattr
& ~__COLOR
) : win
->wattr
;
272 topright
.attributes
|= (topright
.attributes
& __COLOR
) ?
273 (win
->wattr
& ~__COLOR
) : win
->wattr
;
274 botleft
.attributes
|= (botleft
.attributes
& __COLOR
) ?
275 (win
->wattr
& ~__COLOR
) : win
->wattr
;
276 botright
.attributes
|= (botright
.attributes
& __COLOR
) ?
277 (win
->wattr
& ~__COLOR
) : win
->wattr
;
279 endx
= win
->maxx
- 1;
280 endy
= win
->maxy
- 1;
283 for (i
= 1; i
< endy
; i
++) {
285 cw
= wcwidth( left
.vals
[ 0 ]);
288 for ( j
= 0; j
< cw
; j
++ ) {
289 win
->alines
[i
]->line
[j
].ch
= left
.vals
[ 0 ];
290 win
->alines
[i
]->line
[j
].attr
= left
.attributes
;
291 np
= win
->alines
[i
]->line
[j
].nsp
;
298 win
->alines
[i
]->line
[j
].nsp
= NULL
;
301 SET_WCOL( win
->alines
[i
]->line
[j
], -j
);
303 SET_WCOL( win
->alines
[i
]->line
[j
], cw
);
304 if ( left
.elements
> 1 ) {
305 for (k
= 1; k
< left
.elements
; k
++) {
306 np
= (nschar_t
*)malloc(sizeof(nschar_t
));
309 np
->ch
= left
.vals
[ k
];
310 np
->next
= win
->alines
[i
]->line
[j
].nsp
;
311 win
->alines
[i
]->line
[j
].nsp
317 for ( j
= cw
; WCOL( win
->alines
[i
]->line
[j
]) < 0; j
++ ) {
319 __CTRACE(__CTRACE_INPUT
,
320 "wborder_set: clean out partial char[%d]", j
);
322 win
->alines
[i
]->line
[j
].ch
= ( wchar_t )btowc(win
->bch
);
323 if (_cursesi_copy_nsp(win
->bnsp
,
324 &win
->alines
[i
]->line
[j
]) == ERR
)
326 SET_WCOL( win
->alines
[i
]->line
[j
], 1 );
329 cw
= wcwidth( right
.vals
[ 0 ]);
332 pcw
= WCOL( win
->alines
[i
]->line
[endx
- cw
]);
333 for ( j
= endx
- cw
+ 1; j
<= endx
; j
++ ) {
334 win
->alines
[i
]->line
[j
].ch
= right
.vals
[ 0 ];
335 win
->alines
[i
]->line
[j
].attr
= right
.attributes
;
336 np
= win
->alines
[i
]->line
[j
].nsp
;
343 win
->alines
[i
]->line
[j
].nsp
= NULL
;
345 if ( j
== endx
- cw
+ 1 ) {
346 SET_WCOL( win
->alines
[i
]->line
[j
], cw
);
347 if ( right
.elements
> 1 ) {
348 for (k
= 1; k
< right
.elements
; k
++) {
349 np
= (nschar_t
*)malloc(sizeof(nschar_t
));
352 np
->ch
= right
.vals
[ k
];
353 np
->next
= win
->alines
[i
]->line
[j
].nsp
;
354 win
->alines
[i
]->line
[j
].nsp
359 SET_WCOL( win
->alines
[i
]->line
[j
],
364 __CTRACE(__CTRACE_INPUT
,
365 "wborder_set: clean out partial chars[%d:%d]",
366 endx
- cw
+ pcw
, endx
- cw
);
368 k
= pcw
< 0 ? endx
-cw
+ pcw
: endx
- cw
;
369 for ( j
= endx
- cw
; j
>= k
; j
-- ) {
370 win
->alines
[i
]->line
[j
].ch
371 = (wchar_t)btowc(win
->bch
);
372 if (_cursesi_copy_nsp(win
->bnsp
,
373 &win
->alines
[i
]->line
[j
]) == ERR
)
375 win
->alines
[i
]->line
[j
].attr
= win
->battr
;
376 SET_WCOL( win
->alines
[i
]->line
[j
], 1 );
380 tlcw
= wcwidth( topleft
.vals
[ 0 ]);
383 blcw
= wcwidth( botleft
.vals
[ 0 ]);
386 trcw
= wcwidth( topright
.vals
[ 0 ]);
389 brcw
= wcwidth( botright
.vals
[ 0 ]);
393 cw
= wcwidth( top
.vals
[ 0 ]);
396 for (i
= tlcw
; i
<= min( endx
- cw
, endx
- trcw
); i
+= cw
) {
397 for ( j
= 0; j
< cw
; j
++ ) {
398 win
->alines
[ 0 ]->line
[i
+ j
].ch
= top
.vals
[ 0 ];
399 win
->alines
[ 0 ]->line
[i
+ j
].attr
= top
.attributes
;
400 np
= win
->alines
[ 0 ]->line
[i
+ j
].nsp
;
407 win
->alines
[ 0 ]->line
[i
+ j
].nsp
= NULL
;
410 SET_WCOL( win
->alines
[ 0 ]->line
[ i
+ j
], -j
);
412 SET_WCOL( win
->alines
[ 0 ]->line
[ i
+ j
], cw
);
413 if ( top
.elements
> 1 ) {
414 for ( k
= 1; k
< top
.elements
; k
++ ) {
415 np
= (nschar_t
*)malloc(sizeof(nschar_t
));
418 np
->ch
= top
.vals
[ k
];
419 np
->next
= win
->alines
[0]->line
[i
+ j
].nsp
;
420 win
->alines
[0]->line
[i
+ j
].nsp
427 while ( i
<= endx
- trcw
) {
428 win
->alines
[0]->line
[i
].ch
=
429 ( wchar_t )btowc(( int ) win
->bch
);
430 if (_cursesi_copy_nsp(win
->bnsp
,
431 &win
->alines
[0]->line
[i
]) == ERR
)
433 win
->alines
[ 0 ]->line
[ i
].attr
= win
->battr
;
434 SET_WCOL( win
->alines
[ 0 ]->line
[ i
], 1 );
438 for (i
= blcw
; i
<= min( endx
- cw
, endx
- brcw
); i
+= cw
) {
439 for ( j
= 0; j
< cw
; j
++ ) {
440 win
->alines
[ endy
]->line
[i
+ j
].ch
= bottom
.vals
[ 0 ];
441 win
->alines
[endy
]->line
[i
+ j
].attr
= bottom
.attributes
;
442 np
= win
->alines
[ endy
]->line
[i
+ j
].nsp
;
449 win
->alines
[ endy
]->line
[i
+ j
].nsp
= NULL
;
452 SET_WCOL( win
->alines
[endy
]->line
[i
+ j
], -j
);
454 SET_WCOL( win
->alines
[endy
]->line
[i
+ j
], cw
);
455 if ( bottom
.elements
> 1 ) {
456 for ( k
= 1; k
< bottom
.elements
;
458 if ( !( np
= ( nschar_t
*)malloc( sizeof( nschar_t
))))
460 np
->ch
= bottom
.vals
[ k
];
461 np
->next
= win
->alines
[endy
]->line
[i
+ j
].nsp
;
462 win
->alines
[endy
]->line
[i
+ j
].nsp
= np
;
468 while ( i
<= endx
- brcw
) {
469 win
->alines
[endy
]->line
[i
].ch
=
470 (wchar_t)btowc((int) win
->bch
);
471 if (_cursesi_copy_nsp(win
->bnsp
,
472 &win
->alines
[endy
]->line
[i
]) == ERR
)
474 win
->alines
[ endy
]->line
[ i
].attr
= win
->battr
;
475 SET_WCOL( win
->alines
[ endy
]->line
[ i
], 1 );
480 if (!(win
->maxx
== LINES
&& win
->maxy
== COLS
&&
481 (win
->flags
& __SCROLLOK
) && (win
->flags
& __SCROLLWIN
))) {
482 for ( i
= 0; i
< tlcw
; i
++ ) {
483 win
->alines
[ 0 ]->line
[i
].ch
= topleft
.vals
[ 0 ];
484 win
->alines
[ 0 ]->line
[i
].attr
= topleft
.attributes
;
485 np
= win
->alines
[ 0 ]->line
[i
].nsp
;
492 win
->alines
[ 0 ]->line
[i
].nsp
= NULL
;
495 SET_WCOL( win
->alines
[ 0 ]->line
[ i
], -i
);
497 SET_WCOL( win
->alines
[ 0 ]->line
[ i
], tlcw
);
498 if ( topleft
.elements
> 1 ) {
499 for ( k
= 1; k
< topleft
.elements
;
501 np
= (nschar_t
*)malloc(sizeof(nschar_t
));
504 np
->ch
= topleft
.vals
[ k
];
505 np
->next
= win
->alines
[ 0 ]->line
[i
].nsp
;
506 win
->alines
[ 0 ]->line
[i
].nsp
512 for ( i
= endx
- trcw
+ 1; i
<= endx
; i
++ ) {
513 win
->alines
[ 0 ]->line
[i
].ch
= topright
.vals
[ 0 ];
514 win
->alines
[ 0 ]->line
[i
].attr
= topright
.attributes
;
515 np
= win
->alines
[ 0 ]->line
[i
].nsp
;
522 win
->alines
[ 0 ]->line
[i
].nsp
= NULL
;
524 if ( i
== endx
- trcw
+ 1 ) {
525 SET_WCOL( win
->alines
[ 0 ]->line
[ i
], trcw
);
526 if ( topright
.elements
> 1 ) {
527 for ( k
= 1; k
< topright
.elements
;
529 np
= (nschar_t
*)malloc(sizeof(nschar_t
));
532 np
->ch
= topright
.vals
[ k
];
533 np
->next
= win
->alines
[0]->line
[i
].nsp
;
534 win
->alines
[ 0 ]->line
[i
].nsp
539 SET_WCOL( win
->alines
[ 0 ]->line
[ i
],
540 endx
- trcw
+ 1 - i
);
542 for ( i
= 0; i
< blcw
; i
++ ) {
543 win
->alines
[ endy
]->line
[i
].ch
= botleft
.vals
[ 0 ];
544 win
->alines
[ endy
]->line
[i
].attr
= botleft
.attributes
;
545 np
= win
->alines
[ endy
]->line
[i
].nsp
;
552 win
->alines
[ endy
]->line
[i
].nsp
= NULL
;
555 SET_WCOL( win
->alines
[endy
]->line
[i
], -i
);
557 SET_WCOL( win
->alines
[endy
]->line
[i
], blcw
);
558 if ( botleft
.elements
> 1 ) {
559 for ( k
= 1; k
< botleft
.elements
;
561 np
= (nschar_t
*)malloc(sizeof(nschar_t
));
564 np
->ch
= botleft
.vals
[ k
];
565 np
->next
= win
->alines
[endy
]->line
[i
].nsp
;
566 win
->alines
[endy
]->line
[i
].nsp
572 for ( i
= endx
- brcw
+ 1; i
<= endx
; i
++ ) {
573 win
->alines
[ endy
]->line
[i
].ch
= botright
.vals
[ 0 ];
574 win
->alines
[ endy
]->line
[i
].attr
= botright
.attributes
;
575 np
= win
->alines
[ endy
]->line
[i
].nsp
;
582 win
->alines
[ endy
]->line
[i
].nsp
= NULL
;
584 if ( i
== endx
- brcw
+ 1 ) {
585 SET_WCOL( win
->alines
[ endy
]->line
[ i
],
587 if ( botright
.elements
> 1 ) {
588 for ( k
= 1; k
< botright
.elements
; k
++ ) {
589 np
= (nschar_t
*)malloc(sizeof(nschar_t
));
592 np
->ch
= botright
.vals
[ k
];
593 np
->next
= win
->alines
[endy
]->line
[i
].nsp
;
594 win
->alines
[endy
]->line
[i
].nsp
599 SET_WCOL( win
->alines
[ endy
]->line
[ i
],
600 endx
- brcw
+ 1 - i
);
605 #endif /* HAVE_WCHAR */