added initial draft of FLUIQ (Flexible User-Interface with Qt) framework (integration patches will follow later)
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1878 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
127
include/fluiq/collapsible_widget.h
Normal file
127
include/fluiq/collapsible_widget.h
Normal file
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* collapsible_widget.h - header file for FLUIQ::CollapsibleWidget
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* 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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _FLUIQ_COLLAPSIBLE_WIDGET_H
|
||||
#define _FLUIQ_COLLAPSIBLE_WIDGET_H
|
||||
|
||||
#include <QtGui/QBoxLayout>
|
||||
|
||||
#include "fluiq/widget.h"
|
||||
|
||||
|
||||
namespace FLUIQ
|
||||
{
|
||||
|
||||
class CollapsibleWidget;
|
||||
|
||||
class CollapsibleWidgetHeader : public Widget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CollapsibleWidgetHeader( CollapsibleWidget * _parent );
|
||||
virtual ~CollapsibleWidgetHeader();
|
||||
|
||||
|
||||
inline bool isCollapsed( void ) const
|
||||
{
|
||||
return m_collapsed;
|
||||
}
|
||||
|
||||
void setCollapsed( bool _c );
|
||||
|
||||
virtual QSize sizeHint( void ) const;
|
||||
|
||||
|
||||
protected:
|
||||
virtual void enterEvent( QEvent * _ev );
|
||||
virtual void leaveEvent( QEvent * _ev );
|
||||
virtual void mousePressEvent( QMouseEvent * _ev );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _event );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _ev );
|
||||
virtual void paintEvent( QPaintEvent * _ev );
|
||||
|
||||
|
||||
private:
|
||||
CollapsibleWidget * m_parent;
|
||||
bool m_hovered;
|
||||
bool m_pressed;
|
||||
bool m_collapsed;
|
||||
bool m_moved;
|
||||
QPoint m_origMousePos;
|
||||
|
||||
QPixmap m_arrowCollapsed;
|
||||
QPixmap m_arrowExpanded;
|
||||
|
||||
|
||||
signals:
|
||||
void expanded( void );
|
||||
void collapsed( void );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
class CollapsibleWidget : public Widget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CollapsibleWidget( Qt::Orientation _or, Widget * _parent = NULL );
|
||||
virtual ~CollapsibleWidget();
|
||||
|
||||
void addWidget( QWidget * _w );
|
||||
void insertWidget( int _idx, QWidget * _w );
|
||||
|
||||
inline QString labelText( void ) const
|
||||
{
|
||||
return m_header->windowTitle();
|
||||
}
|
||||
|
||||
inline void setLabelText( const QString & _text )
|
||||
{
|
||||
m_header->setWindowTitle( _text );
|
||||
}
|
||||
|
||||
inline Qt::Orientation orientation( void ) const
|
||||
{
|
||||
return m_orientation;
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void expand( void );
|
||||
void collapse( void );
|
||||
|
||||
|
||||
private:
|
||||
Qt::Orientation m_orientation;
|
||||
|
||||
QBoxLayout * m_masterLayout;
|
||||
CollapsibleWidgetHeader * m_header;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
64
include/fluiq/splitter.h
Normal file
64
include/fluiq/splitter.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* splitter.h - header file for FLUIQ::Splitter
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* 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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _FLUIQ_SPLITTER_H
|
||||
#define _FLUIQ_SPLITTER_H
|
||||
|
||||
#include <QtGui/QSplitter>
|
||||
|
||||
|
||||
namespace FLUIQ
|
||||
{
|
||||
|
||||
|
||||
class Splitter : public QSplitter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Splitter( Qt::Orientation _o, QWidget * _parent = NULL );
|
||||
virtual ~Splitter();
|
||||
|
||||
|
||||
protected:
|
||||
QSplitterHandle * createHandle( void );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
class SplitterHandle : public QSplitterHandle
|
||||
{
|
||||
public:
|
||||
SplitterHandle( Qt::Orientation _o, QSplitter * _parent );
|
||||
virtual ~SplitterHandle();
|
||||
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent * _event );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
49
include/fluiq/widget.h
Normal file
49
include/fluiq/widget.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* widget.h - header file for FLUIQ::Widget
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* 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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _FLUIQ_WIDGET_H
|
||||
#define _FLUIQ_WIDGET_H
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
|
||||
namespace FLUIQ
|
||||
{
|
||||
|
||||
|
||||
class Widget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Widget( QWidget * _parent = NULL );
|
||||
virtual ~Widget();
|
||||
|
||||
private:
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
62
include/fluiq/widget_container.h
Normal file
62
include/fluiq/widget_container.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* widget_container.h - header file for FLUIQ::WidgetContainer
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* 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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _FLUIQ_WIDGET_CONTAINER_H
|
||||
#define _FLUIQ_WIDGET_CONTAINER_H
|
||||
|
||||
#include "fluiq/widget.h"
|
||||
|
||||
|
||||
class QScrollArea;
|
||||
class QBoxLayout;
|
||||
|
||||
|
||||
|
||||
namespace FLUIQ
|
||||
{
|
||||
|
||||
class Splitter;
|
||||
|
||||
|
||||
class WidgetContainer : public Widget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
WidgetContainer( Qt::Orientation _o, Widget * _parent = NULL );
|
||||
virtual ~WidgetContainer();
|
||||
|
||||
void addWidget( QWidget * _parent );
|
||||
|
||||
|
||||
private:
|
||||
Qt::Orientation m_orientation;
|
||||
QScrollArea * m_scrollArea;
|
||||
Splitter * m_splitter;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
58
include/fluiq/workspace.h
Normal file
58
include/fluiq/workspace.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* workspace.h - header file for FLUIQ::Workspace
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* 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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _FLUIQ_WORKSPACE_H
|
||||
#define _FLUIQ_WORKSPACE_H
|
||||
|
||||
#include "fluiq/widget.h"
|
||||
#include "fluiq/splitter.h"
|
||||
|
||||
class QVBoxLayout;
|
||||
|
||||
|
||||
namespace FLUIQ
|
||||
{
|
||||
|
||||
|
||||
class Workspace : public Widget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Workspace( QWidget * _parent = NULL );
|
||||
virtual ~Workspace();
|
||||
|
||||
void addWidget( QWidget * _w );
|
||||
void addWidgetToExistingRow( QWidget * _w );
|
||||
|
||||
|
||||
private:
|
||||
Splitter * m_currentSplitter;
|
||||
QVBoxLayout * m_masterLayout;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user