font debug env var, drag fixes, cposer hide scrollbar, plugin tool tip
authorGood Guy <good1.2guy@gmail.com>
Thu, 19 Oct 2017 23:12:15 +0000 (17:12 -0600)
committerGood Guy <good1.2guy@gmail.com>
Thu, 19 Oct 2017 23:12:15 +0000 (17:12 -0600)
20 files changed:
cinelerra-5.1/Cinelerra_factory
cinelerra-5.1/cinelerra/awindowgui.C
cinelerra-5.1/cinelerra/cpanel.C
cinelerra-5.1/cinelerra/cpanel.h
cinelerra-5.1/cinelerra/keyframegui.C
cinelerra-5.1/cinelerra/plugintoggles.C
cinelerra-5.1/cinelerra/trackcanvas.C
cinelerra-5.1/cinelerra/vdevicex11.C
cinelerra-5.1/ffmpeg/plugin.opts
cinelerra-5.1/guicast/bcdragwindow.C
cinelerra-5.1/guicast/bcdragwindow.h
cinelerra-5.1/guicast/bclistbox.C
cinelerra-5.1/guicast/bcpopup.C
cinelerra-5.1/guicast/bcresources.C
cinelerra-5.1/guicast/bcresources.h
cinelerra-5.1/guicast/bcwindow.C
cinelerra-5.1/guicast/bcwindowbase.C
cinelerra-5.1/plugins/interpolate/picon_cinfinity.png
cinelerra-5.1/plugins/spherecam/picon_cinfinity.png
cinelerra-5.1/plugins/titler/titler.C

index 97c2aa40ccda95371e40c6ac01b6a398b7797b5c..3cc787ad9dabbc3e7a910a97dedbb0917da07263 100644 (file)
@@ -37,7 +37,7 @@
 <KEYFRAME TITLE="640x480 to d-1"><SCALE WIDTH=1.100000e+00 HEIGHT=1></KEYFRAME>
 <KEYFRAME TITLE="fix D-1 on gootube"><SCALE WIDTH=1 HEIGHT=1.125100e+00></KEYFRAME>
 </PLUGIN>
-<PLUGIN TITLE=Motion>
+<PLUGIN TITLE=MotionHV>
 <KEYFRAME TITLE=coptercam><MOTION BLOCK_COUNT=1 GLOBAL_POSITIONS=256 ROTATE_POSITIONS=4 GLOBAL_BLOCK_W=45 GLOBAL_BLOCK_H=52 ROTATION_BLOCK_W=33 ROTATION_BLOCK_H=32 BLOCK_X=50 BLOCK_Y=50 GLOBAL_RANGE_W=39 GLOBAL_RANGE_H=47 ROTATION_RANGE=10 ROTATION_CENTER=0 MAGNITUDE=50 RETURN_SPEED=3 MODE1=1 GLOBAL=1 ROTATE=1 MODE2=5 DRAW_VECTORS=0 MODE3=11 TRACK_FRAME=0 BOTTOM_IS_MASTER=1 HORIZONTAL_ONLY=0 VERTICAL_ONLY=0></KEYFRAME>
 <KEYFRAME TITLE=running><MOTION BLOCK_COUNT=1 GLOBAL_POSITIONS=1024 ROTATE_POSITIONS=4 GLOBAL_BLOCK_W=34 GLOBAL_BLOCK_H=46 BLOCK_X=50 BLOCK_Y=50 GLOBAL_RANGE_W=100 GLOBAL_RANGE_H=100 ROTATION_RANGE=5 ROTATION_CENTER=0 MAGNITUDE=50 RETURN_SPEED=10 ROTATE_MAGNITUDE=15 ROTATE_RETURN_SPEED=10 ACTION_TYPE=3 GLOBAL=1 ROTATE=1 TRACKING_TYPE=1 DRAW_VECTORS=1 TRACKING_OBJECT=2 TRACK_FRAME=0 BOTTOM_IS_MASTER=1 HORIZONTAL_ONLY=0 VERTICAL_ONLY=0></KEYFRAME>
 </PLUGIN>
index 1267c001cd289b43079c538f58a189be1be54259..da146a611be72b957580146f206159cc79e6d97c 100644 (file)
@@ -1453,7 +1453,7 @@ AWindowAssets::AWindowAssets(MWindow *mwindow, AWindowGUI *gui, int x, int y, in
                0,                // If this listbox is a popup window
                LISTBOX_MULTIPLE, // Select one item or multiple items
                ICON_TOP,         // Position of icon relative to text of each item
-               1)                // Allow drag
+               -1)               // Allow drags, require shift for scrolling
 {
        this->mwindow = mwindow;
        this->gui = gui;
index a62f0a7e946aeab5bff0cb01fc5a2b27dd4e3f42..1e6ef8d3e5348a86a3b599c88f42c90f911c76c5 100644 (file)
@@ -415,11 +415,11 @@ int CPanelZoom::handle_event()
 int CPanelZoom::set_shown(int shown)
 {
        if( shown ) {
-               show_window();
+               show();
                update(gui->subwindow->canvas->get_zoom());
        }
        else
-               hide_window();
+               hide();
        return 1;
 }
 
index 7836d285dfbc8cb2e7b9369d1214adf59ddcd29d..a3e19430ed078db0527386404cd8c3b555a27fb0 100644 (file)
@@ -176,6 +176,10 @@ public:
        char *get_caption();
        int handle_event();
        int set_shown(int shown);
+       int show_window(int flush=1) { return 0; }
+       int hide_window(int flush=1) { return 0; }
+       int show(int flush=1) { return BC_SubWindow::show_window(flush); }
+       int hide(int flush=1) { return BC_SubWindow::hide_window(flush); }
        void update(float zoom);
        MWindow *mwindow;
        CPanel *gui;
index 8e6019f005b5924b9c0bd5b83acac55186b60124..d7d297411a7ed868a9519a26a5865bfedb2993e3 100644 (file)
@@ -53,8 +53,8 @@ KeyFrameThread::KeyFrameThread(MWindow *mwindow)
        is_factory = 0;
        preset_text[0] = 0;
        window_title[0] = 0;
-       column_titles[0] = (char*)"Parameter";
-       column_titles[1] = (char*)"Value";
+       column_titles[0] = (char*)_("Parameter");
+       column_titles[1] = (char*)_("Value");
        column_width[0] = 0;
        column_width[1] = 0;
        presets_data = new ArrayList<BC_ListBoxItem*>;
@@ -147,7 +147,7 @@ void KeyFrameThread::start_window(Plugin *plugin, KeyFrame *keyframe)
                this->keyframe = keyframe;
                this->plugin = plugin;
                plugin->calculate_title(plugin_title, 0);
-               sprintf(window_title, PROGRAM_NAME ": %s Keyframe", plugin_title);
+               sprintf(window_title, _("%s: %s Keyframe"), _(PROGRAM_NAME), plugin_title);
 
 // Load all the presets from disk
                char path[BCTEXTLEN];
@@ -479,11 +479,8 @@ void KeyFrameWindow::create_objects()
 
 
        add_subwindow(title1 = new BC_Title(theme->keyframe_list_x,
-               theme->keyframe_list_y - 
-                       BC_Title::calculate_h(this, (char*)"Py", LARGEFONT) - 
-                       theme->widget_border,
-               _("Keyframe parameters:"),
-               LARGEFONT));
+               theme->keyframe_list_y - BC_Title::calculate_h(this, (char*)_("Py"), LARGEFONT) - 
+                       theme->widget_border, _("Keyframe parameters:"), LARGEFONT));
        add_subwindow(keyframe_list = new KeyFrameList(thread,
                this,
                theme->keyframe_list_x,
@@ -499,57 +496,31 @@ void KeyFrameWindow::create_objects()
 //             theme->keyframe_text_y,
 //             theme->keyframe_text_w));
        add_subwindow(title3 = new BC_Title(theme->keyframe_value_x,
-               theme->keyframe_value_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border,
-               _("Edit value:")));
-       add_subwindow(value_text = new KeyFrameValue(thread,
-               this,
-               theme->keyframe_value_x,
-               theme->keyframe_value_y,
-               theme->keyframe_value_w));
-       add_subwindow(all_toggle = new KeyFrameAll(thread,
-               this, 
-               theme->keyframe_all_x,
-               theme->keyframe_all_y));
+               theme->keyframe_value_y - BC_Title::calculate_h(this, (char*)"P") -
+                       theme->widget_border, _("Edit value:")));
+       add_subwindow(value_text = new KeyFrameValue(thread, this,
+               theme->keyframe_value_x, theme->keyframe_value_y, theme->keyframe_value_w));
+       add_subwindow(all_toggle = new KeyFrameAll(thread, this, 
+               theme->keyframe_all_x, theme->keyframe_all_y));
 
 #endif
