change popupmenu behaviour, few minor fixups
authorGood Guy <good1.2guy@gmail.com>
Wed, 22 Jun 2016 00:43:48 +0000 (18:43 -0600)
committerGood Guy <good1.2guy@gmail.com>
Wed, 22 Jun 2016 00:43:48 +0000 (18:43 -0600)
cinelerra-5.1/cinelerra/Makefile
cinelerra-5.1/cinelerra/awindowgui.C
cinelerra-5.1/cinelerra/awindowgui.h
cinelerra-5.1/cinelerra/canvas.C
cinelerra-5.1/cinelerra/canvas.h
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/cinelerra/ffmpeg.C
cinelerra-5.1/cinelerra/recordmonitor.C
cinelerra-5.1/guicast/bcpopupmenu.C
cinelerra-5.1/guicast/bcpopupmenu.h

index 51820d706180dffd4a46edd7a95e18e3e2beee91..cb0c1d65532ad7f57e20ce942a6d3c1559348374 100644 (file)
@@ -409,7 +409,7 @@ $(OUTPUT): $(OBJS) $(DCRAW) $(FILEEXR) $(FILEFLAC) $(LIBRARIES)
        $(LINKER) `cat $(OBJDIR)/objs`
        $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(OUTPUT) $(OUTPUT_G))
        $(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
-       ln -f -s $(OUTPUT) ci
+       ln -f -s ../bin/$(WANT_CIN) ci
 
 $(CUTADS):     $(CUTOBJS) $(CUTLIBS)
        @echo g++ -o $@ $(CUTOBJS)
index 6acc2c512baecff7baf99f6b0cf83bd4dbb82509..a6a1c1ce9ed9f82a964c34fd1bbef5ca4e06cecd 100644 (file)
@@ -684,38 +684,12 @@ int AWindowGUI::translation_event()
 
 void AWindowGUI::reposition_objects()
 {
-       int wmax = mwindow->session->awindow_w-mwindow->theme->adivider_w;
-       int x = mwindow->theme->afolders_x;
-       int w = mwindow->theme->afolders_w;
-       if (w > wmax)
-               w = wmax;
-       if (w <= 0)
-               w = 1;
-       folder_list->reposition_window(x, mwindow->theme->afolders_y,
-               w, mwindow->theme->afolders_h);
-       x = mwindow->theme->adivider_x;
-       if (x > wmax)
-               x = wmax;
-       if (x < 0)
-               x = 0;
-       divider->reposition_window(x,
-               mwindow->theme->adivider_y,
-               mwindow->theme->adivider_w,
-               mwindow->theme->adivider_h);
-       int x2 = mwindow->theme->alist_x;
-       if (x2 < x+mwindow->theme->adivider_w)
-               x2 = x+mwindow->theme->adivider_w;
-       w = mwindow->theme->alist_w;
-       if (w > wmax)
-               w = wmax;
-       if (w <= 0)
-               w = 1;
-       asset_list->reposition_window(x2, mwindow->theme->alist_y,
-               w, mwindow->theme->alist_h);
-       mwindow->theme->get_awindow_sizes(this);
+       divider->reposition_window(
+               mwindow->theme->adivider_x, mwindow->theme->adivider_y,
+               mwindow->theme->adivider_w, mwindow->theme->adivider_h);
        asset_list->reposition_window(
                mwindow->theme->alist_x, mwindow->theme->alist_y,
-               mwindow->theme->alist_w, mwindow->theme->alist_h);
+               mwindow->theme->alist_w, mwindow->theme->alist_h);
        divider->reposition_window(
                mwindow->theme->adivider_x, mwindow->theme->adivider_y,
                mwindow->theme->adivider_w, mwindow->theme->adivider_h);
@@ -908,11 +882,10 @@ int AWindowGUI::create_custom_xatoms()
 }
 int AWindowGUI::recieve_custom_xatoms(xatom_event *event)
 {
-       if (event->message_type == UpdateAssetsXAtom)
-       {
+       if( event->message_type == UpdateAssetsXAtom ) {
                update_assets();
                return 1;
-       } else
+       }
        return 0;
 }
 
