lumiera_/src/gui/widgets/timeline-widget.hpp

93 lines
2.3 KiB
C++
Raw Normal View History

/*
2008-05-31 14:22:15 +02:00
timeline-widget.hpp - Declaration of the timeline widget
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-19 21:31:27 +02:00
#ifndef TIMELINE_WIDGET_HPP
#define TIMELINE_WIDGET_HPP
#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>
namespace lumiera {
namespace gui {
2008-04-19 21:31:27 +02:00
namespace widgets {
2008-05-31 14:22:15 +02:00
class TimelineWidget : public Gtk::Table
{
public:
TimelineWidget();
~TimelineWidget();
/* ===== Events ===== */
protected:
void on_scroll();
void on_size_allocate(Gtk::Allocation& allocation);
2008-05-31 14:22:15 +02:00
/* ===== Internals ===== */
protected:
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;
timeline::TimelineBody *body;
timeline::HeaderContainer *headerContainer;
Gtk::Label ruler;
2008-05-31 14:22:15 +02:00
Gtk::Adjustment horizontalAdjustment, verticalAdjustment;
Gtk::HScrollbar horizontalScroll;
Gtk::VScrollbar verticalScroll;
/* ===== Constants ===== */
protected:
static const int TrackPadding;
static const int HeaderWidth;
2008-05-31 14:22:15 +02:00
friend class timeline::TimelineBody;
friend class timeline::HeaderContainer;
2008-05-31 14:22:15 +02:00
};
2008-04-19 21:31:27 +02:00
} // namespace widgets
} // namespace gui
} // namespace lumiera
2008-04-19 21:31:27 +02:00
#endif // TIMELINE_WIDGET_HPP
2008-05-31 14:22:15 +02:00