-
-
-
-       add_subwindow(title4 = new BC_Title(theme->presets_list_x,
-               theme->presets_list_y - 
-                       BC_Title::calculate_h(this, (char*)"Py", LARGEFONT) - 
-                       theme->widget_border,
-               _("Presets:"),
-               LARGEFONT));
-       add_subwindow(preset_list = new KeyFramePresetsList(thread,
-               this,
-               theme->presets_list_x,
-               theme->presets_list_y,
-               theme->presets_list_w, 
-               theme->presets_list_h));
+       add_subwindow(title4 = new BC_Title(theme->presets_list_x, theme->presets_list_y - 
+                       BC_Title::calculate_h(this, (char*)_("Py"), LARGEFONT) - 
+                       theme->widget_border, _("Presets:"), LARGEFONT));
+       add_subwindow(preset_list = new KeyFramePresetsList(thread, this,
+               theme->presets_list_x, theme->presets_list_y,
+               theme->presets_list_w, theme->presets_list_h));
        add_subwindow(title5 = new BC_Title(theme->presets_text_x,
                theme->presets_text_y - BC_Title::calculate_h(this, (char*)"P") - theme->widget_border,
                _("Preset title:")));
-       add_subwindow(preset_text = new KeyFramePresetsText(thread,
-               this,
-               theme->presets_text_x,
-               theme->presets_text_y,
-               theme->presets_text_w));
-       add_subwindow(delete_preset = new KeyFramePresetsDelete(thread,
-               this,
-               theme->presets_delete_x,
-               theme->presets_delete_y));
-       add_subwindow(save_preset = new KeyFramePresetsSave(thread,
-               this,
-               theme->presets_save_x,
-               theme->presets_save_y));
-       add_subwindow(apply_preset = new KeyFramePresetsApply(thread,
-               this,
-               theme->presets_apply_x,
-               theme->presets_apply_y));
-
-
-
+       add_subwindow(preset_text = new KeyFramePresetsText(thread, this,
+               theme->presets_text_x, theme->presets_text_y, theme->presets_text_w));
+       add_subwindow(delete_preset = new KeyFramePresetsDelete(thread, this,
+               theme->presets_delete_x, theme->presets_delete_y));
+       add_subwindow(save_preset = new KeyFramePresetsSave(thread, this,
+               theme->presets_save_x, theme->presets_save_y));
+       add_subwindow(apply_preset = new KeyFramePresetsApply(thread, this,
+               theme->presets_apply_x, theme->presets_apply_y));
 
        add_subwindow(new KeyFramePresetsOK(thread, this));
        add_subwindow(new BC_CancelButton(this));
@@ -634,23 +605,13 @@ int KeyFrameWindow::resize_event(int w, int h)
 
 
 KeyFrameList::KeyFrameList(KeyFrameThread *thread,
-       KeyFrameWindow *window,
-       int x,
-       int y,
-       int w, 
-       int h)
- : BC_ListBox(x, 
-               y, 
-               w, 
-               h,
-               LISTBOX_TEXT,
-               thread->keyframe_data,
-               thread->column_titles,
-               thread->column_width,
-               KEYFRAME_COLUMNS)
+       KeyFrameWindow *window, int x, int y, int w, int h)
+ : BC_ListBox(x, y, w, h, LISTBOX_TEXT, thread->keyframe_data,
+       thread->column_titles, thread->column_width, KEYFRAME_COLUMNS)
 {
        this->thread = thread;
        this->window = window;
+       set_master_column(1, 0);
 }
 
 int KeyFrameList::selection_changed()
index f06cb94f87b3a818f80292d584527ec2e1e6c23e..743620caf4d0338595462e39cf1f4b9f6a87db6b 100644 (file)
 
 
 PluginOn::PluginOn(MWindow *mwindow, int x, int y, Plugin *plugin)
- : BC_Toggle(x,
-               y,
-               mwindow->theme->get_image_set("plugin_on"),
-               plugin->on)
+ : BC_Toggle(x, y, mwindow->theme->get_image_set("plugin_on"), plugin->on)
 {
        this->mwindow = mwindow;
        this->plugin = plugin;
        in_use = 1;
-       set_tooltip(_("On"));
+       set_tooltip(plugin->on ? _("Turn Off") : _("Turn On"));
 }
 
 int PluginOn::calculate_w(MWindow *mwindow)
