Commit Graph

100 Commits (0f09f002101fb22543d9e67a5fce64040ccc4856)

Author SHA1 Message Date
Martin Klapetek 54bc491c46 Port to KF5 renaming changes 2013-12-11 21:41:47 +01:00
Martin Gräßlin 13d1b67f99 [libkdecorations] Do not link to Qt5::X11Extras
No longer needed as the library doesn't include kwinglobals.h any more.
2013-12-05 10:07:23 +01:00
Jacob Logan 199ed87c61 [libkdecorations] Generate an export header
REVIEW: 114247
2013-12-05 10:00:46 +01:00
Martin Gräßlin 23a510c0b5 [kdecorations] Add a ::palette() to the decoration API
The ::palette() in KDecoration and KCommonDecoration returns the
QPalette the decoration should use for the decorated window. The
call delegates into the bridge and KWin core might provide a special
QPalette for a given Client depending on the _KDE_NET_WM_COLOR_SCHEME
property.
2013-11-25 09:44:23 +01:00
Aleix Pol 7b110f0671 Improve CMake usage
It's basically a run of the port-cmake.sh script in here, mostly the changes
are the following:
- Using KF5::* targets
- Using the proper macros, following recent developments in frameworks
2013-11-15 13:37:47 +01:00
Martin Gräßlin b73d90cf78 [kdecorations] Introduce an enum for decoration buttons instead of characters
A new enum is introduced which defines all the buttons known to KWin.
The defaultTitleButton methods return a list of DecorationButtons instead
of a string which needs to be parsed by the decoration. The same for the
actual title buttons. The reading/storing of the buttons is unchanged,
that is the same characters are used and mapped to the button types.
2013-11-14 09:41:52 +01:00
Martin Gräßlin 79d36fe4e9 [kdecorations] Drop KCommonDecoration::defaultButtons(Left|Right)
Just forwards to static method in KDecorationOptions, thus any user can
also just use this static method directly.
2013-11-14 09:41:52 +01:00
Martin Gräßlin f8b9b98345 [decorations] Allow decorations to use a QWindow instead of QWidget
A setMainWindow() method is added which behaves similar to
setMainWidget(). In addition a few convenient methods are added which
can be used by KWin core to show/hide the decoration without caring
whether the decoration uses a QWindow or QWidget.
2013-11-14 09:41:51 +01:00
Martin Gräßlin 8ecb69cd8c [decorations] Add a KDecoration::window() returning the QWindow
KWin core can access the QWindow of the decoration instead of the
QWidget. This is a preparation step to allow QWidget based window
decorations without any QWidgets at all.

