From 8de0bdc9a16f0dd3b97d437a89e8217303947816 Mon Sep 17 00:00:00 2001 From: Jean-Nicolas Artaud Date: Wed, 15 Jan 2014 00:23:22 +0100 Subject: [PATCH] Moves VideoGLWidget into widgets folder. --- src/CMakeLists.txt | 2 +- src/monitor.h | 2 +- src/videoglwidget.h | 41 -------------------- src/{ => widgets}/videoglwidget.cpp | 21 +++++++++- src/widgets/videoglwidget.h | 60 +++++++++++++++++++++++++++++ 5 files changed, 82 insertions(+), 44 deletions(-) delete mode 100644 src/videoglwidget.h rename src/{ => widgets}/videoglwidget.cpp (78%) create mode 100644 src/widgets/videoglwidget.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7caa091b..ad661ad6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -260,7 +260,7 @@ kde4_add_ui_files(kdenlive_UIS ) if(OPENGL_FOUND) - list(APPEND kdenlive_SRCS videoglwidget.cpp) + list(APPEND kdenlive_SRCS widgets/videoglwidget.cpp) endif(OPENGL_FOUND) if(BUILD_JogShuttle) diff --git a/src/monitor.h b/src/monitor.h index dde2828b..e65f2ec9 100644 --- a/src/monitor.h +++ b/src/monitor.h @@ -27,7 +27,7 @@ #include "timecodedisplay.h" #include "abstractmonitor.h" #ifdef USE_OPENGL -#include "videoglwidget.h" +#include "widgets/videoglwidget.h" #endif #include diff --git a/src/videoglwidget.h b/src/videoglwidget.h deleted file mode 100644 index 99e22e4e..00000000 --- a/src/videoglwidget.h +++ /dev/null @@ -1,41 +0,0 @@ - -#ifndef VIDEOGLWIDGET_H -#define VIDEOGLWIDGET_H - -#include - -class VideoGLWidget : public QGLWidget -{ - Q_OBJECT - -public: - explicit VideoGLWidget(QWidget *parent = 0); - ~VideoGLWidget(); - void activateMonitor(); - QSize minimumSizeHint() const; - QSize sizeHint() const; - void setImageAspectRatio(double ratio); - void setBackgroundColor(const QColor &color) { - m_backgroundColor = color; - } - -public slots: - void showImage(const QImage &image); - -protected: - void initializeGL(); - void resizeGL(int width, int height); - void resizeEvent(QResizeEvent* event); - void paintGL(); - void mouseDoubleClickEvent(QMouseEvent * event); - -private: - int x, y, w, h; - int m_image_width, m_image_height; - GLuint m_texture; - double m_display_ratio; - QColor m_backgroundColor; - Qt::WindowFlags m_baseFlags; -}; - -#endif diff --git a/src/videoglwidget.cpp b/src/widgets/videoglwidget.cpp similarity index 78% rename from src/videoglwidget.cpp rename to src/widgets/videoglwidget.cpp index 3da19948..375f2d6b 100644 --- a/src/videoglwidget.cpp +++ b/src/widgets/videoglwidget.cpp @@ -1,3 +1,22 @@ +/*************************************************************************** + * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) * + * 2014 by Jean-Nicolas Artaud (jeannicolasartaud@gmail.com) * + * * + * 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., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ #include #include @@ -6,7 +25,7 @@ #else #include #endif -#include "videoglwidget.h" +#include "widgets/videoglwidget.h" #ifndef GL_TEXTURE_RECTANGLE_EXT #define GL_TEXTURE_RECTANGLE_EXT GL_TEXTURE_RECTANGLE_NV diff --git a/src/widgets/videoglwidget.h b/src/widgets/videoglwidget.h new file mode 100644 index 00000000..de2304f4 --- /dev/null +++ b/src/widgets/videoglwidget.h @@ -0,0 +1,60 @@ +/*************************************************************************** + * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) * + * 2014 by Jean-Nicolas Artaud (jeannicolasartaud@gmail.com) * + * * + * 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., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + +#ifndef VIDEOGLWIDGET_H +#define VIDEOGLWIDGET_H + +#include + +class VideoGLWidget : public QGLWidget +{ + Q_OBJECT + +public: + explicit VideoGLWidget(QWidget *parent = 0); + ~VideoGLWidget(); + void activateMonitor(); + QSize minimumSizeHint() const; + QSize sizeHint() const; + void setImageAspectRatio(double ratio); + void setBackgroundColor(const QColor &color) { + m_backgroundColor = color; + } + +public slots: + void showImage(const QImage &image); + +protected: + void initializeGL(); + void resizeGL(int width, int height); + void resizeEvent(QResizeEvent* event); + void paintGL(); + void mouseDoubleClickEvent(QMouseEvent * event); + +private: + int x, y, w, h; + int m_image_width, m_image_height; + GLuint m_texture; + double m_display_ratio; + QColor m_backgroundColor; + Qt::WindowFlags m_baseFlags; +}; + +#endif -- 2.39.2