From c64de14fbfdc0267696d61d7b83b8d7c0dba629a Mon Sep 17 00:00:00 2001 From: Michael Fisher Date: Sun, 12 Aug 2012 04:16:48 -0500 Subject: [PATCH] Changes to allow the gtk3 GUI to at least build. Lots off commented out blocks of code but most issues are related to simple function name changes, set/get_flags calls, anything that has to do with a Gtk::Style... Plan of attack from here is to go one-by one of each commented-out or code and update to gtk3 specs. --- src/gui/dialogs/name-chooser.cpp | 2 +- src/gui/dialogs/preferences-dialog.cpp | 4 +- src/gui/dialogs/render.cpp | 4 +- src/gui/output/gdkdisplayer.cpp | 3 ++ src/gui/output/xvdisplayer.cpp | 8 ++-- src/gui/panels/panel.cpp | 6 +-- src/gui/widgets/button-bar.cpp | 6 ++- src/gui/widgets/button-bar.hpp | 2 +- src/gui/widgets/panel-bar.cpp | 18 +++++--- src/gui/widgets/timecode-widget.cpp | 43 ++++++++++--------- src/gui/widgets/timeline-widget.cpp | 32 +++++++------- src/gui/widgets/timeline-widget.hpp | 2 +- .../widgets/timeline/timeline-arrow-tool.cpp | 4 +- .../widgets/timeline/timeline-arrow-tool.hpp | 2 +- src/gui/widgets/timeline/timeline-body.cpp | 4 +- .../timeline/timeline-header-container.cpp | 25 +++++------ .../timeline/timeline-header-widget.cpp | 28 ++++++------ .../timeline/timeline-header-widget.hpp | 2 +- .../widgets/timeline/timeline-ibeam-tool.cpp | 14 +++--- .../widgets/timeline/timeline-ibeam-tool.hpp | 2 +- src/gui/widgets/timeline/timeline-ruler.cpp | 11 +++-- src/gui/widgets/timeline/timeline-tool.cpp | 6 +-- src/gui/widgets/timeline/timeline-tool.hpp | 2 +- src/gui/widgets/timeline/timeline-track.cpp | 10 ++--- .../widgets/timeline/timeline-zoom-scale.cpp | 16 +++---- .../widgets/timeline/timeline-zoom-scale.hpp | 4 +- src/gui/widgets/video-display-widget.cpp | 2 +- src/gui/window-manager.cpp | 15 ++++--- src/gui/window-manager.hpp | 8 ++-- src/gui/workspace/workspace-window.cpp | 5 ++- 30 files changed, 158 insertions(+), 132 deletions(-) diff --git a/src/gui/dialogs/name-chooser.cpp b/src/gui/dialogs/name-chooser.cpp index c109a8ef3..ca7b63a55 100644 --- a/src/gui/dialogs/name-chooser.cpp +++ b/src/gui/dialogs/name-chooser.cpp @@ -43,7 +43,7 @@ NameChooser::NameChooser(Window &parent, cuString title, hBox.pack_start(name); hBox.set_spacing(BoxSpacing); - VBox* const v_box = get_vbox(); + Box* const v_box = get_vbox(); REQUIRE(v_box != NULL); v_box->pack_start(hBox); diff --git a/src/gui/dialogs/preferences-dialog.cpp b/src/gui/dialogs/preferences-dialog.cpp index 16efef076..c5296957f 100644 --- a/src/gui/dialogs/preferences-dialog.cpp +++ b/src/gui/dialogs/preferences-dialog.cpp @@ -34,8 +34,8 @@ namespace dialogs { PreferencesDialog::PreferencesDialog(Window &parent) : Dialog(_("Preferences"), parent, true) { - VBox *v_box = get_vbox(); - g_assert(v_box != NULL); + Box *v_box = get_vbox(); + REQUIRE(v_box != NULL); interfaceBox.pack_start(interfaceThemeCombo, PACK_SHRINK); interfaceBox.set_spacing(4); diff --git a/src/gui/dialogs/render.cpp b/src/gui/dialogs/render.cpp index 52ba96e0a..5d6951025 100644 --- a/src/gui/dialogs/render.cpp +++ b/src/gui/dialogs/render.cpp @@ -43,7 +43,7 @@ Render::Render(Window &parent) : audioFrame(_("Audio")), videoFrame(_("Video")) { - VBox *v_box = get_vbox(); + Box *v_box = get_vbox(); REQUIRE(v_box != NULL); // The Output File Row @@ -78,7 +78,7 @@ Render::Render(Window &parent) : Button *render_button = add_button(Stock::OK, RESPONSE_OK); render_button->set_label(_("_Render")); render_button->set_image(renderButtonImage); - render_button->set_flags(Gtk::CAN_DEFAULT); + //render_button->set_flags(Gtk::CAN_DEFAULT); render_button->grab_default(); show_all_children(); diff --git a/src/gui/output/gdkdisplayer.cpp b/src/gui/output/gdkdisplayer.cpp index eeddfa5c5..6eeed1ce7 100644 --- a/src/gui/output/gdkdisplayer.cpp +++ b/src/gui/output/gdkdisplayer.cpp @@ -21,6 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *****************************************************/ +#if 0 #include "gui/gtk-lumiera.hpp" #include "gui/output/gdkdisplayer.hpp" @@ -83,3 +84,5 @@ GdkDisplayer::put( const void* image ) } // namespace output } // namespace gui + +#endif diff --git a/src/gui/output/xvdisplayer.cpp b/src/gui/output/xvdisplayer.cpp index 14518428f..b0def2881 100644 --- a/src/gui/output/xvdisplayer.cpp +++ b/src/gui/output/xvdisplayer.cpp @@ -49,8 +49,8 @@ XvDisplayer::XvDisplayer( Gtk::Widget *drawing_area, int width, int height ) : Glib::RefPtr area_window = drawing_area->get_window(); - window = gdk_x11_drawable_get_xid( area_window->gobj() ); - display = gdk_x11_drawable_get_xdisplay( area_window->gobj() ); + window = GDK_WINDOW_XID (area_window->gobj()); + display = GDK_WINDOW_XDISPLAY (area_window->gobj()); unsigned int count; XvAdaptorInfo *adaptorInfo; @@ -157,10 +157,12 @@ XvDisplayer::XvDisplayer( Gtk::Widget *drawing_area, int width, int height ) : shmInfo.shmaddr = ( char * ) shmat( shmInfo.shmid, 0, 0 ); xvImage->data = shmInfo.shmaddr; shmInfo.readOnly = 0; - if ( !XShmAttach( gdk_display, &shmInfo ) ) + + if ( !XShmAttach( display, &shmInfo ) ) { gotPort = false; } + XSync( display, false ); shmctl( shmInfo.shmid, IPC_RMID, 0 ); } diff --git a/src/gui/panels/panel.cpp b/src/gui/panels/panel.cpp index 03349e3ff..ec6d01db5 100644 --- a/src/gui/panels/panel.cpp +++ b/src/gui/panels/panel.cpp @@ -61,7 +61,7 @@ Panel::Panel(workspace::PanelManager &panel_manager, gtk_widget_show (GTK_WIDGET(dockItem)); // Connect the signals - hide_panel_handler_id = g_signal_connect (GTK_OBJECT(dockItem), + hide_panel_handler_id = g_signal_connect (GTK_WIDGET(dockItem), "hide", G_CALLBACK(on_item_hidden), this); } @@ -79,7 +79,7 @@ Panel::~Panel() // Detach the signals g_signal_handler_disconnect( - GTK_OBJECT(dockItem), hide_panel_handler_id); + GTK_WIDGET(dockItem), hide_panel_handler_id); // Unref the dock item g_object_unref(dockItem); @@ -104,7 +104,7 @@ bool Panel::is_shown() const { REQUIRE(dockItem != NULL); - return GTK_WIDGET_VISIBLE((GtkWidget*)dockItem); + return gtk_widget_get_visible((GtkWidget*)dockItem); } void diff --git a/src/gui/widgets/button-bar.cpp b/src/gui/widgets/button-bar.cpp index 63e5f423d..e21cee2f4 100644 --- a/src/gui/widgets/button-bar.cpp +++ b/src/gui/widgets/button-bar.cpp @@ -35,7 +35,7 @@ namespace widgets { ButtonBar::ButtonBar() { - set_flags(Gtk::NO_WINDOW); + set_has_window(false); } void @@ -47,6 +47,7 @@ ButtonBar::append(Widget &widget) void ButtonBar::on_size_request(Gtk::Requisition* requisition) { +#if 0 REQUIRE(requisition); requisition->width = 0; @@ -67,11 +68,13 @@ ButtonBar::on_size_request(Gtk::Requisition* requisition) ENSURE(requisition->width >= 0); ENSURE(requisition->height >= 0); +#endif } void ButtonBar::on_size_allocate(Gtk::Allocation& allocation) { +#if 0 //Use the offered allocation for this container: set_allocation(allocation); @@ -108,6 +111,7 @@ ButtonBar::on_size_allocate(Gtk::Allocation& allocation) widget->set_child_visible(true); } } +#endif } } // widgets diff --git a/src/gui/widgets/button-bar.hpp b/src/gui/widgets/button-bar.hpp index 85926ba1c..b75402795 100644 --- a/src/gui/widgets/button-bar.hpp +++ b/src/gui/widgets/button-bar.hpp @@ -75,7 +75,7 @@ private: * a given area for itself. * @param allocation The area to allocate for this widget. */ - void on_size_allocate(Gtk::Allocation& allocation); + virtual void on_size_allocate(Gtk::Allocation& allocation); }; } // gui diff --git a/src/gui/widgets/panel-bar.cpp b/src/gui/widgets/panel-bar.cpp index 7aeccb160..70020c2c4 100644 --- a/src/gui/widgets/panel-bar.cpp +++ b/src/gui/widgets/panel-bar.cpp @@ -47,7 +47,7 @@ PanelBar::PanelBar(panels::Panel &owner_panel, const gchar *stock_id) : set_border_width(1); panelButton.set_relief(RELIEF_NONE); - panelButton.unset_flags(CAN_FOCUS); + panelButton.set_can_focus(false); panelButton.show(); pack_start(panelButton, PACK_SHRINK); @@ -57,10 +57,11 @@ PanelBar::PanelBar(panels::Panel &owner_panel, const gchar *stock_id) : void PanelBar::setup_panel_button() { +#if 0 REQUIRE(lockItem == NULL); Menu& menu = panelButton.get_menu(); - Menu::MenuList& list = menu.items(); + MenuList& list = menu.items(); // Add items for each type of panel for(int i = 0; i < PanelManager::get_panel_description_count(); i++) @@ -88,12 +89,13 @@ PanelBar::setup_panel_button() list.push_back( Menu_Helpers::MenuElem(_("Split _Vertical"), bind(mem_fun(*this, &PanelBar::on_split_panel), ORIENTATION_VERTICAL) ) ); +#endif } void PanelBar::on_realize() { - set_flags(Gtk::NO_WINDOW); + set_has_window(false); // Call base class: Gtk::Container::on_realize(); @@ -118,17 +120,18 @@ PanelBar::on_realize() GDK_WA_X | GDK_WA_Y); window->set_user_data(gobj()); - window->set_cursor(Gdk::Cursor(Gdk::LEFT_PTR)); + // window->set_cursor(Gdk::Cursor(Gdk::LEFT_PTR)); set_window(window); - unset_flags(Gtk::NO_WINDOW); + set_has_window(false); - unset_bg(STATE_NORMAL); + //unset_bg(STATE_NORMAL); } void PanelBar::on_size_request(Gtk::Requisition* requisition) { +#if 0 REQUIRE(requisition); requisition->width = 0; @@ -153,11 +156,13 @@ PanelBar::on_size_request(Gtk::Requisition* requisition) ENSURE(requisition->width >= 0); ENSURE(requisition->height >= 0); +#endif } void PanelBar::on_size_allocate(Gtk::Allocation& allocation) { +#if 0 struct RequestResult { Requisition requisition; @@ -239,6 +244,7 @@ PanelBar::on_size_allocate(Gtk::Allocation& allocation) total_width + border_width * 2, allocation.get_height()); } } +#endif } void diff --git a/src/gui/widgets/timecode-widget.cpp b/src/gui/widgets/timecode-widget.cpp index 300e63003..fec7bf595 100644 --- a/src/gui/widgets/timecode-widget.cpp +++ b/src/gui/widgets/timecode-widget.cpp @@ -598,6 +598,7 @@ TimeCode::field_key_release_event(GdkEventKey *ev, Field field) } switch (ev->keyval) { +#if 0 case GDK_0: case GDK_KP_0: new_char = '0'; @@ -659,7 +660,7 @@ TimeCode::field_key_release_event(GdkEventKey *ev, Field field) clock_base.grab_focus(); ChangeAborted(); /* EMIT SIGNAL */ return true; - +#endif default: return false; } @@ -759,14 +760,14 @@ TimeCode::field_key_release_event(GdkEventKey *ev, Field field) } } - +#if 0 //if user hit Enter, lose focus switch (ev->keyval) { case GDK_Return: case GDK_KP_Enter: clock_base.grab_focus(); } - +#endif return true; } @@ -779,37 +780,37 @@ TimeCode::field_focus_gain_event(GdkEventFocus*, Field field) switch (field) { case SMPTE_Hours: - hours_ebox.set_flags(Gtk::HAS_FOCUS); + //hours_ebox.set_flags(Gtk::HAS_FOCUS); hours_ebox.set_state(Gtk::STATE_ACTIVE); break; case SMPTE_Minutes: - minutes_ebox.set_flags(Gtk::HAS_FOCUS); + //minutes_ebox.set_flags(Gtk::HAS_FOCUS); minutes_ebox.set_state(Gtk::STATE_ACTIVE); break; case SMPTE_Seconds: - seconds_ebox.set_flags(Gtk::HAS_FOCUS); + //seconds_ebox.set_flags(Gtk::HAS_FOCUS); seconds_ebox.set_state(Gtk::STATE_ACTIVE); break; case SMPTE_Frames: - frames_ebox.set_flags(Gtk::HAS_FOCUS); + //frames_ebox.set_flags(Gtk::HAS_FOCUS); frames_ebox.set_state(Gtk::STATE_ACTIVE); break; case VFrames: - audio_frames_ebox.set_flags(Gtk::HAS_FOCUS); + ///audio_frames_ebox.set_flags(Gtk::HAS_FOCUS); audio_frames_ebox.set_state(Gtk::STATE_ACTIVE); break; case MS_Hours: - ms_hours_ebox.set_flags(Gtk::HAS_FOCUS); + //ms_hours_ebox.set_flags(Gtk::HAS_FOCUS); ms_hours_ebox.set_state(Gtk::STATE_ACTIVE); break; case MS_Minutes: - ms_minutes_ebox.set_flags(Gtk::HAS_FOCUS); + //ms_minutes_ebox.set_flags(Gtk::HAS_FOCUS); ms_minutes_ebox.set_state(Gtk::STATE_ACTIVE); break; case MS_Seconds: - ms_seconds_ebox.set_flags(Gtk::HAS_FOCUS); + //ms_seconds_ebox.set_flags(Gtk::HAS_FOCUS); ms_seconds_ebox.set_state(Gtk::STATE_ACTIVE); break; } @@ -823,37 +824,37 @@ TimeCode::field_focus_loss_event(GdkEventFocus*, Field field) switch (field) { case SMPTE_Hours: - hours_ebox.unset_flags(Gtk::HAS_FOCUS); + //hours_ebox.unset_flags(Gtk::HAS_FOCUS); hours_ebox.set_state(Gtk::STATE_NORMAL); break; case SMPTE_Minutes: - minutes_ebox.unset_flags(Gtk::HAS_FOCUS); + //minutes_ebox.unset_flags(Gtk::HAS_FOCUS); minutes_ebox.set_state(Gtk::STATE_NORMAL); break; case SMPTE_Seconds: - seconds_ebox.unset_flags(Gtk::HAS_FOCUS); + //seconds_ebox.unset_flags(Gtk::HAS_FOCUS); seconds_ebox.set_state(Gtk::STATE_NORMAL); break; case SMPTE_Frames: - frames_ebox.unset_flags(Gtk::HAS_FOCUS); + //frames_ebox.unset_flags(Gtk::HAS_FOCUS); frames_ebox.set_state(Gtk::STATE_NORMAL); break; case VFrames: - audio_frames_ebox.unset_flags(Gtk::HAS_FOCUS); + //audio_frames_ebox.unset_flags(Gtk::HAS_FOCUS); audio_frames_ebox.set_state(Gtk::STATE_NORMAL); break; case MS_Hours: - ms_hours_ebox.unset_flags(Gtk::HAS_FOCUS); + //ms_hours_ebox.unset_flags(Gtk::HAS_FOCUS); ms_hours_ebox.set_state(Gtk::STATE_NORMAL); break; case MS_Minutes: - ms_minutes_ebox.unset_flags(Gtk::HAS_FOCUS); + //ms_minutes_ebox.unset_flags(Gtk::HAS_FOCUS); ms_minutes_ebox.set_state(Gtk::STATE_NORMAL); break; case MS_Seconds: - ms_seconds_ebox.unset_flags(Gtk::HAS_FOCUS); + //ms_seconds_ebox.unset_flags(Gtk::HAS_FOCUS); ms_seconds_ebox.set_state(Gtk::STATE_NORMAL); break; } @@ -1249,6 +1250,7 @@ TimeCode::audio_time_from_display () const void TimeCode::build_ops_menu () { +#if 0 using namespace Menu_Helpers; ops_menu = new Menu; MenuList& ops_items = ops_menu->items(); @@ -1258,6 +1260,7 @@ TimeCode::build_ops_menu () ops_items.push_back (MenuElem ("Minutes:Seconds", bind (mem_fun(*this, &TimeCode::set_mode), MinSec))); ops_items.push_back (MenuElem ("Frames", bind (mem_fun(*this, &TimeCode::set_mode), Frames))); ops_items.push_back (MenuElem ("Off", bind (mem_fun(*this, &TimeCode::set_mode), Off))); +#endif } void @@ -1342,7 +1345,7 @@ TimeCode::set_size_request_to_display_given_text(Gtk::Widget &w, const gchar *te gint hpadding, gint vpadding) { int width, height; - w.ensure_style(); + //w.ensure_style(); get_ink_pixel_size(w.create_pango_layout(text), width, height); w.set_size_request(width + hpadding, height + vpadding); diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index 765bb3790..6fc13bb21 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -49,8 +49,8 @@ TimelineWidget::TimelineWidget(shared_ptr source_state) , headerContainer(NULL) , body(NULL) , ruler(NULL) - , horizontalAdjustment(0, 0, 0) - , verticalAdjustment(0, 0, 0) + , horizontalAdjustment(Gtk::Adjustment::create(0, 0, 0)) + , verticalAdjustment(Gtk::Adjustment::create(0, 0, 0)) , horizontalScroll(horizontalAdjustment) , verticalScroll(verticalAdjustment) , update_tracks_frozen(false) @@ -62,9 +62,9 @@ TimelineWidget::TimelineWidget(shared_ptr source_state) ruler = manage(new TimelineRuler(*this)); ENSURE(ruler != NULL); - horizontalAdjustment.signal_value_changed().connect( sigc::mem_fun( + horizontalAdjustment->signal_value_changed().connect( sigc::mem_fun( this, &TimelineWidget::on_scroll) ); - verticalAdjustment.signal_value_changed().connect( sigc::mem_fun( + verticalAdjustment->signal_value_changed().connect( sigc::mem_fun( this, &TimelineWidget::on_scroll) ); body->signal_motion_notify_event().connect( sigc::mem_fun( this, &TimelineWidget::on_motion_in_body_notify_event) ); @@ -191,7 +191,7 @@ TimelineWidget::on_scroll() { if(state) { - TimeValue newStartOffset ((gavl_time_t)horizontalAdjustment.get_value()); + TimeValue newStartOffset ((gavl_time_t)horizontalAdjustment->get_value()); state->get_view_window().set_time_offset(Time(newStartOffset)); } } @@ -215,10 +215,10 @@ TimelineWidget::on_view_window_changed() const int view_width = body->get_allocation().get_width(); - horizontalAdjustment.set_page_size( + horizontalAdjustment->set_page_size( window.get_time_scale() * view_width); - horizontalAdjustment.set_value(_raw(window.get_time_offset())); + horizontalAdjustment->set_value(_raw(window.get_time_offset())); } } @@ -410,7 +410,7 @@ TimelineWidget::update_scroll() { REQUIRE(body != NULL); const Allocation body_allocation = body->get_allocation(); - + if(state) { ///////////////////////////////////////////////TICKET #861 shoudln't that be performed by TimelineViewWindow, instead of manipulating values from the outside? @@ -419,11 +419,11 @@ TimelineWidget::update_scroll() //----- Horizontal Scroll ------// // TEST CODE - horizontalAdjustment.set_upper( 1000 * GAVL_TIME_SCALE / 200); - horizontalAdjustment.set_lower(-1000 * GAVL_TIME_SCALE / 200); + horizontalAdjustment->set_upper( 1000 * GAVL_TIME_SCALE / 200); + horizontalAdjustment->set_lower(-1000 * GAVL_TIME_SCALE / 200); // Set the page size - horizontalAdjustment.set_page_size( + horizontalAdjustment->set_page_size( window.get_time_scale() * body_allocation.get_width()); //----- Vertical Scroll -----// @@ -436,10 +436,10 @@ TimelineWidget::update_scroll() // If by resizing we're now over-scrolled, scroll back to // maximum distance - if((int)verticalAdjustment.get_value() > y_scroll_length) - verticalAdjustment.set_value(y_scroll_length); + if((int)verticalAdjustment->get_value() > y_scroll_length) + verticalAdjustment->set_value(y_scroll_length); - verticalAdjustment.set_upper(y_scroll_length); + verticalAdjustment->set_upper(y_scroll_length); // Hide the scrollbar if no scrolling is possible #if 0 @@ -456,13 +456,13 @@ TimelineWidget::update_scroll() int TimelineWidget::get_y_scroll_offset() const { - return (int)verticalAdjustment.get_value(); + return (int)verticalAdjustment->get_value(); } void TimelineWidget::set_y_scroll_offset(const int offset) { - verticalAdjustment.set_value(offset); + verticalAdjustment->set_value(offset); } bool diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index 9afe5efe8..67aebe4e7 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -268,7 +268,7 @@ protected: timeline::TimelineBody *body; timeline::TimelineRuler *ruler; - Gtk::Adjustment horizontalAdjustment, verticalAdjustment; + Glib::RefPtr horizontalAdjustment, verticalAdjustment; Gtk::HScrollbar horizontalScroll; Gtk::VScrollbar verticalScroll; diff --git a/src/gui/widgets/timeline/timeline-arrow-tool.cpp b/src/gui/widgets/timeline/timeline-arrow-tool.cpp index 8b2e0ad37..ce805dfa3 100644 --- a/src/gui/widgets/timeline/timeline-arrow-tool.cpp +++ b/src/gui/widgets/timeline/timeline-arrow-tool.cpp @@ -42,10 +42,10 @@ namespace timeline { return Arrow; } - Gdk::Cursor + Glib::RefPtr ArrowTool::get_cursor() const { - return Gdk::Cursor(Gdk::LEFT_PTR); + return Gdk::Cursor::create(Gdk::LEFT_PTR); } void diff --git a/src/gui/widgets/timeline/timeline-arrow-tool.hpp b/src/gui/widgets/timeline/timeline-arrow-tool.hpp index b390a25d5..04dcca63a 100644 --- a/src/gui/widgets/timeline/timeline-arrow-tool.hpp +++ b/src/gui/widgets/timeline/timeline-arrow-tool.hpp @@ -62,7 +62,7 @@ namespace timeline { /** * Gets the cursor to display for this tool at this moment. */ - Gdk::Cursor get_cursor() const; + Glib::RefPtr get_cursor() const; /** * The event handler for button press events. diff --git a/src/gui/widgets/timeline/timeline-body.cpp b/src/gui/widgets/timeline/timeline-body.cpp index 0092d629c..247d61e36 100644 --- a/src/gui/widgets/timeline/timeline-body.cpp +++ b/src/gui/widgets/timeline/timeline-body.cpp @@ -484,13 +484,13 @@ TimelineBody::begin_shift_drag() int TimelineBody::get_vertical_offset() const { - return (int)timelineWidget.verticalAdjustment.get_value(); + return (int)timelineWidget.verticalAdjustment->get_value(); } void TimelineBody::set_vertical_offset(int offset) { - timelineWidget.verticalAdjustment.set_value(offset); + timelineWidget.verticalAdjustment->set_value(offset); } void diff --git a/src/gui/widgets/timeline/timeline-header-container.cpp b/src/gui/widgets/timeline/timeline-header-container.cpp index 6747c3d61..9fa3d6f50 100644 --- a/src/gui/widgets/timeline/timeline-header-container.cpp +++ b/src/gui/widgets/timeline/timeline-header-container.cpp @@ -53,13 +53,13 @@ TimelineHeaderContainer::TimelineHeaderContainer( timelineWidget(timeline_widget) { // This widget will not have a window at first - set_flags(Gtk::NO_WINDOW); + //set_flags(Gtk::NO_WINDOW); set_redraw_on_allocate(false); // Connect to the timeline widget's vertical scroll event, // so that we get notified when the view shifts - timelineWidget.verticalAdjustment.signal_value_changed().connect( + timelineWidget.verticalAdjustment->signal_value_changed().connect( sigc::mem_fun(this, &TimelineHeaderContainer::on_scroll) ); // Connect to the timeline widget's hover event, @@ -67,12 +67,13 @@ TimelineHeaderContainer::TimelineHeaderContainer( timelineWidget.hovering_track_changed_signal().connect( sigc::mem_fun(this, &TimelineHeaderContainer::on_hovering_track_changed) ); - +#if 0 // Create the context menu Menu::MenuList& menu_list = contextMenu.items(); menu_list.push_back( Menu_Helpers::MenuElem(_("_Add Track"), sigc::mem_fun(timelineWidget, &TimelineWidget::on_add_track_command) ) ); +#endif } void @@ -107,7 +108,7 @@ TimelineHeaderContainer::clear_headers() void TimelineHeaderContainer::on_realize() { - set_flags(Gtk::NO_WINDOW); + //set_flags(Gtk::NO_WINDOW); // Call base class: Gtk::Container::on_realize(); @@ -130,12 +131,12 @@ TimelineHeaderContainer::on_realize() gdkWindow = Gdk::Window::create(get_window(), &attributes, GDK_WA_X | GDK_WA_Y); - unset_flags(Gtk::NO_WINDOW); + //unset_flags(Gtk::NO_WINDOW); set_window(gdkWindow); // Unset the background so as to make the colour match the parent // window - unset_bg(STATE_NORMAL); + //unset_bg(STATE_NORMAL); // Make the widget receive expose events gdkWindow->set_user_data(gobj()); @@ -269,8 +270,8 @@ TimelineHeaderContainer::on_size_request (Requisition* requisition) { Widget &widget = lookup_timeline_track(*iterator)->get_header_widget(); - if(widget.is_visible()) - widget.size_request(); + if(widget.get_visible()) + { /* widget.size_request(); */ } } } @@ -402,14 +403,14 @@ TimelineHeaderContainer::layout_headers() // Apply the allocation to the header widget.size_allocate (*header_rect); - if(!widget.is_visible()) + if(!widget.get_visible()) { widget.show(); headers_shown = true; } } else // No header rect, so the track must be hidden - if(widget.is_visible()) + if(widget.get_visible()) widget.hide(); } @@ -448,7 +449,7 @@ TimelineHeaderContainer::begin_drag() // Set the cursor to a hand REQUIRE(gdkWindow); - gdkWindow->set_cursor(Gdk::Cursor(Gdk::FLEUR)); + //gdkWindow->set_cursor(Gdk::Cursor(Gdk::FLEUR)); } void @@ -465,7 +466,7 @@ TimelineHeaderContainer::end_drag(bool apply) // Reset the arrow as a cursor REQUIRE(gdkWindow); - gdkWindow->set_cursor(Gdk::Cursor(Gdk::LEFT_PTR)); + //gdkWindow->set_cursor(Gdk::Cursor(Gdk::LEFT_PTR)); } void diff --git a/src/gui/widgets/timeline/timeline-header-widget.cpp b/src/gui/widgets/timeline/timeline-header-widget.cpp index c0f3514db..6b297a356 100644 --- a/src/gui/widgets/timeline/timeline-header-widget.cpp +++ b/src/gui/widgets/timeline/timeline-header-widget.cpp @@ -1,5 +1,4 @@ /* - timeline-header-widget.cpp - Implementation of the timeline header widget Copyright (C) Lumiera.org @@ -47,7 +46,7 @@ TimelineHeaderWidget::TimelineHeaderWidget( margin(-1), expand_button_size(12) { - set_flags(Gtk::NO_WINDOW); + //set_flags(Gtk::NO_WINDOW); set_redraw_on_allocate(false); // Install style properties @@ -60,7 +59,7 @@ TimelineHeaderWidget::TimelineHeaderWidget( void TimelineHeaderWidget::on_realize() { - set_flags(Gtk::NO_WINDOW); + //set_flags(Gtk::NO_WINDOW); Container::on_realize(); @@ -86,12 +85,12 @@ TimelineHeaderWidget::on_realize() gdkWindow = Gdk::Window::create(get_window(), &attributes, GDK_WA_X | GDK_WA_Y); - unset_flags(Gtk::NO_WINDOW); + //unset_flags(Gtk::NO_WINDOW); set_window(gdkWindow); // Unset the background so as to make the colour match the parent // window - unset_bg(STATE_NORMAL); + //unset_bg(STATE_NORMAL); // Make the widget receive expose events gdkWindow->set_user_data(gobj()); @@ -120,10 +119,10 @@ TimelineHeaderWidget::on_size_request(Requisition* requisition) REQUIRE(requisition); Requisition child_requisition = {0, 0}; - - if(widget && widget->is_visible()) +#if 0 + if(widget && widget->get_visible()) child_requisition = widget->size_request(); - +#endif requisition->width = child_requisition.width, requisition->height = child_requisition.height; @@ -151,13 +150,14 @@ TimelineHeaderWidget::on_size_allocate(Gtk::Allocation& allocation) max(allocation.get_width() - expand_button_size - margin * 2, 0), allocation.get_height() - margin*2); - if(widget && widget->is_visible()) + if(widget && widget->get_visible()) widget->size_allocate(child_allocation); } bool TimelineHeaderWidget::on_expose_event(GdkEventExpose *event) -{ +{ +#if 0 Glib::RefPtr