From: Good Guy Date: Thu, 19 Oct 2017 23:12:15 +0000 (-0600) Subject: font debug env var, drag fixes, cposer hide scrollbar, plugin tool tip X-Git-Url: https://git.cinelerra-gg.org/git/?a=commitdiff_plain;h=5e3715ec449272335bab3419bf21ed4cd6d4bcbf;hp=6bd49ce1b213869a304386c48d43324d7f641248;p=goodguy%2Fhistory.git font debug env var, drag fixes, cposer hide scrollbar, plugin tool tip --- diff --git a/cinelerra-5.1/Cinelerra_factory b/cinelerra-5.1/Cinelerra_factory index 97c2aa40..3cc787ad 100644 --- a/cinelerra-5.1/Cinelerra_factory +++ b/cinelerra-5.1/Cinelerra_factory @@ -37,7 +37,7 @@ - + diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 1267c001..da146a61 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -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; diff --git a/cinelerra-5.1/cinelerra/cpanel.C b/cinelerra-5.1/cinelerra/cpanel.C index a62f0a7e..1e6ef8d3 100644 --- a/cinelerra-5.1/cinelerra/cpanel.C +++ b/cinelerra-5.1/cinelerra/cpanel.C @@ -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; } diff --git a/cinelerra-5.1/cinelerra/cpanel.h b/cinelerra-5.1/cinelerra/cpanel.h index 7836d285..a3e19430 100644 --- a/cinelerra-5.1/cinelerra/cpanel.h +++ b/cinelerra-5.1/cinelerra/cpanel.h @@ -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; diff --git a/cinelerra-5.1/cinelerra/keyframegui.C b/cinelerra-5.1/cinelerra/keyframegui.C index 8e6019f0..d7d29741 100644 --- a/cinelerra-5.1/cinelerra/keyframegui.C +++ b/cinelerra-5.1/cinelerra/keyframegui.C @@ -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; @@ -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() diff --git a/cinelerra-5.1/cinelerra/plugintoggles.C b/cinelerra-5.1/cinelerra/plugintoggles.C index f06cb94f..743620ca 100644 --- a/cinelerra-5.1/cinelerra/plugintoggles.C +++ b/cinelerra-5.1/cinelerra/plugintoggles.C @@ -28,15 +28,12 @@ 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); diff --git a/cinelerra-5.1/cinelerra/trackcanvas.C b/cinelerra-5.1/cinelerra/trackcanvas.C index feff8a85..0e3ebc03 100644 --- a/cinelerra-5.1/cinelerra/trackcanvas.C +++ b/cinelerra-5.1/cinelerra/trackcanvas.C @@ -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; diff --git a/cinelerra-5.1/cinelerra/vdevicex11.C b/cinelerra-5.1/cinelerra/vdevicex11.C index 793047ac..c0ca4b08 100644 --- a/cinelerra-5.1/cinelerra/vdevicex11.C +++ b/cinelerra-5.1/cinelerra/vdevicex11.C @@ -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; iset_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; ishow_window(0); + device->mwindow->gui->flush(); device->mwindow->gui->unlock_window(); return 0; diff --git a/cinelerra-5.1/ffmpeg/plugin.opts b/cinelerra-5.1/ffmpeg/plugin.opts index aea62b6a..173a5a9e 100644 --- a/cinelerra-5.1/ffmpeg/plugin.opts +++ b/cinelerra-5.1/ffmpeg/plugin.opts @@ -30,7 +30,7 @@ aloop #amix #amovie #anequalizer -anoisesrc +#anoisesrc #anull #anullsink #anullsrc diff --git a/cinelerra-5.1/guicast/bcdragwindow.C b/cinelerra-5.1/guicast/bcdragwindow.C index 2eab2e17..355315bc 100644 --- a/cinelerra-5.1/guicast/bcdragwindow.C +++ b/cinelerra-5.1/guicast/bcdragwindow.C @@ -25,32 +25,14 @@ #include "vframe.h" #include -// 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; yget_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; } diff --git a/cinelerra-5.1/guicast/bcdragwindow.h b/cinelerra-5.1/guicast/bcdragwindow.h index ea51834b..63c89767 100644 --- a/cinelerra-5.1/guicast/bcdragwindow.h +++ b/cinelerra-5.1/guicast/bcdragwindow.h @@ -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; }; diff --git a/cinelerra-5.1/guicast/bclistbox.C b/cinelerra-5.1/guicast/bclistbox.C index ac15f666..0c3057d1 100644 --- a/cinelerra-5.1/guicast/bclistbox.C +++ b/cinelerra-5.1/guicast/bclistbox.C @@ -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 *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; diff --git a/cinelerra-5.1/guicast/bcpopup.C b/cinelerra-5.1/guicast/bcpopup.C index 60d90fa5..7df9f84e 100644 --- a/cinelerra-5.1/guicast/bcpopup.C +++ b/cinelerra-5.1/guicast/bcpopup.C @@ -24,48 +24,21 @@ 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; } diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C index e932af59..2ab104e0 100644 --- a/cinelerra-5.1/guicast/bcresources.C +++ b/cinelerra-5.1/guicast/bcresources.C @@ -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_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; itotal; ++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; itotal; ++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); } diff --git a/cinelerra-5.1/guicast/bcresources.h b/cinelerra-5.1/guicast/bcresources.h index d5c9a069..1c73f713 100644 --- a/cinelerra-5.1/guicast/bcresources.h +++ b/cinelerra-5.1/guicast/bcresources.h @@ -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); diff --git a/cinelerra-5.1/guicast/bcwindow.C b/cinelerra-5.1/guicast/bcwindow.C index 23f7f71c..6992bc9b 100644 --- a/cinelerra-5.1/guicast/bcwindow.C +++ b/cinelerra-5.1/guicast/bcwindow.C @@ -28,39 +28,17 @@ 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); } diff --git a/cinelerra-5.1/guicast/bcwindowbase.C b/cinelerra-5.1/guicast/bcwindowbase.C index 6599369e..12e6c34a 100644 --- a/cinelerra-5.1/guicast/bcwindowbase.C +++ b/cinelerra-5.1/guicast/bcwindowbase.C @@ -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; diff --git a/cinelerra-5.1/plugins/interpolate/picon_cinfinity.png b/cinelerra-5.1/plugins/interpolate/picon_cinfinity.png index f2a07fc6..74bd1330 100644 Binary files a/cinelerra-5.1/plugins/interpolate/picon_cinfinity.png and b/cinelerra-5.1/plugins/interpolate/picon_cinfinity.png differ diff --git a/cinelerra-5.1/plugins/spherecam/picon_cinfinity.png b/cinelerra-5.1/plugins/spherecam/picon_cinfinity.png index ee0b79ab..b91425aa 100644 Binary files a/cinelerra-5.1/plugins/spherecam/picon_cinfinity.png and b/cinelerra-5.1/plugins/spherecam/picon_cinfinity.png differ diff --git a/cinelerra-5.1/plugins/titler/titler.C b/cinelerra-5.1/plugins/titler/titler.C index d9680342..3e13abec 100644 --- a/cinelerra-5.1/plugins/titler/titler.C +++ b/cinelerra-5.1/plugins/titler/titler.C @@ -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&fonts = *gui->get_resources()->fontlist; + BC_Resources *resources = BC_WindowBase::get_resources(); + ArrayList&fonts = *resources->fontlist; for( int font_number=0; font_numberget_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_numberfont_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; }