@@ -47,6 +44,7 @@ int PluginOn::calculate_w(MWindow *mwindow)
 void PluginOn::update(int x, int y, Plugin *plugin)
 {
        BC_Toggle::set_value(plugin->on, 0);
+       set_tooltip(plugin->on ? _("Turn Off") : _("Turn On"));
        reposition_window(x, y);
        this->plugin = plugin;
        in_use = 1;
@@ -55,6 +53,7 @@ void PluginOn::update(int x, int y, Plugin *plugin)
 int PluginOn::handle_event()
 {
        plugin->on = get_value();
+       set_tooltip(plugin->on ? _("Turn Off") : _("Turn On"));
        unlock_window();
        mwindow->restart_brender();
        mwindow->sync_parameters(CHANGE_EDL);
index feff8a858d5df154b48f02d64a89c4ee68c0e56d..0e3ebc03068b327d0c92080e9f1d3e27ccbf6a1e 100644 (file)
@@ -4507,10 +4507,12 @@ int TrackCanvas::do_edits(int cursor_x, int cursor_y, int button_press, int drag
                                                        mwindow->edl->local_session->zoom_sample /
                                                        mwindow->edl->session->sample_rate;
 
+                                               int cx, cy;
+                                               get_abs_cursor_xy(cx, cy);
+                                               cx -= mwindow->theme->get_image("clip_icon")->get_w() / 2,
+                                               cy -= mwindow->theme->get_image("clip_icon")->get_h() / 2;
                                                gui->drag_popup = new BC_DragWindow(gui,
-                                                       mwindow->theme->get_image("clip_icon") /*,
-                                                       get_abs_cursor_x(0) - mwindow->theme->get_image("clip_icon")->get_w() / 2,
-                                                       get_abs_cursor_y(0) - mwindow->theme->get_image("clip_icon")->get_h() / 2 */);
+                                                       mwindow->theme->get_image("clip_icon"), cx, cy);
 
                                                result = 1;
                                        }
@@ -4619,19 +4621,22 @@ int TrackCanvas::do_plugins(int cursor_x, int cursor_y, int drag_start,
                                                        frame = mwindow->theme->get_image("veffect_icon");
                                                }
                                        }
-
-                                       gui->drag_popup = new BC_DragWindow(gui, frame /*,
-                                               get_abs_cursor_x(0) - frame->get_w() / 2,
-                                               get_abs_cursor_y(0) - frame->get_h() / 2 */);
+                                       int cx, cy;
+                                       get_abs_cursor_xy(cx, cy);
+                                       cx -= frame->get_w() / 2;
+                                       cy -= frame->get_h() / 2;
+                                       gui->drag_popup = new BC_DragWindow(gui, frame, cx, cy);
                                                break; }
 
                                case PLUGIN_SHAREDPLUGIN:
-                               case PLUGIN_SHAREDMODULE:
-                                       gui->drag_popup = new BC_DragWindow(gui,
-                                               mwindow->theme->get_image("clip_icon") /*,
-                                               get_abs_cursor_x(0) - mwindow->theme->get_image("clip_icon")->get_w() / 2,
-                                               get_abs_cursor_y(0) - mwindow->theme->get_image("clip_icon")->get_h() / 2 */);
-                                       break;
+                               case PLUGIN_SHAREDMODULE: {
+                                       VFrame *frame = mwindow->theme->get_image("clip_icon");
+                                       int cx, cy;
+                                       get_abs_cursor_xy(cx, cy);
+                                       cx -= frame->get_w() / 2;
+                                       cy -= frame->get_h() / 2;
+                                       gui->drag_popup = new BC_DragWindow(gui, frame, cx, cy);
+                                       break; }
                                }
 
                                result = 1;
index 793047ac184c065e6a053f2a76cff5bec546af71..c0ca4b08357df010a1d85b04532b38ede2ece028 100644 (file)
@@ -95,31 +95,28 @@ int VDeviceX11::open_input()
 // create overlay
        device->mwindow->gui->lock_window("VDeviceX11::close_all");
 
