Renamed mainwindow.* -> main-window.*, and added the base of video
viewer widget
This commit is contained in:
parent
1c91e56fc5
commit
368f3595b4
10 changed files with 150 additions and 17 deletions
|
|
@ -20,8 +20,8 @@ gtk_lumiera_SOURCES = \
|
|||
gtk-lumiera.hpp \
|
||||
workspace/actions.cpp \
|
||||
workspace/actions.hpp \
|
||||
workspace/mainwindow.cpp \
|
||||
workspace/mainwindow.hpp \
|
||||
workspace/main-window.cpp \
|
||||
workspace/main-window.hpp \
|
||||
dialogs/render.cpp \
|
||||
dialogs/render.hpp \
|
||||
panels/panel.cpp \
|
||||
|
|
@ -31,7 +31,9 @@ gtk_lumiera_SOURCES = \
|
|||
panels/viewer.cpp \
|
||||
panels/viewer.hpp \
|
||||
panels/assets.cpp \
|
||||
panels/assets.hpp
|
||||
panels/assets.hpp \
|
||||
widgets/video-display.cpp \
|
||||
widgets/video-display.hpp
|
||||
|
||||
gtk_lumiera_LDFLAGS =
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#endif
|
||||
|
||||
#include "gtk-lumiera.hpp"
|
||||
#include "workspace/mainwindow.hpp"
|
||||
#include "workspace/main-window.hpp"
|
||||
|
||||
using namespace lumiera::gui;
|
||||
using namespace lumiera::gui::workspace;
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@
|
|||
** This file contains the definition of the timeline panel
|
||||
*/
|
||||
|
||||
#ifndef TIMELINE_H
|
||||
#define TIMELINE_H
|
||||
#ifndef TIMELINE_HPP
|
||||
#define TIMELINE_HPP
|
||||
|
||||
#include "panel.hpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -22,15 +22,16 @@
|
|||
|
||||
#include "viewer.hpp"
|
||||
|
||||
using namespace lumiera::gui::widgets;
|
||||
|
||||
namespace lumiera {
|
||||
namespace gui {
|
||||
namespace panels {
|
||||
|
||||
Viewer::Viewer() :
|
||||
Panel("viewer", "Viewer"),
|
||||
placeholder("Placeholder: XVideo in here!!!")
|
||||
Panel("viewer", "Viewer")
|
||||
{
|
||||
pack_start(placeholder);
|
||||
pack_start(display);
|
||||
}
|
||||
|
||||
} // namespace panels
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@
|
|||
#define VIEWER_H
|
||||
|
||||
#include "panel.hpp"
|
||||
#include "../widgets/video-display.hpp"
|
||||
|
||||
using namespace lumiera::gui::widgets;
|
||||
|
||||
namespace lumiera {
|
||||
namespace gui {
|
||||
|
|
@ -38,7 +41,7 @@ namespace panels {
|
|||
Viewer();
|
||||
|
||||
protected:
|
||||
Gtk::Button placeholder;
|
||||
VideoDisplay display;
|
||||
};
|
||||
|
||||
} // namespace panels
|
||||
|
|
|
|||
77
gui/src/widgets/video-display.cpp
Normal file
77
gui/src/widgets/video-display.cpp
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
video-display.cpp - Implementation of the video viewer 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 "video-display.hpp"
|
||||
|
||||
namespace lumiera {
|
||||
namespace gui {
|
||||
namespace widgets {
|
||||
|
||||
VideoDisplay::VideoDisplay()
|
||||
{
|
||||
set_flags(Gtk::NO_WINDOW);
|
||||
}
|
||||
|
||||
void
|
||||
VideoDisplay::on_realize()
|
||||
{
|
||||
//Call base class:
|
||||
Gtk::Widget::on_realize();
|
||||
|
||||
}
|
||||
|
||||
bool
|
||||
VideoDisplay::on_expose_event(GdkEventExpose* event)
|
||||
{
|
||||
// This is where we draw on the window
|
||||
Glib::RefPtr<Gdk::Window> window = get_window();
|
||||
if(window)
|
||||
{
|
||||
double scale_x = 1;
|
||||
double scale_y = 1;
|
||||
|
||||
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
|
||||
|
||||
50
gui/src/widgets/video-display.hpp
Normal file
50
gui/src/widgets/video-display.hpp
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
video-display.hpp - Declaration of the video viewer 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 viewer.hpp
|
||||
** This file contains the definition of video viewer widget
|
||||
*/
|
||||
|
||||
#ifndef VIDEO_DISPLAY_HPP
|
||||
#define VIDEO_DISPLAY_HPP
|
||||
|
||||
#include <gtkmm.h>
|
||||
|
||||
namespace lumiera {
|
||||
namespace gui {
|
||||
namespace widgets {
|
||||
|
||||
class VideoDisplay : public Gtk::Widget
|
||||
{
|
||||
public:
|
||||
VideoDisplay();
|
||||
|
||||
/* ===== Overrides ===== */
|
||||
protected:
|
||||
virtual void on_realize();
|
||||
virtual bool on_expose_event(GdkEventExpose* event);
|
||||
};
|
||||
|
||||
} // namespace widgets
|
||||
} // namespace gui
|
||||
} // namespace lumiera
|
||||
|
||||
#endif // VIDEO_DISPLAY_H
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#include "../gtk-lumiera.hpp"
|
||||
#include "actions.hpp"
|
||||
#include "mainwindow.hpp"
|
||||
#include "main-window.hpp"
|
||||
|
||||
namespace lumiera {
|
||||
namespace gui {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
MainWindow.cpp - Definition of the main workspace window object
|
||||
main-window.cpp - Definition of the main workspace window object
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
#include <libgdl-1.0/gdl/gdl-switcher.h>
|
||||
|
||||
#include "gtk-lumiera.hpp"
|
||||
#include "mainwindow.hpp"
|
||||
#include "main-window.hpp"
|
||||
|
||||
using namespace Gtk;
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
mainwindow.hpp - Definition of the main workspace window object
|
||||
main-window.hpp - Definition of the main workspace window object
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
|
||||
|
|
@ -26,8 +26,8 @@
|
|||
** @see actions.hpp
|
||||
*/
|
||||
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
#ifndef MAIN_WINDOW_HPP
|
||||
#define MAIN_WINDOW_HPP
|
||||
|
||||
#include <gtkmm.h>
|
||||
#include <libgdl-1.0/gdl/gdl-dock-layout.h>
|
||||
|
|
@ -84,4 +84,4 @@ namespace workspace {
|
|||
} // namespace gui
|
||||
} // namespace lumiera
|
||||
|
||||
#endif // MAIN_WINDOW_H
|
||||
#endif // MAIN_WINDOW_HPP
|
||||
Loading…
Reference in a new issue