@@ -1364,6 +1337,7 @@ void AWindowGUI::update_assets()
                asset_list->get_yposition(),
                -1,
                0);
+       asset_list->center_selection();
 //printf("AWindowGUI::update_assets 7\n");
 
        flush();
@@ -1461,7 +1435,12 @@ int AWindowDivider::cursor_motion_event()
 {
        if(mwindow->session->current_operation == DRAG_PARTITION)
        {
-               mwindow->session->afolders_w = gui->get_relative_cursor_x();
+               int wmin = 25;
+               int wmax = mwindow->session->awindow_w - mwindow->theme->adivider_w - wmin;
+               int fw = gui->get_relative_cursor_x();
+               if( fw > wmax ) fw = wmax;
+               if( fw < wmin ) fw = wmin;
+               mwindow->session->afolders_w = fw;
                mwindow->theme->get_awindow_sizes(gui);
                gui->reposition_objects();
                gui->flush();
@@ -1517,12 +1496,6 @@ int AWindowFolders::selection_changed()
        {
                gui->stop_vicon_drawing();
 
-               if(get_button_down() && get_buttonpress() == 3)
-               {
-                       gui->folderlist_menu->update_titles();
-                       gui->folderlist_menu->activate_menu();
-               }
-
                strcpy(mwindow->edl->session->current_folder, picon->get_text());
 //printf("AWindowFolders::selection_changed 1\n");
                gui->asset_list->draw_background();
@@ -1535,21 +1508,22 @@ int AWindowFolders::selection_changed()
 
 int AWindowFolders::button_press_event()
 {
-       int result = 0;
-
-       result = BC_ListBox::button_press_event();
+       if( get_buttonpress() == 3 && is_event_win() && cursor_inside() )
+               return 0;
+       return BC_ListBox::button_press_event();
+}
 
-       if(!result)
+int AWindowFolders::button_release_event()
+{
+       int result = 0;
+       if(get_buttonpress() == 3 && is_event_win() && cursor_inside())
        {
-               if(get_buttonpress() == 3 && is_event_win() && cursor_inside())
-               {
-                       gui->folderlist_menu->update_titles();
-                       gui->folderlist_menu->activate_menu();
-                       result = 1;
-               }
+               gui->folderlist_menu->update_titles();
+               gui->folderlist_menu->activate_menu();
+               result = 1;
        }
-
-
+       else
+               result = BC_ListBox::button_release_event();
        return result;
 }
 
@@ -1558,7 +1532,6 @@ int AWindowFolders::button_press_event()
 
 
 
-
 AWindowAssets::AWindowAssets(MWindow *mwindow, AWindowGUI *gui, int x, int y, int w, int h)
  : BC_ListBox(x,
                y,
@@ -1587,19 +1560,35 @@ AWindowAssets::~AWindowAssets()
 
 int AWindowAssets::button_press_event()
 {
-       int result = 0;
-
-       result = BC_ListBox::button_press_event();
+       if( get_buttonpress() == 3 && is_event_win() && cursor_inside() )
+               return 0;
+       return BC_ListBox::button_press_event();
+}
 
-       if(!result && get_buttonpress() == 3 && is_event_win() && cursor_inside())
-       {
-               BC_ListBox::deactivate_selection();
-               gui->assetlist_menu->update_titles();
-               gui->assetlist_menu->activate_menu();
+int AWindowAssets::button_release_event()
+{
+       int result = 0;
+       if(get_buttonpress() == 3 && is_event_win() && cursor_inside()) {
+               if( !strcasecmp(mwindow->edl->session->current_folder, AEFFECT_FOLDER) ||
+                   !strcasecmp(mwindow->edl->session->current_folder, VEFFECT_FOLDER) ||
+                   !strcasecmp(mwindow->edl->session->current_folder, ATRANSITION_FOLDER) ||
+                   !strcasecmp(mwindow->edl->session->current_folder, VTRANSITION_FOLDER)) {
+                       BC_ListBox::deactivate_selection();
+                       gui->assetlist_menu->update_titles();
+                       gui->assetlist_menu->activate_menu();
+               }
+                else if (!strcasecmp(mwindow->edl->session->current_folder, LABEL_FOLDER)) {
+                       gui->label_menu->update();
+                       gui->label_menu->activate_menu();
+               }
+               else {
+                       gui->asset_menu->update();
+                       gui->asset_menu->activate_menu();
+               }
                result = 1;
        }
-
-
+       else
+               result = BC_ListBox::button_release_event();
        return result;
 }
 
@@ -1609,24 +1598,11 @@ int AWindowAssets::handle_event()
 //printf("AWindowAssets::handle_event 1 %d %d\n", get_buttonpress(), get_selection(0, 0));
        if(get_selection(0, 0))
        {
-               if(!strcasecmp(mwindow->edl->session->current_folder, AEFFECT_FOLDER))
-               {
-               }
-               else
-               if(!strcasecmp(mwindow->edl->session->current_folder, VEFFECT_FOLDER))
-               {
-               }
-               else
-               if(!strcasecmp(mwindow->edl->session->current_folder, ATRANSITION_FOLDER))
-               {
-               }
-               else
-               if(!strcasecmp(mwindow->edl->session->current_folder, VTRANSITION_FOLDER))
-               {
-               }
-               else
-               if(mwindow->vwindows.size())
-               {
+               if(!strcasecmp(mwindow->edl->session->current_folder, AEFFECT_FOLDER)) {}
+               else if(!strcasecmp(mwindow->edl->session->current_folder, VEFFECT_FOLDER)) {}
+               else if(!strcasecmp(mwindow->edl->session->current_folder, ATRANSITION_FOLDER)) {}
+               else if(!strcasecmp(mwindow->edl->session->current_folder, VTRANSITION_FOLDER)) {}
+               else if(mwindow->vwindows.size()) {
 //printf("AWindowAssets::handle_event 2 %d %d\n", get_buttonpress(), get_selection(0, 0));
                        mwindow->vwindows.get(DEFAULT_VWINDOW)->gui->lock_window("AWindowAssets::handle_event");
 
@@ -1663,18 +1639,6 @@ int AWindowAssets::selection_changed()
                        if(((AssetPicon*)get_selection(0, 0))->label)
                                gui->label_menu->activate_menu();
                }
-               else
-               {
-                       if(((AssetPicon*)get_selection(0, 0))->indexable)
-                               gui->asset_menu->update();
-                       else
-                       if(((AssetPicon*)get_selection(0, 0))->edl)
-                               gui->asset_menu->update();
-
-
-
-                       gui->asset_menu->activate_menu();
-               }
 
                BC_ListBox::deactivate_selection();
                return 1;
@@ -2024,6 +1988,11 @@ void LabelPopup::create_objects()
        add_item(editlabel = new LabelPopupEdit(mwindow, this));
 }
 
+int LabelPopup::update()
+{
+       gui->collect_assets();
+       return 0;
+}
 
 
 
index a1d2b5e5ea6355699852327b84139ca715810493..79b41878cb0bfbc6bc2ffdf64d7f1161791dddf5 100644 (file)
@@ -269,6 +269,7 @@ public:
        int drag_motion_event();
        int drag_stop_event();
        int button_press_event();
+       int button_release_event();
        int column_resize_event();
        int focus_in_event();
        int focus_out_event();
@@ -299,6 +300,7 @@ public:
 
        int selection_changed();
        int button_press_event();
+       int button_release_event();
 
        MWindow *mwindow;
        AWindowGUI *gui;
index 01653fc3b5163860fa8c1122f91a1a24910aeb7e..6f057d6ee1d29f0d491b5742082c33409cffc341 100644 (file)
@@ -662,7 +662,7 @@ void Canvas::create_objects(EDL *edl)
 
 }
 
-int Canvas::button_press_event()
+int Canvas::button_release_event()
 {
        int result = 0;
 
index 27336588f67f166125b6a13d64dc86056837da22..5230c2281f0e1ffa501984a659977f956c77774a 100644 (file)
@@ -93,8 +93,8 @@ public:
        virtual void zoom_auto() {};
        virtual int cursor_leave_event() { return 0; };
        virtual int cursor_enter_event() { return 0; };
-       virtual int button_release_event() { return 0; };
-       virtual int button_press_event();
+       virtual int button_release_event();
+       virtual int button_press_event() { return 0; };
        virtual int cursor_motion_event() { return 0; };
        virtual void draw_overlays() { };
        virtual void toggle_controls() { } ;
index 172ee6e3cbbc88c115aa80fdb8887d4b964009da..aa61b3e1ea0bbfa36500d2ba0616c0c49e3ba873 100644 (file)
@@ -3342,7 +3342,9 @@ int CWindowCanvas::button_release_event()
                        gui->mask_keyframe = 0;
                        mwindow->undo->update_undo_after(_("mask"), LOAD_AUTOMATION);
                        break;
-
+               case CWINDOW_NONE:
+                       result = Canvas::button_release_event();
+                       break;
        }
 
        gui->current_operation = CWINDOW_NONE;
index 8673e6f39fb10eb4aba5e3a76456bf2bdd83b3d0..fb5ef21016313563b27fd5f0fd5e6f6a550121ad 100644 (file)
@@ -831,6 +831,9 @@ AVPixelFormat FFVideoConvert::color_model_to_pix_fmt(int color_model)
        case BC_RGBA8888:       return AV_PIX_FMT_RGBA;
        case BC_BGR8888:        return AV_PIX_FMT_BGR0;
        case BC_BGR888:         return AV_PIX_FMT_BGR24;
+       case BC_ARGB8888:       return AV_PIX_FMT_ARGB;
+       case BC_ABGR8888:       return AV_PIX_FMT_ABGR;
+       case BC_RGB8:           return AV_PIX_FMT_RGB8;
        case BC_YUV420P:        return AV_PIX_FMT_YUV420P;
        case BC_YUV422P:        return AV_PIX_FMT_YUV422P;
        case BC_YUV444P:        return AV_PIX_FMT_YUV444P;
@@ -852,6 +855,9 @@ int FFVideoConvert::pix_fmt_to_color_model(AVPixelFormat pix_fmt)
        case AV_PIX_FMT_RGBA:           return BC_RGBA8888;
        case AV_PIX_FMT_BGR0:           return BC_BGR8888;
        case AV_PIX_FMT_BGR24:          return BC_BGR888;
+       case AV_PIX_FMT_ARGB:           return BC_ARGB8888;
+       case AV_PIX_FMT_ABGR:           return BC_ABGR8888;
+       case AV_PIX_FMT_RGB8:           return BC_RGB8;
        case AV_PIX_FMT_YUV420P:        return BC_YUV420P;
        case AV_PIX_FMT_YUV422P:        return BC_YUV422P;
        case AV_PIX_FMT_YUV444P:        return BC_YUV444P;
index 1ab31ffb4a85c0d8076172b83e97ca0660c070a5..dd65f6c3d189eb9849b90078b23c1bd5c98ab129 100644 (file)
@@ -437,16 +437,6 @@ int RecordMonitorGUI::button_press_event()
 {
        if(mwindow->session->rwindow_fullscreen && canvas && canvas->get_canvas())
                return canvas->button_press_event_base(canvas->get_canvas());
-
-       if( get_buttonpress() == 2 ) {
-               return 0;
-       }
-       else
-// Right button
-       if( get_buttonpress() == 3 ) {
-               monitor_menu->activate_menu();
-               return 1;
-       }
        return 0;
 }
 
@@ -466,6 +456,10 @@ int RecordMonitorGUI::cursor_enter_event()
 
 int RecordMonitorGUI::button_release_event()
 {
+       if( get_buttonpress() == 3 && cursor_inside() ) {
+               monitor_menu->activate_menu();
+               return 1;
+       }
        if( canvas && canvas->get_canvas() )
                return canvas->button_release_event();
        return 0;
@@ -862,6 +856,9 @@ RecordMonitorFullsize::RecordMonitorFullsize(MWindow *mwindow,
 }
 int RecordMonitorFullsize::handle_event()
 {
+       Record *record = window->record;
+       record->video_zoom = 1.0;
+       record->record_gui->set_translation(record->video_x, record->video_y, record->video_zoom);
        return 1;
 }
 
index d0bf3b3ae0dc7fff778051ac7890167b7becc72c..bfcca0693939b42fa0497a4f315979740c025eb7 100644 (file)
@@ -301,7 +301,6 @@ int BC_PopupMenu::activate_menu()
                        button_press_y = top_level->cursor_y;
                }
 
-               button_releases = 0;
                if(use_title)
                {
                        Window tempwin;
@@ -412,8 +411,6 @@ int BC_PopupMenu::button_release_event()
 // try the title
        int result = 0;
 
-       button_releases++;
-
        if(is_event_win() && use_title)
        {
                hide_tooltip();
@@ -427,75 +424,16 @@ int BC_PopupMenu::button_release_event()
        if( !use_title && status == BUTTON_DN ) {
                result = 1;
        }
-       else if(popup_down)
-       {
+       else if(popup_down) {
 // Menu is down so dispatch to popup.
                result = menu_popup->dispatch_button_release();
        }
-
-       if(popup_down && button_releases >= 2)
-       {
+// released outside popup
+       if( !result && popup_down ) {
                deactivate();
-       }
-
-       if(!result && use_title && cursor_inside() && is_event_win())
-       {
-               hide_tooltip();
-               result = 1;
-       }
-       else
-       if(!result && !use_title && popup_down && button_releases < 2)
-       {
-               result = 1;
-       }
-
-
-       if(!result && popup_down)
-       {
-// Button was released outside any menu.
-               deactivate();
-               result = 1;
-       }
-
-       return result;
-
-
-
-
-
-
-
-
-
-
-       if(popup_down)
-       {
-// Menu is down so dispatch to popup.
-               result = menu_popup->dispatch_button_release();
-       }
-
-       if(!result && use_title && cursor_inside() && top_level->event_win == win)
-       {
-// Inside title
-               if(button_releases >= 2)
-               {
-                       highlighted = 1;
-                       deactivate();
-               }
-               result = 1;
-       }
-       else
-       if(!result && !use_title && button_releases < 2)
-       {
-// First release outside a floating menu
-// Released outside a fictitious title area
-//             if(top_level->cursor_x < button_press_x - 5 ||
-//                     top_level->cursor_y < button_press_y - 5 ||
-//                     top_level->cursor_x > button_press_x + 5 ||
-//                     top_level->cursor_y > button_press_y + 5)
-                       deactivate();
                result = 1;
        }
+       hide_tooltip();
 
        return result;
 }
index 88af58957b29115c5ef13a10b6f620021509e137..182ced28b4871bdb6cdd1e14fbf7a356132df380 100644 (file)
@@ -95,7 +95,6 @@ private:
        int highlighted;
        int popup_down;
        int use_title;
-       int button_releases;
        BC_MenuPopup *menu_popup;
 // Remember cursor position when no title
        int button_press_x, button_press_y;