-       screencap_border[0] = new BC_Popup(device->mwindow->gui, 
+       screencap_border[0] = new BC_Popup(device->mwindow->gui,
                        device->input_x - SCREENCAP_PIXELS, device->input_y - SCREENCAP_PIXELS,
                        device->in_config->w + SCREENCAP_PIXELS * 2, SCREENCAP_PIXELS,
                        SCREENCAP_COLOR, 1);
-       screencap_border[1] = new BC_Popup(device->mwindow->gui, 
+       screencap_border[1] = new BC_Popup(device->mwindow->gui,
                        device->input_x - SCREENCAP_PIXELS, device->input_y,
                        SCREENCAP_PIXELS, device->in_config->h,
                        SCREENCAP_COLOR, 1);
-       screencap_border[2] = new BC_Popup(device->mwindow->gui, 
+       screencap_border[2] = new BC_Popup(device->mwindow->gui,
                        device->input_x - SCREENCAP_PIXELS, device->input_y + device->in_config->h,
                        device->in_config->w + SCREENCAP_PIXELS * 2, SCREENCAP_PIXELS,
                        SCREENCAP_COLOR, 1);
-       screencap_border[3] = new BC_Popup(device->mwindow->gui, 
+       screencap_border[3] = new BC_Popup(device->mwindow->gui,
                        device->input_x + device->in_config->w, device->input_y,
                        SCREENCAP_PIXELS, device->in_config->h,
                        SCREENCAP_COLOR, 1);
+usleep(500000);        // avoids a bug in gnome-shell 2017/10/19
 
-       for( int i=0; i<SCREENCAP_BORDERS; ++i ) {
-               BC_Popup *box = screencap_border[i];
-               box->set_bg_color(SCREENCAP_COLOR);
-               box->clear_box(0, 0, box->get_w(), box->get_h());
-               box->flash(0);
-               box->show_window();
-       }
+       for( int i=0; i<SCREENCAP_BORDERS; ++i )
+               screencap_border[i]->show_window(0);
 
+       device->mwindow->gui->flush();
        device->mwindow->gui->unlock_window();
 
        return 0;
index aea62b6aed19da1ca15fb00089b3f4dcf5128b56..173a5a9ebe5a7c94f19d1cb4aa8a28f3418f11aa 100644 (file)
@@ -30,7 +30,7 @@ aloop
 #amix
 #amovie
 #anequalizer
-anoisesrc
+#anoisesrc
 #anull
 #anullsink
 #anullsrc
index 2eab2e17406d8ce4363a077675aeb8ed4a05e37b..355315bc447cd98081b8c947461c293e831aa7d5 100644 (file)
 #include "vframe.h"
 #include <unistd.h>
 
-// Icon has to be offset so the cursor isn't directly over it.
-// The cursor has to be over the target window for X to detect the right window.
-#define DRAG_OFFSET_X 16
-#define DRAG_OFFSET_Y 16
-
 BC_DragWindow::BC_DragWindow(BC_WindowBase *parent_window,
-       BC_Pixmap *pixmap /*,
-       int icon_x,
-       int icon_y */)
- : BC_Popup(parent_window,
-//     icon_x,
-//     icon_y,
-       parent_window->get_abs_cursor_x(0) + DRAG_OFFSET_X,
-       parent_window->get_abs_cursor_y(0) + DRAG_OFFSET_Y,
-       pixmap->get_w(),
-       pixmap->get_h(),
-       -1,
-       0,
-       pixmap)
+       BC_Pixmap *pixmap, int icon_x, int icon_y)
+ : BC_Popup(parent_window, icon_x, icon_y, pixmap->get_w(), pixmap->get_h(),
+       -1, 0, pixmap)
 {
-       temp_frame = 0;
        drag_pixmap = 0;
-//     init_x = icon_x;
-//     init_y = icon_y;
-       init_x = parent_window->get_abs_cursor_x(0) + DRAG_OFFSET_X;
-       init_y = parent_window->get_abs_cursor_y(0) + DRAG_OFFSET_Y;
+       init_x = icon_x;
+       init_y = icon_y;
        end_x = BC_INFINITY;
        end_y = BC_INFINITY;
        icon_offset_x = init_x - parent_window->get_abs_cursor_x(0);
@@ -61,26 +43,12 @@ BC_DragWindow::BC_DragWindow(BC_WindowBase *parent_window,
 
 
 BC_DragWindow::BC_DragWindow(BC_WindowBase *parent_window,
-       VFrame *frame /*,
-       int icon_x,
-       int icon_y */)
- : BC_Popup(parent_window,
-//     icon_x,
-//     icon_y,
-       parent_window->get_abs_cursor_x(0) + DRAG_OFFSET_X,
-       parent_window->get_abs_cursor_y(0) + DRAG_OFFSET_Y,
-       frame->get_w(),
-       frame->get_h(),
-       -1,
-       0,
-       prepare_frame(frame, parent_window))
+       VFrame *frame, int icon_x, int icon_y)
+ : BC_Popup(parent_window, icon_x, icon_y, frame->get_w(), frame->get_h(),
+       -1, 0, prepare_frame(frame, parent_window))
 {
-       delete temp_frame;  // created in prepare_frame inside constructor
-       temp_frame = 0;
-//     init_x = icon_x;
-//     init_y = icon_y;
-       init_x = parent_window->get_abs_cursor_x(0) + DRAG_OFFSET_X;
-       init_y = parent_window->get_abs_cursor_y(0) + DRAG_OFFSET_Y;
+       init_x = icon_x;
+       init_y = icon_y;
        end_x = BC_INFINITY;
        end_y = BC_INFINITY;
        icon_offset_x = init_x - parent_window->get_abs_cursor_x(0);
@@ -99,13 +67,8 @@ int BC_DragWindow::get_init_x(BC_WindowBase *parent_window, int icon_x)
        int output_x, temp = 0;
        Window tempwin;
        XTranslateCoordinates(parent_window->top_level->display,
-               parent_window->win,
-               parent_window->top_level->rootwin,
-               icon_x,
-               temp,
-               &output_x,
-               &temp,
-               &tempwin);
+               parent_window->win, parent_window->top_level->rootwin,
+               icon_x, temp, &output_x, &temp, &tempwin);
        return output_x;
 }
 
@@ -114,22 +77,16 @@ int BC_DragWindow::get_init_y(BC_WindowBase *parent_window, int icon_y)
        int output_y, temp = 0;
        Window tempwin;
        XTranslateCoordinates(parent_window->top_level->display,
-               parent_window->win,
-               parent_window->top_level->rootwin,
-               temp,
-               icon_y,
-               &temp,
-               &output_y,
-               &tempwin);
+               parent_window->win, parent_window->top_level->rootwin,
+               temp, icon_y, &temp, &output_y, &tempwin);
        return output_y;
 }
 
 int BC_DragWindow::cursor_motion_event()
 {
-       reposition_window(get_abs_cursor_x(0) + icon_offset_x,
-               get_abs_cursor_y(0) + icon_offset_y,
-               get_w(),
-               get_h());
+       int cx, cy;
+       get_abs_cursor_xy(cx, cy);
+       reposition_window(cx + icon_offset_x, cy + icon_offset_y, get_w(), get_h());
        flush();
        return 1;
 }
@@ -148,21 +105,16 @@ int BC_DragWindow::drag_failure_event()
 {
        if(!do_animation) return 0;
 
-       if(end_x == BC_INFINITY)
-       {
+       if(end_x == BC_INFINITY) {
                end_x = get_x();
                end_y = get_y();
        }
 
-       for(int i = 0; i < 10; i++)
-       {
+       for(int i = 0; i < 10; i++) {
                int new_x = end_x + (init_x - end_x) * i / 10;
                int new_y = end_y + (init_y - end_y) * i / 10;
 
-               reposition_window(new_x,
-                       new_y,
-                       get_w(),
-                       get_h());
+               reposition_window(new_x, new_y, get_w(), get_h());
                flush();
                usleep(1000);
        }
@@ -176,38 +128,28 @@ void BC_DragWindow::set_animation(int value)
 
 BC_Pixmap *BC_DragWindow::prepare_frame(VFrame *frame, BC_WindowBase *parent_window)
 {
-       temp_frame = 0;
+       VFrame *temp_frame = 0;
+       int tw = frame->get_w(), th = frame->get_h();
 
-       if(frame->get_color_model() == BC_RGBA8888)
-       {
-               temp_frame = new VFrame(*frame);
+       if( frame->get_color_model() != BC_RGBA8888 ) {
+               temp_frame = new VFrame(tw, th, BC_RGBA8888);
+               temp_frame->transfer_from(frame);
        }
        else
-       {
-               temp_frame = new VFrame;
-               temp_frame->set_use_shm(0);
-               temp_frame->reallocate(0,
-                                       -1,
-                                       0,
-                                       0,
-                                       0,
-                                       frame->get_w(),
-                                       frame->get_h(),
-                                       BC_RGBA8888,
-                                       -1);
-
-               BC_CModels::transfer(temp_frame->get_rows(), frame->get_rows(),
-                       0, 0, 0, 0, 0, 0,
-                       0, 0, frame->get_w(), frame->get_h(),
-                       0, 0, temp_frame->get_w(), temp_frame->get_h(),
-                       frame->get_color_model(), temp_frame->get_color_model(),
-                       0, frame->get_w(), temp_frame->get_w());
+               temp_frame = new VFrame(*frame);
+
+       int tx = tw/2, ty = th/2, tx1 = tx-1, ty1 = ty-1, tx2 = tx+2, ty2 = ty+2;
+       int bpp = BC_CModels::calculate_pixelsize(temp_frame->get_color_model());
+       unsigned char **rows = temp_frame->get_rows();
+       for( int y=ty1; y<ty2; ++y ) {
+               for( int x=tx1; x<tx2; ++x ) {
+                       unsigned char *rp = rows[y] + x*bpp;
+                       rp[3] = 0; // alpha of center pixels = 0
+               }
        }
-       temp_frame->get_rows()[(temp_frame->get_h() / 2)][(temp_frame->get_w() / 2) * 4 + 3] = 0;
-       drag_pixmap = new BC_Pixmap(parent_window,
-                       temp_frame,
-                       PIXMAP_ALPHA);
+       drag_pixmap = new BC_Pixmap(parent_window, temp_frame, PIXMAP_ALPHA);
 
+       delete temp_frame;
        return drag_pixmap;
 }
 
index ea51834b573e887de9f332045301d2bb13abf9c8..63c89767cb71599106555e33a4cbe70c00ad9e50 100644 (file)
@@ -28,8 +28,8 @@
 class BC_DragWindow : public BC_Popup
 {
 public:
-       BC_DragWindow(BC_WindowBase *parent_window, BC_Pixmap *pixmap /*, int icon_x, int icon_y */);
-       BC_DragWindow(BC_WindowBase *parent_window, VFrame *frame /*, int icon_x, int icon_y */);
+       BC_DragWindow(BC_WindowBase *parent_window, BC_Pixmap *pixmap, int icon_x, int icon_y);
+       BC_DragWindow(BC_WindowBase *parent_window, VFrame *frame, int icon_x, int icon_y);
        ~BC_DragWindow();
 
        int cursor_motion_event();
@@ -47,7 +47,6 @@ private:
        int end_x, end_y;
        int icon_offset_x, icon_offset_y;
        int do_animation;
-       VFrame *temp_frame;
        BC_Pixmap *drag_pixmap;
 };
 
index ac15f666e4d8b139414bda2703d63ee86fff6d61..0c3057d1d99ed47838741a38fa648cee5b71f7ea 100644 (file)
@@ -3676,9 +3676,7 @@ int BC_ListBox::drag_start_event()
        switch(current_operation)
        {
                case SELECT:
-                       if(gui &&
-                               gui->is_event_win() &&
-                               allow_drag)
+                       if( gui && gui->is_event_win() && allow_drag )
                        {
                                BC_ListBoxItem *item_return = 0;
                                selection_number = get_cursor_item(data,
@@ -3688,33 +3686,25 @@ int BC_ListBox::drag_start_event()
 
                                if(selection_number >= 0)
                                {
-
-                                       if (item_return->icon_vframe)
-                                       {
+                                       int cx, cy;
+                                       get_abs_cursor_xy(cx, cy);
+                                       cx -= item_return->icon_vframe->get_w() / 2,
+                                       cy -= item_return->icon_vframe->get_h() / 2;
+                                       if( item_return->icon_vframe )
                                                drag_popup = new BC_DragWindow(this,
-                                                       item_return->icon_vframe /*,
-                                                       get_abs_cursor_x(0) - item_return->icon_vframe->get_w() / 2,
-                                                       get_abs_cursor_y(0) - item_return->icon_vframe->get_h() / 2 */);
-                                       }
+                                                       item_return->icon_vframe, cx, cy);
                                        else
 // this probably works not!
-                                       if (item_return->icon)
-                                       {
+                                       if( item_return->icon )
                                                drag_popup = new BC_DragWindow(this,
-                                                       item_return->icon /*,
-                                                       get_abs_cursor_x(0) - item_return->icon->get_w() / 2,
-                                                       get_abs_cursor_y(0) - item_return->icon->get_h() / 2 */);
-                                       }
+                                                       item_return->icon, cx, cy);
                                        else
-                                       {
                                                drag_popup = new BC_DragWindow(this,
-                                                       drag_icon_vframe /*,
-                                                       get_abs_cursor_x(0) - drag_icon_vframe->get_w() / 2,
-                                                       get_abs_cursor_y(0) - drag_icon_vframe->get_h() / 2 */);
-                                       }
-
+                                                       drag_icon_vframe, cx, cy);
                                        current_operation = DRAG_ITEM;
-                                       set_repeat(get_resources()->scroll_repeat);
+// require shift down for scrolling
+                                       if( allow_drag < 0 && shift_down() )
+                                               set_repeat(get_resources()->scroll_repeat);
                                        return 1;
                                }
                        }
@@ -3723,10 +3713,12 @@ int BC_ListBox::drag_start_event()
                case COLUMN_DN:
                        if(gui && gui->is_event_win() && allow_drag_column)
                        {
+                               int cx, cy;
+                               get_abs_cursor_xy(cx, cy);
+                               cx -= drag_column_icon_vframe->get_w() / 2,
+                               cy -= drag_column_icon_vframe->get_h() / 2;
                                drag_popup = new BC_DragWindow(this,
-                                       drag_column_icon_vframe /*,
-                                       get_abs_cursor_x(0) - drag_column_icon_vframe->get_w() / 2,
-                                       get_abs_cursor_y(0) - drag_column_icon_vframe->get_h() / 2 */);
+                                       drag_column_icon_vframe, cx, cy);
                                dragged_title = highlighted_title;
                                current_operation = COLUMN_DRAG;
                                draw_titles(1);
@@ -3769,7 +3761,6 @@ int BC_ListBox::drag_motion_event()
                        }
 
                        return drag_popup->cursor_motion_event();
-                       break;
                }
 
                case COLUMN_DRAG:
@@ -3781,7 +3772,6 @@ int BC_ListBox::drag_motion_event()
                                draw_titles(1);
                        }
                        return drag_popup->cursor_motion_event();
-                       break;
                }
        }
        return 0;
