cd "$path/$dir/$bld"
rm -rf "$proj"
-git clone "git://git.cinelerra-cv.org/goodguy/cinelerra.git" "$proj"
+git clone --depth 1 "git://git.cinelerra-cv.org/goodguy/cinelerra.git" "$proj"
#rsh host tar -C /mnt0/cinelerra5 -cf - cinelerra | tar -xf -
#mv cinelerra cinelerra5
if [ $? -ne 0 ]; then
cd "$path/$dir/$bld"
rm -rf "$proj"
-git clone "git://git.cinelerra-cv.org/goodguy/cinelerra.git" "$proj"
+git clone --depth 1 "git://git.cinelerra-cv.org/goodguy/cinelerra.git" "$proj"
#rsh host tar -C /mnt0/cinelerra5 -cf - cinelerra | tar -xf -
#mv cinelerra cinelerra5
if [ $? -ne 0 ]; then
void get_exe_path(char *result)
{
// Get executable path
- pid_t pid = getpid();
- char proc_path[BCTEXTLEN];
- int len = 0;
- result[0] = 0;
- sprintf(proc_path, "/proc/%d/exe", pid);
- if((len = readlink(proc_path, result, BCTEXTLEN)) >= 0)
- {
+ int len = readlink("/proc/self/exe", result, BCTEXTLEN);
+ if( len >= 0 ) {
result[len] = 0;
-//printf("Preferences::Preferences %d %s\n", __LINE__, result);
char *ptr = strrchr(result, '/');
- if(ptr) *ptr = 0;
+ if( ptr ) *ptr = 0;
}
-
+ else
+ result[0] = 0;
}
-
+ int load_backup = 0;
for(int i = 1; i < argc; i++)
{
}
}
else
+ if(!strcmp(argv[i], "-x"))
+ {
+ load_backup = 1;
+ }
+ else
{
char *new_filename;
new_filename = new char[BCTEXTLEN];
case DO_GUI:
{
int done = 0;
- int load_backup = 0;
while( !done ) {
BC_WindowBase::get_resources()->vframe_shm = 0;
MWindow mwindow;
mwindow.save_defaults();
//PRINT_TRACE
filenames.remove_all_objects();
+#if 1
+ if( !mwindow.reload() ) break;
+// due to leaks and munges in x fonts, this loop has to be
+// executed via a total program restart 2/18/2016
+ char exe_path[BCTEXTLEN];
+ if( readlink("/proc/self/exe", exe_path, sizeof(exe_path)) < 0 ) break;
+ char *const av[3] = { exe_path, (char*)(load_backup? "-x" : 0), 0 };
+ execv(exe_path, av);
+#endif
}
//SET_TRACE
DISABLE_BUFFER
edl = 0;
mwindow->defaults->update("DEFAULTPREF", current_dialog);
+ if( mwindow->reload_status )
+ mwindow->gui->set_done(0);
}
(*this_aconfig != *aconfig) || (*this_vconfig != *vconfig) ||
!preferences->brender_asset->equivalent(*mwindow->preferences->brender_asset, 0, 1);
+ if( strcmp(preferences->theme, mwindow->preferences->theme) != 0 )
+ mwindow->reload_status = 1;
+
mwindow->edl->copy_session(edl, 1);
mwindow->preferences->copy_from(preferences);
mwindow->init_brender();
draw_vframe(bg, 0, 0);
flash();
show_window();
-
- add_subwindow(progress = new BC_ProgressBar(5,
- get_h() - get_resources()->progress_images[0]->get_h() - 5,
- get_w() - 10,
- 0,
- 0));
add_subwindow(operation =
new BC_Title(5,
- progress->get_y() - get_text_height(MEDIUMFONT) - 5,
+ get_h() - get_text_height(MEDIUMFONT) - 5,
_("Loading...")));
}
void create_objects();
BC_Title *operation;
VFrame *bg;
- BC_ProgressBar *progress;
};
keys_return[0] = keysym;
return 0;
}
+ wkey_string_length = 0;
- wkey_string_length = XwcLookupString(input_context,
- (XKeyEvent*)event, wkey_string, 4, &keysym, 0);
+ if( input_context ) {
+ wkey_string_length = XwcLookupString(input_context,
+ (XKeyEvent*)event, wkey_string, 4, &keysym, 0);
//printf("keysym_lookup 1 %d %d %lx %x %x %x %x\n", wkey_string_length, keysym,
// wkey_string[0], wkey_string[1], wkey_string[2], wkey_string[3]);
- Status stat;
- int ret = Xutf8LookupString(input_context, (XKeyEvent*)event,
- keys_return, KEYPRESSLEN, &keysym, &stat);
+ Status stat;
+ int ret = Xutf8LookupString(input_context, (XKeyEvent*)event,
+ keys_return, KEYPRESSLEN, &keysym, &stat);
//printf("keysym_lookup 2 %d %d %lx %x %x\n", ret, stat, keysym, keys_return[0], keys_return[1]);
- if( stat == XLookupBoth ) return ret;
- if( stat == XLookupKeySym ) return 0;
-
- return XLookupString((XKeyEvent*)event, keys_return, KEYPRESSLEN, &keysym, 0);
+ if( stat == XLookupBoth ) return ret;
+ if( stat == XLookupKeySym ) return 0;
+ }
+ int ret = XLookupString((XKeyEvent*)event, keys_return, KEYPRESSLEN, &keysym, 0);
+ wkey_string_length = ret;
+ for( int i=0; i<ret; ++i ) wkey_string[i] = keys_return[i];
+ return ret;
}
pthread_t locking_task = -1;
void BC_WindowBase::init_xft()
{
#ifdef HAVE_XFT
+ if( !get_resources()->use_xft ) return;
if(!(smallfont_xft =
(resources.small_font_xft[0] == '-' ?
XftFontOpenXlfd(display, screen, resources.small_font_xft) :
int BC_WindowBase::get_single_text_width(int font, const wchar_t *text, int length)
{
-//#ifdef HAVE_XFT
- XGlyphInfo extents;
+#ifdef HAVE_XFT
+ if(get_resources()->use_xft && get_xft_struct(font)) {
+ XGlyphInfo extents;
- XftTextExtents32(top_level->display,
- get_xft_struct(font),
- (const FcChar32*)text,
- length,
- &extents);
- return extents.xOff;
-//#endif
+ XftTextExtents32(top_level->display, get_xft_struct(font),
+ (const FcChar32*)text, length, &extents);
+ return extents.xOff;
+ }
+#endif
+ if(!get_font_struct(font)) return 0;
+ XChar2b xtext[length], *xp = xtext;
+ for( int i=0; i<length; ++i,++xp ) {
+ xp->byte1 = (unsigned char) (text[i] >> 8);
+ xp->byte2 = (unsigned char) (text[i] & 0xff);
+ }
+ return XTextWidth16(get_font_struct(font), xtext, length);
}
int BC_WindowBase::get_text_width(int font, const char *text, int length)
void BC_WindowBase::draw_wtext(int x, int y,
const wchar_t *text, int length, BC_Pixmap *pixmap, int *charpos)
{
+ if( !get_resources()->use_xft ) {
+ if( !get_font_struct(current_font) ) return;
+ XChar2b xtext[length], *xp = xtext;
+ for( int i=0; i<length; ++i,++xp ) {
+ xp->byte1 = (unsigned char) (text[i] >> 8);
+ xp->byte2 = (unsigned char) (text[i] & 0xff);
+ }
+ XDrawString16(top_level->display,
+ pixmap ? pixmap->opaque_pixmap : this->pixmap->opaque_pixmap,
+ top_level->gc, x, y, xtext, length);
+ return;
+ }
XRenderColor color;
XftColor xft_color;
const wchar_t *up, *ubp;
break;
case BC_YUVA8888:
HISTOGRAM_HEAD(unsigned char)
- y = (float)row[0] / 0xff;
- u = (float)row[1] / 0xff;
- v = (float)row[2] / 0xff;
+ y = row[0];
+ u = row[1];
+ v = row[2];
+ y /= 0xff;
+ u = (float)((u - 0x80) / 0xff);
+ v = (float)((v - 0x80) / 0xff);
YUV::yuv_to_rgb_f(r, g, b, y, u, v);
HISTOGRAM_TAIL(4)
break;