2008-04-12 22:15:07 +02:00
|
|
|
/*
|
2008-05-31 14:22:15 +02:00
|
|
|
timeline-widget.hpp - Declaration of the timeline widget
|
2008-04-12 22:15:07 +02:00
|
|
|
|
|
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
*/
|
2008-05-31 14:22:15 +02:00
|
|
|
/** @file timeline-widget.hpp
|
2008-04-19 21:31:27 +02:00
|
|
|
** This file contains the definition of timeline widget
|
2008-04-12 22:15:07 +02:00
|
|
|
*/
|
|
|
|
|
|
2008-04-19 21:31:27 +02:00
|
|
|
#ifndef TIMELINE_WIDGET_HPP
|
|
|
|
|
#define TIMELINE_WIDGET_HPP
|
2008-04-12 22:15:07 +02:00
|
|
|
|
2008-06-05 21:27:53 +02:00
|
|
|
#include "timeline/header-container.hpp"
|
2008-05-31 14:22:15 +02:00
|
|
|
#include "timeline/timeline-body.hpp"
|
|
|
|
|
#include "timeline/track.hpp"
|
|
|
|
|
#include "timeline/video-track.hpp"
|
|
|
|
|
|
2008-04-19 21:31:27 +02:00
|
|
|
#include <gtkmm.h>
|
2008-05-31 14:22:15 +02:00
|
|
|
#include <vector>
|
2008-04-12 22:15:07 +02:00
|
|
|
|
|
|
|
|
namespace lumiera {
|
|
|
|
|
namespace gui {
|
2008-04-19 21:31:27 +02:00
|
|
|
namespace widgets {
|
2008-04-12 22:15:07 +02:00
|
|
|
|
2008-05-31 14:22:15 +02:00
|
|
|
class TimelineWidget : public Gtk::Table
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
TimelineWidget();
|
|
|
|
|
|
|
|
|
|
~TimelineWidget();
|
|
|
|
|
|
|
|
|
|
/* ===== Events ===== */
|
|
|
|
|
protected:
|
|
|
|
|
void on_scroll();
|
2008-06-05 21:27:53 +02:00
|
|
|
|
|
|
|
|
void on_size_allocate(Gtk::Allocation& allocation);
|
2008-05-31 14:22:15 +02:00
|
|
|
|
|
|
|
|
/* ===== Internals ===== */
|
|
|
|
|
protected:
|
2008-06-05 21:27:53 +02:00
|
|
|
|
|
|
|
|
void update_tracks();
|
|
|
|
|
|
|
|
|
|
void update_scroll();
|
|
|
|
|
|
|
|
|
|
int get_y_scroll_offset() const;
|
2008-05-31 14:22:15 +02:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
int totalHeight;
|
|
|
|
|
|
|
|
|
|
timeline::VideoTrack video1;
|
|
|
|
|
timeline::VideoTrack video2;
|
|
|
|
|
std::vector<timeline::Track*> tracks;
|
|
|
|
|
|
2008-06-06 00:57:04 +02:00
|
|
|
Glib::RefPtr<timeline::TimelineBody> body;
|
|
|
|
|
Glib::RefPtr<timeline::HeaderContainer> headerContainer;
|
2008-06-05 21:27:53 +02:00
|
|
|
Gtk::Label ruler;
|
2008-05-31 14:22:15 +02:00
|
|
|
|
|
|
|
|
Gtk::Adjustment horizontalAdjustment, verticalAdjustment;
|
|
|
|
|
Gtk::HScrollbar horizontalScroll;
|
|
|
|
|
Gtk::VScrollbar verticalScroll;
|
2008-05-31 19:21:05 +02:00
|
|
|
|
|
|
|
|
/* ===== Constants ===== */
|
|
|
|
|
protected:
|
|
|
|
|
static const int TrackPadding;
|
2008-06-05 21:27:53 +02:00
|
|
|
static const int HeaderWidth;
|
2008-05-31 14:22:15 +02:00
|
|
|
|
|
|
|
|
friend class timeline::TimelineBody;
|
2008-06-05 21:27:53 +02:00
|
|
|
friend class timeline::HeaderContainer;
|
2008-05-31 14:22:15 +02:00
|
|
|
};
|
2008-04-12 22:15:07 +02:00
|
|
|
|
2008-04-19 21:31:27 +02:00
|
|
|
} // namespace widgets
|
2008-04-12 22:15:07 +02:00
|
|
|
} // namespace gui
|
|
|
|
|
} // namespace lumiera
|
|
|
|
|
|
2008-04-19 21:31:27 +02:00
|
|
|
#endif // TIMELINE_WIDGET_HPP
|
2008-05-31 14:22:15 +02:00
|
|
|
|