@@ -3806,16 +3796,10 @@ int BC_ListBox::drag_stop_event()
                                {
                                        reposition_item(data,
                                                selection_number,
-                                               top_level->cursor_x +
-                                                       drag_popup->get_offset_x() -
-                                                       LISTBOX_MARGIN -
-                                                       2 +
-                                                       xposition,
-                                               top_level->cursor_y +
-                                                       drag_popup->get_offset_y() -
-                                                       LISTBOX_MARGIN -
-                                                       2 +
-                                                       yposition);
+                                               top_level->cursor_x + drag_popup->get_offset_x() -
+                                                       LISTBOX_MARGIN - 2 + xposition,
+                                               top_level->cursor_y + drag_popup->get_offset_y() -
+                                                       LISTBOX_MARGIN - 2 + yposition);
                                }
                                else
 // Move rows
@@ -4386,7 +4370,7 @@ void BC_ListBox::draw_text_recursive(ArrayList<BC_ListBoxItem*> *data,
                                gui->set_color(BLACK);
                                int xx = x + column_width-1;
                                gui->draw_line(x, y, xx, y);
-                               int hh = row_height;
+                               int hh = h;
                                if( display_format == LISTBOX_ICON_LIST ) {
                                        int ih = get_icon_h(item);
                                        if( ih > hh ) hh = ih;
index 60d90fa5c99f27234df601d79684bf57d5be4ab5..7df9f84ed3af5f752f40c22e135034b830b3f1f5 100644 (file)
 
 
 BC_FullScreen::BC_FullScreen(BC_WindowBase *parent_window, int w, int h,
-                          int bg_color,
-                          int vm_scale,
-                          int hide,
-                          BC_Pixmap *bg_pixmap)
+               int bg_color, int vm_scale, int hide, BC_Pixmap *bg_pixmap)
  : BC_WindowBase()
 {
 #ifdef HAVE_LIBXXF86VM
    if (vm_scale)
-          create_window(parent_window,
-                          _("Fullscreen"),
-                          parent_window->get_screen_x(0, -1),
-                          parent_window->get_screen_y(0, -1),
-                          w,
-                          h,
-                          w,
-                          h,
-                          0,
-                          parent_window->top_level->private_color,
-                          hide,
-                          bg_color,
-                          NULL,
-                          VIDMODE_SCALED_WINDOW,
-                          bg_pixmap,
-                          0);
+          create_window(parent_window, _("Fullscreen"),
+                  parent_window->get_screen_x(0, -1), parent_window->get_screen_y(0, -1),
+                  w, h, w, h, 0, parent_window->top_level->private_color, hide,
+                  bg_color, NULL, VIDMODE_SCALED_WINDOW, bg_pixmap, 0);
    else
 #endif
-   create_window(parent_window,
-                          _("Fullscreen"),
-                          parent_window->get_screen_x(0, -1),
-                          parent_window->get_screen_y(0, -1),
-                          w,
-                          h,
-                          w,
-                          h,
-                          0,
-                          parent_window->top_level->private_color,
-                          hide,
-                          bg_color,
-                          NULL,
-                          POPUP_WINDOW,
-                          bg_pixmap,
-                          0);
+   create_window(parent_window, _("Fullscreen"),
+                  parent_window->get_screen_x(0, -1), parent_window->get_screen_y(0, -1),
+                  w, h, w, h, 0, parent_window->top_level->private_color, hide,
+                  bg_color, NULL, POPUP_WINDOW, bg_pixmap, 0);
 }
 
 
@@ -75,31 +48,12 @@ BC_FullScreen::~BC_FullScreen()
 
 
 BC_Popup::BC_Popup(BC_WindowBase *parent_window,
-                               int x,
-                               int y,
-                               int w,
-                               int h,
-                               int bg_color,
-                               int hide,
-                               BC_Pixmap *bg_pixmap)
+               int x, int y, int w, int h, int bg_color, int hide, BC_Pixmap *bg_pixmap)
  : BC_WindowBase()
 {
        create_window(parent_window,
-                               _("Popup"),
-                               x,
-                               y,
-                               w,
-                               h,
-                               w,
-                               h,
-                               0,
-                               parent_window->top_level->private_color,
-                               hide,
-                               bg_color,
-                               NULL,
-                               POPUP_WINDOW,
-                               bg_pixmap,
-                               0);
+               _("Popup"), x, y, w, h, w, h, 0, parent_window->top_level->private_color,
+               hide, bg_color, NULL, POPUP_WINDOW, bg_pixmap, 0);
        grabbed = 0;
 }
 
index e932af59411abeee197a8b2e7d415f4bb649d28b..2ab104e094b78244b1c586b7c6a1de38a8c1eff0 100644 (file)
@@ -59,6 +59,7 @@ char BC_Resources::region[LEN_LANG] = {0};
 char BC_Resources::encoding[LEN_ENCOD] = {0};
 const char *BC_Resources::wide_encoding = 0;
 ArrayList<BC_FontEntry*> *BC_Resources::fontlist = 0;
+int BC_Resources::font_debug = 0;
 const char *BC_Resources::fc_properties[] = { FC_SLANT, FC_WEIGHT, FC_WIDTH };
 #define LEN_FCPROP (sizeof(BC_Resources::fc_properties) / sizeof(const char*))
 
@@ -88,7 +89,7 @@ static const char *def_large_font_xft = "Sans:pixelsize=%.4f";           // 21.3
 static const char *def_large_b_font_xft = "Sans:bold:pixelsize=%.4f";    // 21.3333
 static const char *def_big_font_xft = "Sans:pixelsize=37.3333";          // 37.3333
 static const char *def_big_b_font_xft = "Sans:bold:pixelsize=37.33333";  // 37.3333
-static const char *def_clock_font_xft = "Sans:pixelsize=16";             // 16
+static const char *def_clock_font_xft = "Sans:pixelsize=%.4f";           // 16
 
 #define default_font_xft2 "-microsoft-verdana-*-*-*-*-*-*-*-*-*-*-*-*"
 
@@ -136,8 +137,8 @@ void BC_Resources::init_font_defs(double scale)
        def_font(large_font2,      iround(scale*20));
        def_font(big_font,         iround(scale*160), iround(scale*160));
        def_font(big_font2,        iround(scale*16), iround(scale*16));
-       def_font(clock_font,       iround(scale*16), iround(scale*16));
-       def_font(clock_font2,      iround(scale*16), iround(scale*16));
+       def_font(clock_font,       iround(scale*16));
+       def_font(clock_font2,      iround(scale*18));
        def_font(small_fontset,    iround(scale*10));
        def_font(medium_fontset,   iround(scale*14));
        def_font(large_fontset,    iround(scale*18));
