@ -1,5 +1,5 @@
//
//
// "$Id: Fl_Help_View.cxx,v 1.1.2.37 2002/07/18 15:27:21 easysw Exp $"
// "$Id: Fl_Help_View.cxx,v 1.1.2.38 2002/08/09 01:09:49 easysw Exp $"
//
//
// Fl_Help_View widget routines.
// Fl_Help_View widget routines.
//
//
@ -322,7 +322,7 @@ Fl_Help_View::draw()
attr [ 1024 ] ; // Attribute buffer
attr [ 1024 ] ; // Attribute buffer
int xx , yy , ww , hh ; // Current positions and sizes
int xx , yy , ww , hh ; // Current positions and sizes
int line ; // Current line
int line ; // Current line
unsigned char font , size ; // Current font and size
unsigned char font , f size; // Current font and size
int head , pre , // Flags for text
int head , pre , // Flags for text
needspace ; // Do we need whitespace?
needspace ; // Do we need whitespace?
Fl_Boxtype b = box ( ) ? box ( ) : FL_DOWN_BOX ;
Fl_Boxtype b = box ( ) ? box ( ) : FL_DOWN_BOX ;
@ -371,7 +371,7 @@ Fl_Help_View::draw()
head = 0 ;
head = 0 ;
needspace = 0 ;
needspace = 0 ;
initfont ( font , size ) ;
initfont ( font , f size) ;
for ( ptr = block - > start , s = buf ; ptr < block - > end ; )
for ( ptr = block - > start , s = buf ; ptr < block - > end ; )
{
{
@ -399,8 +399,8 @@ Fl_Help_View::draw()
fl_draw ( buf , xx + x ( ) - leftline_ , yy + y ( ) ) ;
fl_draw ( buf , xx + x ( ) - leftline_ , yy + y ( ) ) ;
xx + = ww ;
xx + = ww ;
if ( ( size + 2 ) > hh )
if ( ( f size + 2 ) > hh )
hh = size + 2 ;
hh = f size + 2 ;
needspace = 0 ;
needspace = 0 ;
}
}
@ -419,7 +419,7 @@ Fl_Help_View::draw()
line + + ;
line + + ;
xx = block - > line [ line ] ;
xx = block - > line [ line ] ;
yy + = hh ;
yy + = hh ;
hh = size + 2 ;
hh = f size + 2 ;
}
}
else if ( * ptr = = ' \t ' )
else if ( * ptr = = ' \t ' )
{
{
@ -430,8 +430,8 @@ Fl_Help_View::draw()
else
else
* s + + = ' ' ;
* s + + = ' ' ;
if ( ( size + 2 ) > hh )
if ( ( f size + 2 ) > hh )
hh = size + 2 ;
hh = f size + 2 ;
ptr + + ;
ptr + + ;
}
}
@ -514,28 +514,28 @@ Fl_Help_View::draw()
{
{
if ( tolower ( buf [ 0 ] ) = = ' h ' )
if ( tolower ( buf [ 0 ] ) = = ' h ' )
{
{
font = FL_HELVETICA_BOLD ;
font = FL_HELVETICA_BOLD ;
size = textsize_ + ' 7 ' - buf [ 1 ] ;
f size = textsize_ + ' 7 ' - buf [ 1 ] ;
}
}
else if ( strcasecmp ( buf , " DT " ) = = 0 )
else if ( strcasecmp ( buf , " DT " ) = = 0 )
{
{
font = textfont_ | FL_ITALIC ;
font = textfont_ | FL_ITALIC ;
size = textsize_ ;
f size = textsize_ ;
}
}
else if ( strcasecmp ( buf , " PRE " ) = = 0 )
else if ( strcasecmp ( buf , " PRE " ) = = 0 )
{
{
font = FL_COURIER ;
font = FL_COURIER ;
size = textsize_ ;
f size = textsize_ ;
pre = 1 ;
pre = 1 ;
}
}
if ( strcasecmp ( buf , " LI " ) = = 0 )
if ( strcasecmp ( buf , " LI " ) = = 0 )
{
{
fl_font ( FL_SYMBOL , size ) ;
fl_font ( FL_SYMBOL , f size) ;
fl_draw ( " \267 " , xx - size + x ( ) - leftline_ , yy + y ( ) ) ;
fl_draw ( " \267 " , xx - f size + x ( ) - leftline_ , yy + y ( ) ) ;
}
}
pushfont ( font , size ) ;
pushfont ( font , f size) ;
}
}
else if ( strcasecmp ( buf , " A " ) = = 0 & &
else if ( strcasecmp ( buf , " A " ) = = 0 & &
get_attr ( attrs , " HREF " , attr , sizeof ( attr ) ) ! = NULL )
get_attr ( attrs , " HREF " , attr , sizeof ( attr ) ) ! = NULL )
@ -544,21 +544,21 @@ Fl_Help_View::draw()
fl_color ( textcolor_ ) ;
fl_color ( textcolor_ ) ;
else if ( strcasecmp ( buf , " B " ) = = 0 | |
else if ( strcasecmp ( buf , " B " ) = = 0 | |
strcasecmp ( buf , " STRONG " ) = = 0 )
strcasecmp ( buf , " STRONG " ) = = 0 )
pushfont ( font | = FL_BOLD , size ) ;
pushfont ( font | = FL_BOLD , f size) ;
else if ( strcasecmp ( buf , " TD " ) = = 0 | |
else if ( strcasecmp ( buf , " TD " ) = = 0 | |
strcasecmp ( buf , " TH " ) = = 0 )
strcasecmp ( buf , " TH " ) = = 0 )
{
{
int tx , ty , tw , th ;
int tx , ty , tw , th ;
if ( tolower ( buf [ 1 ] ) = = ' h ' )
if ( tolower ( buf [ 1 ] ) = = ' h ' )
pushfont ( font | = FL_BOLD , size ) ;
pushfont ( font | = FL_BOLD , f size) ;
else
else
pushfont ( font = textfont_ , size ) ;
pushfont ( font = textfont_ , f size) ;
tx = block - > x - 4 - leftline_ ;
tx = block - > x - 4 - leftline_ ;
ty = block - > y - topline_ - size - 3 ;
ty = block - > y - topline_ - f size - 3 ;
tw = block - > w - block - > x + 7 ;
tw = block - > w - block - > x + 7 ;
th = block - > h + size - 5 ;
th = block - > h + f size - 5 ;
if ( tx < 0 )
if ( tx < 0 )
{
{
@ -587,14 +587,14 @@ Fl_Help_View::draw()
}
}
else if ( strcasecmp ( buf , " I " ) = = 0 | |
else if ( strcasecmp ( buf , " I " ) = = 0 | |
strcasecmp ( buf , " EM " ) = = 0 )
strcasecmp ( buf , " EM " ) = = 0 )
pushfont ( font | = FL_ITALIC , size ) ;
pushfont ( font | = FL_ITALIC , f size) ;
else if ( strcasecmp ( buf , " CODE " ) = = 0 | |
else if ( strcasecmp ( buf , " CODE " ) = = 0 | |
strcasecmp ( buf , " TT " ) = = 0 )
strcasecmp ( buf , " TT " ) = = 0 )
pushfont ( font = FL_COURIER , size ) ;
pushfont ( font = FL_COURIER , f size) ;
else if ( strcasecmp ( buf , " KBD " ) = = 0 )
else if ( strcasecmp ( buf , " KBD " ) = = 0 )
pushfont ( font = FL_COURIER_BOLD , size ) ;
pushfont ( font = FL_COURIER_BOLD , f size) ;
else if ( strcasecmp ( buf , " VAR " ) = = 0 )
else if ( strcasecmp ( buf , " VAR " ) = = 0 )
pushfont ( font = FL_COURIER_ITALIC , size ) ;
pushfont ( font = FL_COURIER_ITALIC , f size) ;
else if ( strcasecmp ( buf , " /HEAD " ) = = 0 )
else if ( strcasecmp ( buf , " /HEAD " ) = = 0 )
head = 0 ;
head = 0 ;
else if ( strcasecmp ( buf , " /H1 " ) = = 0 | |
else if ( strcasecmp ( buf , " /H1 " ) = = 0 | |
@ -611,10 +611,10 @@ Fl_Help_View::draw()
strcasecmp ( buf , " /TT " ) = = 0 | |
strcasecmp ( buf , " /TT " ) = = 0 | |
strcasecmp ( buf , " /KBD " ) = = 0 | |
strcasecmp ( buf , " /KBD " ) = = 0 | |
strcasecmp ( buf , " /VAR " ) = = 0 )
strcasecmp ( buf , " /VAR " ) = = 0 )
popfont ( font , size ) ;
popfont ( font , f size) ;
else if ( strcasecmp ( buf , " /PRE " ) = = 0 )
else if ( strcasecmp ( buf , " /PRE " ) = = 0 )
{
{
popfont ( font , size ) ;
popfont ( font , f size) ;
pre = 0 ;
pre = 0 ;
}
}
else if ( strcasecmp ( buf , " IMG " ) = = 0 )
else if ( strcasecmp ( buf , " IMG " ) = = 0 )
@ -678,7 +678,7 @@ Fl_Help_View::draw()
line + + ;
line + + ;
xx = block - > line [ line ] ;
xx = block - > line [ line ] ;
yy + = hh ;
yy + = hh ;
hh = size + 2 ;
hh = f size + 2 ;
needspace = 0 ;
needspace = 0 ;
ptr + + ;
ptr + + ;
@ -713,15 +713,15 @@ Fl_Help_View::draw()
ptr = strchr ( ptr , ' ; ' ) + 1 ;
ptr = strchr ( ptr , ' ; ' ) + 1 ;
}
}
if ( ( size + 2 ) > hh )
if ( ( f size + 2 ) > hh )
hh = size + 2 ;
hh = f size + 2 ;
}
}
else
else
{
{
* s + + = * ptr + + ;
* s + + = * ptr + + ;
if ( ( size + 2 ) > hh )
if ( ( f size + 2 ) > hh )
hh = size + 2 ;
hh = f size + 2 ;
}
}
}
}
@ -774,13 +774,13 @@ Fl_Help_View::format()
attr [ 1024 ] , // Attribute buffer
attr [ 1024 ] , // Attribute buffer
wattr [ 1024 ] , // Width attribute buffer
wattr [ 1024 ] , // Width attribute buffer
hattr [ 1024 ] , // Height attribute buffer
hattr [ 1024 ] , // Height attribute buffer
link [ 1024 ] ; // Link destination
linkdest [ 1024 ] ; // Link destination
int xx , yy , ww , hh ; // Size of current text fragment
int xx , yy , ww , hh ; // Size of current text fragment
int line ; // Current line in block
int line ; // Current line in block
int links ; // Links for current line
int links ; // Links for current line
unsigned char font , size ; // Current font and size
unsigned char font , f size; // Current font and size
unsigned char border ; // Draw border?
unsigned char border ; // Draw border?
int align , // Current alignment
int t align, // Current alignment
newalign , // New alignment
newalign , // New alignment
head , // In the <HEAD> section?
head , // In the <HEAD> section?
pre , // <PRE> text?
pre , // <PRE> text?
@ -816,24 +816,24 @@ Fl_Help_View::format()
return ;
return ;
// Setup for formatting...
// Setup for formatting...
initfont ( font , size ) ;
initfont ( font , f size) ;
line = 0 ;
line = 0 ;
links = 0 ;
links = 0 ;
xx = 4 ;
xx = 4 ;
yy = size + 2 ;
yy = f size + 2 ;
ww = 0 ;
ww = 0 ;
column = 0 ;
column = 0 ;
border = 0 ;
border = 0 ;
hh = 0 ;
hh = 0 ;
block = add_block ( value_ , xx , yy , hsize_ , 0 ) ;
block = add_block ( value_ , xx , yy , hsize_ , 0 ) ;
row = 0 ;
row = 0 ;
head = 0 ;
head = 0 ;
pre = 0 ;
pre = 0 ;
align = LEFT ;
t align = LEFT ;
newalign = LEFT ;
newalign = LEFT ;
needspace = 0 ;
needspace = 0 ;
link [ 0 ] = ' \0 ' ;
linkdest [ 0 ] = ' \0 ' ;
for ( ptr = value_ , s = buf ; * ptr ; )
for ( ptr = value_ , s = buf ; * ptr ; )
{
{
@ -867,24 +867,24 @@ Fl_Help_View::format()
hh = 0 ;
hh = 0 ;
}
}
if ( link [ 0 ] )
if ( linkdest [ 0 ] )
add_link ( link , xx , yy - size , ww , size ) ;
add_link ( linkdest , xx , yy - f size, ww , f size) ;
xx + = ww ;
xx + = ww ;
if ( ( size + 2 ) > hh )
if ( ( f size + 2 ) > hh )
hh = size + 2 ;
hh = f size + 2 ;
needspace = 0 ;
needspace = 0 ;
}
}
else if ( pre )
else if ( pre )
{
{
// Add a link as needed...
// Add a link as needed...
if ( link [ 0 ] )
if ( linkdest [ 0 ] )
add_link ( link , xx , yy - hh , ww , hh ) ;
add_link ( linkdest , xx , yy - hh , ww , hh ) ;
xx + = ww ;
xx + = ww ;
if ( ( size + 2 ) > hh )
if ( ( f size + 2 ) > hh )
hh = size + 2 ;
hh = f size + 2 ;
// Handle preformatted text...
// Handle preformatted text...
while ( isspace ( * ptr ) )
while ( isspace ( * ptr ) )
@ -897,13 +897,13 @@ Fl_Help_View::format()
xx = block - > x ;
xx = block - > x ;
yy + = hh ;
yy + = hh ;
block - > h + = hh ;
block - > h + = hh ;
hh = size + 2 ;
hh = f size + 2 ;
}
}
else
else
xx + = ( int ) fl_width ( ' ' ) ;
xx + = ( int ) fl_width ( ' ' ) ;
if ( ( size + 2 ) > hh )
if ( ( f size + 2 ) > hh )
hh = size + 2 ;
hh = f size + 2 ;
ptr + + ;
ptr + + ;
}
}
@ -965,13 +965,13 @@ Fl_Help_View::format()
else if ( strcasecmp ( buf , " A " ) = = 0 )
else if ( strcasecmp ( buf , " A " ) = = 0 )
{
{
if ( get_attr ( attrs , " NAME " , attr , sizeof ( attr ) ) ! = NULL )
if ( get_attr ( attrs , " NAME " , attr , sizeof ( attr ) ) ! = NULL )
add_target ( attr , yy - size - 2 ) ;
add_target ( attr , yy - f size - 2 ) ;
if ( get_attr ( attrs , " HREF " , attr , sizeof ( attr ) ) ! = NULL )
if ( get_attr ( attrs , " HREF " , attr , sizeof ( attr ) ) ! = NULL )
strlcpy ( link , attr , sizeof ( link ) ) ;
strlcpy ( linkdest , attr , sizeof ( linkdest ) ) ;
}
}
else if ( strcasecmp ( buf , " /A " ) = = 0 )
else if ( strcasecmp ( buf , " /A " ) = = 0 )
link [ 0 ] = ' \0 ' ;
linkdest [ 0 ] = ' \0 ' ;
else if ( strcasecmp ( buf , " BODY " ) = = 0 )
else if ( strcasecmp ( buf , " BODY " ) = = 0 )
{
{
bgcolor_ = get_color ( get_attr ( attrs , " BGCOLOR " , attr , sizeof ( attr ) ) ,
bgcolor_ = get_color ( get_attr ( attrs , " BGCOLOR " , attr , sizeof ( attr ) ) ,
@ -1016,8 +1016,8 @@ Fl_Help_View::format()
strcasecmp ( buf , " OL " ) = = 0 | |
strcasecmp ( buf , " OL " ) = = 0 | |
strcasecmp ( buf , " DL " ) = = 0 )
strcasecmp ( buf , " DL " ) = = 0 )
{
{
block - > h + = size + 2 ;
block - > h + = f size + 2 ;
xx + = 4 * size ;
xx + = 4 * f size;
}
}
else if ( strcasecmp ( buf , " TABLE " ) = = 0 )
else if ( strcasecmp ( buf , " TABLE " ) = = 0 )
{
{
@ -1028,7 +1028,7 @@ Fl_Help_View::format()
tc = rc = get_color ( get_attr ( attrs , " BGCOLOR " , attr , sizeof ( attr ) ) , bgcolor_ ) ;
tc = rc = get_color ( get_attr ( attrs , " BGCOLOR " , attr , sizeof ( attr ) ) , bgcolor_ ) ;
block - > h + = size + 2 ;
block - > h + = f size + 2 ;
format_table ( & table_width , columns , start ) ;
format_table ( & table_width , columns , start ) ;
@ -1043,27 +1043,27 @@ Fl_Help_View::format()
if ( tolower ( buf [ 0 ] ) = = ' h ' & & isdigit ( buf [ 1 ] ) )
if ( tolower ( buf [ 0 ] ) = = ' h ' & & isdigit ( buf [ 1 ] ) )
{
{
font = FL_HELVETICA_BOLD ;
font = FL_HELVETICA_BOLD ;
size = textsize_ + ' 7 ' - buf [ 1 ] ;
f size = textsize_ + ' 7 ' - buf [ 1 ] ;
}
}
else if ( strcasecmp ( buf , " DT " ) = = 0 )
else if ( strcasecmp ( buf , " DT " ) = = 0 )
{
{
font = textfont_ | FL_ITALIC ;
font = textfont_ | FL_ITALIC ;
size = textsize_ ;
f size = textsize_ ;
}
}
else if ( strcasecmp ( buf , " PRE " ) = = 0 )
else if ( strcasecmp ( buf , " PRE " ) = = 0 )
{
{
font = FL_COURIER ;
font = FL_COURIER ;
size = textsize_ ;
f size = textsize_ ;
pre = 1 ;
pre = 1 ;
}
}
else
else
{
{
font = textfont_ ;
font = textfont_ ;
size = textsize_ ;
f size = textsize_ ;
}
}
pushfont ( font , size ) ;
pushfont ( font , f size) ;
yy = block - > y + block - > h ;
yy = block - > y + block - > h ;
hh = 0 ;
hh = 0 ;
@ -1072,11 +1072,11 @@ Fl_Help_View::format()
strcasecmp ( buf , " DD " ) = = 0 | |
strcasecmp ( buf , " DD " ) = = 0 | |
strcasecmp ( buf , " DT " ) = = 0 | |
strcasecmp ( buf , " DT " ) = = 0 | |
strcasecmp ( buf , " P " ) = = 0 )
strcasecmp ( buf , " P " ) = = 0 )
yy + = size + 2 ;
yy + = f size + 2 ;
else if ( strcasecmp ( buf , " HR " ) = = 0 )
else if ( strcasecmp ( buf , " HR " ) = = 0 )
{
{
hh + = 2 * size ;
hh + = 2 * f size;
yy + = size ;
yy + = f size;
}
}
if ( row )
if ( row )
@ -1088,9 +1088,9 @@ Fl_Help_View::format()
line = 0 ;
line = 0 ;
if ( strcasecmp ( buf , " CENTER " ) = = 0 )
if ( strcasecmp ( buf , " CENTER " ) = = 0 )
newalign = align = CENTER ;
newalign = t align = CENTER ;
else
else
newalign = get_align ( attrs , align ) ;
newalign = get_align ( attrs , t align) ;
}
}
else if ( strcasecmp ( buf , " /CENTER " ) = = 0 | |
else if ( strcasecmp ( buf , " /CENTER " ) = = 0 | |
strcasecmp ( buf , " /P " ) = = 0 | |
strcasecmp ( buf , " /P " ) = = 0 | |
@ -1114,20 +1114,20 @@ Fl_Help_View::format()
strcasecmp ( buf , " /OL " ) = = 0 | |
strcasecmp ( buf , " /OL " ) = = 0 | |
strcasecmp ( buf , " /DL " ) = = 0 )
strcasecmp ( buf , " /DL " ) = = 0 )
{
{
xx - = 4 * size ;
xx - = 4 * f size;
block - > h + = size + 2 ;
block - > h + = f size + 2 ;
}
}
else if ( strcasecmp ( buf , " /TABLE " ) = = 0 )
else if ( strcasecmp ( buf , " /TABLE " ) = = 0 )
block - > h + = size + 2 ;
block - > h + = f size + 2 ;
else if ( strcasecmp ( buf , " /PRE " ) = = 0 )
else if ( strcasecmp ( buf , " /PRE " ) = = 0 )
{
{
pre = 0 ;
pre = 0 ;
hh = 0 ;
hh = 0 ;
}
}
else if ( strcasecmp ( buf , " /CENTER " ) = = 0 )
else if ( strcasecmp ( buf , " /CENTER " ) = = 0 )
align = LEFT ;
t align = LEFT ;
popfont ( font , size ) ;
popfont ( font , f size) ;
while ( isspace ( * ptr ) )
while ( isspace ( * ptr ) )
ptr + + ;
ptr + + ;
@ -1136,7 +1136,7 @@ Fl_Help_View::format()
yy + = hh ;
yy + = hh ;
if ( tolower ( buf [ 2 ] ) = = ' l ' )
if ( tolower ( buf [ 2 ] ) = = ' l ' )
yy + = size + 2 ;
yy + = f size + 2 ;
if ( row )
if ( row )
block = add_block ( ptr , xx , yy , block - > w , 0 ) ;
block = add_block ( ptr , xx , yy , block - > w , 0 ) ;
@ -1146,7 +1146,7 @@ Fl_Help_View::format()
needspace = 0 ;
needspace = 0 ;
hh = 0 ;
hh = 0 ;
line = 0 ;
line = 0 ;
newalign = align ;
newalign = t align;
}
}
else if ( strcasecmp ( buf , " TR " ) = = 0 )
else if ( strcasecmp ( buf , " TR " ) = = 0 )
{
{
@ -1233,9 +1233,9 @@ Fl_Help_View::format()
else
else
font = textfont_ ;
font = textfont_ ;
size = textsize_ ;
f size = textsize_ ;
xx = blocks_ [ row ] . x + size + 3 ;
xx = blocks_ [ row ] . x + f size + 3 ;
for ( i = 0 ; i < column ; i + + )
for ( i = 0 ; i < column ; i + + )
xx + = columns [ i ] + 6 ;
xx + = columns [ i ] + 6 ;
@ -1253,7 +1253,7 @@ Fl_Help_View::format()
block - - ;
block - - ;
}
}
pushfont ( font , size ) ;
pushfont ( font , f size) ;
yy = blocks_ [ row ] . y ;
yy = blocks_ [ row ] . y ;
hh = 0 ;
hh = 0 ;
@ -1272,21 +1272,21 @@ Fl_Help_View::format()
else if ( ( strcasecmp ( buf , " /TD " ) = = 0 | |
else if ( ( strcasecmp ( buf , " /TD " ) = = 0 | |
strcasecmp ( buf , " /TH " ) = = 0 ) & & row )
strcasecmp ( buf , " /TH " ) = = 0 ) & & row )
{
{
popfont ( font , size ) ;
popfont ( font , f size) ;
}
}
else if ( strcasecmp ( buf , " B " ) = = 0 | |
else if ( strcasecmp ( buf , " B " ) = = 0 | |
strcasecmp ( buf , " STRONG " ) = = 0 )
strcasecmp ( buf , " STRONG " ) = = 0 )
pushfont ( font | = FL_BOLD , size ) ;
pushfont ( font | = FL_BOLD , f size) ;
else if ( strcasecmp ( buf , " I " ) = = 0 | |
else if ( strcasecmp ( buf , " I " ) = = 0 | |
strcasecmp ( buf , " EM " ) = = 0 )
strcasecmp ( buf , " EM " ) = = 0 )
pushfont ( font | = FL_ITALIC , size ) ;
pushfont ( font | = FL_ITALIC , f size) ;
else if ( strcasecmp ( buf , " CODE " ) = = 0 | |
else if ( strcasecmp ( buf , " CODE " ) = = 0 | |
strcasecmp ( buf , " TT " ) = = 0 )
strcasecmp ( buf , " TT " ) = = 0 )
pushfont ( font = FL_COURIER , size ) ;
pushfont ( font = FL_COURIER , f size) ;
else if ( strcasecmp ( buf , " KBD " ) = = 0 )
else if ( strcasecmp ( buf , " KBD " ) = = 0 )
pushfont ( font = FL_COURIER_BOLD , size ) ;
pushfont ( font = FL_COURIER_BOLD , f size) ;
else if ( strcasecmp ( buf , " VAR " ) = = 0 )
else if ( strcasecmp ( buf , " VAR " ) = = 0 )
pushfont ( font = FL_COURIER_ITALIC , size ) ;
pushfont ( font = FL_COURIER_ITALIC , f size) ;
else if ( strcasecmp ( buf , " /B " ) = = 0 | |
else if ( strcasecmp ( buf , " /B " ) = = 0 | |
strcasecmp ( buf , " /STRONG " ) = = 0 | |
strcasecmp ( buf , " /STRONG " ) = = 0 | |
strcasecmp ( buf , " /I " ) = = 0 | |
strcasecmp ( buf , " /I " ) = = 0 | |
@ -1295,7 +1295,7 @@ Fl_Help_View::format()
strcasecmp ( buf , " /TT " ) = = 0 | |
strcasecmp ( buf , " /TT " ) = = 0 | |
strcasecmp ( buf , " /KBD " ) = = 0 | |
strcasecmp ( buf , " /KBD " ) = = 0 | |
strcasecmp ( buf , " /VAR " ) = = 0 )
strcasecmp ( buf , " /VAR " ) = = 0 )
popfont ( font , size ) ;
popfont ( font , f size) ;
else if ( strcasecmp ( buf , " IMG " ) = = 0 )
else if ( strcasecmp ( buf , " IMG " ) = = 0 )
{
{
Fl_Shared_Image * img = 0 ;
Fl_Shared_Image * img = 0 ;
@ -1334,8 +1334,8 @@ Fl_Help_View::format()
hh = 0 ;
hh = 0 ;
}
}
if ( link [ 0 ] )
if ( linkdest [ 0 ] )
add_link ( link , xx , yy - height , ww , height ) ;
add_link ( linkdest , xx , yy - height , ww , height ) ;
xx + = ww ;
xx + = ww ;
if ( ( height + 2 ) > hh )
if ( ( height + 2 ) > hh )
@ -1346,8 +1346,8 @@ Fl_Help_View::format()
}
}
else if ( * ptr = = ' \n ' & & pre )
else if ( * ptr = = ' \n ' & & pre )
{
{
if ( link [ 0 ] )
if ( linkdest [ 0 ] )
add_link ( link , xx , yy - hh , ww , hh ) ;
add_link ( linkdest , xx , yy - hh , ww , hh ) ;
if ( xx > hsize_ ) {
if ( xx > hsize_ ) {
hsize_ = xx ;
hsize_ = xx ;
@ -1381,8 +1381,8 @@ Fl_Help_View::format()
ptr = strchr ( ptr , ' ; ' ) + 1 ;
ptr = strchr ( ptr , ' ; ' ) + 1 ;
}
}
if ( ( size + 2 ) > hh )
if ( ( f size + 2 ) > hh )
hh = size + 2 ;
hh = f size + 2 ;
}
}
else
else
{
{
@ -1391,8 +1391,8 @@ Fl_Help_View::format()
else
else
ptr + + ;
ptr + + ;
if ( ( size + 2 ) > hh )
if ( ( f size + 2 ) > hh )
hh = size + 2 ;
hh = f size + 2 ;
}
}
}
}
@ -1422,12 +1422,12 @@ Fl_Help_View::format()
hh = 0 ;
hh = 0 ;
}
}
if ( link [ 0 ] )
if ( linkdest [ 0 ] )
add_link ( link , xx , yy - size , ww , size ) ;
add_link ( linkdest , xx , yy - f size, ww , f size) ;
xx + = ww ;
xx + = ww ;
if ( ( size + 2 ) > hh )
if ( ( f size + 2 ) > hh )
hh = size + 2 ;
hh = f size + 2 ;
needspace = 0 ;
needspace = 0 ;
}
}
@ -1493,7 +1493,7 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
* attrs , // Pointer to attributes
* attrs , // Pointer to attributes
* start ; // Start of element
* start ; // Start of element
int minwidths [ MAX_COLUMNS ] ; // Minimum widths for each column
int minwidths [ MAX_COLUMNS ] ; // Minimum widths for each column
unsigned char font , size ; // Current font and size
unsigned char font , f size; // Current font and size
// Clear widths...
// Clear widths...
@ -1584,33 +1584,33 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
if ( tolower ( buf [ 0 ] ) = = ' h ' & & isdigit ( buf [ 1 ] ) )
if ( tolower ( buf [ 0 ] ) = = ' h ' & & isdigit ( buf [ 1 ] ) )
{
{
font = FL_HELVETICA_BOLD ;
font = FL_HELVETICA_BOLD ;
size = textsize_ + ' 7 ' - buf [ 1 ] ;
f size = textsize_ + ' 7 ' - buf [ 1 ] ;
}
}
else if ( strcasecmp ( buf , " DT " ) = = 0 )
else if ( strcasecmp ( buf , " DT " ) = = 0 )
{
{
font = textfont_ | FL_ITALIC ;
font = textfont_ | FL_ITALIC ;
size = textsize_ ;
f size = textsize_ ;
}
}
else if ( strcasecmp ( buf , " PRE " ) = = 0 )
else if ( strcasecmp ( buf , " PRE " ) = = 0 )
{
{
font = FL_COURIER ;
font = FL_COURIER ;
size = textsize_ ;
f size = textsize_ ;
pre = 1 ;
pre = 1 ;
}
}
else if ( strcasecmp ( buf , " LI " ) = = 0 )
else if ( strcasecmp ( buf , " LI " ) = = 0 )
{
{
width + = 4 * size ;
width + = 4 * f size;
font = textfont_ ;
font = textfont_ ;
size = textsize_ ;
f size = textsize_ ;
}
}
else
else
{
{
font = textfont_ ;
font = textfont_ ;
size = textsize_ ;
f size = textsize_ ;
}
}
pushfont ( font , size ) ;
pushfont ( font , f size) ;
}
}
else if ( strcasecmp ( buf , " /CENTER " ) = = 0 | |
else if ( strcasecmp ( buf , " /CENTER " ) = = 0 | |
strcasecmp ( buf , " /P " ) = = 0 | |
strcasecmp ( buf , " /P " ) = = 0 | |
@ -1628,7 +1628,7 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
width = 0 ;
width = 0 ;
needspace = 0 ;
needspace = 0 ;
popfont ( font , size ) ;
popfont ( font , f size) ;
}
}
else if ( strcasecmp ( buf , " TR " ) = = 0 | | strcasecmp ( buf , " /TR " ) = = 0 | |
else if ( strcasecmp ( buf , " TR " ) = = 0 | | strcasecmp ( buf , " /TR " ) = = 0 | |
strcasecmp ( buf , " /TABLE " ) = = 0 )
strcasecmp ( buf , " /TABLE " ) = = 0 )
@ -1703,9 +1703,9 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
else
else
font = textfont_ ;
font = textfont_ ;
size = textsize_ ;
f size = textsize_ ;
pushfont ( font , size ) ;
pushfont ( font , f size) ;
if ( get_attr ( attrs , " WIDTH " , attr , sizeof ( attr ) ) ! = NULL )
if ( get_attr ( attrs , " WIDTH " , attr , sizeof ( attr ) ) ! = NULL )
max_width = get_length ( attr ) ;
max_width = get_length ( attr ) ;
@ -1718,21 +1718,21 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
strcasecmp ( buf , " /TH " ) = = 0 )
strcasecmp ( buf , " /TH " ) = = 0 )
{
{
incell = 0 ;
incell = 0 ;
popfont ( font , size ) ;
popfont ( font , f size) ;
}
}
else if ( strcasecmp ( buf , " B " ) = = 0 | |
else if ( strcasecmp ( buf , " B " ) = = 0 | |
strcasecmp ( buf , " STRONG " ) = = 0 )
strcasecmp ( buf , " STRONG " ) = = 0 )
pushfont ( font | = FL_BOLD , size ) ;
pushfont ( font | = FL_BOLD , f size) ;
else if ( strcasecmp ( buf , " I " ) = = 0 | |
else if ( strcasecmp ( buf , " I " ) = = 0 | |
strcasecmp ( buf , " EM " ) = = 0 )
strcasecmp ( buf , " EM " ) = = 0 )
pushfont ( font | = FL_ITALIC , size ) ;
pushfont ( font | = FL_ITALIC , f size) ;
else if ( strcasecmp ( buf , " CODE " ) = = 0 | |
else if ( strcasecmp ( buf , " CODE " ) = = 0 | |
strcasecmp ( buf , " TT " ) = = 0 )
strcasecmp ( buf , " TT " ) = = 0 )
pushfont ( font = FL_COURIER , size ) ;
pushfont ( font = FL_COURIER , f size) ;
else if ( strcasecmp ( buf , " KBD " ) = = 0 )
else if ( strcasecmp ( buf , " KBD " ) = = 0 )
pushfont ( font = FL_COURIER_BOLD , size ) ;
pushfont ( font = FL_COURIER_BOLD , f size) ;
else if ( strcasecmp ( buf , " VAR " ) = = 0 )
else if ( strcasecmp ( buf , " VAR " ) = = 0 )
pushfont ( font = FL_COURIER_ITALIC , size ) ;
pushfont ( font = FL_COURIER_ITALIC , f size) ;
else if ( strcasecmp ( buf , " /B " ) = = 0 | |
else if ( strcasecmp ( buf , " /B " ) = = 0 | |
strcasecmp ( buf , " /STRONG " ) = = 0 | |
strcasecmp ( buf , " /STRONG " ) = = 0 | |
strcasecmp ( buf , " /I " ) = = 0 | |
strcasecmp ( buf , " /I " ) = = 0 | |
@ -1741,7 +1741,7 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
strcasecmp ( buf , " /TT " ) = = 0 | |
strcasecmp ( buf , " /TT " ) = = 0 | |
strcasecmp ( buf , " /KBD " ) = = 0 | |
strcasecmp ( buf , " /KBD " ) = = 0 | |
strcasecmp ( buf , " /VAR " ) = = 0 )
strcasecmp ( buf , " /VAR " ) = = 0 )
popfont ( font , size ) ;
popfont ( font , f size) ;
else if ( strcasecmp ( buf , " IMG " ) = = 0 & & incell )
else if ( strcasecmp ( buf , " IMG " ) = = 0 & & incell )
{
{
Fl_Shared_Image * img = 0 ;
Fl_Shared_Image * img = 0 ;
@ -1873,7 +1873,7 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
int // O - Alignment
int // O - Alignment
Fl_Help_View : : get_align ( const char * p , // I - Pointer to start of attrs
Fl_Help_View : : get_align ( const char * p , // I - Pointer to start of attrs
int a ) // I - Default alignment
int a ) // I - Default alignment
{
{
char buf [ 255 ] ; // Alignment value
char buf [ 255 ] ; // Alignment value
@ -2042,18 +2042,24 @@ Fl_Help_View::get_image(const char *name, int W, int H) {
// See if the image can be found...
// See if the image can be found...
if ( strchr ( directory_ , ' : ' ) ! = NULL & & strchr ( name , ' : ' ) = = NULL ) {
if ( strchr ( directory_ , ' : ' ) ! = NULL & & strchr ( name , ' : ' ) = = NULL ) {
if ( name [ 0 ] = = ' / ' ) {
if ( name [ 0 ] = = ' / ' ) {
strcpy ( temp , directory_ ) ;
strlcpy ( temp , directory_ , sizeof ( temp ) ) ;
if ( ( tempptr = strrchr ( strchr ( directory_ , ' : ' ) + 3 , ' / ' ) ) ! = NULL ) strcpy ( tempptr , name ) ;
else strcat ( temp , name ) ;
if ( ( tempptr = strrchr ( strchr ( directory_ , ' : ' ) + 3 , ' / ' ) ) ! = NULL ) {
} else sprintf ( temp , " %s/%s " , directory_ , name ) ;
strlcpy ( tempptr , name , sizeof ( temp ) - ( tempptr - temp ) ) ;
} else {
strlcat ( temp , name , sizeof ( temp ) ) ;
}
} else {
snprintf ( temp , sizeof ( temp ) , " %s/%s " , directory_ , name ) ;
}
if ( link_ ) localname = ( * link_ ) ( this , temp ) ;
if ( link_ ) localname = ( * link_ ) ( this , temp ) ;
else localname = temp ;
else localname = temp ;
} else if ( name [ 0 ] ! = ' / ' & & strchr ( name , ' : ' ) = = NULL ) {
} else if ( name [ 0 ] ! = ' / ' & & strchr ( name , ' : ' ) = = NULL ) {
if ( directory_ [ 0 ] ) sprintf ( temp , " %s/%s " , directory_ , name ) ;
if ( directory_ [ 0 ] ) sn printf ( temp , sizeof ( temp ) , " %s/%s " , directory_ , name ) ;
else {
else {
getcwd ( dir , sizeof ( dir ) ) ;
getcwd ( dir , sizeof ( dir ) ) ;
sprintf ( temp , " file:%s/%s " , dir , name ) ;
sn printf ( temp , sizeof ( temp ) , " file:%s/%s " , dir , name ) ;
}
}
if ( link_ ) localname = ( * link_ ) ( this , temp ) ;
if ( link_ ) localname = ( * link_ ) ( this , temp ) ;
@ -2103,7 +2109,7 @@ Fl_Help_View::handle(int event) // I - Event to handle
{
{
int i ; // Looping var
int i ; // Looping var
int xx , yy ; // Adjusted mouse position
int xx , yy ; // Adjusted mouse position
Fl_Help_Link * link ; // Current link
Fl_Help_Link * linkp ; // Current link
char target [ 32 ] ; // Current target
char target [ 32 ] ; // Current target
@ -2126,9 +2132,9 @@ Fl_Help_View::handle(int event) // I - Event to handle
}
}
// Handle mouse clicks on links...
// Handle mouse clicks on links...
for ( i = nlinks_ , link = links_ ; i > 0 ; i - - , link + + )
for ( i = nlinks_ , linkp = links_ ; i > 0 ; i - - , linkp + + )
if ( xx > = link - > x & & xx < link - > w & &
if ( xx > = linkp - > x & & xx < linkp - > w & &
yy > = link - > y & & yy < link - > h )
yy > = linkp - > y & & yy < linkp - > h )
break ;
break ;
if ( ! i )
if ( ! i )
@ -2145,11 +2151,11 @@ Fl_Help_View::handle(int event) // I - Event to handle
{
{
fl_cursor ( FL_CURSOR_DEFAULT ) ;
fl_cursor ( FL_CURSOR_DEFAULT ) ;
strlcpy ( target , link - > name , sizeof ( target ) ) ;
strlcpy ( target , linkp - > name , sizeof ( target ) ) ;
set_changed ( ) ;
set_changed ( ) ;
if ( strcmp ( link - > filename , filename_ ) ! = 0 & & link - > filename [ 0 ] )
if ( strcmp ( linkp - > filename , filename_ ) ! = 0 & & linkp - > filename [ 0 ] )
{
{
char dir [ 1024 ] ; // Current directory
char dir [ 1024 ] ; // Current directory
char temp [ 1024 ] , // Temporary filename
char temp [ 1024 ] , // Temporary filename
@ -2157,34 +2163,35 @@ Fl_Help_View::handle(int event) // I - Event to handle
if ( strchr ( directory_ , ' : ' ) ! = NULL & &
if ( strchr ( directory_ , ' : ' ) ! = NULL & &
strchr ( link - > filename , ' : ' ) = = NULL )
strchr ( linkp - > filename , ' : ' ) = = NULL )
{
{
if ( link - > filename [ 0 ] = = ' / ' )
if ( linkp - > filename [ 0 ] = = ' / ' )
{
{
strcpy ( temp , directory_ ) ;
strl cpy ( temp , directory_ , sizeof ( temp ) ) ;
if ( ( tempptr = strrchr ( strchr ( directory_ , ' : ' ) + 3 , ' / ' ) ) ! = NULL )
if ( ( tempptr = strrchr ( strchr ( directory_ , ' : ' ) + 3 , ' / ' ) ) ! = NULL )
strcpy ( tempptr , link - > filename ) ;
strl cpy ( tempptr , linkp - > filename , sizeof ( temp ) ) ;
else
else
strcat ( temp , link - > filename ) ;
strl cat ( temp , linkp - > filename , sizeof ( temp ) ) ;
}
}
else
else
sprintf ( temp , " %s/%s " , directory_ , link - > filename ) ;
sn printf ( temp , sizeof ( temp ) , " %s/%s " , directory_ , linkp - > filename ) ;
}
}
else if ( link - > filename [ 0 ] ! = ' / ' & & strchr ( link - > filename , ' : ' ) = = NULL )
else if ( linkp - > filename [ 0 ] ! = ' / ' & & strchr ( linkp - > filename , ' : ' ) = = NULL )
{
{
if ( directory_ [ 0 ] )
if ( directory_ [ 0 ] )
sprintf ( temp , " %s/%s " , directory_ , link - > filename ) ;
sn printf ( temp , sizeof ( temp ) , " %s/%s " , directory_ , linkp - > filename ) ;
else
else
{
{
getcwd ( dir , sizeof ( dir ) ) ;
getcwd ( dir , sizeof ( dir ) ) ;
sprintf ( temp , " file:%s/%s " , dir , link - > filename ) ;
sn printf ( temp , sizeof ( temp ) , " file:%s/%s " , dir , linkp - > filename ) ;
}
}
}
}
else
else
strcpy ( temp , link - > filename ) ;
strl cpy ( temp , linkp - > filename , sizeof ( temp ) ) ;
if ( link - > name [ 0 ] )
if ( linkp - > name [ 0 ] )
sprintf ( temp + strlen ( temp ) , " #%s " , link - > name ) ;
snprintf ( temp + strlen ( temp ) , sizeof ( temp ) - strlen ( temp ) , " #%s " ,
linkp - > name ) ;
load ( temp ) ;
load ( temp ) ;
}
}
@ -2641,5 +2648,5 @@ hscrollbar_callback(Fl_Widget *s, void *)
//
//
// End of "$Id: Fl_Help_View.cxx,v 1.1.2.37 2002/07/18 15:27:21 easysw Exp $".
// End of "$Id: Fl_Help_View.cxx,v 1.1.2.38 2002/08/09 01:09:49 easysw Exp $".
//
//