diff options
author | Dennis Kasprzyk <onestone@compiz-fusion.org> | 2009-01-14 15:22:35 +0100 |
---|---|---|
committer | Dennis Kasprzyk <onestone@compiz-fusion.org> | 2009-01-14 15:22:35 +0100 |
commit | 531ccf8b922695911d15bb6c0b6bf98c084952a7 (patch) | |
tree | 380babc8fdddb406a89286cdcd257acf2e2deceb /kde | |
parent | 05cdbf9fe6dfb49762dbc2cc6ce601124148e018 (diff) | |
download | zcomp-531ccf8b922695911d15bb6c0b6bf98c084952a7.tar.gz zcomp-531ccf8b922695911d15bb6c0b6bf98c084952a7.tar.bz2 |
KDE window decorator KDE 4.2 plasma support.
Diffstat (limited to 'kde')
-rw-r--r-- | kde/window-decorator-kde4/CMakeLists.txt | 109 | ||||
-rw-r--r-- | kde/window-decorator-kde4/switcher.cpp | 19 | ||||
-rw-r--r-- | kde/window-decorator-kde4/switcher.h | 4 |
3 files changed, 62 insertions, 70 deletions
diff --git a/kde/window-decorator-kde4/CMakeLists.txt b/kde/window-decorator-kde4/CMakeLists.txt index 4b0c404..9e8e661 100644 --- a/kde/window-decorator-kde4/CMakeLists.txt +++ b/kde/window-decorator-kde4/CMakeLists.txt @@ -4,71 +4,64 @@ set (USE_KDE4 1 CACHE BOOL "Build KDE 4 window decorator") if (USE_KDE4) - find_package(KDE4) + find_package(KDE4 4.1.80 REQUIRED) if (KDE4_FOUND) include(KDE4Defaults) include(FindPkgConfig) include(MacroLibrary) - include (FindPlasma) - - if (PLASMA_FOUND) - - add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) - - qt4_add_dbus_adaptor (kwd4_SRCS org.kde.KWin.xml decorator.h KWD::Decorator kwinadaptor) - - pkg_check_modules (KWD4 REQUIRED xdamage xrender xcomposite) - - link_directories( - ${KWD4_LIBRARY_DIRS} - ) - - include_directories ( - ${compiz_SOURCE_DIR}/include - ${KWD4_INCLUDE_DIRS} - ${KDE4_INCLUDES} - ${KDE4_INCLUDE_DIR} - ${PLASMA_INCLUDE_DIR} - ${QT_INCLUDES} - ) - - set (kwd4_SRCS - main.cpp - utils.cpp - decorator.cpp - window.cpp - options.cpp - kdecoration_plugins.cpp - switcher.cpp - ${kwd4_SRCS} - ) - - kde4_add_executable ( - kde4-window-decorator - ${kwd4_SRCS} - ) - - target_link_libraries ( - kde4-window-decorator - decoration - ${KWD4_LIBRARIES} - ${PLASMA_LIBS} - ${KDE4_KDECORE_LIBS} - ${KDE4_KDEUI_LIBS} - kdecorations - ) - - install ( - TARGETS kde4-window-decorator - DESTINATION ${exec_prefix} - ) - - else (PLASMA_FOUND) - set (USE_KDE4 0) - endif (PLASMA_FOUND) + add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) + + qt4_add_dbus_adaptor (kwd4_SRCS org.kde.KWin.xml decorator.h KWD::Decorator kwinadaptor) + + + pkg_check_modules (KWD4 REQUIRED xdamage xrender xcomposite) + + link_directories( + ${KWD4_LIBRARY_DIRS} + ) + + include_directories ( + ${compiz_SOURCE_DIR}/include + ${KWD4_INCLUDE_DIRS} + ${KDE4_INCLUDES} + ${KDE4_INCLUDE_DIR} + ${PLASMA_INCLUDE_DIR} + ${QT_INCLUDES} + ) + + set (kwd4_SRCS + main.cpp + utils.cpp + decorator.cpp + window.cpp + options.cpp + kdecoration_plugins.cpp + switcher.cpp + ${kwd4_SRCS} + ) + + kde4_add_executable ( + kde4-window-decorator + ${kwd4_SRCS} + ) + + target_link_libraries ( + kde4-window-decorator + decoration + ${KWD4_LIBRARIES} + ${PLASMA_LIBS} + ${KDE4_KDECORE_LIBS} + ${KDE4_KDEUI_LIBS} + kdecorations + ) + + install ( + TARGETS kde4-window-decorator + DESTINATION ${exec_prefix} + ) else (KDE4_FOUND) set (USE_KDE4 0) diff --git a/kde/window-decorator-kde4/switcher.cpp b/kde/window-decorator-kde4/switcher.cpp index 2978e69..0150d91 100644 --- a/kde/window-decorator-kde4/switcher.cpp +++ b/kde/window-decorator-kde4/switcher.cpp @@ -30,7 +30,7 @@ #include <fixx11h.h> -#include <KDE/Plasma/PanelSvg> +#include <KDE/Plasma/FrameSvg> #include <KDE/Plasma/Theme> #include <kwindowsystem.h> @@ -38,7 +38,7 @@ #include <QString> #include <QPainter> -KWD::Switcher::Switcher (WId parentId, WId id): +KWD::Switcher::Switcher (WId, WId id): mId (id) { QPalette palette; @@ -46,9 +46,9 @@ mId (id) QColor color; color = Plasma::Theme::defaultTheme ()->color (Plasma::Theme::TextColor); - mBackground = new Plasma::PanelSvg(); + mBackground = new Plasma::FrameSvg(); mBackground->setImagePath ("dialogs/background"); - mBackground->setEnabledBorders(Plasma::PanelSvg::AllBorders); + mBackground->setEnabledBorders(Plasma::FrameSvg::AllBorders); mBorder.left = mBackground->marginSize(Plasma::LeftMargin); mBorder.right = mBackground->marginSize(Plasma::RightMargin); @@ -131,9 +131,8 @@ KWD::Switcher::redrawPixmap () p.setCompositionMode (QPainter::CompositionMode_Source); p.setRenderHint (QPainter::SmoothPixmapTransform); - mBackground->resizePanel (QSizeF (contentWidth, contentHeight)); - mBackground->paintPanel (&p, QRect (0, 0, contentWidth, - contentHeight)); + mBackground->resizeFrame (QSizeF (contentWidth, contentHeight)); + mBackground->paintFrame (&p, QRect (0, 0, contentWidth, contentHeight)); mBackgroundPixmap = mPixmap.copy (mBorder.left, mBorder.top, mGeometry.width (), @@ -168,9 +167,9 @@ KWD::Switcher::update () p.setCompositionMode (QPainter::CompositionMode_Source); - mBackground->paintPanel (&p, QRect (mBorder.left, mBorder.top + - mGeometry.height () + 5, mGeometry.width (), - fm.height ())); + mBackground->paintFrame (&p, QRect (mBorder.left, mBorder.top + + mGeometry.height () + 5, mGeometry.width (), + fm.height ())); p.setFont (font); p.setPen (Plasma::Theme::defaultTheme ()->color(Plasma::Theme::TextColor)); diff --git a/kde/window-decorator-kde4/switcher.h b/kde/window-decorator-kde4/switcher.h index 2451c7a..bc969d7 100644 --- a/kde/window-decorator-kde4/switcher.h +++ b/kde/window-decorator-kde4/switcher.h @@ -30,7 +30,7 @@ namespace Plasma { -class PanelSvg; +class FrameSvg; } class QSpacerItem; @@ -70,7 +70,7 @@ class Switcher QRect mGeometry; - Plasma::PanelSvg *mBackground; + Plasma::FrameSvg *mBackground; QPixmap mPixmap; QPixmap mBackgroundPixmap; |