KWin core makes already use of this new accessor to get the window Id
which is also on QWidgets provided through the QWindow.
2013-11-14 09:41:50 +01:00
Martin Gräßlin d6bf62eb3e [kdecorations] Drop initialParentWidget()
No longer needed for creating the preview and not set in our main
bridge. Thus it can go and we just use NULL as the parent widget.
2013-11-14 09:41:50 +01:00
Martin Gräßlin 51ee2e86d1 [kdecorations] Introduce new way to schedule updates in composited case
The PaintRedirector calls the new method KDecoration::render and passes
it's PaintDevice and the region to update to it. A decoration can
implement this method and provide an optimized implementation for the
painting which does not go through the deco's QWidget at all. In addition
the decoration can invoke an update() slot which will schedule a repaint
in the PaintRedirector and thus completely replaces the need for
intercepting paint events on the QWidget and also allows to add QWindow
based decorations in future.
2013-11-14 09:41:50 +01:00
Martin Gräßlin 23a354f4d8 Remove WA_PaintOnScreen attribute from decoration widget
With this attribute set the QPainter on the widget() never gets active
in non composited rendering and thus the decoration does not get rendered
at all.
2013-10-02 07:49:54 +02:00
Martin Gräßlin 2944e919da Introduce d-ptr class for KCommonDecoration 2013-09-12 09:27:39 +02:00
Martin Gräßlin 169beb6b1f Add d-ptr class for KCommonDecorationButton
All private members are moved to the new d-ptr class.
2013-09-12 09:27:39 +02:00
Martin Gräßlin fcfcc795e6 Change KDecorationFactory::options()
* no longer inlined
* forwards to KDecorationOptions::self()
* deprecated
* protected
2013-09-12 09:27:39 +02:00
Martin Gräßlin dead386941 Move decorations member to d-ptr class KDecorationFactoryPrivate 2013-09-12 09:27:39 +02:00
Martin Gräßlin 9aeebb179f Move static KDecorationOptions* to KDecorationOptions
No idea why it was in KDecoration in the first place, but creation
and deletion is done in KDecorationOptions. So it clearly belongs
there.
2013-09-12 09:27:39 +02:00
Martin Gräßlin f0e8f5ee64 Move factory to d-ptr class KDecorationPrivate 2013-09-12 09:27:39 +02:00
Martin Gräßlin 7c1a7f46d8 Move QWidget* data member to d-ptr class KDecorationPrivate 2013-09-12 09:27:39 +02:00
Martin Gräßlin 0aa9594608 Move bridge into d-ptr class KDecorationPrivate 2013-09-12 09:27:39 +02:00
Martin Gräßlin 014910ffe5 Un-inline methods in k(common)decoration headers
Makes Krazy more happy and allows us to change the implementation.
E.g. the one in KCommonDecoration should use a d-ptr.
2013-09-12 09:27:39 +02:00
Martin Gräßlin 8d4e2a630f Drop no longer needed emitKeepAbove/BelowChanged from KDecoration
Not called from anywhere and marked as remove Qt5.
2013-09-12 09:27:39 +02:00
Martin Gräßlin c5e60a7ce8 Add properties for keepAbove/Below to KDecoration
For consistency two new changed signals are introduced without any
argument and the old signals are marked as deprecated.
2013-09-12 09:27:39 +02:00
Martin Gräßlin 7aadeaa310 Add maximized property and changed signal to KDecoration
Replaces the pure virtual method which the Decoration had to
implement. Instead the Decoration can now connect to the signal.

For KCommonDecoration there is no change at all except that the
invoked method is turned into a slot.

The property is of type bool and maps to isMaximized and not to
maximizeMode.
2013-09-12 09:27:39 +02:00
Martin Gräßlin c918f40a77 Introduce a convenience method isMaximized in KDecoration
Returns true in case of fully maximized, false otherwise. By that
it ignores the horizontal and vertical modes.
2013-09-12 09:27:39 +02:00
Martin Gräßlin 22e4476777 Add icon property and changed signal to KDecoration
Replaces the pure virtual method which the Decoration had to
implement. Instead the Decoration can now connect to the signal.

For KCommonDecoration there is no change at all except that the
invoked method is turned into a slot.
2013-09-12 09:27:39 +02:00
Martin Gräßlin 63bb36e2ad Add shade property and changed signal to KDecoration
Replaces the pure virtual method which the Decoration had to
implement. Instead the Decoration can now connect to the signal.

For KCommonDecoration there is no change at all except that the
invoked method is turned into a slot.
2013-09-12 09:27:39 +02:00
Martin Gräßlin fd64a29f72 Add desktop property and changed signal to KDecoration
Replaces the pure virtual method which the Decoration had to
implement. Instead the Decoration can now connect to the signal.

For KCommonDecoration there is no change at all except that the
invoked method is turned into a slot.

Also isOnAllDesktop property is added using the same changed
signal as desktop property.
2013-09-12 09:27:39 +02:00
Martin Gräßlin 29bce13e9f Add caption property and changed signal to KDecoration
Replaces the pure virtual method which the Decoration had to
implement. Instead the Decoration can now connect to the signal.

For KCommonDecoration there is no change at all except that the
invoked method is turned into a slot
2013-09-12 09:27:39 +02:00
Martin Gräßlin e1c4512ccc Add active property and changed signal to KDecoration
Replaces the pure virtual method which the Decoration had to
implement. Instead the Decoration can now connect to the signal.

