X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fbcresources.C;h=ba67eeffd1da6d7d5ab37a6d34ed3f6038d9d453;hb=27fd3ea07d41d179c8fdcb5b8481960c1fcc37d5;hp=58d3c5879cfc0b08a29f4038254cacdb69e43b68;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C index 58d3c587..ba67eeff 100644 --- a/cinelerra-5.1/guicast/bcresources.C +++ b/cinelerra-5.1/guicast/bcresources.C @@ -234,10 +234,11 @@ BC_Resources::BC_Resources() wide_encoding = little_endian ? "UTF32LE" : "UTF32BE"; use_xvideo = 1; -#include "images/file_film_png.h" #include "images/file_folder_png.h" -#include "images/file_sound_png.h" #include "images/file_unknown_png.h" +#include "images/file_film_png.h" +#include "images/file_sound_png.h" +#include "images/file_label_png.h" #include "images/file_column_png.h" static VFrame* default_type_to_icon[] = { @@ -245,6 +246,7 @@ BC_Resources::BC_Resources() new VFramePng(file_unknown_png), new VFramePng(file_film_png), new VFramePng(file_sound_png), + new VFramePng(file_label_png), new VFramePng(file_column_png) }; type_to_icon = default_type_to_icon; @@ -607,6 +609,7 @@ BC_Resources::BC_Resources() popupmenu_margin = 10; + popupmenu_btnup = 1; popupmenu_triangle_margin = 10; min_menu_w = 0; @@ -643,6 +646,7 @@ BC_Resources::BC_Resources() tooltip_delay = 1000; tooltip_bg_color = YELLOW; tooltips_enabled = 1; + textbox_focus_policy = 0; filebox_margin = 110; dirbox_margin = 90; @@ -829,9 +833,21 @@ int BC_Resources::init_fontconfig(const char *search_path) } while(0) char find_command[BCTEXTLEN]; - sprintf(find_command, - "find %s -name 'fonts.dir' -print -exec cat {} \\;", - search_path); + char *fp = find_command, *ep = fp+sizeof(find_command)-1; + fp += snprintf(fp, ep-fp, "find '%s'", search_path); + const char *bc_font_path = getenv("BC_FONT_PATH"); + if( bc_font_path ) { + const char *path = bc_font_path; + for( int len=0; *path; path+=len ) { + const char *cp = strchr(path,':'); + len = !cp ? strlen(path) : cp-path; + char font_path[BCTEXTLEN]; + memcpy(font_path, path, len); font_path[len] = 0; + if( cp ) ++len; + fp += snprintf(fp, ep-fp, " '%s'", font_path); + } + } + fp += snprintf(fp, ep-fp, " -name 'fonts.scale' -print -exec cat {} \\;"); FILE *in = popen(find_command, "r"); FT_Library freetype_library = 0; @@ -862,7 +878,7 @@ int BC_Resources::init_fontconfig(const char *search_path) entry->path = cstrcat(2, current_dir, string); // Foundary skip_str(" -", in_ptr); - get_str(string, " -\n", in_ptr, 1); + get_str(string, "-\n", in_ptr, 1); if( !string[0] ) { delete entry; continue; } entry->foundry = cstrdup(string); if(*in_ptr == '-') in_ptr++; @@ -954,25 +970,25 @@ int BC_Resources::init_fontconfig(const char *search_path) } if(!strcasecmp(entry->swidth, "normal")) - entry->style = FL_WIDTH_NORMAL; + entry->style |= FL_WIDTH_NORMAL; else if(!strcasecmp(entry->swidth, "ultracondensed")) - entry->style = FL_WIDTH_ULTRACONDENSED; + entry->style |= FL_WIDTH_ULTRACONDENSED; else if(!strcasecmp(entry->swidth, "extracondensed")) - entry->style = FL_WIDTH_EXTRACONDENSED; + entry->style |= FL_WIDTH_EXTRACONDENSED; else if(!strcasecmp(entry->swidth, "condensed")) - entry->style = FL_WIDTH_CONDENSED; + entry->style |= FL_WIDTH_CONDENSED; else if(!strcasecmp(entry->swidth, "semicondensed")) - entry->style = FL_WIDTH_SEMICONDENSED; + entry->style |= FL_WIDTH_SEMICONDENSED; else if(!strcasecmp(entry->swidth, "semiexpanded")) - entry->style = FL_WIDTH_SEMIEXPANDED; + entry->style |= FL_WIDTH_SEMIEXPANDED; else if(!strcasecmp(entry->swidth, "expanded")) - entry->style = FL_WIDTH_EXPANDED; + entry->style |= FL_WIDTH_EXPANDED; else if(!strcasecmp(entry->swidth, "extraexpanded")) - entry->style = FL_WIDTH_EXTRAEXPANDED; + entry->style |= FL_WIDTH_EXTRAEXPANDED; else if(!strcasecmp(entry->swidth, "ultraexpanded")) - entry->style = FL_WIDTH_ULTRAEXPANDED; + entry->style |= FL_WIDTH_ULTRAEXPANDED; else - entry->style = FL_WIDTH_NORMAL; + entry->style |= FL_WIDTH_NORMAL; fontlist->append(entry); // printf("TitleMain::build_fonts %s: success\n", entry->path); @@ -1426,7 +1442,7 @@ BC_FontEntry *BC_Resources::find_fontentry(const char *displayname, int style, { if(!style_match) style_match = entry; - if(!preferred_match && (entry->style & preferred)) + if(!preferred_match && entry->fixed_style == preferred) preferred_match = entry; } } @@ -1489,7 +1505,7 @@ size_t BC_Resources::encode(const char *from_enc, const char *to_enc, { if((cd = iconv_open(to_enc, from_enc)) == (iconv_t)-1) { - printf(_("Conversion from %s to %s is not available"), + printf(_("Conversion from %s to %s is not available\n"), from_enc, to_enc); return 0; }