diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/videowidget.cc | 28 | ||||
-rw-r--r-- | src/videowidget.h | 13 |
2 files changed, 38 insertions, 3 deletions
diff --git a/src/videowidget.cc b/src/videowidget.cc index 4fadb1d..859763d 100644 --- a/src/videowidget.cc +++ b/src/videowidget.cc @@ -31,6 +31,9 @@ /* * $Log$ + * Revision 1.4 2005/07/25 15:35:41 deva + * *** empty log message *** + * * Revision 1.3 2005/05/03 08:31:59 deva * Removed the error object, and replaced it with a more generic info object. * @@ -44,8 +47,10 @@ #include "videowidget.h" -VideoWidget::VideoWidget(QWidget *parent) : QWidget(parent, "") +VideoWidget::VideoWidget(QWidget *p) : QWidget(p, "") { + parent = p; + // A welltested hack to force SDL to draw in the QWidget QString ids; setenv("SDL_WINDOWID", ids.setNum(winId()), 1); @@ -60,4 +65,25 @@ QPixmap VideoWidget::getScreenshot() return QPixmap::grabWindow (winId()); } +void VideoWidget::mousePressEvent(QMouseEvent *event) +{ + if(isFullScreen()) { + + printf("Going normal\n"); + + reparent(parent, 0, QPoint(0,0), FALSE); + + showNormal(); + + } else { + + printf("Going fullscreen\n"); + + reparent(NULL, 0, QPoint(10,10), FALSE); + + showFullScreen(); + + } +} + #endif /* USE_GUI */ diff --git a/src/videowidget.h b/src/videowidget.h index 4159bb9..9283a8e 100644 --- a/src/videowidget.h +++ b/src/videowidget.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /*************************************************************************** * videowidget.h * @@ -30,6 +31,9 @@ /* * $Log$ + * Revision 1.5 2005/07/25 15:35:41 deva + * *** empty log message *** + * * Revision 1.4 2005/05/03 08:31:59 deva * Removed the error object, and replaced it with a more generic info object. * @@ -50,12 +54,17 @@ class VideoWidget : public QWidget { Q_OBJECT - public: +public: VideoWidget(QWidget *parent); ~VideoWidget(); QPixmap getScreenshot(); + void mousePressEvent(QMouseEvent *event); + +signals: + void clicked(); - private: +private: + QWidget *parent; }; #endif /* __VIDEOWIDGET_H__ */ |