@@ -151,7 +152,7 @@ void BC_Resources::init_font_defs(double scale)
        def_font(large_b_font_xft, (scale*21.3333));
        def_font(big_font_xft,     (scale*37.3333));
        def_font(big_b_font_xft,   (scale*37.3333));
-       def_font(clock_font_xft,   (scale*16));
+       def_font(clock_font_xft,   (scale*16.));
 
        set_font(small_font_xft2,  default_font_xft2);
        set_font(medium_font_xft2, default_font_xft2);
@@ -344,7 +345,9 @@ BC_Resources::BC_Resources()
        synchronous = 0;
        vframe_shm = 0;
        double default_scale = 1.0; // display_size/1000.;
-       char *env = getenv("BC_FONT_SCALE");
+       char *env = getenv("BC_FONT_DEBUG");
+       font_debug = env ? atoi(env) : 0;
+       env = getenv("BC_FONT_SCALE");
        font_scale = env ? atof(env) : default_scale;
        if( font_scale <= 0 ) font_scale = 1;
        init_font_defs(font_scale);
@@ -966,17 +969,23 @@ int BC_Resources::init_fontconfig(const char *search_path)
 
        char find_command[BCTEXTLEN];
        char *fp = find_command, *ep = fp+sizeof(find_command)-1;
-       fp += snprintf(fp, ep-fp, "find '%s'", search_path);
+       fp += snprintf(fp, ep-fp, "%s", "find");
        const char *bc_font_path = getenv("BC_FONT_PATH");
+// if BC_FONT_PATH starts with ':', omit default path
+       if( !(bc_font_path && bc_font_path[0] == ':') )
+               fp += snprintf(fp, ep-fp, " '%s'", search_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;
+               while( *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);
+                       const char *cp = strchr(path,':');
+                       int len = !cp ? strlen(path) : cp-path;
+                       if( len > 0 ) {
+                               memcpy(font_path, path, len);
+                               font_path[len] = 0;  path += len;
+                               fp += snprintf(fp, ep-fp, " '%s'", font_path);
+                       }
+                       if( cp ) ++path;
                }
         }
        fp += snprintf(fp, ep-fp, " -name 'fonts.scale' -print -exec cat {} \\;");
@@ -1123,11 +1132,16 @@ int BC_Resources::init_fontconfig(const char *search_path)
                        entry->style |= FL_WIDTH_NORMAL;
 
                fontlist->append(entry);
+               if( font_debug )
+                       dump_font_entry(stdout, "font 0: ", entry);
+
 //             printf("TitleMain::build_fonts %s: success\n",  entry->path);
 //printf("TitleMain::build_fonts 2\n");
        }
        pclose(in);
 
+       if( bc_font_path && bc_font_path[0] == ':' )
+               return 0;
 
 // Load all the fonts from fontconfig
        FcPattern *pat;
@@ -1335,6 +1349,8 @@ int BC_Resources::init_fontconfig(const char *search_path)
 
                }
                fontlist->append(entry);
+               if( font_debug )
+                       dump_font_entry(stdout, "font 1: ", entry);
        }
 
        FcFontSetDestroy(fs);
@@ -1544,6 +1560,8 @@ int BC_Resources::init_fontconfig(const char *search_path)
                        strcpy(entry->displayname, entry->family);
                }
                fontlist->append(entry);
+               if( font_debug )
+                       dump_font_entry(stdout, "font 2: ", entry);
        }
        FcFontSetDestroy(fs);
        return 0;
@@ -1753,13 +1771,16 @@ FcPattern* BC_Resources::find_similar_font(FT_ULong char_code, FcPattern *oldfon
 
 void BC_Resources::dump_fonts(FILE *fp)
 {
-       for( int i=0; i<fontlist->total; ++i ) {
-               BC_FontEntry *ep = fontlist->values[i];
-               fprintf(fp,"%s = %s\n",ep->displayname,ep->path);
-               fprintf(fp,"  %s:%s:%s:%s:%s:%s:%d:%d:%d:%d:%d:%s:%d:%s:%s:%d\n",
-                       ep->foundry, ep->family, ep->weight, ep->slant, ep->swidth, ep->adstyle,
-                       ep->pixelsize, ep->pointsize, ep->xres, ep->yres, ep->style, ep->spacing,
-                       ep->avg_width, ep->registry, ep->encoding, ep->fixed_style);
-       }
+       for( int i=0; i<fontlist->total; ++i )
+               dump_font_entry(fp, "", fontlist->values[i]);
+}
+
+void BC_Resources::dump_font_entry(FILE *fp, const char *cp,  BC_FontEntry *ep)
+{
+       fprintf(fp,"%s%s = %s\n",cp,ep->displayname,ep->path);
+       fprintf(fp,"  %s:%s:%s:%s:%s:%s:%d:%d:%d:%d:%d:%s:%d:%s:%s:%d\n",
+               ep->foundry, ep->family, ep->weight, ep->slant, ep->swidth, ep->adstyle,
+               ep->pixelsize, ep->pointsize, ep->xres, ep->yres, ep->style, ep->spacing,
+               ep->avg_width, ep->registry, ep->encoding, ep->fixed_style);
 }
 
index d5c9a069f83ebaeccf797c09e0d778e2ef49d0af..1c73f71377c8d342b69ea02a7f464712ee19fb68 100644 (file)
@@ -304,7 +304,6 @@ public:
        int directory_color;
        int file_color;
        double font_scale, icon_scale;
-
 // fonts
        static const char *small_font, *small_font2;
        static const char *medium_font, *medium_font2;
@@ -360,7 +359,9 @@ public:
        static size_t encode(const char *from_enc, const char *to_enc,
                char *input, int input_length, char *output, int output_length);
        static int find_font_by_char(FT_ULong char_code, char *path_new, const FT_Face oldface);
+       static int font_debug;
        static void dump_fonts(FILE *fp = stdout);
+       static void dump_font_entry(FILE *fp, const char *cp,  BC_FontEntry *ep);
 
        static void new_vframes(int n, VFrame *vframes[], ...);
        static void del_vframes(VFrame *vframes[], int n);
index 23f7f71cc70b63082324fce936fc195789d25e43..6992bc9b3d10abdece45babb01ae6e76c4608ab6 100644 (file)
 char BC_Window::default_x11_host[BCTEXTLEN] = "";
 
 BC_Window::BC_Window(const char *title,
-                               int x,
-                               int y,
-                               int w,
-                               int h,
-                               int minw,
-                               int minh,
-                               int allow_resize,
-                               int private_color,
-                               int hide,
-                               int bg_color,
-                               const char *display_name,
-                               int group_it,
-                               int options)
+               int x, int y, int w, int h, int minw, int minh, int allow_resize,
+               int private_color, int hide, int bg_color, const char *display_name,
+               int group_it, int options)
  : BC_WindowBase(options)
 {
-       create_window(0,
-                               title,
-                               x,
-                               y,
-                               w,
-                               h,
-                               (minw < 0) ? w : minw,
-                               (minh < 0) ? h : minh,
-                               allow_resize,
-                               private_color,
-                               hide,
-                               bg_color,
-                               display_name ? display_name :
-                                       default_x11_host[0] ? default_x11_host :
-                                               0,
-                               MAIN_WINDOW,
-                               0,
-                               group_it);
+       create_window(0, title, x, y, w, h,
+               (minw < 0) ? w : minw, (minh < 0) ? h : minh,
+               allow_resize, private_color, hide, bg_color,
+               display_name ? display_name :
+                       default_x11_host[0] ? default_x11_host : 0,
+               MAIN_WINDOW, 0, group_it);
 }
 
 