For KCommonDecoration there is no change at all except that the
invoked method is turned into a slot.
2013-09-12 09:27:39 +02:00
Martin Gräßlin 70aafe08b5 Drop the KDecorationDefines::Settings* enum
No longer needed as the reset method is gone.
2013-09-12 09:27:38 +02:00
Martin Gräßlin d10a31750e Drop reset method from K(Common)Decoration
For the only remaining update flag a dedicated signal is added to
KDecoration.
2013-09-12 09:27:38 +02:00
Martin Gräßlin 0ba75ca07f Drop the reset methods in KDecorationFactory
They are no longer used by any decoration or by KWin core.
2013-09-12 09:27:38 +02:00
Martin Gräßlin d29b9bf03a Introduce a compositingChanged signal in KDecorationOptions
Connected from a signal in DecorationPlugins in KWin core replacing
the previous reset method.
2013-09-12 09:27:38 +02:00
Martin Gräßlin d403bfcadb Make KDecorationOptions::updateSettings protected
Only called from KWin::Options, so no need to have it public.
2013-09-12 09:27:38 +02:00
Martin Gräßlin ad85c6bc99 Introduce changed signals in KDecorationOptions
For this KDecorationOptions becomes a QObject. The changed flags from
updateSettings are removed. Instead the method just emits the proper
changed signals.

This should allow better handling in the Factories.
2013-09-12 09:27:38 +02:00
Martin Gräßlin e923426930 Add a recreateDecorations signal to KDecorationFactory
A factory is supposed to emit this signal whenever the decorations
need to be recrated. The DecorationPlugins inside KWin Core connect
to the signal and recreate the decorations.

This signal is supposed to replace the reset method which encoded
this information in the return value and which is already ignored.
2013-09-12 09:27:38 +02:00
Martin Gräßlin e2583e679f No longer pass changed mask from KWin core to the decorations
The changed mask is going to be replaced by more specific signals so
we don't need to calculate the change mask in KWin core anymore.

We still need to call reset in the decoration plugin to check whether
a new decoration library needs to be loaded.
2013-09-12 09:27:38 +02:00
Martin Gräßlin c2fdc66cee Remove pure virtual updateSettings from DecorationOptions
Not really needed as it's only invoked from inside KWin core to the
Options class.
2013-09-12 09:27:38 +02:00
Martin Gräßlin ae50ef270b Make KDecorationFactory ctor protected
It's not supposed to be invoked directly, but always through a
subclass.
2013-09-12 09:27:38 +02:00
Martin Gräßlin 784c40a338 KDecorationFactory inherits from QObject
Adjusting to reality: our decorations have the factory already inheriting
from QObject.
2013-09-12 09:27:38 +02:00
Martin Gräßlin 10e044151e Drop KDecorationFactoryUnstable
Did nothing and no longer needed.
2013-09-12 09:27:38 +02:00
Martin Gräßlin a90072d753 Merge KDecorationUnstable into KDecoration
Also KCommonDecorationUnstable is merged into KCommonDecoration.
2013-09-12 09:27:38 +02:00
Martin Gräßlin afcf6dbc41 Remove deprecated functionality from libkdecorations 2013-09-12 09:27:37 +02:00
Martin Gräßlin c8331784ba Merge KDecorationBridgeUnstable into KDecorationBridge 2013-09-12 09:27:37 +02:00
Martin Gräßlin 48e8121ab9 Port away from KGlobalSettings::windowTitleFont in libkdecorations
And with that it's no longer linking kde4support.
2013-09-02 11:22:59 +02:00
Martin Gräßlin bd2c80428c Port libkdecoration from KDebug to QDebug 2013-09-02 11:17:23 +02:00
Martin Gräßlin 84a2f3020b Use Qt5:: in target link libraries in KWin 2013-08-20 09:14:24 +02:00
Martin Gräßlin 5ca6654eb8 Fix linking
KDEUI is dead which caused collateral damage.
2013-08-20 08:47:47 +02:00
Martin Gräßlin c2e0c13b7b Delay performWindowOperation to next event cycle in UserActionsMenu
In case that the window operation results in destroying the window
decoration we need to have the menu closed before the deco gets
destroyed. Otherwise Qt crashes.
2013-08-19 12:15:42 +02:00