Added the base of a timeline widget

This commit is contained in:
Joel Holdsworth 2008-04-19 20:31:27 +01:00
parent 82a000662b
commit b8fd3885f4
7 changed files with 148 additions and 19 deletions

View file

@ -23,14 +23,16 @@ gtk_lumiera_SOURCES = \
dialogs/render.hpp \
panels/panel.cpp \
panels/panel.hpp \
panels/timeline.cpp \
panels/timeline.hpp \
panels/timeline-panel.cpp \
panels/timeline-panel.hpp \
panels/viewer.cpp \
panels/viewer.hpp \
panels/assets.cpp \
panels/assets.hpp \
widgets/video-display.cpp \
widgets/video-display.hpp \
widgets/timeline-widget.cpp \
widgets/timeline-widget.hpp \
model/project.cpp \
model/project.hpp

View file

@ -1,5 +1,5 @@
/*
timeline.cpp - Implementation of the timeline panel
timeline-panel.cpp - Implementation of the timeline panel
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
@ -20,17 +20,16 @@
* *****************************************************/
#include "timeline.hpp"
#include "timeline-panel.hpp"
namespace lumiera {
namespace gui {
namespace panels {
Timeline::Timeline() :
Panel("timeline", "Timeline"),
placeholder("Placeholder label. Is Timeline the correct title for this panel?")
TimelinePanel::TimelinePanel() :
Panel("timeline", "Timeline")
{
pack_start(placeholder);
pack_start(timeline_widget);
}
} // namespace panels

View file

@ -1,5 +1,5 @@
/*
timeline.hpp - Definition of the timeline panel
timeline-panel.hpp - Definition of the timeline panel
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
@ -19,30 +19,33 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/** @file timeline.hpp
/** @file timeline-panel.hpp
** This file contains the definition of the timeline panel
*/
#ifndef TIMELINE_HPP
#define TIMELINE_HPP
#ifndef TIMELINE_PANEL_HPP
#define TIMELINE_PANEL_HPP
#include "panel.hpp"
#include "../widgets/timeline-widget.hpp"
using namespace lumiera::gui::widgets;
namespace lumiera {
namespace gui {
namespace panels {
class Timeline : public Panel
class TimelinePanel : public Panel
{
public:
Timeline();
TimelinePanel();
protected:
Gtk::Label placeholder;
TimelineWidget timeline_widget;
};
} // namespace panels
} // namespace gui
} // namespace lumiera
#endif // TIMELINE_H
#endif // TIMELINE_PANEL_H

View file

@ -0,0 +1,75 @@
/*
timeline.cpp - Implementation 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.
* *****************************************************/
#include <gdkmm/drawable.h>
#include <gdkmm/general.h>
#include <cairomm-1.0/cairomm/cairomm.h>
#include "timeline-widget.hpp"
namespace lumiera {
namespace gui {
namespace widgets {
TimelineWidget::TimelineWidget()
{
set_flags(Gtk::NO_WINDOW);
}
void
TimelineWidget::on_realize()
{
//Call base class:
Gtk::Widget::on_realize();
}
bool
TimelineWidget::on_expose_event(GdkEventExpose* event)
{
// This is where we draw on the window
Glib::RefPtr<Gdk::Window> window = get_window();
if(window)
{
/*Cairo::RefPtr<Cairo::Context> 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;
}
} // namespace widgets
} // namespace gui
} // namespace lumiera

View file

@ -0,0 +1,50 @@
/*
timeline.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.
*/
/** @file timeline.hpp
** This file contains the definition of timeline widget
*/
#ifndef TIMELINE_WIDGET_HPP
#define TIMELINE_WIDGET_HPP
#include <gtkmm.h>
namespace lumiera {
namespace gui {
namespace widgets {
class TimelineWidget : public Gtk::Widget
{
public:
TimelineWidget();
/* ===== Overrides ===== */
protected:
virtual void on_realize();
virtual bool on_expose_event(GdkEventExpose* event);
};
} // namespace widgets
} // namespace gui
} // namespace lumiera
#endif // TIMELINE_WIDGET_HPP

View file

@ -47,4 +47,4 @@ namespace widgets {
} // namespace gui
} // namespace lumiera
#endif // VIDEO_DISPLAY_H
#endif // VIDEO_DISPLAY_HPP

View file

@ -36,7 +36,7 @@
#include "../panels/assets.hpp"
#include "../panels/viewer.hpp"
#include "../panels/timeline.hpp"
#include "../panels/timeline-panel.hpp"
using namespace lumiera::gui::panels;
@ -79,7 +79,7 @@ namespace workspace {
private:
Assets assets;
Viewer viewer;
Timeline timeline;
TimelinePanel timeline;
/* ===== Helpers ===== */
private: