diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index e056225fa..fe4a1543f 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -33,47 +33,55 @@ AM_CFLAGS =\ bin_PROGRAMS += lumigui -lumigui_SOURCES = \ - $(lumigui_srcdir)/gtk-lumiera.cpp \ - $(lumigui_srcdir)/gtk-lumiera.hpp \ - $(lumigui_srcdir)/window-manager.cpp \ - $(lumigui_srcdir)/window-manager.hpp \ - $(lumigui_srcdir)/workspace/actions.cpp \ - $(lumigui_srcdir)/workspace/actions.hpp \ - $(lumigui_srcdir)/workspace/workspace-window.cpp \ - $(lumigui_srcdir)/workspace/workspace-window.hpp \ - $(lumigui_srcdir)/dialogs/render.cpp \ - $(lumigui_srcdir)/dialogs/render.hpp \ - $(lumigui_srcdir)/dialogs/preferences-dialog.cpp \ - $(lumigui_srcdir)/dialogs/preferences-dialog.hpp \ - $(lumigui_srcdir)/panels/panel.cpp \ - $(lumigui_srcdir)/panels/panel.hpp \ - $(lumigui_srcdir)/panels/timeline-panel.cpp \ - $(lumigui_srcdir)/panels/timeline-panel.hpp \ - $(lumigui_srcdir)/panels/viewer-panel.cpp \ - $(lumigui_srcdir)/panels/viewer-panel.hpp \ - $(lumigui_srcdir)/panels/assets-panel.cpp \ - $(lumigui_srcdir)/panels/asset-panels.hpp \ - $(lumigui_srcdir)/widgets/video-display-widget.cpp \ - $(lumigui_srcdir)/widgets/video-display-widget.hpp \ - $(lumigui_srcdir)/widgets/timeline-widget.cpp \ - $(lumigui_srcdir)/widgets/timeline-widget.hpp \ - $(lumigui_srcdir)/model/project.cpp \ - $(lumigui_srcdir)/model/project.hpp \ - $(lumigui_srcdir)/output/displayer.cpp \ - $(lumigui_srcdir)/output/displayer.hpp \ - $(lumigui_srcdir)/output/gdkdisplayer.cpp \ - $(lumigui_srcdir)/output/gdkdisplayer.hpp \ - $(lumigui_srcdir)/output/xvdisplayer.cpp \ +lumigui_SOURCES = \ + $(lumigui_srcdir)/gtk-lumiera.cpp \ + $(lumigui_srcdir)/gtk-lumiera.hpp \ + $(lumigui_srcdir)/window-manager.cpp \ + $(lumigui_srcdir)/window-manager.hpp \ + $(lumigui_srcdir)/workspace/actions.cpp \ + $(lumigui_srcdir)/workspace/actions.hpp \ + $(lumigui_srcdir)/workspace/workspace-window.cpp \ + $(lumigui_srcdir)/workspace/workspace-window.hpp \ + $(lumigui_srcdir)/dialogs/render.cpp \ + $(lumigui_srcdir)/dialogs/render.hpp \ + $(lumigui_srcdir)/dialogs/preferences-dialog.cpp \ + $(lumigui_srcdir)/dialogs/preferences-dialog.hpp \ + $(lumigui_srcdir)/panels/panel.cpp \ + $(lumigui_srcdir)/panels/panel.hpp \ + $(lumigui_srcdir)/panels/timeline-panel.cpp \ + $(lumigui_srcdir)/panels/timeline-panel.hpp \ + $(lumigui_srcdir)/panels/viewer-panel.cpp \ + $(lumigui_srcdir)/panels/viewer-panel.hpp \ + $(lumigui_srcdir)/panels/assets-panel.cpp \ + $(lumigui_srcdir)/panels/asset-panels.hpp \ + $(lumigui_srcdir)/widgets/video-display-widget.cpp \ + $(lumigui_srcdir)/widgets/video-display-widget.hpp \ + $(lumigui_srcdir)/widgets/timeline-widget.cpp \ + $(lumigui_srcdir)/widgets/timeline-widget.hpp \ + $(lumigui_srcdir)/widgets/timeline/header-container.cpp \ + $(lumigui_srcdir)/widgets/timeline/header-container.hpp \ + $(lumigui_srcdir)/widgets/timeline/track.cpp \ + $(lumigui_srcdir)/widgets/timeline/track.hpp \ + $(lumigui_srcdir)/widgets/timeline/video-track.cpp \ + $(lumigui_srcdir)/widgets/timeline/video-track.hpp \ + $(lumigui_srcdir)/widgets/timeline/timeline-body.cpp \ + $(lumigui_srcdir)/widgets/timeline/timeline-body.hpp \ + $(lumigui_srcdir)/model/project.cpp \ + $(lumigui_srcdir)/model/project.hpp \ + $(lumigui_srcdir)/output/displayer.cpp \ + $(lumigui_srcdir)/output/displayer.hpp \ + $(lumigui_srcdir)/output/gdkdisplayer.cpp \ + $(lumigui_srcdir)/output/gdkdisplayer.hpp \ + $(lumigui_srcdir)/output/xvdisplayer.cpp \ $(lumigui_srcdir)/output/xvdisplayer.hpp lumigui_LDFLAGS = lumigui_LDADD = $(GTK_LUMIERA_LIBS) -lumigui_DEPENDENCIES = \ - $(top_builddir)/lumiera_ui.rc \ - $(top_builddir)/assets-panel.png \ - $(top_builddir)/timeline-panel.png \ +lumigui_DEPENDENCIES = \ + $(top_builddir)/lumiera_ui.rc \ + $(top_builddir)/assets-panel.png \ + $(top_builddir)/timeline-panel.png \ $(top_builddir)/viewer-panel.png $(top_builddir)/lumiera_ui.rc: diff --git a/src/gui/lumiera_ui.rc b/src/gui/lumiera_ui.rc index d87322014..b2d951ae1 100644 --- a/src/gui/lumiera_ui.rc +++ b/src/gui/lumiera_ui.rc @@ -1,86 +1,25 @@ # -# This is the GTK style file for Ardour +# This is the GTK style file for Lumiera # # -style "very_small_text" -{ - font_name = "sans 7" -} - -style "small_text" -{ - font_name = "sans 8" -} - -style "small_bold_text" -{ - font_name = "sans bold 8" -} - -style "medium_bold_text" -{ - font_name = "sans bold 8" -} +#---------- Styles for Standard Widgets ----------# style "medium_text" { - font_name = "sans 8" + font_name = "sans bold 10" } - -style "red_medium_text" = "medium_text" -{ - fg[NORMAL] = { 1.0, 0, 0 } - fg[ACTIVE] = { 1.0, 0, 0 } - fg[SELECTED] = { 1.0, 0, 0 } -} - - -style "large_text" + +style "medium_bold_entry" = "medium_text" { - font_name = "sans 18" -} - -style "larger_bold_text" -{ - font_name = "sans bold 14" -} - -style "plugin_name_text" -{ - font_name = "sans bold 25" - fg[NORMAL] = { 0.80, 0.80, 0.80 } -} - -style "plugin_maker_text" -{ - font_name = "sans bold 14" - fg[NORMAL] = { 0.80, 0.80, 0.80 } -} - -style "automation_track_name" -{ - font_name = "sans italic 8" -} - -style "first_action_message" -{ - font_name = "sans medium 34" -} - -style "verbose_canvas_cursor" -{ - font_name = "sans bold 24" -} - -style "marker_text" -{ - font_name = "sans 8" -} - -style "time_axis_view_item_name" -{ - font_name = "sans 9" + fg[NORMAL] = { 0.70, 0.70, 0.70 } + fg[ACTIVE] = { 0.70, 0.70, 0.70 } + + bg[NORMAL] = { 0.35, 0.35, 0.40 } + + base[NORMAL] = { 0, 0, 0 } + base[ACTIVE] = { 0, 0, 0 } + base[SELECTED] = { 0, 0, 0 } } style "default_base" = "medium_text" @@ -120,37 +59,15 @@ style "default_base" = "medium_text" engine "clearlooks" { menubarstyle = 2 # 0 = flat, 1 = sunken, 2 = flat gradient - menuitemstyle = 1 # 0 = flat, 1 = 3d-ish (gradient), 2 = 3d-ish (button) - listviewitemstyle = 1 # 0 = flat, 1 = 3d-ish (gradient) - progressbarstyle = 1 # 0 = candy bar, 1 = fancy candy bar, 2 = flat +# menuitemstyle = 1 # 0 = flat, 1 = 3d-ish (gradient), 2 = 3d-ish (button) +# listviewitemstyle = 1 # 0 = flat, 1 = 3d-ish (gradient) +# progressbarstyle = 1 # 0 = candy bar, 1 = fancy candy bar, 2 = flat } } -style "base_frame" -{ - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[NORMAL] = { 0.35, 0.35, 0.40 } -} - -style "transport_base" = "medium_bold_text" -{ - bg[NORMAL] = { 0.10, 0.10, 0.10 } - bg[ACTIVE] = { 0, 0, 0 } - bg[PRELIGHT] = { 0, 0, 0 } - bg[INSENSITIVE] = { 0, 0, 0 } - bg[SELECTED] = { 0, 0, 0 } -} - -style "black_mackie_menu_bar" -{ - font_name = "sans bold 9" - fg[NORMAL] = { 1.0, 1.0, 1.0 } - bg[NORMAL] = { 0, 0, 0 } -} - style "default_buttons_menus" { - font_name = "sans 8" + font_name = "sans 10" fg[ACTIVE] = { 1.0, 1.0, 1.0 } bg[NORMAL] = { 0.30, 0.30, 0.35 } @@ -160,913 +77,23 @@ style "default_buttons_menus" bg[SELECTED] = { 0.15, 0.15, 0.20 } } -style "very_small_button" = "default_buttons_menus" -{ - font_name = "sans 7" - ythickness = 0 - xthickness = 0 -} - -style "small_button" = "default_buttons_menus" -{ -} - -style "very_small_red_active_and_selected_button" = "very_small_button" -{ - bg[ACTIVE] = { 1.0, 0, 0} - bg[SELECTED] = { 1.0, 0, 0} -} - -style "small_red_active_and_selected_button" = "small_button" -{ - fg[ACTIVE] = { 0, 0, 0 } - bg[ACTIVE] = { 1.0, 0, 0} - bg[SELECTED] = { 1.0, 0, 0} -} - -style "gain_fader" -{ - bg[NORMAL] = { 0.269, 0.269, 0.300} - bg[ACTIVE] = { 0.152, 0.152, 0.168 } -} - - -style "track_rec_enable_button" = "small_button" -{ -} - -style "track_rec_enable_button_active" = "small_button" -{ - fg[SELECTED] = { 0.0, 0.0, 0.0 } - fg[ACTIVE] = { 0.0, 0.0, 0.0 } - fg[PRELIGHT] = { 0.0, 0.0, 0.0 } - fg[NORMAL] = { 0.0, 0.0, 0.0 } - - bg[NORMAL] = { 1.0, 0.0, 0.0 } - bg[ACTIVE] = { 1.0, 0.0, 0.0 } - bg[SELECTED] = { 1.0, 0.0, 0.0 } - bg[PRELIGHT] = { 1.0, 0.0, 0.0 } -} - -style "track_rec_enable_button_alternate" = "small_button" -{ - fg[SELECTED] = { 0.0, 0.0, 0.0 } - fg[ACTIVE] = { 0.0, 0.0, 0.0 } - fg[PRELIGHT] = { 0.0, 0.0, 0.0 } - fg[NORMAL] = { 0.0, 0.0, 0.0 } - - bg[NORMAL] = { 0.91, 0.68, 0.68} - bg[ACTIVE] = { 0.91, 0.68, 0.68} - bg[SELECTED] = { 0.91, 0.68, 0.68} - bg[PRELIGHT] = { 0.91, 0.68, 0.68} -} - -style "mixer_track_rec_enable_button" = "track_rec_enable_button" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "mixer_track_rec_enable_button_alternate" = "track_rec_enable_button_alternate" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "mixer_track_rec_enable_button_active" = "track_rec_enable_button_active" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "solo_button" = "small_button" -{ -} - -style "solo_button_alternate" = "small_button" -{ - bg[NORMAL] = { 0.19, 0.97, 0.69 } # solo-safe - bg[ACTIVE] = { 0.19, 0.97, 0.69 } # solo-safe - bg[SELECTED] = { 0.19, 0.97, 0.69 } # solo-safe - bg[PRELIGHT] = { 0.19, 0.97, 0.69 } # solo-safe - - fg[ACTIVE] = { 0, 0, 0 } - fg[SELECTED] = { 0, 0, 0 } - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } -} - - -style "solo_button_active" = "small_button" -{ - bg[NORMAL] = { 0.66, 0.97, 0.19 } # solo - bg[ACTIVE] = { 0.66, 0.97, 0.19 } # solo - bg[SELECTED] = { 0.66, 0.97, 0.19 } # solo - bg[PRELIGHT] = { 0.66, 0.97, 0.19 } # solo - - fg[ACTIVE] = { 0, 0, 0 } - fg[SELECTED] = { 0, 0, 0 } - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } -} - -style "mixer_solo_button" = "solo_button" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "mixer_solo_button_alternate" = "solo_button_alternate" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} -style "mixer_solo_button_active" = "solo_button_active" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - - -style "mute_button" = "small_button" -{ -} - -style "mute_button_alternate" = "small_button" -{ - bg[ACTIVE] = { 1.0, 0.98, 0.53 } - bg[NORMAL] = { 1.0, 0.98, 0.53 } - bg[SELECTED] = { 1.0, 0.98, 0.53 } - bg[PRELIGHT] = { 1.0, 0.98, 0.53 } - - fg[SELECTED] = { 0, 0, 0 } - fg[ACTIVE] = { 0, 0, 0 } - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } -} - -style "mute_button_active" = "small_button" -{ - bg[NORMAL] = { 0.90, 0.89, 0.73 } - bg[ACTIVE] = { 0.90, 0.89, 0.73 } - bg[PRELIGHT] = { 0.90, 0.89, 0.73 } - bg[SELECTED] = { 0.90, 0.89, 0.73 } - - fg[SELECTED] = { 0, 0, 0 } - fg[ACTIVE] = { 0, 0, 0 } - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } -} - -style "mixer_mute_button" = "mute_button" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "mixer_mute_button_alternate" = "mute_button_alternate" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "mixer_mute_button_active" = "mute_button_active" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "multiline_combo" = "small_button" -{ - font_name = "sans 8" - xthickness = 0 - ythickness = 0 -} - -style "mixer_mute_button" = "mute_button" -{ - font_name = "sans 7" - xthickness = 0 - ythickness = 0 -} - -style "track_loop_button" = "small_button" -{ - bg[ACTIVE] = { 1.0, 0.98, 0.53 } - bg[PRELIGHT] = { 1.0, 0.98, 0.53 } - -} - -style "mixer_red_active_button" = "very_small_button" -{ - fg[ACTIVE] = { 0, 1.0, 1.0 } - bg[ACTIVE] = { 0.7, 0, 0 } - - base[INSENSITIVE] = { 0.16, 0.16, 0.21 } - bg[INSENSITIVE] = { 0.16, 0.16, 0.21 } -} - -style "time_button" = "default_buttons_menus" -{ - font_name = "sans 8" -} - -style "transport_button" -{ -} - -style "transport_button_active" -{ - bg[NORMAL] = { 0.50, 1.0, 0.50 } - bg[ACTIVE] = { 0.50, 1.0, 0.50 } - bg[SELECTED] = { 0.50, 1.0, 0.50 } - bg[PRELIGHT] = { 0.50, 1.0, 0.50 } - - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } - fg[SELECTED] = { 0, 0, 0 } - fg[ACTIVE] = { 0, 0, 0 } -} - -style "transport_rec_button" -{ -} - -style "transport_rec_button_active" -{ - bg[ACTIVE] = { 1.0, 0, 0 } - bg[NORMAL] = { 1.0, 0, 0 } - bg[SELECTED] = { 1.0, 0, 0 } - bg[PRELIGHT] = { 1.0, 0, 0 } -} - -style "transport_rec_button_alternate" -{ - bg[PRELIGHT] = { 0.91, 0.68, 0.68 } - bg[NORMAL] = { 0.91, 0.68, 0.68 } - bg[SELECTED] = { 0.91, 0.68, 0.68 } - bg[ACTIVE] = { 0.91, 0.68, 0.68 } -} - -style "shuttle_control" = "very_small_text" -{ - fg[NORMAL] = { 0.85, 0.92, 0.98 } - fg[ACTIVE] = { 0.85, 0.92, 0.98 } - fg[PRELIGHT] = { 0.85, 0.92, 0.98 } - fg[SELECTED] = { 0.85, 0.92, 0.98 } - fg[INSENSITIVE] = { 0.85, 0.92, 0.98 } - - bg[NORMAL] = { 0.26, 0.26, 0.31 } - bg[PRELIGHT] = { 0.26, 0.26, 0.31 } - bg[INSENSITIVE] = { 0.26, 0.26, 0.31 } - bg[ACTIVE] = { 0.70, 0.70, 0.70 } - bg[SELECTED] = { 1.0, 0.04, 0.04 } -} - -style "ardour_adjusters" = "default_buttons_menus" +style "lumiera_adjusters" = "default_buttons_menus" { bg[NORMAL] = { 0.60, 0.60, 0.60 } bg[PRELIGHT] = { 0.80, 0.80, 0.80 } bg[ACTIVE] = { 0.06, 0.06, 0.06 } } -style "editor_hscrollbar" = "ardour_adjusters" -{ - # - # special case: we want this scrollbar to be as tall as the - # zoom focus selector combobox. scrollbars don't expand to - # fill the space available to them, so we have to explicitly - # make it bigger. - # - GtkRange::slider_width = 27 - GtkScrollbar::slider_width = 27 -} - -style "ardour_progressbars" = "default_buttons_menus" +style "lumiera_progressbars" = "default_buttons_menus" { bg[NORMAL] = { 0, 0, 0 } bg[PRELIGHT] = { 0.00, 0.36, 0.40 } } -style "options_window" = "default_base" +style "lumiera_button" = "default_buttons_menus" { - font_name = "sans 8" - fg[PRELIGHT] = { 0.80, 0.80, 0.80 } -} - -style "option_entry" = "default_base" -{ - fg[NORMAL] = { 1.0, 1.0, 1.0 } - fg[ACTIVE] = { 1.0, 1.0, 1.0 } - fg[INSENSITIVE] = { 0.80, 0.80, 0.80 } - - base[INSENSITIVE] = { 0.07, 0.07, 0.12 } - - bg[NORMAL] = { 0.35, 0.35, 0.40 } - bg[ACTIVE] = { 0.35, 0.35, 0.40 } -} - -style "red_when_active" = "medium_text" -{ - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[NORMAL] = { 0.26, 0.26, 0.31 } - - fg[ACTIVE] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 1.0, 0, 0} -} - -style "xrun_warn" -{ - font_name = "sans bold 18" - - fg[NORMAL] = { 1.0, 1.0, 1.0 } - fg[ACTIVE] = { 1.0, 1.0, 1.0 } - text[NORMAL] = { 1.0, 1.0, 1.0 } - text[ACTIVE] = { 1.0, 1.0, 1.0 } - base[NORMAL] = { 0.09, 0.48, 0.46 } - base[ACTIVE] = { 0.09, 0.48, 0.46 } - bg[NORMAL] = { 1.0, 0.48, 0.46 } - bg[ACTIVE] = { 0.09, 1.0, 0.46 } -} - -style "menu_bar_base" = "default_base" -{ - bg[NORMAL] = { 0.2, 0.2, 0.3 } - bg[ACTIVE] = { 0, 0, 0 } - bg[PRELIGHT] = { 0, 0, 0 } - bg[INSENSITIVE] = { 0, 0, 0 } - bg[SELECTED] = { 0, 0, 0 } -} - -style "fatal_message" = "medium_text" -{ - fg[ACTIVE] = { 1.0, 0, 1.0 } - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 0,0,0 } - bg[NORMAL] = { 0,0,0 } - base[ACTIVE] = { 0,0,0 } - base[NORMAL] = { 0,0,0 } -} - -style "error_message" = "medium_text" -{ - fg[ACTIVE] = { 1.0, 0, 0 } - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 0,0,0 } - bg[NORMAL] = { 0,0,0 } - base[ACTIVE] = { 0,0,0 } - base[NORMAL] = { 0,0,0 } -} - -style "info_message" = "medium_text" -{ - fg[ACTIVE] = { 1.0, 0, 0 } - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 0,0,0 } - bg[NORMAL] = { 0,0,0 } - base[ACTIVE] = { 0,0,0 } - base[NORMAL] = { 0,0,0 } -} - -style "warning_message" = "medium_text" -{ - fg[ACTIVE] = { 0.30,0.30, 1.0 } - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 0, 0, 0 } - bg[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[NORMAL] = { 0, 0, 0 } -} - -style "medium_entry" = "medium_text" -{ - fg[NORMAL] = { 0.70, 0.70, 0.70 } - fg[ACTIVE] = { 0.70, 0.70, 0.70 } - fg[SELECTED] = { 1.0, 1.0, 1.0 } - - bg[NORMAL] = { 0.35, 0.35, 0.40 } - - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[SELECTED] = { 0.70, 0.70, 0.70 } -} - -style "medium_entry_noselection_fg" = "medium_entry" -{ - fg[SELECTED] = { 0.50, 1.0, 0.50 } -} - -style "medium_entry_noselection_bg" = "medium_entry" -{ - bg[SELECTED] = { 1.0, 1.0, 1.0 } -} - -style "medium_bold_entry" = "medium_bold_text" -{ - fg[NORMAL] = { 0.70, 0.70, 0.70 } - fg[ACTIVE] = { 0.70, 0.70, 0.70 } - - bg[NORMAL] = { 0.35, 0.35, 0.40 } - - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[SELECTED] = { 0, 0, 0 } -} - -style "small_entry" = "small_text" -{ - fg[NORMAL] = { 0.70, 0.70, 0.70 } - fg[ACTIVE] = { 0, 1.0, 0 } - fg[SELECTED] = { 0, 1.0, 0 } - text[NORMAL] = { 0.70, 0.70, 0.70 } - text[ACTIVE] = { 0, 1.0, 0 } - text[SELECTED] = { 0, 1.0, 0 } - bg[NORMAL] = { 0.0, 0.0, 0.0 } - bg[SELECTED] = { 0.0, 0.0, 0.0 } - bg[SELECTED] = { 0.0, 0.0, 0.0 } - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[SELECTED] = { 0, 0, 0 } -} - -style "red_active_small_entry" = "small_entry" -{ - fg[ACTIVE] = { 1.0, 0.0, 0.0 } - fg[SELECTED] = { 1.0, 0, 0 } -} - -style "small_bold_entry" = "small_bold_text" -{ - fg[NORMAL] = { 0.70, 0.70, 0.70 } - fg[ACTIVE] = { 0.70, 0.70, 0.70 } - - bg[NORMAL] = { 0.35, 0.35, 0.40 } - - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[SELECTED] = { 0, 0, 0 } -} - -style "small_red_on_black_entry" = "small_bold_text" -{ - fg[NORMAL] = { 1.0, 0, 0 } - fg[ACTIVE] = { 1.0, 0, 0 } - base[NORMAL] = { 0.0, 0.0, 0.0 } - base[ACTIVE] = { 0.0, 0.0, 0.0 } - bg[NORMAL] = { 0.0, 0.0, 0.0 } - bg[ACTIVE] = { 0.0, 0.0, 0.0 } -} - -style "non_recording_big_clock_display" = "medium_entry" -{ - font_name = "sans 60" - - fg[NORMAL] = { 0.50, 1.0, 0.50 } - fg[ACTIVE] = { 1.0, 0, 0.0 } - fg[SELECTED] = { 1.0, 0, 0 } - fg[PRELIGHT] = { 1.0, 0, 0.0 } - fg[INSENSITIVE] = { 1.0, 0, 0.0 } - - base[NORMAL] = { 0.0, 0.0, 0.0 } - base[ACTIVE] = { 0.0, 0.0, 0.0 } - bg[NORMAL] = { 0.0, 0.0, 0.0 } - bg[ACTIVE] = { 0.7, 0.0, 0.0 } -} - -style "recording_big_clock_display" = "non_recording_big_clock_display" -{ - fg[NORMAL] = { 1.0, 0, 0 } -} - -style "transport_clock_display" -{ - font_name = "sans bold 14" - - fg[NORMAL] = { 0.50, 1.0, 0.50 } - fg[ACTIVE] = { 1.0, 0, 0.0 } - fg[SELECTED] = { 1.0, 0, 0 } - fg[PRELIGHT] = { 1.0, 0, 0.0 } - fg[INSENSITIVE] = { 1.0, 0, 0.0 } - - base[NORMAL] = { 0.0, 0.0, 0.0 } - base[ACTIVE] = { 0.0, 0.0, 0.0 } - bg[NORMAL] = { 0.0, 0.0, 0.0 } - bg[ACTIVE] = { 0.0, 0.0, 0.0 } -} - -style "tempo_meter_clock_display" -{ - font_name = "sans 7" - fg[NORMAL] = { 1.0, 1.0, 1.0 } - fg[ACTIVE] = { 1.0, 1.0, 0.0 } - fg[SELECTED] = { 1.0, 0, 0 } - base[NORMAL] = { 0.0, 0.48, 1.0 } - base[ACTIVE] = { 0.09, 0.98, 0.46 } - bg[NORMAL] = { 0.0, 0.48, 1.0 } - bg[ACTIVE] = { 0.09, 0.98, 0.46 } -} - -style "default_clock_display" = "medium text" -{ - fg[NORMAL] = { 0.50, 1.0, 0.50 } - fg[ACTIVE] = { 1.0, 0.0, 0.0 } - fg[SELECTED] = { 1.0, 0, 0 } - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - bg[NORMAL] = { 0, 0, 0 } - bg[ACTIVE] = { 0, 0, 0 } -} - -style "editor_time_ruler" = "small_text" -{ - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[NORMAL] = { 0.09, 0.09, 0.09 } -} - -style "audio_track_base" = "default_base" -{ - font_name = "sans 6" - fg[NORMAL] = { 0.77, 0.77, 0.72 } - bg[NORMAL] = { 0.18, 0.19, 0.22 } - bg[ACTIVE] = { 0.20, 0.20, 0.20 } - bg[PRELIGHT] = { 0.20, 0.20, 0.20 } - bg[INSENSITIVE] = { 0.20, 0.20, 0.20 } - bg[SELECTED] = { 0.20, 0.20, 0.20 } -} - -style "audio_bus_base" -{ - font_name = "sans 6" - fg[NORMAL] = { 0.77, 0.77, 0.72 } - fg[NORMAL] = { 0.7, 0.8, 0.2 } - #bg[NORMAL] = {0, 0.36, 0.40 } - bg[NORMAL] = "#444466" -} - -style "track_name_display" -{ - font_name = "sans medium 8" - fg[NORMAL] = { 0.80, 0.80, 0.80 } - fg[ACTIVE] = { 0.80, 0.80, 0.80 } - - base[NORMAL] = { 0.06, 0.06, 0.06 } - base[ACTIVE] = { 0.26, 0.26, 0.26 } - bg[NORMAL] = { 0.26, 0.26, 0.26 } - bg[ACTIVE] = { 0.26, 0.26, 0.26 } -} - -style "active_track_name_display" -{ - font_name = "sans medium 8" - text[NORMAL] = { 0.26, 0.26, 0.26 } - base[NORMAL] = { 0.89, 0.89, 0.89 } -} - -style "track_separator" -{ - bg[NORMAL] = { 0.35, 0.35, 0.40 } -} - -# -# Track edit groups. These styles define -# the colors that the "edit" button will -# use as a track is moved from -# track edit group to track edit group. -# There are 8 edit groups. Edit group 0 -# is used for tracks that are not editable, -# so we leave its style to the default. -# - -style "edit_group_0" - -{ - bg[ACTIVE] = { 1.0, 0.65, 0.13 } - bg[NORMAL] = { 0.31, 0.31, 0.31 } - fg[NORMAL] = { 0.82, 0.91, 0.99 } - fg[ACTIVE] = { 0, 0, 0 } -} - -style "edit_group_1" -{ - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } - fg[SELECTED] = { 0, 0, 0 } - bg[NORMAL] = { 0.93, 0.34, 0.08 } - bg[PRELIGHT] = { 0.93, 0.34, 0.08 } - bg[SELECTED] = { 0.93, 0.34, 0.08 } -} - -style "edit_group_2" -{ - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } - fg[SELECTED] = { 0, 0, 0 } - bg[NORMAL] = { 0.93, 0.34, 0.08 } - bg[PRELIGHT] = { 0.93, 0.34, 0.08 } - bg[SELECTED] = { 0.93, 0.34, 0.08 } -} - -style "edit_group_3" -{ - fg[NORMAL] = { 0, 0, 0 } - fg[PRELIGHT] = { 0, 0, 0 } - fg[SELECTED] = { 0, 0, 0 } - bg[NORMAL] = { 0.93, 0.34, 0.08 } - bg[PRELIGHT] = { 0.93, 0.34, 0.08 } - bg[SELECTED] = { 0.93, 0.34, 0.08 } -} - -style "treeview_parent_node" -{ - # specifies *just* the color used for whole file rows when not selected - fg[NORMAL] = { 0.0, 0.6, 0.85 } -} - -style "treeview_display" = "small_bold_text" -{ - # expander arrow border and DnD "icon" text - fg[NORMAL] = { 0.8, 0.8, 0.8 } - - # background with no rows or no selection, plus - # expander arrow core and DnD "icon" background - base[NORMAL] = { 0.20, 0.20, 0.25 } - - # selected row bg when window does not have focus (including during DnD) - base[ACTIVE] = { 0.0, 0.60, 0.60 } - - # selected row bg when window has focus - base[SELECTED] = { 0, 0.75, 0.75 } - - # row text when in normal state and not a parent - text[NORMAL] = { 0.80, 0.80, 0.80 } - - # selected row text with window focus - text[SELECTED] = { 0, 1.0, 1.0 } - - # selected row text without window focus (including during DnD) - text[ACTIVE] = { 0, 1.0, 1.0 } -} - -style "main_canvas_area" -{ - bg[NORMAL] = { 0.30, 0.30, 0.34 } - bg[ACTIVE] = { 0.30, 0.30, 0.34 } - bg[INSENSITIVE] = { 0.30, 0.30, 0.34 } - bg[SELECTED] = { 0.30, 0.30, 0.34 } - bg[PRELIGHT] = { 0.30, 0.30, 0.34 } -} - -style "track_controls_inactive" -{ - bg[NORMAL] = { 0.60, 0.60, 0.66 } - bg[ACTIVE] = { 0.60, 0.60, 0.66 } - bg[INSENSITIVE] = { 0.60, 0.60, 0.66 } - bg[SELECTED] = { 0.60, 0.60, 0.66 } - bg[PRELIGHT] = { 0.60, 0.60, 0.66 } - - font_name = "sans medium 10" - fg[NORMAL] = { 0.7, 0.8, 0.2 } -} - -style "edit_controls_base_selected" -{ - bg[NORMAL] = { 0.60, 0.54, 0.60 } - bg[ACTIVE] = { 0.60, 0.54, 0.60 } - bg[INSENSITIVE] = { 0.60, 0.54, 0.60 } - bg[SELECTED] = { 0.60, 0.54, 0.60 } - bg[PRELIGHT] = { 0.60, 0.54, 0.60 } -} - -style "automation_track_controls_base" -{ - bg[NORMAL] = { 0.22, 0.22, 0.29 } - bg[ACTIVE] = { 0.22, 0.22, 0.29 } - bg[INSENSITIVE] = { 0.22, 0.22, 0.29 } - bg[SELECTED] = { 0.22, 0.22, 0.29 } - bg[PRELIGHT] = { 0.22, 0.22, 0.29 } -} - -# Plugin Editors -style "plugin_slider" -{ - font_name ="sans bold 10" - - # the slider itself. the inactive part is INSENSITIVE, - # the active part is something else. - - fg[NORMAL] = { 0.37, 0.43, 0.52 } - fg[ACTIVE] = { 0.37, 0.43, 0.52 } - fg[INSENSITIVE] = {0.35, 0.35, 0.40 } # matches default_base - fg[SELECTED] = { 0.37, 0.43, 0.52 } - fg[PRELIGHT] = { 0.37, 0.43, 0.52 } - - # draws the outer rectangle around the slider - - bg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 0.80, 0.80, 0.80 } - bg[INSENSITIVE] = {0.80, 0.80, 0.80 } - bg[SELECTED] = { 0.80, 0.80, 0.80 } - bg[PRELIGHT] = { 0.80, 0.80, 0.80 } - - # the numeric display - - text[NORMAL] = { 0.80, 0.80, 0.80 } - text[ACTIVE] = { 0.80, 0.80, 0.80 } - text[INSENSITIVE] = { 0.80, 0.80, 0.80 } - text[SELECTED] = { 0.80, 0.80, 0.80 } - text[PRELIGHT] = { 0.80, 0.80, 0.80 } -} - -style "track_list_display" = "small_bold_text" -{ - text[NORMAL] = { 0.80, 0.80, 0.80 } - text[ACTIVE] = { 0.3, 0.3, 0.3 } - text[INSENSITIVE] = { 0, 0, 0 } - text[SELECTED] = { 0.8, 0.8, 0.8 } - - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[INSENSITIVE] = { 0, 0, 0 } - base[SELECTED] = { 0, 0, 0 } -} - -style "inspector_track_list_display" = "track_list_display" -{ - text[ACTIVE] = { 0.8, 0.8, 0.8 } - - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0.2, 0.2, 0.2 } - base[INSENSITIVE] = { 0, 0, 0 } - base[SELECTED] = { 0.3, 0.3, 0.4 } -} - -style "redirect_list_display" -{ - GtkTreeView::horizontal-separator = 0 - GtkTreeView::vertical-separator = 0 - - font_name = "sans 7" - text[NORMAL] = { 0.80, 0.80, 0.80 } - text[ACTIVE] = { 0.70, 0.70, 0.70 } - text[INSENSITIVE] = { 0, 0, 0 } - text[SELECTED] = { 0.9, 0.3, 0.3 } - - base[NORMAL] = { 0, 0, 0 } - base[ACTIVE] = { 0, 0, 0 } - base[INSENSITIVE] = { 0, 0, 0 } - base[SELECTED] = { 0, 0, 0 } - - # these two are explicitly used by the cell renderer for the - # text - - fg[NORMAL] = { 0.5, 0.5, 0.5 } # used for inactive - fg[ACTIVE] = { 1.0, 1.0, 1.0 } # used for active -} - -style "inspector_redirect_list_display" = "redirect_list_display" -{ - base[SELECTED] = { 0.3, 0.3, 0.3 } -} - -# MixerPanZone: -# -# the NORMAL fg color is used for the pan puck -# the ACTIVE fg color is used for the speaker boxes - -style "pan_zone" = "default_base" -{ - fg[NORMAL] = { 0.34, 0.95, 0.92 } - fg[ACTIVE] = { 0.95, 0.48, 0.11 } -} - -style "paler_red_when_active" = "medium_text" -{ - fg[NORMAL] = { 0.80, 0.80, 0.80 } - fg[PRELIGHT] = { 0.80, 0.80, 0.80 } - bg[NORMAL] = { 0.31, 0.31, 0.31 } - bg[PRELIGHT] = { 0.31, 0.31, 0.31 } - - fg[ACTIVE] = { 0.36, 0.46, 0.28 } - bg[ACTIVE] = { 1.00, 0.59, 0.59} -} - -style "peak_display_peaked_entry" = "small_text" -{ - fg[NORMAL] = { 1.0, 1.0, 1.0 } - fg[ACTIVE] = { 1.0, 1.0, 1.0 } - fg[SELECTED] = { 1.0, 1.0, 1.0 } - - bg[NORMAL] = {0.9, 0.0, 0.0 } - bg[ACTIVE] = { 0.9, 0.0, 0.0 } - bg[PRELIGHT] = { 0.9, 0.0, 0.0 } - bg[INSENSITIVE] = { 0.9, 0.0, 0.0 } - bg[SELECTED] = { 0.9, 0.0, 0.0 } - base[NORMAL] = { 0.9, 0.0, 0.0 } - base[ACTIVE] = { 0.9, 0.0, 0.0 } - base[PRELIGHT] = { 0.9, 0.0, 0.0 } - base[INSENSITIVE] = { 0.9, 0.0, 0.0 } - base[SELECTED] = { 0.9, 0.0, 0.0 } -} - -style "selected_strip_frame" -{ - fg[NORMAL] = { 0.74, 0.42, 0.47 } - bg[NORMAL] = { 0.79, 0.28, 0.18 } -} - -style "flashing_alert" = "very_small_text" -{ - fg[NORMAL] = { 0.80, 0.80, 0.80 } - bg[NORMAL] = { 0.26, 0.26, 0.31 } - - fg[ACTIVE] = { 0.80, 0.80, 0.80 } - bg[ACTIVE] = { 1.0, 0, 0} -} - -style "selected_io_selector_port_list" = "medium_bold_text" -{ - - GtkTreeView::even-row-color = { 0, 0, 0 } - GtkTreeView::odd-row-color = { 0, 0, 0 } - -# fg is used to color the fg (text) of the column header button - - fg[NORMAL] = { 0.85, 0.85, 0.85 } - fg[SELECTED] = { 0.85, 0.85, 0.85 } - fg[ACTIVE] = { 0.85, 0.85, 0.85 } - fg[PRELIGHT] = { 0.85, 0.85, 0.85 } - fg[INSENSITIVE] = { 0.85, 0.85, 0.85 } - -# bg is used used to color the background of the column header button - - bg[NORMAL] = { 0.30, 0.30, 0.35 } - bg[ACTIVE] = { 0.30, 0.30, 0.35 } - bg[PRELIGHT] = { 0.30, 0.30, 0.35 } - bg[INSENSITIVE] = { 0.30, 0.30, 0.35 } - bg[SELECTED] = { 0.30, 0.30, 0.35 } - -# text is used to color the treeview row text - - text[NORMAL] = { 0.85, 0.85, 0.85 } - text[SELECTED] = { 0.85, 0.85, 0.85 } - -# base is used to color a treeview with no rows - - base[NORMAL] = { 0.20, 0.20, 0.25 } - base[ACTIVE] = { 0.20, 0.20, 0.25 } - base[PRELIGHT] = { 0.20, 0.20, 0.25 } - base[INSENSITIVE] = { 0.20, 0.20, 0.25 } - base[SELECTED] = { 0.20, 0.20, 0.25 } - -} - -style "io_selector_port_list" = "medium_text" -{ - GtkTreeView::even-row-color = { 0.20, 0.20, 0.25 } - GtkTreeView::odd-row-color = { 0.20, 0.20, 0.25 } -# fg is used to color the fg (text) of the column header button - - fg[NORMAL] = { 0.70, 0.70, 0.70 } - fg[SELECTED] = { 0.70, 0.70, 0.70 } - fg[ACTIVE] = { 0.70, 0.70, 0.70 } - fg[PRELIGHT] = { 0.70, 0.70, 0.70 } - fg[INSENSITIVE] = { 0.70, 0.70, 0.70 } - -# bg is used used to color the background of the column header button - - bg[NORMAL] = { 0.30, 0.30, 0.35 } - bg[ACTIVE] = { 0.30, 0.30, 0.35 } - bg[PRELIGHT] = { 0.30, 0.30, 0.35 } - bg[INSENSITIVE] = { 0.30, 0.30, 0.35 } - bg[SELECTED] = { 0.30, 0.30, 0.35 } - -# text is used to color the treeview row text - - text[NORMAL] = { 0.80, 0.80, 0.80 } - text[SELECTED] = { 0.80, 0.80, 0.80 } - -# base is used to color a treeview with no rows - - base[NORMAL] = { 0.20, 0.20, 0.25 } - base[ACTIVE] = { 0.20, 0.20, 0.25 } - base[PRELIGHT] = { 0.20, 0.20, 0.25 } - base[INSENSITIVE] = { 0.20, 0.20, 0.25 } - base[SELECTED] = { 0.20, 0.20, 0.25 } -} - -style "io_selector_notebook" = "default_base" -{ - fg[NORMAL] = { 1.0, 1.0, 1.0 } - font_name ="sans bold 8" + xthickness = 1 + ythickness = 1 } style "tearoff_arrow" = "medium_bold_entry" @@ -1077,420 +104,31 @@ style "tearoff_arrow" = "medium_bold_entry" bg[PRELIGHT] = { 0.80, 0.80, 0.80 } } -style "meter_metrics_strip" = "default_base" -{ - font_name = "sans 4" - fg[NORMAL] = { 1.0, 0.8, 0.2 } -} - -style "location_row_button" = "default_buttons_menus" -{ - font_name = "sans 10" -} - -style "location_rows_clock" = "default_clock_display" -{ - font_name = "sans 12" -} - -style "pan_slider" -{ - font_name = "sans 8" - - fg[NORMAL] = { 0.22, 0.73, 0.22 } - fg[ACTIVE] = { 0.22, 0.73, 0.22 } - fg[INSENSITIVE] = {0.22, 0.53, 0.22 } - fg[SELECTED] = { 0.67, 0.23, 0.22 } - fg[PRELIGHT] = { 0.67, 0.23, 0.22 } - - bg[NORMAL] = { 0.05, 0.05, 0.05 } - bg[ACTIVE] = { 0, 0, 0 } - bg[INSENSITIVE] = {0.12, 0.19, 0.25 } - bg[SELECTED] = { 0, 0, 0 } - bg[PRELIGHT] = { 0, 0, 0 } - - text[NORMAL] = { 0.70, 0.70, 0.70 } - text[ACTIVE] = { 0.70, 0.70, 0.70 } - text[INSENSITIVE] = { 0.70, 0.70, 0.70 } - text[SELECTED] = { 0.70, 0.70, 0.70 } - text[PRELIGHT] = { 0.70, 0.70, 0.70 } - - # used to draw the triangular indicators - - base[NORMAL] = { 0.80, 0.80, 0.80 } - base[ACTIVE] = { 0.80, 0.80, 0.80 } - base[INSENSITIVE] = {0.6, 0.6, 0.6 } - base[SELECTED] = { 0.80, 0.80, 0.80 } - base[PRELIGHT] = { 0.80, 0.80, 0.80 } - -} - -style "ardour_button" ="default_buttons_menus" -{ - xthickness = 1 - ythickness = 1 -} - -#--------------------------------------------------------------- - class "GtkWidget" style:highest "default_base" -class "GtkScrollbar" style:highest "ardour_adjusters" +class "GtkScrollbar" style:highest "lumiera_adjusters" class "GtkLabel" style:highest "default_buttons_menus" -class "GtkButton" style:highest "ardour_button" +class "GtkButton" style:highest "lumiera_button" class "GtkArrow" style:highest "tearoff_arrow" -class "GtkProgressBar" style:highest "ardour_progressbars" +class "GtkProgressBar" style:highest "lumiera_progressbars" -widget "*FirstActionMessage" style:highest "first_action_message" -widget "*VerboseCanvasCursor" style:highest "verbose_canvas_cursor" -widget "*MarkerText" style:highest "marker_text" -widget "*TimeAxisViewItemName*" style:highest "time_axis_view_item_name" -#widget "*ExportProgress" style:highest "default_buttons_menus" -widget "*ExportFileLabel" style:highest "small_bold_text" -widget "*ExportFormatLabel" style:highest "medium_bold_text" -widget "*ExportHeader" style:highest "small_bold_text" -widget "*ExportFileDisplay" style:highest "medium_entry" -widget "*ExportFormatDisplay" style:highest "medium_entry" -widget "*ExportCheckbox" style:highest "small_entry" -widget "*ExportTrackSelector*" style:highest "medium_entry_noselection_bg" -widget "*EditModeSelector" style:highest "medium_bold_entry" -widget "*SnapTypeSelector" style:highest "medium_bold_entry" -widget "*SnapModeSelector" style:highest "medium_bold_entry" -widget "*ZoomFocusSelector" style:highest "medium_bold_entry" -widget "*ArdourContextMenu*" style:highest "default_buttons_menus" -widget "*EditGroupTitleButton*" style:highest "default_buttons_menus" -widget "*MixerGroupTitleButton*" style:highest "default_buttons_menus" -widget "*ErrorLogCloseButton" style:highest "default_buttons_menus" -widget "*EditorGTKButton*" style:highest "default_buttons_menus" -widget "*ToolbarButton" style:highest "default_buttons_menus" -widget "*ToolbarButton*" style:highest "default_buttons_menus" -widget "*CrossfadeEditButton" style:highest "default_buttons_menus" -widget "*CrossfadeEditButton*" style:highest "default_buttons_menus" -widget "*TrackHistoryButton*" style:highest "default_buttons_menus" -widget "*TrackSizeButton*" style:highest "default_buttons_menus" -widget "*TrackPlaylistButton*" style:highest "default_buttons_menus" -widget "*TrackAutomationButton*" style:highest "default_buttons_menus" -widget "*TrackGroupButton*" style:highest "default_buttons_menus" -widget "*TrackMixButton*" style:highest "default_buttons_menus" -widget "*TrackVisualButton*" style:highest "default_buttons_menus" -widget "*TrackRemoveButton*" style:highest "default_buttons_menus" -widget "*BaseButton" style:highest "default_buttons_menus" -widget "*TakeButtonLabel" style:highest "default_buttons_menus" -widget "*MixerWidthButton" style:highest "default_buttons_menus" -widget "*MixerHideButton" style:highest "default_buttons_menus" -widget "*MixerSendButton" style:highest "default_buttons_menus" -widget "*MixerSendButtonLabel" style:highest "default_buttons_menus" -widget "*MixerSendSwitch" style:highest "default_buttons_menus" -widget "*MixerInsertButton" style:highest "default_buttons_menus" -widget "*MixerInsertButtonLabel" style:highest "default_buttons_menus" -widget "*MixerInsertSwitch" style:highest "default_buttons_menus" -widget "*MixerMonitorInputButton*" style:highest "very_small_button" -widget "*MixerMonitorInputButton.*" style:highest "very_small_button" -widget "*MixerIOButton" style:highest "very_small_button" -widget "*MixerIOButtonLabel" style:highest "very_small_button" -widget "*AddRouteDialogSpinner" style:highest "ardour_adjusters" -widget "*AddRouteDialogRadioButton*" style:highest "options_window" -widget "*OptionsNotebook" style:highest "options_window" -widget "*OptionEditorToggleButton*" style:highest "options_window" -widget "*OptionsLabel" style:highest "options_window" -widget "*OptionEditorAuditionerLabel" style:highest "options_window" -widget "*OptionsEntry" style:highest "option_entry" -widget "*InspectorNotebook" style:highest "options_window" -widget "*NewSessionDialog" style:highest "options_window" -widget "*NewSessionDialogButton*" style:highest "options_window" -widget "*MixerSendSwitch*" style:highest "very_small_red_active_and_selected_button" -widget "*OptionEditorToggleButton" style:highest "small_red_active_and_selected_button" -widget "*NewSessionDialogButton" style:highest "small_red_active_and_selected_button" -widget "*RecordEnableButton" style:highest "track_rec_enable_button" -widget "*RecordEnableButton-active" style:highest "track_rec_enable_button_active" -widget "*RecordEnableButton-alternate" style:highest "track_rec_enable_button_alternate" -widget "*MixerRecordEnableButton" style:highest "mixer_track_rec_enable_button" -widget "*MixerRecordEnableButton-active" style:highest "mixer_track_rec_enable_button_active" -widget "*MixerRecordEnableButton-alternate" style:highest "mixer_track_rec_enable_button_alternate" -widget "*MuteButton" style:highest "mute_button" -widget "*MuteButton-alternate" style:highest "mute_button_alternate" -widget "*MuteButton-active" style:highest "mute_button_active" -widget "*MixerMuteButton" style:highest "mixer_mute_button" -widget "*MixerMuteButton-alternate" style:highest "mixer_mute_button_alternate" -widget "*MixerMuteButton-active" style:highest "mixer_mute_button_active" -widget "*SoloButton" style:highest "solo_button" -widget "*SoloButton-alternate" style:highest "solo_button_alternate" -widget "*SoloButton-active" style:highest "solo_button_active" -widget "*MixerSoloButton" style:highest "mixer_solo_button" -widget "*MixerSoloButton-alternate" style:highest "mixer_solo_button_alternate" -widget "*MixerSoloButton-active" style:highest "mixer_solo_button_active" -widget "*TrackLoopButton*" style:highest "track_loop_button" -widget "*PanAutomationLineSelector*" style:highest "multiline_combo" -widget "*EditorTimeButton*" style:highest "time_button" -widget "*MixerPhaseInvertButton*" style:highest "very_small_button" -widget "*MixerPhaseInvertButton.*" style:highest "very_small_button" -widget "*MixerAutomationRecordingButton*" style:highest "very_small_button" -widget "*MixerAutomationRecordingButton.*" style:highest "very_small_button" -widget "*MixerAutomationModeButton*" style:highest "very_small_button" -widget "*MixerAutomationModeButton.*" style:highest "very_small_button" -widget "*MixerAutomationPlaybackButton*" style:highest "very_small_button" -widget "*MixerAutomationPlaybackButton.*" style:highest "very_small_button" -widget "*MixerNameButton" style:highest "very_small_button" -widget "*MixerNameButtonLabel" style:highest "very_small_button" -widget "*MixerGroupButton" style:highest "very_small_button" -widget "*MixerGroupButtonLabel" style:highest "very_small_button" -widget "*MixerCommentButton" style:highest "very_small_button" -widget "*MixerCommentButton*" style:highest "very_small_button" -widget "*EditGroupButton" style:highest "very_small_button" -widget "*EditGroupButtonLabel" style:highest "very_small_button" -widget "*TransportButton" style:highest "transport_rec_button" -widget "*TransportButton-active" style:highest "transport_button_active" -widget "*ShuttleButton" style:highest "transport_button" -widget "*ShuttleButton*" style:highest "transport_button" -widget "*ShuttleDisplay" style:highest "transport_button" -widget "*ShuttleDisplay*" style:highest "transport_button" -widget "*ShuttleControl" style:highest "shuttle_control" -widget "*TransportRecButton" style:highest "transport_rec_button" -widget "*TransportRecButton*" style:highest "transport_rec_button" -widget "*TransportRecButton-active" style:highest "transport_rec_button_active" -widget "*TransportRecButton-active*" style:highest "transport_rec_button_active" -widget "*TransportRecButton-alternate" style:highest "transport_rec_button_alternate" -widget "*TransportRecButton-alternate*" style:highest "transport_rec_button_alternate" -widget "*TransportRecButton*" style:highest "transport_rec_button" -widget "*RecordingXrunWarningWindow" style:highest "xrun_warn" -widget "*RecordingXrunWarningWindow*" style:highest "xrun_warn" -widget "*MainMenuBar" style:highest "menu_bar_base" -widget "*ErrorMessage" style:highest "error_message" -widget "*FatalMessage" style:highest "fatal_message" -widget "*InfoMessage" style:highest "info_message" -widget "*WarningMessage" style:highest "warning_message" -widget "*BigClockNonRecording" style:highest "non_recording_big_clock_display" -widget "*BigClockRecording" style:highest "recording_big_clock_display" -widget "*TransportClockDisplay" style:highest "transport_clock_display" -widget "*SecondaryClockDisplay" style:highest "transport_clock_display" -widget "*AudioClockFramesUpperInfo" style:highest "tempo_meter_clock_display" -widget "*AudioClockFramesLowerInfo" style:highest "tempo_meter_clock_display" -widget "*AudioClockSMPTEUpperInfo" style:highest "tempo_meter_clock_display" -widget "*AudioClockSMPTELowerInfo" style:highest "tempo_meter_clock_display" -widget "*AudioClockBBTUpperInfo" style:highest "tempo_meter_clock_display" -widget "*AudioClockBBTLowerInfo" style:highest "tempo_meter_clock_display" -widget "*SelectionStartClock" style:highest "default_clock_display" -widget "*SelectionEndClock" style:highest "default_clock_display" -widget "*EditCursorClock" style:highest "default_clock_display" -widget "*PreRollClock" style:highest "default_clock_display" -widget "*PostRollClock" style:highest "default_clock_display" -widget "*NudgeClock" style:highest "default_clock_display" -widget "*ZoomRangeClock" style:highest "default_clock_display" -widget "*SMPTEOffsetClock" style:highest "default_clock_display" -widget "*TransportLabel" style:highest "small_bold_text" -widget "*TakeLabel" style:highest "small_bold_text" -widget "*LocationLabel" style:highest "small_bold_text" -widget "*WipeLabel" style:highest "small_bold_text" -widget "*TakeTagLabel" style:highest "small_bold_text" -widget "*ToolBarLabel" style:highest "small_bold_text" -widget "*EditorDisplayLabel" style:highest "small_bold_text" -widget "*NewSessionLabel" style:highest "large_text" -widget "*GlobalButtonLabel" style:highest "default_buttons_menus" -widget "*ClickButton" style:highest "medium_entry" -widget "*RegionNameDisplay" style:highest "medium_entry" -widget "*PluginDisplay" style:highest "medium_entry" -widget "*SelectionDisplay" style:highest "medium_entry" -widget "*HistorySelector" style:highest "medium_entry" -widget "*LocationSelector" style:highest "medium_entry" -widget "*TakeSelector" style:highest "medium_entry" -widget "*RegionSelector" style:highest "medium_entry" -widget "*SMPTERuler" style:highest "editor_time_ruler" -widget "*BBTRuler" style:highest "editor_time_ruler" -widget "*FramesRuler" style:highest "editor_time_ruler" -widget "*MinSecRuler" style:highest "editor_time_ruler" -widget "*BaseFrame" style:highest "base_frame" -widget "*AudioTrackStripBase" style:highest "audio_track_base" -widget "*TimeAxisViewControlsBaseUnselected" style:highest "audio_track_base" -widget "*AudioTrackControlsBaseUnselected" style:highest "audio_track_base" -widget "*AudioTrackFader" style:highest "gain_fader" -widget "*AudioBusStripBase" style:highest "audio_bus_base" -widget "*BusControlsBaseUnselected" style:highest "audio_bus_base" -widget "*AudioBusFader" style:highest "gain_fader" -widget "*TrackSeparator" style:highest "track_separator" -widget "*TrackEditIndicator0*" style:highest "edit_group_0" -widget "*TrackEditIndicator1*" style:highest "edit_group_1" -widget "*TrackEditIndicator2*" style:highest "edit_group_2" -widget "*TrackEditIndicator3*" style:highest "edit_group_3" -widget "*TrackEditIndicator4*" style:highest "edit_group_3" -widget "*TrackEditIndicator5*" style:highest "edit_group_3" -widget "*TrackEditIndicator6*" style:highest "edit_group_3" -widget "*TrackEditIndicator7*" style:highest "edit_group_3" -widget "*EditorTrackNameDisplay" style:highest "track_name_display" -widget "*EditorTrackNameDisplay*" style:highest "track_name_display" -widget "*EditorActiveTrackNameDisplay" style:highest "active_track_name_display" -widget "*EditorActiveTrackNameDisplay*" style:highest "active_track_name_display" -widget "*CrossfadeEditAuditionButton" style:highest "red_when_active" -widget "*CrossfadeEditAuditionButton*" style:highest "red_when_active" -widget "*CrossfadeEditCurveButton" style:highest "red_when_active" -widget "*CrossfadeEditCurveButton*" style:highest "red_when_active" -widget "*CrossfadeEditLabel" style:highest "medium_text" -widget "*CrossfadeEditFrame" style:highest "base_frame" -widget "*MouseModeButton" style:highest "default_buttons_menus" -widget "*MouseModeButton*" style:highest "default_buttons_menus" -widget "*EditorMainCanvas" style:highest "main_canvas_area" -widget "*AudioTrackControlsBaseInactiveUnselected" style:highest "track_controls_inactive" -widget "*BusControlsBaseInactiveUnselected" style:highest "track_controls_inactive" -widget "*AutomationTrackControlsBaseInactiveUnselected" style:highest "track_controls_inactive" -widget "*AutomationTrackName" style:highest "automation_track_name" -widget "*AudioTrackControlsBaseInactiveSelected" style:highest "track_controls_inactive" -widget "*BusControlsBaseInactiveSelected" style:highest "track_controls_inactive" -widget "*AutomationTrackControlsBaseInactiveSelected" style:highest "track_controls_inactive" -widget "*AudioTrackStripBaseInactive" style:highest "track_controls_inactive" -widget "*AudioBusStripBaseInactive" style:highest "track_controls_inactive" -widget "*AudioTrackControlsBaseSelected" style:highest "edit_controls_base_selected" -widget "*BusControlsBaseSelected" style:highest "edit_controls_base_selected" -widget "*AutomationTrackControlsBase" style:highest "automation_track_controls_base" -widget "*AutomationTrackControlsBaseSelected" style:highest "edit_controls_base_selected" -widget "*EditorMenuBar*" style:highest "black_mackie_menu_bar" -widget "*MainMenuBar*" style:highest "black_mackie_menu_bar" -widget "*ZoomClickBox" style:highest "medium_bold_entry" -widget "*PluginParameterLabel" style:highest "medium_text" -widget "*PluginNameInfo" style:highest "plugin_name_text" -widget "*PluginMakerInfo" style:highest "plugin_maker_text" -widget "*PluginParameterInfo" style:highest "medium_text" -widget "*MotionControllerValue" style:highest "medium_entry" -widget "*ParameterValueDisplay" style:highest "medium_bold_entry" -widget "*PluginUIClickBox" style:highest "medium_bold_entry" -widget "*PluginUIClickBox*" style:highest "medium_bold_entry" -widget "*PluginSlider" style:highest "plugin_slider" -widget "*RedirectSelector" style:highest "redirect_list_display" -widget "*RedirectSelector.*" style:highest "redirect_list_display" -widget "*EditGroupDisplay" style:highest "treeview_display" -widget "*TrackListDisplay" style:highest "treeview_display" -widget "*RegionListDisplay" style:highest "treeview_display" -widget "*NamedSelectionDisplay" style:highest "treeview_display" -widget "*SnapshotDisplay" style:highest "treeview_display" -widget "*MixerTrackCommentArea" style:highest "option_entry" -widget "*MixerPanZone" style:highest "pan_zone" -widget "*MixerTrackDisplayList" style:highest "treeview_display" -widget "*MixerSnapshotDisplayList" style:highest "treeview_display" -widget "*MixerAuxDisplayList" style:highest "treeview_display" -widget "*MixerGroupList" style:highest "treeview_display" -widget "*RegionEditorLabel" style:highest "medium_text" -widget "*RegionEditorSmallLabel" style:highest "small_text" -widget "*RegionEditorEntry" style:highest "medium_entry" -widget "*RegionEditorClock" style:highest "default_clock_display" -widget "*RegionEditorToggleButton" style:highest "paler_red_when_active" -widget "*RegionEditorToggleButton*" style:highest "paler_red_when_active" -widget "*MixerStripSpeedBase" style:highest "small_entry" -widget "*MixerStripSpeedBase*" style:highest "small_entry" -widget "*MixerStripSpeedBaseNotOne" style:highest "small_red_on_black_entry" -widget "*MixerStripSpeedBaseNotOne*" style:highest "small_red_on_black_entry" -widget "*MixerStripGainDisplay" style:highest "small_entry" -widget "*MixerStripGainDisplay*" style:highest "small_entry" -widget "*MixerStripGainUnitButton" style:highest "very_small_button" -widget "*MixerStripGainUnitButton*" style:highest "very_small_button" -widget "*MixerStripMeterPreButton" style:highest "very_small_button" -widget "*MixerStripMeterPreButton*" style:highest "very_small_button" -widget "*MixerStripPeakDisplay*" style:highest "red_active_small_entry" -widget "*MixerStripPeakDisplayPeak*" style:highest "peak_display_peaked_entry" -widget "*MixerStripSelectedFrame" style:highest "selected_strip_frame" -widget "*MixerStripFrame" style:highest "base_frame" -widget "*HWMonitorButton" style:highest "red_when_active" -widget "*HWMonitorButton*" style:highest "red_when_active" -widget "*BypassButton" style:highest "red_when_active" -widget "*BypassButton*" style:highest "red_when_active" -widget "*TransportSoloAlert" style:highest "flashing_alert" -widget "*TransportSoloAlert.*" style:highest "flashing_alert" -widget "*TransportAuditioningAlert" style:highest "flashing_alert" -widget "*TransportAuditioningAlert.*" style:highest "flashing_alert" -widget "*FadeCurve" style:highest "medium_bold_entry" -widget "*FadeCurve*" style:highest "medium_bold_entry" -widget "*IOSelectorButton" style:highest "default_buttons_menus" -widget "*IOSelectorButton*" style:highest "default_buttons_menus" -widget "*IOSelectorList" style:highest "medium_entry_noselection_fg" -widget "*IOSelectorPortList" style:highest "io_selector_port_list" -widget "*IOSelectorPortList.*" style:highest "io_selector_port_list" -widget "*IOSelectorPortListSelected" style:highest "selected_io_selector_port_list" -widget "*IOSelectorPortListSelected.*" style:highest "selected_io_selector_port_list" -widget "*IOSelectorNotebook" style:highest "io_selector_notebook" -widget "*IOSelectorNotebookTab" style:highest "io_selector_notebook" -widget "*IOSelectorFrame" style:highest "base_frame" -widget "*ConnectionEditorButton" style:highest "default_buttons_menus" -widget "*ConnectionEditorButton*" style:highest "default_buttons_menus" -widget "*ConnectionEditorList" style:highest "medium_entry_noselection_fg" -widget "*ConnectionEditorConnectionList" style:highest "medium_entry" -widget "*ConnectionEditorPortList" style:highest "io_selector_port_list" -widget "*ConnectionEditorPortListSelected" style:highest "selected_io_selector_port_list" -widget "*ConnectionEditorNotebook" style:highest "io_selector_notebook" -widget "*ConnectionEditorNotebookTab" style:highest "io_selector_notebook" -widget "*ConnectionEditorFrame" style:highest "base_frame" -widget "*RouteParamsListDisplay" style:highest "inspector_track_list_display" -widget "*RouteParamsPreListDisplay" style:highest "inspector_redirect_list_display" -widget "*RouteParamsPostListDisplay" style:highest "inspector_redirect_list_display" -widget "*TearOffArrow" style:highest "tearoff_arrow" -widget "*RouteParamsTitleButton" style:highest "medium_text" -widget "*RouteParamsTitleLabel" style:highest "medium_text" -widget "*PluginAutomateRecordButton" style:highest "small_red_active_and_selected_button" -widget "*PluginAutomateRecordButton*" style:highest "small_red_active_and_selected_button" -widget "*PluginAutomatePlayButton" style:highest "small_red_active_and_selected_button" -widget "*PluginAutomatePlayButton*" style:highest "small_red_active_and_selected_button" -widget "*PluginAutomateButton" style:highest "small_button" -widget "*PluginAutomateButton*" style:highest "small_button" -widget "*PluginSaveButton" style:highest "small_button" -widget "*PluginSaveButton*" style:highest "small_button" -widget "*PluginLoadButton" style:highest "small_button" -widget "*PluginLoadButton*" style:highest "small_button" -widget "*FaderMetricsStrip" style:highest "meter_metrics_strip" -widget "*MeterMetricsStrip" style:highest "meter_metrics_strip" -widget "*MetricDialogFrame" style:highest "base_frame" -widget "*MetricEntry" style:highest "medium_bold_entry" -widget "*MetricButton" style:highest "default_buttons_menus" -widget "*MetricButton.*" style:highest "default_buttons_menus" -widget "*MetricLabel" style:highest "medium_text" -widget "*TimeStretchButton" style:highest "default_buttons_menus" -widget "*TimeStretchButton.*" style:highest "default_buttons_menus" -widget "*TimeStretchProgress" style:highest "default_buttons_menus" -widget "*ChoiceWindow" style:highest "default_buttons_menus" -widget "*ChoicePrompt" style:highest "default_buttons_menus" -widget "*ChoiceButton" style:highest "default_buttons_menus" -widget "*ChoiceButton*" style:highest "default_buttons_menus" -widget "*SelectionModeButton" style:highest "default_buttons_menus" -widget "*SelectionModeButton*" style:highest "default_buttons_menus" -widget "*TrackLabel" style:highest "medium_text" -widget "*TrackPlugName" style:highest "medium_text" -widget "*TrackParameterName" style:highest "small_text" -widget "*AddRouteDialog*" style:highest "medium_text" -widget "*AddRouteDialog.GtkLabel" style:highest "medium_text" -widget "*AddRouteDialogChannelChoice" style:highest "medium_bold_entry" -widget "*AddRouteDialogSpinner" style:highest "medium_bold_entry" -widget "*AddRouteDialogSpinner*" style:highest "medium_bold_entry" -widget "*AddRouteDialogRadioButton" style:highest "red_when_active" -widget "*AddRouteDialogButton" style:highest "default_buttons_menus" -widget "*AddRouteDialogNameTemplateEntry" style:highest "medium_bold_entry" -widget "*NewSessionIOLabel" style:highest "larger_bold_text" -widget "*NewSessionSR1Label" style:highest "red_medium_text" -widget "*NewSessionSR2Label" style:highest "medium_text" -widget "*NewSessionChannelChoice" style:highest "medium_bold_entry" -widget "*NewSessionMainButton" style:highest "larger_bold_text" -widget "*NewSessionMainButton*" style:highest "larger_bold_text" -widget "*NewSessionMainLabel" style:highest "larger_bold_text" -widget "*LocationEditRowClock" style:highest "location_rows_clock" -widget "*LocationEditNameLabel" style:highest "medium_text" -widget "*LocationEditSetButton" style:highest "location_row_button" -widget "*LocationEditSetButton*" style:highest "location_row_button" -widget "*LocationEditGoButton" style:highest "location_row_button" -widget "*LocationEditGoButton*" style:highest "location_row_button" -widget "*LocationEditCdButton" style:highest "small_red_active_and_selected_button" -widget "*LocationEditCdButton*" style:highest "small_red_active_and_selected_button" -widget "*LocationEditHideButton" style:highest "small_red_active_and_selected_button" -widget "*LocationEditHideButton*" style:highest "small_red_active_and_selected_button" -widget "*LocationEditNumberLabel" style:highest "small_text" -widget "*LocationLocEditorFrame" style:highest "base_frame" -widget "*LocationRangeEditorFrame" style:highest "base_frame" -widget "*LocationEditNameEntry" style:highest "option_entry" -widget "*LocationAddLocationButton" style:highest "default_buttons_menus" -widget "*LocationAddLocationButton*" style:highest "default_buttons_menus" -widget "*LocationAddRangeButton" style:highest "default_buttons_menus" -widget "*LocationAddRangeButton*" style:highest "default_buttons_menus" -widget "*LocationEditRemoveButton" style:highest "location_row_button" -widget "*LocationEditRemoveButton*" style:highest "location_row_button" -widget "*PanSlider" style:highest "pan_slider" -widget "*PanningLinkButton" style:highest "mixer_red_active_button" -widget "*PanningLinkButton.*" style:highest "mixer_red_active_button" -widget "*PanningLinkDirectionButton" style:highest "very_small_button" -widget "*PanningLinkDirectionButton.*" style:highest "very_small_button" -widget "*ChannelCountSelector" style:highest "medium_bold_entry" -widget "*ChannelCountSelector.GtkArrow" style:highest "default_buttons_menus" -widget "*RegionListWholeFile" style:highest "treeview_parent_node" -widget "*EditorHScrollbar" style:highest "editor_hscrollbar" +#---------- Styles for Lumiera Widgets ----------# + +style "timeline_body" +{ + gtkmm__CustomObject_TimelineBody::track_background = "#7E838B" +} + +style "timeline_header_base" = "default_base" +{ + fg[NORMAL] = { 0.77, 0.77, 0.72 } + bg[NORMAL] = { 0.18, 0.19, 0.22 } + bg[ACTIVE] = { 0.20, 0.20, 0.20 } + bg[PRELIGHT] = { 0.20, 0.20, 0.20 } + bg[INSENSITIVE] = { 0.20, 0.20, 0.20 } + bg[SELECTED] = { 0.20, 0.20, 0.20 } +} + +class "gtkmm__CustomObject_TimelineBody" style:highest "timeline_body" + +widget "*TimelineHeaderBaseUnselected" style:highest "timeline_header_base" diff --git a/src/gui/panels/timeline-panel.cpp b/src/gui/panels/timeline-panel.cpp index f2a29fd61..fc4e7387e 100644 --- a/src/gui/panels/timeline-panel.cpp +++ b/src/gui/panels/timeline-panel.cpp @@ -23,6 +23,8 @@ #include "../gtk-lumiera.hpp" #include "timeline-panel.hpp" +using namespace Gtk; + namespace lumiera { namespace gui { namespace panels { @@ -30,7 +32,7 @@ namespace panels { TimelinePanel::TimelinePanel() : Panel("timeline", _("Timeline"), "timeline_panel") { - pack_start(timeline_widget); + pack_start(timeline_widget, PACK_EXPAND_WIDGET); } } // namespace panels diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index 10eaa3fb0..d201dd47f 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -1,5 +1,5 @@ /* - timeline.cpp - Implementation of the timeline widget + timeline-widget.cpp - Implementation of the timeline widget Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -20,54 +20,117 @@ * *****************************************************/ -#include -#include -#include - #include "timeline-widget.hpp" +using namespace Gtk; +using namespace std; +using namespace lumiera::gui::widgets::timeline; + namespace lumiera { namespace gui { namespace widgets { -TimelineWidget::TimelineWidget() +const int TimelineWidget::TrackPadding = 1; +const int TimelineWidget::HeaderWidth = 100; + +TimelineWidget::TimelineWidget() : + Table(2, 2), + totalHeight(0), + horizontalAdjustment(0, 0, 0), + verticalAdjustment(0, 0, 0), + horizontalScroll(horizontalAdjustment), + verticalScroll(verticalAdjustment), + ruler("ruler") { - set_flags(Gtk::NO_WINDOW); + body = new TimelineBody(this); + g_assert(body != NULL); + headerContainer = new HeaderContainer(this); + g_assert(headerContainer != NULL); + + verticalAdjustment.signal_value_changed().connect( + sigc::mem_fun(this, &TimelineWidget::on_scroll) ); + + attach(*body, 1, 2, 1, 2, FILL|EXPAND, FILL|EXPAND); + attach(ruler, 1, 2, 0, 1, FILL|EXPAND, SHRINK); + attach(*headerContainer, 0, 1, 1, 2, SHRINK, FILL|EXPAND); + attach(horizontalScroll, 1, 2, 2, 3, FILL|EXPAND, SHRINK); + attach(verticalScroll, 2, 3, 1, 2, SHRINK, FILL|EXPAND); + + tracks.push_back(&video1); + tracks.push_back(&video2); + + update_tracks(); + } + +TimelineWidget::~TimelineWidget() + { + g_assert(body != NULL); + delete body; + g_assert(headerContainer != NULL); + delete headerContainer; } void -TimelineWidget::on_realize() +TimelineWidget::on_scroll() { - //Call base class: - Gtk::Widget::on_realize(); - + } - -bool -TimelineWidget::on_expose_event(GdkEventExpose* event) + +void +TimelineWidget::on_size_allocate(Allocation& allocation) { - // This is where we draw on the window - Glib::RefPtr window = get_window(); - if(window) - { - /*Cairo::RefPtr cr = window->create_cairo_context(); - if(event) + Widget::on_size_allocate(allocation); + + update_scroll(); + } + +void +TimelineWidget::update_tracks() + { + g_assert(headerContainer != NULL); + headerContainer->update_headers(); + + // Recalculate the total height of the timeline scrolled area + totalHeight = 0; + vector::iterator i; + for(i = tracks.begin(); i != tracks.end(); i++) { - // clip to the area that needs to be re-exposed so we don't draw any - // more than we need to. - cr->rectangle(event->area.x, event->area.y, - event->area.width, event->area.height); - cr->clip(); - } - - // Paint the background - cr->set_source_rgb(0.0, 0.0, 0.0); - cr->paint();*/ - } - return true; + timeline::Track *track = *i; + g_assert(track != NULL); + totalHeight += track->get_height() + TrackPadding; + } + } + +void +TimelineWidget::update_scroll() + { + g_assert(body != NULL); + const Allocation body_allocation = body->get_allocation(); + + // Calculate the length that can be scrolled: + // the total height of all the tracks minus one screenful + int y_scroll_length = totalHeight - body_allocation.get_height(); + if(y_scroll_length < 0) y_scroll_length = 0; + + // 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); + + verticalAdjustment.set_upper(y_scroll_length); + + // Hide the scrollbar if no scrolling is possible + if(y_scroll_length == 0 && verticalScroll.is_visible()) + verticalScroll.hide(); + else if(y_scroll_length != 0 && !verticalScroll.is_visible()) + verticalScroll.show(); } - +int +TimelineWidget::get_y_scroll_offset() const + { + return (int)verticalAdjustment.get_value(); + } } // namespace widgets } // namespace gui diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index a080d34b2..502b3c535 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -1,5 +1,5 @@ /* - timeline.hpp - Declaration of the timeline widget + timeline-widget.hpp - Declaration of the timeline widget Copyright (C) Lumiera.org 2008, Joel Holdsworth @@ -19,32 +19,74 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/** @file timeline.hpp +/** @file timeline-widget.hpp ** This file contains the definition of timeline widget */ #ifndef TIMELINE_WIDGET_HPP #define TIMELINE_WIDGET_HPP +#include "timeline/header-container.hpp" +#include "timeline/timeline-body.hpp" +#include "timeline/track.hpp" +#include "timeline/video-track.hpp" + #include +#include namespace lumiera { namespace gui { namespace widgets { - class TimelineWidget : public Gtk::Widget - { - public: - TimelineWidget(); +class TimelineWidget : public Gtk::Table + { + public: + TimelineWidget(); - /* ===== Overrides ===== */ - protected: - virtual void on_realize(); - virtual bool on_expose_event(GdkEventExpose* event); - }; + ~TimelineWidget(); + + /* ===== Events ===== */ + protected: + void on_scroll(); + + void on_size_allocate(Gtk::Allocation& allocation); + + /* ===== Internals ===== */ + protected: + + void update_tracks(); + + void update_scroll(); + + int get_y_scroll_offset() const; + + protected: + int totalHeight; + + timeline::VideoTrack video1; + timeline::VideoTrack video2; + std::vector tracks; + + timeline::TimelineBody *body; + timeline::HeaderContainer *headerContainer; + Gtk::Label ruler; + + Gtk::Adjustment horizontalAdjustment, verticalAdjustment; + Gtk::HScrollbar horizontalScroll; + Gtk::VScrollbar verticalScroll; + + /* ===== Constants ===== */ + protected: + static const int TrackPadding; + static const int HeaderWidth; + + friend class timeline::TimelineBody; + friend class timeline::HeaderContainer; + }; } // namespace widgets } // namespace gui } // namespace lumiera #endif // TIMELINE_WIDGET_HPP + diff --git a/src/gui/widgets/timeline/header-container.cpp b/src/gui/widgets/timeline/header-container.cpp new file mode 100644 index 000000000..630f4be90 --- /dev/null +++ b/src/gui/widgets/timeline/header-container.cpp @@ -0,0 +1,193 @@ +/* + header-container.cpp - Implementation of the header container widget + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + +#include "header-container.hpp" +#include "track.hpp" +#include "../timeline-widget.hpp" + +using namespace Gtk; +using namespace std; + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +HeaderContainer::HeaderContainer(lumiera::gui::widgets::TimelineWidget *timeline_widget) : + timelineWidget(timeline_widget) + { + set_flags(Gtk::NO_WINDOW); + set_redraw_on_allocate(false); + + timelineWidget->verticalAdjustment.signal_value_changed().connect( + sigc::mem_fun(this, &HeaderContainer::on_scroll) ); + } + +void +HeaderContainer::update_headers() + { + g_assert(timelineWidget != NULL); + + vector &tracks = timelineWidget->tracks; + vector::iterator i; + for(i = tracks.begin(); i != tracks.end(); i++) + { + timeline::Track *track = *i; + g_assert(track != NULL); + + Widget &header = track->get_header_widget(); + header.set_parent(*this); + header.show(); + } + + layout_headers(); + } + +void +HeaderContainer::on_realize() + { + set_flags(Gtk::NO_WINDOW); + + ensure_style(); + + // Call base class: + Gtk::Widget::on_realize(); + + // Create the GdkWindow: + GdkWindowAttr attributes; + memset(&attributes, 0, sizeof(attributes)); + + Allocation allocation = get_allocation(); + + // Set initial position and size of the Gdk::Window: + attributes.x = allocation.get_x(); + attributes.y = allocation.get_y(); + attributes.width = allocation.get_width(); + attributes.height = allocation.get_height(); + + attributes.event_mask = get_events () | Gdk::EXPOSURE_MASK; + attributes.window_type = GDK_WINDOW_CHILD; + attributes.wclass = GDK_INPUT_OUTPUT; + + gdkWindow = Gdk::Window::create(get_window() /* parent */, &attributes, + GDK_WA_X | GDK_WA_Y); + 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); + + // Make the widget receive expose events + gdkWindow->set_user_data(gobj()); + } + +void +HeaderContainer::on_unrealize() + { + gdkWindow.clear(); + + //Call base class: + Gtk::Widget::on_unrealize(); + } + +void +HeaderContainer::on_size_request (Requisition* requisition) + { + //Initialize the output parameter: + *requisition = Gtk::Requisition(); + + requisition->width = TimelineWidget::HeaderWidth; + requisition->height = 0; + } + +void +HeaderContainer::on_size_allocate (Allocation& allocation) + { + // Use the offered allocation for this container: + set_allocation(allocation); + + // Resize the widget's window + if(gdkWindow) + gdkWindow->resize(allocation.get_width(), allocation.get_height()); + + // Relayout the child widgets of the headers + layout_headers(); + } + +void +HeaderContainer::forall_vfunc(gboolean /* include_internals */, + GtkCallback callback, gpointer callback_data) + { + g_assert(timelineWidget != NULL); + + vector &tracks = timelineWidget->tracks; + vector::iterator i; + for(i = tracks.begin(); i != tracks.end(); i++) + { + timeline::Track *track = *i; + g_assert(track != NULL); + callback(track->get_header_widget().gobj(), + callback_data); + } + } + +void +HeaderContainer::on_scroll() + { + layout_headers(); + } + +void +HeaderContainer::layout_headers() + { + g_assert(timelineWidget != NULL); + + int offset = 0; + const int y_scroll_offset = timelineWidget->get_y_scroll_offset(); + + const Allocation container_allocation = get_allocation(); + + vector &tracks = timelineWidget->tracks; + vector::iterator i; + for(i = tracks.begin(); i != tracks.end(); i++) + { + timeline::Track *track = *i; + g_assert(track != NULL); + Widget &header = track->get_header_widget(); + + const int height = 100;//header->get_track_height(); + + Gtk::Allocation header_allocation; + header_allocation.set_x (0); + header_allocation.set_y (offset - y_scroll_offset); + header_allocation.set_width (container_allocation.get_width ()); + header_allocation.set_height (height); + header.size_allocate(header_allocation); + + offset += height + TimelineWidget::TrackPadding; + } + } + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera diff --git a/src/gui/widgets/timeline/header-container.hpp b/src/gui/widgets/timeline/header-container.hpp new file mode 100644 index 000000000..f82dc3dce --- /dev/null +++ b/src/gui/widgets/timeline/header-container.hpp @@ -0,0 +1,76 @@ +/* + header-container.hpp - Declaration of the header container widget + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ +/** @file header-container.hpp + ** This file contains the definition of the header container + ** widget + */ + +#ifndef HEADER_CONTAINER_HPP +#define HEADER_CONTAINER_HPP + +#include +#include + +namespace lumiera { +namespace gui { +namespace widgets { + +class TimelineWidget; + +namespace timeline { + +class HeaderContainer : public Gtk::Container + { + public: + HeaderContainer(lumiera::gui::widgets::TimelineWidget *timeline_widget); + + void update_headers(); + + private: + void on_realize(); + void on_unrealize(); + + void on_size_allocate (Gtk::Allocation& allocation); + void on_size_request (Gtk::Requisition* requisition); + + void forall_vfunc(gboolean include_internals, GtkCallback callback, + gpointer callback_data); + + void on_scroll(); + + /* ===== Internals ===== */ + private: + void layout_headers(); + + private: + lumiera::gui::widgets::TimelineWidget *timelineWidget; + + Glib::RefPtr gdkWindow; + }; + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera + +#endif // HEADER_CONTAINER_HPP + diff --git a/src/gui/widgets/timeline/timeline-body.cpp b/src/gui/widgets/timeline/timeline-body.cpp new file mode 100644 index 000000000..859abb0e8 --- /dev/null +++ b/src/gui/widgets/timeline/timeline-body.cpp @@ -0,0 +1,137 @@ +/* + timeline.cpp - Implementation of the timeline widget + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + +#include + +#include "timeline-body.hpp" +#include "../timeline-widget.hpp" + +using namespace Gtk; +using namespace std; +using namespace lumiera::gui::widgets; +using namespace lumiera::gui::widgets::timeline; + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +TimelineBody::TimelineBody(lumiera::gui::widgets::TimelineWidget *timeline_widget) : + Glib::ObjectBase("TimelineBody"), + timelineWidget(timeline_widget) + { + g_assert(timelineWidget != NULL); + + // Connect up some events + timelineWidget->horizontalAdjustment.signal_value_changed().connect( + sigc::mem_fun(this, &TimelineBody::on_scroll) ); + timelineWidget->verticalAdjustment.signal_value_changed().connect( + sigc::mem_fun(this, &TimelineBody::on_scroll) ); + + // Install style properties + gtk_widget_class_install_style_property( + GTK_WIDGET_CLASS(G_OBJECT_GET_CLASS(gobj())), + g_param_spec_boxed("track_background", + "Track Background", + "The background colour of timeline tracks", + GDK_TYPE_COLOR, G_PARAM_READABLE)); + + } + +void +TimelineBody::on_scroll() + { + queue_draw(); + } + +bool +TimelineBody::on_expose_event(GdkEventExpose* event) + { + // This is where we draw on the window + Glib::RefPtr window = get_window(); + if(!window) + return false; + + // Makes sure the widget styles have been loaded + read_styles(); + + // Prepare to render via cairo + Gtk::Allocation allocation = get_allocation(); + Cairo::RefPtr cairo = window->create_cairo_context(); + + // Translate the view by the scroll distance + cairo->translate( + -(int)timelineWidget->horizontalAdjustment.get_value(), + -(int)timelineWidget->verticalAdjustment.get_value()); + + // Interate drawing each track + vector::iterator i; + for(i = timelineWidget->tracks.begin(); + i != timelineWidget->tracks.end(); i++) + { + timeline::Track *track = *i; + g_assert(track != NULL); + + const int track_height = track->get_height(); + + // Draw the track background + cairo->rectangle(0, 0, allocation.get_width(), track_height); + gdk_cairo_set_source_color(cairo->cobj(), &track_background); + cairo->fill(); + + // Render the track + cairo->save(); + track->draw_track(cairo); + cairo->restore(); + + // Shift for the next track + cairo->translate(0, track_height + TimelineWidget::TrackPadding); + } + + return true; + } + +void +TimelineBody::read_styles() + { + GdkColor *colour; + + gtk_widget_style_get(Widget::gobj(), "track_background", &colour, NULL); + + // Did the color load successfully? + if(colour != NULL) + track_background = *colour; + else + { + g_warning("track_background style value failed to load"); + track_background.red = 0x0000; + track_background.green = 0x0000; + track_background.blue = 0x0000; + track_background.pixel = 0x00000000; + } + } + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera + diff --git a/src/gui/widgets/timeline/timeline-body.hpp b/src/gui/widgets/timeline/timeline-body.hpp new file mode 100644 index 000000000..d3ba192ab --- /dev/null +++ b/src/gui/widgets/timeline/timeline-body.hpp @@ -0,0 +1,65 @@ +/* + timeline-body.hpp - Declaration of the timeline body widget + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ +/** @file timeline-body.hpp + ** This file contains the definition of timeline body widget + */ + +#ifndef TIMELINE_BODY_HPP +#define TIMELINE_BODY_HPP + +#include + +namespace lumiera { +namespace gui { +namespace widgets { + +class TimelineWidget; + +namespace timeline { + +class TimelineBody : public Gtk::DrawingArea + { + public: + TimelineBody(lumiera::gui::widgets::TimelineWidget *timeline_widget); + + /* ===== Events ===== */ + protected: + void on_scroll(); + + virtual bool on_expose_event(GdkEventExpose* event); + + /* ===== Internals ===== */ + private: + void read_styles(); + + private: + GdkColor track_background; + + lumiera::gui::widgets::TimelineWidget *timelineWidget; + }; + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera + +#endif // TIMELINE_BODY_HPP diff --git a/src/gui/widgets/timeline/track.cpp b/src/gui/widgets/timeline/track.cpp new file mode 100644 index 000000000..6b915949d --- /dev/null +++ b/src/gui/widgets/timeline/track.cpp @@ -0,0 +1,57 @@ +/* + track.cpp - Implementation of the timeline track object + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + +#include "track.hpp" + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +Track::Track() + { + + } + +Glib::ustring +Track::get_title() + { + return "Hello"; + } + +int +Track::get_height() + { + return get_header_widget().get_allocation().get_height(); + } + +void +Track::draw_track(Cairo::RefPtr cairo) + { + + } + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera + diff --git a/src/gui/widgets/timeline/track.hpp b/src/gui/widgets/timeline/track.hpp new file mode 100644 index 000000000..5f368ea18 --- /dev/null +++ b/src/gui/widgets/timeline/track.hpp @@ -0,0 +1,58 @@ +/* + track.hpp - Declaration of the timeline track object + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ +/** @file track.hpp + ** This file contains the definition of timeline track object + */ + +#ifndef TRACK_HPP +#define TRACK_HPP + +#include + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +class Track + { + public: + Track(); + + Glib::ustring get_title(); + + virtual Gtk::Widget& get_header_widget() = 0; + + virtual int get_height(); + + virtual void draw_track(Cairo::RefPtr cairo); + + protected: + }; + + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera + +#endif // TRACK_HPP diff --git a/src/gui/widgets/timeline/video-track.cpp b/src/gui/widgets/timeline/video-track.cpp new file mode 100644 index 000000000..b20992543 --- /dev/null +++ b/src/gui/widgets/timeline/video-track.cpp @@ -0,0 +1,62 @@ +/* + video-track.cpp - Implementation of the timeline video track object + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + +#include "video-track.hpp" + +using namespace Gtk; + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +VideoTrack::VideoTrack() : + headerWidget("HeaderTest") + { + headerFrame.add(headerWidget); + headerFrame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT); + headerFrame.set_name ("TimelineHeaderBaseUnselected"); + } + +Gtk::Widget& +VideoTrack::get_header_widget() + { + return headerFrame; + } + +/*int +VideoTrack::get_height() + { + return 100; + }*/ + +void +VideoTrack::draw_track(Cairo::RefPtr cairo) + { + + } + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera + diff --git a/src/gui/widgets/timeline/video-track.hpp b/src/gui/widgets/timeline/video-track.hpp new file mode 100644 index 000000000..fad2f77af --- /dev/null +++ b/src/gui/widgets/timeline/video-track.hpp @@ -0,0 +1,58 @@ +/* + video-track.hpp - Declaration of the timeline video track object + + Copyright (C) Lumiera.org + 2008, Joel Holdsworth + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ +/** @file video-track.hpp + ** This file contains the definition of video track object + */ + +#ifndef VIDEO_TRACK_HPP +#define VIDEO_TRACK_HPP + +#include "track.hpp" + +namespace lumiera { +namespace gui { +namespace widgets { +namespace timeline { + +class VideoTrack : public Track + { + public: + VideoTrack(); + + virtual Gtk::Widget& get_header_widget(); + + //virtual int get_height(); + + virtual void draw_track(Cairo::RefPtr cairo); + + protected: + Gtk::Label headerWidget; + Gtk::Frame headerFrame; + }; + +} // namespace timeline +} // namespace widgets +} // namespace gui +} // namespace lumiera + +#endif // VIDEO_TRACK_HPP + diff --git a/src/gui/widgets/video-display-widget.cpp b/src/gui/widgets/video-display-widget.cpp index 920ea379c..2c7be8111 100644 --- a/src/gui/widgets/video-display-widget.cpp +++ b/src/gui/widgets/video-display-widget.cpp @@ -36,123 +36,123 @@ namespace widgets { VideoDisplayWidget::VideoDisplayWidget() : gdkWindow(NULL), displayer(NULL) -{ - set_flags(Gtk::NO_WINDOW); -} + { + set_flags(Gtk::NO_WINDOW); + } VideoDisplayWidget::~VideoDisplayWidget() -{ - if(displayer != NULL) - delete displayer; -} + { + if(displayer != NULL) + delete displayer; + } void VideoDisplayWidget::on_realize() -{ - set_flags(Gtk::NO_WINDOW); + { + set_flags(Gtk::NO_WINDOW); - //Call base class: - Gtk::Widget::on_realize(); + // Call base class: + Gtk::Widget::on_realize(); - //Create the GdkWindow: - GdkWindowAttr attributes; - memset(&attributes, 0, sizeof(attributes)); + // Create the GdkWindow: + GdkWindowAttr attributes; + memset(&attributes, 0, sizeof(attributes)); - Gtk::Allocation allocation = get_allocation(); + Gtk::Allocation allocation = get_allocation(); - //Set initial position and size of the Gdk::Window: - attributes.x = allocation.get_x(); - attributes.y = allocation.get_y(); - attributes.width = allocation.get_width(); - attributes.height = allocation.get_height(); + // Set initial position and size of the Gdk::Window: + attributes.x = allocation.get_x(); + attributes.y = allocation.get_y(); + attributes.width = allocation.get_width(); + attributes.height = allocation.get_height(); - attributes.event_mask = get_events () | Gdk::EXPOSURE_MASK; - attributes.window_type = GDK_WINDOW_CHILD; - attributes.wclass = GDK_INPUT_OUTPUT; + attributes.event_mask = get_events () | Gdk::EXPOSURE_MASK; + attributes.window_type = GDK_WINDOW_CHILD; + attributes.wclass = GDK_INPUT_OUTPUT; - gdkWindow = Gdk::Window::create(get_window() /* parent */, &attributes, - GDK_WA_X | GDK_WA_Y); - unset_flags(Gtk::NO_WINDOW); - set_window(gdkWindow); + gdkWindow = Gdk::Window::create(get_window() /* parent */, &attributes, + GDK_WA_X | GDK_WA_Y); + unset_flags(Gtk::NO_WINDOW); + set_window(gdkWindow); - //set colors - modify_bg(Gtk::STATE_NORMAL, Gdk::Color("black")); + // Set colors + modify_bg(Gtk::STATE_NORMAL, Gdk::Color("black")); - //make the widget receive expose events - gdkWindow->set_user_data(gobj()); + // Make the widget receive expose events + gdkWindow->set_user_data(gobj()); - if(displayer != NULL) - delete displayer; - displayer = createDisplayer(this, 320, 240); + if(displayer != NULL) + delete displayer; + displayer = createDisplayer(this, 320, 240); - add_events(Gdk::ALL_EVENTS_MASK); -} + add_events(Gdk::ALL_EVENTS_MASK); + } void VideoDisplayWidget::on_unrealize() -{ - gdkWindow.clear(); + { + gdkWindow.clear(); - //Call base class: - Gtk::Widget::on_unrealize(); -} + //Call base class: + Gtk::Widget::on_unrealize(); + } bool VideoDisplayWidget::on_button_press_event (GdkEventButton* event) -{ - unsigned char buffer[320 * 240 * 4]; + { + unsigned char buffer[320 * 240 * 4]; - for(int i = 0; i < 320*240*4; i++) - buffer[i] = rand(); + for(int i = 0; i < 320*240*4; i++) + buffer[i] = rand(); - displayer->put((void*)buffer); + displayer->put((void*)buffer); - return true; -} + return true; + } bool VideoDisplayWidget::on_expose_event(GdkEventExpose* event) -{ - // This is where we draw on the window - /*Glib::RefPtr window = get_window(); - if(window) { - Cairo::RefPtr cr = window->create_cairo_context(); - if(event) + // This is where we draw on the window + /*Glib::RefPtr window = get_window(); + if(window) { - // clip to the area that needs to be re-exposed so we don't draw any - // more than we need to. - cr->rectangle(event->area.x, event->area.y, - event->area.width, event->area.height); - cr->clip(); - } + Cairo::RefPtr cr = window->create_cairo_context(); + if(event) + { + // clip to the area that needs to be re-exposed so we don't draw any + // more than we need to. + cr->rectangle(event->area.x, event->area.y, + event->area.width, event->area.height); + cr->clip(); + } - // Paint the background - cr->set_source_rgb(0.0, 0.0, 0.0); - cr->paint(); - }*/ - return true; -} + // Paint the background + cr->set_source_rgb(0.0, 0.0, 0.0); + cr->paint(); + }*/ + return true; + } Displayer* VideoDisplayWidget::createDisplayer( Gtk::Widget *drawingArea, int width, int height ) -{ - Displayer *displayer = NULL; - - displayer = new XvDisplayer( drawingArea, width, height ); - if ( !displayer->usable() ) { - delete displayer; - displayer = NULL; - } + Displayer *displayer = NULL; - if ( displayer == NULL ) - { - displayer = new GdkDisplayer( drawingArea, width, height ); - } + displayer = new XvDisplayer( drawingArea, width, height ); + if ( !displayer->usable() ) + { + delete displayer; + displayer = NULL; + } - return displayer; -} + if ( displayer == NULL ) + { + displayer = new GdkDisplayer( drawingArea, width, height ); + } + + return displayer; + } } // namespace widgets } // namespace gui diff --git a/src/gui/widgets/video-display-widget.hpp b/src/gui/widgets/video-display-widget.hpp index 7a80a4b04..66e224c18 100644 --- a/src/gui/widgets/video-display-widget.hpp +++ b/src/gui/widgets/video-display-widget.hpp @@ -51,6 +51,7 @@ namespace widgets { virtual bool on_expose_event(GdkEventExpose* event); + // TEST CODE!!!! virtual bool on_button_press_event (GdkEventButton* event); /* ===== Internals ===== */