index 6599369e1b2276e71eac074dcbeb3154e938631c..12e6c34a6faf3645f36f5aa394f74a7b753f9555 100644 (file)
@@ -385,22 +385,10 @@ int BC_WindowBase::initialize()
                        FocusChangeMask
 
 
-int BC_WindowBase::create_window(BC_WindowBase *parent_window,
-                               const char *title,
-                               int x,
-                               int y,
-                               int w,
-                               int h,
-                               int minw,
-                               int minh,
-                               int allow_resize,
-                               int private_color,
-                               int hide,
-                               int bg_color,
-                               const char *display_name,
-                               int window_type,
-                               BC_Pixmap *bg_pixmap,
-                               int group_it)
+int BC_WindowBase::create_window(BC_WindowBase *parent_window, const char *title,
+               int x, int y, int w, int h, int minw, int minh, int allow_resize,
+               int private_color, int hide, int bg_color, const char *display_name,
+               int window_type, BC_Pixmap *bg_pixmap, int group_it)
 {
        XSetWindowAttributes attr;
        unsigned long mask;
index f2a07fc6dfe9a5adf3e7018eb12dc0c0146c0f52..74bd13302186ed08ac1a7dc06c1c1ef87e5fd6f8 100644 (file)
Binary files a/cinelerra-5.1/plugins/interpolate/picon_cinfinity.png and b/cinelerra-5.1/plugins/interpolate/picon_cinfinity.png differ
index ee0b79ab30b9e1c1cec96349bd293291dc4030f2..b91425aa39d9e6c9d226b9092cca98e68b13b8bd 100644 (file)
Binary files a/cinelerra-5.1/plugins/spherecam/picon_cinfinity.png and b/cinelerra-5.1/plugins/spherecam/picon_cinfinity.png differ
index d96803425779e3f648925dffe7947c9d30ed5256..3e13abecfff6ec0ba0f4888175f80dc099ea242c 100644 (file)
@@ -294,6 +294,10 @@ void GlyphUnit::process_package(LoadPackage *package)
 {
        GlyphPackage *pkg = (GlyphPackage*)package;
        TitleGlyph *glyph = pkg->glyph;
+       BC_Resources *resources =  BC_WindowBase::get_resources();
+       if( resources->font_debug )
+               printf("GlyphUnit load glyph (%s) %04x, '%c'\n", glyph->font->displayname,
+                       (unsigned)glyph->char_code, (unsigned)glyph->char_code);
        int result = 0;
        char new_path[BCTEXTLEN];
        if( plugin->load_freetype_face(freetype_library, freetype_face, glyph->font->path) ) {
@@ -311,7 +315,6 @@ void GlyphUnit::process_package(LoadPackage *package)
                if( gindex == 0 ) {
 printf("GlyphUnit::process_package 1 glyph not found (%s) %04x, '%c'\n",
  glyph->font->displayname, (unsigned)glyph->char_code, (unsigned)glyph->char_code);
-                       BC_Resources *resources =  BC_WindowBase::get_resources();
                        // Search replacement font
                        if( resources->find_font_by_char(glyph->char_code, new_path, freetype_face) ) {
                                plugin->load_freetype_face(freetype_library,
@@ -1151,7 +1154,8 @@ NEW_WINDOW_MACRO(TitleMain, TitleWindow);
 
 void TitleMain::build_previews(TitleWindow *gui)
 {
-       ArrayList<BC_FontEntry*>&fonts = *gui->get_resources()->fontlist;
+       BC_Resources *resources =  BC_WindowBase::get_resources();
+       ArrayList<BC_FontEntry*>&fonts = *resources->fontlist;
 
        for( int font_number=0; font_number<fonts.size(); ++font_number ) {
                BC_FontEntry *font = fonts.get(font_number);
@@ -1166,7 +1170,7 @@ void TitleMain::build_previews(TitleWindow *gui)
        char new_path[BCTEXTLEN];
        int text_height = gui->get_text_height(LARGEFONT);
        int max_height = 3*text_height/2, max_width = 2 * max_height;
-       int text_color = BC_WindowBase::get_resources()->default_text_color;
+       int text_color = resources->default_text_color;
        int r = (text_color >> 16) & 0xff;
        int g = (text_color >> 8) & 0xff;
        int b = text_color & 0xff;
@@ -1179,6 +1183,8 @@ void TitleMain::build_previews(TitleWindow *gui)
        int total_w = 0;
        int total_h = 0;
        for( int pass=0; pass<2; ++pass ) {
+               if( resources->font_debug )
+                       printf("Titler: build previews pass %d\n",pass);
 //printf("TitleMain::build_previews %d %d %d\n",
 //__LINE__, text_height, total_h);
                for( int font_number=0; font_number<fonts.size(); ++font_number ) {
@@ -1196,6 +1202,8 @@ void TitleMain::build_previews(TitleWindow *gui)
                        }
 
                        if( skip ) continue;
+                       if( resources->font_debug )
+                               printf("Titler: preview %s = %s\n",font->displayname, font->path);
                        if( pass > 0 ) {
                                font->image = new VFrame;
                                font->image->set_use_shm(0);
@@ -1353,7 +1361,7 @@ int TitleMain::load_freetype_face(FT_Library &freetype_library,
 
 int TitleMain::load_font(BC_FontEntry *font)
 {
-       if( load_freetype_face(freetype_library,freetype_face, font->path) ) return 1;
+       if( !font || load_freetype_face(freetype_library,freetype_face, font->path) ) return 1;
        strcpy(text_font, font->displayname);
        return 0;
 }