2011-02-24 16:37:04 +00:00
|
|
|
#ifndef oxygenfactory_h
|
|
|
|
#define oxygenfactory_h
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-08-24 16:17:15 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-09-15 07:12:54 +00:00
|
|
|
// oxygen.h
|
2009-08-24 16:17:15 +00:00
|
|
|
// -------------------
|
2009-09-09 00:55:55 +00:00
|
|
|
//
|
2009-08-25 04:15:13 +00:00
|
|
|
// Copyright (c) 2009 Hugo Pereira <hugo.pereira@free.fr>
|
2009-08-22 08:24:06 +00:00
|
|
|
// Copyright (c) 2006, 2007 Riccardo Iaconelli <ruphy@fsfe.org>
|
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
// of this software and associated documentation files (the "Software"), to
|
|
|
|
// deal in the Software without restriction, including without limitation the
|
|
|
|
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
// sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
// furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
2009-09-09 00:55:55 +00:00
|
|
|
// IN THE SOFTWARE.
|
2009-08-24 16:17:15 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-09-20 07:42:03 +00:00
|
|
|
#include <QtCore/QObject>
|
2009-08-22 08:24:06 +00:00
|
|
|
#include <kdecorationfactory.h>
|
|
|
|
#include <kdeversion.h>
|
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
#include "oxygenconfiguration.h"
|
2010-05-02 18:50:01 +00:00
|
|
|
#include "oxygendecohelper.h"
|
2009-09-15 07:12:54 +00:00
|
|
|
#include "oxygenexceptionlist.h"
|
2009-10-13 01:45:01 +00:00
|
|
|
#include "oxygenshadowcache.h"
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
namespace Oxygen
|
2009-08-22 08:24:06 +00:00
|
|
|
{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
class Client;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! buttons
|
|
|
|
enum ButtonType {
|
|
|
|
ButtonHelp=0,
|
|
|
|
ButtonMax,
|
|
|
|
ButtonMin,
|
|
|
|
ButtonClose,
|
|
|
|
ButtonMenu,
|
|
|
|
ButtonSticky,
|
|
|
|
ButtonAbove,
|
|
|
|
ButtonBelow,
|
|
|
|
ButtonShade,
|
|
|
|
ButtonTypeCount,
|
2009-10-15 16:03:30 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
// Close only one tab
|
|
|
|
ButtonItemClose=100,
|
2009-10-15 16:03:30 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
// shows the window menu for one tab
|
|
|
|
ButtonItemMenu
|
2009-10-15 16:03:30 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
};
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
Q_DECLARE_FLAGS(ButtonTypes, ButtonType)
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
enum {
|
2009-10-13 01:45:01 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! this is the top title bar edge
|
|
|
|
TFRAMESIZE = 3,
|
2009-10-13 01:45:01 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
/*!
|
|
|
|
this is the extra title bar top and bottom edges
|
|
|
|
needed to outline active window title bar
|
|
|
|
*/
|
|
|
|
HFRAMESIZE = 4
|
|
|
|
};
|
2009-10-13 01:45:01 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! window decoration factory
|
|
|
|
class Factory: public QObject, public KDecorationFactoryUnstable
|
|
|
|
{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
Q_OBJECT
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
public:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! constructor
|
|
|
|
Factory();
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! destructor
|
|
|
|
virtual ~Factory();
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! create decoration
|
|
|
|
virtual KDecoration *createDecoration(KDecorationBridge *b);
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! configuration reset
|
|
|
|
virtual bool reset(unsigned long changed);
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! configuration capabilities
|
|
|
|
virtual bool supports( Ability ability ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! true if initialized
|
|
|
|
virtual bool initialized()
|
2011-02-24 16:37:04 +00:00
|
|
|
{ return _initialized; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! helper
|
2010-05-02 18:50:01 +00:00
|
|
|
virtual DecoHelper& helper( void )
|
2011-02-24 16:37:04 +00:00
|
|
|
{ return _helper; }
|
2009-10-13 01:45:01 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! shadow cache
|
|
|
|
virtual ShadowCache& shadowCache( void )
|
2011-02-24 16:37:04 +00:00
|
|
|
{ return _shadowCache; }
|
2009-10-13 01:45:01 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! shadow cache
|
|
|
|
virtual const ShadowCache& shadowCache( void ) const
|
2011-02-24 16:37:04 +00:00
|
|
|
{ return _shadowCache; }
|
2010-04-25 20:28:02 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! get configuration for a give client
|
|
|
|
virtual Configuration configuration( const Client& );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
private:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! read configuration from KConfig
|
|
|
|
bool readConfig();
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! default configuration
|
|
|
|
const Configuration& defaultConfiguration( void ) const
|
2011-02-24 16:37:04 +00:00
|
|
|
{ return _defaultConfiguration; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! default configuration
|
|
|
|
Configuration& defaultConfiguration( void )
|
2011-02-24 16:37:04 +00:00
|
|
|
{ return _defaultConfiguration; }
|
2010-04-25 20:28:02 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! initialization
|
|
|
|
void setInitialized( bool value )
|
2011-02-24 16:37:04 +00:00
|
|
|
{ _initialized = value; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! set default configuration
|
|
|
|
void setDefaultConfiguration( Configuration value )
|
2011-02-24 16:37:04 +00:00
|
|
|
{ _defaultConfiguration = value; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! initialization flag
|
2011-02-24 16:37:04 +00:00
|
|
|
bool _initialized;
|
2009-10-13 01:45:01 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! helper
|
2011-02-24 16:37:04 +00:00
|
|
|
DecoHelper _helper;
|
2009-10-13 01:45:01 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! shadow cache
|
2011-02-24 16:37:04 +00:00
|
|
|
ShadowCache _shadowCache;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! default configuration
|
2011-02-24 16:37:04 +00:00
|
|
|
Configuration _defaultConfiguration;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! exceptions
|
2011-02-24 16:37:04 +00:00
|
|
|
ExceptionList _exceptions;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
};
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-24 06:27:49 +00:00
|
|
|
}
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
#endif
|