From 766478767615bc46d689b8e130aff0853e478b4c Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Mon, 19 Sep 2005 04:37:51 +0000 Subject: [PATCH] Fixes from Bill Allombert at Debian: fl_ prefix for filename functions in fltk1. Turns off visible_focus() (really click-to-focus on buttons) in fltk1. Rotated code works for fonts where fontstruct->per_char is NULL. --- Rotated.C | 23 ++++++++++++----------- main.C | 3 ++- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Rotated.C b/Rotated.C index fef4f74..cf382fb 100644 --- a/Rotated.C +++ b/Rotated.C @@ -121,18 +121,19 @@ XRotLoadFont(Display *dpy, XFontStruct* fontstruct, int dir) for (ichar = min_char; ichar <= max_char; ichar++) { index = ichar-fontstruct->min_char_or_byte2; - + + XCharStruct* charstruct; + if (fontstruct->per_char) + charstruct = fontstruct->per_char+index; + else + charstruct = &fontstruct->min_bounds; + /* per char dimensions ... */ - ascent = rotfont->per_char[ichar].ascent = - fontstruct->per_char[index].ascent; - descent = rotfont->per_char[ichar].descent = - fontstruct->per_char[index].descent; - lbearing = rotfont->per_char[ichar].lbearing = - fontstruct->per_char[index].lbearing; - rbearing = rotfont->per_char[ichar].rbearing = - fontstruct->per_char[index].rbearing; - rotfont->per_char[ichar].width = - fontstruct->per_char[index].width; + ascent = rotfont->per_char[ichar].ascent = charstruct->ascent; + descent = rotfont->per_char[ichar].descent = charstruct->descent; + lbearing = rotfont->per_char[ichar].lbearing = charstruct->lbearing; + rbearing = rotfont->per_char[ichar].rbearing = charstruct->rbearing; + rotfont->per_char[ichar].width = charstruct->width; /* some space chars have zero body, but a bitmap can't have ... */ if (!ascent && !descent) diff --git a/main.C b/main.C index 21fce7a..51ed49a 100644 --- a/main.C +++ b/main.C @@ -238,6 +238,7 @@ static void initialize() { #else Root->cursor((Fl_Cursor)cursor, CURSOR_FG_SLOT, CURSOR_BG_SLOT); #endif + Fl::visible_focus(0); #ifdef TITLE_FONT Fl::set_font(TITLE_FONT_SLOT, TITLE_FONT); @@ -369,7 +370,7 @@ static void color_setup(Fl_Color slot, const char* arg, ulong value) { #endif int main(int argc, char** argv) { - program_name = filename_name(argv[0]); + program_name = fl_filename_name(argv[0]); int i; if (Fl::args(argc, argv, i, arg) < argc) Fl::error( "options are:\n" " -d[isplay] host:#.#\tX display & screen to use\n"