From f2851a7b132ecc92fad01f5d89418fd912f62cd5 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Kempf Date: Sun, 28 Dec 2008 23:00:59 +0100 Subject: [PATCH] Qt: Move code around and simplify the inclusion of headers. Signed-off-by: Jean-Baptiste Kempf --- modules/gui/qt4/components/controller.cpp | 19 ++++---- modules/gui/qt4/components/controller.hpp | 20 ++++----- .../gui/qt4/components/controller_widget.cpp | 43 ++++++++----------- .../gui/qt4/components/controller_widget.hpp | 42 ++++++++---------- .../gui/qt4/components/interface_widgets.cpp | 12 ------ .../gui/qt4/components/interface_widgets.hpp | 16 +------ modules/gui/qt4/dialogs/toolbar.hpp | 2 + 7 files changed, 58 insertions(+), 96 deletions(-) diff --git a/modules/gui/qt4/components/controller.cpp b/modules/gui/qt4/components/controller.cpp index 05fbf70b0e..fc5d56d3c0 100644 --- a/modules/gui/qt4/components/controller.cpp +++ b/modules/gui/qt4/components/controller.cpp @@ -31,23 +31,19 @@ #include #include -#include "dialogs_provider.hpp" +#include "components/controller.hpp" +#include "components/controller_widget.hpp" #include "components/interface_widgets.hpp" -#include "main_interface.hpp" + +#include "dialogs_provider.hpp" #include "input_manager.hpp" -#include "menus.hpp" -#include "util/input_slider.hpp" -#include "util/customwidgets.hpp" -#include +#include "util/input_slider.hpp" /* InputSlider */ +#include "util/customwidgets.hpp" /* qEventToKey */ + #include -#include #include #include -#include -#include -#include -#include #include #include @@ -689,6 +685,7 @@ void AbstractController::frame() if( p_input ) var_SetVoid( p_input, "frame-next" ); } + #include /***************************** * DA Control Widget ! diff --git a/modules/gui/qt4/components/controller.hpp b/modules/gui/qt4/components/controller.hpp index 45f64d2b9f..c498b242f0 100644 --- a/modules/gui/qt4/components/controller.hpp +++ b/modules/gui/qt4/components/controller.hpp @@ -30,33 +30,29 @@ # include "config.h" #endif -#include -#include - #include "qt4.hpp" -#include "main_interface.hpp" -#include "input_manager.hpp" -#include #include -#include +#include #define I_PLAY_TOOLTIP N_("Play\nIf the playlist is empty, open a media") class QPixmap; class QLabel; + class QGridLayout; +class QHBoxLayout; +class QBoxLayout; -class InputSlider; class QAbstractSlider; - class QAbstractButton; +class InputSlider; class VolumeClickHandler; -class QSignalMapper; +class WidgetListing; +class QSignalMapper; class QTimer; -class WidgetListing; typedef enum buttonType_e { @@ -94,7 +90,6 @@ typedef enum buttonType_e WIDGET_MAX, } buttonType_e; -#include static const QString nameL[BUTTON_MAX] = { "Play", "Stop", "Open", "Previous", "Next", "Slower", "Faster", "Fullscreen", "De-Fullscreen", @@ -142,6 +137,7 @@ enum WIDGET_SHINY = 0x4, }; +class AdvControlsWidget; class AbstractController : public QFrame { friend class WidgetListing; /* For ToolBar Edition HACKS */ diff --git a/modules/gui/qt4/components/controller_widget.cpp b/modules/gui/qt4/components/controller_widget.cpp index 71b99a744e..21f95609b5 100644 --- a/modules/gui/qt4/components/controller_widget.cpp +++ b/modules/gui/qt4/components/controller_widget.cpp @@ -4,10 +4,7 @@ * Copyright ( C ) 2006-2008 the VideoLAN team * $Id$ * - * Authors: Clément Stenac - * Jean-Baptiste Kempf - * Rafaël Carré - * Ilkka Ollakka + * Authors: Jean-Baptiste Kempf * * 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 @@ -28,31 +25,16 @@ # include "config.h" #endif -//#include -//#include - #include "controller_widget.hpp" -#include "dialogs_provider.hpp" -#include "components/interface_widgets.hpp" -#include "main_interface.hpp" -#include "input_manager.hpp" -#include "menus.hpp" -#include "util/input_slider.hpp" -#include "util/customwidgets.hpp" +#include "input_manager.hpp" /* Get notification of Volume Change */ +#include "util/input_slider.hpp" /* SoundSlider */ + +#include /* Volume functions */ #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include - +#include SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf, bool b_shiny ) @@ -175,3 +157,16 @@ void AtoB_Button::setIcons( bool timeA, bool timeB ) } } +bool VolumeClickHandler::eventFilter( QObject *obj, QEvent *e ) +{ + if (e->type() == QEvent::MouseButtonPress ) + { + aout_VolumeMute( p_intf, NULL ); + audio_volume_t i_volume; + aout_VolumeGet( p_intf, &i_volume ); +// m->updateVolume( i_volume * VOLUME_MAX / (AOUT_VOLUME_MAX/2) ); + return true; + } + return false; +} + diff --git a/modules/gui/qt4/components/controller_widget.hpp b/modules/gui/qt4/components/controller_widget.hpp index 8089a434d7..38bb76f386 100644 --- a/modules/gui/qt4/components/controller_widget.hpp +++ b/modules/gui/qt4/components/controller_widget.hpp @@ -1,12 +1,10 @@ /***************************************************************************** - * interface_widgets.hpp : Custom widgets for the main interface + * Controller_widget.cpp : Controller Widget for the controllers **************************************************************************** - * Copyright (C) 2006 the VideoLAN team + * Copyright (C) 2006-2008 the VideoLAN team * $Id$ * - * Authors: Clément Stenac - * Jean-Baptiste Kempf - * Rafaël Carré + * Authors: Jean-Baptiste Kempf * * 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 @@ -30,34 +28,17 @@ # include "config.h" #endif -#include -#include - #include "qt4.hpp" -#include "main_interface.hpp" -#include "input_manager.hpp" #include -#include #include #define I_PLAY_TOOLTIP N_("Play\nIf the playlist is empty, open a media") -class QPixmap; class QLabel; -class QGridLayout; - -class InputSlider; +class QSpinBox; class QAbstractSlider; -class QAbstractButton; - -class VolumeClickHandler; -class QSignalMapper; - -class QTimer; -class WidgetListing; - /** * SPECIAL Widgets that are a bit more than just a ToolButton * and have an icon/behaviour that changes depending on the context: @@ -93,6 +74,9 @@ private slots: void toggleTeletextTransparency( bool ); }; +#define VOLUME_MAX 200 +class VolumeClickHandler; + class SoundWidget : public QWidget { Q_OBJECT @@ -113,4 +97,16 @@ protected slots: void updateVolume( void ); }; +class VolumeClickHandler : public QObject +{ +public: + VolumeClickHandler( intf_thread_t *_p_intf, SoundWidget *_m ) : QObject(_m) + {m = _m; p_intf = _p_intf; } + virtual ~VolumeClickHandler() {}; + virtual bool eventFilter( QObject *obj, QEvent *e ); +private: + SoundWidget *m; + intf_thread_t *p_intf; +}; + #endif diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp index 87bc625b37..99a600c50a 100644 --- a/modules/gui/qt4/components/interface_widgets.cpp +++ b/modules/gui/qt4/components/interface_widgets.cpp @@ -521,16 +521,4 @@ void TimeLabel::setStatus( int i_status ) setText( "Buffering" ); } -bool VolumeClickHandler::eventFilter( QObject *obj, QEvent *e ) -{ - if (e->type() == QEvent::MouseButtonPress ) - { - aout_VolumeMute( p_intf, NULL ); - audio_volume_t i_volume; - aout_VolumeGet( p_intf, &i_volume ); -// m->updateVolume( i_volume * VOLUME_MAX / (AOUT_VOLUME_MAX/2) ); - return true; - } - return false; -} diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp index 9ef3587703..607924b39c 100644 --- a/modules/gui/qt4/components/interface_widgets.hpp +++ b/modules/gui/qt4/components/interface_widgets.hpp @@ -32,10 +32,11 @@ #include #include -#include +//#include Visualizer #include "qt4.hpp" #include "main_interface.hpp" +#include "input_manager.hpp" #include "components/controller.hpp" #include "components/controller_widget.hpp" @@ -124,19 +125,6 @@ private slots: }; #endif -#define VOLUME_MAX 200 -class VolumeClickHandler : public QObject -{ -public: - VolumeClickHandler( intf_thread_t *_p_intf, SoundWidget *_m ) : QObject(_m) - {m = _m; p_intf = _p_intf; } - virtual ~VolumeClickHandler() {}; - virtual bool eventFilter( QObject *obj, QEvent *e ); -private: - SoundWidget *m; - intf_thread_t *p_intf; -}; - class TimeLabel : public QLabel { Q_OBJECT diff --git a/modules/gui/qt4/dialogs/toolbar.hpp b/modules/gui/qt4/dialogs/toolbar.hpp index fafd288288..6100685826 100644 --- a/modules/gui/qt4/dialogs/toolbar.hpp +++ b/modules/gui/qt4/dialogs/toolbar.hpp @@ -29,9 +29,11 @@ #include #include +#include class ToolbarEditDialog; class DroppingController; +class QCheckBox; class WidgetListing : public QListWidget { -- 2.39.2