summaryrefslogtreecommitdiffstats
path: root/kwin-styles
diff options
context:
space:
mode:
Diffstat (limited to 'kwin-styles')
-rw-r--r--kwin-styles/Makefile.am4
-rw-r--r--kwin-styles/cde/Makefile.am22
-rw-r--r--kwin-styles/cde/cde.desktop6
-rw-r--r--kwin-styles/cde/cdeclient.cpp863
-rw-r--r--kwin-styles/cde/cdeclient.h118
-rw-r--r--kwin-styles/cde/config/Makefile.am17
-rw-r--r--kwin-styles/cde/config/config.cpp131
-rw-r--r--kwin-styles/cde/config/config.h51
-rw-r--r--kwin-styles/configure.in.in3
-rw-r--r--kwin-styles/glow/Makefile.am22
-rw-r--r--kwin-styles/glow/config/Makefile.am17
-rw-r--r--kwin-styles/glow/config/bitmaps.h55
-rw-r--r--kwin-styles/glow/config/glowconfigdialog.cpp369
-rw-r--r--kwin-styles/glow/config/glowconfigdialog.h91
-rw-r--r--kwin-styles/glow/glow.desktop49
-rw-r--r--kwin-styles/glow/glowbutton.cpp339
-rw-r--r--kwin-styles/glow/glowbutton.h128
-rw-r--r--kwin-styles/glow/glowclient.cpp902
-rw-r--r--kwin-styles/glow/glowclient.h205
-rw-r--r--kwin-styles/glow/resources.h11
-rw-r--r--kwin-styles/glow/themes/Makefile.am1
-rw-r--r--kwin-styles/glow/themes/default/Makefile.am17
-rw-r--r--kwin-styles/glow/themes/default/background.pngbin0 -> 788 bytes
-rw-r--r--kwin-styles/glow/themes/default/close.pngbin0 -> 122 bytes
-rw-r--r--kwin-styles/glow/themes/default/close_glow.pngbin0 -> 179 bytes
-rw-r--r--kwin-styles/glow/themes/default/default.theme19
-rw-r--r--kwin-styles/glow/themes/default/help.pngbin0 -> 120 bytes
-rw-r--r--kwin-styles/glow/themes/default/help_glow.pngbin0 -> 174 bytes
-rw-r--r--kwin-styles/glow/themes/default/iconify.pngbin0 -> 120 bytes
-rw-r--r--kwin-styles/glow/themes/default/iconify_glow.pngbin0 -> 177 bytes
-rw-r--r--kwin-styles/glow/themes/default/maximizeoff.pngbin0 -> 109 bytes
-rw-r--r--kwin-styles/glow/themes/default/maximizeoff_glow.pngbin0 -> 166 bytes
-rw-r--r--kwin-styles/glow/themes/default/maximizeon.pngbin0 -> 129 bytes
-rw-r--r--kwin-styles/glow/themes/default/maximizeon_glow.pngbin0 -> 186 bytes
-rw-r--r--kwin-styles/glow/themes/default/stickyoff.pngbin0 -> 103 bytes
-rw-r--r--kwin-styles/glow/themes/default/stickyoff_glow.pngbin0 -> 161 bytes
-rw-r--r--kwin-styles/glow/themes/default/stickyon.pngbin0 -> 115 bytes
-rw-r--r--kwin-styles/glow/themes/default/stickyon_glow.pngbin0 -> 173 bytes
-rw-r--r--kwin-styles/glow/themes/glass/Makefile.am17
-rw-r--r--kwin-styles/glow/themes/glass/background.pngbin0 -> 794 bytes
-rw-r--r--kwin-styles/glow/themes/glass/close.pngbin0 -> 186 bytes
-rw-r--r--kwin-styles/glow/themes/glass/close_glow.pngbin0 -> 567 bytes
-rw-r--r--kwin-styles/glow/themes/glass/glass.theme19
-rw-r--r--kwin-styles/glow/themes/glass/help.pngbin0 -> 183 bytes
-rw-r--r--kwin-styles/glow/themes/glass/help_glow.pngbin0 -> 554 bytes
-rw-r--r--kwin-styles/glow/themes/glass/iconify.pngbin0 -> 190 bytes
-rw-r--r--kwin-styles/glow/themes/glass/iconify_glow.pngbin0 -> 575 bytes
-rw-r--r--kwin-styles/glow/themes/glass/maximizeoff.pngbin0 -> 169 bytes
-rw-r--r--kwin-styles/glow/themes/glass/maximizeoff_glow.pngbin0 -> 518 bytes
-rw-r--r--kwin-styles/glow/themes/glass/maximizeon.pngbin0 -> 188 bytes
-rw-r--r--kwin-styles/glow/themes/glass/maximizeon_glow.pngbin0 -> 541 bytes
-rw-r--r--kwin-styles/glow/themes/glass/stickyoff.pngbin0 -> 178 bytes
-rw-r--r--kwin-styles/glow/themes/glass/stickyoff_glow.pngbin0 -> 597 bytes
-rw-r--r--kwin-styles/glow/themes/glass/stickyon.pngbin0 -> 180 bytes
-rw-r--r--kwin-styles/glow/themes/glass/stickyon_glow.pngbin0 -> 564 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/Makefile.am17
-rw-r--r--kwin-styles/glow/themes/glass_huge/background.pngbin0 -> 2094 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/close.pngbin0 -> 207 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/close_glow.pngbin0 -> 1386 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/glass_huge.theme19
-rw-r--r--kwin-styles/glow/themes/glass_huge/help.pngbin0 -> 199 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/help_glow.pngbin0 -> 1398 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/iconify.pngbin0 -> 206 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/iconify_glow.pngbin0 -> 1395 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/maximizeoff.pngbin0 -> 187 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/maximizeoff_glow.pngbin0 -> 1397 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/maximizeon.pngbin0 -> 206 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/maximizeon_glow.pngbin0 -> 1417 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/stickyoff.pngbin0 -> 192 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/stickyoff_glow.pngbin0 -> 1409 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/stickyon.pngbin0 -> 194 bytes
-rw-r--r--kwin-styles/glow/themes/glass_huge/stickyon_glow.pngbin0 -> 1414 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/Makefile.am17
-rw-r--r--kwin-styles/glow/themes/glass_large/background.pngbin0 -> 1217 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/close.pngbin0 -> 190 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/close_glow.pngbin0 -> 731 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/glass_large.theme19
-rw-r--r--kwin-styles/glow/themes/glass_large/help.pngbin0 -> 187 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/help_glow.pngbin0 -> 720 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/iconify.pngbin0 -> 194 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/iconify_glow.pngbin0 -> 723 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/maximizeoff.pngbin0 -> 174 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/maximizeoff_glow.pngbin0 -> 667 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/maximizeon.pngbin0 -> 195 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/maximizeon_glow.pngbin0 -> 700 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/stickyoff.pngbin0 -> 182 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/stickyoff_glow.pngbin0 -> 658 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/stickyon.pngbin0 -> 178 bytes
-rw-r--r--kwin-styles/glow/themes/glass_large/stickyon_glow.pngbin0 -> 674 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/Makefile.am17
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/background.pngbin0 -> 1520 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/close.pngbin0 -> 197 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/close_glow.pngbin0 -> 1048 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/glass_verylarge.theme19
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/help.pngbin0 -> 190 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/help_glow.pngbin0 -> 1070 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/iconify.pngbin0 -> 201 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/iconify_glow.pngbin0 -> 1063 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/maximizeoff.pngbin0 -> 179 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/maximizeoff_glow.pngbin0 -> 1060 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/maximizeon.pngbin0 -> 201 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/maximizeon_glow.pngbin0 -> 1073 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/stickyoff.pngbin0 -> 185 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/stickyoff_glow.pngbin0 -> 1059 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/stickyon.pngbin0 -> 183 bytes
-rw-r--r--kwin-styles/glow/themes/glass_verylarge/stickyon_glow.pngbin0 -> 1045 bytes
-rw-r--r--kwin-styles/glow/themes/square/Makefile.am17
-rw-r--r--kwin-styles/glow/themes/square/background.pngbin0 -> 287 bytes
-rw-r--r--kwin-styles/glow/themes/square/close.pngbin0 -> 122 bytes
-rw-r--r--kwin-styles/glow/themes/square/close_glow.pngbin0 -> 164 bytes
-rw-r--r--kwin-styles/glow/themes/square/help.pngbin0 -> 120 bytes
-rw-r--r--kwin-styles/glow/themes/square/help_glow.pngbin0 -> 164 bytes
-rw-r--r--kwin-styles/glow/themes/square/iconify.pngbin0 -> 120 bytes
-rw-r--r--kwin-styles/glow/themes/square/iconify_glow.pngbin0 -> 164 bytes
-rw-r--r--kwin-styles/glow/themes/square/maximizeoff.pngbin0 -> 109 bytes
-rw-r--r--kwin-styles/glow/themes/square/maximizeoff_glow.pngbin0 -> 164 bytes
-rw-r--r--kwin-styles/glow/themes/square/maximizeon.pngbin0 -> 129 bytes
-rw-r--r--kwin-styles/glow/themes/square/maximizeon_glow.pngbin0 -> 164 bytes
-rw-r--r--kwin-styles/glow/themes/square/square.theme19
-rw-r--r--kwin-styles/glow/themes/square/stickyoff.pngbin0 -> 103 bytes
-rw-r--r--kwin-styles/glow/themes/square/stickyoff_glow.pngbin0 -> 164 bytes
-rw-r--r--kwin-styles/glow/themes/square/stickyon.pngbin0 -> 115 bytes
-rw-r--r--kwin-styles/glow/themes/square/stickyon_glow.pngbin0 -> 164 bytes
-rw-r--r--kwin-styles/icewm/Makefile.am21
-rw-r--r--kwin-styles/icewm/config/Makefile.am16
-rw-r--r--kwin-styles/icewm/config/config.cpp271
-rw-r--r--kwin-styles/icewm/config/config.h76
-rw-r--r--kwin-styles/icewm/icewm-themes/Makefile.am12
-rw-r--r--kwin-styles/icewm/icewm-themes/closeA.xpm69
-rw-r--r--kwin-styles/icewm/icewm-themes/closeI.xpm69
-rw-r--r--kwin-styles/icewm/icewm-themes/default.theme48
-rw-r--r--kwin-styles/icewm/icewm-themes/depthA.xpm69
-rw-r--r--kwin-styles/icewm/icewm-themes/depthI.xpm69
-rw-r--r--kwin-styles/icewm/icewm-themes/maximizeA.xpm68
-rw-r--r--kwin-styles/icewm/icewm-themes/maximizeI.xpm68
-rw-r--r--kwin-styles/icewm/icewm-themes/menuButtonA.xpm68
-rw-r--r--kwin-styles/icewm/icewm-themes/menuButtonI.xpm68
-rw-r--r--kwin-styles/icewm/icewm-themes/minimizeA.xpm68
-rw-r--r--kwin-styles/icewm/icewm-themes/minimizeI.xpm68
-rw-r--r--kwin-styles/icewm/icewm-themes/restoreA.xpm68
-rw-r--r--kwin-styles/icewm/icewm-themes/restoreI.xpm68
-rw-r--r--kwin-styles/icewm/icewm-themes/rolldownA.xpm68
-rw-r--r--kwin-styles/icewm/icewm-themes/rolldownI.xpm68
-rw-r--r--kwin-styles/icewm/icewm-themes/rollupA.xpm68
-rw-r--r--kwin-styles/icewm/icewm-themes/rollupI.xpm68
-rw-r--r--kwin-styles/icewm/icewm-themes/titleAB.xpm32
-rw-r--r--kwin-styles/icewm/icewm-themes/titleAJ.xpm37
-rw-r--r--kwin-styles/icewm/icewm-themes/titleAM.xpm73
-rw-r--r--kwin-styles/icewm/icewm-themes/titleAP.xpm73
-rw-r--r--kwin-styles/icewm/icewm-themes/titleAQ.xpm37
-rw-r--r--kwin-styles/icewm/icewm-themes/titleAR.xpm37
-rw-r--r--kwin-styles/icewm/icewm-themes/titleAS.xpm32
-rw-r--r--kwin-styles/icewm/icewm-themes/titleAT.xpm38
-rw-r--r--kwin-styles/icewm/icewm-themes/titleIB.xpm32
-rw-r--r--kwin-styles/icewm/icewm-themes/titleIJ.xpm37
-rw-r--r--kwin-styles/icewm/icewm-themes/titleIM.xpm66
-rw-r--r--kwin-styles/icewm/icewm-themes/titleIP.xpm66
-rw-r--r--kwin-styles/icewm/icewm-themes/titleIQ.xpm37
-rw-r--r--kwin-styles/icewm/icewm-themes/titleIR.xpm37
-rw-r--r--kwin-styles/icewm/icewm-themes/titleIS.xpm32
-rw-r--r--kwin-styles/icewm/icewm-themes/titleIT.xpm38
-rw-r--r--kwin-styles/icewm/icewm.cpp1703
-rw-r--r--kwin-styles/icewm/icewm.desktop11
-rw-r--r--kwin-styles/icewm/icewm.h192
-rw-r--r--kwin-styles/kde1/Makefile.am16
-rw-r--r--kwin-styles/kde1/kde1.desktop7
-rw-r--r--kwin-styles/kde1/kde1client.cpp809
-rw-r--r--kwin-styles/kde1/kde1client.h155
-rw-r--r--kwin-styles/kde1/kde1client_bitmaps.h149
-rw-r--r--kwin-styles/kstep/Makefile.am22
-rw-r--r--kwin-styles/kstep/kstep.desktop12
-rw-r--r--kwin-styles/kstep/nextclient.cpp987
-rw-r--r--kwin-styles/kstep/nextclient.h125
-rw-r--r--kwin-styles/openlook/Makefile.am16
-rw-r--r--kwin-styles/openlook/OpenLook.cpp728
-rw-r--r--kwin-styles/openlook/OpenLook.h115
-rw-r--r--kwin-styles/openlook/openlook.desktop14
-rw-r--r--kwin-styles/riscos/AboveButton.cpp65
-rw-r--r--kwin-styles/riscos/AboveButton.h50
-rw-r--r--kwin-styles/riscos/Button.cpp153
-rw-r--r--kwin-styles/riscos/Button.h81
-rw-r--r--kwin-styles/riscos/CloseButton.cpp66
-rw-r--r--kwin-styles/riscos/CloseButton.h52
-rw-r--r--kwin-styles/riscos/HelpButton.cpp66
-rw-r--r--kwin-styles/riscos/HelpButton.h52
-rw-r--r--kwin-styles/riscos/IconifyButton.cpp66
-rw-r--r--kwin-styles/riscos/IconifyButton.h52
-rw-r--r--kwin-styles/riscos/LowerButton.cpp66
-rw-r--r--kwin-styles/riscos/LowerButton.h52
-rw-r--r--kwin-styles/riscos/Makefile.am39
-rw-r--r--kwin-styles/riscos/Manager.cpp767
-rw-r--r--kwin-styles/riscos/Manager.h123
-rw-r--r--kwin-styles/riscos/MaximiseButton.cpp98
-rw-r--r--kwin-styles/riscos/MaximiseButton.h60
-rw-r--r--kwin-styles/riscos/Palette.h69
-rw-r--r--kwin-styles/riscos/README90
-rw-r--r--kwin-styles/riscos/Static.cpp540
-rw-r--r--kwin-styles/riscos/Static.h134
-rw-r--r--kwin-styles/riscos/StickyButton.cpp99
-rw-r--r--kwin-styles/riscos/StickyButton.h60
-rw-r--r--kwin-styles/riscos/riscos.desktop11
-rw-r--r--kwin-styles/smooth-blend/AUTHORS1
-rw-r--r--kwin-styles/smooth-blend/COPYING340
-rw-r--r--kwin-styles/smooth-blend/CREDITS5
-rw-r--r--kwin-styles/smooth-blend/ChangeLog22
-rw-r--r--kwin-styles/smooth-blend/INSTALL167
-rw-r--r--kwin-styles/smooth-blend/Makefile.am1
-rw-r--r--kwin-styles/smooth-blend/NEWS0
-rw-r--r--kwin-styles/smooth-blend/README15
-rw-r--r--kwin-styles/smooth-blend/TODO4
-rw-r--r--kwin-styles/smooth-blend/client/Makefile.am20
-rw-r--r--kwin-styles/smooth-blend/client/buttons.h1798
-rw-r--r--kwin-styles/smooth-blend/client/config/Makefile.am15
-rw-r--r--kwin-styles/smooth-blend/client/config/configdialog.ui421
-rw-r--r--kwin-styles/smooth-blend/client/config/smoothblendconfig.cc180
-rw-r--r--kwin-styles/smooth-blend/client/config/smoothblendconfig.h55
-rw-r--r--kwin-styles/smooth-blend/client/smoothblend.cc1396
-rw-r--r--kwin-styles/smooth-blend/client/smoothblend.desktop40
-rw-r--r--kwin-styles/smooth-blend/client/smoothblend.h254
-rw-r--r--kwin-styles/system/Makefile.am21
-rw-r--r--kwin-styles/system/system.desktop27
-rw-r--r--kwin-styles/system/systemclient.cpp737
-rw-r--r--kwin-styles/system/systemclient.h111
223 files changed, 19462 insertions, 0 deletions
diff --git a/kwin-styles/Makefile.am b/kwin-styles/Makefile.am
new file mode 100644
index 00000000..82fda365
--- /dev/null
+++ b/kwin-styles/Makefile.am
@@ -0,0 +1,4 @@
+SUBDIRS = kstep glow cde icewm openlook kde1 system riscos smooth-blend
+
+messages:
+ $(XGETTEXT) `find . -name \*.cpp` -o $(podir)/kwin_art_clients.pot
diff --git a/kwin-styles/cde/Makefile.am b/kwin-styles/cde/Makefile.am
new file mode 100644
index 00000000..46d74191
--- /dev/null
+++ b/kwin-styles/cde/Makefile.am
@@ -0,0 +1,22 @@
+
+INCLUDES = $(all_includes)
+
+SUBDIRS = . config
+
+kde_module_LTLIBRARIES = kwin3_cde.la
+
+kwin3_cde_la_SOURCES = cdeclient.cpp
+kwin3_cde_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwin3_cde_la_LIBADD = -lkdecorations
+
+METASOURCES = AUTO
+noinst_HEADERS = cdeclient.h
+
+lnkdir = $(kde_datadir)/kwin/
+lnk_DATA = cde.desktop
+
+EXTRA_DIST = $(lnk_DATA)
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/cde/cde.desktop b/kwin-styles/cde/cde.desktop
new file mode 100644
index 00000000..410c666d
--- /dev/null
+++ b/kwin-styles/cde/cde.desktop
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Name=CDE
+Name[af]=Cde
+Name[hi]=सीडीई
+Name[ne]=सीडीई
+X-KDE-Library=kwin3_cde
diff --git a/kwin-styles/cde/cdeclient.cpp b/kwin-styles/cde/cdeclient.cpp
new file mode 100644
index 00000000..9757ee87
--- /dev/null
+++ b/kwin-styles/cde/cdeclient.cpp
@@ -0,0 +1,863 @@
+/*
+ * $Id$
+ *
+ * CDE KWin client - emulates the look and feel
+ * of dtwm, the CDE window manager.
+ *
+ * Copyright (c) 2000-2001, 2002
+ * Chris Lee <lee@azsites.com>
+ * Lennart Kudling <kudling@kde.org>
+ * Fredrik Hglund <fredrik@kde.org>
+ *
+ * Copyright (c) 2003,2004
+ * Luciano Montanaro <mikelima@cirulla.net>
+ *
+ * Originally based on the KStep client.
+ *
+ * Distributed under the terms of the BSD license.
+ */
+
+#include "cdeclient.h"
+#include <qdatetime.h>
+#include <qlayout.h>
+#include <qbutton.h>
+#include <qcursor.h>
+#include <qlabel.h>
+#include <qtooltip.h>
+#include <qdrawutil.h>
+#include <qpainter.h>
+#include <qapplication.h>
+#include <klocale.h>
+#include <kconfig.h>
+
+extern "C" KDE_EXPORT KDecorationFactory* create_factory()
+{
+ return new CDE::CdeClientFactory();
+}
+
+namespace CDE {
+
+static int s_frameWidth = 5;
+static int s_buttonSize = 19;
+static bool titlebarButtonMode = true;
+static bool coloredFrame = true;
+static Qt::AlignmentFlags textAlignment = Qt::AlignHCenter;
+
+// Precomputed border sizes for accessibility
+// The sizes are applied for tiny -> normal -> large -> very large -> huge ->
+// very huge -> oversized
+static const int borderSizes[] = { 4, 6, 9, 12, 18, 26, 42 };
+
+// Parameters needed to draw the widgets (offsets from the border)
+static int s_o1 = 4;
+static int s_o2 = 7;
+static int s_w1 = 11;
+static int s_w2 = 5;
+
+// These are the line segments for the X on the close button
+
+static const int NUM_CLOSEL_COORDS = 2 * 14;
+static const QCOORD closeLLinesTemplate[NUM_CLOSEL_COORDS] =
+ { 14,3, 12,3, 12,3, 9,6, 5,3, 3,3, 3,3, 3,5,
+ 3,5, 6,8, 6,9, 3,12, 3,12, 3,14 };
+
+static const int NUM_CLOSED_COORDS = 2 * 18;
+static const QCOORD closeDLinesTemplate[NUM_CLOSED_COORDS] =
+ { 5,3, 8,6, 14,4, 14,5, 14,5, 11,8, 11,9, 14,12, 14,12, 14,14,
+ 14,14, 12,14, 12,14, 9,11, 8,11, 5,14, 5,14, 4,14 };
+
+static QCOORD closeLLines[NUM_CLOSEL_COORDS];
+
+static QCOORD closeDLines[NUM_CLOSED_COORDS];
+
+// These are the line segments for the ? on the help button
+static const int NUM_HELPL_COORDS = 2 * 16;
+static const QCOORD helpLLinesTemplate[NUM_HELPL_COORDS] =
+ { 4,6, 4,5, 4,5, 6,3, 6,3, 9,3, 10,3, 11,4,
+ 9,7, 7,9, 7,9, 7,10, 7,14, 7,13, 8,12, 9,12 };
+
+static const int NUM_HELPD_COORDS = 2 * 14;
+static const QCOORD helpDLinesTemplate[NUM_HELPD_COORDS] =
+ { 5,7, 8,6, 12,5, 12,8, 12,8, 10,10, 10,10, 10,11,
+ 10,11, 8,11, 10,14, 10,13, 9,15, 8,15 };
+
+static QCOORD helpLLines[NUM_HELPL_COORDS];
+
+static QCOORD helpDLines[NUM_HELPD_COORDS];
+
+
+// This question mark is taller than the one above and
+// is positioned one pixel higher on the button
+/*
+static const QCOORD helpLLines[] =
+ { 4,5, 4,4, 4,4, 6,2, 6,2, 9,2, 10,2, 11,3,
+ 9,6, 7,8, 7,9, 7,10, 7,13, 8,12, 8,12, 9,12 };
+
+static const QCOORD helpDLines[] =
+ { 5,6, 8,5, 12,4, 12,7, 12,7, 10,9, 10,10, 10,11,
+ 10,11, 8,11, 10,13, 9,14, 9,14, 8,14 };
+*/
+// Same as the one above but with a larger dot under
+// the question mark
+/*
+static const QCOORD helpLLines[] =
+ { 4,5, 4,4, 4,4, 6,2, 6,2, 9,2, 10,2, 11,3,
+ 9,6, 7,8, 7,9, 7,10, 7,14, 7,13, 8,12, 9,12 };
+
+static const QCOORD helpDLines[] =
+ { 5,6, 8,5, 12,4, 12,7, 12,7, 10,9, 10,10, 10,11,
+ 10,11, 8,11, 10,13, 10,14, 9,15, 8,15 };
+*/
+
+static inline const KDecorationOptions* options()
+{
+ return KDecoration::options();
+}
+
+static void fixColorGroup(QColorGroup & colorGroup)
+{
+ QColor light = colorGroup.light();
+
+ int hue, saturation, value;
+
+ light.hsv(&hue, &saturation, &value);
+
+ if (value < 128)
+ {
+ light.setHsv(hue, saturation, 128);
+ colorGroup.setColor(QColorGroup::Light, light);
+ }
+
+ QColor dark = colorGroup.dark();
+
+ dark.hsv(&hue, &saturation, &value);
+
+ if (value < 84)
+ {
+ dark.setHsv(hue, saturation, 84);
+ colorGroup.setColor(QColorGroup::Dark, dark);
+ }
+}
+
+// scaling helper function used to scale the close 'X' glyph
+
+static int scaleCoord(int c)
+{
+ if (c < 6) return c;
+ if (c <= 11) return c + (s_buttonSize - 19) / 2;
+ return c + s_buttonSize - 19;
+}
+
+static void readConfig(CdeClientFactory *f)
+{
+ KConfig conf( "kwincderc" );
+
+ conf.setGroup("General");
+ coloredFrame = conf.readBoolEntry( "UseTitleBarBorderColors", true );
+ titlebarButtonMode = conf.readBoolEntry( "TitlebarButtonMode", true );
+
+ QString value = conf.readEntry( "TextAlignment", "AlignHCenter" );
+ if ( value == "AlignLeft" )
+ textAlignment = Qt::AlignLeft;
+ else if ( value == "AlignHCenter" )
+ textAlignment = Qt::AlignHCenter;
+ else if ( value == "AlignRight" )
+ textAlignment = Qt::AlignRight;
+
+
+ // find preferred border size
+ int i = options()->preferredBorderSize(f);
+ if (i >= 0 && i <= 6) s_frameWidth = borderSizes[i];
+
+ // Do not allow malicious users or corrupt config files to
+ // go past the domain of the valid border sizes.
+
+ // Size limit increased for accessability. LM
+ if (s_frameWidth < 0) s_frameWidth = 0;
+ if (s_frameWidth > 30) s_frameWidth = 30;
+
+ // Force button size to be in a reasonable range.
+ // If the frame width is large, the button size must be large too.
+ s_buttonSize = QFontMetrics(options()->font( true )).height() + 2;
+ if (s_buttonSize < 19) s_buttonSize = 19;
+ if (s_buttonSize < s_frameWidth) s_buttonSize = s_frameWidth;
+ s_buttonSize |= 1; // Be sure the button size is odd.
+
+ // Calculate widths and offsets for the button icons
+ s_o1 = s_buttonSize * 4 / 19;
+ s_o2 = s_buttonSize * 7 / 19;
+ s_w1 = s_buttonSize - 2 * s_o1;
+ s_w2 = s_buttonSize - 2 * s_o2;
+
+ // Copy and scale the close icon
+ int offset = (s_buttonSize - 19) / 2;
+ for (int i = 0; i < NUM_CLOSEL_COORDS; i++) {
+ closeLLines[i] = scaleCoord(closeLLinesTemplate[i]);
+ }
+ for (int i = 0; i < NUM_CLOSED_COORDS; i++) {
+ closeDLines[i] = scaleCoord(closeDLinesTemplate[i]);
+ }
+ // Copy and center the help icon
+ for (int i = 0; i < NUM_HELPL_COORDS; i++) {
+ helpLLines[i] = helpLLinesTemplate[i] + offset;
+ }
+ for (int i = 0; i < NUM_HELPD_COORDS; i++) {
+ helpDLines[i] = helpDLinesTemplate[i] + offset;
+ }
+}
+
+// ---------------------------------------
+
+CdeClientFactory::CdeClientFactory()
+{
+ CDE::readConfig(this);
+}
+
+CdeClientFactory::~CdeClientFactory()
+{
+}
+
+KDecoration *CdeClientFactory::createDecoration(KDecorationBridge *b)
+{
+ return new CdeClient(b, this);
+}
+
+bool CdeClientFactory::reset(unsigned long /*changed*/)
+{
+ // TODO Do not recreate decorations if it is not needed. Look at
+ // ModernSystem for how to do that
+ // For now just return true.
+ CDE::readConfig(this);
+ return true;
+}
+
+bool CdeClientFactory::supports( Ability ability )
+{
+ switch( ability )
+ {
+ case AbilityAnnounceButtons:
+ case AbilityButtonMenu:
+ case AbilityButtonOnAllDesktops:
+ case AbilityButtonHelp:
+ case AbilityButtonMinimize:
+ case AbilityButtonMaximize:
+ case AbilityButtonClose:
+ return true;
+ default:
+ return false;
+ };
+}
+
+QValueList< CdeClientFactory::BorderSize >
+CdeClientFactory::borderSizes() const
+{
+ // the list must be sorted
+ return QValueList< BorderSize >() << BorderTiny << BorderNormal <<
+ BorderLarge << BorderVeryLarge << BorderHuge <<
+ BorderVeryHuge << BorderOversized;
+}
+
+// ---------------------------------------
+
+CdeClient::CdeClient(KDecorationBridge *b, KDecorationFactory *f)
+ : KDecoration(b, f)
+{
+}
+
+void CdeClient::init()
+{
+ createMainWidget(WStaticContents | WResizeNoErase | WRepaintNoErase);
+ widget()->installEventFilter(this);
+
+ widget()->setBackgroundMode(NoBackground);
+
+ mainLayout = new QVBoxLayout(widget());
+ QBoxLayout* windowLayout = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
+ titleLayout = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
+
+ // TODO Check if this stuff can be simplified.
+ // Border sizes are from a fixed set now.
+ if ( s_frameWidth > 1 )
+ {
+ // the style normally draws a black frame around the window, so we
+ // need 1 line of space for that in addition to the normal window frame
+ mainLayout->setMargin( s_frameWidth+1 );
+ }
+ else
+ {
+ // but if the frame is set to just 1 pixel we just draw the black frame
+ // instead of the normal window frame, so no extra space is needed. if
+ // its 0 we don't draw anything.
+ mainLayout->setMargin( s_frameWidth );
+ }
+
+ mainLayout->addLayout( titleLayout );
+ mainLayout->addLayout( windowLayout, 1 );
+
+ if (isPreview())
+ windowLayout->addWidget(new QLabel(i18n(
+ "<center><b>CDE preview</b></center>"), widget()), 1);
+ else
+ windowLayout->addItem( new QSpacerItem( 0, 0 ));
+
+ for ( int i=0; i < BtnCount; i++ )
+ button[i] = NULL;
+
+ addClientButtons( options()->titleButtonsLeft() );
+
+ titlebar = new QSpacerItem( 10, 16, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ titleLayout->addItem( titlebar );
+
+ addClientButtons( options()->titleButtonsRight() );
+
+ titlebarPressed = false;
+ closing = false;
+}
+
+void CdeClient::addClientButtons( const QString& s )
+{
+ if ( s.length() > 0 )
+ for ( unsigned int i = 0; i < s.length(); i++ )
+ {
+ switch( s[i].latin1() )
+ {
+ // Menu button
+ case 'M':
+ if ( ! button[BtnMenu] )
+ {
+ button[BtnMenu] = new CdeButton( this, "menu", BtnMenu, i18n("Menu"), LeftButton|RightButton );
+ connect( button[BtnMenu], SIGNAL(pressed()), SLOT(menuButtonPressed()) );
+ connect( button[BtnMenu], SIGNAL(released()), SLOT(menuButtonReleased()) );
+ titleLayout->addWidget( button[BtnMenu] );
+ }
+ break;
+
+ //Help button
+ case 'H':
+ if ( providesContextHelp() && (! button[BtnHelp] ) )
+ {
+ button[BtnHelp] = new CdeButton( this, "help", BtnHelp, i18n("Help") );
+ connect(button[BtnHelp],
+ SIGNAL(clicked()), SLOT(showContextHelp()));
+ titleLayout->addWidget( button[BtnHelp] );
+ }
+ break;
+
+ //Minimize button
+ case 'I':
+ if ( (! button[BtnIconify] ) && isMinimizable() )
+ {
+ button[BtnIconify] = new CdeButton( this, "iconify", BtnIconify, i18n("Minimize") );
+ connect(button[BtnIconify],
+ SIGNAL(clicked()), SLOT(minimize()));
+ titleLayout->addWidget( button[BtnIconify] );
+ }
+ break;
+
+ // Maximize button
+ case 'A':
+ if ( (! button[BtnMax] ) && isMaximizable() )
+ {
+ button[BtnMax] = new CdeButton(this, "maximize", BtnMax, i18n("Maximize"), LeftButton|MidButton|RightButton);
+ connect(button[BtnMax], SIGNAL(clicked()),
+ SLOT(maximizeButtonClicked()));
+ titleLayout->addWidget( button[BtnMax] );
+ }
+ break;
+
+ // Close button
+ case 'X':
+ if ( !button[BtnClose] && isCloseable())
+ {
+ button[BtnClose] = new CdeButton(this, "close", BtnClose, i18n("Close"));
+ connect( button[BtnClose], SIGNAL( clicked()), SLOT(closeWindow()) );
+ titleLayout->addWidget( button[BtnClose] );
+ }
+ // Add onAlldesktops button and spacers
+ }
+ }
+
+}
+
+void CdeClient::captionChange()
+{
+ widget()->repaint(titlebar->geometry(), false);
+}
+
+void CdeClient::activeChange()
+{
+ for ( int i=0; i < BtnCount; i++ )
+ if ( button[i] ) button[i]->reset();
+
+ widget()->repaint(false);
+}
+
+void CdeClient::maximizeChange()
+{
+ if ( button[BtnMax] ) {
+ bool m = maximizeMode() == MaximizeFull;
+ QToolTip::remove(button[BtnMax]);
+ QToolTip::add(button[BtnMax], m ? i18n("Restore") : i18n("Maximize"));
+ button[BtnMax]->repaint();
+ }
+}
+
+void CdeClient::iconChange()
+{
+}
+
+void CdeClient::shadeChange()
+{
+}
+
+void CdeClient::showEvent(QShowEvent *)
+{
+ widget()->repaint();
+}
+
+void CdeClient::desktopChange()
+{
+ // Nothing to do yet
+}
+
+QSize CdeClient::minimumSize() const
+{
+ return QSize(2 * (s_buttonSize + s_frameWidth),
+ 2 * s_frameWidth + s_buttonSize);
+}
+
+void CdeClient::resize(const QSize& s)
+{
+ widget()->resize(s);
+}
+
+void CdeClient::maximizeButtonClicked()
+{
+ if (button[BtnMax]) {
+ maximize(button[BtnMax]->lastButton());
+ }
+}
+
+void CdeClient::menuButtonPressed()
+{
+ static QTime* t = NULL;
+ static CdeClient* lastClient = NULL;
+ if( t == NULL )
+ t = new QTime;
+ bool dbl = ( lastClient == this && t->elapsed() <= QApplication::doubleClickInterval());
+ lastClient = this;
+ t->start();
+ if( !dbl )
+ {
+ QRect menuRect = button[BtnMenu]->rect();
+ QPoint menuTop = button[BtnMenu]->mapToGlobal(menuRect.topLeft());
+ QPoint menuBottom =
+ button[BtnMenu]->mapToGlobal(menuRect.bottomRight());
+ KDecorationFactory* f = factory();
+ showWindowMenu(QRect(menuTop, menuBottom));
+ if( !f->exists( this )) // 'this' was deleted
+ return;
+ button[BtnMenu]->setDown(false);
+ }
+ else
+ closing = true;
+}
+
+void CdeClient::menuButtonReleased()
+{
+ if( closing )
+ closeWindow();
+}
+
+void CdeClient::resizeEvent( QResizeEvent* e)
+{
+ if (widget()->isVisibleToTLW()) {
+ widget()->update();
+ int dx = 0;
+ int dy = 0;
+
+ if ( e->oldSize().width() != width() )
+ dx = 32 + QABS( e->oldSize().width() - width() );
+
+ if ( e->oldSize().height() != height() )
+ dy = 8 + QABS( e->oldSize().height() - height() );
+
+ if ( dy )
+ widget()->update( 0, height() - dy + 1, width(), dy );
+
+ if ( dx )
+ {
+ widget()->update( width() - dx + 1, 0, dx, height() );
+ widget()->update( QRect( QPoint(4,4),
+ titlebar->geometry().bottomLeft() - QPoint(1,0) ) );
+ widget()->update(QRect(titlebar->geometry().topRight(),
+ QPoint(width() - 4, titlebar->geometry().bottom())));
+
+ // Titlebar needs no paint event
+ QApplication::postEvent( this, new QPaintEvent( titlebar->geometry(), false ) );
+ }
+ }
+}
+
+void CdeClient::paintEvent( QPaintEvent* )
+{
+ QPainter p(widget());
+
+ QColorGroup colorGroup;
+
+ if ( coloredFrame )
+ colorGroup = options()->colorGroup( KDecoration::ColorTitleBar, isActive() );
+ else
+ colorGroup = options()->colorGroup( KDecoration::ColorFrame, isActive() );
+
+ fixColorGroup( colorGroup );
+
+ QRect trect = titlebar->geometry();
+ QRect mrect = widget()->rect();
+
+ if ( s_frameWidth > 0 )
+ {
+ // draw black frame:
+ p.setPen( Qt::black );
+ p.drawRect( mrect );
+ }
+
+ p.setPen( Qt::NoPen );
+ p.setBrush( colorGroup.background() );
+
+
+ if ( s_frameWidth > 1 )
+ {
+ bool shaded = isShade();
+ int longSide = s_frameWidth + s_buttonSize;
+
+ // draw frame-background:
+ p.drawRect( 1, 1,
+ mrect.width() - 2, s_frameWidth );
+ p.drawRect( 1, mrect.height() - s_frameWidth - 1,
+ mrect.width() - 2, s_frameWidth );
+ p.drawRect( 1, s_frameWidth + 1,
+ s_frameWidth, mrect.height() - 2*s_frameWidth - 2 );
+ p.drawRect( mrect.width() - s_frameWidth - 1, s_frameWidth + 1,
+ s_frameWidth, mrect.height() - 2*s_frameWidth - 2 );
+
+ if ( ! shaded )
+ {
+ // draw left and right frames:
+ qDrawShadePanel( &p, 1, longSide + 1,
+ s_frameWidth, mrect.height() - 2 * (longSide + 1),
+ colorGroup );
+
+ qDrawShadePanel( &p, mrect.width() - s_frameWidth - 1, longSide + 1,
+ s_frameWidth, mrect.height() - 2 * (longSide + 1),
+ colorGroup );
+ }
+
+ // draw top and bottom frames:
+ qDrawShadePanel( &p, longSide + 1, 1,
+ mrect.width() - 2 * (longSide + 1), s_frameWidth,
+ colorGroup );
+
+ qDrawShadePanel( &p, longSide + 1, mrect.height() - s_frameWidth - 1,
+ mrect.width() - 2 * (longSide + 1), s_frameWidth,
+ colorGroup );
+
+ // draw light corner parts:
+ p.setPen( colorGroup.light() );
+
+ // tl corner:
+ p.drawLine( 1, 1, longSide - 1, 1 );
+ p.drawLine( 1, 1, 1, longSide - 1 );
+
+ // tr corner:
+ p.drawLine( mrect.width() - 3, 1, mrect.width() - longSide - 1, 1 );
+ p.drawLine( mrect.width() - longSide - 1, 1,
+ mrect.width() - longSide - 1, s_frameWidth - 1 );
+ p.drawLine( mrect.width() - s_frameWidth - 1, s_frameWidth,
+ mrect.width() - s_frameWidth - 1, longSide - 1 );
+
+ // br corner:
+ if ( !shaded )
+ {
+ p.drawLine( mrect.width() - 3, mrect.height() - longSide - 1,
+ mrect.width() - s_frameWidth - 1, mrect.height() - longSide - 1 );
+ }
+ p.drawLine( mrect.width() - s_frameWidth - 1, mrect.height() - longSide,
+ mrect.width() - s_frameWidth - 1, mrect.height() - s_frameWidth - 1 );
+ p.drawLine( mrect.width() - s_frameWidth - 2, mrect.height() - s_frameWidth - 1,
+ mrect.width() - longSide - 1, mrect.height() - s_frameWidth - 1 );
+ p.drawLine( mrect.width() - longSide - 1, mrect.height() - s_frameWidth,
+ mrect.width() - longSide - 1, mrect.height() - 2 );
+
+ // bl corner:
+ if ( !shaded )
+ {
+ p.drawLine( s_frameWidth-1, mrect.height() - longSide - 1,
+ 2, mrect.height() - longSide - 1 );
+ }
+ p.drawLine( 1, mrect.height() - longSide - 1,
+ 1, mrect.height() - 3 );
+ p.drawLine( longSide - 1, mrect.height() - s_frameWidth - 1,
+ s_frameWidth + 1, mrect.height() - s_frameWidth - 1 );
+
+ // draw dark corner parts:
+ p.setPen( colorGroup.dark() );
+
+ // tl corner:
+ if ( !shaded )
+ p.drawLine( 1, longSide, s_frameWidth, longSide );
+ p.drawLine( s_frameWidth, longSide - 1, s_frameWidth, s_frameWidth );
+ p.drawLine( s_frameWidth + 1, s_frameWidth, longSide, s_frameWidth );
+ p.drawLine( s_frameWidth + s_buttonSize, s_frameWidth, longSide, 1 );
+
+ // tr corner:
+ p.drawLine( mrect.width() - longSide - 1, s_frameWidth,
+ mrect.width() - s_frameWidth - 2, s_frameWidth );
+ if ( !shaded )
+ {
+ p.drawLine( mrect.width() - s_frameWidth - 1, longSide,
+ mrect.width() - 2, longSide );
+ }
+ p.drawLine( mrect.width() - 2, longSide, mrect.width() - 2, 1 );
+
+ // br corner:
+ p.drawLine( mrect.width() - longSide - 1, mrect.height() - 2,
+ mrect.width() - 3, mrect.height() - 2 );
+ p.drawLine( mrect.width() - 2, mrect.height() - 2,
+ mrect.width() - 2, mrect.height() - longSide - 2 );
+
+ // bl corner:
+ p.drawLine( 1, mrect.height() - 2,
+ longSide, mrect.height() - 2 );
+ p.drawLine( s_frameWidth + s_buttonSize, mrect.height() - 3,
+ longSide, mrect.height() - s_frameWidth - 1 );
+ p.drawLine( s_frameWidth, mrect.height() - s_frameWidth - 1,
+ s_frameWidth, mrect.height() - longSide - 1 );
+ }
+
+
+ p.setPen( Qt::NoPen );
+
+ if ( !coloredFrame )
+ {
+ colorGroup = options()->colorGroup( KDecoration::ColorTitleBar, isActive() );
+ fixColorGroup( colorGroup );
+ p.setBrush( colorGroup.background() );
+ }
+
+ // draw titlebar:
+ p.drawRect( trect );
+ qDrawShadePanel( &p, trect, colorGroup, titlebarPressed );
+
+ // draw caption:
+ if ( titlebarPressed ) // move the caption right and down if the titlebar is pressed
+ trect.moveBy( 1,1 ); // Note: the real Mwm doesn't actually do this
+
+ p.setFont( options()->font( true ) );
+ p.setPen( options()->color( KDecoration::ColorFont, isActive() ) );
+ if ( p.fontMetrics().width( caption() ) > trect.width() - 6 )
+ {
+ // left align the text if its too wide to fit in the titlebar
+ p.drawText( trect.x() + 3, trect.y(),
+ trect.width() - 6, trect.height(),
+ AlignLeft | AlignVCenter, caption() );
+ }
+ else
+ {
+ // otherwise we'll draw it according to the user settings
+ p.drawText( trect.x() + 3, trect.y(),
+ trect.width() - 6, trect.height(),
+ textAlignment | AlignVCenter, caption() );
+ }
+
+ // Draw a line behind the wrapped window to prevent having
+ // unpainted areas when we're shaded.
+ p.setPen( colorGroup.dark() );
+ p.drawLine(s_frameWidth + 1, mrect.height() - s_frameWidth - 2,
+ mrect.width() - s_frameWidth - 2, mrect.height() - s_frameWidth - 2);
+
+}
+
+KDecoration::Position CdeClient::mousePosition( const QPoint& p ) const
+{
+ const int range = s_frameWidth + s_buttonSize;
+ const int border = s_frameWidth + 1;
+
+ Position m = PositionCenter;
+
+ if ((p.x() > border && p.x() < width() - border)
+ && (p.y() > border && p.y() < height() - border))
+ return PositionCenter;
+
+ if (p.y() < range && p.x() <= range)
+ m = PositionTopLeft;
+ else if (p.y() >= height() - range && p.x() >= width() - range)
+ m = PositionBottomRight;
+ else if (p.y() >= height()-range && p.x() <= range)
+ m = PositionBottomLeft;
+ else if (p.y() < range && p.x() >= width() - range)
+ m = PositionTopRight;
+ else if (p.y() < border)
+ m = PositionTop;
+ else if (p.y() >= height() - border)
+ m = PositionBottom;
+ else if (p.x() <= border)
+ m = PositionLeft;
+ else if (p.x() >= width() - border)
+ m = PositionRight;
+ else
+ m = PositionCenter;
+ return m;
+}
+
+void CdeClient::mouseDoubleClickEvent( QMouseEvent * e )
+{
+ if ( e->button() == LeftButton && titlebar->geometry().contains( e->pos() ) )
+ titlebarDblClickOperation();
+}
+
+void CdeClient::wheelEvent( QWheelEvent * e )
+{
+ if (isSetShade() || titleLayout->geometry().contains( e->pos() ) )
+ titlebarMouseWheelOperation( e->delta());
+}
+
+void CdeClient::mousePressEvent( QMouseEvent * e )
+{
+ if ( e->button() == LeftButton && titlebar->geometry().contains( e->pos() ) )
+ {
+ if ( titlebarButtonMode )
+ {
+ titlebarPressed = true;
+ widget()->repaint(titlebar->geometry(), false);
+ }
+ }
+}
+
+void CdeClient::borders(int &left, int &right, int &top, int &bottom) const
+{
+ left = right = bottom = s_frameWidth + 1;
+ top = s_buttonSize + s_frameWidth + 1;
+}
+
+void CdeClient::mouseReleaseEvent( QMouseEvent * e )
+{
+ if ( e->button() == LeftButton && titlebarPressed )
+ {
+ titlebarPressed = false;
+ widget()->repaint(titlebar->geometry(), false);
+ }
+}
+
+bool CdeClient::eventFilter(QObject *o, QEvent *e)
+{
+ if (o != widget())
+ return false;
+ switch (e->type()) {
+ case QEvent::Resize:
+ resizeEvent(static_cast< QResizeEvent* >(e));
+ return true;
+ case QEvent::Paint:
+ paintEvent(static_cast< QPaintEvent* >(e));
+ return true;
+ case QEvent::MouseButtonDblClick:
+ mouseDoubleClickEvent(static_cast< QMouseEvent* >(e));
+ return true;
+ case QEvent::MouseButtonPress:
+ processMousePressEvent(static_cast< QMouseEvent* >(e));
+ return true;
+ case QEvent::Show:
+ showEvent(static_cast< QShowEvent* >(e));
+ return true;
+ case QEvent::Wheel:
+ wheelEvent( static_cast< QWheelEvent* >( e ));
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+// ---------------------------------------
+
+CdeButton::CdeButton(CdeClient* parent,
+ const char* name, int btnType, const QString& tip, int realize_btns)
+ : QButton(parent->widget(), name), m_btnType(btnType), last_button(NoButton)
+{
+ setBackgroundMode( QWidget::NoBackground );
+ setFixedSize( s_buttonSize, s_buttonSize );
+ resize( s_buttonSize, s_buttonSize );
+ m_parent = parent;
+
+ setCursor(ArrowCursor);
+ QToolTip::add(this, tip);
+
+ m_realize_buttons = realize_btns;
+}
+
+void CdeButton::reset()
+{
+ repaint( false );
+}
+
+void CdeButton::drawButton( QPainter* p )
+{
+ p->setBrush( options()->color( KDecoration::ColorTitleBar, m_parent->isActive() ) );
+ p->drawRect( 0, 0, s_buttonSize, s_buttonSize );
+
+ QColorGroup colorGroup =
+ options()->colorGroup( KDecoration::ColorTitleBar, m_parent->isActive() );
+
+ fixColorGroup(colorGroup);
+
+ qDrawShadePanel( p, 0, 0, s_buttonSize, s_buttonSize,
+ colorGroup, isDown() );
+
+ switch ( m_btnType )
+ {
+ case (BtnMenu):
+ qDrawShadePanel( p, s_o1, s_o2, s_w1, s_w2, colorGroup );
+ break;
+ case (BtnHelp):
+ p->setPen( colorGroup.light() );
+ p->drawLineSegments( QPointArray(16, helpLLines) );
+ p->setPen( colorGroup.dark() );
+ p->drawLineSegments( QPointArray(14, helpDLines) );
+ break;
+ case (BtnIconify):
+ qDrawShadePanel( p, s_o2, s_o2, s_w2, s_w2, colorGroup );
+ break;
+ case (BtnMax):
+ qDrawShadePanel( p, s_o1, s_o1, s_w1, s_w1, colorGroup,
+ m_parent->maximizeMode() == KDecoration::MaximizeFull );
+ break;
+ case (BtnClose):
+ p->setPen( colorGroup.dark() );
+ p->drawLineSegments( QPointArray(18, closeDLines) );
+ p->setPen( colorGroup.light() );
+ p->drawLineSegments( QPointArray(15, closeLLines) );
+ break;
+ }
+}
+
+void CdeButton::mousePressEvent(QMouseEvent *e)
+{
+ last_button = e->button();
+ QMouseEvent me(e->type(), e->pos(),
+ e->globalPos(), (e->button()&m_realize_buttons)?LeftButton:NoButton, e->state());
+ QButton::mousePressEvent(&me);
+}
+
+void CdeButton::mouseReleaseEvent(QMouseEvent * e)
+{
+ last_button = e->button();
+ QMouseEvent me(e->type(), e->pos(),
+ e->globalPos(), (e->button()&m_realize_buttons)?LeftButton:NoButton, e->state());
+ QButton::mouseReleaseEvent(&me);
+}
+
+} // CDE namespace
+
+#include "cdeclient.moc"
+
+// vim: sw=4
diff --git a/kwin-styles/cde/cdeclient.h b/kwin-styles/cde/cdeclient.h
new file mode 100644
index 00000000..40e8f2eb
--- /dev/null
+++ b/kwin-styles/cde/cdeclient.h
@@ -0,0 +1,118 @@
+/*
+ * CDE KWin client - emulates the look and feel
+ * of dtwm, the CDE window manager.
+ *
+ * Copyright (c) 2000-2001, 2002
+ * Chris Lee <lee@azsites.com>
+ * Lennart Kudling <kudling@kde.org>
+ * Fredrik Hglund <fredrik@kde.org>
+ *
+ * Copyright (c) 2003
+ * Luciano Montanaro <mikelima@cirulla.net>
+ *
+ * Originally based on the KStep client.
+ *
+ * Distributed under the terms of the BSD license.
+ */
+
+#ifndef __CDECLIENT_H
+#define __CDECLIENT_H
+
+#include <qbutton.h>
+#include <qbitmap.h>
+#include <kpixmap.h>
+#include <kdecoration.h>
+#include <kdecorationfactory.h>
+
+class QLabel;
+class QBoxLayout;
+class QVBoxLayout;
+class QSpacerItem;
+
+namespace CDE {
+
+class CdeClient;
+
+enum Buttons { BtnMenu=0, BtnHelp, BtnIconify, BtnMax, BtnClose, BtnCount };
+
+class CdeButton : public QButton
+{
+public:
+ CdeButton( CdeClient* parent=0, const char* name=0, int btnType=0,
+ const QString& tip=NULL, int realize_btns = LeftButton );
+ void reset();
+ ButtonState lastButton() { return last_button; }
+
+protected:
+ void mousePressEvent(QMouseEvent *e);
+ void mouseReleaseEvent(QMouseEvent *e);
+ virtual void drawButton(QPainter *p);
+
+private:
+ CdeClient *m_parent;
+ int m_btnType;
+ int m_realize_buttons;
+ ButtonState last_button;
+};
+
+class CdeClient : public KDecoration
+{
+ Q_OBJECT
+public:
+ CdeClient(KDecorationBridge *b, KDecorationFactory *f);
+ ~CdeClient() {};
+ void init();
+
+protected:
+ bool eventFilter(QObject *o, QEvent *e);
+ void resizeEvent( QResizeEvent* );
+ void paintEvent( QPaintEvent* );
+
+ void showEvent(QShowEvent *);
+ void addClientButtons( const QString& );
+ void mouseDoubleClickEvent( QMouseEvent* );
+ void wheelEvent( QWheelEvent * );
+ void captionChange();
+ void desktopChange();
+ void activeChange();
+ void shadeChange();
+ void iconChange();
+ QSize minimumSize() const;
+ void resize(const QSize &size);
+ void borders(int &left, int &right, int &top, int &bottom) const;
+ void mousePressEvent( QMouseEvent* );
+ void mouseReleaseEvent( QMouseEvent* );
+ void maximizeChange();
+ Position mousePosition( const QPoint& p ) const;
+
+protected slots:
+ void menuButtonPressed();
+ void menuButtonReleased();
+ void maximizeButtonClicked();
+
+private:
+ CdeButton* button[BtnCount];
+ QVBoxLayout* mainLayout;
+ QBoxLayout* titleLayout;
+ QSpacerItem* titlebar;
+ bool titlebarPressed;
+ bool closing;
+};
+
+class CdeClientFactory: public QObject, public KDecorationFactory
+{
+public:
+ CdeClientFactory();
+ virtual ~CdeClientFactory();
+ virtual KDecoration *createDecoration(KDecorationBridge *);
+ virtual bool supports( Ability ability );
+ virtual bool reset(unsigned long changed);
+
+ QValueList< CdeClientFactory::BorderSize > borderSizes() const;
+
+};
+
+}
+
+#endif
+
diff --git a/kwin-styles/cde/config/Makefile.am b/kwin-styles/cde/config/Makefile.am
new file mode 100644
index 00000000..c12933e4
--- /dev/null
+++ b/kwin-styles/cde/config/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = $(all_includes)
+
+kde_module_LTLIBRARIES = kwin_cde_config.la
+
+kwin_cde_config_la_SOURCES = config.cpp
+kwin_cde_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwin_cde_config_la_LIBADD = $(LIB_KDEUI)
+
+METASOURCES = AUTO
+noinst_HEADERS = config.h
+
+lnkdir = $(kde_datadir)/kwin/
+
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/cde/config/config.cpp b/kwin-styles/cde/config/config.cpp
new file mode 100644
index 00000000..5c3ac455
--- /dev/null
+++ b/kwin-styles/cde/config/config.cpp
@@ -0,0 +1,131 @@
+// $Id$
+#include "config.h"
+#include <kapplication.h>
+#include <kglobal.h>
+#include <qwhatsthis.h>
+#include <qvbox.h>
+#include <klocale.h>
+
+extern "C" KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent )
+{
+ return new CdeConfig(conf, parent);
+}
+
+
+/* NOTE:
+ * 'conf' is a pointer to the kwindecoration modules open kwin config,
+ * and is by default set to the "Style" group.
+ *
+ * 'parent' is the parent of the QObject, which is a VBox inside the
+ * Configure tab in kwindecoration
+ */
+
+CdeConfig::CdeConfig( KConfig* conf, QWidget* parent )
+ : QObject( parent )
+{
+ cdeConfig = new KConfig("kwincderc");
+ KGlobal::locale()->insertCatalogue("kwin_art_clients");
+
+ groupBox = new QVBox( parent );
+
+ bgAlign = new QButtonGroup( 3, Qt::Horizontal, i18n("Text &Alignment"), groupBox );
+ bgAlign->setExclusive( true );
+ QWhatsThis::add( bgAlign, i18n("Use these buttons to set the alignment of the titlebar caption text.") );
+ new QRadioButton( i18n("Left"), bgAlign, "AlignLeft" );
+ QRadioButton *radio2 = new QRadioButton( i18n("Centered"), bgAlign, "AlignHCenter" );
+ radio2->setChecked( true );
+ new QRadioButton( i18n("Right"), bgAlign, "AlignRight" );
+
+ cbColorBorder = new QCheckBox( i18n("Draw window frames using &titlebar colors"), groupBox );
+ QWhatsThis::add( cbColorBorder, i18n("When selected, the window decoration borders "
+ "are drawn using the titlebar colors. Otherwise, they are "
+ "drawn using normal border colors instead.") );
+
+// cbTitlebarButton = new QCheckBox( i18n("Titlebar acts like a &pushbutton when clicked"), groupBox );
+// QWhatsThis::add( cbTitlebarButton, i18n("When selected, this option causes the window titlebar to behave "
+// "as if it was a pushbutton when you click it to move the window.") );
+
+ (void) new QLabel( i18n("Tip: If you want the look of the original Motif(tm) Window Manager,\n"
+ "click the \"Buttons\" tab above and remove the help\n"
+ "and close buttons from the titlebar."), groupBox );
+
+ // Load configuration options
+ load( conf );
+
+ // Ensure we track user changes properly
+ connect( cbColorBorder, SIGNAL(clicked()), SLOT(slotSelectionChanged()) );
+// connect( cbTitlebarButton, SIGNAL(clicked()), SLOT(slotSelectionChanged()) );
+ connect( bgAlign, SIGNAL(clicked(int)), SLOT(slotSelectionChanged(int)) );
+
+ // Make the widgets visible in kwindecoration
+ groupBox->show();
+}
+
+
+CdeConfig::~CdeConfig()
+{
+ delete bgAlign;
+ delete groupBox;
+ delete cdeConfig;
+}
+
+
+void CdeConfig::slotSelectionChanged()
+{
+ emit changed();
+}
+
+void CdeConfig::slotSelectionChanged( int )
+{
+ emit changed();
+}
+
+// Loads the configurable options from the kwinrc config file
+// It is passed the open config from kwindecoration to improve efficiency
+void CdeConfig::load( KConfig* /*conf*/ )
+{
+ cdeConfig->setGroup("General");
+
+ QString value = cdeConfig->readEntry( "TextAlignment", "AlignHCenter" );
+ QRadioButton *button = (QRadioButton*)bgAlign->child( (const char *)value.latin1() );
+ if ( button )
+ button->setChecked( true );
+
+ bool coloredFrame = cdeConfig->readBoolEntry( "UseTitleBarBorderColors", true );
+ cbColorBorder->setChecked( coloredFrame );
+
+// bool titlebarButton = cdeConfig->readBoolEntry( "TitlebarButtonMode", true );
+// cbTitlebarButton->setChecked( titlebarButton );
+}
+
+
+// Saves the configurable options to the kwinrc config file
+void CdeConfig::save( KConfig* /*conf*/ )
+{
+ cdeConfig->setGroup("General");
+
+ QRadioButton *button = (QRadioButton*)bgAlign->selected();
+ if ( button )
+ cdeConfig->writeEntry( "TextAlignment", QString(button->name()) );
+
+ cdeConfig->writeEntry( "UseTitleBarBorderColors", cbColorBorder->isChecked() );
+// cdeConfig->writeEntry( "TitlebarButtonMode", cbTitlebarButton->isChecked() );
+
+ // Ensure others trying to read this config get updated
+ cdeConfig->sync();
+}
+
+
+// Sets UI widget defaults which must correspond to style defaults
+void CdeConfig::defaults()
+{
+ QRadioButton *button = (QRadioButton*)bgAlign->child( "AlignHCenter" );
+ if ( button )
+ button->setChecked( true );
+
+ cbColorBorder->setChecked( true );
+// cbTitlebarButton->setChecked( true );
+}
+
+#include "config.moc"
+// vim: ts=4
diff --git a/kwin-styles/cde/config/config.h b/kwin-styles/cde/config/config.h
new file mode 100644
index 00000000..723d7b95
--- /dev/null
+++ b/kwin-styles/cde/config/config.h
@@ -0,0 +1,51 @@
+#ifndef __KDE_CDECONFIG_H
+#define __KDE_CDECONFIG_H
+
+#include <qcheckbox.h>
+#include <qgroupbox.h>
+#include <qbuttongroup.h>
+#include <qlabel.h>
+#include <qradiobutton.h>
+#include <qhbox.h>
+#include <kconfig.h>
+
+class QCheckBox;
+class QGroupBox;
+class QVBox;
+class QLabel;
+class QRadioButton;
+
+class CdeConfig: public QObject
+{
+ Q_OBJECT
+
+ public:
+ CdeConfig( KConfig* conf, QWidget* parent );
+ ~CdeConfig();
+
+ // These public signals/slots work similar to KCM modules
+ signals:
+ void changed();
+
+ public slots:
+ void load( KConfig* conf );
+ void save( KConfig* conf );
+ void defaults();
+
+ protected slots:
+ void slotSelectionChanged(); // Internal use
+ void slotSelectionChanged( int );
+
+ private:
+ KConfig* cdeConfig;
+ QCheckBox* cbColorBorder;
+// QCheckBox* cbTitlebarButton;
+ QHBox* groupBox;
+ QGroupBox* gbSlider;
+ QButtonGroup* bgAlign;
+};
+
+
+#endif
+
+// vim: ts=4
diff --git a/kwin-styles/configure.in.in b/kwin-styles/configure.in.in
new file mode 100644
index 00000000..9759bdaa
--- /dev/null
+++ b/kwin-styles/configure.in.in
@@ -0,0 +1,3 @@
+if test "x$kde_use_qt_mac" = "xyes"; then
+ DO_NOT_COMPILE="$DO_NOT_COMPILE kwin-styles"
+fi
diff --git a/kwin-styles/glow/Makefile.am b/kwin-styles/glow/Makefile.am
new file mode 100644
index 00000000..92d5a63a
--- /dev/null
+++ b/kwin-styles/glow/Makefile.am
@@ -0,0 +1,22 @@
+
+INCLUDES = $(all_includes)
+
+SUBDIRS = . config themes
+
+kde_module_LTLIBRARIES = kwin3_glow.la
+
+kwin3_glow_la_SOURCES = glowclient.cpp glowbutton.cpp
+kwin3_glow_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwin3_glow_la_LIBADD = $(LIB_KDECORE) -lkdecorations
+
+METASOURCES = AUTO
+noinst_HEADERS = glowclient.h glowbutton.h resources.h
+
+linkdir = $(kde_datadir)/kwin/
+link_DATA = glow.desktop
+
+EXTRA_DIST = $(link_DATA)
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/glow/config/Makefile.am b/kwin-styles/glow/config/Makefile.am
new file mode 100644
index 00000000..e677ff91
--- /dev/null
+++ b/kwin-styles/glow/config/Makefile.am
@@ -0,0 +1,17 @@
+INCLUDES = $(all_includes)
+
+kde_module_LTLIBRARIES = kwin_glow_config.la
+
+kwin_glow_config_la_SOURCES = glowconfigdialog.cpp
+kwin_glow_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwin_glow_config_la_LIBADD = $(LIB_KDEUI)
+
+METASOURCES = AUTO
+noinst_HEADERS = glowconfigdialog.h
+
+lnkdir = $(kde_datadir)/kwin/
+
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/glow/config/bitmaps.h b/kwin-styles/glow/config/bitmaps.h
new file mode 100644
index 00000000..7ecb262a
--- /dev/null
+++ b/kwin-styles/glow/config/bitmaps.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ bitmaps.h - description
+ -------------------
+ begin : Thu Sep 12 2001
+ copyright : (C) 2001 by Henning Burchardt
+ email : h_burchardt@gmx.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef BITMAPS_H
+#define BITMAPS_H
+
+#define BITMAP_SIZE 17
+
+static unsigned char close_bits[] = {
+ 0x00,0x00,0x16,0x00,0x00,0x16,0x00,0x00,0xf8,0x00,0x00,0x0c,0x10,0x10,0x60,
+ 0x30,0x18,0x00,0x60,0x0c,0xc8,0xc0,0x07,0x16,0x80,0x03,0x60,0xc0,0x07,0x00,
+ 0x60,0x0c,0x00,0x30,0x18,0xf8,0x10,0x10,0x00,0x00,0x00,0x46,0x00,0x00,0xfe,
+ 0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x89,0xf3,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
+static unsigned char help_bits[] = {
+ 0x00,0x00,0x16,0x00,0x00,0x16,0x00,0x00,0x10,0x00,0x00,0x0c,0x80,0x07,0xb6,
+ 0x40,0x0c,0x00,0x00,0x0c,0xc8,0x00,0x0c,0x16,0x00,0x06,0xb6,0x00,0x03,0x00,
+ 0x00,0x01,0x00,0x00,0x00,0x10,0x00,0x01,0x00,0x00,0x00,0xac,0x00,0x00,0xfe,
+ 0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x24,0xc4,0x3f,0x40,0x01,0xf3,0x00,0x00,
+ 0x70,0xb9,0x65,0x40,0x70,0xb9,0x65,0x40 };
+static unsigned char maximizeoff_bits[] = {
+ 0x00,0x00,0x16,0x00,0x00,0x16,0x00,0x00,0x1e,0x00,0x00,0x0c,0xf0,0x1f,0x60,
+ 0xf0,0x1f,0x00,0x10,0x10,0xc8,0x10,0x10,0x16,0x10,0x10,0x60,0x10,0x10,0x00,
+ 0x10,0x10,0x00,0x10,0x10,0x1e,0xf0,0x1f,0x00,0x00,0x00,0x50,0x00,0x00,0xfe,
+ 0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x68,0xb9,0x65,0x40,0x01,0xf2,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xe0,0xb1,0x65,0x40 };
+static unsigned char minimize_bits[] = {
+ 0x00,0x00,0x16,0x00,0x00,0x16,0x00,0x00,0x10,0x00,0x00,0x0c,0x00,0x00,0xb6,
+ 0xe0,0x0f,0x00,0x00,0x00,0xc8,0x20,0x08,0x16,0x60,0x0c,0xb6,0xc0,0x06,0x00,
+ 0x80,0x03,0x00,0x00,0x01,0x10,0x00,0x00,0x00,0x00,0x00,0xb2,0x00,0x00,0xfe,
+ 0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x29,0xf2,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };
+static unsigned char stickyoff_bits[] = {
+ 0x00,0x00,0x16,0x00,0x00,0x16,0x00,0x00,0x1e,0x00,0x00,0x0c,0x50,0x15,0x60,
+ 0xe0,0x00,0x00,0xf0,0x11,0xc8,0xe0,0x00,0x16,0x50,0x15,0x60,0x00,0x00,0x00,
+ 0x10,0x11,0x00,0x00,0x00,0x1e,0x50,0x15,0x00,0x00,0x00,0x46,0x00,0x00,0xfe,
+ 0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x08,0x31,0xf2,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x29,0xf2,0x00,0x00 };
+
+#endif
+
diff --git a/kwin-styles/glow/config/glowconfigdialog.cpp b/kwin-styles/glow/config/glowconfigdialog.cpp
new file mode 100644
index 00000000..41144c8a
--- /dev/null
+++ b/kwin-styles/glow/config/glowconfigdialog.cpp
@@ -0,0 +1,369 @@
+/***************************************************************************
+ glowconfigdialog.cpp - description
+ -------------------
+ begin : Thu Sep 12 2001
+ copyright : (C) 2001 by Henning Burchardt
+ email : h_burchardt@gmx.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. *
+ * *
+ ***************************************************************************/
+
+#include <qbitmap.h>
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <qcombobox.h>
+#include <qdir.h>
+#include <qfileinfo.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qlistview.h>
+#include <qpushbutton.h>
+#include <qsignalmapper.h>
+#include <qstringlist.h>
+#include <kconfig.h>
+#include <kcolorbutton.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <kpixmap.h>
+#include <kpixmapeffect.h>
+#include <kstandarddirs.h>
+#include "bitmaps.h"
+#include "glowconfigdialog.h"
+#include "../resources.h"
+
+#define NUMBER_OF_BUTTONS 5
+
+extern "C"
+{
+ KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent )
+ {
+ return(new GlowConfigDialog(conf, parent));
+ }
+}
+
+GlowConfigDialog::GlowConfigDialog( KConfig * conf, QWidget * parent )
+ : QObject(parent)
+{
+ _glowConfig = new KConfig("kwinglowrc");
+ KGlobal::locale()->insertCatalogue("kwin_glow_config");
+
+ _main_group_box = new QWidget(parent);
+ QVBoxLayout *main_group_boxLayout = new QVBoxLayout(_main_group_box);
+ main_group_boxLayout->setAlignment(Qt::AlignTop | Qt::AlignLeft);
+ main_group_boxLayout->setSpacing(6);
+
+ //-------------------------------------------------------------------------
+ // themes
+
+ _theme_list_view = new QListView (_main_group_box, "theme_list_view");
+ _theme_list_view->addColumn (i18n("Theme"));
+ _theme_list_view->addColumn (i18n("Button Size"));
+ _theme_list_view->setAllColumnsShowFocus(true);
+ _theme_list_view->setResizeMode(QListView::AllColumns);
+
+ main_group_boxLayout->addWidget (_theme_list_view);
+ QObject::connect (_theme_list_view, SIGNAL(selectionChanged()),
+ this, SLOT(slotThemeListViewSelectionChanged()));
+ slotLoadThemeList();
+
+ _button_glow_color_group_box = new QGroupBox(
+ 0, Qt::Horizontal, i18n("Button Glow Colors"), _main_group_box);
+ QHBoxLayout *colorHBoxLayout =
+ new QHBoxLayout(_button_glow_color_group_box->layout());
+
+ // create buttons
+ QSize buttonSize(BITMAP_SIZE, BITMAP_SIZE);
+ QPixmap pm(buttonSize);
+ pm.fill(Qt::black);
+
+ _stickyButton = new QPushButton(_button_glow_color_group_box);
+ pm.setMask(QBitmap(buttonSize, stickyoff_bits, true));
+ _stickyButton->setPixmap(pm);
+ colorHBoxLayout->addWidget(_stickyButton);
+ _titleButtonList.push_back(_stickyButton);
+
+ _helpButton = new QPushButton(_button_glow_color_group_box);
+ pm.setMask(QBitmap(buttonSize, help_bits, true));
+ _helpButton->setPixmap(pm);
+ colorHBoxLayout->addWidget(_helpButton);
+ _titleButtonList.push_back(_helpButton);
+
+ _iconifyButton = new QPushButton(_button_glow_color_group_box);
+ pm.setMask(QBitmap(buttonSize, minimize_bits, true));
+ _iconifyButton->setPixmap(pm);
+ colorHBoxLayout->addWidget(_iconifyButton);
+ _titleButtonList.push_back(_iconifyButton);
+
+ _maximizeButton = new QPushButton(_button_glow_color_group_box);
+ pm.setMask(QBitmap(buttonSize, maximizeoff_bits, true));
+ _maximizeButton->setPixmap(pm);
+ colorHBoxLayout->addWidget(_maximizeButton);
+ _titleButtonList.push_back(_maximizeButton);
+
+ _closeButton = new QPushButton(_button_glow_color_group_box);
+ pm.setMask(QBitmap(buttonSize, close_bits, true));
+ _closeButton->setPixmap(pm);
+ colorHBoxLayout->addWidget(_closeButton);
+ _titleButtonList.push_back(_closeButton);
+
+ // create signal mapper
+ _titleButtonMapper = new QSignalMapper(this);
+ for( uint i=0; i<_titleButtonList.size(); i++ ) {
+ _titleButtonMapper->setMapping(_titleButtonList[i], i);
+ connect(_titleButtonList[i], SIGNAL(clicked()),_titleButtonMapper, SLOT(map()));
+ }
+ connect(_titleButtonMapper, SIGNAL(mapped(int)),this, SLOT(slotTitleButtonClicked(int)));
+
+ _colorButton = new KColorButton(_button_glow_color_group_box);
+ _colorButton->setEnabled(false);
+ connect(_colorButton, SIGNAL(changed(const QColor&)),
+ this, SLOT(slotColorButtonChanged(const QColor&)));
+
+ colorHBoxLayout->addItem(new QSpacerItem(
+ 200, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
+ colorHBoxLayout->addWidget(_colorButton);
+
+ main_group_boxLayout->addWidget(_button_glow_color_group_box);
+
+ QHBoxLayout *titlebarGradientTypeLayout = new QHBoxLayout();
+ _titlebarGradientTypeComboBox = new QComboBox(_main_group_box);
+
+ KConfig *c = KGlobal::config();
+ KConfigGroupSaver cgs( c, QString::fromLatin1("WM") );
+ QColor activeBackground = c->readColorEntry("activeBackground");
+ QColor activeBlend = c->readColorEntry("activeBlend");
+
+ // If the colors are equal, change one to get a gradient effect
+ if (activeBackground==activeBlend) {
+ activeBackground = activeBackground.dark();
+ }
+ for (int i=0; i< KPixmapEffect::EllipticGradient; i++ ) {
+ KPixmap gradPixmap(QSize(196,20));
+ KPixmapEffect::gradient(gradPixmap, activeBackground,
+ activeBlend, (KPixmapEffect::GradientType) i);
+
+ _titlebarGradientTypeComboBox->insertItem(gradPixmap, i);
+ }
+
+ connect(_titlebarGradientTypeComboBox, SIGNAL(activated(int)),
+ this, SLOT(slotTitlebarGradientTypeChanged(int)));
+ titlebarGradientTypeLayout->addWidget(
+ new QLabel(i18n("Titlebar gradient:"), _main_group_box));
+ titlebarGradientTypeLayout->addWidget(_titlebarGradientTypeComboBox, 0, Qt::AlignLeft);
+ titlebarGradientTypeLayout->addStretch(10);
+ main_group_boxLayout->addLayout(titlebarGradientTypeLayout);
+
+
+ _showResizeHandleCheckBox = new QCheckBox(
+ i18n("Show resize handle"), _main_group_box);
+ connect(_showResizeHandleCheckBox, SIGNAL(clicked()),
+ this, SLOT(slotResizeHandleCheckBoxChanged()));
+ main_group_boxLayout->addWidget(_showResizeHandleCheckBox);
+
+ // load config and update user interface
+ load(conf);
+
+ _main_group_box->show();
+}
+
+GlowConfigDialog::~GlowConfigDialog()
+{
+ delete _main_group_box;
+ delete _glowConfig;
+ delete[] _buttonConfigMap;
+}
+
+void GlowConfigDialog::load( KConfig* /* conf */ )
+{
+ QColor color;
+ const QColor defaultCloseButtonColor(DEFAULT_CLOSE_BUTTON_COLOR);
+ const QColor defaultMaximizeButtonColor(DEFAULT_MAXIMIZE_BUTTON_COLOR);
+ const QColor defaultIconifyButtonColor(DEFAULT_ICONIFY_BUTTON_COLOR);
+ const QColor defaultHelpButtonColor(DEFAULT_HELP_BUTTON_COLOR);
+ const QColor defaultStickyButtonColor(DEFAULT_STICKY_BUTTON_COLOR);
+
+ _glowConfig->setGroup("General");
+
+ _buttonConfigMap = new QColor[NUMBER_OF_BUTTONS];
+ color = _glowConfig->readColorEntry("stickyButtonGlowColor",
+ &defaultStickyButtonColor);
+ _buttonConfigMap[stickyButton] = color;
+
+ color = _glowConfig->readColorEntry("helpButtonGlowColor",
+ &defaultHelpButtonColor);
+ _buttonConfigMap[helpButton] = color;
+
+ color = _glowConfig->readColorEntry("iconifyButtonGlowColor",
+ &defaultIconifyButtonColor);
+ _buttonConfigMap[iconifyButton] = color;
+
+ color = _glowConfig->readColorEntry("maximizeButtonGlowColor",
+ &defaultMaximizeButtonColor);
+ _buttonConfigMap[maximizeButton] = color;
+
+ color = _glowConfig->readColorEntry("closeButtonGlowColor",
+ &defaultCloseButtonColor);
+ _buttonConfigMap[closeButton] = color;
+
+ _showResizeHandle = _glowConfig->readBoolEntry("showResizeHandle", true);
+ _titlebarGradientType = static_cast<KPixmapEffect::GradientType>
+ (_glowConfig->readNumEntry("titlebarGradientType",
+ KPixmapEffect::DiagonalGradient));
+
+ _showResizeHandleCheckBox->setChecked(_showResizeHandle);
+ _titlebarGradientTypeComboBox->setCurrentItem(_titlebarGradientType);
+
+ _theme_name = _glowConfig->readEntry ("themeName", "default");
+ _theme_list_view->setSelected (
+ _theme_list_view->findItem (_theme_name, 0), true);
+ slotTitleButtonClicked(0);
+}
+
+void GlowConfigDialog::save( KConfig* /* conf */ )
+{
+ _glowConfig->setGroup("General");
+
+ _glowConfig->writeEntry("stickyButtonGlowColor", _buttonConfigMap[stickyButton]);
+ _glowConfig->writeEntry("helpButtonGlowColor", _buttonConfigMap[helpButton]);
+ _glowConfig->writeEntry("iconifyButtonGlowColor", _buttonConfigMap[iconifyButton]);
+ _glowConfig->writeEntry("maximizeButtonGlowColor", _buttonConfigMap[maximizeButton]);
+ _glowConfig->writeEntry("closeButtonGlowColor", _buttonConfigMap[closeButton]);
+
+ _glowConfig->writeEntry("showResizeHandle", _showResizeHandle);
+ _glowConfig->writeEntry("titlebarGradientType", _titlebarGradientType);
+
+ _glowConfig->writeEntry ("themeName", _theme_name);
+
+ _glowConfig->sync();
+}
+
+void GlowConfigDialog::defaults()
+{
+ const QColor defaultCloseButtonColor = DEFAULT_CLOSE_BUTTON_COLOR;
+ const QColor defaultMaximizeButtonColor(DEFAULT_MAXIMIZE_BUTTON_COLOR);
+ const QColor defaultIconifyButtonColor(DEFAULT_ICONIFY_BUTTON_COLOR);
+ const QColor defaultHelpButtonColor(DEFAULT_HELP_BUTTON_COLOR);
+ const QColor defaultStickyButtonColor(DEFAULT_STICKY_BUTTON_COLOR);
+
+ _buttonConfigMap[stickyButton] = defaultStickyButtonColor;
+ _buttonConfigMap[helpButton] = defaultHelpButtonColor;
+ _buttonConfigMap[iconifyButton] = defaultIconifyButtonColor;
+ _buttonConfigMap[maximizeButton] = defaultMaximizeButtonColor;
+ _buttonConfigMap[closeButton] = defaultCloseButtonColor;
+
+ _showResizeHandle = true;
+ _titlebarGradientType = KPixmapEffect::DiagonalGradient;
+
+ _showResizeHandleCheckBox->setChecked(_showResizeHandle);
+ _titlebarGradientTypeComboBox->setCurrentItem(_titlebarGradientType);
+
+ _theme_list_view->setSelected (
+ _theme_list_view->findItem("default", 0), true);
+}
+
+void GlowConfigDialog::slotLoadThemeList ()
+{
+ QStringList dir_list=KGlobal::dirs()->findDirs("data", "kwin/glow-themes");
+
+ QStringList::ConstIterator it;
+
+ _theme_list_view->clear();
+ new QListViewItem (_theme_list_view, "default", "17x17");
+
+ for (it=dir_list.begin(); it!=dir_list.end(); ++it)
+ {
+ QDir dir (*it, QString("*"), QDir::Unsorted,
+ QDir::Dirs | QDir::Readable);
+ if (dir.exists())
+ {
+ QFileInfoListIterator it2(*dir.entryInfoList());
+ QFileInfo * finfo;
+
+ while ((finfo=it2.current()))
+ {
+ if (finfo->fileName() == "." || finfo->fileName() == "..") {
+ ++it2;
+ continue;
+ }
+
+ if (! _theme_list_view->findItem (finfo->fileName(), 0))
+ {
+ KConfig conf (dir.path() + "/" + finfo->fileName() + "/" +
+ finfo->fileName() + ".theme");
+ QSize button_size = conf.readSizeEntry (
+ "buttonSize", new QSize (-1, -1));
+ if (button_size.width() == -1)
+ {
+ ++it2;
+ continue;
+ }
+ QString size_string = QString("") +
+ QString::number(button_size.width()) +
+ "x" + QString::number(button_size.height());
+ new QListViewItem (_theme_list_view,
+ finfo->fileName(), size_string);
+ }
+
+ ++it2;
+ }
+ }
+ }
+}
+
+void GlowConfigDialog::slotTitlebarGradientTypeChanged(int index)
+{
+ _titlebarGradientType = static_cast<KPixmapEffect::GradientType>(index);
+ emit changed();
+}
+
+void GlowConfigDialog::slotResizeHandleCheckBoxChanged()
+{
+ _showResizeHandle = _showResizeHandleCheckBox->isChecked();
+ emit changed();
+}
+
+void GlowConfigDialog::slotTitleButtonClicked(int index)
+{
+ for( int i=0; i< ((int) _titleButtonList.size()); i++ ) {
+ _titleButtonList[i]->setDown(i==index);
+ }
+ _colorButton->setEnabled(true);
+ _colorButton->setColor(_buttonConfigMap[index]);
+}
+
+void GlowConfigDialog::slotColorButtonChanged(const QColor& glowColor)
+{
+ if( _stickyButton->isDown() ) {
+ _buttonConfigMap[stickyButton] = glowColor;
+ } else if( _helpButton->isDown() ) {
+ _buttonConfigMap[helpButton] = glowColor;
+ } else if( _iconifyButton->isDown() ) {
+ _buttonConfigMap[iconifyButton] = glowColor;
+ } else if( _maximizeButton->isDown() ) {
+ _buttonConfigMap[maximizeButton] = glowColor;
+ } else {
+ _buttonConfigMap[closeButton] = glowColor;
+ }
+ emit changed();
+}
+
+void GlowConfigDialog::slotThemeListViewSelectionChanged ()
+{
+ if( _theme_list_view->selectedItem() != 0 ) {
+ _theme_name = _theme_list_view->selectedItem()->text (0);
+
+ emit changed();
+ }
+}
+
+#include "glowconfigdialog.moc"
diff --git a/kwin-styles/glow/config/glowconfigdialog.h b/kwin-styles/glow/config/glowconfigdialog.h
new file mode 100644
index 00000000..2190b3ce
--- /dev/null
+++ b/kwin-styles/glow/config/glowconfigdialog.h
@@ -0,0 +1,91 @@
+/***************************************************************************
+ glowconfigdialog.h - description
+ -------------------
+ begin : Thu Sep 12 2001
+ copyright : (C) 2001 by Henning Burchardt
+ email : h_burchardt@gmx.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef GLOW_CONFIG_DIALOG_H
+#define GLOW_CONFIG_DIALOG_H
+
+#include <qvaluevector.h>
+#include <qobject.h>
+
+class QListView;
+class QPushButton;
+class QSignalMapper;
+class QCheckBox;
+class QComboBox;
+class KConfig;
+class KColorButton;
+
+class GlowConfigDialog : public QObject
+{
+ Q_OBJECT
+
+public:
+ GlowConfigDialog( KConfig* conf, QWidget* parent );
+ ~GlowConfigDialog();
+
+signals:
+ void changed();
+
+public slots:
+ void load( KConfig* conf );
+ void save( KConfig* conf );
+ void defaults();
+
+protected slots:
+ void slotTitleButtonClicked(int);
+ void slotColorButtonChanged(const QColor&);
+ void slotTitlebarGradientTypeChanged(int);
+ void slotResizeHandleCheckBoxChanged();
+ void slotThemeListViewSelectionChanged ();
+
+private slots:
+ void slotLoadThemeList ();
+
+private:
+ enum ButtonType{stickyButton, helpButton, iconifyButton,
+ maximizeButton, closeButton };
+
+ KConfig *_glowConfig;
+
+ bool _showResizeHandle;
+ KPixmapEffect::GradientType _titlebarGradientType;
+ QString _theme_name;
+
+ QWidget *_main_group_box;
+ QGroupBox *_button_glow_color_group_box;
+ QGroupBox *_theme_group_box;
+
+ QListView * _theme_list_view;
+
+ QCheckBox *_showResizeHandleCheckBox;
+ QComboBox *_titlebarGradientTypeComboBox;
+
+ QPushButton *_stickyButton;
+ QPushButton *_helpButton;
+ QPushButton *_iconifyButton;
+ QPushButton *_maximizeButton;
+ QPushButton *_closeButton;
+ QSignalMapper *_titleButtonMapper;
+
+ QColor* _buttonConfigMap;
+ QValueVector<QPushButton*> _titleButtonList;
+
+ KColorButton *_colorButton;
+};
+
+#endif
+
diff --git a/kwin-styles/glow/glow.desktop b/kwin-styles/glow/glow.desktop
new file mode 100644
index 00000000..6db539eb
--- /dev/null
+++ b/kwin-styles/glow/glow.desktop
@@ -0,0 +1,49 @@
+[Desktop Entry]
+Name=Glow
+Name[af]=Gloei
+Name[br]=Lufrus
+Name[ca]=Lluïssor
+Name[cs]=Záře
+Name[cy]=Gwrid
+Name[da]=Glød
+Name[el]=Λάμψη
+Name[es]=Brillo
+Name[et]=Helendus
+Name[eu]=Dirdira
+Name[fa]=درخشندگی
+Name[fi]=Hehku
+Name[fr]=Lueur
+Name[fy]=Gloede
+Name[hi]=ग्लो
+Name[is]=Glóð
+Name[it]=Bagliore
+Name[ja]=輝き
+Name[ka]=გავარვარება
+Name[lt]=Švytėjimas
+Name[lv]=Kvēlot
+Name[mk]=Отсјај
+Name[ms]=Kilau
+Name[mt]=Dija
+Name[nb]=Glød
+Name[ne]=चमक
+Name[nl]=Gloed
+Name[nn]=Glød
+Name[pl]=Blask
+Name[ro]=Licărire
+Name[ru]=Зарево
+Name[sk]=Plameň
+Name[sl]=Lesk
+Name[sr]=Сијање
+Name[sr@Latn]=Sijanje
+Name[sv]=Glöd
+Name[ta]=ஒளிப்பெற்று
+Name[tg]=Шафақ
+Name[th]=เรืองแสง
+Name[tr]=Parlama
+Name[uk]=Заграва
+Name[ven]=Tshedza
+Name[vi]=Hào quang
+Name[xh]=Qukuqela
+Name[zh_CN]=光芒
+Name[zu]=Khanya
+X-KDE-Library=kwin3_glow
diff --git a/kwin-styles/glow/glowbutton.cpp b/kwin-styles/glow/glowbutton.cpp
new file mode 100644
index 00000000..41f53386
--- /dev/null
+++ b/kwin-styles/glow/glowbutton.cpp
@@ -0,0 +1,339 @@
+/***************************************************************************
+ glowbutton.cpp - description
+ -------------------
+ begin : Thu Sep 6 2001
+ copyright : (C) 2001 by Henning Burchardt
+ email : h_burchardt@gmx.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. *
+ * *
+ ***************************************************************************/
+
+#include <math.h>
+#include <iostream>
+#include <vector>
+#include <qmap.h>
+#include <qpixmap.h>
+#include <qpixmapcache.h>
+#include <qbitmap.h>
+#include <qpainter.h>
+#include <qimage.h>
+#include <qtimer.h>
+#include <qtooltip.h>
+#include <kdecoration.h>
+#include <kiconeffect.h>
+#include "glowbutton.h"
+
+namespace Glow
+{
+
+//-----------------------------------------------------------------------------
+// PixmapCache
+//-----------------------------------------------------------------------------
+
+QMap<QString, const QPixmap*> PixmapCache::m_pixmapMap;
+
+const QPixmap* PixmapCache::find(const QString& key)
+{
+ QMap<QString, const QPixmap*>::const_iterator it =
+ m_pixmapMap.find(key);
+ if( it != m_pixmapMap.end() )
+ return *it;
+ else
+ return 0;
+}
+
+void PixmapCache::insert(const QString& key, const QPixmap *pixmap)
+{
+ m_pixmapMap[key] = pixmap;
+}
+
+void PixmapCache::erase(const QString& key)
+{
+ QMap<QString, const QPixmap*>::iterator it =
+ m_pixmapMap.find(key);
+ if (it != m_pixmapMap.end())
+ {
+ delete *it;
+ m_pixmapMap.erase(it);
+ }
+}
+
+void PixmapCache::clear()
+{
+ // delete all pixmaps in the cache
+ QMap<QString, const QPixmap*>::const_iterator it
+ = m_pixmapMap.begin();
+ for(; it != m_pixmapMap.end(); ++it)
+ delete *it;
+ m_pixmapMap.clear();
+}
+
+//-----------------------------------------------------------------------------
+// GlowButton
+//-----------------------------------------------------------------------------
+
+GlowButton::GlowButton(QWidget *parent, const char *name,
+ const QString& tip, const int realizeBtns)
+ : QButton(parent, name)
+{
+ m_realizeButtons = realizeBtns;
+
+ _steps = 0;
+ m_updateTime = 50;
+ m_pixmapName = QString::null;
+
+ m_timer = new QTimer(this);
+ connect(m_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));
+ m_pos = 0;
+ m_timerStatus = Stop;
+
+ setTipText (tip);
+ setCursor(arrowCursor);
+}
+
+GlowButton::~GlowButton()
+{
+}
+
+void GlowButton::setTipText( const QString& tip )
+{
+ if (KDecoration::options()->showTooltips())
+ {
+ QToolTip::remove( this );
+ QToolTip::add( this, tip );
+ }
+}
+
+QString GlowButton::getPixmapName() const
+{
+ return m_pixmapName;
+}
+
+Qt::ButtonState GlowButton::lastButton() const
+{
+ return _last_button;
+}
+
+void GlowButton::setPixmapName(const QString& pixmapName)
+{
+ m_pixmapName = pixmapName;
+
+ const QPixmap *pixmap = PixmapCache::find(pixmapName);
+ if( ! pixmap )
+ return;
+
+ // set steps
+ _steps = pixmap->height()/pixmap->width() - 1;
+
+ repaint(false);
+}
+
+void GlowButton::paintEvent( QPaintEvent *e )
+{
+ QWidget::paintEvent(e);
+ const QPixmap *pixmap = PixmapCache::find(m_pixmapName);
+ if( pixmap != 0 )
+ {
+ int pos = m_pos>=0?m_pos:-m_pos;
+ QPainter p;
+ QPixmap pm (pixmap->size());
+ p.begin(&pm);
+ const QPixmap * bg_pixmap = PixmapCache::find(
+ QString::number(parentWidget()->winId()));
+ p.drawPixmap (0, 0, *bg_pixmap, x(), y(), width(), height());
+ p.drawPixmap (0, 0, *pixmap, 0, pos*height(), width(), height());
+ p.end();
+ p.begin(this);
+ p.drawPixmap (0, 0, pm);
+ p.end();
+ }
+}
+
+void GlowButton::enterEvent( QEvent *e )
+{
+ if( m_pos<0 )
+ m_pos=-m_pos;
+ m_timerStatus = Run;
+ if( ! m_timer->isActive() )
+ m_timer->start(m_updateTime);
+ QButton::enterEvent(e);
+}
+
+void GlowButton::leaveEvent( QEvent *e )
+{
+ m_timerStatus = Stop;
+ if( ! m_timer->isActive() )
+ m_timer->start(m_updateTime);
+ QButton::leaveEvent(e);
+}
+
+void GlowButton::mousePressEvent( QMouseEvent *e )
+{
+ _last_button = e->button();
+ if( m_timer->isActive() )
+ m_timer->stop();
+ m_pos = _steps;
+ repaint(false);
+ // without pretending LeftButton, clicking on the button with MidButton
+ // or RightButton would cause unwanted titlebar action
+ QMouseEvent me (e->type(), e->pos(), e->globalPos(),
+ (e->button()&m_realizeButtons)?LeftButton:NoButton, e->state());
+ QButton::mousePressEvent(&me);
+}
+
+void GlowButton::mouseReleaseEvent( QMouseEvent *e )
+{
+ _last_button = e->button();
+ QPoint p = mapToParent(mapFromGlobal(e->globalPos()));
+ if( ! m_timer->isActive() ) {
+ m_timer->start(m_updateTime);
+ }
+ if( ! geometry().contains(p) ) {
+ m_timerStatus = Stop;
+ }
+ QMouseEvent me (e->type(), e->pos(), e->globalPos(),
+ (e->button()&m_realizeButtons)?LeftButton:NoButton, e->state());
+ QButton::mouseReleaseEvent(&me);
+}
+
+void GlowButton::slotTimeout()
+{
+ repaint(false);
+
+ if( m_pos>=_steps-1 ) {
+ m_pos = -m_pos;
+ }
+ if( m_timerStatus==Stop ) {
+ if( m_pos==0 ) {
+ m_timer->stop();
+ return;
+ } else if( m_pos>0 ) {
+ m_pos = -m_pos;
+ }
+ }
+
+ m_pos++;
+}
+
+//-----------------------------------------------------------------------------
+// GlowButtonFactory
+//-----------------------------------------------------------------------------
+
+GlowButtonFactory::GlowButtonFactory()
+{
+ _steps = 20;
+}
+
+int GlowButtonFactory::getSteps()
+{
+ return _steps;
+}
+
+void GlowButtonFactory::setSteps(int steps)
+{
+ _steps = steps;
+}
+
+QPixmap * GlowButtonFactory::createGlowButtonPixmap(
+ const QImage & bg_image,
+ const QImage & fg_image,
+ const QImage & glow_image,
+ const QColor & color,
+ const QColor & glow_color)
+{
+ if (bg_image.size() != fg_image.size()
+ || fg_image.size() != glow_image.size()) {
+ std::cerr << "Image size error" << std::endl;
+ return new QPixmap();
+ }
+
+ QImage colorized_bg_image = bg_image.copy();
+ KIconEffect::colorize (colorized_bg_image, color, 1.0);
+
+ int w = colorized_bg_image.width();
+ int h = colorized_bg_image.height();
+
+ QImage image (w, (_steps+1)*h, 32);
+ image.setAlphaBuffer (true);
+ for (int i=0; i<_steps+1; ++i) {
+ for (int y=0; y<h; ++y) {
+ uint * src1_line = (uint*) colorized_bg_image.scanLine (y);
+ uint * src2_line = (uint*) fg_image.scanLine (y);
+ uint * dst_line = (uint*) image.scanLine (i*h+y);
+ for (int x=0; x<w; ++x) {
+ int r = qRed (*(src1_line+x));
+ int g = qGreen (*(src1_line+x));
+ int b = qBlue (*(src1_line+x));
+ int a = QMAX (qAlpha(*(src1_line+x)),qGray(*(src2_line+x)));
+ *(dst_line+x) = qRgba (r, g, b, a);
+ }
+ }
+ }
+ QPixmap * pixmap = new QPixmap (image);
+ QPainter painter (pixmap);
+
+ bool dark = (qGray(color.rgb()) <= 127);
+ QImage fg_img (w, h, 32);
+ fg_img.setAlphaBuffer (true);
+ for (int y=0; y<h; ++y) {
+ uint * src_line = (uint*) fg_image.scanLine (y);
+ uint * dst_line = (uint*) fg_img.scanLine (y);
+ for (int x=0; x<w; ++x) {
+ int alpha = qGray (*(src_line+x));
+ if (dark)
+ *(dst_line+x) = qRgba (255, 255, 255, alpha);
+ else
+ *(dst_line+x) = qRgba (0, 0, 0, alpha);
+ }
+ }
+
+ int r = glow_color.red();
+ int g = glow_color.green();
+ int b = glow_color.blue();
+ QImage glow_img (w, h, 32);
+ glow_img.setAlphaBuffer (true);
+ for (int i=0; i<_steps; ++i) {
+ painter.drawImage (0, i*h, fg_img);
+ for (int y=0; y<h; ++y) {
+ uint * src_line = (uint*) glow_image.scanLine(y);
+ uint * dst_line = (uint*) glow_img.scanLine(y);
+ for (int x=0; x<w; ++x) {
+ int alpha =
+ (int) (qGray (*(src_line+x)) * ((double) i/_steps));
+ *(dst_line+x) = qRgba (r, g, b, alpha);
+ }
+ }
+ painter.drawImage (0, i*h, glow_img);
+ }
+ painter.drawImage (0, _steps*h, fg_img);
+ for (int y=0; y<h; ++y) {
+ uint * src_line = (uint*) glow_image.scanLine (y);
+ uint * dst_line = (uint*) glow_img.scanLine (y);
+ for (int x=0; x<w; ++x) {
+ int alpha = qGray (*(src_line+x));
+ *(dst_line+x) = qRgba (r, g, b, alpha);
+ }
+ }
+ painter.drawImage (0, _steps*h, glow_img);
+
+ return pixmap;
+}
+
+GlowButton* GlowButtonFactory::createGlowButton(
+ QWidget *parent, const char* name, const QString& tip, const int realizeBtns)
+{
+ GlowButton *glowButton = new GlowButton(parent, name, tip, realizeBtns);
+ return glowButton;
+}
+
+}
+
+#include "glowbutton.moc"
+
diff --git a/kwin-styles/glow/glowbutton.h b/kwin-styles/glow/glowbutton.h
new file mode 100644
index 00000000..3d4f5e1d
--- /dev/null
+++ b/kwin-styles/glow/glowbutton.h
@@ -0,0 +1,128 @@
+/***************************************************************************
+ glowbutton.h - description
+ -------------------
+ begin : Thu Sep 14 2001
+ copyright : (C) 2001 by Henning Burchardt
+ email : h_burchardt@gmx.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef GLOW_BUTTON_H
+#define GLOW_BUTTON_H
+
+#include <vector>
+#include <qmap.h>
+#include <qbutton.h>
+
+class QPixmap;
+class QBitmap;
+class QTimer;
+class QString;
+
+namespace Glow
+{
+
+class PixmapCache
+{
+public:
+ static const QPixmap* find(const QString& key);
+ static void insert(const QString& key, const QPixmap *pixmap);
+ static void erase(const QString& key);
+ static void clear();
+private:
+ static QMap<QString, const QPixmap*> m_pixmapMap;
+};
+
+
+//-----------------------------------------------------------------------------
+
+class GlowButton : public QButton
+{
+ Q_OBJECT
+
+public:
+ GlowButton(QWidget *parent, const char* name, const QString& tip, const int realizeBtns);
+ ~GlowButton();
+
+ void setTipText( const QString& tip );
+
+ QString getPixmapName() const;
+ ButtonState lastButton() const;
+
+ /** Sets the name of the pixmap in the pixmap cache.
+ * If no background pixmap is wanted use QString::null as name. */
+ void setPixmapName(const QString& pixmapName);
+
+protected:
+ virtual void paintEvent( QPaintEvent * );
+ virtual void enterEvent( QEvent * );
+ virtual void leaveEvent( QEvent * );
+ virtual void mousePressEvent( QMouseEvent * );
+ virtual void mouseReleaseEvent( QMouseEvent * );
+
+protected slots:
+ void slotTimeout();
+
+private:
+ enum TimerStatus { Run, Stop };
+
+ int m_updateTime;
+ int _steps;
+ QString m_pixmapName;
+
+ QTimer *m_timer;
+ int m_pos;
+ TimerStatus m_timerStatus;
+
+ int m_realizeButtons;
+ ButtonState _last_button;
+};
+
+//-----------------------------------------------------------------------------
+
+class GlowButtonFactory
+{
+public:
+ GlowButtonFactory();
+
+ int getSteps();
+
+ /**
+ * Sets the number of pixmaps used to create the glow effect of the
+ * glow buttons.
+ */
+ void setSteps(int steps);
+
+ /**
+ * Creates a background pixmap for a glow button.
+ * The pixmap will consist of sub pixmaps of the size of the button which
+ * are placed one below the other. Each sub pixmap is copied on the button
+ * in succession to create the glow effect. The last sub pixmap is used
+ * when the button is pressed.
+ */
+ QPixmap * createGlowButtonPixmap(
+ const QImage & bg_image,
+// const QImage & bg_alpha_image,
+ const QImage & fg_image,
+ const QImage & glow_image,
+ const QColor & color,
+ const QColor & glow_color);
+
+ GlowButton* createGlowButton(
+ QWidget *parent, const char* name, const QString& tip, const int realizeBtns = Qt::LeftButton);
+
+private:
+ int _steps;
+};
+
+} // namespace
+
+#endif
diff --git a/kwin-styles/glow/glowclient.cpp b/kwin-styles/glow/glowclient.cpp
new file mode 100644
index 00000000..ed13f480
--- /dev/null
+++ b/kwin-styles/glow/glowclient.cpp
@@ -0,0 +1,902 @@
+/***************************************************************************
+ glowclient.cpp - description
+ -------------------
+ begin : Thu Sep 6 2001
+ copyright : (C) 2001 by Henning Burchardt
+ email : h_burchardt@gmx.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. *
+ * *
+ ***************************************************************************/
+
+#include <qapplication.h>
+#include <qbitmap.h>
+#include <qimage.h>
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qpixmap.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kpixmapeffect.h>
+#include <kpixmap.h>
+#include <kstandarddirs.h>
+#include <qlabel.h>
+#include "resources.h"
+#include "glowclient.h"
+#include "glowbutton.h"
+
+namespace Glow
+{
+
+static int titleHeight;
+static int SIDE_MARGIN;
+static int BOTTOM_MARGIN;
+static const int TITLE_MARGIN = 2;
+static const int TITLE_SPACING = 1;
+static int RESIZE_HANDLE_HEIGHT;
+
+//-----------------------------------------------------------------------------
+
+GlowClientConfig::GlowClientConfig()
+{
+ themeName = "default";
+}
+
+void GlowClientConfig::load(KDecorationFactory *factory)
+{
+ KConfig conf("kwinglowrc");
+ conf.setGroup("General");
+
+ const QColor defaultCloseButtonColor(DEFAULT_CLOSE_BUTTON_COLOR);
+ const QColor defaultMaximizeButtonColor(DEFAULT_MAXIMIZE_BUTTON_COLOR);
+ const QColor defaultIconifyButtonColor(DEFAULT_ICONIFY_BUTTON_COLOR);
+ const QColor defaultHelpButtonColor(DEFAULT_HELP_BUTTON_COLOR);
+ const QColor defaultStickyButtonColor(DEFAULT_STICKY_BUTTON_COLOR);
+
+ stickyButtonGlowColor = conf.readColorEntry(
+ "stickyButtonGlowColor", &defaultStickyButtonColor);
+
+ helpButtonGlowColor = conf.readColorEntry(
+ "helpButtonGlowColor", &defaultHelpButtonColor);
+
+ iconifyButtonGlowColor = conf.readColorEntry(
+ "iconifyButtonGlowColor", &defaultIconifyButtonColor);
+
+ maximizeButtonGlowColor = conf.readColorEntry(
+ "maximizeButtonGlowColor", &defaultMaximizeButtonColor);
+
+ closeButtonGlowColor = conf.readColorEntry(
+ "closeButtonGlowColor", &defaultCloseButtonColor);
+
+ showResizeHandle = conf.readBoolEntry("showResizeHandle", true);
+ titlebarGradientType = conf.readNumEntry("titlebarGradientType",
+ KPixmapEffect::DiagonalGradient);
+
+ themeName = conf.readEntry ("themeName", "default");
+
+ switch(KDecoration::options()->preferredBorderSize (factory)) {
+ case KDecoration::BorderLarge:
+ SIDE_MARGIN = 8;
+ BOTTOM_MARGIN = 6;
+ RESIZE_HANDLE_HEIGHT = 10;
+ break;
+ case KDecoration::BorderVeryLarge:
+ SIDE_MARGIN = 12;
+ BOTTOM_MARGIN = 12;
+ RESIZE_HANDLE_HEIGHT = 18;
+ break;
+ case KDecoration::BorderHuge:
+ SIDE_MARGIN = 18;
+ BOTTOM_MARGIN = 18;
+ RESIZE_HANDLE_HEIGHT = 27;
+ break;
+ case KDecoration::BorderVeryHuge:
+ SIDE_MARGIN = 27;
+ BOTTOM_MARGIN = 27;
+ RESIZE_HANDLE_HEIGHT = 40;
+ break;
+ case KDecoration::BorderOversized:
+ SIDE_MARGIN = 40;
+ BOTTOM_MARGIN = 40;
+ RESIZE_HANDLE_HEIGHT = 60;
+ break;
+ case KDecoration::BorderNormal:
+ default:
+ SIDE_MARGIN = 4;
+ BOTTOM_MARGIN = 2;
+ RESIZE_HANDLE_HEIGHT = 4;
+ }
+}
+
+//-----------------------------------------------------------------------------
+
+GlowClientGlobals::~GlowClientGlobals()
+{
+ deletePixmaps();
+ m_instance = 0;
+}
+
+QString GlowClientGlobals::getPixmapName(PixmapType type, bool isActive)
+{
+ QString s = getPixmapTypeName(static_cast<PixmapType>(type));
+ s += "|";
+ s += isActive ? "Active" : "NotActive";
+ return s;
+}
+
+GlowClientGlobals::GlowClientGlobals()
+ : KDecorationFactory()
+{
+ _button_factory = new GlowButtonFactory();
+ readConfig();
+ readTheme ();
+ if (!createPixmaps())
+ {
+ deletePixmaps();
+ delete _theme;
+ config()->themeName = "default";
+ readTheme();
+ createPixmaps();
+ }
+}
+
+void GlowClientGlobals::readConfig()
+{
+ _config = new GlowClientConfig();
+ _config->load(this);
+}
+
+QValueList< GlowClientGlobals::BorderSize >
+GlowClientGlobals::borderSizes() const
+{
+ // the list must be sorted
+ return QValueList< BorderSize >() << BorderNormal <<
+ BorderLarge << BorderVeryLarge << BorderHuge <<
+ BorderVeryHuge << BorderOversized;
+}
+
+void GlowClientGlobals::readTheme()
+{
+ QString theme_config_file = KGlobal::dirs()->findResource ("data",
+ QString("kwin/glow-themes/") + config()->themeName + "/" +
+ config()->themeName + ".theme");
+ if (theme_config_file.isNull())
+ {
+ config()->themeName = "default";
+ return;
+ }
+
+ KConfig conf (theme_config_file);
+ _theme = new GlowTheme(default_glow_theme);
+
+ _theme->buttonSize = conf.readSizeEntry ("buttonSize",
+ &_theme->buttonSize);
+ _theme->stickyOnPixmap = conf.readEntry ("stickyOnPixmap",
+ _theme->stickyOnPixmap);
+ _theme->stickyOffPixmap = conf.readEntry ("stickyOffPixmap",
+ _theme->stickyOffPixmap);
+ _theme->maximizeOnPixmap = conf.readEntry ("maximizeOnPixmap",
+ _theme->maximizeOnPixmap);
+ _theme->maximizeOffPixmap = conf.readEntry ("maximizeOffPixmap",
+ _theme->maximizeOffPixmap);
+ _theme->helpPixmap = conf.readEntry ("helpPixmap",
+ _theme->helpPixmap);
+ _theme->closePixmap = conf.readEntry ("closePixmap",
+ _theme->closePixmap);
+ _theme->iconifyPixmap = conf.readEntry ("iconifyPixmap",
+ _theme->iconifyPixmap);
+ _theme->stickyOnGlowPixmap = conf.readEntry ("stickyOnGlowPixmap",
+ _theme->stickyOnGlowPixmap);
+ _theme->stickyOffGlowPixmap = conf.readEntry ("stickyOffGlowPixmap",
+ _theme->stickyOffGlowPixmap);
+ _theme->maximizeOnGlowPixmap = conf.readEntry ("maximizeOnGlowPixmap",
+ _theme->maximizeOnGlowPixmap);
+ _theme->maximizeOffGlowPixmap = conf.readEntry ("maximizeOffGlowPixmap",
+ _theme->maximizeOffGlowPixmap);
+ _theme->helpGlowPixmap = conf.readEntry ("helpGlowPixmap",
+ _theme->helpGlowPixmap);
+ _theme->closeGlowPixmap = conf.readEntry ("closeGlowPixmap",
+ _theme->closeGlowPixmap);
+ _theme->iconifyGlowPixmap = conf.readEntry ("iconifyGlowPixmap",
+ _theme->iconifyGlowPixmap);
+
+ titleHeight = QFontMetrics(KDecoration::options()->font(true)).height();
+ if (titleHeight < SIDE_MARGIN)
+ titleHeight = SIDE_MARGIN;
+ if (titleHeight < _theme->buttonSize.height())
+ titleHeight = _theme->buttonSize.height();
+}
+
+bool GlowClientGlobals::reset( unsigned long /*changed*/ )
+{
+ deletePixmaps();
+ delete _config;
+ readConfig();
+ delete _theme;
+ readTheme ();
+ if (! createPixmaps())
+ {
+ deletePixmaps();
+ delete _theme;
+ _config->themeName = "default";
+ readTheme();
+ createPixmaps();
+ }
+ return true; // FRAME
+}
+
+bool GlowClientGlobals::supports( Ability ability )
+{
+ switch( ability )
+ {
+ case AbilityAnnounceButtons:
+ case AbilityButtonOnAllDesktops:
+ case AbilityButtonSpacer:
+ case AbilityButtonHelp:
+ case AbilityButtonMinimize:
+ case AbilityButtonMaximize:
+ case AbilityButtonClose:
+ return true;
+ default:
+ return false;
+ };
+}
+
+bool GlowClientGlobals::createPixmaps()
+{
+ for( int type=0; type<=Close; type++ ) {
+ if (! createPixmap(static_cast<PixmapType>(type), false))
+ return false;
+ if (! createPixmap(static_cast<PixmapType>(type), true))
+ return false;
+ }
+
+ return true;
+}
+
+void GlowClientGlobals::deletePixmaps()
+{
+ PixmapCache::clear();
+}
+
+const QString GlowClientGlobals::getPixmapTypeName(PixmapType type)
+{
+ switch(type) {
+ case (StickyOn):
+ return "StickyOn";
+ case(StickyOff ):
+ return "StickyOff";
+ case(Help):
+ return "Help";
+ case(Iconify):
+ return "Iconify";
+ case(MaximizeOn):
+ return "MaximizeOn";
+ case(MaximizeOff):
+ return "MaximizeOff";
+ case(Close):
+ return "Close";
+ default:
+ return QString::null;
+ }
+}
+
+bool GlowClientGlobals::createPixmap(PixmapType type, bool isActive)
+{
+ QString theme_dir = KGlobal::dirs()->findResource ("data",
+ QString("kwin/glow-themes/") + _config->themeName + "/");
+
+ QColor glow_color;
+ QColor color = options()->color(ColorButtonBg, isActive);
+
+ QImage bg_image (theme_dir+_theme->backgroundPixmap);
+ QImage fg_image;
+ QImage glow_image;
+
+ switch(type) {
+ case (StickyOn):
+ {
+ fg_image = QImage (theme_dir+_theme->stickyOnPixmap);
+ glow_image = QImage (theme_dir+_theme->stickyOnGlowPixmap);
+ glow_color = _config->stickyButtonGlowColor;
+ break;
+ }
+ case (StickyOff):
+ {
+ fg_image = QImage (theme_dir+_theme->stickyOffPixmap);
+ glow_image = QImage (theme_dir+_theme->stickyOffGlowPixmap);
+ glow_color = _config->stickyButtonGlowColor;
+ break;
+ }
+ case (Help):
+ {
+ fg_image = QImage (theme_dir+_theme->helpPixmap);
+ glow_image = QImage (theme_dir+_theme->helpGlowPixmap);
+ glow_color = _config->helpButtonGlowColor;
+ break;
+ }
+ case (Iconify):
+ {
+ fg_image = QImage (theme_dir+_theme->iconifyPixmap);
+ glow_image = QImage (theme_dir+_theme->iconifyGlowPixmap);
+ glow_color = _config->iconifyButtonGlowColor;
+ break;
+ }
+ case (MaximizeOn):
+ {
+ fg_image = QImage (theme_dir+_theme->maximizeOnPixmap);
+ glow_image = QImage (theme_dir+_theme->maximizeOnGlowPixmap);
+ glow_color = _config->maximizeButtonGlowColor;
+ break;
+ }
+ case (MaximizeOff):
+ {
+ fg_image = QImage (theme_dir+_theme->maximizeOffPixmap);
+ glow_image = QImage (theme_dir+_theme->maximizeOffGlowPixmap);
+ glow_color = _config->maximizeButtonGlowColor;
+ break;
+ }
+ case (Close):
+ {
+ fg_image = QImage (theme_dir+_theme->closePixmap);
+ glow_image = QImage (theme_dir+_theme->closeGlowPixmap);
+ glow_color = _config->closeButtonGlowColor;
+ break;
+ }
+ }
+
+ if (bg_image.size() != _theme->buttonSize
+ || fg_image.size() != _theme->buttonSize
+ || glow_image.size() != _theme->buttonSize)
+ return false;
+
+ QPixmap * glowPm = buttonFactory()->createGlowButtonPixmap(
+ bg_image, fg_image, glow_image,
+ color, glow_color);
+ if (glowPm->isNull())
+ return false;
+ PixmapCache::insert(getPixmapName(type, isActive), glowPm);
+ return true;
+}
+
+GlowClientGlobals *GlowClientGlobals::m_instance = 0;
+
+GlowClientGlobals *GlowClientGlobals::instance()
+{
+ if( ! m_instance )
+ {
+ m_instance = new GlowClientGlobals();
+ }
+ return m_instance;
+}
+
+//-----------------------------------------------------------------------------
+
+GlowClient::GlowClient( KDecorationBridge* b, KDecorationFactory* f )
+ : KDecoration( b, f ),
+ m_stickyButton(0), m_helpButton(0), m_minimizeButton(0),
+ m_maximizeButton(0), m_closeButton(0),
+ m_leftButtonLayout(0), m_rightButtonLayout(0), _main_layout(0)
+{
+}
+
+void GlowClient::init()
+{
+ createMainWidget(WResizeNoErase | WStaticContents | WRepaintNoErase);
+ widget()->installEventFilter(this);
+
+ createButtons();
+ resetLayout();
+}
+
+GlowClient::~GlowClient()
+{
+ PixmapCache::erase(QString::number(widget()->winId()));
+}
+
+void GlowClient::resizeEvent( QResizeEvent * )
+{
+ doShape();
+ widget()->repaint(false);
+}
+
+void GlowClient::paintEvent( QPaintEvent * )
+{
+ GlowClientConfig *conf = GlowClientGlobals::instance()->config();
+ QRect r_this = widget()->rect();
+ QRect r_title = _title_spacer->geometry();
+ QColorGroup titleCg = options()->colorGroup(ColorTitleBar, isActive());
+ QColorGroup titleBlendCg=options()->colorGroup(ColorTitleBlend, isActive());
+ QColorGroup cg = widget()->colorGroup();
+ QColor titleColor = options()->color(ColorTitleBar, isActive());
+ QColor titleBlendColor = options()->color(ColorTitleBlend, isActive());
+ QColor bgColor = widget()->colorGroup().background();
+ QPainter p;
+ QPointArray pArray, pArray2, pArray3, pArray4;
+
+ // pixmap for title bar
+ QSize tBSize(width(), r_title.height());
+ QSize gradientPixmapSize (tBSize-QSize(3,3));
+ if (! gradientPixmapSize.isValid())
+ gradientPixmapSize = QSize(0,0);
+ KPixmap gradientPixmap(gradientPixmapSize);
+ if (! gradientPixmapSize.isNull())
+ KPixmapEffect::gradient(gradientPixmap, titleColor, titleBlendColor,
+ (KPixmapEffect::GradientType) conf->titlebarGradientType);
+
+ QPixmap * title_buffer = new QPixmap(tBSize);
+ p.begin(title_buffer);
+ if (! gradientPixmap.isNull())
+ p.drawPixmap(2, 2, gradientPixmap);
+
+ if (tBSize.width()>=3 && tBSize.height()>=3)
+ {
+ // draw caption
+ p.setFont(options()->font(isActive()));
+ p.setPen(options()->color(ColorFont, isActive()));
+ p.drawText(r_title.x(), 0,
+ r_title.width(), r_title.height(),
+ Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, caption());
+
+ // draw split color beneath buttons top right
+ pArray4 = QPointArray(4);
+ pArray4.setPoint(0, tBSize.width()-1, tBSize.height()/2-1);
+ pArray4.setPoint(1, r_title.x()+r_title.width()-1+tBSize.height()/2,
+ tBSize.height()/2-1);
+ pArray4.setPoint(2, r_title.x()+r_title.width()-1, tBSize.height());
+ pArray4.setPoint(3, tBSize.width()-1, tBSize.height());
+ p.setPen(Qt::NoPen);
+ p.setBrush(bgColor);
+ p.drawPolygon(pArray4);
+
+ // draw borders
+ pArray = QPointArray(3);
+ pArray.setPoint(0, tBSize.width()-1, tBSize.height()/2-1);
+ pArray.setPoint(1, r_title.x()+r_title.width()-1+tBSize.height()/2,
+ tBSize.height()/2-1);
+ pArray.setPoint(2, r_title.x()+r_title.width()-1, tBSize.height()-1);
+ p.setPen(titleCg.mid());
+ p.drawPolyline(pArray);
+ p.drawLine (0, tBSize.height()-1, r_title.x()+r_title.width()-1, tBSize.height()-1);
+
+ pArray2 = QPointArray(3);
+ pArray2.setPoint(0, 1, tBSize.height()-2);
+ pArray2.setPoint(1, 1, 1);
+ pArray2.setPoint(2, tBSize.width()-2, 1);
+ p.setPen(titleCg.light());
+ p.drawPolyline(pArray2);
+ }
+
+ pArray3 = QPointArray(4);
+ pArray3.setPoint(0, 0, tBSize.height()-1);
+ pArray3.setPoint(1, 0, 0);
+ pArray3.setPoint(2, tBSize.width()-1, 0);
+ pArray3.setPoint(3, tBSize.width()-1, tBSize.height()-1);
+ p.setPen(Qt::black);
+ p.drawPolyline(pArray3);
+ p.end();
+
+ // insert title buffer in cache; before that, remove old buffer
+ PixmapCache::erase(QString::number(widget()->winId()));
+ PixmapCache::insert(QString::number(widget()->winId()), title_buffer);
+
+ bitBlt(widget(), 0, 0, title_buffer);
+ for (unsigned int i=0; i<m_buttonList.size(); ++i)
+ m_buttonList[i]->repaint(false);
+
+ p.begin(widget());
+ p.setPen(Qt::black);
+ //-----
+ // draw borders
+ p.drawLine(0,tBSize.height(),0,r_this.height()-1);
+ p.drawLine(0,r_this.height()-1,r_this.width()-1,r_this.height()-1);
+ p.drawLine(r_this.width()-1,r_this.height()-1,
+ r_this.width()-1,tBSize.height()/2);
+ //-----
+ // fill content widget
+ p.fillRect(1, tBSize.height(),
+ r_this.width()-2, r_this.height()-tBSize.height()-1,
+ options()->colorGroup(ColorFrame, isActive()).background());
+ p.end();
+
+ // paint resize handle if necessary
+ if(conf->showResizeHandle && isResizable() && ! isShade()
+ && width()>=2 && height() >= RESIZE_HANDLE_HEIGHT)
+ {
+ p.begin(widget());
+ p.setPen (Qt::black);
+ p.drawLine (1, height() - RESIZE_HANDLE_HEIGHT,
+ width()-2, height() - RESIZE_HANDLE_HEIGHT);
+ p.end();
+ }
+}
+
+void GlowClient::showEvent( QShowEvent * )
+{
+ doShape();
+ widget()->repaint(false);
+}
+
+void GlowClient::mouseDoubleClickEvent( QMouseEvent *e )
+{
+ if(e->button() == LeftButton && _title_spacer->geometry().contains(e->pos()))
+ titlebarDblClickOperation();
+}
+
+void GlowClient::wheelEvent( QWheelEvent *e )
+{
+ if (isSetShade() || QRect( 0, 0, width(), titleHeight ).contains(e->pos()))
+ titlebarMouseWheelOperation( e->delta());
+}
+
+void GlowClient::activeChange()
+{
+ updateButtonPixmaps();
+ widget()->repaint(false);
+}
+
+void GlowClient::iconChange()
+{
+ // we have no (t yet an) icon button, so do nothing
+}
+
+void GlowClient::shadeChange()
+{
+}
+
+void GlowClient::captionChange()
+{
+ widget()->update(_title_spacer->geometry());
+}
+
+QSize GlowClient::minimumSize() const
+{
+ return widget()->minimumSize();
+}
+
+void GlowClient::resize( const QSize& s )
+{
+ widget()->resize( s );
+}
+
+void GlowClient::borders( int& left, int& right, int& top, int& bottom ) const
+{
+ left = right = SIDE_MARGIN;
+ top = titleHeight + TITLE_MARGIN + 1;
+ if (GlowClientGlobals::instance()->config()->showResizeHandle
+ && isResizable())
+ bottom = RESIZE_HANDLE_HEIGHT;
+ else
+ bottom = BOTTOM_MARGIN;
+}
+
+void GlowClient::desktopChange()
+{
+ if (isOnAllDesktops()) {
+ m_stickyButton->setPixmapName(
+ GlowClientGlobals::instance()->getPixmapName(
+ GlowClientGlobals::StickyOn, isActive()));
+ m_stickyButton->setTipText(i18n("Not on all desktops"));
+ } else {
+ m_stickyButton->setPixmapName(
+ GlowClientGlobals::instance()->getPixmapName(
+ GlowClientGlobals::StickyOff, isActive()));
+ m_stickyButton->setTipText(i18n("On all desktops"));
+ }
+}
+
+void GlowClient::maximizeChange()
+{
+ if (maximizeMode() == MaximizeFull) {
+ m_maximizeButton->setPixmapName(
+ GlowClientGlobals::instance()->getPixmapName(
+ GlowClientGlobals::MaximizeOn, isActive()));
+ m_maximizeButton->setTipText(i18n("Restore"));
+ } else {
+ m_maximizeButton->setPixmapName(
+ GlowClientGlobals::instance()->getPixmapName(
+ GlowClientGlobals::MaximizeOff, isActive()));
+ m_maximizeButton->setTipText(i18n("Maximize"));
+ }
+}
+
+KDecoration::Position GlowClient::mousePosition(const QPoint &pos) const
+{
+ Position m = PositionCenter;
+
+ int bottomSize
+ = (GlowClientGlobals::instance()->config()->showResizeHandle)
+ ? RESIZE_HANDLE_HEIGHT : BOTTOM_MARGIN;
+
+ const int range = 14 + 3*SIDE_MARGIN/2;
+
+ if ( ( pos.x() > SIDE_MARGIN && pos.x() < width() - SIDE_MARGIN )
+ && ( pos.y() > 4 && pos.y() < height() - bottomSize ) )
+ m = PositionCenter;
+ else if ( pos.y() <= range && pos.x() <= range)
+ m = PositionTopLeft;
+ else if ( pos.y() >= height()-range && pos.x() >= width()-range)
+ m = PositionBottomRight;
+ else if ( pos.y() >= height()-range && pos.x() <= range)
+ m = PositionBottomLeft;
+ else if ( pos.y() <= range && pos.x() >= width()-range)
+ m = PositionTopRight;
+ else if ( pos.y() <= 4 )
+ m = PositionTop;
+ else if ( pos.y() >= height()-bottomSize )
+ m = PositionBottom;
+ else if ( pos.x() <= SIDE_MARGIN )
+ m = PositionLeft;
+ else if ( pos.x() >= width()-SIDE_MARGIN )
+ m = PositionRight;
+ else
+ m = PositionCenter;
+
+ return m;
+}
+
+void GlowClient::createButtons()
+{
+ GlowClientGlobals *globals = GlowClientGlobals::instance();
+ GlowButtonFactory *factory = globals->buttonFactory();
+ QSize size = globals->theme()->buttonSize;
+
+ m_stickyButton = factory->createGlowButton(widget(),
+ "StickyButton", isOnAllDesktops()?i18n("Not on all desktops"):i18n("On all desktops"), LeftButton|RightButton);
+ m_stickyButton->setFixedSize(size);
+ connect(m_stickyButton, SIGNAL(clicked()), this, SLOT(toggleOnAllDesktops()));
+ m_buttonList.insert(m_buttonList.end(), m_stickyButton);
+
+ m_helpButton = factory->createGlowButton(widget(),
+ "HelpButton", i18n("Help"));
+ m_helpButton->setFixedSize(size);
+ connect(m_helpButton, SIGNAL(clicked()), this, SLOT(showContextHelp()));
+ m_buttonList.insert(m_buttonList.end(), m_helpButton);
+
+ m_minimizeButton = factory->createGlowButton(widget(),
+ "IconifyButton", i18n("Minimize"));
+ m_minimizeButton->setFixedSize(size);
+ connect(m_minimizeButton, SIGNAL(clicked()), this, SLOT(minimize()));
+ m_buttonList.insert(m_buttonList.end(), m_minimizeButton);
+
+ m_maximizeButton=factory->createGlowButton(widget(),
+ "MaximizeButton", i18n("Maximize"), LeftButton|MidButton|RightButton);
+ m_maximizeButton->setFixedSize(size);
+ connect(m_maximizeButton, SIGNAL(clicked()), this, SLOT(slotMaximize()));
+ m_buttonList.insert(m_buttonList.end(), m_maximizeButton);
+
+ m_closeButton = factory->createGlowButton(widget(),
+ "CloseButton", i18n("Close"));
+ m_closeButton->setFixedSize(size);
+ connect(m_closeButton, SIGNAL(clicked()), this, SLOT(closeWindow()));
+ m_buttonList.insert(m_buttonList.end(), m_closeButton);
+}
+
+void GlowClient::resetLayout()
+{
+ _main_layout = new QVBoxLayout(widget(), 0, 0);
+ _main_layout->setResizeMode (QLayout::FreeResize);
+
+ // update button positions and colors
+ updateButtonPositions();
+ updateButtonPixmaps();
+
+ QBoxLayout * topLayout = new QBoxLayout(_main_layout,
+ QBoxLayout::LeftToRight, 0, 0);
+ topLayout->setMargin(0);
+ topLayout->setSpacing(TITLE_SPACING);
+ topLayout->addSpacing(SIDE_MARGIN);
+ QVBoxLayout *outerLeftLayout = new QVBoxLayout(topLayout);
+ outerLeftLayout->addSpacing(TITLE_MARGIN);
+ outerLeftLayout->addItem(m_leftButtonLayout);
+ outerLeftLayout->addSpacing(1);
+ topLayout->addSpacing(SIDE_MARGIN);
+
+ _title_spacer = new QSpacerItem(0, titleHeight + TITLE_MARGIN + 1,
+ QSizePolicy::Expanding, QSizePolicy::Fixed);
+ topLayout->addItem(_title_spacer);
+
+ topLayout->addSpacing(SIDE_MARGIN);
+ QVBoxLayout *outerRightLayout = new QVBoxLayout(topLayout);
+ outerRightLayout->addSpacing(TITLE_MARGIN);
+ outerRightLayout->addItem(m_rightButtonLayout);
+ outerRightLayout->addSpacing(1);
+ topLayout->addSpacing(SIDE_MARGIN);
+
+ QBoxLayout *midLayout = new QBoxLayout(
+ _main_layout, QBoxLayout::LeftToRight, 0, 0);
+ midLayout->addSpacing(SIDE_MARGIN);
+ if(isPreview())
+ midLayout->addWidget(
+ new QLabel( i18n( "<b><center>Glow preview</center></b>" ), widget()));
+ else
+ midLayout->addItem( new QSpacerItem( 0, 0 ));
+ midLayout->addSpacing(SIDE_MARGIN);
+
+ if(GlowClientGlobals::instance()->config()->showResizeHandle
+ && isResizable() ) {
+ _bottom_spacer = new QSpacerItem(SIDE_MARGIN*2,
+ RESIZE_HANDLE_HEIGHT, QSizePolicy::Expanding, QSizePolicy::Minimum);
+ } else {
+ _bottom_spacer = new QSpacerItem(SIDE_MARGIN*2,
+ BOTTOM_MARGIN, QSizePolicy::Expanding, QSizePolicy::Minimum);
+ }
+ _main_layout->addItem (_bottom_spacer);
+ _main_layout->setStretchFactor(topLayout, 0);
+ _main_layout->setStretchFactor(midLayout, 1);
+}
+
+void GlowClient::updateButtonPositions()
+{
+ QString buttons = options()->titleButtonsLeft() + "|"
+ + options()->titleButtonsRight();
+ bool leftButtons=true;
+
+ // hide all buttons
+ for( unsigned int i=0; i<m_buttonList.size(); i++ )
+ m_buttonList[i]->hide();
+
+ m_leftButtonList.clear();
+ m_rightButtonList.clear();
+
+ // reset left and right button layout
+ if(m_leftButtonLayout)
+ delete m_leftButtonLayout;
+ m_leftButtonLayout = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
+ m_leftButtonLayout->setMargin(0);
+ m_leftButtonLayout->setSpacing(TITLE_SPACING);
+ if(m_rightButtonLayout)
+ delete m_rightButtonLayout;
+ m_rightButtonLayout = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
+ m_rightButtonLayout->setMargin(0);
+ m_rightButtonLayout->setSpacing(TITLE_SPACING);
+
+ for( unsigned int i=0; i<buttons.length(); i++ )
+ {
+ char c = buttons[i].latin1();
+ GlowButton *button = 0;
+ if( c=='S' ) // sticky
+ button = m_stickyButton;
+ else if( c=='H' && providesContextHelp() ) // help
+ button = m_helpButton;
+ else if( c=='I' && isMinimizable() ) // iconify
+ button = m_minimizeButton;
+ else if( c=='A' && isMaximizable() ) // maximize
+ button = m_maximizeButton;
+ else if( c=='X' && isCloseable() ) // close
+ button= m_closeButton;
+ else if( c=='_' ) // spacer item
+ {
+ if(leftButtons)
+ m_leftButtonLayout->addSpacing(4);
+ else
+ m_rightButtonLayout->addSpacing(4);
+ }
+ else if( c=='|' )
+ leftButtons = false;
+
+ if (button) {
+ button->show(); // show visible buttons
+ if (leftButtons) {
+ m_leftButtonList.insert(m_leftButtonList.end(), button);
+ m_leftButtonLayout->addWidget(button);
+ } else {
+ m_rightButtonList.insert(m_rightButtonList.end(), button);
+ m_rightButtonLayout->addWidget(button);
+ }
+ }
+ }
+}
+
+void GlowClient::updateButtonPixmaps()
+{
+ GlowClientGlobals *globals = GlowClientGlobals::instance();
+
+ if ( isOnAllDesktops() ) {
+ m_stickyButton->setPixmapName(globals->getPixmapName(
+ GlowClientGlobals::StickyOn, isActive()));
+ } else {
+ m_stickyButton->setPixmapName(globals->getPixmapName(
+ GlowClientGlobals::StickyOff, isActive()));
+ }
+ m_helpButton->setPixmapName(globals->getPixmapName(
+ GlowClientGlobals::Help, isActive()));
+
+ m_minimizeButton->setPixmapName(globals->getPixmapName(
+ GlowClientGlobals::Iconify, isActive()));
+
+ if ( maximizeMode() == MaximizeFull ) {
+ m_maximizeButton->setPixmapName(globals->getPixmapName(
+ GlowClientGlobals::MaximizeOn, isActive()));
+ } else {
+ m_maximizeButton->setPixmapName(globals->getPixmapName(
+ GlowClientGlobals::MaximizeOff, isActive()));
+ }
+ m_closeButton->setPixmapName(globals->getPixmapName(
+ GlowClientGlobals::Close, isActive()));
+}
+
+void GlowClient::doShape()
+{
+ QRegion mask(widget()->rect());
+ // edges
+
+ mask -= QRegion(width()-1,0,1,1);
+ mask -= QRegion(0,height()-1,1,1);
+ mask -= QRegion(width()-1,height()-1,1,1);
+ setMask(mask);
+}
+
+bool GlowClient::isLeft(GlowButton *button)
+{
+ for( unsigned int i=0; i<m_leftButtonList.size(); i++ )
+ if( m_leftButtonList[i] == button )
+ return true;
+ return false;
+}
+
+bool GlowClient::isRight(GlowButton *button)
+{
+ for( unsigned int i=0; i<m_rightButtonList.size(); i++ )
+ if( m_rightButtonList[i] == button )
+ return true;
+ return false;
+}
+
+void GlowClient::slotMaximize()
+{
+ maximize(m_maximizeButton->lastButton());
+}
+
+bool GlowClient::eventFilter( QObject* o, QEvent* e )
+{
+ if( o != widget())
+ return false;
+ switch( e->type())
+ {
+ case QEvent::Resize:
+ resizeEvent( static_cast< QResizeEvent* >( e ));
+ return true;
+ case QEvent::Paint:
+ paintEvent( static_cast< QPaintEvent* >( e ));
+ return true;
+ case QEvent::MouseButtonDblClick:
+ mouseDoubleClickEvent( static_cast< QMouseEvent* >( e ));
+ return true;
+ case QEvent::MouseButtonPress:
+ processMousePressEvent( static_cast< QMouseEvent* >( e ));
+ return true;
+ case QEvent::Show:
+ showEvent( static_cast< QShowEvent* >( e ));
+ return true;
+ case QEvent::Wheel:
+ wheelEvent( static_cast< QWheelEvent* >( e ));
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+KDecoration* GlowClientGlobals::createDecoration( KDecorationBridge* bridge )
+{
+ return new GlowClient( bridge, this );
+}
+
+} // end of namespace
+
+extern "C"
+KDE_EXPORT KDecorationFactory* create_factory()
+{
+ return Glow::GlowClientGlobals::instance();
+}
+
+#include "glowclient.moc"
+
diff --git a/kwin-styles/glow/glowclient.h b/kwin-styles/glow/glowclient.h
new file mode 100644
index 00000000..9de73126
--- /dev/null
+++ b/kwin-styles/glow/glowclient.h
@@ -0,0 +1,205 @@
+/***************************************************************************
+ glowclient.h - description
+ -------------------
+ begin : Thu Sep 6 2001
+ copyright : (C) 2001 by Henning Burchardt
+ email : h_burchardt@gmx.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef GLOW_CLIENT_H
+#define GLOW_CLIENT_H
+
+#include <vector>
+#include <map>
+#include <kdecoration.h>
+#include <kdecorationfactory.h>
+
+class QPixmap;
+class QBitmap;
+class QTimer;
+class QBoxLayout;
+class QGridLayout;
+class QVBoxLayout;
+class QSpacerItem;
+
+namespace Glow
+{
+
+class GlowButton;
+class GlowButtonFactory;
+
+//-----------------------------------------------------------------------------
+// GlowTheme
+//-----------------------------------------------------------------------------
+
+struct GlowTheme
+{
+ QSize buttonSize;
+
+ QString backgroundPixmap;
+ QString backgroundAlphaPixmap;
+
+ QString stickyOnPixmap;
+ QString stickyOffPixmap;
+ QString maximizeOnPixmap;
+ QString maximizeOffPixmap;
+ QString helpPixmap;
+ QString closePixmap;
+ QString iconifyPixmap;
+
+ QString stickyOnGlowPixmap;
+ QString stickyOffGlowPixmap;
+ QString maximizeOnGlowPixmap;
+ QString maximizeOffGlowPixmap;
+ QString helpGlowPixmap;
+ QString closeGlowPixmap;
+ QString iconifyGlowPixmap;
+};
+
+static GlowTheme default_glow_theme = {
+ QSize (17, 17),
+ "background.png", "background_alpha.png",
+ "stickyon.png", "stickyoff.png",
+ "maximizeon.png", "maximizeoff.png",
+ "help.png", "close.png", "iconify.png",
+ "stickyon_glow.png", "stickyoff_glow.png",
+ "maximizeon_glow.png", "maximizeoff_glow.png",
+ "help_glow.png", "close_glow.png", "iconify_glow.png" };
+
+//-----------------------------------------------------------------------------
+// GlowClientConfig
+//-----------------------------------------------------------------------------
+
+class GlowClientConfig
+{
+public:
+ GlowClientConfig();
+
+ void load (KDecorationFactory *factory);
+
+ QColor stickyButtonGlowColor;
+ QColor helpButtonGlowColor;
+ QColor iconifyButtonGlowColor;
+ QColor maximizeButtonGlowColor;
+ QColor closeButtonGlowColor;
+ bool showResizeHandle;
+ int titlebarGradientType;
+ QString themeName;
+};
+
+//-----------------------------------------------------------------------------
+// GlowClientGlobals
+//-----------------------------------------------------------------------------
+
+class GlowClientGlobals : public KDecorationFactory
+{
+public:
+ enum PixmapType { StickyOn, StickyOff, Help, Iconify, MaximizeOn,
+ MaximizeOff, Close };
+
+ static GlowClientGlobals *instance();
+
+ ~GlowClientGlobals();
+
+ virtual KDecoration* createDecoration( KDecorationBridge* b );
+ virtual bool reset( unsigned long changed );
+ virtual bool supports( Ability ability );
+ QValueList< GlowClientGlobals::BorderSize > borderSizes() const;
+
+ QString getPixmapName(PixmapType type, bool isActive);
+
+ GlowTheme * theme() const { return _theme; }
+ GlowClientConfig * config() const { return _config; }
+ GlowButtonFactory * buttonFactory() { return _button_factory; }
+
+private:
+ static GlowClientGlobals *m_instance;
+
+ GlowTheme * _theme;
+ GlowClientConfig * _config;
+ GlowButtonFactory * _button_factory;
+
+ GlowClientGlobals();
+ void readConfig();
+ void readTheme ();
+ bool createPixmaps();
+ void deletePixmaps();
+ bool createPixmap(PixmapType type,bool isActive);
+ const QString getPixmapTypeName(PixmapType type);
+};
+
+//-----------------------------------------------------------------------------
+// GlowClient
+//-----------------------------------------------------------------------------
+
+class GlowClient : public KDecoration
+{
+ Q_OBJECT
+public:
+ GlowClient( KDecorationBridge* b, KDecorationFactory* f );
+ ~GlowClient();
+
+ virtual void init();
+ virtual void borders( int&, int&, int&, int& ) const;
+ virtual void resize( const QSize& );
+ virtual QSize minimumSize() const;
+
+protected:
+ virtual void resizeEvent( QResizeEvent * );
+ virtual void paintEvent( QPaintEvent * );
+ virtual void showEvent( QShowEvent * );
+ virtual void mouseDoubleClickEvent( QMouseEvent * );
+ virtual void wheelEvent( QWheelEvent * );
+ virtual void maximizeChange();
+ virtual void activeChange();
+ virtual void iconChange();
+ virtual void desktopChange();
+ virtual void shadeChange();
+ virtual void captionChange();
+ virtual Position mousePosition(const QPoint &) const;
+ virtual bool eventFilter( QObject* o, QEvent* e );
+
+private:
+ std::vector<GlowButton*> m_buttonList;
+ std::vector<GlowButton*> m_leftButtonList;
+ std::vector<GlowButton*> m_rightButtonList;
+ GlowButton *m_stickyButton;
+ GlowButton *m_helpButton;
+ GlowButton *m_minimizeButton;
+ GlowButton *m_maximizeButton;
+ GlowButton *m_closeButton;
+ QBoxLayout *m_leftButtonLayout;
+ QBoxLayout *m_rightButtonLayout;
+ QSpacerItem * _bottom_spacer;
+ QSpacerItem * _title_spacer;
+ QVBoxLayout * _main_layout;
+
+ void createButtons();
+ void updateButtonPositions();
+ /**
+ * Before this method is called we have to update the button
+ * positions with updateButtonPositions() because the pixmaps
+ * depend on the position
+ */
+ void updateButtonPixmaps();
+ void resetLayout();
+ void doShape();
+ bool isLeft(GlowButton *button);
+ bool isRight(GlowButton *button);
+
+protected slots:
+ void slotMaximize();
+};
+
+} // namespace
+
+#endif
diff --git a/kwin-styles/glow/resources.h b/kwin-styles/glow/resources.h
new file mode 100644
index 00000000..fa575aed
--- /dev/null
+++ b/kwin-styles/glow/resources.h
@@ -0,0 +1,11 @@
+#ifndef RESOURCES_H
+#define RESOURCES_H
+
+#define DEFAULT_CLOSE_BUTTON_COLOR Qt::red
+#define DEFAULT_MAXIMIZE_BUTTON_COLOR Qt::yellow
+#define DEFAULT_ICONIFY_BUTTON_COLOR Qt::green
+#define DEFAULT_HELP_BUTTON_COLOR Qt::white
+#define DEFAULT_STICKY_BUTTON_COLOR Qt::white
+
+#endif
+
diff --git a/kwin-styles/glow/themes/Makefile.am b/kwin-styles/glow/themes/Makefile.am
new file mode 100644
index 00000000..ec2725a7
--- /dev/null
+++ b/kwin-styles/glow/themes/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS=default glass square glass_large glass_verylarge glass_huge
diff --git a/kwin-styles/glow/themes/default/Makefile.am b/kwin-styles/glow/themes/default/Makefile.am
new file mode 100644
index 00000000..881b15d4
--- /dev/null
+++ b/kwin-styles/glow/themes/default/Makefile.am
@@ -0,0 +1,17 @@
+linkdir = $(kde_datadir)/kwin/glow-themes/default
+link_DATA = \
+background.png \
+help.png help_glow.png \
+close.png close_glow.png \
+iconify.png iconify_glow.png \
+maximizeoff.png maximizeoff_glow.png \
+maximizeon.png maximizeon_glow.png \
+stickyon.png stickyon_glow.png \
+stickyoff.png stickyoff_glow.png \
+default.theme
+
+EXTRA_DIST = $(link_DATA)
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/glow/themes/default/background.png b/kwin-styles/glow/themes/default/background.png
new file mode 100644
index 00000000..3fcbcdf5
--- /dev/null
+++ b/kwin-styles/glow/themes/default/background.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/close.png b/kwin-styles/glow/themes/default/close.png
new file mode 100644
index 00000000..898a368a
--- /dev/null
+++ b/kwin-styles/glow/themes/default/close.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/close_glow.png b/kwin-styles/glow/themes/default/close_glow.png
new file mode 100644
index 00000000..69b36e92
--- /dev/null
+++ b/kwin-styles/glow/themes/default/close_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/default.theme b/kwin-styles/glow/themes/default/default.theme
new file mode 100644
index 00000000..26f00feb
--- /dev/null
+++ b/kwin-styles/glow/themes/default/default.theme
@@ -0,0 +1,19 @@
+buttonSize=17,17
+
+backgroundPixmap=background.png
+
+stickyOnPixmap=stickyon.png
+stickyOffPixmap=stickyoff.png
+maximizeOnPixmap=maximizeon.png
+maximizeOffPixmap=maximizeoff.png
+helpPixmap=help.png
+closePixmap=close.png
+iconifyPixmap=iconify.png
+
+stickyOnGlowPixmap=stickyon_glow.png
+stickyOffGlowPixmap=stickyoff_glow.png
+maximizeOnGlowPixmap=maximizeon_glow.png
+maximizeOffGlowPixmap=maximizeoff_glow.png
+helpGlowPixmap=help_glow.png
+closeGlowPixmap=close_glow.png
+iconifyGlowPixmap=iconify_glow.png
diff --git a/kwin-styles/glow/themes/default/help.png b/kwin-styles/glow/themes/default/help.png
new file mode 100644
index 00000000..c3ed65ee
--- /dev/null
+++ b/kwin-styles/glow/themes/default/help.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/help_glow.png b/kwin-styles/glow/themes/default/help_glow.png
new file mode 100644
index 00000000..79a5006a
--- /dev/null
+++ b/kwin-styles/glow/themes/default/help_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/iconify.png b/kwin-styles/glow/themes/default/iconify.png
new file mode 100644
index 00000000..94fc6338
--- /dev/null
+++ b/kwin-styles/glow/themes/default/iconify.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/iconify_glow.png b/kwin-styles/glow/themes/default/iconify_glow.png
new file mode 100644
index 00000000..8b4d1413
--- /dev/null
+++ b/kwin-styles/glow/themes/default/iconify_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/maximizeoff.png b/kwin-styles/glow/themes/default/maximizeoff.png
new file mode 100644
index 00000000..e60cdc97
--- /dev/null
+++ b/kwin-styles/glow/themes/default/maximizeoff.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/maximizeoff_glow.png b/kwin-styles/glow/themes/default/maximizeoff_glow.png
new file mode 100644
index 00000000..25f4c8ec
--- /dev/null
+++ b/kwin-styles/glow/themes/default/maximizeoff_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/maximizeon.png b/kwin-styles/glow/themes/default/maximizeon.png
new file mode 100644
index 00000000..3976411f
--- /dev/null
+++ b/kwin-styles/glow/themes/default/maximizeon.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/maximizeon_glow.png b/kwin-styles/glow/themes/default/maximizeon_glow.png
new file mode 100644
index 00000000..941ed849
--- /dev/null
+++ b/kwin-styles/glow/themes/default/maximizeon_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/stickyoff.png b/kwin-styles/glow/themes/default/stickyoff.png
new file mode 100644
index 00000000..3600e326
--- /dev/null
+++ b/kwin-styles/glow/themes/default/stickyoff.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/stickyoff_glow.png b/kwin-styles/glow/themes/default/stickyoff_glow.png
new file mode 100644
index 00000000..5c9861a0
--- /dev/null
+++ b/kwin-styles/glow/themes/default/stickyoff_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/stickyon.png b/kwin-styles/glow/themes/default/stickyon.png
new file mode 100644
index 00000000..a84941a3
--- /dev/null
+++ b/kwin-styles/glow/themes/default/stickyon.png
Binary files differ
diff --git a/kwin-styles/glow/themes/default/stickyon_glow.png b/kwin-styles/glow/themes/default/stickyon_glow.png
new file mode 100644
index 00000000..905653e5
--- /dev/null
+++ b/kwin-styles/glow/themes/default/stickyon_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/Makefile.am b/kwin-styles/glow/themes/glass/Makefile.am
new file mode 100644
index 00000000..f1d7e5d7
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/Makefile.am
@@ -0,0 +1,17 @@
+linkdir = $(kde_datadir)/kwin/glow-themes/glass
+link_DATA = \
+background.png \
+help.png help_glow.png \
+close.png close_glow.png \
+iconify.png iconify_glow.png \
+maximizeoff.png maximizeoff_glow.png \
+maximizeon.png maximizeon_glow.png \
+stickyon.png stickyon_glow.png \
+stickyoff.png stickyoff_glow.png \
+glass.theme
+
+EXTRA_DIST = $(link_DATA)
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/glow/themes/glass/background.png b/kwin-styles/glow/themes/glass/background.png
new file mode 100644
index 00000000..97d278a0
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/background.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/close.png b/kwin-styles/glow/themes/glass/close.png
new file mode 100644
index 00000000..8b61cfd2
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/close.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/close_glow.png b/kwin-styles/glow/themes/glass/close_glow.png
new file mode 100644
index 00000000..2be50e89
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/close_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/glass.theme b/kwin-styles/glow/themes/glass/glass.theme
new file mode 100644
index 00000000..9facf271
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/glass.theme
@@ -0,0 +1,19 @@
+buttonSize=19,19
+
+backgroundPixmap=background.png
+
+stickyOnPixmap=stickyon.png
+stickyOffPixmap=stickyoff.png
+maximizeOnPixmap=maximizeon.png
+maximizeOffPixmap=maximizeoff.png
+helpPixmap=help.png
+closePixmap=close.png
+iconifyPixmap=iconify.png
+
+stickyOnGlowPixmap=stickyon_glow.png
+stickyOffGlowPixmap=stickyoff_glow.png
+maximizeOnGlowPixmap=maximizeon_glow.png
+maximizeOffGlowPixmap=maximizeoff_glow.png
+helpGlowPixmap=help_glow.png
+closeGlowPixmap=close_glow.png
+iconifyGlowPixmap=iconify_glow.png
diff --git a/kwin-styles/glow/themes/glass/help.png b/kwin-styles/glow/themes/glass/help.png
new file mode 100644
index 00000000..7a12fe88
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/help.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/help_glow.png b/kwin-styles/glow/themes/glass/help_glow.png
new file mode 100644
index 00000000..77976ff1
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/help_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/iconify.png b/kwin-styles/glow/themes/glass/iconify.png
new file mode 100644
index 00000000..55b9f6a9
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/iconify.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/iconify_glow.png b/kwin-styles/glow/themes/glass/iconify_glow.png
new file mode 100644
index 00000000..ff741dbe
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/iconify_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/maximizeoff.png b/kwin-styles/glow/themes/glass/maximizeoff.png
new file mode 100644
index 00000000..b08d34c1
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/maximizeoff.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/maximizeoff_glow.png b/kwin-styles/glow/themes/glass/maximizeoff_glow.png
new file mode 100644
index 00000000..8ff43447
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/maximizeoff_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/maximizeon.png b/kwin-styles/glow/themes/glass/maximizeon.png
new file mode 100644
index 00000000..8894007e
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/maximizeon.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/maximizeon_glow.png b/kwin-styles/glow/themes/glass/maximizeon_glow.png
new file mode 100644
index 00000000..7fe3c840
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/maximizeon_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/stickyoff.png b/kwin-styles/glow/themes/glass/stickyoff.png
new file mode 100644
index 00000000..d87cfe9d
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/stickyoff.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/stickyoff_glow.png b/kwin-styles/glow/themes/glass/stickyoff_glow.png
new file mode 100644
index 00000000..f682df78
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/stickyoff_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/stickyon.png b/kwin-styles/glow/themes/glass/stickyon.png
new file mode 100644
index 00000000..f044c134
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/stickyon.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass/stickyon_glow.png b/kwin-styles/glow/themes/glass/stickyon_glow.png
new file mode 100644
index 00000000..0b468787
--- /dev/null
+++ b/kwin-styles/glow/themes/glass/stickyon_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/Makefile.am b/kwin-styles/glow/themes/glass_huge/Makefile.am
new file mode 100644
index 00000000..b9631d1b
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/Makefile.am
@@ -0,0 +1,17 @@
+linkdir = $(kde_datadir)/kwin/glow-themes/glass_huge
+link_DATA = \
+background.png \
+help.png help_glow.png \
+close.png close_glow.png \
+iconify.png iconify_glow.png \
+maximizeoff.png maximizeoff_glow.png \
+maximizeon.png maximizeon_glow.png \
+stickyon.png stickyon_glow.png \
+stickyoff.png stickyoff_glow.png \
+glass_huge.theme
+
+EXTRA_DIST = $(link_DATA)
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/glow/themes/glass_huge/background.png b/kwin-styles/glow/themes/glass_huge/background.png
new file mode 100644
index 00000000..f69e109b
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/background.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/close.png b/kwin-styles/glow/themes/glass_huge/close.png
new file mode 100644
index 00000000..3f1c7369
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/close.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/close_glow.png b/kwin-styles/glow/themes/glass_huge/close_glow.png
new file mode 100644
index 00000000..00b647dc
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/close_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/glass_huge.theme b/kwin-styles/glow/themes/glass_huge/glass_huge.theme
new file mode 100644
index 00000000..d8c41f52
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/glass_huge.theme
@@ -0,0 +1,19 @@
+buttonSize=40,40
+
+backgroundPixmap=background.png
+
+stickyOnPixmap=stickyon.png
+stickyOffPixmap=stickyoff.png
+maximizeOnPixmap=maximizeon.png
+maximizeOffPixmap=maximizeoff.png
+helpPixmap=help.png
+closePixmap=close.png
+iconifyPixmap=iconify.png
+
+stickyOnGlowPixmap=stickyon_glow.png
+stickyOffGlowPixmap=stickyoff_glow.png
+maximizeOnGlowPixmap=maximizeon_glow.png
+maximizeOffGlowPixmap=maximizeoff_glow.png
+helpGlowPixmap=help_glow.png
+closeGlowPixmap=close_glow.png
+iconifyGlowPixmap=iconify_glow.png
diff --git a/kwin-styles/glow/themes/glass_huge/help.png b/kwin-styles/glow/themes/glass_huge/help.png
new file mode 100644
index 00000000..a391ce94
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/help.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/help_glow.png b/kwin-styles/glow/themes/glass_huge/help_glow.png
new file mode 100644
index 00000000..a8237795
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/help_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/iconify.png b/kwin-styles/glow/themes/glass_huge/iconify.png
new file mode 100644
index 00000000..b3219692
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/iconify.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/iconify_glow.png b/kwin-styles/glow/themes/glass_huge/iconify_glow.png
new file mode 100644
index 00000000..a5950bcc
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/iconify_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/maximizeoff.png b/kwin-styles/glow/themes/glass_huge/maximizeoff.png
new file mode 100644
index 00000000..b6ca8c0b
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/maximizeoff.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/maximizeoff_glow.png b/kwin-styles/glow/themes/glass_huge/maximizeoff_glow.png
new file mode 100644
index 00000000..deb8b29f
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/maximizeoff_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/maximizeon.png b/kwin-styles/glow/themes/glass_huge/maximizeon.png
new file mode 100644
index 00000000..bcccef1f
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/maximizeon.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/maximizeon_glow.png b/kwin-styles/glow/themes/glass_huge/maximizeon_glow.png
new file mode 100644
index 00000000..410296b1
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/maximizeon_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/stickyoff.png b/kwin-styles/glow/themes/glass_huge/stickyoff.png
new file mode 100644
index 00000000..db79fec8
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/stickyoff.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/stickyoff_glow.png b/kwin-styles/glow/themes/glass_huge/stickyoff_glow.png
new file mode 100644
index 00000000..ff8377b1
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/stickyoff_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/stickyon.png b/kwin-styles/glow/themes/glass_huge/stickyon.png
new file mode 100644
index 00000000..c6b1f6bc
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/stickyon.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_huge/stickyon_glow.png b/kwin-styles/glow/themes/glass_huge/stickyon_glow.png
new file mode 100644
index 00000000..46d8470b
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_huge/stickyon_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/Makefile.am b/kwin-styles/glow/themes/glass_large/Makefile.am
new file mode 100644
index 00000000..b884ff55
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/Makefile.am
@@ -0,0 +1,17 @@
+linkdir = $(kde_datadir)/kwin/glow-themes/glass_large
+link_DATA = \
+background.png \
+help.png help_glow.png \
+close.png close_glow.png \
+iconify.png iconify_glow.png \
+maximizeoff.png maximizeoff_glow.png \
+maximizeon.png maximizeon_glow.png \
+stickyon.png stickyon_glow.png \
+stickyoff.png stickyoff_glow.png \
+glass_large.theme
+
+EXTRA_DIST = $(link_DATA)
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/glow/themes/glass_large/background.png b/kwin-styles/glow/themes/glass_large/background.png
new file mode 100644
index 00000000..860e346f
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/background.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/close.png b/kwin-styles/glow/themes/glass_large/close.png
new file mode 100644
index 00000000..4e180281
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/close.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/close_glow.png b/kwin-styles/glow/themes/glass_large/close_glow.png
new file mode 100644
index 00000000..59976dd3
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/close_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/glass_large.theme b/kwin-styles/glow/themes/glass_large/glass_large.theme
new file mode 100644
index 00000000..1fdf6832
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/glass_large.theme
@@ -0,0 +1,19 @@
+buttonSize=23,23
+
+backgroundPixmap=background.png
+
+stickyOnPixmap=stickyon.png
+stickyOffPixmap=stickyoff.png
+maximizeOnPixmap=maximizeon.png
+maximizeOffPixmap=maximizeoff.png
+helpPixmap=help.png
+closePixmap=close.png
+iconifyPixmap=iconify.png
+
+stickyOnGlowPixmap=stickyon_glow.png
+stickyOffGlowPixmap=stickyoff_glow.png
+maximizeOnGlowPixmap=maximizeon_glow.png
+maximizeOffGlowPixmap=maximizeoff_glow.png
+helpGlowPixmap=help_glow.png
+closeGlowPixmap=close_glow.png
+iconifyGlowPixmap=iconify_glow.png
diff --git a/kwin-styles/glow/themes/glass_large/help.png b/kwin-styles/glow/themes/glass_large/help.png
new file mode 100644
index 00000000..464a7d49
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/help.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/help_glow.png b/kwin-styles/glow/themes/glass_large/help_glow.png
new file mode 100644
index 00000000..21e94cd0
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/help_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/iconify.png b/kwin-styles/glow/themes/glass_large/iconify.png
new file mode 100644
index 00000000..c148f4bb
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/iconify.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/iconify_glow.png b/kwin-styles/glow/themes/glass_large/iconify_glow.png
new file mode 100644
index 00000000..9daa831b
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/iconify_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/maximizeoff.png b/kwin-styles/glow/themes/glass_large/maximizeoff.png
new file mode 100644
index 00000000..40580530
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/maximizeoff.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/maximizeoff_glow.png b/kwin-styles/glow/themes/glass_large/maximizeoff_glow.png
new file mode 100644
index 00000000..164aadbf
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/maximizeoff_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/maximizeon.png b/kwin-styles/glow/themes/glass_large/maximizeon.png
new file mode 100644
index 00000000..34e9425a
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/maximizeon.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/maximizeon_glow.png b/kwin-styles/glow/themes/glass_large/maximizeon_glow.png
new file mode 100644
index 00000000..6038c045
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/maximizeon_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/stickyoff.png b/kwin-styles/glow/themes/glass_large/stickyoff.png
new file mode 100644
index 00000000..a29cde1a
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/stickyoff.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/stickyoff_glow.png b/kwin-styles/glow/themes/glass_large/stickyoff_glow.png
new file mode 100644
index 00000000..76c4781e
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/stickyoff_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/stickyon.png b/kwin-styles/glow/themes/glass_large/stickyon.png
new file mode 100644
index 00000000..c805faf4
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/stickyon.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_large/stickyon_glow.png b/kwin-styles/glow/themes/glass_large/stickyon_glow.png
new file mode 100644
index 00000000..7a6b9ec4
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_large/stickyon_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/Makefile.am b/kwin-styles/glow/themes/glass_verylarge/Makefile.am
new file mode 100644
index 00000000..f6a5582c
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/Makefile.am
@@ -0,0 +1,17 @@
+linkdir = $(kde_datadir)/kwin/glow-themes/glass_verylarge
+link_DATA = \
+background.png \
+help.png help_glow.png \
+close.png close_glow.png \
+iconify.png iconify_glow.png \
+maximizeoff.png maximizeoff_glow.png \
+maximizeon.png maximizeon_glow.png \
+stickyon.png stickyon_glow.png \
+stickyoff.png stickyoff_glow.png \
+glass_verylarge.theme
+
+EXTRA_DIST = $(link_DATA)
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/glow/themes/glass_verylarge/background.png b/kwin-styles/glow/themes/glass_verylarge/background.png
new file mode 100644
index 00000000..ed032232
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/background.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/close.png b/kwin-styles/glow/themes/glass_verylarge/close.png
new file mode 100644
index 00000000..15dc4b50
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/close.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/close_glow.png b/kwin-styles/glow/themes/glass_verylarge/close_glow.png
new file mode 100644
index 00000000..9207e37e
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/close_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/glass_verylarge.theme b/kwin-styles/glow/themes/glass_verylarge/glass_verylarge.theme
new file mode 100644
index 00000000..36368a8d
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/glass_verylarge.theme
@@ -0,0 +1,19 @@
+buttonSize=30,30
+
+backgroundPixmap=background.png
+
+stickyOnPixmap=stickyon.png
+stickyOffPixmap=stickyoff.png
+maximizeOnPixmap=maximizeon.png
+maximizeOffPixmap=maximizeoff.png
+helpPixmap=help.png
+closePixmap=close.png
+iconifyPixmap=iconify.png
+
+stickyOnGlowPixmap=stickyon_glow.png
+stickyOffGlowPixmap=stickyoff_glow.png
+maximizeOnGlowPixmap=maximizeon_glow.png
+maximizeOffGlowPixmap=maximizeoff_glow.png
+helpGlowPixmap=help_glow.png
+closeGlowPixmap=close_glow.png
+iconifyGlowPixmap=iconify_glow.png
diff --git a/kwin-styles/glow/themes/glass_verylarge/help.png b/kwin-styles/glow/themes/glass_verylarge/help.png
new file mode 100644
index 00000000..3a2d0c9d
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/help.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/help_glow.png b/kwin-styles/glow/themes/glass_verylarge/help_glow.png
new file mode 100644
index 00000000..29e6edf9
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/help_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/iconify.png b/kwin-styles/glow/themes/glass_verylarge/iconify.png
new file mode 100644
index 00000000..2d760e3d
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/iconify.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/iconify_glow.png b/kwin-styles/glow/themes/glass_verylarge/iconify_glow.png
new file mode 100644
index 00000000..01f474e5
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/iconify_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/maximizeoff.png b/kwin-styles/glow/themes/glass_verylarge/maximizeoff.png
new file mode 100644
index 00000000..4224aa05
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/maximizeoff.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/maximizeoff_glow.png b/kwin-styles/glow/themes/glass_verylarge/maximizeoff_glow.png
new file mode 100644
index 00000000..9327994a
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/maximizeoff_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/maximizeon.png b/kwin-styles/glow/themes/glass_verylarge/maximizeon.png
new file mode 100644
index 00000000..2d90482f
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/maximizeon.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/maximizeon_glow.png b/kwin-styles/glow/themes/glass_verylarge/maximizeon_glow.png
new file mode 100644
index 00000000..3b9a6bf4
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/maximizeon_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/stickyoff.png b/kwin-styles/glow/themes/glass_verylarge/stickyoff.png
new file mode 100644
index 00000000..a2c26583
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/stickyoff.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/stickyoff_glow.png b/kwin-styles/glow/themes/glass_verylarge/stickyoff_glow.png
new file mode 100644
index 00000000..c6e57e21
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/stickyoff_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/stickyon.png b/kwin-styles/glow/themes/glass_verylarge/stickyon.png
new file mode 100644
index 00000000..56cde081
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/stickyon.png
Binary files differ
diff --git a/kwin-styles/glow/themes/glass_verylarge/stickyon_glow.png b/kwin-styles/glow/themes/glass_verylarge/stickyon_glow.png
new file mode 100644
index 00000000..f3778479
--- /dev/null
+++ b/kwin-styles/glow/themes/glass_verylarge/stickyon_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/Makefile.am b/kwin-styles/glow/themes/square/Makefile.am
new file mode 100644
index 00000000..bcb698b0
--- /dev/null
+++ b/kwin-styles/glow/themes/square/Makefile.am
@@ -0,0 +1,17 @@
+linkdir = $(kde_datadir)/kwin/glow-themes/square
+link_DATA = \
+background.png \
+help.png help_glow.png \
+close.png close_glow.png \
+iconify.png iconify_glow.png \
+maximizeoff.png maximizeoff_glow.png \
+maximizeon.png maximizeon_glow.png \
+stickyon.png stickyon_glow.png \
+stickyoff.png stickyoff_glow.png \
+square.theme
+
+EXTRA_DIST = $(link_DATA)
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/glow/themes/square/background.png b/kwin-styles/glow/themes/square/background.png
new file mode 100644
index 00000000..225af3a5
--- /dev/null
+++ b/kwin-styles/glow/themes/square/background.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/close.png b/kwin-styles/glow/themes/square/close.png
new file mode 100644
index 00000000..898a368a
--- /dev/null
+++ b/kwin-styles/glow/themes/square/close.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/close_glow.png b/kwin-styles/glow/themes/square/close_glow.png
new file mode 100644
index 00000000..4cd1f1cb
--- /dev/null
+++ b/kwin-styles/glow/themes/square/close_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/help.png b/kwin-styles/glow/themes/square/help.png
new file mode 100644
index 00000000..c3ed65ee
--- /dev/null
+++ b/kwin-styles/glow/themes/square/help.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/help_glow.png b/kwin-styles/glow/themes/square/help_glow.png
new file mode 100644
index 00000000..4cd1f1cb
--- /dev/null
+++ b/kwin-styles/glow/themes/square/help_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/iconify.png b/kwin-styles/glow/themes/square/iconify.png
new file mode 100644
index 00000000..94fc6338
--- /dev/null
+++ b/kwin-styles/glow/themes/square/iconify.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/iconify_glow.png b/kwin-styles/glow/themes/square/iconify_glow.png
new file mode 100644
index 00000000..4cd1f1cb
--- /dev/null
+++ b/kwin-styles/glow/themes/square/iconify_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/maximizeoff.png b/kwin-styles/glow/themes/square/maximizeoff.png
new file mode 100644
index 00000000..e60cdc97
--- /dev/null
+++ b/kwin-styles/glow/themes/square/maximizeoff.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/maximizeoff_glow.png b/kwin-styles/glow/themes/square/maximizeoff_glow.png
new file mode 100644
index 00000000..4cd1f1cb
--- /dev/null
+++ b/kwin-styles/glow/themes/square/maximizeoff_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/maximizeon.png b/kwin-styles/glow/themes/square/maximizeon.png
new file mode 100644
index 00000000..3976411f
--- /dev/null
+++ b/kwin-styles/glow/themes/square/maximizeon.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/maximizeon_glow.png b/kwin-styles/glow/themes/square/maximizeon_glow.png
new file mode 100644
index 00000000..4cd1f1cb
--- /dev/null
+++ b/kwin-styles/glow/themes/square/maximizeon_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/square.theme b/kwin-styles/glow/themes/square/square.theme
new file mode 100644
index 00000000..26f00feb
--- /dev/null
+++ b/kwin-styles/glow/themes/square/square.theme
@@ -0,0 +1,19 @@
+buttonSize=17,17
+
+backgroundPixmap=background.png
+
+stickyOnPixmap=stickyon.png
+stickyOffPixmap=stickyoff.png
+maximizeOnPixmap=maximizeon.png
+maximizeOffPixmap=maximizeoff.png
+helpPixmap=help.png
+closePixmap=close.png
+iconifyPixmap=iconify.png
+
+stickyOnGlowPixmap=stickyon_glow.png
+stickyOffGlowPixmap=stickyoff_glow.png
+maximizeOnGlowPixmap=maximizeon_glow.png
+maximizeOffGlowPixmap=maximizeoff_glow.png
+helpGlowPixmap=help_glow.png
+closeGlowPixmap=close_glow.png
+iconifyGlowPixmap=iconify_glow.png
diff --git a/kwin-styles/glow/themes/square/stickyoff.png b/kwin-styles/glow/themes/square/stickyoff.png
new file mode 100644
index 00000000..3600e326
--- /dev/null
+++ b/kwin-styles/glow/themes/square/stickyoff.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/stickyoff_glow.png b/kwin-styles/glow/themes/square/stickyoff_glow.png
new file mode 100644
index 00000000..4cd1f1cb
--- /dev/null
+++ b/kwin-styles/glow/themes/square/stickyoff_glow.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/stickyon.png b/kwin-styles/glow/themes/square/stickyon.png
new file mode 100644
index 00000000..a84941a3
--- /dev/null
+++ b/kwin-styles/glow/themes/square/stickyon.png
Binary files differ
diff --git a/kwin-styles/glow/themes/square/stickyon_glow.png b/kwin-styles/glow/themes/square/stickyon_glow.png
new file mode 100644
index 00000000..4cd1f1cb
--- /dev/null
+++ b/kwin-styles/glow/themes/square/stickyon_glow.png
Binary files differ
diff --git a/kwin-styles/icewm/Makefile.am b/kwin-styles/icewm/Makefile.am
new file mode 100644
index 00000000..1bdcda43
--- /dev/null
+++ b/kwin-styles/icewm/Makefile.am
@@ -0,0 +1,21 @@
+INCLUDES = $(all_includes)
+
+SUBDIRS = . config icewm-themes
+
+kde_module_LTLIBRARIES = kwin3_icewm.la
+
+kwin3_icewm_la_SOURCES = icewm.cpp
+kwin3_icewm_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwin3_icewm_la_LIBADD = $(LIB_KDEUI) -lkdecorations
+
+METASOURCES = AUTO
+noinst_HEADERS = icewm.h
+
+lnkdir = $(kde_datadir)/kwin/
+lnk_DATA = icewm.desktop
+
+EXTRA_DIST = $(lnk_DATA)
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/icewm/config/Makefile.am b/kwin-styles/icewm/config/Makefile.am
new file mode 100644
index 00000000..7c2b82e5
--- /dev/null
+++ b/kwin-styles/icewm/config/Makefile.am
@@ -0,0 +1,16 @@
+INCLUDES = $(all_includes)
+
+kde_module_LTLIBRARIES = kwin_icewm_config.la
+
+kwin_icewm_config_la_SOURCES = config.cpp
+kwin_icewm_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwin_icewm_config_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO)
+
+METASOURCES = AUTO
+noinst_HEADERS = config.h
+
+lnkdir = $(kde_datadir)/kwin/
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/icewm/config/config.cpp b/kwin-styles/icewm/config/config.cpp
new file mode 100644
index 00000000..7cae598e
--- /dev/null
+++ b/kwin-styles/icewm/config/config.cpp
@@ -0,0 +1,271 @@
+/*
+ * $Id$
+ *
+ * This file contains the IceWM configuration widget
+ *
+ * Copyright (c) 2001
+ * Karol Szwed <gallium@kde.org>
+ * http://gallium.n3.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 the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include <qdir.h>
+#include <qregexp.h>
+#include <qvbox.h>
+#include <qwhatsthis.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+#include <kdialog.h>
+#include <kdirwatch.h>
+#include <kapplication.h>
+
+
+extern "C"
+{
+ KDE_EXPORT QObject* allocate_config( KConfig* conf, QWidget* parent )
+ {
+ return(new IceWMConfig(conf, parent));
+ }
+}
+
+
+// NOTE:
+// ==========================================================================
+// 'conf' is a pointer to the kwindecoration modules open kwin config,
+// and is by default set to the "Style" group.
+//
+// 'parent' is the parent of the QObject, which is a VBox inside the
+// Configure tab in kwindecoration
+// ==========================================================================
+
+IceWMConfig::IceWMConfig( KConfig* conf, QWidget* parent )
+ : QObject( parent )
+{
+ icewmConfig = new KConfig("kwinicewmrc");
+ KGlobal::locale()->insertCatalogue("kwin_art_clients");
+
+ mainWidget = new QVBox( parent );
+ mainWidget->setSpacing( KDialog::spacingHint() );
+
+ themeListBox = new QListBox( mainWidget );
+ QWhatsThis::add( themeListBox,
+ i18n("Make your IceWM selection by clicking on a theme here. ") );
+
+ cbThemeTitleTextColors = new QCheckBox(
+ i18n("Use theme &title text colors"), mainWidget );
+
+ QWhatsThis::add( cbThemeTitleTextColors,
+ i18n("When selected, titlebar colors will follow those set "
+ "in the IceWM theme. If not selected, the current KDE "
+ "titlebar colors will be used instead.") );
+
+ cbTitleBarOnTop = new QCheckBox(
+ i18n("&Show title bar on top of windows"), mainWidget );
+
+ QWhatsThis::add( cbTitleBarOnTop,
+ i18n("When selected, all window titlebars will be shown "
+ "at the top of each window, otherwise they will be "
+ "shown at the bottom.") );
+
+ cbShowMenuButtonIcon = new QCheckBox(
+ i18n("&Menu button always shows application mini icon"), mainWidget );
+
+ QWhatsThis::add( cbShowMenuButtonIcon,
+ i18n("When selected, all titlebar menu buttons will have "
+ "the application icon shown. If not selected, the current "
+ "theme's defaults are used instead.") );
+
+ urlLabel = new KURLLabel( mainWidget );
+ urlLabel->setText( i18n("Open KDE's IceWM theme folder") );
+
+ themeLabel = new QLabel(
+ i18n("Clicking on the link above will cause a window to appear "
+ "showing the KDE IceWM theme folder. You can "
+ "add or remove native IceWM themes by "
+ "uncompressing <b>http://icewm.themes.org/</b> theme files "
+ "into this folder, or by creating folder symlinks to "
+ "existing IceWM themes on your system."), mainWidget );
+
+ // Load configuration options
+ load( conf );
+
+ // Ensure we track user changes properly
+ connect( themeListBox, SIGNAL(selectionChanged()),
+ this, SLOT(slotSelectionChanged()) );
+
+ connect( urlLabel, SIGNAL(leftClickedURL(const QString&)),
+ this, SLOT(callURL(const QString&)));
+
+ connect( cbThemeTitleTextColors, SIGNAL(clicked()),
+ this, SLOT(slotSelectionChanged()) );
+
+ connect( cbTitleBarOnTop, SIGNAL(clicked()),
+ this, SLOT(slotSelectionChanged()) );
+
+ connect( cbShowMenuButtonIcon, SIGNAL(clicked()),
+ this, SLOT(slotSelectionChanged()) );
+
+ // Create the theme directory (if not found) ... and obtain the path as we do so.
+ localThemeString = KGlobal::dirs()->saveLocation("data", "kwin");
+ localThemeString += "/icewm-themes";
+ if (!QFile::exists(localThemeString))
+ QDir().mkdir(localThemeString);
+
+ // Watch the icewm theme directory for theme additions/removals
+ KDirWatch::self()->addDir(localThemeString);
+ connect( KDirWatch::self(), SIGNAL(dirty(const QString&)), this, SLOT(findIceWMThemes()) );
+ connect( KDirWatch::self(), SIGNAL(created(const QString&)), this, SLOT(findIceWMThemes()) );
+ connect( KDirWatch::self(), SIGNAL(deleted(const QString&)), this, SLOT(findIceWMThemes()) );
+
+ // Set the konqui link url
+ QString urlThemeString = QString("file://") + localThemeString;
+ urlThemeString.replace( QRegExp("~"), "$HOME" );
+ urlLabel->setURL( urlThemeString );
+
+ // Make the widgets visible in kwindecoration
+ mainWidget->show();
+
+ KDirWatch::self()->startScan();
+}
+
+
+IceWMConfig::~IceWMConfig()
+{
+ KDirWatch::self()->removeDir(localThemeString);
+ KDirWatch::self()->stopScan();
+ delete icewmConfig;
+ delete mainWidget;
+}
+
+
+// Searches for all installed IceWM themes, and adds them to the listBox.
+void IceWMConfig::findIceWMThemes()
+{
+ QStringList dirList = KGlobal::dirs()->findDirs("data", "kwin/icewm-themes");
+ QStringList::ConstIterator it;
+
+ // Remove any old themes in the list (if any)
+ themeListBox->clear();
+ themeListBox->insertItem( i18n("Infadel #2 (default)") );
+
+ // Step through all kwin/icewm-themes directories...
+ for( it = dirList.begin(); it != dirList.end(); it++)
+ {
+ // List all directory names only...
+ QDir d(*it, QString("*"), QDir::Unsorted, QDir::Dirs | QDir::Readable );
+ if (d.exists())
+ {
+ QFileInfoListIterator it2( *d.entryInfoList() );
+ QFileInfo* finfo;
+
+ // Step through all directories within the kwin/icewm-themes directory
+ while( (finfo = it2.current()) )
+ {
+ // Ignore . and .. directories
+ if ( (finfo->fileName() == ".") || (finfo->fileName() == "..") )
+ {
+ ++it2;
+ continue;
+ }
+
+ if ( !themeListBox->findItem( finfo->fileName()) )
+ themeListBox->insertItem( finfo->fileName() );
+
+ ++it2;
+ }
+ }
+ }
+
+ // Sort the items
+ themeListBox->sort();
+
+ // Select the currently used IceWM theme
+ QString themeName = icewmConfig->readEntry("CurrentTheme");
+
+ // Provide a theme alias
+ if (themeName == "default")
+ themeName = "";
+
+ if (themeName.isEmpty())
+ themeListBox->setCurrentItem(
+ themeListBox->findItem( i18n("Infadel #2 (default)") ) );
+ else
+ themeListBox->setCurrentItem( themeListBox->findItem(themeName) );
+}
+
+
+void IceWMConfig::callURL( const QString& s )
+{
+ kapp->invokeBrowser( s );
+}
+
+
+void IceWMConfig::slotSelectionChanged()
+{
+ emit changed();
+}
+
+
+// Loads the configurable options from the kwinicewmrc config file
+void IceWMConfig::load( KConfig* )
+{
+ icewmConfig->setGroup("General");
+
+ bool override = icewmConfig->readBoolEntry( "ThemeTitleTextColors", true );
+ cbThemeTitleTextColors->setChecked( override );
+
+ override = icewmConfig->readBoolEntry( "TitleBarOnTop", true );
+ cbTitleBarOnTop->setChecked( override );
+
+ override = icewmConfig->readBoolEntry( "ShowMenuButtonIcon", false );
+ cbShowMenuButtonIcon->setChecked( override );
+
+ findIceWMThemes();
+}
+
+
+// Saves the configurable options to the kwinicewmrc config file
+void IceWMConfig::save( KConfig* )
+{
+ icewmConfig->setGroup("General");
+ icewmConfig->writeEntry( "ThemeTitleTextColors", cbThemeTitleTextColors->isChecked() );
+ icewmConfig->writeEntry( "TitleBarOnTop", cbTitleBarOnTop->isChecked() );
+ icewmConfig->writeEntry( "ShowMenuButtonIcon", cbShowMenuButtonIcon->isChecked() );
+
+ if (themeListBox->currentText() == i18n("Infadel #2 (default)"))
+ icewmConfig->writeEntry("CurrentTheme", "default");
+ else
+ icewmConfig->writeEntry("CurrentTheme", themeListBox->currentText() );
+
+ icewmConfig->sync();
+}
+
+
+// Sets UI widget defaults which must correspond to config defaults
+void IceWMConfig::defaults()
+{
+ cbThemeTitleTextColors->setChecked( true );
+ cbTitleBarOnTop->setChecked( true );
+ cbShowMenuButtonIcon->setChecked( false );
+ themeListBox->setCurrentItem( themeListBox->findItem(i18n("Infadel #2 (default)")) );
+}
+
+#include "config.moc"
+// vim: ts=4
diff --git a/kwin-styles/icewm/config/config.h b/kwin-styles/icewm/config/config.h
new file mode 100644
index 00000000..e156137e
--- /dev/null
+++ b/kwin-styles/icewm/config/config.h
@@ -0,0 +1,76 @@
+/*
+ * $Id$
+ *
+ * This file contains the IceWM configuration widget
+ *
+ * Copyright (c) 2001
+ * Karol Szwed <gallium@kde.org>
+ * http://gallium.n3.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 the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef _ICEWMCONFIG_H
+#define _ICEWMCONFIG_H
+
+#include <qwidget.h>
+#include <qcheckbox.h>
+#include <qgroupbox.h>
+#include <qlistbox.h>
+#include <qlabel.h>
+#include <kurllabel.h>
+#include <kconfig.h>
+
+class QVBox;
+
+class IceWMConfig: public QObject
+{
+ Q_OBJECT
+
+ public:
+ IceWMConfig( KConfig* conf, QWidget* parent );
+ ~IceWMConfig();
+
+ // These public signals/slots work similar to KCM modules
+ signals:
+ void changed();
+
+ public slots:
+ void load( KConfig* conf );
+ void save( KConfig* conf );
+ void defaults();
+
+ protected slots:
+ void slotSelectionChanged(); // Internal use
+ void callURL( const QString& s );
+ void findIceWMThemes();
+
+ private:
+ KConfig* icewmConfig;
+ QCheckBox* cbThemeTitleTextColors;
+ QCheckBox* cbTitleBarOnTop;
+ QCheckBox* cbShowMenuButtonIcon;
+ QListBox* themeListBox;
+ QLabel* themeLabel;
+ KURLLabel* urlLabel;
+ QString localThemeString;
+ QVBox* mainWidget;
+};
+
+
+#endif
+// vim: ts=4
diff --git a/kwin-styles/icewm/icewm-themes/Makefile.am b/kwin-styles/icewm/icewm-themes/Makefile.am
new file mode 100644
index 00000000..40290635
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/Makefile.am
@@ -0,0 +1,12 @@
+pics_DATA = titleAB.xpm titleAJ.xpm titleAM.xpm titleAP.xpm titleAQ.xpm \
+ titleAR.xpm titleAS.xpm titleAT.xpm titleIB.xpm titleIJ.xpm \
+ titleIM.xpm titleIQ.xpm titleIR.xpm titleIS.xpm titleIT.xpm \
+ titleIP.xpm closeA.xpm closeI.xpm depthA.xpm depthI.xpm \
+ maximizeA.xpm maximizeI.xpm menuButtonA.xpm menuButtonI.xpm \
+ minimizeA.xpm minimizeI.xpm restoreA.xpm restoreI.xpm \
+ rolldownA.xpm rolldownI.xpm rollupA.xpm rollupI.xpm \
+ default.theme
+
+picsdir = $(kde_datadir)/kwin/icewm-themes
+
+
diff --git a/kwin-styles/icewm/icewm-themes/closeA.xpm b/kwin-styles/icewm/icewm-themes/closeA.xpm
new file mode 100644
index 00000000..cc202bcd
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/closeA.xpm
@@ -0,0 +1,69 @@
+/* XPM */
+static char * closeA_xpm[] = {
+"15 34 32 1",
+" c None",
+". c #858686",
+"+ c #9A9A9A",
+"@ c #AEAEAE",
+"# c #5D5D5E",
+"$ c #111214",
+"% c #040404",
+"& c #C2C2C2",
+"* c #181C22",
+"= c #2D333D",
+"- c #56657A",
+"; c #58667E",
+"> c #5D6E86",
+", c #D6D6D6",
+"' c #1D2632",
+") c #4A4A4A",
+"! c #6E809C",
+"~ c #EAEAEA",
+"{ c #717273",
+"] c #232D3A",
+"^ c #4D5868",
+"/ c #798EAA",
+"( c #7E96B6",
+"_ c #C7CDD4",
+": c #FEFEFE",
+"< c #8CA3C5",
+"[ c #435165",
+"} c #3C4553",
+"| c #323F4F",
+"1 c #0D0E13",
+"2 c #363636",
+"3 c #677B98",
+"...............",
+"+++++++++++++++",
+"@@@@#$%%%$#@@@@",
+"&&&*=-;>;-=*&&&",
+",,')->!!!>;)',,",
+"~{]^>!/(/_>^]{~",
+":*)^>!(<'!_^[*:",
+"~%}^>!/*/_>^}%~",
+",%}[->*!,>;^}%,",
+"&%|[^$>_>;^}=%&",
+"@$]|1[&^^^}|]$@",
+"+)$]|&}[)||=$)+",
+"..**']=|=]]**..",
+"{{{$1*'''*1${{{",
+"####=%%%%1=####",
+")))))))))))))))",
+"2222222=2222222",
+"...............",
+"+++++++++++++++",
+"@@@@)1%%%$)@@@@",
+"&&&*'})[)}]*&&&",
+",,*=)[^-^^}2*,,",
+"~{'}[^;>;-[}'{~",
+":$=}[^>31+[|=*:",
+"~%=}[^;$;^+|=%~",
+",%]|}^1-^+}|]%,",
+"&%'2|1[[/)|2'%&",
+"@1']%|}.}|2]'1@",
+"+)1']=.==]]'1)+",
+"..$$*.]]''*$1..",
+"{{{11$***$1${{{",
+"####]%%%%%]####",
+")))))))))))))))",
+"222222222222222"};
diff --git a/kwin-styles/icewm/icewm-themes/closeI.xpm b/kwin-styles/icewm/icewm-themes/closeI.xpm
new file mode 100644
index 00000000..4529b06f
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/closeI.xpm
@@ -0,0 +1,69 @@
+/* XPM */
+static char * closeI_xpm[] = {
+"15 34 32 1",
+" g None",
+". g #858585",
+"+ g #9A9A9A",
+"@ g #AEAEAE",
+"# g #5D5D5D",
+"$ g #111111",
+"% g #040404",
+"& g #C2C2C2",
+"* g #1B1B1B",
+"= g #323232",
+"- g #626262",
+"; g #646464",
+"> g #6B6B6B",
+", g #D6D6D6",
+"' g #242424",
+") g #4A4A4A",
+"! g #7D7D7D",
+"~ g #EAEAEA",
+"{ g #717171",
+"] g #2B2B2B",
+"^ g #565656",
+"/ g #8A8A8A",
+"( g #929292",
+"_ g #CBCBCB",
+": g #FEFEFE",
+"< g #9F9F9F",
+"[ g #4F4F4F",
+"} g #434343",
+"| g #3C3C3C",
+"1 g #0E0E0E",
+"2 g #363636",
+"3 g #787878",
+"...............",
+"+++++++++++++++",
+"@@@@#$%%%$#@@@@",
+"&&&*=-;>;-=*&&&",
+",,')->!!!>;)',,",
+"~{]^>!/(/_>^]{~",
+":*)^>!(<'!_^[*:",
+"~%}^>!/*/_>^}%~",
+",%}[->*!,>;^}%,",
+"&%|[^$>_>;^}=%&",
+"@$]|1[&^^^}|]$@",
+"+)$]|&}[)||=$)+",
+"..**']=|=]]**..",
+"{{{$1*'''*1${{{",
+"####=%%%%1=####",
+")))))))))))))))",
+"2222222=2222222",
+"...............",
+"+++++++++++++++",
+"@@@@)1%%%$)@@@@",
+"&&&*'})[)}]*&&&",
+",,*=)[^-^^}2*,,",
+"~{'}[^;>;-[}'{~",
+":$=}[^>31+[|=*:",
+"~%=}[^;$;^+|=%~",
+",%]|}^1-^+}|]%,",
+"&%'2|1[[/)|2'%&",
+"@1']%|}.}|2]'1@",
+"+)1']=.==]]'1)+",
+"..$$*.]]''*$1..",
+"{{{11$***$1${{{",
+"####]%%%%%]####",
+")))))))))))))))",
+"222222222222222"};
diff --git a/kwin-styles/icewm/icewm-themes/default.theme b/kwin-styles/icewm/icewm-themes/default.theme
new file mode 100644
index 00000000..5c76117b
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/default.theme
@@ -0,0 +1,48 @@
+# Xerithane:
+#
+# Well, Artwiz inspired me (dirty lil blackbox user <g>)
+# So, I ripped his font (snap.pcf), and then got the chrome style idea and
+# adapted the theme as a rip of the e.t.o page (get it, Infadel..)
+# Some of the borrowed style is from Area 51 (by RudeSka, herald of #icewm)
+# Also borrowed are some icons from Area 51.
+#
+# tbf:
+#
+# Extended Artwiz's snap font, added cursors, polished the applets.
+# Invented depth, hide, rollup and rolldown buttons. Redraw the others.
+# Reduced number of colors.
+
+# closeI.xpm depthI.xpm maximizeI.xpm minimizeI.xpm restoreI.xpm hideI.xpm
+# rollupI.xpm rolldownI.xpm menuButtonI.xpm
+# closeA.xpm depthA.xpm maximizeA.xpm minimizeA.xpm restoreA.xpm hideA.xpm
+# rollupA.xpm rolldownA.xpm menuButtonA.xpm
+
+# PLEASE NOTE:
+# ============
+# Heavily modified by gallium for the purposes of kwin-icewm.
+# Please do not use this for icewm. Use the original icewm Infadel #2 instead.
+# The full Infadel #2 theme will still work with kwin-icewm as well, but
+# this trimmed version is included here for space reasons.
+
+ThemeDescription="Infadel/1.0.7(kwin)"
+ThemeAuthor="xerithane@nerdfarm.org"
+Look=pixmap
+
+TitleButtonsLeft="s"
+TitleButtonsRight="xmi"
+TitleButtonsSupported="sxmihrd"
+TitleBarCentered=1
+TitleBarHeight=17
+
+# Modified border sizes so they're more user "grip" friendly
+BorderSizeX=3
+BorderSizeY=3
+CornerSizeX=28
+CornerSizeY=28
+
+ColorNormalTitleBarText="#c0c0c0"
+ColorActiveTitleBarText="#ffffff"
+ColorActiveBorder="#868687"
+ColorNormalBorder="#575757"
+
+ShowMenuButtonIcon=0
diff --git a/kwin-styles/icewm/icewm-themes/depthA.xpm b/kwin-styles/icewm/icewm-themes/depthA.xpm
new file mode 100644
index 00000000..67a2e1e6
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/depthA.xpm
@@ -0,0 +1,69 @@
+/* XPM */
+static char * depthA_xpm[] = {
+"15 34 32 1",
+" c None",
+". c #858686",
+"+ c #9A9A9A",
+"@ c #AEAEAE",
+"# c #363636",
+"$ c #0D0E13",
+"% c #040404",
+"& c #C2C2C2",
+"* c #4A4A4A",
+"= c #2D333D",
+"- c #56657A",
+"; c #5D6E86",
+"> c #D6D6D6",
+", c #4D5868",
+"' c #677B98",
+") c #6E809C",
+"! c #58667E",
+"~ c #EAEAEA",
+"{ c #232D3A",
+"] c #798EAA",
+"^ c #7E96B6",
+"/ c #FEFEFE",
+"( c #3C4553",
+"_ c #8CA3C5",
+": c #111214",
+"< c #323F4F",
+"[ c #435165",
+"} c #C7CDD4",
+"| c #717273",
+"1 c #181C22",
+"2 c #1D2632",
+"3 c #5D5D5E",
+"...............",
+"+++++++++++++++",
+"@@@@.#$%$#.@@@@",
+"&&&*=-;;;-=*&&&",
+">>,*-;')';!*,>>",
+"~@{,;)]^]);,{@~",
+"/*(-;)^_^);,(,/",
+"~:(,;)<(<);,*:~",
+">%([!=)))}![(%>",
+"&:=*[-}}&-,[=$&",
+"@#=<*[,-,[(<{#@",
+"+|:{<(((*(<=:|+",
+"..#1{=<==={1#..",
+"|||{$12221$=|||",
+"3333(1%%%1(3333",
+"***************",
+"###############",
+"...............",
+"+++++++++++++++",
+"@@@@|{$%%=|@@@@",
+"&&&(2**[[(2(&&&",
+">>*=([,3,,*#*>>",
+"~+1([3!;!,[(2+~",
+"/(#([,;'!-[(#(/",
+"~:=([,{={,[<=:~",
+">%{<(2,-,+(<=%>",
+"&$2#((^+.[<=2$&",
+"@=2{=#<<(<#{1=@",
+"+3$2{===={{2$!+",
+"..=:122{221:=..",
+"|||{%1111:$2|||",
+"3333#1%%%:*3333",
+"***************",
+"###############"};
diff --git a/kwin-styles/icewm/icewm-themes/depthI.xpm b/kwin-styles/icewm/icewm-themes/depthI.xpm
new file mode 100644
index 00000000..e4fe17a9
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/depthI.xpm
@@ -0,0 +1,69 @@
+/* XPM */
+static char * depthI_xpm[] = {
+"15 34 32 1",
+" g None",
+". g #858585",
+"+ g #9A9A9A",
+"@ g #AEAEAE",
+"# g #363636",
+"$ g #0E0E0E",
+"% g #040404",
+"& g #C2C2C2",
+"* g #4A4A4A",
+"= g #323232",
+"- g #626262",
+"; g #6B6B6B",
+"> g #D6D6D6",
+", g #565656",
+"' g #787878",
+") g #7D7D7D",
+"! g #646464",
+"~ g #EAEAEA",
+"{ g #2B2B2B",
+"] g #8A8A8A",
+"^ g #929292",
+"/ g #FEFEFE",
+"( g #434343",
+"_ g #9F9F9F",
+": g #111111",
+"< g #3C3C3C",
+"[ g #4F4F4F",
+"} g #CBCBCB",
+"| g #717171",
+"1 g #1B1B1B",
+"2 g #242424",
+"3 g #5D5D5D",
+"...............",
+"+++++++++++++++",
+"@@@@.#$%$#.@@@@",
+"&&&*=-;;;-=*&&&",
+">>,*-;')';!*,>>",
+"~@{,;)]^]);,{@~",
+"/*(-;)^_^);,(,/",
+"~:(,;)<(<);,*:~",
+">%([!=)))}![(%>",
+"&:=*[-}}&-,[=$&",
+"@#=<*[,-,[(<{#@",
+"+|:{<(((*(<=:|+",
+"..#1{=<==={1#..",
+"|||{$12221$=|||",
+"3333(1%%%1(3333",
+"***************",
+"###############",
+"...............",
+"+++++++++++++++",
+"@@@@|{$%%=|@@@@",
+"&&&(2**[[(2(&&&",
+">>*=([,3,,*#*>>",
+"~+1([3!;!,[(2+~",
+"/(#([,;'!-[(#(/",
+"~:=([,{={,[<=:~",
+">%{<(2,-,+(<=%>",
+"&$2#((^+.[<=2$&",
+"@=2{=#<<(<#{1=@",
+"+3$2{===={{2$!+",
+"..=:122{221:=..",
+"|||{%1111:$2|||",
+"3333#1%%%:*3333",
+"***************",
+"###############"};
diff --git a/kwin-styles/icewm/icewm-themes/maximizeA.xpm b/kwin-styles/icewm/icewm-themes/maximizeA.xpm
new file mode 100644
index 00000000..c34304dc
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/maximizeA.xpm
@@ -0,0 +1,68 @@
+/* XPM */
+static char * maximizeA_xpm[] = {
+"15 34 31 1",
+" c None",
+". c #858686",
+"+ c #9A9A9A",
+"@ c #AEAEAE",
+"# c #5D5D5E",
+"$ c #111214",
+"% c #040404",
+"& c #C2C2C2",
+"* c #181C22",
+"= c #2D333D",
+"- c #56657A",
+"; c #58667E",
+"> c #5D6E86",
+", c #D6D6D6",
+"' c #1D2632",
+") c #4A4A4A",
+"! c #6E809C",
+"~ c #EAEAEA",
+"{ c #717273",
+"] c #232D3A",
+"^ c #4D5868",
+"/ c #798EAA",
+"( c #7E96B6",
+"_ c #FEFEFE",
+": c #7A91B1",
+"< c #3C4553",
+"[ c #435165",
+"} c #C7CDD4",
+"| c #323F4F",
+"1 c #0D0E13",
+"2 c #363636",
+"...............",
+"+++++++++++++++",
+"@@@@#$%%%$#@@@@",
+"&&&*=-;>;-=*&&&",
+",,')->!!!>;)',,",
+"~{]^>!/(/!>^]{~",
+"_*)^>!(~:!>-)*_",
+"~%<^>!,@,!>^<%~",
+",%<[-}@@@};^|%,",
+"&%|[^%%%%%^<|%&",
+"@$]|<^^^^^<|]$@",
+"+)$]|<<[<<|]$)+",
+"..**'==|=]]**..",
+"{{{$1*'''*1${{{",
+"####=%%%%1=####",
+")))))))))))))))",
+"222222222222222",
+"...............",
+"+++++++++++++++",
+"@@@@)1%%%$)@@@@",
+"&&&*'<)[)['*}&&",
+",,*2<^^^^[<2*,,",
+"~{'<[^>>;-)<*{~",
+"_$=|[->+;-[<2*_",
+"~%=<[^+.+^[|=%~",
+",%]|<+.!!+<|]%,",
+"&%'=|%%%%%|2'%&",
+"@1']=||<||2]'1@",
+"+)1']==2=]]'1)+",
+"..$1*'''''*$1..",
+"{{{11$***$1${{{",
+"####]%%%%%]####",
+")))))))))))))))",
+"222222222222222"};
diff --git a/kwin-styles/icewm/icewm-themes/maximizeI.xpm b/kwin-styles/icewm/icewm-themes/maximizeI.xpm
new file mode 100644
index 00000000..d857672b
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/maximizeI.xpm
@@ -0,0 +1,68 @@
+/* XPM */
+static char * maximizeI_xpm[] = {
+"15 34 31 1",
+" g None",
+". g #858585",
+"+ g #9A9A9A",
+"@ g #AEAEAE",
+"# g #5D5D5D",
+"$ g #111111",
+"% g #040404",
+"& g #C2C2C2",
+"* g #1B1B1B",
+"= g #323232",
+"- g #626262",
+"; g #646464",
+"> g #6B6B6B",
+", g #D6D6D6",
+"' g #242424",
+") g #4A4A4A",
+"! g #7D7D7D",
+"~ g #EAEAEA",
+"{ g #717171",
+"] g #2B2B2B",
+"^ g #565656",
+"/ g #8A8A8A",
+"( g #929292",
+"_ g #FEFEFE",
+": g #8D8D8D",
+"< g #434343",
+"[ g #4F4F4F",
+"} g #CBCBCB",
+"| g #3C3C3C",
+"1 g #0E0E0E",
+"2 g #363636",
+"...............",
+"+++++++++++++++",
+"@@@@#$%%%$#@@@@",
+"&&&*=-;>;-=*&&&",
+",,')->!!!>;)',,",
+"~{]^>!/(/!>^]{~",
+"_*)^>!(~:!>-)*_",
+"~%<^>!,@,!>^<%~",
+",%<[-}@@@};^|%,",
+"&%|[^%%%%%^<|%&",
+"@$]|<^^^^^<|]$@",
+"+)$]|<<[<<|]$)+",
+"..**'==|=]]**..",
+"{{{$1*'''*1${{{",
+"####=%%%%1=####",
+")))))))))))))))",
+"222222222222222",
+"...............",
+"+++++++++++++++",
+"@@@@)1%%%$)@@@@",
+"&&&*'<)[)['*}&&",
+",,*2<^^^^[<2*,,",
+"~{'<[^>>;-)<*{~",
+"_$=|[->+;-[<2*_",
+"~%=<[^+.+^[|=%~",
+",%]|<+.!!+<|]%,",
+"&%'=|%%%%%|2'%&",
+"@1']=||<||2]'1@",
+"+)1']==2=]]'1)+",
+"..$1*'''''*$1..",
+"{{{11$***$1${{{",
+"####]%%%%%]####",
+")))))))))))))))",
+"222222222222222"};
diff --git a/kwin-styles/icewm/icewm-themes/menuButtonA.xpm b/kwin-styles/icewm/icewm-themes/menuButtonA.xpm
new file mode 100644
index 00000000..e4b5e0ed
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/menuButtonA.xpm
@@ -0,0 +1,68 @@
+/* XPM */
+static char * menuButtonA_xpm[] = {
+"17 34 31 1",
+" c None",
+". c #858686",
+"+ c #9A9A9A",
+"@ c #AEAEAE",
+"# c #363636",
+"$ c #0D0E13",
+"% c #040404",
+"& c #C2C2C2",
+"* c #4A4A4A",
+"= c #2D333D",
+"- c #56657A",
+"; c #5D6E86",
+"> c #D6D6D6",
+", c #4D5868",
+"' c #677B98",
+") c #6E809C",
+"! c #58667E",
+"~ c #EAEAEA",
+"{ c #232D3A",
+"] c #798EAA",
+"^ c #7E96B6",
+"/ c #FEFEFE",
+"( c #3C4553",
+"_ c #8CA3C5",
+": c #111214",
+"< c #435165",
+"[ c #323F4F",
+"} c #717273",
+"| c #181C22",
+"1 c #1D2632",
+"2 c #5D5D5E",
+".................",
+"+++++++++++++++++",
+"@@@@@.#$%$#.@@@@@",
+"&&&&*=-;;;-=*&&&&",
+">>>,*-;')';!*,>>>",
+"~~@{,;)]^]);,{@~~",
+"//*(-;)^_^);,(,//",
+"~~:(,;)]^]);,*:~~",
+">>%(<%%%%%%%<(%>>",
+"&&$=<@&&&&&@<=$&&",
+"@@#{[*<,,,,([=#@@",
+"++}|{[((<(([=:}++",
+"...#|{{=[={{|#...",
+"}}}}{$|111|$=}}}}",
+"22222(|%%$|(22222",
+"*****************",
+"#################",
+".................",
+"+++++++++++++++++",
+"@@@@@}{$%%=}@@@@@",
+"&&&&(1**<<(1(&&&&",
+">>>*=(<,-2<*#*>>>",
+"~~+|(<,-;-,<(1+~~",
+"//(#(<-;'!-<(#(//",
+"~~$=[*,!;-,<[=:~~",
+">>%{[%%%%%%%[{%>>",
+"&&$1#.]..]..#1$&&",
+"@@=1{=[((([#{1=@@",
+"++2$1{====={|$2++",
+"...{:|11{11|:=...",
+"}}}}{%:|||:$1}}}}",
+"22222(|%%%|(22222",
+"*****************",
+"#################"};
diff --git a/kwin-styles/icewm/icewm-themes/menuButtonI.xpm b/kwin-styles/icewm/icewm-themes/menuButtonI.xpm
new file mode 100644
index 00000000..854ea273
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/menuButtonI.xpm
@@ -0,0 +1,68 @@
+/* XPM */
+static char * menuButtonI_xpm[] = {
+"17 34 31 1",
+" g None",
+". g #858585",
+"+ g #9A9A9A",
+"@ g #AEAEAE",
+"# g #363636",
+"$ g #0E0E0E",
+"% g #040404",
+"& g #C2C2C2",
+"* g #4A4A4A",
+"= g #323232",
+"- g #626262",
+"; g #6B6B6B",
+"> g #D6D6D6",
+", g #565656",
+"' g #787878",
+") g #7D7D7D",
+"! g #646464",
+"~ g #EAEAEA",
+"{ g #2B2B2B",
+"] g #8A8A8A",
+"^ g #929292",
+"/ g #FEFEFE",
+"( g #434343",
+"_ g #9F9F9F",
+": g #111111",
+"< g #4F4F4F",
+"[ g #3C3C3C",
+"} g #717171",
+"| g #1B1B1B",
+"1 g #242424",
+"2 g #5D5D5D",
+".................",
+"+++++++++++++++++",
+"@@@@@.#$%$#.@@@@@",
+"&&&&*=-;;;-=*&&&&",
+">>>,*-;')';!*,>>>",
+"~~@{,;)]^]);,{@~~",
+"//*(-;)^_^);,(,//",
+"~~:(,;)]^]);,*:~~",
+">>%(<%%%%%%%<(%>>",
+"&&$=<@&&&&&@<=$&&",
+"@@#{[*<,,,,([=#@@",
+"++}|{[((<(([=:}++",
+"...#|{{=[={{|#...",
+"}}}}{$|111|$=}}}}",
+"22222(|%%$|(22222",
+"*****************",
+"#################",
+".................",
+"+++++++++++++++++",
+"@@@@@}{$%%=}@@@@@",
+"&&&&(1**<<(1(&&&&",
+">>>*=(<,-2<*#*>>>",
+"~~+|(<,-;-,<(1+~~",
+"//(#(<-;'!-<(#(//",
+"~~$=[*,!;-,<[=:~~",
+">>%{[%%%%%%%[{%>>",
+"&&$1#.]..]..#1$&&",
+"@@=1{=[((([#{1=@@",
+"++2$1{====={|$2++",
+"...{:|11{11|:=...",
+"}}}}{%:|||:$1}}}}",
+"22222(|%%%|(22222",
+"*****************",
+"#################"};
diff --git a/kwin-styles/icewm/icewm-themes/minimizeA.xpm b/kwin-styles/icewm/icewm-themes/minimizeA.xpm
new file mode 100644
index 00000000..bcbfa3a7
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/minimizeA.xpm
@@ -0,0 +1,68 @@
+/* XPM */
+static char * minimizeA_xpm[] = {
+"15 34 31 1",
+" c None",
+". c #858686",
+"+ c #9A9A9A",
+"@ c #AEAEAE",
+"# c #5D5D5E",
+"$ c #111214",
+"% c #040404",
+"& c #C2C2C2",
+"* c #181C22",
+"= c #2D333D",
+"- c #56657A",
+"; c #58667E",
+"> c #5D6E86",
+", c #D6D6D6",
+"' c #1D2632",
+") c #4A4A4A",
+"! c #6E809C",
+"~ c #EAEAEA",
+"{ c #717273",
+"] c #232D3A",
+"^ c #4D5868",
+"/ c #798EAA",
+"( c #7E96B6",
+"_ c #FEFEFE",
+": c #8CA3C5",
+"< c #3C4553",
+"[ c #323F4F",
+"} c #0D0E13",
+"| c #435165",
+"1 c #363636",
+"2 c #677B98",
+"...............",
+"+++++++++++++++",
+"@@@@#$%%%$#@@@@",
+"&&&*=-;>;-=*&&&",
+",,')->!!!>;)',,",
+"~{]^>!/(/!>^]{~",
+"_*)^>!(:(!>-)*_",
+"~%<^>,,,,,>^<%~",
+",%<^-%@@@%-^[%,",
+"&%[<^-}@%-^<[%&",
+"@}][<|^%^|<[]$@",
+"+|$][<<|<<[=$)+",
+"..**]==[=]]**..",
+"{{{$}*'''*}${{{",
+"####=%%%%}]####",
+")))))))))))))))",
+"111111111111111",
+"...............",
+"+++++++++++++++",
+"@@@@)}%%%}^@@@@",
+"&&&*'<)|)<'*&&&",
+",,*1||^-^|)1*,,",
+"~{*[|^;>;^|<'{~",
+"_*1<|->2>-|<=*_",
+"~%=[|+++++|[=%~",
+",%=[<%!.!%<[]%,",
+"&%'1[<%.%)[1'%&",
+"@}']11[%[[1]'}@",
+"+)}']==1==]'})+",
+"..}$*'''''*$}..",
+"{{{$}$**$$}}{{{",
+"####]%%%%}]####",
+")))))))))))))))",
+"111111111111111"};
diff --git a/kwin-styles/icewm/icewm-themes/minimizeI.xpm b/kwin-styles/icewm/icewm-themes/minimizeI.xpm
new file mode 100644
index 00000000..e2e954a2
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/minimizeI.xpm
@@ -0,0 +1,68 @@
+/* XPM */
+static char * minimizeI_xpm[] = {
+"15 34 31 1",
+" g None",
+". g #858585",
+"+ g #9A9A9A",
+"@ g #AEAEAE",
+"# g #5D5D5D",
+"$ g #111111",
+"% g #040404",
+"& g #C2C2C2",
+"* g #1B1B1B",
+"= g #323232",
+"- g #626262",
+"; g #646464",
+"> g #6B6B6B",
+", g #D6D6D6",
+"' g #242424",
+") g #4A4A4A",
+"! g #7D7D7D",
+"~ g #EAEAEA",
+"{ g #717171",
+"] g #2B2B2B",
+"^ g #565656",
+"/ g #8A8A8A",
+"( g #929292",
+"_ g #FEFEFE",
+": g #9F9F9F",
+"< g #434343",
+"[ g #3C3C3C",
+"} g #0E0E0E",
+"| g #4F4F4F",
+"1 g #363636",
+"2 g #787878",
+"...............",
+"+++++++++++++++",
+"@@@@#$%%%$#@@@@",
+"&&&*=-;>;-=*&&&",
+",,')->!!!>;)',,",
+"~{]^>!/(/!>^]{~",
+"_*)^>!(:(!>-)*_",
+"~%<^>,,,,,>^<%~",
+",%<^-%@@@%-^[%,",
+"&%[<^-}@%-^<[%&",
+"@}][<|^%^|<[]$@",
+"+|$][<<|<<[=$)+",
+"..**]==[=]]**..",
+"{{{$}*'''*}${{{",
+"####=%%%%}]####",
+")))))))))))))))",
+"111111111111111",
+"...............",
+"+++++++++++++++",
+"@@@@)}%%%}^@@@@",
+"&&&*'<)|)<'*&&&",
+",,*1||^-^|)1*,,",
+"~{*[|^;>;^|<'{~",
+"_*1<|->2>-|<=*_",
+"~%=[|+++++|[=%~",
+",%=[<%!.!%<[]%,",
+"&%'1[<%.%)[1'%&",
+"@}']11[%[[1]'}@",
+"+)}']==1==]'})+",
+"..}$*'''''*$}..",
+"{{{$}$**$$}}{{{",
+"####]%%%%}]####",
+")))))))))))))))",
+"111111111111111"};
diff --git a/kwin-styles/icewm/icewm-themes/restoreA.xpm b/kwin-styles/icewm/icewm-themes/restoreA.xpm
new file mode 100644
index 00000000..93481afe
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/restoreA.xpm
@@ -0,0 +1,68 @@
+/* XPM */
+static char * restoreA_xpm[] = {
+"15 34 31 1",
+" c None",
+". c #858686",
+"+ c #9A9A9A",
+"@ c #AEAEAE",
+"# c #5D5D5E",
+"$ c #111214",
+"% c #040404",
+"& c #C2C2C2",
+"* c #181C22",
+"= c #2D333D",
+"- c #56657A",
+"; c #58667E",
+"> c #5D6E86",
+", c #D6D6D6",
+"' c #1D2632",
+") c #4A4A4A",
+"! c #6E809C",
+"~ c #EAEAEA",
+"{ c #717273",
+"] c #232D3A",
+"^ c #4D5868",
+"/ c #798EAA",
+"( c #FEFEFE",
+"_ c #3C4553",
+": c #0D0E13",
+"< c #323F4F",
+"[ c #C7CDD4",
+"} c #435165",
+"| c #363636",
+"1 c #8CA3C5",
+"2 c #7E96B6",
+"...............",
+"+++++++++++++++",
+"@@@@#$%%%$#@@@@",
+"&&&*=-;>;-=*&&&",
+",,')->!!!>;)',,",
+"~{]^>!/,/!>^]{~",
+"(*)^>!,@,!>-)*(",
+"~%_^>,@@@,>^_%~",
+",%_^;%:%%%-^<%,",
+"&%<_^[[[[[^_<%&",
+"@:]<_:@@@%_<]$@",
+"+}$]<<%@%_<]$)+",
+"..**]]=%=]]**..",
+"{{{$:*'''*:${{{",
+"####=%%%%:=####",
+")))))))))))))))",
+"|||||||||||||||",
+"...............",
+"+++++++++++++++",
+"@@@@):%%%$)@@@@",
+"&&&*'_)})}'*[&&",
+",,*|_^^^^}_|*,,",
+"~{'_}^>1;#}<'{~",
+"($=<}-+.+^}_=*(",
+"~%=_)+!..+}<=%~",
+",%=<_%%%%%)|]%,",
+"&%'<<++2+/_=]%&",
+"@:*]=%.{.%|]*:@",
+"+):'']%{%]]':)+",
+"..$$*''%''*$$..",
+"{{{$:$***$::{{{",
+"####]%%%%:]####",
+")))))))))))))))",
+"|||||||||||||||"};
diff --git a/kwin-styles/icewm/icewm-themes/restoreI.xpm b/kwin-styles/icewm/icewm-themes/restoreI.xpm
new file mode 100644
index 00000000..b1408657
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/restoreI.xpm
@@ -0,0 +1,68 @@
+/* XPM */
+static char * restoreI_xpm[] = {
+"15 34 31 1",
+" g None",
+". g #858585",
+"+ g #9A9A9A",
+"@ g #AEAEAE",
+"# g #5D5D5D",
+"$ g #111111",
+"% g #040404",
+"& g #C2C2C2",
+"* g #1B1B1B",
+"= g #323232",
+"- g #626262",
+"; g #646464",
+"> g #6B6B6B",
+", g #D6D6D6",
+"' g #242424",
+") g #4A4A4A",
+"! g #7D7D7D",
+"~ g #EAEAEA",
+"{ g #717171",
+"] g #2B2B2B",
+"^ g #565656",
+"/ g #8A8A8A",
+"( g #FEFEFE",
+"_ g #434343",
+": g #0E0E0E",
+"< g #3C3C3C",
+"[ g #CBCBCB",
+"} g #4F4F4F",
+"| g #363636",
+"1 g #9F9F9F",
+"2 g #929292",
+"...............",
+"+++++++++++++++",
+"@@@@#$%%%$#@@@@",
+"&&&*=-;>;-=*&&&",
+",,')->!!!>;)',,",
+"~{]^>!/,/!>^]{~",
+"(*)^>!,@,!>-)*(",
+"~%_^>,@@@,>^_%~",
+",%_^;%:%%%-^<%,",
+"&%<_^[[[[[^_<%&",
+"@:]<_:@@@%_<]$@",
+"+}$]<<%@%_<]$)+",
+"..**]]=%=]]**..",
+"{{{$:*'''*:${{{",
+"####=%%%%:=####",
+")))))))))))))))",
+"|||||||||||||||",
+"...............",
+"+++++++++++++++",
+"@@@@):%%%$)@@@@",
+"&&&*'_)})}'*[&&",
+",,*|_^^^^}_|*,,",
+"~{'_}^>1;#}<'{~",
+"($=<}-+.+^}_=*(",
+"~%=_)+!..+}<=%~",
+",%=<_%%%%%)|]%,",
+"&%'<<++2+/_=]%&",
+"@:*]=%.{.%|]*:@",
+"+):'']%{%]]':)+",
+"..$$*''%''*$$..",
+"{{{$:$***$::{{{",
+"####]%%%%:]####",
+")))))))))))))))",
+"|||||||||||||||"};
diff --git a/kwin-styles/icewm/icewm-themes/rolldownA.xpm b/kwin-styles/icewm/icewm-themes/rolldownA.xpm
new file mode 100644
index 00000000..e7b70845
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/rolldownA.xpm
@@ -0,0 +1,68 @@
+/* XPM */
+static char * rolldownA_xpm[] = {
+"15 34 31 1",
+" c None",
+". c #858686",
+"+ c #9A9A9A",
+"@ c #AEAEAE",
+"# c #5D5D5E",
+"$ c #111214",
+"% c #040404",
+"& c #C2C2C2",
+"* c #181C22",
+"= c #2D333D",
+"- c #56657A",
+"; c #58667E",
+"> c #5D6E86",
+", c #D6D6D6",
+"' c #1D2632",
+") c #4A4A4A",
+"! c #6E809C",
+"~ c #EAEAEA",
+"{ c #717273",
+"] c #232D3A",
+"^ c #4D5868",
+"/ c #798EAA",
+"( c #7E96B6",
+"_ c #FEFEFE",
+": c #3C4553",
+"< c #323F4F",
+"[ c #0D0E13",
+"} c #C7CDD4",
+"| c #435165",
+"1 c #363636",
+"2 c #8CA3C5",
+"...............",
+"+++++++++++++++",
+"@@@@#$%%%$#@@@@",
+"&&&*=-;>;-=*&&&",
+",,')->!!!>;)',,",
+"~{]^>!/(/!>^]{~",
+"_*)^>,,~,,>-)*_",
+"~%:^>%@@@%>^:%~",
+",%:^->%@%>;^<%,",
+"&%<:^;>%>-^:<%&",
+"@[]<&&}}}&&<][@",
+"+|$]%%%%%%%=$)+",
+"..**]]====]**..",
+"{{{$[*']'*[${{{",
+"####=%%%%%=####",
+")))))))))))))))",
+"111111=11111111",
+"...............",
+"+++++++++++++++",
+"@@@@)[%%%[^@@@@",
+"&&&*':)|):'*&&&",
+",,*=)|^-^|)1*,,",
+"~{':|^;>;^|:'{~",
+"_$=:|+2+2+|:=*_",
+"~%=:|%...%)<=%~",
+",%]<:|%.%|)<]%,",
+"&%'1<:)%):<<'%&",
+"@[''+/+/+(.]*[@",
+"+)['%%%%%%%'[)+",
+"..$$*'''''*$$..",
+"{{{[[$***$[[{{{",
+"####]%%%%%]####",
+")))))))))))))))",
+"111111111111111"};
diff --git a/kwin-styles/icewm/icewm-themes/rolldownI.xpm b/kwin-styles/icewm/icewm-themes/rolldownI.xpm
new file mode 100644
index 00000000..993e561b
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/rolldownI.xpm
@@ -0,0 +1,68 @@
+/* XPM */
+static char * rolldownI_xpm[] = {
+"15 34 31 1",
+" g None",
+". g #858585",
+"+ g #9A9A9A",
+"@ g #AEAEAE",
+"# g #5D5D5D",
+"$ g #111111",
+"% g #040404",
+"& g #C2C2C2",
+"* g #1B1B1B",
+"= g #323232",
+"- g #626262",
+"; g #646464",
+"> g #6B6B6B",
+", g #D6D6D6",
+"' g #242424",
+") g #4A4A4A",
+"! g #7D7D7D",
+"~ g #EAEAEA",
+"{ g #717171",
+"] g #2B2B2B",
+"^ g #565656",
+"/ g #8A8A8A",
+"( g #929292",
+"_ g #FEFEFE",
+": g #434343",
+"< g #3C3C3C",
+"[ g #0E0E0E",
+"} g #CBCBCB",
+"| g #4F4F4F",
+"1 g #363636",
+"2 g #9F9F9F",
+"...............",
+"+++++++++++++++",
+"@@@@#$%%%$#@@@@",
+"&&&*=-;>;-=*&&&",
+",,')->!!!>;)',,",
+"~{]^>!/(/!>^]{~",
+"_*)^>,,~,,>-)*_",
+"~%:^>%@@@%>^:%~",
+",%:^->%@%>;^<%,",
+"&%<:^;>%>-^:<%&",
+"@[]<&&}}}&&<][@",
+"+|$]%%%%%%%=$)+",
+"..**]]====]**..",
+"{{{$[*']'*[${{{",
+"####=%%%%%=####",
+")))))))))))))))",
+"111111=11111111",
+"...............",
+"+++++++++++++++",
+"@@@@)[%%%[^@@@@",
+"&&&*':)|):'*&&&",
+",,*=)|^-^|)1*,,",
+"~{':|^;>;^|:'{~",
+"_$=:|+2+2+|:=*_",
+"~%=:|%...%)<=%~",
+",%]<:|%.%|)<]%,",
+"&%'1<:)%):<<'%&",
+"@[''+/+/+(.]*[@",
+"+)['%%%%%%%'[)+",
+"..$$*'''''*$$..",
+"{{{[[$***$[[{{{",
+"####]%%%%%]####",
+")))))))))))))))",
+"111111111111111"};
diff --git a/kwin-styles/icewm/icewm-themes/rollupA.xpm b/kwin-styles/icewm/icewm-themes/rollupA.xpm
new file mode 100644
index 00000000..32311d6a
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/rollupA.xpm
@@ -0,0 +1,68 @@
+/* XPM */
+static char * rollupA_xpm[] = {
+"15 34 31 1",
+" c None",
+". c #858686",
+"+ c #9A9A9A",
+"@ c #AEAEAE",
+"# c #5D5D5E",
+"$ c #111214",
+"% c #040404",
+"& c #C2C2C2",
+"* c #181C22",
+"= c #2D333D",
+"- c #56657A",
+"; c #58667E",
+"> c #5D6E86",
+", c #D6D6D6",
+"' c #1D2632",
+") c #4A4A4A",
+"! c #6E809C",
+"~ c #EAEAEA",
+"{ c #717273",
+"] c #232D3A",
+"^ c #4D5868",
+"/ c #C7CDD4",
+"( c #FEFEFE",
+"_ c #0D0E13",
+": c #435165",
+"< c #3C4553",
+"[ c #677B98",
+"} c #798EAA",
+"| c #323F4F",
+"1 c #363636",
+"2 c #8CA3C5",
+"...............",
+"+++++++++++++++",
+"@@@@#$%%%$#@@@@",
+"&&&*=-;>;-=*&&&",
+",,')->!!!>;)',,",
+"~{]^/,,,,,/^]{~",
+"(*)^_%__%_%^:*(",
+"~%<^;[},}!>^<%~",
+",%<^;>,@/[-^<%,",
+"&%|<^/@@@/^<=%&",
+"@_]|<_%%%%<|]$@",
+"+)*]|<<<<||=$)+",
+"..$*'=||==]**..",
+"{{{$_**''*_${{{",
+"##-#=_%%%%=####",
+")))))))))))))))",
+"111111=11111111",
+"...............",
+"+++++++++++++++",
+"@@@@)_%%%_^@@@@",
+"&&&*'<):)<'*&&&",
+",,*=):^-^^)1*,,",
+"~{'|+2+2+++<'{~",
+"($=<%%%%%%%<=*(",
+"~%=|:^;+;^:|=%~",
+",%=|<:+.+:<|]%,",
+"&%'1<+!!.+|1'%&",
+"@_']=%%%%%1]'_@",
+"+)_*]====]]'_)+",
+"..$$*'']''*$_..",
+"{{{__$$*$$_${{{",
+"####]%%%%_]####",
+")))))))))))))))",
+"111111111111111"};
diff --git a/kwin-styles/icewm/icewm-themes/rollupI.xpm b/kwin-styles/icewm/icewm-themes/rollupI.xpm
new file mode 100644
index 00000000..31b81973
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/rollupI.xpm
@@ -0,0 +1,68 @@
+/* XPM */
+static char * rollupI_xpm[] = {
+"15 34 31 1",
+" g None",
+". g #858585",
+"+ g #9A9A9A",
+"@ g #AEAEAE",
+"# g #5D5D5D",
+"$ g #111111",
+"% g #040404",
+"& g #C2C2C2",
+"* g #1B1B1B",
+"= g #323232",
+"- g #626262",
+"; g #646464",
+"> g #6B6B6B",
+", g #D6D6D6",
+"' g #242424",
+") g #4A4A4A",
+"! g #7D7D7D",
+"~ g #EAEAEA",
+"{ g #717171",
+"] g #2B2B2B",
+"^ g #565656",
+"/ g #CBCBCB",
+"( g #FEFEFE",
+"_ g #0E0E0E",
+": g #4F4F4F",
+"< g #434343",
+"[ g #787878",
+"} g #8A8A8A",
+"| g #3C3C3C",
+"1 g #363636",
+"2 g #9F9F9F",
+"...............",
+"+++++++++++++++",
+"@@@@#$%%%$#@@@@",
+"&&&*=-;>;-=*&&&",
+",,')->!!!>;)',,",
+"~{]^/,,,,,/^]{~",
+"(*)^_%__%_%^:*(",
+"~%<^;[},}!>^<%~",
+",%<^;>,@/[-^<%,",
+"&%|<^/@@@/^<=%&",
+"@_]|<_%%%%<|]$@",
+"+)*]|<<<<||=$)+",
+"..$*'=||==]**..",
+"{{{$_**''*_${{{",
+"##-#=_%%%%=####",
+")))))))))))))))",
+"111111=11111111",
+"...............",
+"+++++++++++++++",
+"@@@@)_%%%_^@@@@",
+"&&&*'<):)<'*&&&",
+",,*=):^-^^)1*,,",
+"~{'|+2+2+++<'{~",
+"($=<%%%%%%%<=*(",
+"~%=|:^;+;^:|=%~",
+",%=|<:+.+:<|]%,",
+"&%'1<+!!.+|1'%&",
+"@_']=%%%%%1]'_@",
+"+)_*]====]]'_)+",
+"..$$*'']''*$_..",
+"{{{__$$*$$_${{{",
+"####]%%%%_]####",
+")))))))))))))))",
+"111111111111111"};
diff --git a/kwin-styles/icewm/icewm-themes/titleAB.xpm b/kwin-styles/icewm/icewm-themes/titleAB.xpm
new file mode 100644
index 00000000..f153f2af
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleAB.xpm
@@ -0,0 +1,32 @@
+/* XPM */
+static char * titleAS_xpm[] = {
+"1 17 12 1",
+" c None",
+". c #868687",
+"+ c #9A9A9B",
+"@ c #AEAEAF",
+"# c #C2C2C3",
+"$ c #D6D6D7",
+"% c #EAEAEB",
+"& c #FFFFFF",
+"* c #727273",
+"= c #5E5E5F",
+"- c #4A4A4B",
+"; c #363637",
+".",
+"+",
+"@",
+"#",
+"$",
+"%",
+"&",
+"%",
+"$",
+"#",
+"@",
+"+",
+".",
+"*",
+"=",
+"-",
+";"};
diff --git a/kwin-styles/icewm/icewm-themes/titleAJ.xpm b/kwin-styles/icewm/icewm-themes/titleAJ.xpm
new file mode 100644
index 00000000..0ef284c1
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleAJ.xpm
@@ -0,0 +1,37 @@
+/* XPM */
+static char * titleAJ_xpm[] = {
+"3 17 17 1",
+" c None",
+". c #858687",
+"+ c #4F4F51",
+"@ c #999A9A",
+"# c #AEAEAE",
+"$ c #5E5E5E",
+"% c #C2C2C2",
+"& c #717172",
+"* c #D6D6D6",
+"= c #E9EAEA",
+"- c #FEFEFE",
+"; c #909090",
+"> c #717374",
+", c #5C5F64",
+"' c #373739",
+") c #494B4D",
+"! c #343638",
+"..+",
+"@@+",
+"##$",
+"%%&",
+"**&",
+"==&",
+"--;",
+"==&",
+"**&",
+"%%&",
+"##$",
+"@@+",
+"..+",
+">>+",
+",,'",
+"))'",
+"!!'"};
diff --git a/kwin-styles/icewm/icewm-themes/titleAM.xpm b/kwin-styles/icewm/icewm-themes/titleAM.xpm
new file mode 100644
index 00000000..808458a4
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleAM.xpm
@@ -0,0 +1,73 @@
+/* XPM */
+static char * titleAM_xpm[] = {
+"18 17 53 1",
+" c None",
+". c #868687",
+"+ c #4E4E4F",
+"@ c #484848",
+"# c #9A9A9B",
+"$ c #575758",
+"% c #344066",
+"& c #515151",
+"* c #AEAEAF",
+"= c #606061",
+"- c #425076",
+"; c #606060",
+"> c #C2C2C3",
+", c #68686A",
+"' c #526185",
+") c #707070",
+"! c #D6D6D7",
+"~ c #717173",
+"{ c #607194",
+"] c #808080",
+"^ c #EAEAEB",
+"/ c #7A7A7C",
+"( c #7081A3",
+"_ c #8E8E8E",
+": c #FFFFFF",
+"< c #838385",
+"[ c #7284A6",
+"} c #9B9B9B",
+"| c #7587A9",
+"1 c #A9A9A9",
+"2 c #66779A",
+"3 c #B7B7B7",
+"4 c #57668A",
+"5 c #C5C5C5",
+"6 c #4A597D",
+"7 c #D2D2D2",
+"8 c #3D4A70",
+"9 c #303C63",
+"0 c #A7A7A7",
+"a c #727273",
+"b c #454547",
+"c c #273259",
+"d c #7F7F7F",
+"e c #5E5E5F",
+"f c #3C3C3E",
+"g c #969696",
+"h c #848484",
+"i c #6B6B6B",
+"j c #575757",
+"k c #4A4A4B",
+"l c #333335",
+"m c #363637",
+"n c #2A2A2C",
+"..............+...",
+"@@@@@@@@@@@@@#$###",
+"%%%%%%%%%%%%&*=***",
+"------------;>,>>>",
+"'''''''''''')!~!!!",
+"{{{{{{{{{{{{]^/^^^",
+"((((((((((((_:<:::",
+"[[[[[[[[[[[[}^/^^^",
+"||||||||||||1!~!!!",
+"2222222222223>,>>>",
+"4444444444445*=***",
+"6666666666667#$###",
+"8888888888885.+...",
+"9999999999990abaaa",
+"ccccccccccccdefeee",
+"}}}}}}}}}ghijklkkk",
+"mmmmmmmmmmmmmmnmmm"};
diff --git a/kwin-styles/icewm/icewm-themes/titleAP.xpm b/kwin-styles/icewm/icewm-themes/titleAP.xpm
new file mode 100644
index 00000000..a4ae203a
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleAP.xpm
@@ -0,0 +1,73 @@
+/* XPM */
+static char * titleAP_xpm[] = {
+"18 17 53 1",
+" c None",
+". c #868687",
+"+ c #4E4E4F",
+"@ c #9A9A9B",
+"# c #575758",
+"$ c #484848",
+"% c #AEAEAF",
+"& c #606061",
+"* c #515151",
+"= c #344066",
+"- c #C2C2C3",
+"; c #68686A",
+"> c #606060",
+", c #425076",
+"' c #D6D6D7",
+") c #717173",
+"! c #707070",
+"~ c #526185",
+"{ c #EAEAEB",
+"] c #7A7A7C",
+"^ c #808080",
+"/ c #607194",
+"( c #FFFFFF",
+"_ c #838385",
+": c #8E8E8E",
+"< c #7081A3",
+"[ c #9B9B9B",
+"} c #7284A6",
+"| c #A9A9A9",
+"1 c #7587A9",
+"2 c #B7B7B7",
+"3 c #66779A",
+"4 c #C5C5C5",
+"5 c #57668A",
+"6 c #D2D2D2",
+"7 c #4A597D",
+"8 c #3D4A70",
+"9 c #727273",
+"0 c #454547",
+"a c #A7A7A7",
+"b c #303C63",
+"c c #5E5E5F",
+"d c #3C3C3E",
+"e c #7F7F7F",
+"f c #273259",
+"g c #4A4A4B",
+"h c #333335",
+"i c #575757",
+"j c #6B6B6B",
+"k c #848484",
+"l c #969696",
+"m c #363637",
+"n c #2A2A2C",
+"...+..............",
+"@@@#@$$$$$$$$$$$$$",
+"%%%&%*============",
+"---;->,,,,,,,,,,,,",
+"''')'!~~~~~~~~~~~~",
+"{{{]{^////////////",
+"(((_(:<<<<<<<<<<<<",
+"{{{]{[}}}}}}}}}}}}",
+"''')'|111111111111",
+"---;-2333333333333",
+"%%%&%4555555555555",
+"@@@#@6777777777777",
+"...+.4888888888888",
+"99909abbbbbbbbbbbb",
+"cccdceffffffffffff",
+"ggghgijkl[[[[[[[[[",
+"mmmnmmmmmmmmmmmmmm"};
diff --git a/kwin-styles/icewm/icewm-themes/titleAQ.xpm b/kwin-styles/icewm/icewm-themes/titleAQ.xpm
new file mode 100644
index 00000000..8bc6cd28
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleAQ.xpm
@@ -0,0 +1,37 @@
+/* XPM */
+static char * titleAQ_xpm[] = {
+"2 17 17 1",
+" c None",
+". c #4F4F51",
+"+ c #858687",
+"@ c #999A9A",
+"# c #5E5E5E",
+"$ c #AEAEAE",
+"% c #717172",
+"& c #C2C2C2",
+"* c #D6D6D6",
+"= c #E9EAEA",
+"- c #909090",
+"; c #FEFEFE",
+"> c #717374",
+", c #373739",
+"' c #5C5F64",
+") c #494B4D",
+"! c #343638",
+".+",
+".@",
+"#$",
+"%&",
+"%*",
+"%=",
+"-;",
+"%=",
+"%*",
+"%&",
+"#$",
+".@",
+".+",
+".>",
+",'",
+",)",
+",!"};
diff --git a/kwin-styles/icewm/icewm-themes/titleAR.xpm b/kwin-styles/icewm/icewm-themes/titleAR.xpm
new file mode 100644
index 00000000..8bc6cd28
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleAR.xpm
@@ -0,0 +1,37 @@
+/* XPM */
+static char * titleAQ_xpm[] = {
+"2 17 17 1",
+" c None",
+". c #4F4F51",
+"+ c #858687",
+"@ c #999A9A",
+"# c #5E5E5E",
+"$ c #AEAEAE",
+"% c #717172",
+"& c #C2C2C2",
+"* c #D6D6D6",
+"= c #E9EAEA",
+"- c #909090",
+"; c #FEFEFE",
+"> c #717374",
+", c #373739",
+"' c #5C5F64",
+") c #494B4D",
+"! c #343638",
+".+",
+".@",
+"#$",
+"%&",
+"%*",
+"%=",
+"-;",
+"%=",
+"%*",
+"%&",
+"#$",
+".@",
+".+",
+".>",
+",'",
+",)",
+",!"};
diff --git a/kwin-styles/icewm/icewm-themes/titleAS.xpm b/kwin-styles/icewm/icewm-themes/titleAS.xpm
new file mode 100644
index 00000000..f153f2af
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleAS.xpm
@@ -0,0 +1,32 @@
+/* XPM */
+static char * titleAS_xpm[] = {
+"1 17 12 1",
+" c None",
+". c #868687",
+"+ c #9A9A9B",
+"@ c #AEAEAF",
+"# c #C2C2C3",
+"$ c #D6D6D7",
+"% c #EAEAEB",
+"& c #FFFFFF",
+"* c #727273",
+"= c #5E5E5F",
+"- c #4A4A4B",
+"; c #363637",
+".",
+"+",
+"@",
+"#",
+"$",
+"%",
+"&",
+"%",
+"$",
+"#",
+"@",
+"+",
+".",
+"*",
+"=",
+"-",
+";"};
diff --git a/kwin-styles/icewm/icewm-themes/titleAT.xpm b/kwin-styles/icewm/icewm-themes/titleAT.xpm
new file mode 100644
index 00000000..84f06879
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleAT.xpm
@@ -0,0 +1,38 @@
+/* XPM */
+static char * titleAT_xpm[] = {
+"1 17 18 1",
+" c None",
+". c #868687",
+"+ c #484848",
+"@ c #344066",
+"# c #425076",
+"$ c #526185",
+"% c #607194",
+"& c #7081A3",
+"* c #7284A6",
+"= c #7587A9",
+"- c #66779A",
+"; c #57668A",
+"> c #4A597D",
+", c #3D4A70",
+"' c #303C63",
+") c #273259",
+"! c #9B9B9B",
+"~ c #363637",
+".",
+"+",
+"@",
+"#",
+"$",
+"%",
+"&",
+"*",
+"=",
+"-",
+";",
+">",
+",",
+"'",
+")",
+"!",
+"~"};
diff --git a/kwin-styles/icewm/icewm-themes/titleIB.xpm b/kwin-styles/icewm/icewm-themes/titleIB.xpm
new file mode 100644
index 00000000..f153f2af
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleIB.xpm
@@ -0,0 +1,32 @@
+/* XPM */
+static char * titleAS_xpm[] = {
+"1 17 12 1",
+" c None",
+". c #868687",
+"+ c #9A9A9B",
+"@ c #AEAEAF",
+"# c #C2C2C3",
+"$ c #D6D6D7",
+"% c #EAEAEB",
+"& c #FFFFFF",
+"* c #727273",
+"= c #5E5E5F",
+"- c #4A4A4B",
+"; c #363637",
+".",
+"+",
+"@",
+"#",
+"$",
+"%",
+"&",
+"%",
+"$",
+"#",
+"@",
+"+",
+".",
+"*",
+"=",
+"-",
+";"};
diff --git a/kwin-styles/icewm/icewm-themes/titleIJ.xpm b/kwin-styles/icewm/icewm-themes/titleIJ.xpm
new file mode 100644
index 00000000..0ef284c1
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleIJ.xpm
@@ -0,0 +1,37 @@
+/* XPM */
+static char * titleAJ_xpm[] = {
+"3 17 17 1",
+" c None",
+". c #858687",
+"+ c #4F4F51",
+"@ c #999A9A",
+"# c #AEAEAE",
+"$ c #5E5E5E",
+"% c #C2C2C2",
+"& c #717172",
+"* c #D6D6D6",
+"= c #E9EAEA",
+"- c #FEFEFE",
+"; c #909090",
+"> c #717374",
+", c #5C5F64",
+"' c #373739",
+") c #494B4D",
+"! c #343638",
+"..+",
+"@@+",
+"##$",
+"%%&",
+"**&",
+"==&",
+"--;",
+"==&",
+"**&",
+"%%&",
+"##$",
+"@@+",
+"..+",
+">>+",
+",,'",
+"))'",
+"!!'"};
diff --git a/kwin-styles/icewm/icewm-themes/titleIM.xpm b/kwin-styles/icewm/icewm-themes/titleIM.xpm
new file mode 100644
index 00000000..575b63c4
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleIM.xpm
@@ -0,0 +1,66 @@
+/* XPM */
+static char * titleIM_xpm[] = {
+"18 17 46 1",
+" c None",
+". c #868686",
+"+ c #4E4E4E",
+"@ c #484848",
+"# c #9A9A9A",
+"$ c #575757",
+"% c #4D4D4D",
+"& c #515151",
+"* c #AEAEAE",
+"= c #606060",
+"- c #5C5C5C",
+"; c #C2C2C2",
+"> c #696969",
+", c #6B6B6B",
+"' c #707070",
+") c #D6D6D6",
+"! c #727272",
+"~ c #7A7A7A",
+"{ c #808080",
+"] c #EAEAEA",
+"^ c #7B7B7B",
+"/ c #898989",
+"( c #8E8E8E",
+"_ c #FFFFFF",
+": c #848484",
+"< c #8C8C8C",
+"[ c #9B9B9B",
+"} c #8F8F8F",
+"| c #A9A9A9",
+"1 c #B7B7B7",
+"2 c #C5C5C5",
+"3 c #636363",
+"4 c #D2D2D2",
+"5 c #565656",
+"6 c #494949",
+"7 c #A7A7A7",
+"8 c #464646",
+"9 c #404040",
+"0 c #7F7F7F",
+"a c #5E5E5E",
+"b c #3D3D3D",
+"c c #969696",
+"d c #4A4A4A",
+"e c #343434",
+"f c #363636",
+"g c #2B2B2B",
+"..............+...",
+"@@@@@@@@@@@@@#$###",
+"%%%%%%%%%%%%&*=***",
+"------------=;>;;;",
+",,,,,,,,,,,,')!)))",
+"~~~~~~~~~~~~{]^]]]",
+"////////////(_:___",
+"<<<<<<<<<<<<[]^]]]",
+"}}}}}}}}}}}}|)!)))",
+"{{{{{{{{{{{{1;>;;;",
+"''''''''''''2*=***",
+"3333333333334#$###",
+"5555555555552.+...",
+"6666666666667!8!!!",
+"9999999999990abaaa",
+"[[[[[[[[[c:,$deddd",
+"ffffffffffffffgfff"};
diff --git a/kwin-styles/icewm/icewm-themes/titleIP.xpm b/kwin-styles/icewm/icewm-themes/titleIP.xpm
new file mode 100644
index 00000000..170d1b2a
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleIP.xpm
@@ -0,0 +1,66 @@
+/* XPM */
+static char * titleIP_xpm[] = {
+"18 17 46 1",
+" c None",
+". c #868686",
+"+ c #4E4E4E",
+"@ c #9A9A9A",
+"# c #575757",
+"$ c #484848",
+"% c #AEAEAE",
+"& c #606060",
+"* c #515151",
+"= c #4D4D4D",
+"- c #C2C2C2",
+"; c #696969",
+"> c #5C5C5C",
+", c #D6D6D6",
+"' c #727272",
+") c #707070",
+"! c #6B6B6B",
+"~ c #EAEAEA",
+"{ c #7B7B7B",
+"] c #808080",
+"^ c #7A7A7A",
+"/ c #FFFFFF",
+"( c #848484",
+"_ c #8E8E8E",
+": c #898989",
+"< c #9B9B9B",
+"[ c #8C8C8C",
+"} c #A9A9A9",
+"| c #8F8F8F",
+"1 c #B7B7B7",
+"2 c #C5C5C5",
+"3 c #D2D2D2",
+"4 c #636363",
+"5 c #565656",
+"6 c #464646",
+"7 c #A7A7A7",
+"8 c #494949",
+"9 c #5E5E5E",
+"0 c #3D3D3D",
+"a c #7F7F7F",
+"b c #404040",
+"c c #4A4A4A",
+"d c #343434",
+"e c #969696",
+"f c #363636",
+"g c #2B2B2B",
+"...+..............",
+"@@@#@$$$$$$$$$$$$$",
+"%%%&%*============",
+"---;-&>>>>>>>>>>>>",
+",,,',)!!!!!!!!!!!!",
+"~~~{~]^^^^^^^^^^^^",
+"///(/_::::::::::::",
+"~~~{~<[[[[[[[[[[[[",
+",,,',}||||||||||||",
+"---;-1]]]]]]]]]]]]",
+"%%%&%2))))))))))))",
+"@@@#@3444444444444",
+"...+.2555555555555",
+"'''6'7888888888888",
+"99909abbbbbbbbbbbb",
+"cccdc#!(e<<<<<<<<<",
+"fffgffffffffffffff"};
diff --git a/kwin-styles/icewm/icewm-themes/titleIQ.xpm b/kwin-styles/icewm/icewm-themes/titleIQ.xpm
new file mode 100644
index 00000000..8bc6cd28
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleIQ.xpm
@@ -0,0 +1,37 @@
+/* XPM */
+static char * titleAQ_xpm[] = {
+"2 17 17 1",
+" c None",
+". c #4F4F51",
+"+ c #858687",
+"@ c #999A9A",
+"# c #5E5E5E",
+"$ c #AEAEAE",
+"% c #717172",
+"& c #C2C2C2",
+"* c #D6D6D6",
+"= c #E9EAEA",
+"- c #909090",
+"; c #FEFEFE",
+"> c #717374",
+", c #373739",
+"' c #5C5F64",
+") c #494B4D",
+"! c #343638",
+".+",
+".@",
+"#$",
+"%&",
+"%*",
+"%=",
+"-;",
+"%=",
+"%*",
+"%&",
+"#$",
+".@",
+".+",
+".>",
+",'",
+",)",
+",!"};
diff --git a/kwin-styles/icewm/icewm-themes/titleIR.xpm b/kwin-styles/icewm/icewm-themes/titleIR.xpm
new file mode 100644
index 00000000..8bc6cd28
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleIR.xpm
@@ -0,0 +1,37 @@
+/* XPM */
+static char * titleAQ_xpm[] = {
+"2 17 17 1",
+" c None",
+". c #4F4F51",
+"+ c #858687",
+"@ c #999A9A",
+"# c #5E5E5E",
+"$ c #AEAEAE",
+"% c #717172",
+"& c #C2C2C2",
+"* c #D6D6D6",
+"= c #E9EAEA",
+"- c #909090",
+"; c #FEFEFE",
+"> c #717374",
+", c #373739",
+"' c #5C5F64",
+") c #494B4D",
+"! c #343638",
+".+",
+".@",
+"#$",
+"%&",
+"%*",
+"%=",
+"-;",
+"%=",
+"%*",
+"%&",
+"#$",
+".@",
+".+",
+".>",
+",'",
+",)",
+",!"};
diff --git a/kwin-styles/icewm/icewm-themes/titleIS.xpm b/kwin-styles/icewm/icewm-themes/titleIS.xpm
new file mode 100644
index 00000000..f153f2af
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleIS.xpm
@@ -0,0 +1,32 @@
+/* XPM */
+static char * titleAS_xpm[] = {
+"1 17 12 1",
+" c None",
+". c #868687",
+"+ c #9A9A9B",
+"@ c #AEAEAF",
+"# c #C2C2C3",
+"$ c #D6D6D7",
+"% c #EAEAEB",
+"& c #FFFFFF",
+"* c #727273",
+"= c #5E5E5F",
+"- c #4A4A4B",
+"; c #363637",
+".",
+"+",
+"@",
+"#",
+"$",
+"%",
+"&",
+"%",
+"$",
+"#",
+"@",
+"+",
+".",
+"*",
+"=",
+"-",
+";"};
diff --git a/kwin-styles/icewm/icewm-themes/titleIT.xpm b/kwin-styles/icewm/icewm-themes/titleIT.xpm
new file mode 100644
index 00000000..ddcab757
--- /dev/null
+++ b/kwin-styles/icewm/icewm-themes/titleIT.xpm
@@ -0,0 +1,38 @@
+/* XPM */
+static char * titleIT_xpm[] = {
+"1 17 18 1",
+" c None",
+". c #868686",
+"+ c #484848",
+"@ c #4D4D4D",
+"# c #5C5C5C",
+"$ c #6B6B6B",
+"% c #7A7A7A",
+"& c #898989",
+"* c #8C8C8C",
+"= c #8F8F8F",
+"- c #808080",
+"; c #707070",
+"> c #636363",
+", c #565656",
+"' c #494949",
+") c #404040",
+"! c #9B9B9B",
+"~ c #363636",
+".",
+"+",
+"@",
+"#",
+"$",
+"%",
+"&",
+"*",
+"=",
+"-",
+";",
+">",
+",",
+"'",
+")",
+"!",
+"~"};
diff --git a/kwin-styles/icewm/icewm.cpp b/kwin-styles/icewm/icewm.cpp
new file mode 100644
index 00000000..e6108748
--- /dev/null
+++ b/kwin-styles/icewm/icewm.cpp
@@ -0,0 +1,1703 @@
+/*
+ $Id$
+
+ Gallium-IceWM themeable KWin client
+
+ Copyright 2001
+ Karol Szwed <gallium@kde.org>
+ http://gallium.n3.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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ -----------------------------------------------------------------------------
+ This client loads most icewm 1.0.X pixmap themes, without taking into account
+ specific font settings for clients, or coloured mouse cursors. Titlebar
+ fonts can be changed via the kde control center. Bi-colour mouse cursors
+ may be added in future if requested by users, as well as theme font support.
+ Any styles using inbuilt icewm titlebar drawing without using pixmaps (e.g.
+ Warp4, win95 etc.) are not fully supported, and may cause drawing errors,
+ as these themes use in-built icewm drawing mechanisms.
+
+ When a pixmap theme is not present (or a corrupt one is present) then very
+ plain title decorations are painted instead, so that users don't see
+ non-painted window areas where possible ;)
+
+ At a later date, frame shaping may be added if really requested, and an
+ update to support the latest icewm 1.1.X theme format may be made.
+
+*/
+
+#include <kconfig.h>
+#include <kstandarddirs.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kdrawutil.h>
+#include <qapplication.h>
+#include <qlabel.h>
+#include <qdrawutil.h>
+#include <qdatetime.h>
+#include <qbitmap.h>
+#include <qcursor.h>
+#include <qstring.h>
+#include <qtooltip.h>
+#include <qregexp.h>
+#include "icewm.h"
+
+namespace IceWM {
+
+////////////////////////////////////////////////////////////////////////////////////////////
+// Here's the global pixmap stuff - as memory efficient as it can be :)
+////////////////////////////////////////////////////////////////////////////////////////////
+
+// IceWM frame pixmaps
+QPixmap* frameTL[] = {NULL, NULL};
+QPixmap* frameT [] = {NULL, NULL};
+QPixmap* frameTR[] = {NULL, NULL};
+QPixmap* frameL [] = {NULL, NULL};
+QPixmap* frameR [] = {NULL, NULL};
+QPixmap* frameBL[] = {NULL, NULL};
+QPixmap* frameB [] = {NULL, NULL};
+QPixmap* frameBR[] = {NULL, NULL};
+
+// Button pixmaps
+QPixmap* closePix[] = {NULL, NULL};
+QPixmap* depthPix[] = {NULL, NULL};
+QPixmap* maximizePix[] = {NULL, NULL};
+QPixmap* minimizePix[] = {NULL, NULL};
+QPixmap* restorePix[] = {NULL, NULL};
+QPixmap* hidePix[] = {NULL, NULL};
+QPixmap* rollupPix[] = {NULL, NULL};
+QPixmap* rolldownPix[] = {NULL, NULL};
+QPixmap* menuButtonPix[] = {NULL, NULL};
+
+// Titlebar pixmaps
+QPixmap* titleJ[] = {NULL, NULL};
+QPixmap* titleL[] = {NULL, NULL};
+QPixmap* titleS[] = {NULL, NULL};
+QPixmap* titleP[] = {NULL, NULL};
+QPixmap* titleT[] = {NULL, NULL};
+QPixmap* titleM[] = {NULL, NULL};
+QPixmap* titleB[] = {NULL, NULL};
+QPixmap* titleR[] = {NULL, NULL};
+QPixmap* titleQ[] = {NULL, NULL};
+
+ThemeHandler* clientHandler;
+
+QString* titleButtonsLeft;
+QString* titleButtonsRight;
+
+QColor* colorActiveBorder;
+QColor* colorInActiveBorder;
+QColor* colorActiveButton;
+QColor* colorInActiveButton;
+QColor* colorActiveTitleBarText;
+QColor* colorInActiveTitleBarText;
+QColor* colorActiveTitleBar;
+QColor* colorInActiveTitleBar;
+QColor* colorActiveTitleTextShadow;
+QColor* colorInActiveTitleTextShadow;
+
+int cornerSizeX;
+int cornerSizeY;
+int titleBarHeight;
+int borderSizeX;
+int borderSizeY;
+
+bool validframe = false;
+bool useActiveShadow = false;
+bool useInActiveShadow = false;
+
+// KControl Settings - Read from kwinicewmrc config file or icewm theme
+bool themeTitleTextColors = true; // Allow theme to set colors.
+ // kcontrol will have no effect
+
+bool titleBarOnTop = true; // Titlebars can be below windows too :)
+bool showMenuButtonIcon = false; // Draw a mini icon over the menu pixmap.
+bool customButtonPositions = false; // Let the theme dictate the btn pos.
+bool titleBarCentered = true;
+
+enum styles {OTHER, WARP3, WARP4, MOTIF, WIN95, NICE} themeLook;
+
+////////////////////////////////////////////////////////////////////////////////////////////
+// General utility functions
+////////////////////////////////////////////////////////////////////////////////////////////
+
+// Returns true if both active and inactive pixmaps are valid, and not null
+bool validPixmaps( QPixmap* p[] )
+{
+ return ( p[Active] && ( !p[Active]->isNull() ) &&
+ p[InActive] && ( !p[InActive]->isNull() ) );
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////////
+// ThemeHandler class
+//
+// This class allows us to free dynamic memory upon being reset, or unloaded
+// from kwin, so we don't leak big images everywhere, and handles the theme
+// initialisation / destruction in general.
+////////////////////////////////////////////////////////////////////////////////////////////
+
+ThemeHandler::ThemeHandler()
+{
+ initialized = false;
+
+ // Prevent having globals objects (use pointers to objects)
+ titleButtonsLeft = new QString();
+ titleButtonsRight = new QString();
+
+ colorActiveBorder = new QColor();
+ colorInActiveBorder = new QColor();
+ colorActiveButton = new QColor();
+ colorInActiveButton = new QColor();
+ colorActiveTitleBarText = new QColor();
+ colorInActiveTitleBarText = new QColor();
+ colorActiveTitleBar = new QColor();
+ colorInActiveTitleBar = new QColor();
+ colorActiveTitleTextShadow = new QColor();
+ colorInActiveTitleTextShadow = new QColor();
+
+ // Initialize
+ readConfig();
+ initTheme();
+ validframe = isFrameValid();
+ initialized = true;
+}
+
+
+ThemeHandler::~ThemeHandler()
+{
+ if (initialized)
+ freePixmaps();
+
+ delete colorInActiveTitleTextShadow;
+ delete colorActiveTitleTextShadow;
+ delete colorInActiveBorder;
+ delete colorActiveTitleBarText;
+ delete colorInActiveTitleBarText;
+ delete colorActiveTitleBar;
+ delete colorInActiveTitleBar;
+ delete colorActiveBorder;
+ delete colorActiveButton;
+ delete colorInActiveButton;
+
+ delete titleButtonsRight;
+ delete titleButtonsLeft;
+}
+
+
+KDecoration* ThemeHandler::createDecoration( KDecorationBridge* bridge )
+{
+ return new IceWMClient( bridge, this );
+}
+
+
+// Converts KDE style button strings to icewm style button strings
+void ThemeHandler::convertButtons( QString& s )
+{
+ s.replace( QRegExp("_"), ""); // Spacer (ignored)
+ s.replace( QRegExp("H"), ""); // Help (ignored)
+ s.replace( QRegExp("M"), "s"); // Sysmenu
+ s.replace( QRegExp("S"), "d"); // Sticky/OnAllDesktops
+ s.replace( QRegExp("I"), "i"); // Minimize
+ s.replace( QRegExp("A"), "m"); // Maximize
+ s.replace( QRegExp("X"), "x"); // Close
+}
+
+
+// Reverses all characters in a QString
+QString ThemeHandler::reverseString( QString s )
+{
+ if (s.length() <= 1)
+ return s;
+
+ QString tmpStr;
+ for(int i = s.length()-1; i >= 0; i--)
+ {
+ tmpStr += s[(unsigned int)i];
+ }
+
+ return tmpStr;
+}
+
+
+// This function reads the kwinicewmrc config file
+void ThemeHandler::readConfig()
+{
+ KConfig conf("kwinicewmrc");
+ conf.setGroup("General");
+ themeName = conf.readEntry("CurrentTheme");
+ themeTitleTextColors = conf.readBoolEntry("ThemeTitleTextColors", true);
+ showMenuButtonIcon = conf.readBoolEntry("ShowMenuButtonIcon", false);
+ titleBarOnTop = conf.readBoolEntry("TitleBarOnTop", true);
+
+ customButtonPositions = KDecoration::options()->customButtonPositions();
+ if (customButtonPositions)
+ {
+ *titleButtonsLeft = KDecoration::options()->titleButtonsLeft();
+ *titleButtonsRight = KDecoration::options()->titleButtonsRight();
+
+ // Convert KDE to icewm style buttons
+ convertButtons( *titleButtonsLeft );
+ convertButtons( *titleButtonsRight );
+ }
+
+ // Provide a default theme alias
+ if (themeName == "default")
+ themeName = "";
+}
+
+
+// This creates the dynamic pixmaps upon loading the style
+// into the pixmap buffers above, and configures the dimensioning stuff.
+void ThemeHandler::initTheme()
+{
+ // Add a slash if required
+ if ( !themeName.isEmpty() )
+ themeName += "/";
+
+ // We use kconfig to read icewm config files...
+ // this is easy since icewm uses key=value pairs!
+ KConfig config( locate("data", QString("kwin/icewm-themes/") +
+ themeName + QString("default.theme")) );
+
+ // Load specifics, or use IceWM defaults instead.
+ borderSizeX = config.readNumEntry("BorderSizeX", 6);
+ borderSizeY = config.readNumEntry("BorderSizeY", 6);
+ cornerSizeX = config.readNumEntry("CornerSizeX", 24);
+ cornerSizeY = config.readNumEntry("CornerSizeY", 24);
+ titleBarCentered = (bool) config.readNumEntry("TitleBarCentered", 0);
+
+ // Check if readConfig() hasn't overridden this value...
+ if (!showMenuButtonIcon)
+ showMenuButtonIcon = (bool) config.readNumEntry("ShowMenuButtonIcon", 0);
+ titleBarHeight = config.readNumEntry("TitleBarHeight", 20);
+
+ if (!customButtonPositions)
+ {
+ // Read in the button configuration, stripping any quotes
+ // Ignore on all desktops 'd' on the left buttons
+ // (some themes look bad with it on by default)
+ *titleButtonsLeft = config.readEntry("TitleButtonsLeft", "s");
+ *titleButtonsLeft = titleButtonsLeft->replace( QRegExp(QString("\"")), "");
+ *titleButtonsRight = config.readEntry("TitleButtonsRight", "xmir");
+ *titleButtonsRight = titleButtonsRight->replace( QRegExp(QString("\"")), "");
+
+ // I have no idea why the right side buttons in icewm are reversed
+ *titleButtonsRight = reverseString( *titleButtonsRight );
+ }
+
+ // Read the default border and text colours from the config file
+ // And use IceWM defaults if not found
+ QString s;
+
+ s = config.readEntry("Look", "other");
+ if (s=="motif") themeLook = MOTIF;
+ else if (s=="warp3") themeLook = WARP3;
+ else if (s=="warp4") themeLook = WARP4;
+ else if (s=="win95") themeLook = WIN95;
+ else if (s=="nice") themeLook = NICE;
+ else themeLook = OTHER;
+
+ s = config.readEntry("ColorActiveBorder", "#C0C0C0");
+ *colorActiveBorder = decodeColor( s );
+ s = config.readEntry("ColorNormalBorder", "#C0C0C0");
+ *colorInActiveBorder = decodeColor( s );
+ s = config.readEntry("ColorActiveButton", "#C0C0C0");
+ *colorActiveButton = decodeColor( s );
+ s = config.readEntry("ColorNormalButton", "#C0C0C0");
+ *colorInActiveButton = decodeColor( s );
+
+ // Use these as a last resort
+ s = config.readEntry("ColorActiveTitleBar", "#0000A0");
+ *colorActiveTitleBar = decodeColor( s );
+ s = config.readEntry("ColorNormalTitleBar", "#808080");
+ *colorInActiveTitleBar = decodeColor( s );
+
+ // Read titlebar text colours
+ s = config.readEntry("ColorActiveTitleBarText", "#FFFFFF");
+ *colorActiveTitleBarText = decodeColor( s );
+ s = config.readEntry("ColorNormalTitleBarText", "#000000");
+ *colorInActiveTitleBarText = decodeColor( s );
+
+ // Use title text shadows only with theme title text colors
+ if ( themeTitleTextColors )
+ {
+ s = config.readEntry("ColorActiveTitleBarShadow");
+ if (!s.isEmpty())
+ {
+ *colorActiveTitleTextShadow = decodeColor( s );
+ useActiveShadow = true;
+ } else
+ useActiveShadow = false;
+
+ s = config.readEntry("ColorNormalTitleBarShadow");
+ if (!s.isEmpty())
+ {
+ *colorInActiveTitleTextShadow = decodeColor( s );
+ useInActiveShadow = true;
+ } else
+ useInActiveShadow = false;
+ } else
+ {
+ useActiveShadow = false;
+ useInActiveShadow = false;
+ }
+
+ // Stretch pixmaps for speed, where required
+ setPixmap( titleJ, "title", "J.xpm" );
+ setPixmap( titleL, "title", "L.xpm" );
+ setPixmap( titleS, "title", "S.xpm", true );
+
+ setPixmap( titleP, "title", "P.xpm" );
+ setPixmap( titleT, "title", "T.xpm", true );
+ setPixmap( titleM, "title", "M.xpm" );
+ setPixmap( titleB, "title", "B.xpm", true );
+ setPixmap( titleR, "title", "R.xpm" );
+ setPixmap( titleQ, "title", "Q.xpm" );
+
+ setPixmapButton( closePix, "close", ".xpm" );
+ setPixmapButton( depthPix, "depth", ".xpm" );
+ setPixmapButton( maximizePix, "maximize", ".xpm" );
+ setPixmapButton( minimizePix, "minimize", ".xpm" );
+ setPixmapButton( restorePix, "restore", ".xpm" );
+ setPixmapButton( hidePix, "hide", ".xpm" );
+ setPixmapButton( rollupPix, "rollup", ".xpm" );
+ setPixmapButton( rolldownPix, "rolldown", ".xpm" );
+ setPixmapButton( menuButtonPix,"menuButton",".xpm" );
+
+ // Top
+ setPixmap( frameTL, "frame", "TL.xpm" );
+ setPixmap( frameT, "frame", "T.xpm", true );
+ setPixmap( frameTR, "frame", "TR.xpm" );
+
+ // Sides
+ setPixmap( frameL, "frame", "L.xpm", true, Vertical );
+ setPixmap( frameR, "frame", "R.xpm", true, Vertical );
+
+ // Bottom
+ setPixmap( frameBL, "frame", "BL.xpm" );
+ setPixmap( frameB, "frame", "B.xpm", true );
+ setPixmap( frameBR, "frame", "BR.xpm" );
+
+ // Make sure border sizes are at least reasonable...
+ if (borderSizeX < 0)
+ borderSizeX = 0;
+ if (borderSizeY < 0)
+ borderSizeY = 0;
+ // ...and titleBarHeight as well
+ if (titleBarHeight < 0)
+ titleBarHeight = 0;
+
+ // This is a work-around for some themes
+ if (!titleT[Active])
+ titleT[Active] = duplicateValidPixmap( Active );
+
+ if (!titleB[Active])
+ titleB[Active] = duplicateValidPixmap( Active );
+
+
+ if (titleL[Active] && !titleL[InActive])
+ titleL[InActive] = duplicateValidPixmap( InActive, titleL[Active]->width() );
+
+ if (titleS[Active] && !titleS[InActive])
+ titleS[InActive] = duplicateValidPixmap( InActive, titleS[Active]->width() );
+
+ if (titleP[Active] && !titleP[InActive])
+ titleP[InActive] = duplicateValidPixmap( InActive, titleP[Active]->width() );
+
+ if (titleT[Active] && !titleT[InActive])
+ titleT[InActive] = duplicateValidPixmap( InActive, titleT[Active]->width() );
+
+ if (titleM[Active] && !titleM[InActive])
+ titleM[InActive] = duplicateValidPixmap( InActive, titleM[Active]->width() );
+
+ if (titleB[Active] && !titleB[InActive])
+ titleB[InActive] = duplicateValidPixmap( InActive, titleB[Active]->width() );
+
+ if (titleR[Active] && !titleR[InActive])
+ titleR[InActive] = duplicateValidPixmap( InActive, titleR[Active]->width() );
+}
+
+
+QPixmap* ThemeHandler::duplicateValidPixmap( bool act, int size )
+{
+ QPixmap* p1 = NULL;
+ // Use the stretch or title pixmaps instead
+ if ( titleS[act] )
+ p1 = new QPixmap( *titleS[act] );
+ else if ( titleB[act] )
+ p1 = new QPixmap( *titleB[act] );
+ else if ( titleT[act] )
+ p1 = new QPixmap( *titleT[act] );
+
+ // Stretch if required
+ if ( (size != -1) && p1 && (!p1->isNull()) )
+ p1 = stretchPixmap( p1, true, size );
+
+ return p1;
+}
+
+
+// Frees all memory used by pixmaps.
+void ThemeHandler::freePixmaps()
+{
+ freePixmapGroup( frameTL );
+ freePixmapGroup( frameT );
+ freePixmapGroup( frameTR );
+ freePixmapGroup( frameL );
+ freePixmapGroup( frameR );
+ freePixmapGroup( frameBL );
+ freePixmapGroup( frameB );
+ freePixmapGroup( frameBR );
+
+ freePixmapGroup( closePix );
+ freePixmapGroup( depthPix );
+ freePixmapGroup( maximizePix );
+ freePixmapGroup( minimizePix );
+ freePixmapGroup( restorePix );
+ freePixmapGroup( hidePix );
+ freePixmapGroup( rollupPix );
+ freePixmapGroup( rolldownPix );
+ freePixmapGroup( menuButtonPix );
+
+ freePixmapGroup( titleJ );
+ freePixmapGroup( titleL );
+ freePixmapGroup( titleS );
+ freePixmapGroup( titleP );
+ freePixmapGroup( titleT );
+ freePixmapGroup( titleM );
+ freePixmapGroup( titleB );
+ freePixmapGroup( titleR );
+ freePixmapGroup( titleQ );
+}
+
+
+// Frees a dynamic pixmap group from the heap.
+void ThemeHandler::freePixmapGroup( QPixmap* p[] )
+{
+ if (p)
+ {
+ if (p[Active]) delete p[Active];
+ if (p[InActive]) delete p[InActive];
+ p[Active] = NULL;
+ p[InActive] = NULL;
+ } else
+ qWarning("kwin-icewm: freePixmapGroup - invalid QPixmap** 'p'\n");
+}
+
+
+// Converts icewm colors #C0C0C0 or rgb:C0/C0/C0 to QColors
+QColor ThemeHandler::decodeColor( QString& s )
+{
+ // Make rgb:C0/C0/C0, or #C0/C0/C0 -> C0C0C0
+ s.replace( QRegExp("r"), "");
+ s.replace( QRegExp("g"), "");
+ s.replace( QRegExp("b"), "");
+ s.replace( QRegExp("#"), "");
+ s.replace( QRegExp("/"), "");
+ s.replace( QRegExp(":"), "");
+ s.replace( QRegExp("\\"), "");
+ s.replace( QRegExp("\""), "");
+
+ // Wierd error - return grey
+ if (s.length() != 6)
+ return QColor( 0xC0, 0xC0, 0xC0 );
+
+ // Qt makes this conversion very easy
+ return QColor( QString("#") + s );
+}
+
+
+// Stretches tiny pixmaps vertically or horizontally, taking into account
+// repetition in patterns, so as not to make them mismatched
+QPixmap* ThemeHandler::stretchPixmap( QPixmap* src, bool stretchHoriz, int stretchSize )
+{
+ if (!src) return NULL;
+ if (src->isNull()) return NULL;
+
+ int s_inc, size;
+
+ // If its the right size already, just return
+ if (stretchSize == -1)
+ {
+ if (stretchHoriz)
+ s_inc = src->width();
+ else
+ s_inc = src->height();
+
+ size = s_inc;
+ if (size >= 100)
+ return src;
+
+ // Stretch an appropriate amount - taking care of pattern repetition
+ while( size < 100 )
+ size += s_inc;
+ } else
+ size = stretchSize;
+
+ QPixmap* p = new QPixmap();
+ if ( stretchHoriz )
+ p->resize( size, src->height() );
+ else
+ p->resize( src->width(), size );
+
+ QPainter pnt( p );
+ if ( stretchHoriz )
+ pnt.drawTiledPixmap( 0, 0, size, src->height(), *src);
+ else
+ pnt.drawTiledPixmap( 0, 0, src->width(), size, *src);
+ pnt.end();
+
+ delete src;
+ return p;
+}
+
+static void draw3DRect(QPainter &pnt, QColor &col, int x, int y, int w, int h, bool up) {
+ QColor light = col.light(135);
+ QColor dark = col.dark(140);
+ pnt.setPen(up ? light : dark);
+ pnt.drawLine(x, y, x+w, y);
+ pnt.drawLine(x, y, x, y+h);
+ pnt.setPen(up ? dark : light);
+ pnt.drawLine(x, y+h, x+w, y+h);
+ pnt.drawLine(x+w, y, x+w, y+h);
+ pnt.setPen(col);
+ pnt.drawPoint(x+w, y);
+ pnt.drawPoint(x, y+h);
+}
+
+void ThemeHandler::setPixmapButton( QPixmap* p[], QString s1, QString s2)
+{
+ if ( p[Active] )
+ qWarning("kwin-icewm: setPixmap - should be null (1)\n");
+ if ( p[InActive] )
+ qWarning("kwin-icewm: setPixmap - should be null (2)\n");
+
+ QString str = locate("appdata", QString("icewm-themes/")
+ + themeName + s1 + "A" + s2);
+ if (str.isEmpty())
+ str = locate("appdata", QString("icewm-themes/")
+ + themeName + s1 + s2);
+
+ QPixmap *qp = new QPixmap(str);
+ QColor cActive = themeLook == WIN95 ? *colorActiveTitleBar : *colorActiveButton;
+ QColor cInActive = themeLook == WIN95 ? *colorInActiveTitleBar : *colorInActiveButton;
+
+ if (!qp->isNull() && themeLook > 0) {
+ int w = qp->width();
+ if (themeLook > 0 && titleBarHeight > w) w = titleBarHeight;
+ p[Active] = new QPixmap(w, 2*titleBarHeight );
+ p[Active] -> fill(cActive);
+
+ QPainter pnt( p[Active] );
+
+ int offX = (w - qp->width())/2;
+ int offY = (titleBarHeight - qp->height())/2;
+ if (offY < 0) offY = 0;
+
+ if (themeLook == WIN95) {
+ draw3DRect(pnt, *colorActiveButton, offX-1, offY-1,
+ qp->width()+1, qp->height()+1, true);
+ draw3DRect(pnt, *colorActiveButton, offX-1, offY-1 + titleBarHeight,
+ qp->width()+1, qp->height()+1, false);
+ } else if (themeLook != WARP4) {
+ draw3DRect(pnt, *colorActiveButton, 0, 0,
+ w-1, titleBarHeight-1, true);
+ draw3DRect(pnt, *colorActiveButton, 0, titleBarHeight,
+ w-1, 2*titleBarHeight-1, false);
+ }
+
+ pnt.drawPixmap(offX, offY, *qp);
+ if (qp->height() <= titleBarHeight) {
+ pnt.drawPixmap(offX, titleBarHeight+offY, *qp);
+ }
+ pnt.end();
+ delete qp;
+ } else {
+ p[Active] = qp;
+ }
+
+ str = locate("appdata", QString("icewm-themes/")
+ + themeName + s1 + "I" + s2);
+ if (str.isEmpty())
+ str = locate("appdata", QString("icewm-themes/")
+ + themeName + s1 + s2);
+
+ qp = new QPixmap(str);
+ if (!qp->isNull() && themeLook > 0) {
+ int w = qp->width();
+ if (titleBarHeight > w) w = titleBarHeight;
+ p[InActive] = new QPixmap(w, 2*titleBarHeight );
+ p[InActive] -> fill(cInActive);
+
+ QPainter pnt( p[InActive] );
+
+ int offX = (w - qp->width())/2;
+ int offY = (titleBarHeight - qp->height())/2;
+ if (offY < 0) offY = 0;
+
+ if (themeLook == WIN95) {
+ draw3DRect(pnt, *colorInActiveButton, offX-1, offY-1,
+ qp->width()+1, qp->height()+1, true);
+ draw3DRect(pnt, *colorInActiveButton, offX-1, offY-1 + titleBarHeight,
+ qp->width()+1, qp->height()+1, false);
+ } else if (themeLook != WARP4) {
+ draw3DRect(pnt, *colorInActiveButton, 0, 0,
+ w-1, titleBarHeight-1, true);
+ draw3DRect(pnt, *colorActiveButton, 0, titleBarHeight,
+ w-1, 2*titleBarHeight-1, false);
+ }
+ pnt.drawPixmap(offX, offY, *qp);
+ if (qp->height() <= titleBarHeight) {
+ pnt.drawPixmap(offX, titleBarHeight+offY, *qp);
+ }
+ pnt.end();
+ delete qp;
+ } else {
+ p[InActive] = qp;
+ }
+}
+
+
+
+
+// Loads the specified Active/InActive files into the specific pixmaps, and
+// can perform horizontal / vertical stretching if required for speed.
+// Tries to implement some icewm specific pixmap handling for some dodgy themes
+void ThemeHandler::setPixmap( QPixmap* p[], QString s1, QString s2,
+ bool stretch, bool stretchHoriz )
+{
+ if ( p[Active] )
+ qWarning("kwin-icewm: setPixmap - should be null (1)\n");
+ if ( p[InActive] )
+ qWarning("kwin-icewm: setPixmap - should be null (2)\n");
+
+ p[Active] = new QPixmap( locate("data", QString("kwin/icewm-themes/")
+ + themeName + s1 + "A" + s2) );
+ p[InActive] = new QPixmap( locate("data", QString("kwin/icewm-themes/")
+ + themeName + s1 + "I" + s2) );
+
+ // Stretch the pixmap if requested.
+ if ( stretch )
+ {
+ if (p[Active])
+ p[Active] = stretchPixmap( p[Active], stretchHoriz );
+ if (p[InActive])
+ p[InActive] = stretchPixmap( p[InActive], stretchHoriz );
+ }
+
+ if ( p[Active] && p[InActive] )
+ {
+ // Make sure active and inactive pixmaps are the same width for proper painting
+ if (p[Active]->width() > p[InActive]->width())
+ p[InActive] = stretchPixmap( p[InActive], true, p[Active]->width() );
+ }
+
+}
+
+
+// returns true if there were enough pixmaps loaded to
+// draw the pixmap frame properly.
+bool ThemeHandler::isFrameValid()
+{
+ return
+ ( validPixmaps( frameTL ) &&
+ validPixmaps( frameT ) &&
+ validPixmaps( frameTR ) &&
+ validPixmaps( frameL ) &&
+ validPixmaps( frameR ) &&
+ validPixmaps( frameBL ) &&
+ validPixmaps( frameB ) &&
+ validPixmaps( frameBR ) );
+}
+
+
+// Resets the theme, and re-clients all kwin's wrapped windows.
+bool ThemeHandler::reset( unsigned long)
+{
+ initialized = false;
+ freePixmaps();
+ readConfig();
+ initTheme();
+ validframe = isFrameValid();
+ initialized = true;
+
+ // recreate all clients
+ return true;
+}
+
+bool ThemeHandler::supports( Ability ability )
+{
+ switch( ability )
+ {
+ case AbilityAnnounceButtons:
+ case AbilityButtonMenu:
+ case AbilityButtonOnAllDesktops:
+ case AbilityButtonMinimize:
+ case AbilityButtonMaximize:
+ case AbilityButtonClose:
+ return true;
+ default:
+ return false;
+ };
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////////
+// IceWM button class
+////////////////////////////////////////////////////////////////////////////////////////////
+
+IceWMButton::IceWMButton(IceWMClient *parent, const char *name, QPixmap* (*p)[2],
+ bool isToggle, const QString& tip, const int realizeBtns )
+ : QButton(parent->widget(), name)
+{
+ m_realizeButtons = realizeBtns;
+ setTipText(tip);
+ setCursor(ArrowCursor);
+ // Eliminate any possible background flicker
+ setBackgroundMode( QWidget::NoBackground );
+ client = parent;
+ usePixmap( p );
+ setFixedSize( sizeHint() );
+ setToggleButton( isToggle );
+}
+
+
+void IceWMButton::setTipText(const QString &tip) {
+ if(KDecoration::options()->showTooltips()) {
+ QToolTip::remove(this );
+ QToolTip::add(this, tip );
+ }
+}
+
+
+QSize IceWMButton::sizeHint() const
+{
+ // Check for invalid data
+ if ( validPixmaps( (QPixmap**) (*pix) ) ) // Cast to avoid dumb warning
+ {
+ QPixmap* p = (*pix)[ client->isActive() ? Active : InActive ];
+ return( QSize(p->width(), titleBarHeight) );
+ } else
+ return( QSize(0, 0) );
+}
+
+
+void IceWMButton::usePixmap( QPixmap* (*p)[2] )
+{
+ if (validPixmaps( *p )) {
+ pix = p;
+ setFixedSize( (*pix)[Active]->width(), titleBarHeight );
+ repaint( false );
+ } else
+ pix = NULL;
+}
+
+
+void IceWMButton::drawButton(QPainter *pnt)
+{
+ if ( pix && validPixmaps(*pix) )
+ {
+ QPixmap* p = (*pix)[ client->isActive() ? Active : InActive ];
+
+ if( p && (!p->isNull()) )
+ {
+ int width = p->width();
+
+ // Only draw the lower pixmap 1/2 for down, and upper 1/2 for up state
+ if( isDown() || isOn() )
+ pnt->drawPixmap(0, 0, *p, 0, titleBarHeight, width, titleBarHeight);
+ else
+ pnt->drawPixmap(0, 0, *p, 0, 0, width, titleBarHeight);
+ }
+ } else
+ qWarning("kwin-icewm: Can't paint a null pixmap button");
+}
+
+
+void IceWMButton::turnOn( bool isOn )
+{
+ if ( isToggleButton() )
+ setOn( isOn );
+}
+
+
+void IceWMButton::mousePressEvent( QMouseEvent* e )
+{
+ last_button = e->button();
+ QMouseEvent me ( e->type(), e->pos(), e->globalPos(),
+ (e->button()&m_realizeButtons)?LeftButton:NoButton, e->state() );
+ QButton::mousePressEvent( &me );
+}
+
+
+void IceWMButton::mouseReleaseEvent( QMouseEvent* e )
+{
+ last_button = e->button();
+ QMouseEvent me ( e->type(), e->pos(), e->globalPos(),
+ (e->button()&m_realizeButtons)?LeftButton:NoButton, e->state() );
+ QButton::mouseReleaseEvent( &me );
+}
+
+
+
+////////////////////////////////////////////////////////////////////////////////////////////
+// IceWMClient class
+////////////////////////////////////////////////////////////////////////////////////////////
+
+IceWMClient::IceWMClient( KDecorationBridge* bridge, KDecorationFactory* factory )
+ : KDecoration (bridge, factory),
+ m_closing(false)
+{
+}
+
+
+IceWMClient::~IceWMClient()
+{
+ // Free the menu pixmaps if previously allocated
+ if ( menuButtonWithIconPix[Active] )
+ delete menuButtonWithIconPix[Active];
+ if ( menuButtonWithIconPix[InActive] )
+ delete menuButtonWithIconPix[InActive];
+}
+
+
+void IceWMClient::init()
+{
+ createMainWidget( WNoAutoErase | WStaticContents );
+ widget()->installEventFilter( this );
+
+ // Set button pointers to null so we can track things
+ for(int i= IceWMClient::BtnSysMenu; i < IceWMClient::BtnCount; i++)
+ button[i] = NULL;
+
+ // Make sure we can track the menu pixmaps too.
+ menuButtonWithIconPix[Active] = NULL;
+ menuButtonWithIconPix[InActive] = NULL;
+
+ // No flicker thanks
+ widget()->setBackgroundMode( NoBackground );
+
+ // Pack the windowWrapper() window within a grid layout
+ grid = new QGridLayout(widget(), 0, 0, 0);
+ grid->setResizeMode(QLayout::FreeResize);
+ grid->addRowSpacing(0, borderSizeY); // Top grab bar
+
+ // Do something IceWM can't do :)
+ if (titleBarOnTop) {
+ if( isPreview())
+ grid->addWidget( new QLabel( i18n( "<center><b>IceWM preview</b></center>" ), widget() ), 2, 1);
+ else
+ grid->addItem( new QSpacerItem( 0, 0 ), 2, 1);
+ // no shade flicker
+ grid->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
+ }
+ else {
+ // no shade flicker
+ grid->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
+ if( isPreview())
+ grid->addWidget( new QLabel( i18n( "<center><b>IceWM preview</b></center>" ), widget() ), 1, 1);
+ else
+ grid->addItem( new QSpacerItem( 0, 0 ), 1, 1);
+ }
+
+ grid->setRowStretch(1, 10);
+ grid->setRowStretch(2, 10);
+ grid->setColStretch(1, 10);
+ grid->addRowSpacing(3, borderSizeY);
+ grid->addColSpacing(0, borderSizeX);
+ grid->addColSpacing(2, borderSizeX);
+
+ // Pack the titlebar with spacers and buttons
+ hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
+ hb->setResizeMode( QLayout::FreeResize );
+
+ titleSpacerJ = addPixmapSpacer( titleJ );
+
+ addClientButtons( *titleButtonsLeft );
+ titleSpacerL = addPixmapSpacer( titleL );
+
+ // Centre titlebar if required.
+ QSizePolicy::SizeType spTitleBar;
+ spTitleBar = titleBarCentered ? QSizePolicy::Expanding : QSizePolicy::Maximum;
+ titleSpacerS = addPixmapSpacer( titleS, spTitleBar, 1 );
+ titleSpacerP = addPixmapSpacer( titleP );
+
+ titlebar = new QSpacerItem( titleTextWidth(caption()), titleBarHeight,
+ QSizePolicy::Preferred, QSizePolicy::Fixed );
+ hb->addItem(titlebar);
+
+ titleSpacerM = addPixmapSpacer( titleM );
+ titleSpacerB = addPixmapSpacer( titleB, QSizePolicy::Expanding, 1 );
+ titleSpacerR = addPixmapSpacer( titleR );
+
+ addClientButtons( *titleButtonsRight );
+
+ titleSpacerQ = addPixmapSpacer( titleQ );
+
+ if (titleBarOnTop)
+ grid->addLayout ( hb, 1, 1 );
+ else
+ grid->addLayout ( hb, 2, 1 );
+}
+
+
+// Adds the buttons to the hbox layout as per the buttons specified
+// in the button string 's'
+void IceWMClient::addClientButtons( const QString& s )
+{
+ if (!s.isEmpty())
+ for(unsigned int i = 0; i < s.length(); i++)
+ {
+ switch ( s[i].latin1() )
+ {
+ case 's':
+ // Create the menu icons, and render with the current mini-icon
+ // if explicitly requested by the theme.
+ if ( (validPixmaps(menuButtonPix) || showMenuButtonIcon) && !button[BtnSysMenu])
+ {
+ if (showMenuButtonIcon) {
+ renderMenuIcons();
+ button[BtnSysMenu] = new IceWMButton(this, "menu",
+ &menuButtonWithIconPix, false, i18n("Menu"), LeftButton|RightButton);
+ }
+ else
+ button[BtnSysMenu] = new IceWMButton(this, "menu",
+ &menuButtonPix, false, i18n("Menu"));
+
+ connect( button[BtnSysMenu], SIGNAL(pressed()),
+ this, SLOT(menuButtonPressed()));
+ connect( button[BtnSysMenu], SIGNAL(released()),
+ this, SLOT(menuButtonReleased()));
+ hb->addWidget( button[BtnSysMenu] );
+ }
+ break;
+
+ case 'x':
+ if ( validPixmaps(closePix) && !button[BtnClose] && isCloseable())
+ {
+ button[BtnClose] = new IceWMButton(this, "close",
+ &closePix, false, i18n("Close"));
+ hb->addWidget( button[BtnClose] );
+ connect( button[BtnClose], SIGNAL(clicked()),
+ this, SLOT(closeWindow()));
+ }
+ break;
+
+ case 'm':
+ if ( validPixmaps(maximizePix) && !button[BtnMaximize] && isMaximizable() )
+ {
+ button[BtnMaximize] = new IceWMButton(this, "maximize",
+ &maximizePix, false, i18n("Maximize"), LeftButton|MidButton|RightButton);
+ hb->addWidget( button[BtnMaximize] );
+ connect( button[BtnMaximize], SIGNAL(clicked()),
+ this, SLOT(slotMaximize()));
+ }
+ break;
+
+ case 'i':
+ if ( validPixmaps(minimizePix) && !button[BtnMinimize] &&
+ isMinimizable() )
+ {
+ button[BtnMinimize] = new IceWMButton(this, "minimize",
+ &minimizePix, false, i18n("Minimize"));
+ hb->addWidget( button[BtnMinimize] );
+ connect( button[BtnMinimize], SIGNAL(clicked()),
+ this, SLOT(minimize()));
+ }
+ break;
+
+ /* Not yet implemented - how's hide useful anyway?
+ case 'h':
+ if ( button[BtnHide] && !button[BtnHide] )
+ hb->addWidget( button[BtnHide] );
+ break; */
+
+ case 'r':
+ // NOTE: kwin doesn't have toggleShade() in clients.h !
+ if ( validPixmaps(rollupPix) && !button[BtnRollup] )
+ {
+ button[BtnRollup] = new IceWMButton(this, "shade",
+ isSetShade() ? &rolldownPix : &rollupPix,
+ false, i18n("Rollup"));
+ hb->addWidget( button[BtnRollup] );
+ connect( button[BtnRollup], SIGNAL(clicked()),
+ this, SLOT(toggleShade()));
+ }
+ break;
+
+ case 'd':
+ // Make depth == on all desktops
+ if ( validPixmaps(depthPix) && !button[BtnDepth] )
+ {
+ button[BtnDepth] = new IceWMButton(this, "on_all_desktops",
+ &depthPix, true, isOnAllDesktops()?i18n("Not on all desktops"):i18n("On all desktops"));
+ button[BtnDepth]->turnOn( isOnAllDesktops() );
+ hb->addWidget( button[BtnDepth] );
+ connect( button[BtnDepth], SIGNAL(clicked()),
+ this, SLOT(toggleOnAllDesktops()));
+ }
+ break;
+ }
+ }
+}
+
+
+// Adds a pixmap to the titlebar layout via the use of a nice QSpacerItem
+QSpacerItem* IceWMClient::addPixmapSpacer( QPixmap* p[], QSizePolicy::SizeType s, int hsize )
+{
+ QSpacerItem* sp;
+
+ // Add a null spacer for zero image
+ if ( p && p[Active] )
+ {
+ int w = (hsize == -1) ? p[Active]->width(): hsize;
+ sp = new QSpacerItem( w, titleBarHeight, s, QSizePolicy::Fixed );
+ }
+ else
+ sp = new QSpacerItem(0, 0, QSizePolicy::Maximum, QSizePolicy::Fixed );
+
+ hb->addItem( sp );
+ return sp;
+}
+
+
+void IceWMClient::renderMenuIcons()
+{
+ QPixmap miniIcon( icon().pixmap( QIconSet::Small, QIconSet::Normal) );
+
+ if (!miniIcon.isNull())
+ for(int i = 0; i < 2; i++) {
+ if ( menuButtonWithIconPix[i] )
+ delete menuButtonWithIconPix[i];
+
+ // Try to be more friendly to dodgy themes - icewm assumes a square menu button
+ // but some pixmap themes don't provide a square menu button.
+ int w = titleBarHeight;
+ if (validPixmaps(menuButtonPix) && menuButtonPix[i]->width() > w)
+ w = menuButtonPix[i]->width();
+ menuButtonWithIconPix[i] = new QPixmap(w, 2*titleBarHeight );
+ if (themeLook != WIN95)
+ menuButtonWithIconPix[i] -> fill((i==0) ? *colorInActiveButton : *colorActiveButton);
+ else
+ menuButtonWithIconPix[i] -> fill((i==0) ? *colorInActiveTitleBar : *colorActiveTitleBar);
+ QPainter pnt( menuButtonWithIconPix[i] );
+
+ if (themeLook > 0 && themeLook != WIN95 && themeLook != WARP4) {
+ draw3DRect(pnt, *colorActiveButton, 0, 0,
+ w-1, titleBarHeight-1, true);
+ draw3DRect(pnt, *colorActiveButton, 0, titleBarHeight,
+ w-1, 2*titleBarHeight-1, false);
+ }
+ if (validPixmaps(menuButtonPix)) {
+ pnt.drawPixmap(0, 0, *menuButtonPix[i]);
+ }
+ int offset = (titleBarHeight - miniIcon.width())/2;
+ if (offset<0) offset = 0;
+ // Paint the mini icon over the menu pixmap in the centre
+ pnt.drawPixmap( offset, offset, miniIcon );
+ pnt.drawPixmap( offset, titleBarHeight+offset, miniIcon );
+ pnt.end();
+ }
+
+}
+
+
+void IceWMClient::slotMaximize()
+{
+ maximize(button[BtnMaximize]->last_button);
+}
+
+void IceWMClient::toggleShade()
+{
+ setShade(!isSetShade());
+}
+
+int IceWMClient::titleTextWidth( const QString& s )
+{
+ // Obtains the actual width of the text, using the titlebar font
+ QSize size;
+ QFontMetrics fm( options()->font(true) );
+ size = fm.size( 0, s );
+ return size.width();
+}
+
+
+void IceWMClient::borders(int& left, int& right, int& top, int& bottom) const
+{
+ left = borderSizeX;
+ right = borderSizeX;
+ if( titleBarOnTop ) {
+ top = titleBarHeight + borderSizeY;
+ bottom = borderSizeY;
+ } else {
+ top = borderSizeY;
+ bottom = titleBarHeight + borderSizeY;
+ }
+}
+
+
+void IceWMClient::resize( const QSize& s )
+{
+ widget()->resize( s );
+}
+
+
+QSize IceWMClient::minimumSize() const
+{
+ return widget()->minimumSize();
+}
+
+
+// Repaint nicely upon resize to minimise flicker.
+void IceWMClient::resizeEvent( QResizeEvent* e )
+{
+ calcHiddenButtons();
+
+ if (widget()->isVisibleToTLW())
+ {
+ widget()->update(widget()->rect());
+ int dx = 0;
+ int dy = 0;
+
+ if ( e->oldSize().width() != widget()->width() )
+ dx = 32 + QABS( e->oldSize().width() - width() );
+
+ if ( e->oldSize().height() != height() )
+ dy = 8 + QABS( e->oldSize().height() - height() );
+
+ if ( dy )
+ widget()->update( 0, height() - dy + 1, width(), dy );
+
+ if ( dx )
+ {
+ widget()->update( width() - dx + 1, 0, dx, height() );
+ widget()->update( QRect( QPoint(4,4), titlebar->geometry().bottomLeft() - QPoint(1,0) ) );
+ widget()->update( QRect( titlebar->geometry().topRight(), QPoint( width() - 4, titlebar->geometry().bottom() ) ) );
+ widget()->repaint(titlebar->geometry(), false);
+ }
+ }
+}
+
+
+// IceWM Paint magic goes here.
+void IceWMClient::paintEvent( QPaintEvent* )
+{
+ QColor colorTitleShadow;
+ QColor colorTitle;
+ QColor c1;
+ int rx, rw;
+
+ QPainter p( widget() );
+ int act = isActive() ? Active: InActive;
+
+ // Determine titlebar shadow colors
+ bool useShadow = isActive() ? useActiveShadow : useInActiveShadow;
+ if ( useShadow )
+ colorTitleShadow = isActive() ? *colorActiveTitleTextShadow : *colorInActiveTitleTextShadow;
+
+ if ( themeTitleTextColors )
+ colorTitle = isActive()? *colorActiveTitleBarText : *colorInActiveTitleBarText;
+ else
+ colorTitle = options()->color(ColorFont, isActive());
+
+ // Obtain widget bounds.
+ QRect r;
+ r = widget()->rect();
+ int fillWidth = r.width() - 2*borderSizeX;
+ int y = r.y();
+ int x = r.x();
+ int w = r.width();
+ int h = r.height();
+
+ // Do we have pixmaps for the frame?
+ if (validframe)
+ {
+ // Top corner
+ p.drawPixmap(0, 0, *frameTL[ act ], 0, 0, cornerSizeX, borderSizeY);
+ p.drawPixmap(0, 0, *frameTL[ act ], 0, 0, borderSizeX, cornerSizeY);
+
+ // Top right corner
+ p.drawPixmap(w-cornerSizeX, 0, *frameTR[ act ],
+ frameTR[act]->width()-cornerSizeX, 0, cornerSizeX, borderSizeY);
+ p.drawPixmap(w-borderSizeX, 0, *frameTR[ act ],
+ frameTR[act]->width()-borderSizeX, 0, borderSizeX, cornerSizeY);
+
+ // Top bar
+ p.drawTiledPixmap( cornerSizeX, 0, w-(2*cornerSizeX), borderSizeY, *frameT[ act ] );
+
+ // Left bar
+ p.drawTiledPixmap( 0, cornerSizeY, borderSizeX, h-(2*cornerSizeY), *frameL[ act ] );
+
+ // Right bar
+ p.drawTiledPixmap( w-borderSizeX, cornerSizeY, borderSizeX, h-(2*cornerSizeY),
+ *frameR[ act ],frameR[act]->width()-borderSizeX );
+
+ // Bottom left corner
+ p.drawPixmap(0, h-borderSizeY, *frameBL[ act ],
+ 0, frameBL[act]->height()-borderSizeY, cornerSizeX, borderSizeY);
+ p.drawPixmap(0, h-cornerSizeY, *frameBL[ act ],
+ 0, frameBL[act]->height()-cornerSizeY, borderSizeX, cornerSizeY);
+
+ // Bottom right corner
+ p.drawPixmap(w-cornerSizeX, h-borderSizeY, *frameBR[ act ],
+ frameBR[act]->width()-cornerSizeX, frameBR[act]->height()-borderSizeY,
+ cornerSizeX, borderSizeY);
+
+ p.drawPixmap(w-borderSizeX, h-cornerSizeY, *frameBR[ act ],
+ frameBR[act]->width()-borderSizeX, frameBR[act]->height()-cornerSizeY,
+ borderSizeX, cornerSizeY);
+
+ // Bottom bar
+ p.drawTiledPixmap(cornerSizeX, h-borderSizeY, w-(2*cornerSizeX), borderSizeY,
+ *frameB[ act ], 0, frameB[ act ]->height()-borderSizeY );
+
+ // Ensure uncovered areas during shading are painted with something
+ p.setPen( *colorInActiveBorder );
+ if (titleBarOnTop)
+ p.drawLine( x+borderSizeX, y+h-borderSizeY-1,
+ x+w-borderSizeX-1, y+h-borderSizeY-1);
+ else
+ p.drawLine( x+borderSizeX, y+borderSizeY,
+ x+w-borderSizeX-1, y+borderSizeY);
+
+ } else
+ {
+ // Draw a stock IceWM frame instead of a pixmap frame
+ c1 = isActive() ? *colorActiveBorder : *colorInActiveBorder;
+
+ if (themeLook == WARP3 || themeLook == MOTIF) {
+ draw3DRect(p, c1, x, y, w-1, h-1, true);
+ p.setPen(c1);
+ p.drawRect(x+1, y+1, w-2, h-2);
+ } else {
+ p.setPen( c1.light(135) );
+ p.drawLine(0, 0, w-2, 0);
+ p.drawLine(0, 0, 0, h-2);
+
+ p.setPen(c1);
+ p.drawLine(1, 1, w-3, 1);
+ p.drawLine(1, 1, 1, h-3);
+
+ p.setPen( c1.dark(140) );
+ p.drawLine(1, h-2, w-2, h-2);
+ p.drawLine(w-2, 1, w-2, h-2);
+
+ p.setPen( Qt::black );
+ p.drawLine(w-1, 0, w-1, h-1);
+ p.drawLine(0, h-1, w-1, h-1);
+ }
+
+
+ // Fill frame border if required
+ if (borderSizeX > 2)
+ {
+ // Fill Vertical sizes
+ p.fillRect( x+2, y+2, borderSizeX-2, h-4, c1);
+ p.fillRect( w-borderSizeX, y+2, borderSizeX-2, h-4, c1);
+ }
+
+ if (borderSizeY > 2)
+ {
+ // Fill horizontal frame parts
+ p.fillRect( x+borderSizeX, y+2, fillWidth, borderSizeY-2, c1);
+ p.fillRect( x+borderSizeX, h-borderSizeY, fillWidth, borderSizeY-2, c1);
+ }
+
+ if (themeLook == WARP3 || themeLook == MOTIF) {
+ draw3DRect(p, c1, x+borderSizeX-1, y+borderSizeY-1,
+ w+1-2*borderSizeX, h+1-2*borderSizeY, false);
+ }
+ if (themeLook == MOTIF && !isShade()) {
+ int xext = titleBarHeight + borderSizeX - 1;
+ int yext = titleBarHeight + borderSizeY - 1;
+
+ int xext2 = w-xext-2;
+ int yext2 = h-yext-2;
+
+ int bX = w - borderSizeX-1;
+ int bY = h - borderSizeY-1;
+
+ p.setPen( c1.dark(140) );
+ p.drawLine(xext, 0, xext, borderSizeY);
+ p.drawLine(xext2, 0, xext2, borderSizeY);
+ p.drawLine(xext, bY, xext, h-1);
+ p.drawLine(xext2, bY, xext2, h-1);
+
+ p.drawLine(0, yext, borderSizeX, yext);
+ p.drawLine(0, yext2, borderSizeX, yext2);
+ p.drawLine(bX, yext, w-1, yext);
+ p.drawLine(bX, yext2, w-1, yext2);
+
+ p.setPen( c1.light(135) );
+
+ ++xext; ++yext; ++xext2; ++yext2;
+
+ p.drawLine(xext, 0, xext, borderSizeY);
+ p.drawLine(xext2, 0, xext2, borderSizeY);
+ p.drawLine(xext, bY, xext, h-1);
+ p.drawLine(xext2, bY, xext2, h-1);
+
+ p.drawLine(0, yext, borderSizeX, yext);
+ p.drawLine(0, yext2, borderSizeX, yext2);
+ p.drawLine(bX, yext, w-1, yext);
+ p.drawLine(bX, yext2, w-1, yext2);
+
+
+ }
+
+ // Ensure uncovered areas during shading are painted with something
+ p.setPen( *colorInActiveBorder );
+ if (titleBarOnTop)
+ p.drawLine( x+borderSizeX, y+h-borderSizeY-1,
+ x+w-borderSizeX-1, y+h-borderSizeY-1);
+ else
+ p.drawLine( x+borderSizeX, y+borderSizeY,
+ x+w-borderSizeX-1, y+borderSizeY);
+ }
+
+ // Draw the title elements, if we need to draw a titlebar.
+ if (titleBarHeight > 0)
+ {
+ QPixmap* titleBuffer = new QPixmap( width()-(2*borderSizeX), titleBarHeight );
+ QPainter p2( titleBuffer, this );
+ titleBuffer->fill( act ? *colorActiveTitleBar : *colorInActiveTitleBar );
+
+ r = titleSpacerJ->geometry();
+ if (!r.isEmpty() && titleJ[ act ])
+ p2.drawPixmap( r.x()-borderSizeX, 0, *titleJ[ act ]);
+
+ r = titleSpacerL->geometry();
+ if (!r.isEmpty() && titleL[ act ])
+ p2.drawPixmap( r.x()-borderSizeX, 0, *titleL[ act ]);
+
+ r = titleSpacerS->geometry();
+ if (!r.isEmpty() && titleS[ act ])
+ p2.drawTiledPixmap( r.x()-borderSizeX, 0, r.width(), titleBarHeight, *titleS[ act ]);
+
+ r = titleSpacerP->geometry();
+ if (!r.isEmpty() && titleP[ act ])
+ p2.drawPixmap( r.x()-borderSizeX, 0, *titleP[ act ]);
+
+ r = titlebar->geometry();
+ if (!r.isEmpty() && titleT[ act ] )
+ p2.drawTiledPixmap( r.x()-borderSizeX, 0, r.width(), titleBarHeight, *titleT[ act ]);
+
+ r = titleSpacerM->geometry();
+ if (!r.isEmpty() && titleM[ act ])
+ p2.drawPixmap( r.x()-borderSizeX, 0, *titleM[ act ], 0, 0, r.width(), r.height());
+
+ r = titleSpacerB->geometry();
+ if (!r.isEmpty() && titleB[ act ])
+ p2.drawTiledPixmap( r.x()-borderSizeX, 0, r.width(), titleBarHeight, *titleB[ act ]);
+
+ r = titleSpacerR->geometry();
+ if (!r.isEmpty() && titleR[ act ])
+ p2.drawPixmap( r.x()-borderSizeX, 0, *titleR[ act ], 0, 0, r.width(), r.height());
+
+ r = titleSpacerQ->geometry();
+ if (!r.isEmpty() && titleQ[ act ])
+ p2.drawPixmap( r.x()-borderSizeX, 0, *titleQ[ act ], 0, 0, r.width(), r.height());
+
+ p2.setFont( options()->font(true) );
+
+ // Pre-compute as much as possible
+ r = titlebar->geometry();
+ rx = r.x() - borderSizeX;
+ rw = width()-(2*borderSizeX)-r.x();
+
+ // Paint a title text shadow if requested
+ if ( useShadow )
+ {
+ p2.setPen( colorTitleShadow );
+ p2.drawText(rx+1, 1, rw, titleBarHeight, AlignLeft|AlignVCenter, caption());
+ }
+
+ // Draw the title text
+ p2.setPen( colorTitle );
+ p2.drawText(rx, 0, rw, titleBarHeight, AlignLeft|AlignVCenter, caption());
+ p2.end();
+
+ bitBlt( widget(), borderSizeX, hb->geometry().y(), titleBuffer );
+
+ delete titleBuffer;
+ }
+}
+
+
+void IceWMClient::showEvent(QShowEvent *ev)
+{
+ calcHiddenButtons();
+
+ titlebar->changeSize( titleTextWidth(caption()), titleBarHeight,
+ QSizePolicy::Preferred, QSizePolicy::Fixed );
+ grid->activate();
+ widget()->show();
+ IceWMClient::showEvent(ev);
+}
+
+
+void IceWMClient::mouseDoubleClickEvent( QMouseEvent * e )
+{
+ if( e->button() != LeftButton )
+ return;
+
+ QRect r;
+ if (titleBarOnTop)
+ r.setRect( borderSizeX, borderSizeY, width()-(2*borderSizeX), titleBarHeight);
+ else
+ r.setRect( borderSizeX, height()-borderSizeY-titleBarHeight,
+ width()-(2*borderSizeX), titleBarHeight);
+
+ if (r.contains( e->pos() ) )
+ titlebarDblClickOperation();
+
+}
+
+
+void IceWMClient::wheelEvent(QWheelEvent *e)
+{
+ if (isSetShade() || QRect( 0, 0, width(), titleBarHeight ).contains( e->pos() ) )
+ titlebarMouseWheelOperation( e->delta());
+}
+
+
+// Called via Client class when the miniIcon() changes
+void IceWMClient::iconChange()
+{
+ if (validPixmaps(menuButtonPix) && showMenuButtonIcon)
+ {
+ if (button[BtnSysMenu])
+ {
+ renderMenuIcons();
+ button[BtnSysMenu]->usePixmap( &menuButtonWithIconPix );
+ if (button[BtnSysMenu]->isVisible())
+ button[BtnSysMenu]->repaint(false);
+ }
+ }
+}
+
+
+void IceWMClient::desktopChange()
+{
+ if (button[BtnDepth])
+ {
+ button[BtnDepth]->turnOn( isOnAllDesktops() );
+ button[BtnDepth]->repaint(false);
+ button[BtnDepth]->setTipText(isOnAllDesktops() ? i18n("Not on all desktops") : i18n("On all desktops"));
+ }
+}
+
+
+// Please don't modify the following unless you want layout problems
+void IceWMClient::captionChange()
+{
+ QRect r( 0, borderSizeY, geometry().width(), titleBarHeight);
+
+ titlebar->changeSize( titleTextWidth( caption() ), titleBarHeight,
+ QSizePolicy::Preferred, QSizePolicy::Fixed );
+ titlebar->invalidate();
+ grid->activate();
+ widget()->repaint( r, false );
+}
+
+
+void IceWMClient::maximizeChange()
+{
+ // Change the button pixmap to restore if required
+ if (button[BtnMaximize] && validPixmaps(restorePix))
+ {
+ button[BtnMaximize]->usePixmap( (maximizeMode()==MaximizeFull) ? &restorePix : &maximizePix );
+ button[BtnMaximize]->setTipText( (maximizeMode()==MaximizeFull) ? i18n("Restore") : i18n("Maximize"));
+ }
+}
+
+
+void IceWMClient::shadeChange()
+{
+ // Change the button pixmap to rolldown if required
+ if (button[BtnRollup] && validPixmaps(rolldownPix))
+ {
+ button[BtnRollup]->usePixmap( isSetShade() ? &rolldownPix : &rollupPix );
+ button[BtnRollup]->setTipText( isSetShade() ? i18n("Rolldown") : i18n("Rollup"));
+ }
+
+}
+
+
+void IceWMClient::activeChange()
+{
+ widget()->repaint(false);
+
+ // Reset the button pixmaps.
+ for(int i= IceWMClient::BtnSysMenu; i < IceWMClient::BtnCount; i++)
+ if(button[i])
+ button[i]->repaint( false );
+}
+
+
+// This does the showing / hiding button magic
+// for variable positioned buttons.
+void IceWMClient::calcHiddenButtons()
+{
+ const int minwidth = 220; // Minimum width where all buttons are shown
+ const int btn_width = 20; // Average width
+
+ // Show/Hide buttons in this order - OnAllDesktops, Maximize, Menu, Rollup, Minimize, Close.
+ IceWMButton* btnArray[] = { button[BtnDepth], button[BtnMaximize], button[BtnSysMenu],
+ button[BtnRollup], button[BtnMinimize], button[BtnClose] };
+
+ int current_width = width();
+ int count = 0;
+ int i;
+
+ // Find out how many buttons we have to hide.
+ while (current_width < minwidth)
+ {
+ current_width += btn_width;
+ count++;
+ }
+
+ // Bound the number of buttons to hide
+ if (count > 6) count = 6;
+
+ // Hide the required buttons...
+ for(i = 0; i < count; i++)
+ {
+ if (btnArray[i] && btnArray[i]->isVisible() )
+ btnArray[i]->hide();
+ }
+
+ // Show the rest of the buttons...
+ for(i = count; i < 6; i++)
+ {
+ if (btnArray[i] && (!btnArray[i]->isVisible()) )
+ btnArray[i]->show();
+ }
+}
+
+
+// Mouse position code modified from that in workspace.cpp
+IceWMClient::Position IceWMClient::mousePosition( const QPoint& p ) const
+{
+ int rangeX = cornerSizeX;
+ int rangeY = cornerSizeY;
+ int borderX = borderSizeX;
+ int borderY = borderSizeY;
+
+ Position m = PositionCenter;
+
+ if ((p.x() > borderX && p.x() < width() - borderX) &&
+ ( p.y() > borderY && p.y() < height() - borderY))
+ return PositionCenter;
+
+ if ( p.y() <= rangeY && p.x() <= rangeX)
+ m = PositionTopLeft;
+ else if ( p.y() >= height()-rangeY && p.x() >= width()-rangeX)
+ m = PositionBottomRight;
+ else if ( p.y() >= height()-rangeX && p.x() <= rangeX)
+ m = PositionBottomLeft;
+ else if ( p.y() <= rangeY && p.x() >= width()-rangeX)
+ m = PositionTopRight;
+ else if ( p.y() <= borderY )
+ m = PositionTop;
+ else if ( p.y() >= height()-borderY )
+ m = PositionBottom;
+ else if ( p.x() <= borderX )
+ m = PositionLeft;
+ else if ( p.x() >= width()-borderX )
+ m = PositionRight;
+ else
+ m = PositionCenter;
+ return m;
+}
+
+
+void IceWMClient::menuButtonPressed()
+{
+ static QTime t;
+ static IceWMClient* lastClient = NULL;
+ bool dbl = ( lastClient == this && t.elapsed() <= QApplication::doubleClickInterval());
+ lastClient = this;
+ t.start();
+
+ if (dbl)
+ {
+ m_closing = true;
+ return;
+ }
+
+ QPoint menuPoint ( button[BtnSysMenu]->rect().bottomLeft() );
+
+ // Move to right if menu on rhs, otherwise on left
+ // and make this depend on windowWrapper(), not button.
+
+ KDecorationFactory* f = factory();
+ showWindowMenu( button[BtnSysMenu]->mapToGlobal(menuPoint) );
+ if( !f->exists( this )) // 'this' was deleted
+ return;
+ button[BtnSysMenu]->setDown(false);
+}
+
+void IceWMClient::menuButtonReleased()
+{
+ if (m_closing)
+ closeWindow();
+}
+
+bool IceWMClient::eventFilter( QObject* o, QEvent* e )
+{
+ if( o != widget())
+ return false;
+ switch( e->type())
+ {
+ case QEvent::Resize:
+ resizeEvent(static_cast< QResizeEvent* >( e ) );
+ return true;
+ case QEvent::Paint:
+ paintEvent(static_cast< QPaintEvent* >( e ) );
+ return true;
+ case QEvent::MouseButtonDblClick:
+ mouseDoubleClickEvent(static_cast< QMouseEvent* >( e ) );
+ return true;
+ case QEvent::MouseButtonPress:
+ processMousePressEvent(static_cast< QMouseEvent* >( e ) );
+ return true;
+ case QEvent::Wheel:
+ wheelEvent( static_cast< QWheelEvent* >( e ));
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+}
+
+extern "C"
+{
+ KDE_EXPORT KDecorationFactory *create_factory()
+ {
+ IceWM::clientHandler = new IceWM::ThemeHandler;
+ return IceWM::clientHandler;
+ }
+}
+
+
+#include "icewm.moc"
+
+// vim: ts=4
diff --git a/kwin-styles/icewm/icewm.desktop b/kwin-styles/icewm/icewm.desktop
new file mode 100644
index 00000000..387caa0c
--- /dev/null
+++ b/kwin-styles/icewm/icewm.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=IceWM
+Name[cy]=RhewWM
+Name[hi]=आइस-डबल्यूएम
+Name[sv]=Ice-fönsterhanterare
+Name[ta]=பனிக்கட்டிWM
+Name[th]=ตัวจัดการหน้าต่าง IceWM
+Name[vi]=Nước đá WM
+Name[xh]=UmkhenkceWM
+Name[zu]=Iqhwa leWM
+X-KDE-Library=kwin3_icewm
diff --git a/kwin-styles/icewm/icewm.h b/kwin-styles/icewm/icewm.h
new file mode 100644
index 00000000..656f3426
--- /dev/null
+++ b/kwin-styles/icewm/icewm.h
@@ -0,0 +1,192 @@
+/*
+ $Id$
+
+ Gallium-IceWM themeable KWin client
+
+ Copyright 2001
+ Karol Szwed <gallium@kde.org>
+ http://gallium.n3.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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+ -----------------------------------------------------------------------------
+ This client loads most icewm 1.0.X pixmap themes, without taking into account
+ specific font settings for clients, or coloured mouse cursors. Titlebar
+ fonts can be changed via the kde control center. Bi-colour mouse cursors
+ may be added in future if requested by users, as well as theme font support.
+ Any styles using inbuilt icewm titlebar drawing without using pixmaps (e.g.
+ Warp4, win95 etc.) are not fully supported, and may cause drawing errors,
+ as these themes use in-built icewm drawing mechanisms.
+
+ When a pixmap theme is not present (or a corrupt one is present) then very
+ plain title decorations are painted instead, so that users don't see
+ non-painted window areas where possible ;)
+
+ At a later date, frame shaping may be added if really requested, and an
+ update to support the latest icewm 1.1.X theme format may be made.
+*/
+
+#ifndef __KDEGALLIUM_ICEWM_H
+#define __KDEGALLIUM_ICEWM_H
+
+#include <qbutton.h>
+#include <qlayout.h>
+#include <kpixmap.h>
+#include <kdecoration.h>
+#include <kdecorationfactory.h>
+#include <qbutton.h>
+class QLabel;
+class QSpacerItem;
+class QBoxLayout;
+class QGridLayout;
+
+namespace IceWM {
+
+class IceWMClient;
+
+// Pixmap group
+enum { InActive=0, Active };
+// Pixmap stretching mode
+enum { Vertical=0, Horizontal=1 };
+
+
+// Handles the resetClients() signal from the Options class,
+// and manages the dynamic pixmaps, configuration and theme changing
+class ThemeHandler: public KDecorationFactory
+{
+ public:
+ ThemeHandler();
+ ~ThemeHandler();
+
+ virtual KDecoration* createDecoration( KDecorationBridge* );
+ virtual bool reset( unsigned long changed );
+ virtual bool supports( Ability ability );
+
+ private:
+ bool initialized;
+ QString themeName;
+
+ void readConfig();
+ QColor decodeColor( QString& s );
+ bool isFrameValid();
+ void initTheme();
+ void freePixmaps();
+ void freePixmapGroup( QPixmap* p[] );
+ void setPixmap( QPixmap* p[], QString s1, QString s2, bool
+ stretch=false, bool stretchHoriz=true );
+ void setPixmapButton( QPixmap* p[], QString s1, QString s2);
+ QPixmap* stretchPixmap( QPixmap* src, bool stretchHoriz=true,
+ int stretchSize=-1);
+ QPixmap* duplicateValidPixmap( bool act, int size = -1 );
+ void convertButtons( QString& s );
+ QString reverseString( QString s );
+};
+
+
+class IceWMButton : public QButton
+{
+ public:
+ IceWMButton( IceWMClient *parent=0, const char *name=0,
+ QPixmap* (*p)[2]=0L, bool isToggle=false,
+ const QString& tip=NULL, const int realizeBtns = LeftButton );
+ void setTipText(const QString &tip);
+ void usePixmap( QPixmap* (*p)[2] );
+ QSize sizeHint() const;
+ void turnOn( bool isOn );
+ ButtonState last_button;
+
+ protected:
+ void mousePressEvent( QMouseEvent* e );
+ void mouseReleaseEvent( QMouseEvent* e );
+
+ void drawButton( QPainter *p );
+ void drawButtonLabel( QPainter * ) {;}
+
+ private:
+ int m_realizeButtons;
+ IceWMClient* client;
+ QPixmap* (*pix)[2]; // Points to active/inactive pixmap array
+};
+
+
+class IceWMClient : public KDecoration
+{
+ Q_OBJECT
+ public:
+ IceWMClient( KDecorationBridge* bridge, KDecorationFactory* factory );
+ ~IceWMClient();
+
+ virtual void init();
+ virtual void resize(const QSize&);
+ virtual bool eventFilter( QObject* o, QEvent* e );
+
+ protected:
+ void resizeEvent( QResizeEvent* );
+ void paintEvent( QPaintEvent* );
+ void showEvent( QShowEvent* );
+ void mouseDoubleClickEvent( QMouseEvent * );
+ void wheelEvent( QWheelEvent * );
+ virtual void captionChange();
+ virtual void maximizeChange();
+ virtual void shadeChange();
+ virtual void activeChange();
+ // void shadeChange(bool); /* KWin Client class doesn't provide this yet */
+ Position mousePosition( const QPoint& ) const;
+ void renderMenuIcons();
+ void iconChange();
+ virtual void desktopChange( );
+ virtual void borders(int&, int&, int&, int&) const;
+ virtual QSize minimumSize() const;
+
+ protected slots:
+ void slotMaximize();
+ void menuButtonPressed();
+ void menuButtonReleased();
+ void toggleShade();
+
+ private:
+ // These are all the icewm button types :)
+ enum Buttons{ BtnSysMenu=0, BtnClose, BtnMaximize, BtnMinimize,
+ BtnHide, BtnRollup, BtnDepth, BtnCount };
+
+ QString shortenCaption( const QString* s );
+ void calcHiddenButtons();
+ int titleTextWidth( const QString& s );
+ void addClientButtons( const QString& s );
+ QSpacerItem* addPixmapSpacer( QPixmap* p[],
+ QSizePolicy::SizeType = QSizePolicy::Maximum, int hsize = -1 );
+
+ IceWMButton* button[ IceWMClient::BtnCount ];
+ QPixmap* menuButtonWithIconPix[2];
+ QSpacerItem* titleSpacerJ;
+ QSpacerItem* titleSpacerL;
+ QSpacerItem* titleSpacerS;
+ QSpacerItem* titleSpacerP;
+ QSpacerItem* titlebar;
+ QSpacerItem* titleSpacerM;
+ QSpacerItem* titleSpacerB;
+ QSpacerItem* titleSpacerR;
+ QSpacerItem* titleSpacerQ;
+ QBoxLayout* hb;
+ QGridLayout* grid;
+ bool m_closing;
+};
+
+}
+
+#endif
+
+// vim: ts=4
diff --git a/kwin-styles/kde1/Makefile.am b/kwin-styles/kde1/Makefile.am
new file mode 100644
index 00000000..9c25f718
--- /dev/null
+++ b/kwin-styles/kde1/Makefile.am
@@ -0,0 +1,16 @@
+
+INCLUDES = $(all_includes)
+
+kde_module_LTLIBRARIES = kwin3_kde1.la
+
+kwin3_kde1_la_SOURCES = kde1client.cpp
+kwin3_kde1_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwin3_kde1_la_LIBADD = -lkdecorations
+
+METASOURCES = AUTO
+noinst_HEADERS = kde1client.h
+
+lnkdir = $(kde_datadir)/kwin/
+lnk_DATA = kde1.desktop
+EXTRA_DIST = $(lnk_DATA)
+
diff --git a/kwin-styles/kde1/kde1.desktop b/kwin-styles/kde1/kde1.desktop
new file mode 100644
index 00000000..d0f13924
--- /dev/null
+++ b/kwin-styles/kde1/kde1.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Name=KDE 1
+Name[fa]=KDE ۱
+Name[hi]=केडीई 1
+Name[ne]=केडीई १
+Name[th]=โปรแกรมจัดการหน้าต่าง KDE 1
+X-KDE-Library=kwin3_kde1
diff --git a/kwin-styles/kde1/kde1client.cpp b/kwin-styles/kde1/kde1client.cpp
new file mode 100644
index 00000000..39ba9605
--- /dev/null
+++ b/kwin-styles/kde1/kde1client.cpp
@@ -0,0 +1,809 @@
+/*****************************************************************
+kwin - the KDE window manager
+
+Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
+******************************************************************/
+#include "kde1client.h"
+#include <qcursor.h>
+#include <qlayout.h>
+#include <qtoolbutton.h>
+#include <qlabel.h>
+#include <qdrawutil.h>
+#include <qbitmap.h>
+#include <kdrawutil.h>
+#include <klocale.h>
+#include <kpixmap.h>
+#include <qdatetime.h>
+#include <qimage.h>
+#include <qtooltip.h>
+
+#include "kde1client_bitmaps.h"
+
+// Default button layout
+const char default_left[] = "MS";
+const char default_right[] = "H_IAX";
+
+namespace KDE1
+{
+
+QPixmap* close_pix = 0;
+QPixmap* maximize_pix = 0;
+QPixmap* minimize_pix = 0;
+QPixmap* normalize_pix = 0;
+QPixmap* pinup_pix = 0;
+QPixmap* pindown_pix = 0;
+QPixmap* menu_pix = 0;
+QPixmap* question_mark_pix = 0;
+
+QPixmap* dis_close_pix = 0;
+QPixmap* dis_maximize_pix = 0;
+QPixmap* dis_minimize_pix = 0;
+QPixmap* dis_normalize_pix = 0;
+QPixmap* dis_pinup_pix = 0;
+QPixmap* dis_pindown_pix = 0;
+QPixmap* dis_menu_pix = 0;
+QPixmap* dis_question_mark_pix = 0;
+
+QPixmap* titleBuffer = 0;
+
+bool pixmaps_created = FALSE;
+
+inline const KDecorationOptions* options() { return KDecoration::options(); }
+
+void create_pixmaps()
+{
+ if ( pixmaps_created )
+ return;
+ pixmaps_created = true;
+ QColorGroup aGrp = options()->colorGroup(KDecorationOptions::ColorButtonBg, true);
+ QColorGroup iGrp = options()->colorGroup(KDecorationOptions::ColorButtonBg, false);
+
+ QPainter aPainter, iPainter;
+ close_pix = new QPixmap(16, 16);
+ dis_close_pix = new QPixmap(16, 16);
+ aPainter.begin(close_pix); iPainter.begin(dis_close_pix);
+ kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, close_white_bits,
+ NULL, NULL, close_dgray_bits, NULL, NULL);
+ kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, close_white_bits,
+ NULL, NULL, close_dgray_bits, NULL, NULL);
+ aPainter.end(); iPainter.end();
+ close_pix->setMask(QBitmap(16, 16, close_mask_bits, true));
+ dis_close_pix->setMask(*close_pix->mask());
+
+ minimize_pix = new QPixmap(16, 16);
+ dis_minimize_pix = new QPixmap(16, 16);
+ aPainter.begin(minimize_pix); iPainter.begin(dis_minimize_pix);
+ kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, iconify_white_bits,
+ NULL, NULL, iconify_dgray_bits, NULL, NULL);
+ kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, iconify_white_bits,
+ NULL, NULL, iconify_dgray_bits, NULL, NULL);
+ aPainter.end(); iPainter.end();
+ minimize_pix->setMask(QBitmap(16, 16, iconify_mask_bits, true));
+ dis_minimize_pix->setMask(*minimize_pix->mask());
+
+ maximize_pix = new QPixmap(16, 16);
+ dis_maximize_pix = new QPixmap(16, 16);
+ aPainter.begin(maximize_pix); iPainter.begin(dis_maximize_pix);
+ kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, maximize_white_bits,
+ NULL, NULL, maximize_dgray_bits, NULL, NULL);
+ kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, maximize_white_bits,
+ NULL, NULL, maximize_dgray_bits, NULL, NULL);
+ aPainter.end(); iPainter.end();
+ maximize_pix->setMask(QBitmap(16, 16, maximize_mask_bits, true));
+ dis_maximize_pix->setMask(*maximize_pix->mask());
+
+ normalize_pix = new QPixmap(16, 16);
+ dis_normalize_pix = new QPixmap(16, 16);
+ aPainter.begin(normalize_pix); iPainter.begin(dis_normalize_pix);
+ kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, maximizedown_white_bits,
+ NULL, NULL, maximizedown_dgray_bits, NULL, NULL);
+ kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, maximizedown_white_bits,
+ NULL, NULL, maximizedown_dgray_bits, NULL, NULL);
+ aPainter.end(); iPainter.end();
+ normalize_pix->setMask(QBitmap(16, 16, maximizedown_mask_bits, true));
+ dis_normalize_pix->setMask(*normalize_pix->mask());
+
+ menu_pix = new QPixmap(16, 16);
+ dis_menu_pix = new QPixmap(16, 16);
+ aPainter.begin(menu_pix); iPainter.begin(dis_menu_pix);
+ kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, menu_white_bits,
+ NULL, NULL, menu_dgray_bits, NULL, NULL);
+ kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, menu_white_bits,
+ NULL, NULL, menu_dgray_bits, NULL, NULL);
+ aPainter.end(); iPainter.end();
+ menu_pix->setMask(QBitmap(16, 16, menu_mask_bits, true));
+ dis_menu_pix->setMask(*menu_pix->mask());
+
+ pinup_pix = new QPixmap(16, 16);
+ dis_pinup_pix = new QPixmap(16, 16);
+ aPainter.begin(pinup_pix); iPainter.begin(dis_pinup_pix);
+ kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, pinup_white_bits,
+ pinup_gray_bits, NULL, pinup_dgray_bits, NULL, NULL);
+ kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, pinup_white_bits,
+ pinup_gray_bits, NULL, pinup_dgray_bits, NULL, NULL);
+ aPainter.end(); iPainter.end();
+ pinup_pix->setMask(QBitmap(16, 16, pinup_mask_bits, true));
+ dis_pinup_pix->setMask(*pinup_pix->mask());
+
+ pindown_pix = new QPixmap(16, 16);
+ dis_pindown_pix = new QPixmap(16, 16);
+ aPainter.begin(pindown_pix); iPainter.begin(dis_pindown_pix);
+ kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, pindown_white_bits,
+ pindown_gray_bits, NULL, pindown_dgray_bits, NULL, NULL);
+ kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, pindown_white_bits,
+ pindown_gray_bits, NULL, pindown_dgray_bits, NULL, NULL);
+ aPainter.end(); iPainter.end();
+ pindown_pix->setMask(QBitmap(16, 16, pindown_mask_bits, true));
+ dis_pindown_pix->setMask(*pindown_pix->mask());
+
+ question_mark_pix = new QPixmap(16, 16);
+ dis_question_mark_pix = new QPixmap(16, 16);
+ aPainter.begin(question_mark_pix); iPainter.begin(dis_question_mark_pix);
+ kColorBitmaps(&aPainter, aGrp, 0, 0, 16, 16, true, help_light_bits,
+ NULL, NULL, help_dark_bits, NULL, NULL);
+ kColorBitmaps(&iPainter, iGrp, 0, 0, 16, 16, true, help_light_bits,
+ NULL, NULL, help_dark_bits, NULL, NULL);
+ aPainter.end(); iPainter.end();
+ question_mark_pix->setMask(QBitmap(16, 16, help_mask_bits, true));
+ dis_question_mark_pix->setMask(*question_mark_pix->mask());
+
+ titleBuffer = new KPixmap;
+}
+
+void delete_pixmaps()
+{
+ delete close_pix;
+ delete maximize_pix;
+ delete minimize_pix;
+ delete normalize_pix;
+ delete pinup_pix;
+ delete pindown_pix;
+ delete menu_pix;
+ delete question_mark_pix;
+ delete dis_close_pix;
+ delete dis_maximize_pix;
+ delete dis_minimize_pix;
+ delete dis_normalize_pix;
+ delete dis_pinup_pix;
+ delete dis_pindown_pix;
+ delete dis_menu_pix;
+ delete dis_question_mark_pix;
+ delete titleBuffer;
+ pixmaps_created = false;
+}
+
+void drawGradient
+(
+ QPainter & p,
+ const QRect & t,
+ const QColor & c1,
+ const QColor & c2
+)
+{
+ // Don't draw a million vertical lines if we don't need to.
+
+ if (c1 == c2 || QPixmap::defaultDepth() <= 8)
+ {
+ p.fillRect(t, c1);
+ return;
+ }
+
+ // rikkus: Adapted from KPixmapEffect::gradient().
+
+ int rca = c1.red();
+ int gca = c1.green();
+ int bca = c1.blue();
+
+ int rDiff = c2.red() - rca;
+ int gDiff = c2.green() - gca;
+ int bDiff = c2.blue() - bca;
+
+ int rl = rca << 16;
+ int gl = gca << 16;
+ int bl = bca << 16;
+
+ int rcdelta = ((1 << 16) / t.width()) * rDiff;
+ int gcdelta = ((1 << 16) / t.width()) * gDiff;
+ int bcdelta = ((1 << 16) / t.width()) * bDiff;
+
+ for (int x = 0; x < t.width(); x++)
+ {
+ rl += rcdelta;
+ gl += gcdelta;
+ bl += bcdelta;
+
+ p.setPen(QColor(rl >> 16, gl >> 16, bl >> 16));
+
+ p.drawLine(t.x() + x, 0, t.x() + x, t.y() + t.height() - 1);
+ }
+}
+
+
+void StdClient::reset( unsigned long )
+{
+ if (button[ButtonMenu] && (icon().pixmap( QIconSet::Small, QIconSet::Normal ).isNull()))
+ button[ButtonMenu]->setIconSet(isActive() ? *menu_pix : *dis_menu_pix);
+ if (button[ButtonSticky])
+ button[ButtonSticky]->setIconSet(isOnAllDesktops() ? isActive() ? *pindown_pix : *dis_pindown_pix :
+ isActive() ? *pinup_pix : *dis_pinup_pix );
+ if (button[ButtonMinimize])
+ button[ButtonMinimize]->setIconSet(isActive() ? *minimize_pix : *dis_minimize_pix);
+ if (button[ButtonMaximize])
+ button[ButtonMaximize]->setIconSet(isActive() ? *maximize_pix : *dis_maximize_pix);
+ if (button[ButtonClose])
+ button[ButtonClose]->setIconSet(isActive() ? *close_pix : *dis_close_pix);
+ if (button[ButtonHelp])
+ button[ButtonHelp]->setIconSet(isActive() ? *question_mark_pix : *dis_question_mark_pix);
+
+ widget()->setFont(options()->font(true));
+}
+
+
+StdClient::StdClient( KDecorationBridge* b, KDecorationFactory* f )
+ : KDecoration( b, f )
+{
+}
+
+void StdClient::init()
+{
+ createMainWidget();
+ widget()->installEventFilter( this );
+
+ widget()->setFont(options()->font(isActive() ));
+
+ QGridLayout* g = new QGridLayout( widget(), 0, 0, 3, 2 );
+ g->setRowStretch( 1, 10 );
+ if( isPreview())
+ g->addWidget( new QLabel( i18n( "<center><b>KDE 1 preview</b></center>" ), widget()), 1, 1 );
+ else
+ g->addItem( new QSpacerItem( 0, 0 ), 1, 1 ); //no widget in the middle
+ g->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
+
+ g->addColSpacing(0, 1);
+ g->addColSpacing(2, 1);
+ g->addRowSpacing(2, 1);
+
+ int fh = widget()->fontMetrics().lineSpacing();
+ titlebar = new QSpacerItem(10, fh, QSizePolicy::Expanding,
+ QSizePolicy::Minimum );
+
+ QBoxLayout* hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
+ g->addLayout( hb, 0, 1 );
+
+ // setup titlebar buttons
+ for (int n=0; n<ButtonTypeCount; n++) button[n] = 0;
+ addButtons(hb, options()->customButtonPositions() ? options()->titleButtonsLeft() : QString(default_left));
+ hb->addItem(titlebar);
+ addButtons(hb, options()->customButtonPositions() ? options()->titleButtonsRight() : QString(default_right));
+
+ for (int n=0; n<ButtonTypeCount; n++) {
+ if ( !button[n] )
+ continue;
+ button[n]->setBackgroundMode( PaletteBackground );
+ button[n]->setMouseTracking( FALSE );
+ button[n]->setAutoRaise( TRUE );
+ button[n]->setFocusPolicy( QWidget::NoFocus );
+ button[n]->setFixedSize( 20, 20 );
+ }
+
+#if 0 // not sure what this is supposed to mean (and why)
+ if ( isTransient() ) {
+ // lighter decoration for transient windows
+ button[1]->hide();
+// button[2]->hide();
+ button[3]->hide();
+ button[4]->hide();
+ }
+#endif
+}
+
+void StdClient::addButtons(QBoxLayout *hb, const QString& s)
+{
+ if (s.length() > 0) {
+ for (unsigned n=0; n < s.length(); n++) {
+ switch (s[n]) {
+ case 'M': // Menu button
+ if (!button[ButtonMenu]) {
+ button[ButtonMenu] = new QToolButton( widget(), 0 );
+ QToolTip::add( button[ButtonMenu], i18n("Menu") );
+ button[ButtonMenu]->setCursor(ArrowCursor);
+ if( icon().pixmap( QIconSet::Small, QIconSet::Normal ).isNull())
+ button[ButtonMenu]->setIconSet(isActive() ? *menu_pix : *dis_menu_pix);
+ else
+ button[ButtonMenu]->setIconSet( icon().pixmap( QIconSet::Small, QIconSet::Normal ));
+ connect( button[0], SIGNAL( pressed() ), this, SLOT( menuButtonPressed() ) );
+ hb->addWidget(button[ButtonMenu]);
+ }
+ break;
+
+ case 'S': // Sticky button
+ if (!button[ButtonSticky]) {
+ button[ButtonSticky] = new QToolButton( widget(), 0 );
+ button[ButtonSticky]->setIconSet( isOnAllDesktops()?*pindown_pix:*pinup_pix );
+ QToolTip::add( button[ButtonSticky], isOnAllDesktops()?i18n("Not On All Desktops"):i18n("On All Desktops") );
+ button[ButtonSticky]->setCursor(ArrowCursor);
+ button[ButtonSticky]->setIconSet(isOnAllDesktops() ? isActive() ? *pindown_pix : *dis_pindown_pix :
+ isActive() ? *pinup_pix : *dis_pinup_pix );
+ connect( button[ButtonSticky], SIGNAL( clicked() ), this, ( SLOT( toggleOnAllDesktops() ) ) );
+ hb->addWidget(button[ButtonSticky]);
+ }
+ break;
+
+ case 'H': // Help button
+ if ((!button[ButtonHelp]) && providesContextHelp()) {
+ button[ButtonHelp] = new QToolButton( widget(), 0 );
+ QToolTip::add( button[ButtonHelp], i18n("Help") );
+ button[ButtonHelp]->setIconSet( isActive() ? *question_mark_pix : *dis_question_mark_pix);
+ connect( button[ButtonHelp], SIGNAL( clicked() ), this, ( SLOT( showContextHelp() ) ) );
+ button[ButtonHelp]->setCursor(ArrowCursor);
+ hb->addWidget(button[ButtonHelp]);
+ }
+ break;
+
+ case 'I': // Minimize button
+ if ((!button[ButtonMinimize]) && isMinimizable()) {
+ button[ButtonMinimize] = new QToolButton( widget(), 0 );
+ QToolTip::add( button[ButtonMinimize], i18n("Minimize") );
+ button[ButtonMinimize]->setCursor(ArrowCursor);
+ button[ButtonMinimize]->setIconSet(isActive() ? *minimize_pix : *dis_minimize_pix);
+ connect( button[ButtonMinimize], SIGNAL( clicked() ), this, ( SLOT( minimize() ) ) );
+ hb->addWidget(button[ButtonMinimize]);
+ }
+ break;
+
+ case 'A': // Maximize button
+ if ((!button[ButtonMaximize]) && isMaximizable()) {
+ const bool max = maximizeMode()!=MaximizeRestore;
+ button[ButtonMaximize] = new ThreeButtonButton( widget(), 0 );
+ QToolTip::add( button[ButtonMaximize], max?i18n("Restore"):i18n("Maximize") );
+ button[ButtonMaximize]->setCursor(ArrowCursor);
+ button[ButtonMaximize]->setIconSet( max?(isActive() ? *normalize_pix : *dis_normalize_pix):(isActive() ? *maximize_pix : *dis_maximize_pix) );
+ connect( button[ButtonMaximize], SIGNAL( clicked(ButtonState) ),
+ this, ( SLOT( maxButtonClicked(ButtonState) ) ) );
+ hb->addWidget(button[ButtonMaximize]);
+ }
+ break;
+
+ case 'X': // Close button
+ if ((!button[ButtonClose]) && isCloseable()) {
+ button[ButtonClose] = new QToolButton( widget(), 0 );
+ QToolTip::add( button[ButtonClose], i18n("Close") );
+ button[ButtonClose]->setCursor(ArrowCursor);
+ button[ButtonClose]->setIconSet(isActive() ? *close_pix : *dis_close_pix);
+ connect( button[ButtonClose], SIGNAL( clicked() ), this, ( SLOT( closeWindow() ) ) );
+ hb->addWidget(button[ButtonClose]);
+ }
+ break;
+
+ case '_': // Spacer item
+ hb->addItem( new QSpacerItem( 5, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
+ }
+ }
+ }
+}
+
+void StdClient::activeChange()
+{
+ bool on = isActive();
+ if (button[ButtonMenu] && (icon().pixmap( QIconSet::Small, QIconSet::Normal ).isNull()))
+ button[ButtonMenu]->setIconSet(on ? *menu_pix : *dis_menu_pix);
+ if (button[ButtonSticky])
+ button[ButtonSticky]->setIconSet(isOnAllDesktops() ? on ? *pindown_pix : *dis_pindown_pix :
+ on ? *pinup_pix : *dis_pinup_pix );
+ if (button[ButtonMinimize])
+ button[ButtonMinimize]->setIconSet(on ? *minimize_pix : *dis_minimize_pix);
+ if (button[ButtonMaximize])
+ button[ButtonMaximize]->setIconSet(on ? *maximize_pix : *dis_maximize_pix);
+ if (button[ButtonClose])
+ button[ButtonClose]->setIconSet(on ? *close_pix : *dis_close_pix);
+ if (button[ButtonHelp])
+ button[ButtonHelp]->setIconSet(on ? *question_mark_pix : *dis_question_mark_pix);
+ widget()->repaint( titlebar->geometry(), false );
+}
+
+
+StdClient::~StdClient()
+{
+ for (int n=0; n<ButtonTypeCount; n++) {
+ if (button[n]) delete button[n];
+ }
+}
+
+
+void StdClient::resizeEvent( QResizeEvent* )
+{
+ QRegion rr = widget()->rect();
+ QRect t = titlebar->geometry();
+// t.setTop( 0 );
+// QRegion r = rr.subtract( QRect( t.x()+1, 0, t.width()-2, 1 ) );
+// setMask( r );
+
+ if ( widget()->isVisibleToTLW() && !widget()->testWFlags( WStaticContents )) {
+ // manual clearing without the titlebar (we selected WResizeNoErase )
+ QRect cr( 2, 2, width()-4, height()- 4 );
+ widget()->erase( QRegion( cr ).subtract( t ) );
+ }
+}
+
+/*!\reimp
+ */
+void StdClient::captionChange()
+{
+ widget()->repaint( titlebar->geometry(), FALSE );
+}
+
+
+/*!\reimp
+ */
+void StdClient::maximizeChange()
+{
+ bool m = maximizeMode() == MaximizeFull;
+ if (button[ButtonMaximize]) {
+ button[ButtonMaximize]->setIconSet( m?*normalize_pix:*maximize_pix );
+ QToolTip::remove( button[ButtonMaximize] );
+ QToolTip::add( button[ButtonMaximize], m ? i18n("Restore") : i18n("Maximize") );
+ }
+}
+
+
+/*!\reimp
+ */
+void StdClient::desktopChange()
+{
+ bool s = isOnAllDesktops();
+ if (button[ButtonSticky]) {
+ button[ButtonSticky]->setIconSet( s?*pindown_pix:*pinup_pix );
+ QToolTip::remove( button[ButtonSticky] );
+ QToolTip::add( button[ButtonSticky], s ? i18n("Not On All Desktops") : i18n("On All Desktops") );
+ }
+}
+
+void StdClient::paintEvent( QPaintEvent* )
+{
+ QPainter p( widget() );
+ QRect t = titlebar->geometry();
+ QRegion r = widget()->rect();
+ r = r.subtract( t );
+ p.setClipRegion( r );
+ qDrawWinPanel( &p, widget()->rect(), widget()->colorGroup() );
+// t.setTop( 1 );
+// p.setClipRegion( t );
+// t.setTop( 0 );
+
+ QRect titleRect( 0, 0, t.width(), t.height() );
+ titleBuffer->resize( titleRect.width(), titleRect.height() );
+ QPainter p2( titleBuffer );
+
+ drawGradient(p2, titleRect, options()->color(KDecorationOptions::ColorTitleBar, isActive()),
+ options()->color(KDecorationOptions::ColorTitleBlend, isActive()));
+// p.setPen( options()->color(KDecorationOptions::ColorTitleBar, isActive()).light() );
+// p.drawLine(t.left(), t.top()+1, t.right(), t.top()+1);
+ if ( isActive() )
+ qDrawShadePanel( &p2, 0, 0, titleRect.width(), titleRect.height(),
+ widget()->colorGroup(), true, 1 );
+ titleRect.setLeft( 4 );
+ titleRect.setWidth( titleRect.width() - 2 );
+ p2.setPen(options()->color(KDecorationOptions::ColorFont, isActive()));
+ p2.setFont(options()->font(isActive()));
+ p2.drawText( titleRect, AlignLeft|AlignVCenter|SingleLine, caption() );
+ p2.end();
+ p.end();
+ bitBlt( widget(), t.topLeft(), titleBuffer );
+}
+
+
+void StdClient::mouseDoubleClickEvent( QMouseEvent * e )
+{
+ if ( e->button() == LeftButton && titlebar->geometry().contains( e->pos() ) )
+ titlebarDblClickOperation();
+}
+
+
+void StdClient::wheelEvent( QWheelEvent * e )
+{
+ if (isSetShade() || QRect( 0, 0, width(), titlebar->geometry().height() ).contains( e->pos() ) )
+ titlebarMouseWheelOperation( e->delta());
+}
+
+
+void StdClient::iconChange()
+{
+ if (button[ButtonMenu]) {
+ if ( icon().pixmap( QIconSet::Small, QIconSet::Normal ).isNull())
+ button[ButtonMenu]->setIconSet(isActive() ? *menu_pix : *dis_menu_pix);
+ else
+ button[ButtonMenu]->setIconSet( icon().pixmap( QIconSet::Small, QIconSet::Normal ) );
+ button[ButtonMenu]->repaint( FALSE );
+ }
+}
+
+
+/*!
+ Indicates that the menu button has been clicked. One press shows
+ the window operation menu, a double click closes the window.
+ */
+void StdClient::menuButtonPressed()
+{
+ QRect menuRect = button[ButtonMenu]->rect();
+ menuRect.addCoords(-1, 0, +1, +2);
+ QPoint menuTop = button[ButtonMenu]->mapToGlobal(menuRect.topLeft());
+ QPoint menuBottom = button[ButtonMenu]->mapToGlobal(menuRect.bottomRight());
+ KDecorationFactory* f = factory(); // needs to be saved before
+ showWindowMenu( QRect(menuTop, menuBottom) );
+ if( !f->exists( this )) // destroyed, return immediately
+ return;
+ button[ButtonMenu]->setDown(false);
+}
+
+
+void StdClient::maxButtonClicked( ButtonState button )
+{
+ maximize( button );
+}
+
+bool StdClient::eventFilter( QObject* o, QEvent* e )
+{
+ if ( o != widget() )
+ return false;
+
+ switch ( e->type() ) {
+ case QEvent::Resize:
+ resizeEvent( static_cast< QResizeEvent* >( e ) );
+ return true;
+
+ case QEvent::Paint:
+ paintEvent( static_cast< QPaintEvent* >( e ) );
+ return true;
+
+ case QEvent::MouseButtonDblClick:
+ mouseDoubleClickEvent( static_cast< QMouseEvent* >( e ) );
+ return true;
+
+ case QEvent::MouseButtonPress:
+ processMousePressEvent( static_cast< QMouseEvent* >( e ) );
+ return true;
+
+ case QEvent::Wheel:
+ wheelEvent( static_cast< QWheelEvent* >( e ));
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+QSize StdClient::minimumSize() const
+{
+ return widget()->minimumSize().expandedTo( QSize( 100, 50 ));
+}
+
+void StdClient::borders( int& left, int& right, int& top, int& bottom ) const
+{
+ left = right = bottom = 6;
+ top = 6 + widget()->fontMetrics().lineSpacing()+2;
+}
+
+void StdClient::resize( const QSize& s )
+{
+ widget()->resize( s );
+}
+
+StdToolClient::StdToolClient( KDecorationBridge* b, KDecorationFactory* f )
+ : KDecoration( b, f )
+{
+}
+
+void StdToolClient::init()
+{
+ createMainWidget();
+ widget()->installEventFilter( this );
+
+ widget()->setFont(options()->font(isActive(), true ));
+
+ QGridLayout* g = new QGridLayout( widget(), 0, 0, 2 );
+ g->setRowStretch( 1, 10 );
+ if( isPreview())
+ g->addWidget( new QLabel( i18n( "<center><b>KDE 1 decoration</b></center>" ), widget()), 1, 1 );
+ else
+ g->addItem( new QSpacerItem( 0, 0 ), 1, 1 ); //no widget in the middle
+ g->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
+
+ g->addColSpacing(0, 1);
+ g->addColSpacing(2, 1);
+ g->addRowSpacing(2, 1);
+
+ closeBtn = new QToolButton( widget(), 0 );
+ QToolTip::add( closeBtn, i18n("Close") );
+ connect( closeBtn, SIGNAL( clicked() ), this, ( SLOT( closeWindow() ) ) );
+ closeBtn->setFixedSize( 13, 13);
+ reset( -1U );
+
+ QHBoxLayout* hb = new QHBoxLayout;
+ g->addLayout( hb, 0, 1 );
+
+ int fh = widget()->fontMetrics().lineSpacing()+2;
+
+ titlebar = new QSpacerItem(10, fh, QSizePolicy::Expanding,
+ QSizePolicy::Minimum );
+ hb->addItem( titlebar );
+ hb->addWidget( closeBtn );
+}
+
+StdToolClient::~StdToolClient()
+{
+}
+
+void StdToolClient::resizeEvent( QResizeEvent* )
+{
+// QRegion r = rect();
+// QRect t = titlebar->geometry();
+// t.setTop( 0 );
+// r = r.subtract( QRect(0, 0, width(), 1) );
+// r = r.subtract (QRect( 0, 0, 1, t.height() ) );
+// r = r.subtract (QRect( width()-1, 0, 1, t.height() ) );
+// setMask( r );
+}
+
+void StdToolClient::paintEvent( QPaintEvent* )
+{
+ QPainter p( widget() );
+ QRect t = titlebar->geometry();
+ QRect r = widget()->rect();
+ qDrawWinPanel( &p, r, widget()->colorGroup() );
+ r.setTop( t.bottom()+1 );
+ qDrawWinPanel( &p, r, widget()->colorGroup() );
+ p.fillRect( QRect( QPoint(t.topLeft() ), QPoint( width() - t.left(), t.bottom() ) ),
+ options()->color(KDecorationOptions::ColorTitleBar, isActive()));
+ p.setPen( options()->color(KDecorationOptions::ColorTitleBar, isActive()).light() );
+ t.setLeft( t.left() + 4 );
+ t.setRight( t.right() - 2 );
+ p.setPen(options()->color(KDecorationOptions::ColorFont, isActive()));
+ p.setFont(options()->font(isActive(), true));
+ p.drawText( t, AlignLeft|AlignVCenter|SingleLine, caption() );
+}
+
+
+void StdToolClient::mouseDoubleClickEvent( QMouseEvent * e )
+{
+ if ( e->button() == LeftButton && titlebar->geometry().contains( e->pos() ) )
+ titlebarDblClickOperation();
+}
+
+void StdToolClient::wheelEvent( QWheelEvent * e )
+{
+ if (isSetShade() || QRect( 0, 0, width(), titlebar->geometry().height() ).contains( e->pos() ) )
+ titlebarMouseWheelOperation( e->delta());
+}
+
+void StdToolClient::captionChange()
+{
+ widget()->repaint( titlebar->geometry(), FALSE );
+}
+
+void StdToolClient::reset( unsigned long )
+{
+ QImage img = close_pix->convertToImage();
+ img = img.smoothScale( 12, 12 );
+ QPixmap pm;
+ pm.convertFromImage( img );
+ closeBtn->setPixmap( pm );
+ widget()->setFont(options()->font(isActive(), true ));
+}
+
+bool StdToolClient::eventFilter( QObject* o, QEvent* e )
+{
+ if ( o != widget() )
+ return false;
+
+ switch ( e->type() ) {
+ case QEvent::Resize:
+ resizeEvent( static_cast< QResizeEvent* >( e ) );
+ return true;
+
+ case QEvent::Paint:
+ paintEvent( static_cast< QPaintEvent* >( e ) );
+ return true;
+
+ case QEvent::MouseButtonDblClick:
+ mouseDoubleClickEvent( static_cast< QMouseEvent* >( e ) );
+ return true;
+
+ case QEvent::MouseButtonPress:
+ processMousePressEvent( static_cast< QMouseEvent* >( e ) );
+ return true;
+
+ case QEvent::Wheel:
+ wheelEvent( static_cast< QWheelEvent* >( e ));
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+QSize StdToolClient::minimumSize() const
+{
+ return widget()->minimumSize().expandedTo( QSize( 100, 50 ));
+}
+
+void StdToolClient::borders( int& left, int& right, int& top, int& bottom ) const
+{
+ left = right = bottom = 6;
+ top = 6 + widget()->fontMetrics().lineSpacing();
+}
+
+void StdToolClient::resize( const QSize& s )
+{
+ widget()->resize( s );
+}
+
+StdFactory::StdFactory()
+{
+ create_pixmaps();
+}
+
+StdFactory::~StdFactory()
+{
+ delete_pixmaps();
+}
+
+const int SUPPORTED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask
+ | NET::ToolbarMask | NET::MenuMask | NET::DialogMask | NET::OverrideMask | NET::TopMenuMask
+ | NET::UtilityMask | NET::SplashMask;
+
+KDecoration* StdFactory::createDecoration( KDecorationBridge* b )
+{
+ NET::WindowType type = windowType( SUPPORTED_WINDOW_TYPES_MASK, b );
+ if( type == NET::Utility || type == NET::Menu || type == NET::Toolbar )
+ return new StdToolClient( b, this );
+ return new StdClient( b, this );
+}
+
+bool StdFactory::reset( unsigned long mask )
+{
+ bool needHardReset = false;
+
+ // doesn't obey the Border size setting
+ if( mask & ( SettingFont | SettingButtons ))
+ needHardReset = true;
+
+ if( mask & ( SettingFont | SettingColors )) {
+ KDE1::delete_pixmaps();
+ KDE1::create_pixmaps();
+ }
+
+ if( !needHardReset )
+ resetDecorations( mask );
+ return needHardReset;
+}
+
+bool StdFactory::supports( Ability ability )
+{
+ switch( ability )
+ {
+ case AbilityAnnounceButtons:
+ case AbilityButtonMenu:
+ case AbilityButtonOnAllDesktops:
+ case AbilityButtonHelp:
+ case AbilityButtonMinimize:
+ case AbilityButtonMaximize:
+ case AbilityButtonClose:
+ case AbilityButtonSpacer:
+ return true;
+ default:
+ return false;
+ };
+}
+
+
+}
+
+extern "C"
+{
+ KDE_EXPORT KDecorationFactory *create_factory()
+ {
+ return new KDE1::StdFactory();
+ }
+}
+
+#include "kde1client.moc"
diff --git a/kwin-styles/kde1/kde1client.h b/kwin-styles/kde1/kde1client.h
new file mode 100644
index 00000000..27a246dd
--- /dev/null
+++ b/kwin-styles/kde1/kde1client.h
@@ -0,0 +1,155 @@
+/*****************************************************************
+kwin - the KDE window manager
+
+Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
+******************************************************************/
+#ifndef STDCLIENT_H
+#define STDCLIENT_H
+#include <qlayout.h>
+#include <qvariant.h>
+#include <kdecoration.h>
+#include <kdecorationfactory.h>
+#include <qtoolbutton.h>
+class QLabel;
+class QSpacerItem;
+
+namespace KDE1 {
+
+enum ButtonType {
+ ButtonMenu=0,
+ ButtonSticky,
+ ButtonMinimize,
+ ButtonMaximize,
+ ButtonClose,
+ ButtonHelp,
+ ButtonTypeCount
+};
+
+class StdClient : public KDecoration
+{
+ Q_OBJECT
+public:
+ StdClient( KDecorationBridge* b, KDecorationFactory* f );
+ ~StdClient();
+ void init();
+ QSize minimumSize() const;
+ void borders( int& left, int& right, int& top, int& bottom ) const;
+ void reset( unsigned long mask );
+ void resize( const QSize& s );
+ void shadeChange() {};
+ Position mousePosition( const QPoint& p ) const { return KDecoration::mousePosition( p ); }
+protected:
+ bool eventFilter( QObject* o, QEvent* e );
+ void resizeEvent( QResizeEvent* );
+ void paintEvent( QPaintEvent* );
+
+ void mouseDoubleClickEvent( QMouseEvent * );
+ void wheelEvent( QWheelEvent * );
+ void captionChange();
+ void iconChange();
+ void maximizeChange();
+ void desktopChange();
+ void activeChange();
+
+private:
+ void addButtons(QBoxLayout* hb, const QString& buttons);
+
+private slots:
+ void menuButtonPressed();
+ void maxButtonClicked( ButtonState );
+
+private:
+ QToolButton* button[ButtonTypeCount];
+ QSpacerItem* titlebar;
+};
+
+class StdToolClient : public KDecoration
+{
+ Q_OBJECT
+public:
+ StdToolClient( KDecorationBridge* b, KDecorationFactory* f );
+ ~StdToolClient();
+ void init();
+ QSize minimumSize() const;
+ void borders( int& left, int& right, int& top, int& bottom ) const;
+ void reset( unsigned long mask );
+ void resize( const QSize& s );
+ void shadeChange() {};
+ void activeChange() {};
+ void iconChange() {};
+ void maximizeChange() {};
+ void desktopChange() {};
+ Position mousePosition( const QPoint& p ) const { return KDecoration::mousePosition( p ); }
+protected:
+ bool eventFilter( QObject* o, QEvent* e );
+ void resizeEvent( QResizeEvent* );
+ void paintEvent( QPaintEvent* );
+
+ void mouseDoubleClickEvent( QMouseEvent * );
+ void wheelEvent( QWheelEvent * );
+ void captionChange();
+
+private:
+ QToolButton* closeBtn;
+ QSpacerItem* titlebar;
+};
+
+
+
+/*
+ Like QToolButton, but provides a clicked(ButtonState) signals that
+ has the last pressed mouse button as argument
+ */
+class ThreeButtonButton: public QToolButton
+{
+ Q_OBJECT
+public:
+ ThreeButtonButton ( QWidget *parent = 0, const char* name = 0 )
+ : QToolButton( parent, name )
+ {
+ connect( this, SIGNAL( clicked() ), this, SLOT( handleClicked() ) );
+ setCursor( arrowCursor );
+ }
+ ~ThreeButtonButton () {}
+
+signals:
+ void clicked( ButtonState );
+
+protected:
+ void mousePressEvent( QMouseEvent* e )
+ {
+ last_button = e->button();
+ QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() );
+ QToolButton::mousePressEvent( &me );
+ }
+
+ void mouseReleaseEvent( QMouseEvent* e )
+ {
+ QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() );
+ QToolButton::mouseReleaseEvent( &me );
+ }
+
+private slots:
+ void handleClicked()
+ {
+ emit clicked( last_button );
+ }
+
+private:
+ ButtonState last_button;
+
+};
+
+class StdFactory : public KDecorationFactory
+{
+public:
+ StdFactory();
+ ~StdFactory();
+ KDecoration* createDecoration( KDecorationBridge* b );
+ bool reset( unsigned long mask );
+ virtual bool supports( Ability ability );
+};
+
+}
+
+#endif
diff --git a/kwin-styles/kde1/kde1client_bitmaps.h b/kwin-styles/kde1/kde1client_bitmaps.h
new file mode 100644
index 00000000..8b1cb377
--- /dev/null
+++ b/kwin-styles/kde1/kde1client_bitmaps.h
@@ -0,0 +1,149 @@
+#ifndef __STDCLIENT_BITMAPS_H
+#define __STDCLIENT_BITMAPS_H
+
+/**
+ * The standard client has the capability to color it's titlebar buttons
+ * according to the new color scheme. In order to do this it needs a bitmap
+ * for each shade which it draws into a pixmap with the appropriate color.
+ * These are all the bitmaps.
+ */
+
+static const unsigned char close_white_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x04, 0x10, 0x04, 0x08, 0x08, 0x04, 0x10, 0x02,
+ 0x20, 0x01, 0x40, 0x00, 0x40, 0x00, 0x20, 0x01, 0x10, 0x02, 0x08, 0x04,
+ 0x04, 0x08, 0x04, 0x10, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char close_dgray_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x20, 0x18, 0x30, 0x30, 0x18, 0x60, 0x0c,
+ 0xc0, 0x06, 0x80, 0x03, 0x80, 0x03, 0xc0, 0x06, 0x60, 0x0c, 0x30, 0x18,
+ 0x18, 0x30, 0x08, 0x20, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char close_mask_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x1c, 0x38, 0x38, 0x1c, 0x70, 0x0e,
+ 0xe0, 0x07, 0xc0, 0x03, 0xc0, 0x03, 0xe0, 0x07, 0x70, 0x0e, 0x38, 0x1c,
+ 0x1c, 0x38, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char iconify_white_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x03, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char iconify_dgray_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+
+static const unsigned char iconify_mask_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x03, 0x80, 0x02, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char maximize_white_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x04, 0x00, 0x04, 0x08, 0x04, 0x08,
+ 0x04, 0x08, 0x04, 0x08, 0x04, 0x08, 0x04, 0x08, 0x04, 0x08, 0xf4, 0x0f,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char maximize_dgray_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x08, 0x10, 0x08, 0x10,
+ 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10,
+ 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char maximize_mask_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0xfc, 0x1f, 0x0c, 0x18, 0x0c, 0x18,
+ 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x18, 0xfc, 0x1f,
+ 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char maximizedown_white_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0x08, 0x10,
+ 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10,
+ 0x08, 0x10, 0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char maximizedown_dgray_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0x04, 0x00, 0x04, 0x08,
+ 0x04, 0x08, 0x04, 0x08, 0x04, 0x08, 0x04, 0x08, 0x04, 0x08, 0x04, 0x08,
+ 0xf4, 0x0f, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char maximizedown_mask_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0xfc, 0x1f, 0x0c, 0x18,
+ 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x18,
+ 0xfc, 0x1f, 0xfc, 0x1f, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char menu_white_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xfc, 0x3f, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char menu_dgray_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x20, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char menu_mask_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xfc, 0x3f, 0x04, 0x20, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char pindown_white_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x80, 0x1f, 0xa0, 0x03,
+ 0xb0, 0x01, 0x30, 0x01, 0xf0, 0x00, 0x70, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char pindown_gray_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c,
+ 0x00, 0x0e, 0x00, 0x06, 0x00, 0x00, 0x80, 0x07, 0xc0, 0x03, 0xe0, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char pindown_dgray_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x10, 0x70, 0x20, 0x50, 0x20,
+ 0x48, 0x30, 0xc8, 0x38, 0x08, 0x1f, 0x08, 0x18, 0x10, 0x1c, 0x10, 0x0e,
+ 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char pindown_mask_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x1f, 0xf0, 0x3f, 0xf0, 0x3f,
+ 0xf8, 0x3f, 0xf8, 0x3f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf0, 0x1f, 0xf0, 0x0f,
+ 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char pinup_white_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x11,
+ 0x3f, 0x15, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char pinup_gray_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x0a, 0xbf, 0x0a, 0x80, 0x15, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char pinup_dgray_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x40, 0x31, 0x40, 0x2e,
+ 0x40, 0x20, 0x40, 0x20, 0x7f, 0x2a, 0x40, 0x3f, 0xc0, 0x31, 0xc0, 0x20,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char pinup_mask_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0xc0, 0x31, 0xc0, 0x3f,
+ 0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xc0, 0x3f, 0xc0, 0x31, 0xc0, 0x20,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char help_mask_bits[] = {
+ 0x00,0x00,0x00,0x00,0xe0,0x03,0xf0,0x07,0x70,0x0e,0x60,0x0e,0x00,0x0f,0x80,
+ 0x07,0xc0,0x03,0xc0,0x01,0x80,0x01,0xc0,0x00,0xc0,0x01,0x80,0x01,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x4c,0x0b,0x08,0x58,0x65,0x09,0x08,0x90,0x00,0x00,
+ 0x00,0x09,0x04,0x00,0x00,0x72,0x6f,0x6f,0x74,0x00,0x24,0x31,0x24,0x47,0x6b,
+ 0x65,0x44,0x78,0x63 };
+
+static const unsigned char help_dark_bits[] = {
+ 0x00,0x00,0x00,0x00,0xe0,0x03,0x30,0x06,0x30,0x06,0x00,0x06,0x00,0x03,0x80,
+ 0x01,0xc0,0x00,0xc0,0x00,0x00,0x00,0xc0,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x65,0x64,0x28,0x29,0x00,0x00,0x00,0x00,0x90,0x00,0x00,
+ 0x00,0x21,0x00,0x00,0x00,0x34,0xfe,0x12,0x2b,0x00,0x00,0xff,0xff,0x58,0xc0,
+ 0x01,0x2b,0x45,0xfe };
+
+static const unsigned char help_light_bits[] = {
+ 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0x40,0x08,0x60,0x08,0x00,0x0c,0x00,
+ 0x06,0x00,0x03,0x00,0x01,0x80,0x01,0x00,0x00,0x00,0x01,0x80,0x01,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x4c,0x0b,0x08,0x58,0x65,0x09,0x08,0x90,0x00,0x00,
+ 0x00,0x09,0x04,0x00,0x00,0x72,0x6f,0x6f,0x74,0x00,0x24,0x31,0x24,0x47,0x6b,
+ 0x65,0x44,0x78,0x63 };
+
+#endif
+
diff --git a/kwin-styles/kstep/Makefile.am b/kwin-styles/kstep/Makefile.am
new file mode 100644
index 00000000..89397fad
--- /dev/null
+++ b/kwin-styles/kstep/Makefile.am
@@ -0,0 +1,22 @@
+
+INCLUDES = $(all_includes)
+
+kde_module_LTLIBRARIES = kwin3_kstep.la
+
+kwin3_kstep_la_SOURCES = nextclient.cpp
+kwin3_kstep_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+#kwin_kstep_la_LDFLAGS = $(all_libraries) -avoid-version -module $(KDE_RPATH) $(KDE_MT_LDFLAGS)
+kwin3_kstep_la_LIBADD = $(LIB_KDEUI) -lkdecorations
+
+METASOURCES = AUTO
+noinst_HEADERS = nextclient.h
+
+lnkdir = $(kde_datadir)/kwin/
+lnk_DATA = kstep.desktop
+
+EXTRA_DIST = $(lnk_DATA)
+
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/kstep/kstep.desktop b/kwin-styles/kstep/kstep.desktop
new file mode 100644
index 00000000..bf663c8c
--- /dev/null
+++ b/kwin-styles/kstep/kstep.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Name=KStep
+Name[cy]=KCam
+Name[hi]=के-स्टेप
+Name[ne]=केडीई चरण
+Name[sv]=Kstep
+Name[ta]=Kஅடி
+Name[th]=ตัวจัดการหน้าต่างสเต็ป - K
+Name[ven]=Tshitepe tsha K
+Name[xh]=Inqwanqwa le K
+Name[zu]=Izinga le K
+X-KDE-Library=kwin3_kstep
diff --git a/kwin-styles/kstep/nextclient.cpp b/kwin-styles/kstep/nextclient.cpp
new file mode 100644
index 00000000..64fb5217
--- /dev/null
+++ b/kwin-styles/kstep/nextclient.cpp
@@ -0,0 +1,987 @@
+#include "nextclient.h"
+#include <qdatetime.h>
+#include <qdrawutil.h>
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qbitmap.h>
+#include <qlabel.h>
+#include <qtooltip.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kpixmapeffect.h>
+
+namespace KStep {
+
+static const unsigned char close_bits[] = {
+ 0x03, 0x03, 0x87, 0x03, 0xce, 0x01, 0xfc, 0x00, 0x78, 0x00, 0x78, 0x00,
+ 0xfc, 0x00, 0xce, 0x01, 0x87, 0x03, 0x03, 0x03};
+
+static const unsigned char iconify_bits[] = {
+ 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0x03, 0x03, 0x03, 0x03,
+ 0x03, 0x03, 0x03, 0x03, 0xff, 0x03, 0xff, 0x03};
+
+static const unsigned char question_bits[] = {
+ 0x00, 0x00, 0x78, 0x00, 0xcc, 0x00, 0xc0, 0x00, 0x60, 0x00, 0x30, 0x00,
+ 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00};
+
+static const unsigned char sticky_bits[] = {
+ 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0xfe, 0x01, 0xfe, 0x01,
+ 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00};
+
+static const unsigned char unsticky_bits[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0xfe, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+static const unsigned char maximize_bits[] = {
+ 0x30, 0x00, 0x78, 0x00, 0xfc, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xfe, 0x01,
+ 0x02, 0x01, 0x84, 0x00, 0x48, 0x00, 0x30, 0x00 };
+
+static const unsigned char shade_bits[] = {
+ 0xff,0x03,
+ 0xff,0x03,
+ 0x03,0x03,
+ 0xff,0x03,
+ 0xff,0x03,
+ 0x00,0x00,
+ 0x00,0x00,
+ 0x00,0x00,
+ 0x00,0x00,
+ 0x00,0x00
+};
+
+static const unsigned char unshade_bits[] = {
+ 0xff,0x03,
+ 0xff,0x03,
+ 0x03,0x03,
+ 0x03,0x03,
+ 0x03,0x03,
+ 0x03,0x03,
+ 0x03,0x03,
+ 0x03,0x03,
+ 0xff,0x03,
+ 0xff,0x03
+};
+
+static const unsigned char keep_above_bits[] = {
+ 0x30,0x00,
+ 0x78,0x00,
+ 0xfc,0x00,
+ 0x00,0x00,
+ 0xff,0x03,
+ 0xff,0x03,
+ 0x00,0x00,
+ 0x00,0x00,
+ 0x00,0x00,
+ 0x00,0x00
+};
+
+static const unsigned char from_above_bits[] = {
+ 0xff,0x03,
+ 0xff,0x03,
+ 0x00,0x00,
+ 0xfc,0x00,
+ 0x78,0x00,
+ 0x30,0x00,
+ 0x00,0x00,
+ 0x00,0x00,
+ 0x00,0x00,
+ 0x00,0x00
+};
+
+static const unsigned char keep_below_bits[] = {
+ 0x00,0x00,
+ 0x00,0x00,
+ 0x00,0x00,
+ 0x00,0x00,
+ 0xff,0x03,
+ 0xff,0x03,
+ 0x00,0x00,
+ 0xfc,0x00,
+ 0x78,0x00,
+ 0x30,0x00
+};
+
+static const unsigned char from_below_bits[] = {
+ 0x00,0x00,
+ 0x00,0x00,
+ 0x00,0x00,
+ 0x00,0x00,
+ 0x30,0x00,
+ 0x78,0x00,
+ 0xfc,0x00,
+ 0x00,0x00,
+ 0xff,0x03,
+ 0xff,0x03
+};
+
+static const unsigned char resize_bits[] = {
+ 0xff, 0x03,
+ 0xff, 0x03,
+ 0x33, 0x03,
+ 0x33, 0x03,
+ 0xf3, 0x03,
+ 0xf3, 0x03,
+ 0x03, 0x03,
+ 0x03, 0x03,
+ 0xff, 0x03,
+ 0xff, 0x03
+};
+
+
+// If the maximize graphic above (which I did quickly in about a
+// minute, just so I could have something) doesn't please, maybe one
+// of the following would be better. IMO it doesn't matter, as long
+// as it's not offensive---people will get used to whatever you use.
+// True NeXT fans won't turn on the maximize button anyway.
+//
+// static const unsigned char maximize_bits[] = {
+// 0xcf, 0x03, 0x87, 0x03, 0xcf, 0x03, 0xfd, 0x02, 0x48, 0x00, 0x48, 0x00,
+// 0xfd, 0x02, 0xcf, 0x03, 0x87, 0x03, 0xcf, 0x03 };
+//
+// static const unsigned char maximize_bits[] = {
+// 0xcf, 0x03, 0x87, 0x03, 0x87, 0x03, 0x79, 0x02, 0x48, 0x00, 0x48, 0x00,
+// 0x79, 0x02, 0x87, 0x03, 0x87, 0x03, 0xcf, 0x03 };
+//
+// static const unsigned char maximize_bits[] = {
+// 0x87, 0x03, 0x03, 0x03, 0xfd, 0x02, 0x84, 0x00, 0x84, 0x00, 0x84, 0x00,
+// 0x84, 0x00, 0xfd, 0x02, 0x03, 0x03, 0x87, 0x03 };
+//
+// static const unsigned char maximize_bits[] = {
+// 0x30, 0x00, 0x78, 0x00, 0xcc, 0x00, 0x86, 0x01, 0x33, 0x03, 0x79, 0x02,
+// 0xcd, 0x02, 0x87, 0x03, 0x03, 0x03, 0x01, 0x02 };
+//
+// static const unsigned char maximize_bits[] = {
+// 0x30, 0x00, 0x78, 0x00, 0x78, 0x00, 0xfc, 0x00, 0xfc, 0x00, 0xfe, 0x01,
+// 0xfe, 0x01, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03 };
+
+
+static KPixmap *aTitlePix;
+static KPixmap *iTitlePix;
+static KPixmap *aFramePix;
+static KPixmap *iFramePix;
+static KPixmap *aHandlePix;
+static KPixmap *iHandlePix;
+static KPixmap *aBtn;
+static KPixmap *aBtnDown;
+static KPixmap *iBtn;
+static KPixmap *iBtnDown;
+static QColor *btnForeground;
+static bool pixmaps_created = false;
+
+static int titleHeight = 16;
+
+// Precomputed border sizes for accessibility
+// The sizes are applied for tiny -> normal -> large -> very large -> huge -> very huge -> oversized
+static const int borderSizes[] = { 4, 6, 9, 14, 21, 32, 48 };
+
+static int handleSize = 6; // the resize handle size in pixels
+
+static inline const KDecorationOptions* options()
+{
+ return KDecoration::options();
+}
+
+static void create_pixmaps(NextClientFactory *f)
+{
+ if(pixmaps_created)
+ return;
+ pixmaps_created = true;
+
+ // find preferred border size
+ int i = options()->preferredBorderSize(f);
+ if (i >= 0 && i <= 6) handleSize = borderSizes[i];
+
+ titleHeight = QFontMetrics(options()->font(true)).height() + 4;
+ if (titleHeight < handleSize) titleHeight = handleSize;
+ titleHeight &= ~1; // Make title height even
+ if (titleHeight < 16) titleHeight = 16;
+
+ aTitlePix = new KPixmap();
+ aTitlePix->resize(32, titleHeight - 2);
+ KPixmapEffect::gradient(*aTitlePix,
+ options()->color(KDecoration::ColorTitleBar, true),
+ options()->color(KDecoration::ColorTitleBlend, true),
+ KPixmapEffect::VerticalGradient);
+ iTitlePix = new KPixmap();
+ iTitlePix->resize(32, titleHeight - 2);
+ KPixmapEffect::gradient(*iTitlePix,
+ options()->color(KDecoration::ColorTitleBar, false),
+ options()->color(KDecoration::ColorTitleBlend, false),
+ KPixmapEffect::VerticalGradient);
+ // Bottom frame gradient
+ aFramePix = new KPixmap();
+ aFramePix->resize(32, handleSize);
+ KPixmapEffect::gradient(*aFramePix,
+ options()->color(KDecoration::ColorFrame, true).light(150),
+ options()->color(KDecoration::ColorFrame, true).dark(120),
+ KPixmapEffect::VerticalGradient);
+ iFramePix = new KPixmap();
+ iFramePix->resize(32, handleSize);
+ KPixmapEffect::gradient(*iFramePix,
+ options()->color(KDecoration::ColorFrame, false).light(150),
+ options()->color(KDecoration::ColorFrame, false).dark(120),
+ KPixmapEffect::VerticalGradient);
+
+ // Handle gradient
+ aHandlePix = new KPixmap();
+ aHandlePix->resize(32, handleSize);
+ KPixmapEffect::gradient(*aHandlePix,
+ options()->color(KDecoration::ColorHandle, true).light(150),
+ options()->color(KDecoration::ColorHandle, true).dark(120),
+ KPixmapEffect::VerticalGradient);
+ iHandlePix = new KPixmap();
+ iHandlePix->resize(32, handleSize);
+ KPixmapEffect::gradient(*iHandlePix,
+ options()->color(KDecoration::ColorHandle, false).light(150),
+ options()->color(KDecoration::ColorHandle, false).dark(120),
+ KPixmapEffect::VerticalGradient);
+
+ int btnWidth = titleHeight;
+ iBtn = new KPixmap;
+ iBtn->resize(btnWidth, btnWidth);
+ iBtnDown = new KPixmap;
+ iBtnDown->resize(btnWidth, btnWidth);
+ aBtn = new KPixmap;
+ aBtn->resize(btnWidth, btnWidth);
+ aBtnDown = new KPixmap;
+ aBtnDown->resize(btnWidth, btnWidth);
+ KPixmap internal;
+ int internalHeight = btnWidth - 6;
+ internal.resize(internalHeight, internalHeight);
+
+ // inactive buttons
+ QColor c(options()->color(KDecoration::ColorButtonBg, false));
+ KPixmapEffect::gradient(*iBtn, c.light(120), c.dark(120),
+ KPixmapEffect::DiagonalGradient);
+ KPixmapEffect::gradient(internal, c.dark(120), c.light(120),
+ KPixmapEffect::DiagonalGradient);
+ bitBlt(iBtn, 3, 3, &internal, 0, 0, internalHeight, internalHeight, Qt::CopyROP, true);
+
+ KPixmapEffect::gradient(*iBtnDown, c.dark(120), c.light(120),
+ KPixmapEffect::DiagonalGradient);
+ KPixmapEffect::gradient(internal, c.light(120), c.dark(120),
+ KPixmapEffect::DiagonalGradient);
+ bitBlt(iBtnDown, 3, 3, &internal, 0, 0, internalHeight, internalHeight, Qt::CopyROP, true);
+
+ // active buttons
+ c = options()->color(KDecoration::ColorButtonBg, true);
+ KPixmapEffect::gradient(*aBtn, c.light(120), c.dark(120),
+ KPixmapEffect::DiagonalGradient);
+ KPixmapEffect::gradient(internal, c.dark(120), c.light(120),
+ KPixmapEffect::DiagonalGradient);
+ bitBlt(aBtn, 3, 3, &internal, 0, 0, internalHeight, internalHeight, Qt::CopyROP, true);
+
+ KPixmapEffect::gradient(*aBtnDown, c.dark(120), c.light(120),
+ KPixmapEffect::DiagonalGradient);
+ KPixmapEffect::gradient(internal, c.light(120), c.dark(120),
+ KPixmapEffect::DiagonalGradient);
+ bitBlt(aBtnDown, 3, 3, &internal, 0, 0, internalHeight, internalHeight, Qt::CopyROP, true);
+
+ QPainter p;
+ p.begin(aBtn);
+ p.setPen(Qt::black);
+ p.drawRect(0, 0, btnWidth, btnWidth);
+ p.end();
+ p.begin(iBtn);
+ p.setPen(Qt::black);
+ p.drawRect(0, 0, btnWidth, btnWidth);
+ p.end();
+ p.begin(aBtnDown);
+ p.setPen(Qt::black);
+ p.drawRect(0, 0, btnWidth, btnWidth);
+ p.end();
+ p.begin(iBtnDown);
+ p.setPen(Qt::black);
+ p.drawRect(0, 0, btnWidth, btnWidth);
+ p.end();
+
+ if(qGray(options()->color(KDecoration::ColorButtonBg, true).rgb()) > 128)
+ btnForeground = new QColor(Qt::black);
+ else
+ btnForeground = new QColor(Qt::white);
+}
+
+static void delete_pixmaps()
+{
+ delete aTitlePix;
+ delete iTitlePix;
+ delete aFramePix;
+ delete iFramePix;
+ delete aHandlePix;
+ delete iHandlePix;
+ delete aBtn;
+ delete iBtn;
+ delete aBtnDown;
+ delete iBtnDown;
+ delete btnForeground;
+
+ pixmaps_created = false;
+}
+
+// =====================================
+
+NextButton::NextButton(NextClient *parent, const char *name,
+ const unsigned char *bitmap, int bw, int bh,
+ const QString& tip, const int realizeBtns)
+ : QButton(parent->widget(), name),
+ deco(NULL), client(parent), last_button(NoButton)
+{
+ realizeButtons = realizeBtns;
+
+ setBackgroundMode( NoBackground );
+ resize(titleHeight, titleHeight);
+ setFixedSize(titleHeight, titleHeight);
+
+ if(bitmap)
+ setBitmap(bitmap, bw, bh);
+
+ QToolTip::add(this, tip);
+}
+
+void NextButton::reset()
+{
+ repaint(false);
+}
+
+void NextButton::setBitmap(const unsigned char *bitmap, int w, int h)
+{
+ deco = new QBitmap(w, h, bitmap, true);
+ deco->setMask(*deco);
+ repaint();
+}
+
+void NextButton::drawButton(QPainter *p)
+{
+ if(client->isActive())
+ p->drawPixmap(0, 0, isDown() ? *aBtnDown : *aBtn);
+ else
+ p->drawPixmap(0, 0, isDown() ? *iBtnDown : *iBtn);
+
+ // If we have a decoration, draw it; otherwise, we have the menu
+ // button (remember, we set the bitmap to NULL).
+ int offset;
+ if (deco) {
+ offset = (titleHeight - 10) / 2 + (isDown() ? 1 : 0);
+ p->setPen(*btnForeground);
+ p->drawPixmap(offset, offset, *deco);
+ } else {
+ offset = (titleHeight - 16) / 2;
+ KPixmap btnpix = client->icon().pixmap(QIconSet::Small,
+ client->isActive() ? QIconSet::Normal : QIconSet::Disabled);
+ p->drawPixmap( offset, offset, btnpix );
+ }
+}
+
+void NextButton::mousePressEvent( QMouseEvent* e )
+{
+ last_button = e->button();
+ QMouseEvent me( e->type(), e->pos(), e->globalPos(),
+ (e->button()&realizeButtons)?LeftButton:NoButton, e->state() );
+ QButton::mousePressEvent( &me );
+}
+
+void NextButton::mouseReleaseEvent( QMouseEvent* e )
+{
+ last_button = e->button();
+ QMouseEvent me( e->type(), e->pos(), e->globalPos(),
+ (e->button()&realizeButtons)?LeftButton:NoButton, e->state() );
+ QButton::mouseReleaseEvent( &me );
+}
+
+// =====================================
+
+NextClient::NextClient(KDecorationBridge *b, KDecorationFactory *f)
+ : KDecoration(b, f)
+{
+}
+
+void NextClient::init()
+{
+ createMainWidget(WResizeNoErase | WStaticContents);
+ widget()->installEventFilter(this);
+
+ widget()->setBackgroundMode( NoBackground );
+
+ QVBoxLayout *mainLayout = new QVBoxLayout(widget());
+ QBoxLayout *titleLayout = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
+ QHBoxLayout *windowLayout = new QHBoxLayout();
+ mainLayout->addLayout(titleLayout);
+ mainLayout->addLayout(windowLayout, 1);
+ mainLayout->addSpacing(mustDrawHandle() ? handleSize : 1);
+
+ windowLayout->addSpacing(1);
+ if (isPreview())
+ windowLayout->addWidget(new QLabel(i18n(
+ "<center><b>KStep preview</b></center>"), widget()));
+ else
+ windowLayout->addItem(new QSpacerItem( 0, 0 ));
+
+ windowLayout->addSpacing(1);
+
+ initializeButtonsAndTitlebar(titleLayout);
+}
+
+/**
+ Preconditions:
+ + button is an array of length MAX_NUM_BUTTONS
+
+ Postconditions:
+ + Title bar and buttons have been initialized and laid out
+ + for all i in 0..(MAX_NUM_BUTTONS-1), button[i] points to
+ either (1) a valid NextButton instance, if the corresponding
+ button is selected in the current button scheme, or (2) null
+ otherwise.
+ */
+void NextClient::initializeButtonsAndTitlebar(QBoxLayout* titleLayout)
+{
+ // Null the buttons to begin with (they are not guaranteed to be null).
+ for (int i=0; i<MAX_NUM_BUTTONS; i++) {
+ button[i] = NULL;
+ }
+
+ // The default button positions for other styles do not match the
+ // behavior of older versions of KStep, so we have to set these
+ // manually when customButtonPositions isn't enabled.
+ QString left, right;
+ if (options()->customButtonPositions()) {
+ left = options()->titleButtonsLeft();
+ right = options()->titleButtonsRight();
+ } else {
+ left = QString("I");
+ right = QString("SX");
+ }
+
+ // Do actual creation and addition to titleLayout
+ addButtons(titleLayout, left);
+
+ titlebar = new QSpacerItem(10, titleHeight, QSizePolicy::Expanding,
+ QSizePolicy::Minimum );
+ titleLayout->addItem(titlebar);
+ addButtons(titleLayout, right);
+
+ // Finally, activate all live buttons
+ for ( int i = 0; i < MAX_NUM_BUTTONS; i++) {
+ if (button[i]) {
+ button[i]->setMouseTracking( TRUE );
+ }
+ }
+}
+
+/** Adds the buttons for one side of the title bar, based on the spec
+ * string; see the KWinInternal::KDecoration class, methods
+ * titleButtonsLeft and titleBUttonsRight. */
+void NextClient::addButtons(QBoxLayout* titleLayout, const QString& spec)
+{
+ for (unsigned int i=0; i<spec.length(); i++) {
+ switch (spec[i].latin1()) {
+ case 'A':
+ if (isMaximizable()) {
+ button[MAXIMIZE_IDX] =
+ new NextButton(this, "maximize", maximize_bits, 10, 10,
+ i18n("Maximize"), LeftButton|MidButton|RightButton);
+ titleLayout->addWidget( button[MAXIMIZE_IDX] );
+ connect( button[MAXIMIZE_IDX], SIGNAL(clicked()),
+ this, SLOT(maximizeButtonClicked()) );
+ }
+ break;
+
+ case 'H':
+ if (providesContextHelp()) {
+ button[HELP_IDX] = new NextButton(this,
+ "help", question_bits, 10, 10, i18n("Help"));
+ titleLayout->addWidget( button[HELP_IDX] );
+ connect( button[HELP_IDX], SIGNAL(clicked()),
+ this, SLOT(showContextHelp()) );
+ }
+ break;
+
+ case 'I':
+ if (isMinimizable()) {
+ button[ICONIFY_IDX] =
+ new NextButton(this, "iconify", iconify_bits, 10, 10,
+ i18n("Minimize"));
+ titleLayout->addWidget( button[ICONIFY_IDX] );
+ connect( button[ICONIFY_IDX], SIGNAL(clicked()),
+ this, SLOT(minimize()) );
+ }
+ break;
+
+ case 'M':
+ button[MENU_IDX] =
+ new NextButton(this, "menu", NULL, 10, 10, i18n("Menu"), LeftButton|RightButton);
+ titleLayout->addWidget( button[MENU_IDX] );
+ // NOTE DIFFERENCE: capture pressed(), not clicked()
+ connect( button[MENU_IDX], SIGNAL(pressed()),
+ this, SLOT(menuButtonPressed()) );
+ break;
+
+ case 'L':
+ button[SHADE_IDX] =
+ new NextButton(this, "shade", NULL, 0, 0, i18n("Shade"));
+ titleLayout->addWidget( button[SHADE_IDX] );
+ connect( button[SHADE_IDX], SIGNAL(clicked()),
+ this, SLOT(shadeClicked()) );
+ // NOTE DIFFERENCE: set the pixmap separately (2 states)
+ shadeChange();
+ break;
+
+ case 'S':
+ button[STICKY_IDX] =
+ new NextButton(this, "sticky", NULL, 0, 0, i18n("On all desktops"));
+ titleLayout->addWidget( button[STICKY_IDX] );
+ connect( button[STICKY_IDX], SIGNAL(clicked()),
+ this, SLOT(toggleOnAllDesktops()) );
+ // NOTE DIFFERENCE: set the pixmap separately (2 states)
+ desktopChange();
+ break;
+
+ case 'F':
+ button[ABOVE_IDX] = new NextButton(this, "above", NULL, 0, 0, "");
+ titleLayout->addWidget( button[ABOVE_IDX] );
+ connect( button[ABOVE_IDX], SIGNAL(clicked()),
+ this, SLOT(aboveClicked()) );
+ connect(this, SIGNAL(keepAboveChanged(bool)),
+ SLOT(keepAboveChange(bool)));
+ keepAboveChange(keepAbove());
+ break;
+
+ case 'B':
+ button[BELOW_IDX] = new NextButton(this, "below", NULL, 0, 0, "");
+ titleLayout->addWidget( button[BELOW_IDX] );
+ connect( button[BELOW_IDX], SIGNAL(clicked()),
+ this, SLOT(belowClicked()) );
+ connect(this, SIGNAL(keepBelowChanged(bool)),
+ SLOT(keepBelowChange(bool)));
+ keepBelowChange(keepBelow());
+ break;
+
+ case 'X':
+ if (isCloseable()) {
+ button[CLOSE_IDX] =
+ new NextButton(this, "close", close_bits, 10, 10,
+ i18n("Close"));
+ titleLayout->addWidget(button[CLOSE_IDX]);
+ connect(button[CLOSE_IDX], SIGNAL(clicked()),
+ this, SLOT(closeWindow()));
+ }
+ break;
+
+ case 'R':
+ if (mustDrawHandle()) {
+ button[RESIZE_IDX] =
+ new NextButton(this, "resize", resize_bits, 10, 10,
+ i18n("Resize"));
+ titleLayout->addWidget(button[RESIZE_IDX]);
+ // NOTE DIFFERENCE: capture pressed(), not clicked()
+ connect(button[RESIZE_IDX], SIGNAL(pressed()),
+ this, SLOT(resizePressed()));
+ }
+ break;
+ case '_':
+ // TODO: Add spacer handling
+ break;
+
+ default:
+ kdDebug() << " Can't happen: unknown button code "
+ << QString(spec[i]);
+ break;
+ }
+ }
+}
+
+bool NextClient::mustDrawHandle() const
+{
+ bool drawSmallBorders = !options()->moveResizeMaximizedWindows();
+ if (drawSmallBorders && (maximizeMode() & MaximizeVertical)) {
+ return false;
+ } else {
+ return isResizable();
+ }
+}
+
+void NextClient::iconChange()
+{
+ if (button[MENU_IDX] && button[MENU_IDX]->isVisible())
+ button[MENU_IDX]->repaint(false);
+}
+
+void NextClient::menuButtonPressed()
+{
+ // Probably don't need this null check, but we might as well.
+ if (button[MENU_IDX]) {
+ QRect menuRect = button[MENU_IDX]->rect();
+ QPoint menuTop = button[MENU_IDX]->mapToGlobal(menuRect.topLeft());
+ QPoint menuBottom = button[MENU_IDX]->mapToGlobal(menuRect.bottomRight());
+ menuTop += QPoint(1, 1);
+ menuBottom += QPoint(1, 1);
+ KDecorationFactory* f = factory();
+ showWindowMenu(QRect(menuTop, menuBottom));
+ if( !f->exists( this )) // 'this' was deleted
+ return;
+ button[MENU_IDX]->setDown(false);
+ }
+}
+
+// Copied, with minor edits, from KDEDefaultClient::slotMaximize()
+void NextClient::maximizeButtonClicked()
+{
+ if (button[MAXIMIZE_IDX]) {
+ maximize(button[MAXIMIZE_IDX]->lastButton());
+ }
+}
+
+void NextClient::shadeClicked()
+{
+ setShade(!isSetShade());
+}
+
+void NextClient::aboveClicked()
+{
+ setKeepAbove(!keepAbove());
+}
+
+void NextClient::belowClicked()
+{
+ setKeepBelow(!keepBelow());
+ keepAboveChange(keepAbove());
+ keepBelowChange(keepBelow());
+}
+
+void NextClient::resizePressed()
+{
+ performWindowOperation(ResizeOp);
+}
+
+void NextClient::resizeEvent(QResizeEvent *)
+{
+ if (widget()->isVisible()) {
+ // TODO ? update border area only?
+ widget()->update();
+#if 0
+ widget()->update(titlebar->geometry());
+ QPainter p(widget());
+ QRect t = titlebar->geometry();
+ t.setTop( 0 );
+ QRegion r = widget()->rect();
+ r = r.subtract( t );
+ p.setClipRegion( r );
+ p.eraseRect(widget()->rect());
+#endif
+ }
+}
+
+void NextClient::captionChange()
+{
+ widget()->repaint(titlebar->geometry(), false);
+}
+
+
+void NextClient::paintEvent( QPaintEvent* )
+{
+ QPainter p(widget());
+
+ // Draw black frame
+ QRect fr = widget()->rect();
+ p.setPen(Qt::black);
+ p.drawRect(fr);
+
+ // Draw title bar
+ QRect t = titlebar->geometry();
+ t.setTop(1);
+ p.drawTiledPixmap(t.x()+1, t.y()+1, t.width()-2, t.height()-2,
+ isActive() ? *aTitlePix : *iTitlePix);
+ qDrawShadePanel(&p, t.x(), t.y(), t.width(), t.height()-1,
+ options()->colorGroup(KDecoration::ColorTitleBar, isActive()));
+ p.drawLine(t.x(), t.bottom(), t.right(), t.bottom());
+
+#if 0
+ // Why setting up a clipping region if it is not used? (setClipping(false))
+ QRegion r = fr;
+ r = r.subtract( t );
+ p.setClipRegion( r );
+ p.setClipping(false);
+#endif
+
+ t.setTop( 1 );
+ t.setHeight(t.height()-2);
+ t.setLeft( t.left() + 4 );
+ t.setRight( t.right() - 2 );
+
+ p.setPen(options()->color(KDecoration::ColorFont, isActive()));
+ p.setFont(options()->font(isActive()));
+ p.drawText( t, AlignCenter | AlignVCenter, caption() );
+
+ // Draw resize handle
+ if (mustDrawHandle()) {
+ int corner = 16 + 3*handleSize/2;
+ qDrawShadePanel(&p,
+ fr.x() + 1, fr.bottom() - handleSize, corner-1, handleSize,
+ options()->colorGroup(KDecoration::ColorHandle, isActive()),
+ false);
+ p.drawTiledPixmap(fr.x() + 2, fr.bottom() - handleSize + 1,
+ corner - 3, handleSize - 2, isActive() ? *aHandlePix : *iHandlePix);
+
+ qDrawShadePanel(&p,
+ fr.x() + corner, fr.bottom() - handleSize,
+ fr.width() - 2*corner, handleSize,
+ options()->colorGroup(KDecoration::ColorFrame, isActive()),
+ false);
+ p.drawTiledPixmap(fr.x() + corner + 1, fr.bottom() - handleSize + 1,
+ fr.width() - 2*corner - 2, handleSize - 2,
+ isActive() ? *aFramePix : *iFramePix);
+
+ qDrawShadePanel(&p,
+ fr.right() - corner + 1, fr.bottom() - handleSize, corner - 1, handleSize,
+ options()->colorGroup(KDecoration::ColorHandle, isActive()),
+ false);
+ p.drawTiledPixmap(fr.right() - corner + 2, fr.bottom() - handleSize + 1,
+ corner - 3, handleSize - 2, isActive() ? *aHandlePix : *iHandlePix);
+ }
+}
+
+void NextClient::mouseDoubleClickEvent( QMouseEvent * e )
+{
+ if (e->button() == LeftButton && titlebar->geometry().contains( e->pos() ) )
+ titlebarDblClickOperation();
+}
+
+void NextClient::wheelEvent( QWheelEvent * e )
+{
+ if (isSetShade() || QRect( 0, 0, width(), titleHeight ).contains( e->pos() ) )
+ titlebarMouseWheelOperation( e->delta());
+}
+
+void NextClient::showEvent(QShowEvent *)
+{
+ widget()->repaint();
+}
+
+void NextClient::desktopChange()
+{
+ bool on = isOnAllDesktops();
+ if (NextButton * b = button[STICKY_IDX]) {
+ b->setBitmap( on ? unsticky_bits : sticky_bits, 10, 10);
+ QToolTip::remove(b);
+ QToolTip::add(b, on ? i18n("Not on all desktops") : i18n("On all desktops"));
+ }
+}
+
+void NextClient::maximizeChange()
+{
+ if (button[MAXIMIZE_IDX]) {
+ bool m = maximizeMode() == MaximizeFull;
+ //button[MAXIMIZE_IDX]->setBitmap(m ? minmax_bits : maximize_bits);
+ QToolTip::remove(button[MAXIMIZE_IDX]);
+ QToolTip::add(button[MAXIMIZE_IDX],
+ m ? i18n("Restore") : i18n("Maximize"));
+ }
+ //spacer->changeSize(10, mustDrawHandle() ? handleSize : 1,
+ // QSizePolicy::Expanding, QSizePolicy::Minimum);
+ //mainLayout->activate();
+}
+
+void NextClient::activeChange()
+{
+ widget()->repaint(false);
+ slotReset();
+}
+
+void NextClient::slotReset()
+{
+ for (int i=0; i<MAX_NUM_BUTTONS; i++) {
+ if (button[i]) {
+ button[i]->reset();
+ }
+ }
+}
+
+KDecoration::Position
+NextClient::mousePosition( const QPoint& p ) const
+{
+ Position m = PositionCenter;
+
+ if (p.y() < (height() - handleSize))
+ m = KDecoration::mousePosition(p);
+
+ else {
+ int corner = 16 + 3*handleSize/2;
+ if (p.x() >= (width() - corner))
+ m = PositionBottomRight;
+ else if (p.x() <= corner)
+ m = PositionBottomLeft;
+ else
+ m = PositionBottom;
+ }
+
+ return m;
+}
+
+void NextClient::borders(int &left, int &right, int &top, int &bottom) const
+{
+ left = right = 1;
+ top = titleHeight; // FRAME is this ok?
+ bottom = mustDrawHandle() ? handleSize : 1;
+}
+
+void NextClient::shadeChange()
+{
+ if (NextButton *b = button[SHADE_IDX]) {
+ b->setBitmap(isSetShade() ? unshade_bits : shade_bits, 10, 10);
+ QToolTip::remove(b);
+ QToolTip::add(b, isSetShade() ? i18n("Unshade") : i18n("Shade"));
+ }
+}
+
+void NextClient::keepAboveChange(bool above)
+{
+ if (NextButton *b = button[ABOVE_IDX]) {
+ b->setBitmap(above ? from_above_bits : keep_above_bits, 10, 10);
+ QToolTip::remove(b);
+ QToolTip::add(b, above ?
+ i18n("Do not keep above others") : i18n("Keep above others"));
+ b->repaint(false);
+ }
+}
+
+void NextClient::keepBelowChange(bool below)
+{
+ if (NextButton *b = button[BELOW_IDX]) {
+ b->setBitmap(below ? from_below_bits : keep_below_bits, 10, 10);
+ QToolTip::remove(b);
+ QToolTip::add(b, below ?
+ i18n("Do not keep below others") : i18n("Keep below others"));
+ b->repaint(false);
+ }
+}
+
+QSize NextClient::minimumSize() const
+{
+ return QSize(titleHeight * 6 + 2, titleHeight + handleSize + 2);
+}
+
+void NextClient::resize(const QSize& s)
+{
+ widget()->resize(s);
+}
+
+void NextClient::reset(unsigned long)
+{
+ for (int i = 0; i < MAX_NUM_BUTTONS; ++i) {
+ if (button[i])
+ button[i]->reset();
+ }
+ widget()->repaint();
+}
+
+bool NextClient::eventFilter(QObject *o, QEvent *e)
+{
+ if (o != widget())
+ return false;
+ switch (e->type()) {
+ case QEvent::Resize:
+ resizeEvent(static_cast< QResizeEvent* >( e ));
+ return true;
+ case QEvent::Paint:
+ paintEvent(static_cast< QPaintEvent* >( e ));
+ return true;
+ case QEvent::MouseButtonDblClick:
+ mouseDoubleClickEvent(static_cast< QMouseEvent* >( e ));
+ return true;
+ case QEvent::Wheel:
+ wheelEvent( static_cast< QWheelEvent* >( e ));
+ return true;
+ case QEvent::MouseButtonPress:
+ processMousePressEvent(static_cast< QMouseEvent* >( e ));
+ return true;
+ case QEvent::Show:
+ showEvent(static_cast< QShowEvent* >( e ));
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+bool NextClient::drawbound(const QRect& geom, bool /* clear */)
+{
+ QPainter p(workspaceWidget());
+ p.setPen(QPen(Qt::white, 3));
+ p.setRasterOp(Qt::XorROP);
+ p.drawRect(geom);
+ int leftMargin = geom.left() + 2;
+ p.fillRect(leftMargin, geom.top() + titleHeight - 1,
+ geom.width() - 4, 3, Qt::white);
+ if (mustDrawHandle()) {
+ p.fillRect(leftMargin, geom.bottom() - handleSize - 1,
+ geom.width() - 4, 3, Qt::white);
+ }
+ return true;
+}
+
+// =====================================
+
+NextClientFactory::NextClientFactory()
+{
+ create_pixmaps(this);
+}
+
+NextClientFactory::~NextClientFactory()
+{
+ delete_pixmaps();
+}
+
+KDecoration *NextClientFactory::createDecoration(KDecorationBridge *b)
+{
+ return new NextClient(b, this);
+}
+
+bool NextClientFactory::reset(unsigned long /*changed*/)
+{
+ // TODO Do not recreate decorations if it is not needed. Look at
+ // ModernSystem for how to do that
+ delete_pixmaps();
+ create_pixmaps(this);
+ // For now just return true.
+ return true;
+}
+
+bool NextClientFactory::supports( Ability ability )
+{
+ switch( ability )
+ {
+ case AbilityAnnounceButtons:
+ case AbilityButtonMenu:
+ case AbilityButtonOnAllDesktops:
+ case AbilityButtonHelp:
+ case AbilityButtonMinimize:
+ case AbilityButtonMaximize:
+ case AbilityButtonClose:
+ case AbilityButtonAboveOthers:
+ case AbilityButtonBelowOthers:
+ case AbilityButtonShade:
+ case AbilityButtonResize:
+ return true;
+ default:
+ return false;
+ };
+}
+
+QValueList< NextClientFactory::BorderSize >
+NextClientFactory::borderSizes() const
+{
+ // the list must be sorted
+ return QValueList< BorderSize >() << BorderTiny << BorderNormal <<
+ BorderLarge << BorderVeryLarge << BorderHuge <<
+ BorderVeryHuge << BorderOversized;
+}
+
+} // KStep namespace
+
+extern "C" KDE_EXPORT KDecorationFactory* create_factory()
+{
+ return new KStep::NextClientFactory();
+}
+
+#include "nextclient.moc"
+
+// vim: sw=4
diff --git a/kwin-styles/kstep/nextclient.h b/kwin-styles/kstep/nextclient.h
new file mode 100644
index 00000000..dc0470c8
--- /dev/null
+++ b/kwin-styles/kstep/nextclient.h
@@ -0,0 +1,125 @@
+#ifndef __NEXTCLIENT_H
+#define __NEXTCLIENT_H
+
+#include <qvariant.h>
+#include <qbitmap.h>
+#include <kpixmap.h>
+#include <qlayout.h>
+#include <qbutton.h>
+#include <kdecoration.h>
+#include <kdecorationfactory.h>
+
+class QLabel;
+class QSpacerItem;
+
+namespace KStep {
+
+class NextClient;
+
+class NextButton : public QButton
+{
+public:
+ NextButton(NextClient *parent=0, const char *name=0,
+ const unsigned char *bitmap=NULL, int bw=0, int bh=0,
+ const QString& tip=NULL, const int realizeBtns = LeftButton);
+ void setBitmap(const unsigned char *bitmap, int bw, int bh);
+ void reset();
+ ButtonState lastButton() { return last_button; }
+
+protected:
+ void mousePressEvent( QMouseEvent* e );
+ void mouseReleaseEvent( QMouseEvent* e );
+ virtual void drawButton(QPainter *p);
+ void drawButtonLabel(QPainter *){;}
+
+ KPixmap aBackground, iBackground;
+ QBitmap* deco;
+ NextClient *client;
+ ButtonState last_button;
+ int realizeButtons;
+};
+
+class NextClient : public KDecoration
+{
+ Q_OBJECT
+public:
+ NextClient(KDecorationBridge *b, KDecorationFactory *f);
+ ~NextClient() {;}
+ void init();
+ virtual bool drawbound(const QRect& geom, bool clear);
+protected:
+ bool eventFilter(QObject *o, QEvent *e);
+ void resizeEvent( QResizeEvent* );
+ void paintEvent( QPaintEvent* );
+ void showEvent( QShowEvent* );
+
+ void mouseDoubleClickEvent( QMouseEvent * );
+ void wheelEvent( QWheelEvent * );
+ void captionChange();
+ void desktopChange();
+ void activeChange();
+ void shadeChange();
+ void iconChange();
+ QSize minimumSize() const;
+ void resize(const QSize &size);
+ void borders(int &left, int &right, int &top, int &bottom) const;
+ void reset(unsigned long changed);
+ void calcHiddenButtons();
+ void updateActiveBuffer();
+
+ Position mousePosition(const QPoint &) const;
+ void maximizeChange();
+
+protected slots:
+ void slotReset();
+ void menuButtonPressed();
+ void maximizeButtonClicked();
+ void shadeClicked();
+ void aboveClicked();
+ void belowClicked();
+ void resizePressed();
+
+ void keepAboveChange(bool above);
+ void keepBelowChange(bool below);
+
+private:
+ void initializeButtonsAndTitlebar(QBoxLayout* titleLayout);
+ void addButtons(QBoxLayout* titleLayout, const QString& buttons);
+ bool mustDrawHandle() const;
+
+ QSpacerItem* titlebar;
+
+ // Helpful constants for buttons in array
+ enum { CLOSE_IDX = 0,
+ HELP_IDX,
+ ICONIFY_IDX,
+ MAXIMIZE_IDX,
+ MENU_IDX,
+ SHADE_IDX,
+ ABOVE_IDX,
+ BELOW_IDX,
+ RESIZE_IDX,
+ STICKY_IDX,
+ MAX_NUM_BUTTONS = STICKY_IDX + 1 };
+
+ // WARNING: button[i] may be null for any given i. Make sure you
+ // always check for null before doing button[i]->foo().
+ NextButton* button[MAX_NUM_BUTTONS];
+};
+
+class NextClientFactory: public QObject, public KDecorationFactory
+{
+public:
+ NextClientFactory();
+ virtual ~NextClientFactory();
+ virtual KDecoration *createDecoration(KDecorationBridge *);
+ virtual bool reset(unsigned long changed);
+ virtual bool supports( Ability ability );
+
+ QValueList< NextClientFactory::BorderSize > borderSizes() const;
+
+};
+
+}
+
+#endif
diff --git a/kwin-styles/openlook/Makefile.am b/kwin-styles/openlook/Makefile.am
new file mode 100644
index 00000000..25ed43d0
--- /dev/null
+++ b/kwin-styles/openlook/Makefile.am
@@ -0,0 +1,16 @@
+INCLUDES = $(all_includes)
+
+kde_module_LTLIBRARIES = kwin3_openlook.la
+
+kwin3_openlook_la_SOURCES = OpenLook.cpp
+kwin3_openlook_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwin3_openlook_la_LIBADD = -lkdecorations
+
+noinst_HEADERS = OpenLook.h
+METASOURCES = AUTO
+
+linkdir = $(kde_datadir)/kwin/
+link_DATA = openlook.desktop
+
+EXTRA_DIST = $(link_DATA)
+
diff --git a/kwin-styles/openlook/OpenLook.cpp b/kwin-styles/openlook/OpenLook.cpp
new file mode 100644
index 00000000..0f31a6ec
--- /dev/null
+++ b/kwin-styles/openlook/OpenLook.cpp
@@ -0,0 +1,728 @@
+/*
+ 'OpenLook' kwin client
+
+ Porting to kde3.2 API
+ Copyright 2003 Luciano Montanaro <mikelima@cirulla.net>
+
+ 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 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 IN THE SOFTWARE.
+*/
+
+#include "config.h"
+#include <unistd.h> // for usleep
+#include <math.h>
+
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qdrawutil.h>
+#include <qtoolbutton.h>
+#include <qimage.h>
+#include <qlabel.h>
+#include <qpixmap.h>
+
+#include <kapplication.h>
+#include <klocale.h>
+
+#include "OpenLook.h"
+
+extern "C" KDE_EXPORT KDecorationFactory* create_factory()
+{
+ return new OpenLook::DecorationFactory();
+}
+
+namespace OpenLook {
+
+static uint openLookCornerSize = 11;
+static uint openLookMargin = 5;
+static const uint openLookTextVMargin = 1;
+static uint titleHeight;
+
+// ---------------------------------------
+
+DecorationFactory::DecorationFactory()
+{
+}
+
+DecorationFactory::~DecorationFactory()
+{
+}
+
+KDecoration *DecorationFactory::createDecoration(KDecorationBridge *b)
+{
+ return new OpenLook(b, this);
+}
+
+bool DecorationFactory::reset(unsigned long /*changed*/)
+{
+ // TODO Do not recreate decorations if it is not needed. Look at
+ // ModernSystem for how to do that
+ // For now just return true.
+ return true;
+}
+
+bool DecorationFactory::supports( Ability ability )
+{
+ switch( ability )
+ {
+ case AbilityAnnounceButtons:
+ case AbilityButtonMinimize:
+ return true;
+ default:
+ return false;
+ };
+}
+
+QValueList< DecorationFactory::BorderSize >
+DecorationFactory::borderSizes() const
+{
+ // the list must be sorted
+ return QValueList< BorderSize >() << BorderNormal <<
+ BorderLarge << BorderVeryLarge << BorderHuge <<
+ BorderVeryHuge << BorderOversized;
+}
+
+// ---------------------------------------
+
+static inline const KDecorationOptions* options()
+{
+ return KDecoration::options();
+}
+
+// ---------------------------------------
+
+OpenLook::OpenLook(KDecorationBridge *b, KDecorationFactory *f) :
+ KDecoration(b, f),
+ titleSpacer_ (0),
+ mousePressPoint_(0, 0), // Anywhere outside button rect.
+ buttonDown_ (false)
+{
+}
+
+void OpenLook::init()
+{
+ static const int SUPPORTED_WINDOW_TYPES_MASK = NET::NormalMask |
+ NET::DesktopMask | NET::DockMask | NET::ToolbarMask | NET::MenuMask |
+ NET::DialogMask | NET::OverrideMask | NET::TopMenuMask |
+ NET::UtilityMask | NET::SplashMask;
+
+ createMainWidget(WStaticContents | WResizeNoErase | WRepaintNoErase);
+ widget()->installEventFilter(this);
+ widget()->setBackgroundMode(NoBackground);
+ NET::WindowType type = windowType(SUPPORTED_WINDOW_TYPES_MASK);
+ tool_ = (type == NET::Toolbar || type == NET::Utility || type == NET::Menu);
+ QFontMetrics fm(options()->font(isActive(), tool_));
+
+ titleHeight = fm.height() + openLookTextVMargin * 2;
+
+ switch(KDecoration::options()->preferredBorderSize(factory())) {
+ case KDecoration::BorderLarge:
+ openLookMargin = 9;
+ break;
+ case KDecoration::BorderVeryLarge:
+ openLookMargin = 13;
+ break;
+ case KDecoration::BorderHuge:
+ openLookMargin = 18;
+ break;
+ case KDecoration::BorderVeryHuge:
+ openLookMargin = 27;
+ break;
+ case KDecoration::BorderOversized:
+ openLookMargin = 40;
+ break;
+ case KDecoration::BorderNormal:
+ default:
+ openLookMargin = 5;
+ }
+ openLookCornerSize = 2*openLookMargin + 1;
+ if (titleHeight <= openLookMargin)
+ titleHeight = openLookMargin+1;
+
+ doLayout();
+}
+
+OpenLook::~OpenLook()
+{
+ // Empty.
+}
+
+bool OpenLook::eventFilter(QObject *o, QEvent *e)
+{
+ if (o != widget()) return false;
+ switch (e->type()) {
+ case QEvent::Resize:
+ resizeEvent(static_cast< QResizeEvent* >(e));
+ return true;
+ case QEvent::Paint:
+ paintEvent(static_cast< QPaintEvent* >(e));
+ return true;
+ case QEvent::MouseButtonDblClick:
+ mouseDoubleClickEvent(static_cast< QMouseEvent* >(e));
+ return true;
+ case QEvent::Wheel:
+ wheelEvent( static_cast< QWheelEvent* >( e ));
+ return true;
+ case QEvent::MouseButtonPress:
+ if (!isButtonPress(static_cast< QMouseEvent* >(e))) {
+ processMousePressEvent(static_cast< QMouseEvent* >(e));
+ }
+ return true;
+ case QEvent::MouseButtonRelease:
+ if (isButtonRelease(static_cast< QMouseEvent* >(e))) {
+ return true;
+ } else {
+ return false;
+ }
+ case QEvent::Show:
+ showEvent(static_cast< QShowEvent* >(e));
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+ void
+OpenLook::borders(int &left, int &right, int &top, int &bottom) const
+{
+ // FRAME XXX Check
+ left = right = bottom = openLookMargin;
+ top = titleHeight + openLookMargin;
+}
+
+ void
+OpenLook::captionChange()
+{
+ widget()->update(titleRect());
+}
+
+ void
+OpenLook::shadeChange()
+{
+}
+
+QSize OpenLook::minimumSize() const
+{
+ int left, right, top, bottom;
+ borders(left, right, top, bottom);
+ return QSize(left + right + 2 * titleHeight, top + bottom);
+}
+
+ void
+OpenLook::resize(const QSize& s)
+{
+ widget()->resize(s);
+ widget()->repaint(); //there is some strange wrong repaint of the frame without
+}
+
+ void
+OpenLook::paintEvent(QPaintEvent * pe)
+{
+ QRect tr(titleRect());
+
+ QPainter p(widget());
+
+ QRegion clipRegion(pe->region());
+
+ p.setClipRegion(clipRegion);
+
+ paintBorder(p);
+
+ paintTopLeftRect(p);
+ paintTopRightRect(p);
+ paintBottomLeftRect(p);
+ paintBottomRightRect(p);
+
+ p.setClipRegion(clipRegion + buttonRect());
+
+ QBrush titleBackground(options()->color(KDecoration::ColorTitleBar, true));
+
+ if (isActive())
+ qDrawShadePanel(&p, tr, widget()->colorGroup(), true, 1, &titleBackground);
+ else
+ p.fillRect(tr, widget()->colorGroup().brush(QColorGroup::Background));
+
+ p.setClipRegion(clipRegion);
+
+ paintButton(p);
+
+ p.setFont(options()->font(isActive(), tool_));
+
+ p.setPen(options()->color(KDecoration::ColorFont, isActive()));
+
+ tr.setLeft(openLookCornerSize + 3 + buttonRect().width() + 2);
+
+ p.drawText(tr, AlignCenter, caption());
+}
+
+ void
+OpenLook::showEvent(QShowEvent *)
+{
+ widget()->repaint();
+}
+
+ void
+OpenLook::mouseDoubleClickEvent(QMouseEvent * e)
+{
+ if (e->button() == LeftButton && titleRect().contains(e->pos()))
+ {
+ titlebarDblClickOperation();
+ }
+}
+
+ void
+OpenLook::wheelEvent(QWheelEvent *e)
+{
+ if (isSetShade() || titleRect().contains(e->pos()))
+ {
+ titlebarMouseWheelOperation( e->delta());
+ }
+}
+
+ void
+OpenLook::resizeEvent(QResizeEvent* e)
+{
+ widget()->update();
+}
+
+ void
+OpenLook::activeChange()
+{
+ widget()->repaint();
+}
+
+ KDecoration::Position
+OpenLook::mousePosition(const QPoint & p) const
+{
+ if (topLeftRect().contains(p))
+ return PositionTopLeft;
+ else if (topRightRect().contains(p))
+ return PositionTopRight;
+ else if (bottomLeftRect().contains(p))
+ return PositionBottomLeft;
+ else if (bottomRightRect().contains(p))
+ return PositionBottomRight;
+ else
+ return PositionCenter;
+}
+
+ void
+OpenLook::iconChange()
+{
+}
+
+ void
+OpenLook::desktopChange()
+{
+}
+
+ void
+OpenLook::maximizeChange()
+{
+ widget()->repaint(false);
+}
+
+ void
+OpenLook::doLayout()
+{
+ QVBoxLayout * layout = new QVBoxLayout(widget(), openLookMargin);
+
+ titleSpacer_ =
+ new QSpacerItem
+ (
+ 0,
+ titleHeight,
+ QSizePolicy::Expanding,
+ QSizePolicy::Fixed
+ );
+
+ layout->addItem(titleSpacer_);
+
+ layout->addSpacing(2);
+
+ QBoxLayout * midLayout =
+ new QBoxLayout(layout, QBoxLayout::LeftToRight, 0, 0);
+
+ if (isPreview()) {
+ midLayout->addWidget(new QLabel(
+ i18n("<center><b>OpenLook preview</b></center>"),
+ widget()),
+ 1);
+ } else {
+ midLayout->addItem( new QSpacerItem( 0, 0 ));
+ }
+
+}
+
+ bool
+OpenLook::animateMinimize(bool /*iconify*/)
+{
+#if 0
+ QRect icongeom(iconGeometry());
+
+ if (!icongeom.isValid())
+ return false;
+
+ QRect wingeom(geometry());
+
+ QPainter p(workspaceWidget());
+
+ p.setRasterOp(Qt::NotROP);
+
+#if 0
+ if (iconify)
+ p.setClipRegion(
+ QRegion(workspace()->desktopWidget()->rect()) - wingeom
+ );
+#endif
+
+ for (uint count = 0; count < 4; count++)
+ {
+ grabXServer();
+
+ p.drawLine(wingeom.bottomRight(), icongeom.bottomRight());
+ p.drawLine(wingeom.bottomLeft(), icongeom.bottomLeft());
+ p.drawLine(wingeom.topLeft(), icongeom.topLeft());
+ p.drawLine(wingeom.topRight(), icongeom.topRight());
+
+ p.flush();
+
+ kapp->syncX();
+
+ usleep(10000);
+
+ p.drawLine(wingeom.bottomRight(), icongeom.bottomRight());
+ p.drawLine(wingeom.bottomLeft(), icongeom.bottomLeft());
+ p.drawLine(wingeom.topLeft(), icongeom.topLeft());
+ p.drawLine(wingeom.topRight(), icongeom.topRight());
+
+ p.flush();
+
+ kapp->syncX();
+
+ usleep(10000);
+
+ ungrabXServer();
+ }
+#endif
+ return true;
+}
+
+ QRect
+OpenLook::topLeftRect() const
+{
+ return QRect
+ (
+ 0,
+ 0,
+ openLookCornerSize,
+ openLookCornerSize
+ );
+}
+
+ QRect
+OpenLook::topRightRect() const
+{
+ return QRect
+ (
+ width() - openLookCornerSize,
+ 0,
+ openLookCornerSize,
+ openLookCornerSize
+ );
+}
+
+ QRect
+OpenLook::bottomLeftRect() const
+{
+ return QRect
+ (
+ 0,
+ height() - openLookCornerSize,
+ openLookCornerSize,
+ openLookCornerSize
+ );
+}
+
+ QRect
+OpenLook::bottomRightRect() const
+{
+ return QRect
+ (
+ width() - openLookCornerSize,
+ height() - openLookCornerSize,
+ openLookCornerSize,
+ openLookCornerSize
+ );
+}
+
+ void
+OpenLook::paintTopLeftRect(QPainter & p) const
+{
+ QColor handleColour(options()->color(KDecoration::ColorHandle, isActive()));
+
+ QRect r(topLeftRect());
+
+ int x1(r.left());
+ int y1(r.top());
+ int x2(r.right());
+ int y2(r.bottom());
+
+ p.setPen(widget()->colorGroup().light());
+
+ p.drawLine(x1, y1, x2, y1);
+ p.drawLine(x1, y1 + 1, x1, y2);
+
+ p.fillRect(x1 + 1, y1 + 1, r.width()-2, openLookMargin-2, handleColour);
+ p.fillRect(x1 + 1, y1 + 1, openLookMargin-2, r.height()-2, handleColour);
+
+ p.setPen(widget()->colorGroup().dark());
+
+ p.drawLine(x2, y1 + 1, x2, y1 + openLookMargin-1);
+
+ p.drawLine(x1 + openLookMargin-1, y1 + openLookMargin-1, x2 - 1, y1 + openLookMargin-1);
+
+ p.drawLine(x1 + openLookMargin-1, y1 + openLookMargin, x1 + openLookMargin-1, y2 - 1);
+
+ p.drawLine(x1 + 1, y2, x1 + openLookMargin-1, y2);
+}
+
+ void
+OpenLook::paintTopRightRect(QPainter & p) const
+{
+ QColor handleColour(options()->color(KDecoration::ColorHandle, isActive()));
+
+ QRect r(topRightRect());
+
+ int x1(r.left());
+ int y1(r.top());
+ int x2(r.right());
+ int y2(r.bottom());
+
+ p.setPen(widget()->colorGroup().light());
+
+ p.drawLine(x1, y1, x2, y1);
+ p.drawLine(x1, y1 + 1, x1, y1 + openLookMargin-1);
+ p.drawLine(x2 - openLookMargin+1, y1 + openLookMargin, x2 - openLookMargin+1, y2);
+
+ p.fillRect(x1 + 1, y1 + 1, r.width()-2, openLookMargin-2, handleColour);
+ p.fillRect(x2 - openLookMargin + 2, y1 + 1, openLookMargin-2, r.height()-2, handleColour);
+
+ p.setPen(widget()->colorGroup().dark());
+
+ p.drawLine(x1 + 1, y1 + openLookMargin-1, x2 - openLookMargin+1, y1 + openLookMargin-1);
+ p.drawLine(x2, y1 + 1, x2, y2);
+ p.drawLine(x2 - openLookMargin+1, y2, x2 - 1, y2);
+}
+
+ void
+OpenLook::paintBottomLeftRect(QPainter & p) const
+{
+ QColor handleColour(options()->color(KDecoration::ColorHandle, isActive()));
+
+ QRect r(bottomLeftRect());
+
+ int x1(r.left());
+ int y1(r.top());
+ int x2(r.right());
+ int y2(r.bottom());
+
+ p.setPen(widget()->colorGroup().light());
+
+ p.drawLine(x1, y1, x1 + openLookMargin-1, y1);
+ p.drawLine(x1, y1 + 1, x1, y2);
+ p.drawLine(x1 + openLookMargin, y2 - openLookMargin+1, x2, y2 - openLookMargin+1);
+
+ p.fillRect(x1 + 1, y2 - openLookMargin + 2, r.width()-2, openLookMargin-2, handleColour);
+ p.fillRect(x1 + 1, y1 + 1, openLookMargin-2, r.height()-2, handleColour);
+
+ p.setPen(widget()->colorGroup().dark());
+
+ p.drawLine(x1 + openLookMargin-1, y1 + 1, x1 + openLookMargin-1, y2 - openLookMargin);
+ p.drawLine(x1 + 1, y2, x2, y2);
+ p.drawLine(x2, y2 - openLookMargin+2, x2, y2 - 1);
+}
+
+ void
+OpenLook::paintBottomRightRect(QPainter & p) const
+{
+ QColor handleColour(options()->color(KDecoration::ColorHandle, isActive()));
+
+ QRect r(bottomRightRect());
+
+ int x1(r.left());
+ int y1(r.top());
+ int x2(r.right());
+ int y2(r.bottom());
+
+ p.setPen(widget()->colorGroup().light());
+
+ p.drawLine(x1, y2 - openLookMargin+1, x1, y2);
+ p.drawLine(x1 + 1, y2 - openLookMargin+1, x2 - openLookMargin+1, y2 - openLookMargin+1);
+ p.drawLine(x2 - openLookMargin+1, y1 + 1, x2 - openLookMargin+1, y2 - openLookMargin);
+ p.drawLine(x2 - openLookMargin+1, y1, x2, y1);
+
+ p.fillRect(x1 + 1, y2 - openLookMargin + 2, r.width()-2, openLookMargin-2, handleColour);
+ p.fillRect(x2 - openLookMargin + 2, y1 + 1, openLookMargin-2, r.height()-2, handleColour);
+
+ p.setPen(widget()->colorGroup().dark());
+
+ p.drawLine(x1 + 1, y2, x2, y2);
+ p.drawLine(x2, y1 + 1, x2, y2 - 1);
+}
+
+ QRect
+OpenLook::buttonRect() const
+{
+ return QRect
+ (
+ openLookCornerSize + 3,
+ titleRect().top(),
+ titleRect().height(),
+ titleRect().height()
+ );
+}
+
+ void
+OpenLook::paintButton(QPainter & p) const
+{
+ QRect r(buttonRect());
+
+ p.fillRect
+ (
+ r.left() + 1,
+ r.top() + 1,
+ r.width() - 2,
+ r.height() - 2,
+ buttonDown_
+ ? widget()->colorGroup().dark()
+ : options()->color(KDecoration::ColorButtonBg, isActive())
+ );
+
+ p.setPen(buttonDown_ ? widget()->colorGroup().dark() : widget()->colorGroup().light());
+
+ p.drawLine(r.left() + 1, r.top(), r.right() - 1, r.top());
+ p.drawLine(r.left(), r.top() + 1, r.left(), r.bottom() - 1);
+
+ p.setPen(buttonDown_ ? widget()->colorGroup().light() : widget()->colorGroup().dark());
+
+ p.drawLine(r.right(), r.top() + 1, r.right(), r.bottom() - 1);
+ p.drawLine(r.left() + 1, r.bottom(), r.right() - 1, r.bottom());
+
+ paintArrow(p);
+}
+
+ void
+OpenLook::paintArrow(QPainter & p) const
+{
+ QRect br(buttonRect());
+
+ int x = br.left() + 5;
+ int y = br.top() + 5;
+ int w = br.width() - 10;
+ int h = br.height() - 10;
+
+ QPointArray poly(3);
+
+ p.setBrush(widget()->colorGroup().mid());
+
+ poly.setPoint(0, x, y);
+ poly.setPoint(1, x + w - 1, y);
+ poly.setPoint(2, x + (w / 2), y + h - 1);
+
+ p.drawPolygon(poly);
+
+ p.setPen(widget()->colorGroup().dark());
+
+ p.drawLine(x, y, x + w - 1, y);
+
+ p.drawLine(x, y, x + (w / 2), y + h - 1);
+
+ p.setPen(widget()->colorGroup().light());
+
+ p.drawLine(x + (w / 2), y + h - 1, x + w - 1, y);
+}
+
+ void
+OpenLook::paintBorder(QPainter & p) const
+{
+ const uint cs(openLookCornerSize);
+
+ uint x = widget()->rect().left();
+ uint y = widget()->rect().top();
+ uint w = widget()->rect().width();
+ uint h = widget()->rect().height();
+ uint r = widget()->rect().right();
+ uint b = widget()->rect().bottom();
+
+ p.fillRect(x + cs, y, w - cs - cs, 2, widget()->colorGroup().shadow());
+ p.fillRect(x + cs, b - 1, w - cs - cs, 2, widget()->colorGroup().shadow());
+ p.fillRect(x, y + cs, 2, h - cs - cs, widget()->colorGroup().shadow());
+ p.fillRect(r - 1, y + cs, 2, h - cs - cs, widget()->colorGroup().shadow());
+
+ QColor frameColour(options()->color(KDecoration::ColorFrame, isActive()));
+
+ p.fillRect(x + cs, y + 2, w - cs - cs, openLookMargin-2, frameColour);
+ p.fillRect(x + cs, b - openLookMargin + 1, w - cs - cs, openLookMargin-2, frameColour);
+ p.fillRect(x + 2, y + cs, openLookMargin-2, h - cs - cs, frameColour);
+ p.fillRect(r - openLookMargin + 1, y + cs, openLookMargin-2, h - cs - cs, frameColour);
+
+ p.fillRect
+ (
+ openLookMargin,
+ titleRect().bottom() + 1,
+ width() - 2 * openLookMargin,
+ 2,
+ widget()->colorGroup().background()
+ );
+}
+
+ QRect
+OpenLook::titleRect() const
+{
+ return titleSpacer_->geometry();
+}
+
+ bool
+OpenLook::isButtonPress(QMouseEvent * e)
+{
+ mousePressPoint_ = e->pos();
+
+ buttonDown_ = buttonRect().contains(mousePressPoint_);
+
+ widget()->repaint(buttonRect());
+ return buttonDown_;
+}
+
+ bool
+OpenLook::isButtonRelease(QMouseEvent * e)
+{
+ if (buttonDown_ && buttonRect().contains(e->pos()))
+ {
+ minimize();
+ return true;
+ }
+ buttonDown_ = false;
+ widget()->repaint(buttonRect());
+
+ return false;
+}
+
+}
+
+#include "OpenLook.moc"
+// vim:ts=2:sw=2:tw=78:set et:
diff --git a/kwin-styles/openlook/OpenLook.h b/kwin-styles/openlook/OpenLook.h
new file mode 100644
index 00000000..698dec4d
--- /dev/null
+++ b/kwin-styles/openlook/OpenLook.h
@@ -0,0 +1,115 @@
+/*
+ 'OpenLook' kwin client
+
+ Porting to kde3.2 API
+ Copyright 2003 Luciano Montanaro <mikelima@cirulla.net>
+
+ 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 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 IN THE SOFTWARE.
+*/
+
+#ifndef KWIN_WEB_H
+#define KWIN_WEB_H
+
+#include <qptrlist.h>
+#include <qbutton.h>
+
+#include <kdecoration.h>
+#include <kdecorationfactory.h>
+
+class QSpacerItem;
+
+namespace OpenLook
+{
+ class OpenLookButton;
+
+ class OpenLook : public KDecoration
+ {
+ Q_OBJECT
+ public:
+
+ OpenLook(KDecorationBridge *b, KDecorationFactory *f);
+ ~OpenLook();
+ void init();
+
+ protected:
+ bool eventFilter(QObject *o, QEvent *e);
+ void resizeEvent(QResizeEvent *e);
+ void paintEvent(QPaintEvent *e);
+ void showEvent(QShowEvent *e);
+
+ virtual void captionChange();
+ void desktopChange();
+ void activeChange();
+ void shadeChange();
+ void iconChange();
+ void maximizeChange();
+ void borders(int &left, int &right, int &top, int &bottom) const;
+ QSize minimumSize() const;
+ void resize( const QSize& );
+ virtual void mouseDoubleClickEvent(QMouseEvent *);
+ virtual void wheelEvent(QWheelEvent *e);
+
+ virtual Position mousePosition(const QPoint &) const;
+ virtual bool animateMinimize(bool);
+
+ private:
+
+ void doLayout();
+
+ QRect titleRect() const;
+
+ QRect topLeftRect() const;
+ QRect topRightRect() const;
+ QRect bottomLeftRect() const;
+ QRect bottomRightRect() const;
+
+ QRect buttonRect() const;
+
+ void paintBorder(QPainter &) const;
+
+ void paintTopLeftRect(QPainter &) const;
+ void paintTopRightRect(QPainter &) const;
+ void paintBottomLeftRect(QPainter &) const;
+ void paintBottomRightRect(QPainter &) const;
+
+ void paintButton(QPainter &) const;
+ void paintArrow(QPainter &) const;
+
+ bool isButtonPress(QMouseEvent *);
+ bool isButtonRelease(QMouseEvent *);
+
+ QSpacerItem * titleSpacer_;
+ QPoint mousePressPoint_;
+ bool tool_;
+ bool buttonDown_;
+ };
+
+ class DecorationFactory: public QObject, public KDecorationFactory
+ {
+ public:
+ DecorationFactory();
+ virtual ~DecorationFactory();
+ virtual KDecoration *createDecoration(KDecorationBridge *);
+ virtual bool reset(unsigned long changed);
+ virtual bool supports( Ability ability );
+ QValueList< DecorationFactory::BorderSize > borderSizes() const;
+ };
+}
+
+#endif
+// vim:ts=2:sw=2:tw=78:set et:
diff --git a/kwin-styles/openlook/openlook.desktop b/kwin-styles/openlook/openlook.desktop
new file mode 100644
index 00000000..575a583e
--- /dev/null
+++ b/kwin-styles/openlook/openlook.desktop
@@ -0,0 +1,14 @@
+[Desktop Entry]
+Name=OpenLook
+Name[af]=Openlook
+Name[cy]=GolwgAgored
+Name[fa]=نگاه‌باز
+Name[hi]=ओपन-लुक
+Name[lt]=Open išvaizda
+Name[lv]=AtvērtsSkats
+Name[ne]=ओपन लूक
+Name[ta]=திறந்தபார்வை
+Name[ven]=Vula wo sedza
+Name[vi]=Hình thức mở
+Name[zu]=Vula Ubone
+X-KDE-Library=kwin3_openlook
diff --git a/kwin-styles/riscos/AboveButton.cpp b/kwin-styles/riscos/AboveButton.cpp
new file mode 100644
index 00000000..738b7f79
--- /dev/null
+++ b/kwin-styles/riscos/AboveButton.cpp
@@ -0,0 +1,65 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2004
+ Carsten Clever <clushkou@gmx.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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "AboveButton.h"
+
+namespace RiscOS
+{
+
+/* XPM */
+static const char * const above_xpm[] = {
+"12 12 3 1",
+" c None",
+". c #000000",
+"+ c #FFFFFF",
+" ",
+" ..... ",
+".+++++. ",
+".+++++. ",
+".+++++..... ",
+".+++++.++++.",
+".+++++.++++.",
+" .....+++++.",
+" .+++++.",
+" .+++++.",
+" ..... ",
+" "};
+
+AboveButton::AboveButton(QWidget *parent)
+ : Button(parent, i18n("Keep above others"))
+{
+ setPixmap(QPixmap((const char **)above_xpm));
+}
+
+void AboveButton::mouseReleaseEvent(QMouseEvent *e)
+{
+ Button::mouseReleaseEvent(e);
+
+ if (!rect().contains(e->pos()))
+ return;
+
+ emit(above());
+}
+
+} // End namespace
+
+#include "AboveButton.moc"
diff --git a/kwin-styles/riscos/AboveButton.h b/kwin-styles/riscos/AboveButton.h
new file mode 100644
index 00000000..b7a910ec
--- /dev/null
+++ b/kwin-styles/riscos/AboveButton.h
@@ -0,0 +1,50 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2004
+ Carsten Clever <clushkou@gmx.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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RISC_OS_ABOVE_BUTTON_H
+#define RISC_OS_ABOVE_BUTTON_H
+
+#include "Button.h"
+
+namespace RiscOS
+{
+
+class AboveButton : public Button
+{
+ Q_OBJECT
+
+ public:
+
+ AboveButton(QWidget *parent);
+
+ signals:
+
+ void above();
+
+ protected:
+
+ void mouseReleaseEvent(QMouseEvent*);
+};
+
+} // End namespace
+
+#endif
diff --git a/kwin-styles/riscos/Button.cpp b/kwin-styles/riscos/Button.cpp
new file mode 100644
index 00000000..d4da6ecc
--- /dev/null
+++ b/kwin-styles/riscos/Button.cpp
@@ -0,0 +1,153 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <qtooltip.h>
+#include "Button.h"
+#include "Static.h"
+
+namespace RiscOS
+{
+
+Button::Button(QWidget *parent, const QString& tip,
+ const ButtonState realizeButtons)
+ : QWidget(parent, "Button", 0),
+ realizeButtons_(realizeButtons),
+ lastButton_(NoButton),
+ alignment_(Left),
+ down_ (false),
+ active_ (false)
+{
+ QToolTip::add(this, tip);
+ setBackgroundColor(Qt::black);
+
+ setFixedSize(Static::instance()->titleHeight() - 1,
+ Static::instance()->titleHeight());
+}
+
+Button::~Button()
+{
+ // Empty.
+}
+
+void Button::setAlignment(Alignment a)
+{
+ alignment_ = a;
+ repaint();
+}
+
+void Button::setActive(bool b)
+{
+ active_ = b;
+ repaint();
+}
+
+Button::Alignment Button::alignment() const
+{
+ return alignment_;
+}
+
+void Button::mousePressEvent(QMouseEvent *e)
+{
+ down_ = true;
+ lastButton_ = e->button();
+ repaint();
+
+ QMouseEvent me(e->type(), e->pos(), e->globalPos(),
+ (e->button()&realizeButtons_) ? LeftButton : NoButton,
+ e->state());
+ QWidget::mousePressEvent(&me);
+}
+
+void Button::mouseReleaseEvent(QMouseEvent *e)
+{
+ down_ = false;
+ lastButton_ = e->button();
+ repaint();
+ QMouseEvent me(e->type(), e->pos(), e->globalPos(),
+ (e->button()&realizeButtons_) ? LeftButton : NoButton,
+ e->state());
+ QWidget::mouseReleaseEvent(&me);
+}
+
+void Button::setPixmap(const QPixmap &p)
+{
+ if (QPixmap::defaultDepth() <= 8)
+ aPixmap_ = iPixmap_ = p;
+ else
+ {
+ QRgb light;
+ QRgb* data = NULL;
+ QRgb w = qRgb(255, 255, 255);
+
+ QImage aTx(p.convertToImage());
+ QImage iTx(aTx.copy());
+
+ const KDecorationOptions* options = KDecoration::options();
+ light = options->color(KDecoration::ColorButtonBg, true).light(150).rgb();
+
+ if (light == qRgb(0, 0, 0))
+ light = qRgb(228, 228, 228);
+
+ data = (QRgb *)aTx.bits();
+
+ for (int x = 0; x < 144; x++)
+ if (data[x] == w)
+ data[x] = light;
+
+ light = options->color(KDecoration::ColorButtonBg, false).light(150).rgb();
+
+ if (light == qRgb(0, 0, 0))
+ light = qRgb(228, 228, 228);
+
+ data = (QRgb *)iTx.bits();
+
+ for (int x = 0; x < 144; x++)
+ if (data[x] == w)
+ data[x] = light;
+
+ aPixmap_.convertFromImage(aTx);
+ iPixmap_.convertFromImage(iTx);
+
+ if (0 != p.mask())
+ {
+ aPixmap_.setMask(*p.mask());
+ iPixmap_.setMask(*p.mask());
+ }
+ }
+ repaint();
+}
+
+void Button::paintEvent(QPaintEvent *)
+{
+ bitBlt(this, alignment_ == Left ? 1 : 0, 0,
+ &Static::instance()->buttonBase(active_, down_));
+
+ int i = width() / 2 - 6;
+
+ bitBlt(this, alignment_ == Left ? i + 1 : i,
+ i + 1, active_ ? &aPixmap_ : &iPixmap_);
+}
+
+} // End namespace
+
+// vim:ts=2:sw=2:tw=78
+#include "Button.moc"
diff --git a/kwin-styles/riscos/Button.h b/kwin-styles/riscos/Button.h
new file mode 100644
index 00000000..1289a2fa
--- /dev/null
+++ b/kwin-styles/riscos/Button.h
@@ -0,0 +1,81 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RISC_OS_BUTTON_H
+#define RISC_OS_BUTTON_H
+
+#include <qpixmap.h>
+#include <qwidget.h>
+#include <klocale.h>
+#include <kdecoration.h>
+
+namespace RiscOS
+{
+
+class Button : public QWidget
+{
+ Q_OBJECT
+
+ public:
+
+ enum Type { Lower, Close, Iconify, Maximise, Sticky, Help };
+
+ enum Alignment { Left, Right };
+
+ Button(QWidget *parent, const QString &tip,
+ const ButtonState realizeButton = LeftButton);
+ virtual ~Button();
+
+ void setAlignment(Alignment);
+
+ Alignment alignment() const;
+
+ protected slots:
+
+ void setActive(bool);
+
+ protected:
+
+ void paintEvent(QPaintEvent *);
+
+ void mousePressEvent(QMouseEvent *);
+ void mouseReleaseEvent(QMouseEvent *);
+ void mouseMoveEvent(QMouseEvent *) { /* Empty. */ }
+
+ void setPixmap(const QPixmap &);
+
+ ButtonState realizeButtons_;
+ ButtonState lastButton_;
+
+ private:
+
+ Alignment alignment_;
+ bool down_;
+ bool active_;
+ QPixmap aPixmap_, iPixmap_;
+};
+
+} // End namespace
+
+#endif
+
+// vim:ts=2:sw=2:tw=78
diff --git a/kwin-styles/riscos/CloseButton.cpp b/kwin-styles/riscos/CloseButton.cpp
new file mode 100644
index 00000000..4f2066cf
--- /dev/null
+++ b/kwin-styles/riscos/CloseButton.cpp
@@ -0,0 +1,66 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "CloseButton.h"
+
+namespace RiscOS
+{
+
+/* XPM */
+static const char * const close_xpm[] = {
+"12 12 3 1",
+" c None",
+". c #000000",
+"+ c #FFFFFF",
+" . . ",
+" .+. .+. ",
+".+++. .+++.",
+" .+++..+++. ",
+" .++++++. ",
+" .++++. ",
+" .++++. ",
+" .++++++. ",
+" .+++..+++. ",
+".+++. .+++.",
+" .+. .+. ",
+" . . "};
+
+CloseButton::CloseButton(QWidget *parent)
+ : Button(parent, i18n("Close"))
+{
+ setPixmap(QPixmap((const char **)close_xpm));
+}
+
+void CloseButton::mouseReleaseEvent(QMouseEvent *e)
+{
+ Button::mouseReleaseEvent(e);
+
+ if (!rect().contains(e->pos()))
+ return;
+
+ emit(closeWindow());
+}
+
+} // End namespace;
+
+// vim:ts=2:sw=2:tw=78
+#include "CloseButton.moc"
diff --git a/kwin-styles/riscos/CloseButton.h b/kwin-styles/riscos/CloseButton.h
new file mode 100644
index 00000000..73791b76
--- /dev/null
+++ b/kwin-styles/riscos/CloseButton.h
@@ -0,0 +1,52 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RISC_OS_CLOSE_BUTTON_H
+#define RISC_OS_CLOSE_BUTTON_H
+
+#include "Button.h"
+
+namespace RiscOS
+{
+
+class CloseButton : public Button
+{
+ Q_OBJECT
+
+ public:
+
+ CloseButton(QWidget *parent);
+
+ signals:
+
+ void closeWindow();
+
+ protected:
+
+ void mouseReleaseEvent(QMouseEvent *);
+};
+
+} // End namespace;
+
+#endif
+
+// vim:ts=2:sw=2:tw=78
diff --git a/kwin-styles/riscos/HelpButton.cpp b/kwin-styles/riscos/HelpButton.cpp
new file mode 100644
index 00000000..a3d36668
--- /dev/null
+++ b/kwin-styles/riscos/HelpButton.cpp
@@ -0,0 +1,66 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "HelpButton.h"
+
+namespace RiscOS
+{
+
+/* XPM */
+static const char * const help_xpm[] = {
+"12 12 3 1",
+" c None",
+". c #FFFFFF",
+"+ c #000000",
+" . ++++ . ",
+" .+....+. ",
+" +......+ ",
+"..+......+..",
+" +......+ ",
+" +......+ ",
+" .+....+. ",
+" . ++ + . ",
+" + ++ ",
+" ++ + ",
+" + ++ ",
+" ++ "};
+
+HelpButton::HelpButton(QWidget *parent)
+ : Button(parent, i18n("Help"))
+{
+ setPixmap(QPixmap((const char **)help_xpm));
+}
+
+void HelpButton::mouseReleaseEvent(QMouseEvent *e)
+{
+ Button::mouseReleaseEvent(e);
+
+ if (!rect().contains(e->pos()))
+ return;
+
+ emit(help());
+}
+
+} // End namespace;
+
+// vim:ts=2:sw=2:tw=78
+#include "HelpButton.moc"
diff --git a/kwin-styles/riscos/HelpButton.h b/kwin-styles/riscos/HelpButton.h
new file mode 100644
index 00000000..89d76453
--- /dev/null
+++ b/kwin-styles/riscos/HelpButton.h
@@ -0,0 +1,52 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RISC_OS_HELP_BUTTON_H
+#define RISC_OS_HELP_BUTTON_H
+
+#include "Button.h"
+
+namespace RiscOS
+{
+
+class HelpButton : public Button
+{
+ Q_OBJECT
+
+ public:
+
+ HelpButton(QWidget *parent);
+
+ signals:
+
+ void help();
+
+ protected:
+
+ void mouseReleaseEvent(QMouseEvent *);
+};
+
+} // End namespace;
+
+#endif
+
+// vim:ts=2:sw=2:tw=78
diff --git a/kwin-styles/riscos/IconifyButton.cpp b/kwin-styles/riscos/IconifyButton.cpp
new file mode 100644
index 00000000..760194f5
--- /dev/null
+++ b/kwin-styles/riscos/IconifyButton.cpp
@@ -0,0 +1,66 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "IconifyButton.h"
+
+namespace RiscOS
+{
+
+/* XPM */
+static const char * const iconify_xpm[] = {
+"12 12 3 1",
+" c None",
+". c #000000",
+"+ c #FFFFFF",
+" ",
+" ",
+" ",
+" ",
+" .......... ",
+".++++++++++.",
+".++++++++++.",
+" .......... ",
+" ",
+" ",
+" ",
+" "};
+
+IconifyButton::IconifyButton(QWidget *parent)
+ : Button(parent, i18n("Minimize"))
+{
+ setPixmap(QPixmap((const char **)iconify_xpm));
+}
+
+void IconifyButton::mouseReleaseEvent(QMouseEvent *e)
+{
+ Button::mouseReleaseEvent(e);
+
+ if (!rect().contains(e->pos()))
+ return;
+
+ emit(iconify());
+}
+
+} // End namespace;
+
+// vim:ts=2:sw=2:tw=78
+#include "IconifyButton.moc"
diff --git a/kwin-styles/riscos/IconifyButton.h b/kwin-styles/riscos/IconifyButton.h
new file mode 100644
index 00000000..9c940713
--- /dev/null
+++ b/kwin-styles/riscos/IconifyButton.h
@@ -0,0 +1,52 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RISC_OS_ICONIFY_BUTTON_H
+#define RISC_OS_ICONIFY_BUTTON_H
+
+#include "Button.h"
+
+namespace RiscOS
+{
+
+class IconifyButton : public Button
+{
+ Q_OBJECT
+
+ public:
+
+ IconifyButton(QWidget *parent);
+
+ signals:
+
+ void iconify();
+
+ protected:
+
+ void mouseReleaseEvent(QMouseEvent *);
+};
+
+} // End namespace;
+
+#endif
+
+// vim:ts=2:sw=2:tw=78
diff --git a/kwin-styles/riscos/LowerButton.cpp b/kwin-styles/riscos/LowerButton.cpp
new file mode 100644
index 00000000..a14c6149
--- /dev/null
+++ b/kwin-styles/riscos/LowerButton.cpp
@@ -0,0 +1,66 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "LowerButton.h"
+
+namespace RiscOS
+{
+
+/* XPM */
+static const char * const lower_xpm[] = {
+"12 12 3 1",
+" c None",
+". c #000000",
+"+ c #FFFFFF",
+" ",
+" ..... ",
+".+++++. ",
+".+++++. ",
+".+++++..... ",
+".++++.+++++.",
+".++++.+++++.",
+" .....+++++.",
+" .+++++.",
+" .+++++.",
+" ..... ",
+" "};
+
+LowerButton::LowerButton(QWidget *parent)
+ : Button(parent, i18n("Keep below others"))
+{
+ setPixmap(QPixmap((const char **)lower_xpm));
+}
+
+void LowerButton::mouseReleaseEvent(QMouseEvent *e)
+{
+ Button::mouseReleaseEvent(e);
+
+ if (!rect().contains(e->pos()))
+ return;
+
+ emit(lower());
+}
+
+} // End namespace;
+
+// vim:ts=2:sw=2:tw=78
+#include "LowerButton.moc"
diff --git a/kwin-styles/riscos/LowerButton.h b/kwin-styles/riscos/LowerButton.h
new file mode 100644
index 00000000..ec5ab474
--- /dev/null
+++ b/kwin-styles/riscos/LowerButton.h
@@ -0,0 +1,52 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RISC_OS_LOWER_BUTTON_H
+#define RISC_OS_LOWER_BUTTON_H
+
+#include "Button.h"
+
+namespace RiscOS
+{
+
+class LowerButton : public Button
+{
+ Q_OBJECT
+
+ public:
+
+ LowerButton(QWidget *parent);
+
+ signals:
+
+ void lower();
+
+ protected:
+
+ void mouseReleaseEvent(QMouseEvent *);
+};
+
+} // End namespace;
+
+#endif
+
+// vim:ts=2:sw=2:tw=78
diff --git a/kwin-styles/riscos/Makefile.am b/kwin-styles/riscos/Makefile.am
new file mode 100644
index 00000000..2a7d9764
--- /dev/null
+++ b/kwin-styles/riscos/Makefile.am
@@ -0,0 +1,39 @@
+AUTOMAKE_OPTIONS = foreign
+
+KDE_CXXFLAGS = -DQT_PLUGIN
+
+INCLUDES = $(all_includes)
+
+kwindir = $(kde_datadir)/kwin/
+kwin_DATA = riscos.desktop
+
+noinst_HEADERS = AboveButton.h \
+ Button.h \
+ CloseButton.h \
+ HelpButton.h \
+ IconifyButton.h \
+ LowerButton.h \
+ Manager.h \
+ MaximiseButton.h \
+ Palette.h \
+ Static.h \
+ StickyButton.h
+
+kde_module_LTLIBRARIES = kwin3_riscos.la
+kwin3_riscos_la_SOURCES = AboveButton.cpp \
+ Button.cpp \
+ CloseButton.cpp \
+ HelpButton.cpp \
+ IconifyButton.cpp \
+ LowerButton.cpp \
+ Manager.cpp \
+ MaximiseButton.cpp \
+ Static.cpp \
+ StickyButton.cpp
+
+kwin3_riscos_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwin3_riscos_la_LIBADD = $(LIB_KDEUI) -lkdecorations
+kwin3_riscos_la_METASOURCES = AUTO
+
+EXTRA_DIST = $(kwin_DATA)
+
diff --git a/kwin-styles/riscos/Manager.cpp b/kwin-styles/riscos/Manager.cpp
new file mode 100644
index 00000000..a890ac63
--- /dev/null
+++ b/kwin-styles/riscos/Manager.cpp
@@ -0,0 +1,767 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <unistd.h> // for usleep
+#include <config.h> // for usleep on non-linux platforms
+#include <math.h> // for sin and cos
+
+#include <qapplication.h>
+#include <qimage.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qpainter.h>
+
+#include <netwm.h>
+
+#include "Manager.h"
+#include "Static.h"
+#include "AboveButton.h"
+#include "CloseButton.h"
+#include "HelpButton.h"
+#include "IconifyButton.h"
+#include "LowerButton.h"
+#include "MaximiseButton.h"
+#include "StickyButton.h"
+
+extern "C"
+{
+ KDE_EXPORT KDecorationFactory* create_factory()
+ {
+ return new RiscOS::Factory();
+ }
+}
+
+
+namespace RiscOS
+{
+
+Manager::Manager(KDecorationBridge *bridge,
+ KDecorationFactory *factory)
+ : KDecoration(bridge, factory),
+ topLayout_ (NULL),
+ titleLayout_ (NULL),
+ titleSpacer_ (NULL)
+{
+}
+
+Manager::~Manager()
+{
+}
+
+void Manager::init()
+{
+ createMainWidget(WNoAutoErase);
+
+ widget()->installEventFilter(this);
+ widget()->setBackgroundMode(NoBackground);
+
+ leftButtonList_.setAutoDelete(true);
+ rightButtonList_.setAutoDelete(true);
+
+ resetLayout();
+}
+
+bool Manager::eventFilter(QObject *o, QEvent *e)
+{
+ if (o != widget()) return false;
+ switch (e->type())
+ {
+ case QEvent::Resize:
+ resizeEvent(static_cast<QResizeEvent*>(e));
+ return true;
+ case QEvent::Paint:
+ paintEvent(static_cast<QPaintEvent*>(e));
+ return true;
+ case QEvent::MouseButtonDblClick:
+ mouseDoubleClickEvent(static_cast<QMouseEvent*>(e));
+ return true;
+ case QEvent::MouseButtonPress:
+ processMousePressEvent(static_cast<QMouseEvent*>(e));
+ return true;
+ case QEvent::Wheel:
+ wheelEvent( static_cast< QWheelEvent* >( e ));
+ return true;
+ case QEvent::MouseButtonRelease:
+ return false;
+ case QEvent::Show:
+ return false;
+ case QEvent::MouseMove:
+ return false;
+ case QEvent::Enter:
+ return false;
+ case QEvent::Leave:
+ return false;
+ case QEvent::Move:
+ return false;
+ default:
+ return false;
+ }
+}
+
+void Manager::reset(unsigned long /*changed*/)
+{
+ resetLayout();
+}
+
+void Manager::borders(int &left, int &right, int &top, int &bottom) const
+{
+ left = right = 1;
+ top = Static::instance()->titleHeight();
+ bottom = isResizable() ? Static::instance()->resizeHeight() : 1;
+}
+
+void Manager::resize(const QSize &s)
+{
+ widget()->resize(s);
+}
+
+QSize Manager::minimumSize() const
+{
+ return widget()->minimumSize();
+}
+
+void Manager::activeChange()
+{
+ updateTitleBuffer();
+ widget()->repaint();
+ emit(activeChanged(isActive()));
+}
+
+void Manager::captionChange()
+{
+ updateTitleBuffer();
+ widget()->repaint();
+}
+
+void Manager::iconChange()
+{
+}
+
+void Manager::maximizeChange()
+{
+ emit(maximizeChanged(maximizeMode() == MaximizeFull));
+}
+
+void Manager::desktopChange()
+{
+}
+
+void Manager::shadeChange()
+{
+}
+
+void Manager::paintEvent(QPaintEvent *e)
+{
+ QPainter p(widget());
+
+ QRect r(e->rect());
+
+ bool intersectsLeft = r.intersects(QRect(0, 0, 1, height()));
+
+ bool intersectsRight =
+ r.intersects(QRect(width() - 1, 0, width(), height()));
+
+ if (intersectsLeft || intersectsRight)
+ {
+ p.setPen(Qt::black);
+
+ if (intersectsLeft)
+ p.drawLine(0, r.top(), 0, r.bottom());
+
+ if (intersectsRight)
+ p.drawLine(width() - 1, r.top(), width() - 1, r.bottom());
+ }
+
+ Static * s = Static::instance();
+
+ bool active = isActive();
+
+ // Title bar.
+
+ QRect tr = titleSpacer_->geometry();
+ bitBlt(widget(), tr.topLeft(), &titleBuf_);
+
+ // Resize bar.
+
+ if (isResizable())
+ {
+ int rbt = height() - Static::instance()->resizeHeight(); // Resize bar top
+
+ bitBlt(widget(), 0, rbt, &(s->resize(active)));
+ bitBlt(widget(), 30, rbt, &(s->resizeMidLeft(active)));
+
+ p.drawTiledPixmap(32, rbt, width() - 34,
+ Static::instance()->resizeHeight(),
+ s->resizeMidMid(active));
+
+ bitBlt(widget(), width() - 32, rbt, &(s->resizeMidRight(active)));
+ bitBlt(widget(), width() - 30, rbt, &(s->resize(active)));
+ }
+ else
+ p.drawLine(1, height() - 1, width() - 2, height() - 1);
+}
+
+void Manager::resizeEvent(QResizeEvent*)
+{
+ updateButtonVisibility();
+ updateTitleBuffer();
+ widget()->repaint();
+}
+
+void Manager::updateButtonVisibility()
+{
+#if 0
+ enum SizeProblem = { None, Small, Medium, Big };
+ SizeProblem sizeProblem = None;
+
+ if (width() < 80) sizeProblem = Big;
+ else if (width() < 100) sizeProblem = Medium;
+ else if (width() < 180) sizeProblem = Small;
+
+ switch (sizeProblem) {
+
+ case Small:
+ above_ ->hide();
+ lower_ ->hide();
+ sticky_ ->hide();
+ help_ ->hide();
+ iconify_ ->show();
+ maximise_ ->hide();
+ close_ ->show();
+ break;
+
+ case Medium:
+ above_ ->hide();
+ lower_ ->hide();
+ sticky_ ->hide();
+ help_ ->hide();
+ iconify_ ->hide();
+ maximise_ ->hide();
+ close_ ->show();
+ break;
+
+ case Big:
+ above_ ->hide();
+ lower_ ->hide();
+ sticky_ ->hide();
+ help_ ->hide();
+ iconify_ ->hide();
+ maximise_ ->hide();
+ close_ ->hide();
+ break;
+
+ case None:
+ default:
+ above_ ->show();
+ lower_ ->show();
+ sticky_ ->show();
+ if (providesContextHelp())
+ help_->show();
+ iconify_ ->show();
+ maximise_ ->show();
+ close_ ->show();
+ break;
+ }
+
+ layout()->activate();
+#endif
+}
+
+void Manager::updateTitleBuffer()
+{
+ bool active = isActive();
+
+ Static * s = Static::instance();
+
+ QRect tr = titleSpacer_->geometry();
+
+ if (tr.width() == 0 || tr.height() == 0)
+ titleBuf_.resize(8, 8);
+ else
+ titleBuf_.resize(tr.size());
+
+ QPainter p(&titleBuf_);
+
+ p.drawPixmap(0, 0, s->titleTextLeft(active));
+
+ p.drawTiledPixmap(3, 0, tr.width() - 6, Static::instance()->titleHeight(),
+ s->titleTextMid(active));
+
+ p.setPen(options()->color(KDecorationOptions::ColorFont, active));
+
+ p.setFont(options()->font(active));
+
+ p.drawText(4, 2, tr.width() - 8, Static::instance()->titleHeight() - 4,
+ AlignCenter, caption());
+
+ p.drawPixmap(tr.width() - 3, 0, s->titleTextRight(active));
+}
+
+KDecoration::Position Manager::mousePosition(const QPoint& p) const
+{
+ Position m = PositionCenter;
+
+ // Look out for off-by-one errors here.
+
+ if (isResizable())
+ {
+ if (p.y() > (height() - (Static::instance()->resizeHeight() + 1)))
+ {
+ // Keep order !
+
+ if (p.x() >= (width() - 30))
+ m = PositionBottomRight;
+ else if (p.x() <= 30)
+ m = PositionBottomLeft;
+ else
+ m = PositionBottom;
+ }
+ else
+ {
+ m = PositionCenter;
+ // Client::mousePosition(p);
+ }
+ }
+ else
+ {
+ m = PositionCenter;
+ // Client::mousePosition(p);
+ }
+
+ return m;
+}
+
+void Manager::mouseDoubleClickEvent(QMouseEvent *e)
+{
+ if (e->button() == LeftButton && titleSpacer_->geometry().contains(e->pos()))
+ titlebarDblClickOperation();
+}
+
+void Manager::wheelEvent(QWheelEvent *e)
+{
+ if (isSetShade() || titleLayout_->geometry().contains(e->pos()) )
+ titlebarMouseWheelOperation( e->delta());
+}
+
+void Manager::paletteChange(const QPalette &)
+{
+ resetLayout();
+}
+
+void Manager::stickyChange(bool b)
+{
+ emit(stickyChanged(b));
+}
+
+void Manager::slotToggleSticky()
+{
+ toggleOnAllDesktops();
+ emit(stickyChanged(isOnAllDesktops()));
+}
+
+void Manager::slotAbove()
+{
+ setKeepAbove(!keepAbove());
+}
+
+void Manager::slotLower()
+{
+ setKeepBelow(!keepBelow());
+}
+
+void Manager::slotMaximizeClicked(ButtonState state)
+{
+#if KDE_IS_VERSION(3, 3, 0)
+ maximize(state);
+#else
+ switch (state)
+ {
+ case RightButton:
+ maximize(maximizeMode() ^ MaximizeHorizontal);
+ break;
+
+ case MidButton:
+ maximize(maximizeMode() ^ MaximizeVertical);
+ break;
+
+ case LeftButton:
+ default:
+ maximize(maximizeMode() == MaximizeFull ? MaximizeRestore
+ : MaximizeFull);
+ break;
+ }
+#endif
+ emit(maximizeChanged(maximizeMode() == MaximizeFull));
+}
+
+bool Manager::animateMinimize(bool iconify)
+{
+ int style = Static::instance()->animationStyle();
+
+ switch (style)
+ {
+ case 1:
+ {
+ // Double twisting double back, with pike ;)
+
+ if (!iconify) // No animation for restore.
+ return true;
+
+ // Go away quick.
+ helperShowHide(false);
+ qApp->syncX();
+
+ QRect r = iconGeometry();
+
+ if (!r.isValid())
+ return true;
+
+ // Algorithm taken from Window Maker (http://www.windowmaker.org)
+
+ int sx = geometry().x();
+ int sy = geometry().y();
+ int sw = width();
+ int sh = height();
+ int dx = r.x();
+ int dy = r.y();
+ int dw = r.width();
+ int dh = r.height();
+
+ double steps = 12;
+
+ double xstep = double((dx-sx)/steps);
+ double ystep = double((dy-sy)/steps);
+ double wstep = double((dw-sw)/steps);
+ double hstep = double((dh-sh)/steps);
+
+ double cx = sx;
+ double cy = sy;
+ double cw = sw;
+ double ch = sh;
+
+ double finalAngle = 3.14159265358979323846;
+
+ double delta = finalAngle / steps;
+
+ QPainter p(workspaceWidget());
+ p.setRasterOp(Qt::NotROP);
+
+ for (double angle = 0; ; angle += delta)
+ {
+ if (angle > finalAngle)
+ angle = finalAngle;
+
+ double dx = (cw / 10) - ((cw / 5) * sin(angle));
+ double dch = (ch / 2) * cos(angle);
+ double midy = cy + (ch / 2);
+
+ QPoint p1(int(cx + dx), int(midy - dch));
+ QPoint p2(int(cx + cw - dx), p1.y());
+ QPoint p3(int(cx + dw + dx), int(midy + dch));
+ QPoint p4(int(cx - dx), p3.y());
+
+ grabXServer();
+
+ p.drawLine(p1, p2);
+ p.drawLine(p2, p3);
+ p.drawLine(p3, p4);
+ p.drawLine(p4, p1);
+
+ p.flush();
+
+ usleep(500);
+
+ p.drawLine(p1, p2);
+ p.drawLine(p2, p3);
+ p.drawLine(p3, p4);
+ p.drawLine(p4, p1);
+
+ ungrabXServer();
+
+ cx += xstep;
+ cy += ystep;
+ cw += wstep;
+ ch += hstep;
+
+ if (angle >= finalAngle)
+ break;
+ }
+ }
+ break;
+
+ case 2:
+ {
+ // KVirc style ? Maybe. For qwertz.
+
+ if (!iconify) // No animation for restore.
+ return true;
+
+ // Go away quick.
+ helperShowHide(false);
+ qApp->syncX();
+
+ int stepCount = 12;
+
+ QRect r(geometry());
+
+ int dx = r.width() / (stepCount * 2);
+ int dy = r.height() / (stepCount * 2);
+
+ QPainter p(workspaceWidget());
+ p.setRasterOp(Qt::NotROP);
+
+ for (int step = 0; step < stepCount; step++)
+ {
+ r.moveBy(dx, dy);
+ r.setWidth(r.width() - 2 * dx);
+ r.setHeight(r.height() - 2 * dy);
+
+ grabXServer();
+
+ p.drawRect(r);
+ p.flush();
+ usleep(200);
+ p.drawRect(r);
+
+ ungrabXServer();
+ }
+ }
+ break;
+
+
+ default:
+ {
+ QRect icongeom = iconGeometry();
+
+ if (!icongeom.isValid())
+ return true;
+
+ QRect wingeom = geometry();
+
+ QPainter p(workspaceWidget());
+
+ p.setRasterOp(Qt::NotROP);
+#if 0
+ if (iconify)
+ p.setClipRegion(QRegion(workspaceWidget()->rect()) - wingeom);
+#endif
+ grabXServer();
+
+ p.drawLine(wingeom.bottomRight(), icongeom.bottomRight());
+ p.drawLine(wingeom.bottomLeft(), icongeom.bottomLeft());
+ p.drawLine(wingeom.topLeft(), icongeom.topLeft());
+ p.drawLine(wingeom.topRight(), icongeom.topRight());
+
+ p.flush();
+
+ qApp->syncX();
+
+ usleep(30000);
+
+ p.drawLine(wingeom.bottomRight(), icongeom.bottomRight());
+ p.drawLine(wingeom.bottomLeft(), icongeom.bottomLeft());
+ p.drawLine(wingeom.topLeft(), icongeom.topLeft());
+ p.drawLine(wingeom.topRight(), icongeom.topRight());
+
+ ungrabXServer();
+ }
+ break;
+ }
+ return true;
+}
+
+void Manager::createTitle()
+{
+ leftButtonList_.clear();
+ rightButtonList_.clear();
+
+ QString buttons;
+
+ if (options()->customButtonPositions())
+ buttons = options()->titleButtonsLeft() + "|" +
+ options()->titleButtonsRight();
+ else
+ buttons = "XSH|IA";
+
+ QPtrList<Button> *buttonList = &leftButtonList_;
+
+ for (unsigned int i = 0; i < buttons.length(); ++i)
+ {
+ Button * tb = NULL;
+
+ switch (buttons[i].latin1())
+ {
+ case 'S': // Sticky
+ tb = new StickyButton(widget());
+ connect(this, SIGNAL(stickyChanged(bool)),
+ tb, SLOT(setOn(bool)));
+ connect(tb, SIGNAL(toggleSticky()), this, SLOT(slotToggleSticky()));
+ emit(stickyChanged(isOnAllDesktops()));
+ break;
+
+ case 'H': // Help
+ if (providesContextHelp())
+ {
+ tb = new HelpButton(widget());
+ connect(tb, SIGNAL(help()), this, SLOT(showContextHelp()));
+ }
+ break;
+
+ case 'I': // Minimize
+ if (isMinimizable())
+ {
+ tb = new IconifyButton(widget());
+ connect(tb, SIGNAL(iconify()), this, SLOT(minimize()));
+ }
+ break;
+
+ case 'A': // Maximize
+ if (isMaximizable())
+ {
+ tb = new MaximiseButton(widget());
+ connect(tb, SIGNAL(maximizeClicked(ButtonState)),
+ this, SLOT(slotMaximizeClicked(ButtonState)));
+ connect(this, SIGNAL(maximizeChanged(bool)),
+ tb, SLOT(setOn(bool)));
+ emit(maximizeChanged(maximizeMode() == MaximizeFull));
+ }
+ break;
+
+ case 'F': // Above
+ tb = new AboveButton(widget());
+ connect(tb, SIGNAL(above()), this, SLOT(slotAbove()));
+ break;
+
+ case 'B': // Lower
+ tb = new LowerButton(widget());
+ connect(tb, SIGNAL(lower()), this, SLOT(slotLower()));
+ break;
+
+ case 'X': // Close
+ if (isCloseable())
+ {
+ tb = new CloseButton(widget());
+ connect(tb, SIGNAL(closeWindow()), this, SLOT(closeWindow()));
+ }
+ break;
+
+ case '|':
+ buttonList = &rightButtonList_;
+ break;
+ }
+
+ if (tb != NULL)
+ {
+ connect(this, SIGNAL(activeChanged(bool)), tb, SLOT(setActive(bool)));
+ buttonList->append(tb);
+ }
+ }
+
+ for (QPtrListIterator<Button> it(leftButtonList_); it.current(); ++it)
+ {
+ it.current()->setAlignment(Button::Left);
+ titleLayout_->addWidget(it.current());
+ }
+
+ titleSpacer_ = new QSpacerItem(0, Static::instance()->titleHeight(),
+ QSizePolicy::Expanding, QSizePolicy::Fixed);
+
+ titleLayout_->addItem(titleSpacer_);
+
+ for (QPtrListIterator<Button> it(rightButtonList_); it.current(); ++it)
+ {
+ it.current()->setAlignment(Button::Right);
+ titleLayout_->addWidget(it.current());
+ }
+}
+
+void Manager::resetLayout()
+{
+ delete topLayout_;
+ topLayout_ = new QVBoxLayout(widget(), 0, 0);
+ topLayout_->setResizeMode(QLayout::FreeResize);
+
+ titleLayout_ = new QBoxLayout(topLayout_, QBoxLayout::LeftToRight, 0, 0);
+ titleLayout_->setResizeMode(QLayout::FreeResize);
+
+ createTitle();
+
+ QBoxLayout *midLayout = new QBoxLayout(topLayout_, QBoxLayout::LeftToRight,
+ 0, 0);
+ midLayout->setResizeMode(QLayout::FreeResize);
+ midLayout->addSpacing(1);
+ if (isPreview())
+ midLayout->addWidget(
+ new QLabel(i18n("<center><b>RiscOS preview</b></center>"), widget()));
+ midLayout->addSpacing(1);
+
+ if (isResizable())
+ topLayout_->addSpacing(Static::instance()->resizeHeight());
+ else
+ topLayout_->addSpacing(1);
+}
+
+// --------------------
+
+Factory::Factory()
+{
+ (void) RiscOS::Static::instance();
+}
+
+Factory::~Factory()
+{
+ delete RiscOS::Static::instance();
+}
+
+bool Factory::reset(unsigned long /*changed*/)
+{
+ RiscOS::Static::instance()->reset();
+ return true;
+}
+
+bool Factory::supports( Ability ability )
+{
+ switch( ability )
+ {
+ case AbilityAnnounceButtons:
+ case AbilityButtonOnAllDesktops:
+ case AbilityButtonHelp:
+ case AbilityButtonMinimize:
+ case AbilityButtonMaximize:
+ case AbilityButtonClose:
+ case AbilityButtonAboveOthers:
+ case AbilityButtonBelowOthers:
+ return true;
+ default:
+ return false;
+ };
+}
+
+KDecoration* Factory::createDecoration(KDecorationBridge *bridge)
+{
+ return new Manager(bridge, this);
+}
+
+} // End namespace
+
+// vim:ts=2:sw=2:tw=78
+#include "Manager.moc"
diff --git a/kwin-styles/riscos/Manager.h b/kwin-styles/riscos/Manager.h
new file mode 100644
index 00000000..1d30b7a6
--- /dev/null
+++ b/kwin-styles/riscos/Manager.h
@@ -0,0 +1,123 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RISC_OS_MANAGER_H
+#define RISC_OS_MANAGER_H
+
+#include <qdict.h>
+#include <kdecoration.h>
+#include <kdecorationfactory.h>
+
+class QSpacerItem;
+class QVBoxLayout;
+class QBoxLayout;
+
+namespace RiscOS
+{
+
+class LowerButton;
+class CloseButton;
+class IconifyButton;
+class MaximiseButton;
+class StickyButton;
+class HelpButton;
+class Button;
+
+class Manager : public KDecoration
+{
+ Q_OBJECT
+
+ public:
+
+ Manager(KDecorationBridge*, KDecorationFactory*);
+ ~Manager();
+ void init();
+ bool eventFilter(QObject*, QEvent*);
+ void reset(unsigned long changed);
+ void borders(int&, int&, int&, int&) const;
+ void resize(const QSize&);
+ QSize minimumSize() const;
+ void activeChange();
+ void captionChange();
+ void iconChange();
+ void maximizeChange();
+ void desktopChange();
+ void shadeChange();
+
+ signals:
+
+ void maximizeChanged(bool);
+ void stickyChanged(bool);
+ void activeChanged(bool);
+
+ public slots:
+
+ void slotAbove();
+ void slotLower();
+ void slotMaximizeClicked(ButtonState);
+ void slotToggleSticky();
+
+ protected:
+
+ KDecoration::Position mousePosition(const QPoint &) const;
+ void paletteChange(const QPalette &);
+ void activeChange(bool);
+ void stickyChange(bool);
+ void paintEvent(QPaintEvent *);
+ void resizeEvent(QResizeEvent *);
+ void mouseDoubleClickEvent(QMouseEvent *);
+ void wheelEvent(QWheelEvent *e);
+ bool animateMinimize(bool);
+ void updateButtonVisibility();
+ void updateTitleBuffer();
+
+ void createTitle();
+ void resetLayout();
+
+ private:
+
+ QVBoxLayout *topLayout_;
+ QBoxLayout *titleLayout_;
+ QSpacerItem *titleSpacer_;
+
+ QPixmap titleBuf_;
+ QPtrList<Button> leftButtonList_;
+ QPtrList<Button> rightButtonList_;
+};
+
+class Factory : public QObject, public KDecorationFactory
+{
+ Q_OBJECT
+
+ public:
+ Factory();
+ ~Factory();
+ virtual bool reset(unsigned long changed);
+ virtual KDecoration* createDecoration(KDecorationBridge*);
+ virtual bool supports( Ability ability );
+};
+
+} // End namespace
+
+#endif
+
+// vim:ts=2:sw=2:tw=78
diff --git a/kwin-styles/riscos/MaximiseButton.cpp b/kwin-styles/riscos/MaximiseButton.cpp
new file mode 100644
index 00000000..b82f2867
--- /dev/null
+++ b/kwin-styles/riscos/MaximiseButton.cpp
@@ -0,0 +1,98 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "MaximiseButton.h"
+
+#include <qtooltip.h>
+
+namespace RiscOS
+{
+
+/* XPM */
+static const char * const maximise_xpm[] = {
+"12 12 3 1",
+" c None",
+". c #000000",
+"+ c #FFFFFF",
+" ",
+" ........ ",
+" .++++++++. ",
+" .++++++++. ",
+" .++++++++. ",
+" .++++++++. ",
+" .++++++++. ",
+" .++++++++. ",
+" .++++++++. ",
+" .++++++++. ",
+" ........ ",
+" "};
+
+/* XPM */
+static const char * const unmaximise_xpm[] = {
+"12 12 3 1",
+" c None",
+". c #000000",
+"+ c #FFFFFF",
+" ",
+" ",
+" ...... ",
+" .++++++. ",
+" .++++++. ",
+" .++++++. ",
+" .++++++. ",
+" .++++++. ",
+" .++++++. ",
+" ...... ",
+" ",
+" "};
+
+MaximiseButton::MaximiseButton(QWidget * parent)
+ : Button(parent, i18n("Maximize"),
+ (ButtonState)(LeftButton|MidButton|RightButton)),
+ on_(false)
+{
+ setPixmap(QPixmap((const char **)maximise_xpm));
+}
+
+void MaximiseButton::setOn(bool on)
+{
+ on_ = on;
+ setPixmap(on_ ? QPixmap((const char **)unmaximise_xpm)
+ : QPixmap((const char **)maximise_xpm));
+ repaint();
+ QToolTip::remove(this);
+ QToolTip::add(this, on_ ? i18n("Restore") : i18n("Maximize"));
+}
+
+void MaximiseButton::mouseReleaseEvent(QMouseEvent *e)
+{
+ Button::mouseReleaseEvent(e);
+
+ if (!rect().contains(e->pos()))
+ return;
+ emit(maximizeClicked(lastButton_));
+}
+
+} // End namespace
+
+// vim:ts=2:sw=2:tw=78
+#include "MaximiseButton.moc"
diff --git a/kwin-styles/riscos/MaximiseButton.h b/kwin-styles/riscos/MaximiseButton.h
new file mode 100644
index 00000000..7da4bc0a
--- /dev/null
+++ b/kwin-styles/riscos/MaximiseButton.h
@@ -0,0 +1,60 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RISC_OS_MAXIMISE_BUTTON_H
+#define RISC_OS_MAXIMISE_BUTTON_H
+
+#include "Button.h"
+
+namespace RiscOS
+{
+
+class MaximiseButton : public Button
+{
+ Q_OBJECT
+
+ public:
+
+ MaximiseButton(QWidget *parent);
+
+ public slots:
+
+ void setOn(bool);
+
+ signals:
+
+ void maximizeClicked(ButtonState);
+
+ protected:
+
+ void mouseReleaseEvent(QMouseEvent *);
+
+ private:
+
+ bool on_;
+};
+
+} // End namespace
+
+#endif
+
+// vim:ts=2:sw=2:tw=78
diff --git a/kwin-styles/riscos/Palette.h b/kwin-styles/riscos/Palette.h
new file mode 100644
index 00000000..e13457a6
--- /dev/null
+++ b/kwin-styles/riscos/Palette.h
@@ -0,0 +1,69 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RISC_OS_PALETTE_H
+#define RISC_OS_PALETTE_H
+
+#include <qmemarray.h>
+#include <qglobal.h>
+
+namespace RiscOS
+{
+
+class Palette
+{
+ public:
+
+ Palette()
+ {
+ data_.resize(8);
+
+ data_[0] = 0xFFFFFFFF;
+ data_[1] = 0xFFDCDCDC;
+ data_[2] = 0xFFC3C3C3;
+ data_[3] = 0xFFA0A0A0;
+ data_[4] = 0xFF808080;
+ data_[5] = 0xFF585858;
+ data_[6] = 0xFF303030;
+ data_[7] = 0xFF000000;
+ }
+
+ QRgb& operator [] (int idx)
+ {
+ return data_[idx];
+ }
+
+ QRgb operator [] (int idx) const
+ {
+ return data_[idx];
+ }
+
+ private:
+
+ QMemArray<QRgb> data_;
+};
+
+} // End namespace
+
+#endif
+
+// vim:ts=2:sw=2:tw=78
diff --git a/kwin-styles/riscos/README b/kwin-styles/riscos/README
new file mode 100644
index 00000000..04ebd85d
--- /dev/null
+++ b/kwin-styles/riscos/README
@@ -0,0 +1,90 @@
+This theme emulates the look and feel of the RISC OS 'window manager'.
+Actually, RISC OS doesn't have a window manager in the same way X
+does, but if you imagine it does, this is an emulation of that ;)
+
+The look is obviously quite different, but coming anywhere close to
+the unique look of RISC OS would be quite blatantly obvious, so to
+avoid copyright issues, the look of this theme is unique. You may
+consider it to be RISC OS grown up ;)
+
+Functions that will be implemented but are currently missing:
+ Transparent resize.
+ Shading.
+ Backward-resize.
+ NOTE: Backward-resize is an interesting feature and quite useful.
+ If you resize a window such that you hit the screen edge
+ in the process, the window resizes 'backwards' (i.e.
+ moves in the opposite direction to your drag and at the
+ same time continues increasing in size). So instead
+ of having to let go of the resize handle, move the window
+ and resize again, it just does what you want it to do.
+
+Button functions: (Missing functionality is marked with TODO)
+
+Button One:
+
+ Left button: TODO
+ Lower window and drop focus. This is currently unimplemented
+ in kwin itself.
+
+Button Two:
+
+ Left button: Close window.
+
+ Right button: TODO, if I can be bothered.
+ Close window.
+ If window is filer window, open another filer window
+ in parent dir.
+ If window is document window, open a filer window in
+ dir containing document.
+ If you hold Shift, the window doesn't close.
+ NOTE:
+ This requires app support.
+ If I were to implement this, I would do it in konqy
+ and probably not bother for other apps.
+
+Titlebar:
+
+ Left button: Raise, focus and move window
+
+ Middle button: Move window
+
+ Right button: Menu
+ Note: Buttons are this way around for compatibility with
+ other kwin themes.
+
+Button Three:
+
+ Left button: Iconify window.
+
+Button Four:
+
+ Left button: Maximise or restore window plus raise and focus.
+
+ Middle button: Maximise vertically or restore window plus raise and focus.
+
+ Right button: Maximise or restore window.
+
+Resize bar left/right:
+
+ Left button: Move that corner (resizes window) and raise
+
+ Other buttons: Same without raising
+
+Resize bar centre:
+
+ Left button: Move that edge (resizes window) and raise
+
+ Other buttons: Same without raising
+
+The lower bar is used for resizing. It works in the NeXT style.
+This doesn't exist on RISC OS. In RISC OS, there is a 'resize handle'
+in the lower right corner of the window (actually inside the window).
+
+To emulate this would mean covering part of the window with the decorations,
+which is not acceptable. RISC OS gets away with it by making sure that
+there is a vertical scrollbar visible at all times, which is just stupid.
+It's also an impossibility with X11, as the window manager does not know
+anything about scrollbars - they belong to the application, so don't ask
+me to implement it.
+
diff --git a/kwin-styles/riscos/Static.cpp b/kwin-styles/riscos/Static.cpp
new file mode 100644
index 00000000..675cdfc1
--- /dev/null
+++ b/kwin-styles/riscos/Static.cpp
@@ -0,0 +1,540 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+// for enable-final
+#ifdef Bool
+#undef Bool
+#endif
+
+#include <qimage.h>
+#include <qpixmap.h>
+#include <qpainter.h>
+#include <qptrlist.h>
+
+#include <kdecoration.h>
+
+// #include <ksimpleconfig.h>
+
+#include "Static.h"
+
+namespace RiscOS
+{
+
+/* XPM */
+static const char * const texture_xpm[] = {
+"64 12 3 1",
+" c None",
+"a c #000000",
+"b c #FFFFFF",
+" b b b b b b b a b ",
+" b aa b aaa aaa b a b aab bb a ",
+" b b a b b b b aa b b aa ",
+" b b b a a b b b b aa ab ab ",
+" b b b b b b b ba ",
+" aaa aaa aa b b b b b b ",
+" b b bb a b aa b a a aaa a b ",
+" b b b b b a b b b b b",
+" b b b b a a b b aa b baa ",
+" a b a bb aa bb aa aaa b aa a ",
+" a a aab b b aa aab a b ",
+" b a b b aaa a b bb b b b b"};
+
+Static* Static::instance_ = NULL;
+
+Static::Static()
+{
+ instance_ = this;
+ _init();
+}
+
+Static::~Static()
+{
+ instance_ = NULL;
+}
+
+const QPixmap& Static::titleTextLeft(bool active) const
+{
+ return active ? aTitleTextLeft_ : iTitleTextLeft_;
+}
+
+const QPixmap& Static::titleTextRight(bool active) const
+{
+ return active ? aTitleTextRight_ : iTitleTextRight_;
+}
+
+const QPixmap& Static::resizeMidLeft(bool active) const
+{
+ return active ? aResizeMidLeft_ : iResizeMidLeft_;
+}
+
+const QPixmap& Static::resizeMidRight(bool active) const
+{
+ return active ? aResizeMidRight_ : iResizeMidRight_;
+}
+
+const QPixmap& Static::titleTextMid(bool active) const
+{
+ return active ? aTitleTextMid_ : iTitleTextMid_;
+}
+
+const QPixmap& Static::resizeMidMid(bool active) const
+{
+ return active ? aResizeMid_ : iResizeMid_;
+}
+
+const QPixmap& Static::resize(bool active) const
+{
+ return active ? aResize_ : iResize_;
+}
+
+int Static::animationStyle() const
+{
+ return animationStyle_;
+}
+
+int Static::titleHeight() const
+{
+ return titleHeight_;
+}
+
+int Static::resizeHeight() const
+{
+ return resizeHeight_;
+}
+
+void Static::_drawBorder(QPixmap &pix, int w, int h)
+{
+ // 0111111113
+ // 1122222235
+ // 12 46
+ // 12 46
+ // 12 46
+ // 1344444476
+ // 3566666667
+
+ painter_.begin(&pix);
+ painter_.translate(transx, transy);
+
+ QColor c0 = down_ ? palette_[7] : palette_[0];
+ QColor c1 = down_ ? palette_[6] : palette_[1];
+ QColor c2 = down_ ? palette_[5] : palette_[2];
+ QColor c3 = down_ ? palette_[4] : palette_[3];
+ QColor c4 = down_ ? palette_[3] : palette_[4];
+ QColor c5 = down_ ? palette_[2] : palette_[5];
+ QColor c6 = down_ ? palette_[2] : palette_[6];
+ QColor c7 = down_ ? palette_[1] : palette_[7];
+
+ painter_.setPen(c0);
+ painter_.drawPoint(0, 0);
+
+ painter_.setPen(c1);
+ painter_.drawPoint(1, 1);
+ painter_.drawLine(1, 0, w - 1, 0);
+ painter_.drawLine(0, 1, 0, h - 1);
+
+ painter_.setPen(c2);
+ painter_.drawLine(2, 1, w - 2, 1);
+ painter_.drawLine(1, 2, 1, h - 2);
+
+ painter_.setPen(c3);
+ painter_.drawPoint(0, h);
+ painter_.drawPoint(1, h - 1);
+ painter_.drawPoint(w, 0);
+ painter_.drawPoint(w - 1, 1);
+ painter_.fillRect(2, 2, w - 2, h - 2, c3);
+
+ painter_.setPen(c4);
+ painter_.drawLine(2, h - 1, w - 2, h - 1);
+ painter_.drawLine(w - 1, 2, w - 1, h - 2);
+
+ painter_.setPen(c5);
+ painter_.drawPoint(w, 1);
+ painter_.drawPoint(1, h);
+
+ painter_.setPen(c6);
+ painter_.drawLine(w, 2, w, h - 1);
+ painter_.drawLine(2, h, w - 1, h);
+
+ painter_.setPen(c7);
+ painter_.drawPoint(w - 1, h - 1);
+ painter_.drawPoint(w, h);
+
+ painter_.end();
+
+ painter_.resetXForm();
+}
+
+void setPalette(Palette &pal, QColor c)
+{
+ pal[3] = c.rgb();
+
+ int h, s, v;
+ c.hsv(&h, &s, &v);
+
+ if (v < 72)
+ c.setHsv(h, s, 72);
+
+ pal[0] = c.light(200).rgb();
+ pal[1] = c.light(166).rgb();
+ pal[2] = c.light(125).rgb();
+ pal[4] = c.dark(133).rgb();
+ pal[5] = c.dark(166).rgb();
+ pal[6] = c.dark(200).rgb();
+ pal[7] = c.dark(300).rgb();
+}
+
+void Static::_init()
+{
+ hicolour_ = QPixmap::defaultDepth() > 8;
+ animationStyle_ = 0;
+ updatePixmaps();
+}
+
+void Static::reset()
+{
+ updatePixmaps();
+// Workspace::self()->slotResetAllClientsDelayed();
+}
+
+void Static::updatePixmaps()
+{
+ _initSizes();
+
+ _resizeAllPixmaps();
+
+ _blankAllPixmaps();
+
+ if (hicolour_)
+ {
+ _initPalettes();
+ _initTextures();
+ }
+
+ _drawTitleTextAreaSides();
+
+ _drawResizeCentralAreaSides();
+
+ _drawTitleTextAreaBackground();
+
+ _drawResizeCentralAreaBackground();
+
+ _drawResizeHandles();
+
+ _drawButtonBackgrounds();
+}
+
+void Static::_createTexture(QPixmap &px, int t, bool active)
+{
+ const QImage texture(QPixmap((const char **)texture_xpm).convertToImage());
+ const QRgb w(qRgb(255, 255, 255));
+ const QRgb b(qRgb(0, 0, 0));
+
+ QColor c(KDecoration::options()->color(KDecoration::ColorType(t), active));
+
+ QRgb mid (c.rgb());
+ QRgb light (c.light(110).rgb());
+ QRgb dark (c.dark(110).rgb());
+
+ QRgb* data(reinterpret_cast<QRgb *>(texture.bits()));
+
+ for (int x = 0; x < 64*12; x++)
+ if (data[x] == w)
+ data[x] = light;
+ else if (data[x] == b)
+ data[x] = dark;
+ else
+ data[x] = mid;
+
+ px.convertFromImage(texture);
+}
+
+const QPixmap& Static::buttonBase(bool active, bool down) const
+{
+ if (active)
+ return down ? aButtonDown_ : aButtonUp_;
+ else
+ return down ? iButtonDown_ : iButtonUp_;
+}
+
+void Static::_initSizes()
+{
+ QFont f(KDecoration::options()->font(true)); // XXX false doesn't work right at the moment
+
+ QFontMetrics fm(f);
+
+ int h = fm.height();
+
+ titleHeight_ = h + 6;
+
+ if (titleHeight_ < 20)
+ titleHeight_ = 20;
+
+ buttonSize_ = titleHeight_ - 1;
+
+ resizeHeight_ = 10;
+}
+
+void Static::_resizeAllPixmaps()
+{
+ aResize_ .resize(30, resizeHeight_);
+ iResize_ .resize(30, resizeHeight_);
+ aTitleTextLeft_ .resize( 3, titleHeight_);
+ aTitleTextRight_.resize( 3, titleHeight_);
+ iTitleTextLeft_ .resize( 3, titleHeight_);
+ iTitleTextRight_.resize( 3, titleHeight_);
+ aTitleTextMid_ .resize(64, titleHeight_);
+ iTitleTextMid_ .resize(64, titleHeight_);
+ aResizeMidLeft_ .resize( 3, resizeHeight_);
+ aResizeMidRight_.resize( 3, resizeHeight_);
+ iResizeMidLeft_ .resize( 3, resizeHeight_);
+ iResizeMidRight_.resize( 3, resizeHeight_);
+ aResizeMid_ .resize(64, resizeHeight_);
+ iResizeMid_ .resize(64, resizeHeight_);
+
+ aButtonUp_ .resize(buttonSize_, buttonSize_);
+ iButtonUp_ .resize(buttonSize_, buttonSize_);
+ aButtonDown_ .resize(buttonSize_, buttonSize_);
+ iButtonDown_ .resize(buttonSize_, buttonSize_);
+}
+
+void Static::_blankAllPixmaps()
+{
+ aResize_ .fill(Qt::black);
+ iResize_ .fill(Qt::black);
+ aTitleTextLeft_ .fill(Qt::black);
+ aTitleTextRight_.fill(Qt::black);
+ iTitleTextLeft_ .fill(Qt::black);
+ iTitleTextRight_.fill(Qt::black);
+ aTitleTextMid_ .fill(Qt::black);
+ iTitleTextMid_ .fill(Qt::black);
+ aResizeMidLeft_ .fill(Qt::black);
+ aResizeMidRight_.fill(Qt::black);
+ iResizeMidLeft_ .fill(Qt::black);
+ iResizeMidRight_.fill(Qt::black);
+ aResizeMid_ .fill(Qt::black);
+ iResizeMid_ .fill(Qt::black);
+ aButtonUp_ .fill(Qt::black);
+ iButtonUp_ .fill(Qt::black);
+ aButtonDown_ .fill(Qt::black);
+ iButtonDown_ .fill(Qt::black);
+}
+
+void Static::_initPalettes()
+{
+ const KDecorationOptions* options = KDecoration::options();
+ setPalette(aButPal_, options->color(KDecoration::ColorButtonBg, true));
+ setPalette(iButPal_, options->color(KDecoration::ColorButtonBg, false));
+
+ setPalette(aTitlePal_, options->color(KDecoration::ColorTitleBar, true));
+ setPalette(iTitlePal_, options->color(KDecoration::ColorTitleBar, false));
+
+ setPalette(aResizePal_, options->color(KDecoration::ColorTitleBar, true));
+ setPalette(iResizePal_, options->color(KDecoration::ColorTitleBar, false));
+}
+
+void Static::_initTextures()
+{
+ _createTexture(aTexture_, KDecoration::ColorTitleBar, true);
+ _createTexture(iTexture_, KDecoration::ColorTitleBar, false);
+ _createTexture(abTexture_, KDecoration::ColorButtonBg, true);
+ _createTexture(ibTexture_, KDecoration::ColorButtonBg, false);
+}
+
+void Static::_drawTitleTextAreaSides()
+{
+ QPixmap temp(4, titleHeight_);
+ temp.fill(Qt::black);
+
+ transx = transy = 0.0;
+
+ palette_ = aTitlePal_;
+ down_ = false;
+
+ _drawBorder(temp, 4, titleHeight_ - 2);
+
+ painter_.begin(&aTitleTextLeft_);
+ painter_.drawPixmap(1, 1, temp, 0, 1);
+ painter_.end();
+
+ painter_.begin(&aTitleTextRight_);
+ painter_.drawPixmap(0, 1, temp, 2, 1);
+ painter_.end();
+
+ palette_ = iTitlePal_;
+ _drawBorder(temp, 4, titleHeight_ - 2);
+
+ painter_.begin(&iTitleTextLeft_);
+ painter_.drawPixmap(1, 1, temp, 0, 1);
+ painter_.end();
+
+ painter_.begin(&iTitleTextRight_);
+ painter_.drawPixmap(0, 1, temp, 2, 1);
+ painter_.end();
+}
+
+void Static::_drawResizeCentralAreaSides()
+{
+ QPixmap temp(4, resizeHeight_);
+ temp.fill(Qt::black);
+
+ transy = 1.0;
+
+ palette_ = aResizePal_;
+
+ _drawBorder(temp, 4, resizeHeight_ - 3);
+
+ painter_.begin(&aResizeMidLeft_);
+ painter_.drawPixmap(0, 1, temp, 0, 1);
+ painter_.end();
+
+ painter_.begin(&aResizeMidRight_);
+ painter_.drawPixmap(0, 1, temp, 2, 1);
+ painter_.end();
+
+ palette_ = iResizePal_;
+ _drawBorder(temp, 4, resizeHeight_ - 3);
+
+ painter_.begin(&iResizeMidLeft_);
+ painter_.drawPixmap(0, 1, temp, 0, 1);
+ painter_.end();
+
+ painter_.begin(&iResizeMidRight_);
+ painter_.drawPixmap(0, 1, temp, 2, 1);
+ painter_.end();
+}
+
+void Static::_drawTitleTextAreaBackground()
+{
+ QPixmap temp(70, titleHeight_);
+ temp.fill(Qt::black);
+
+ transx = transy = 0.0;
+
+ palette_ = aTitlePal_;
+ _drawBorder(temp, 70, titleHeight_ - 3);
+
+ painter_.begin(&aTitleTextMid_);
+ painter_.drawPixmap(0, 1, temp, 2, 0);
+ if (hicolour_)
+ painter_.drawTiledPixmap(0, 4, 64, titleHeight_ - 8, aTexture_);
+ painter_.end();
+
+ palette_ = iTitlePal_;
+ _drawBorder(temp, 70, titleHeight_ - 3);
+
+ painter_.begin(&iTitleTextMid_);
+ painter_.drawPixmap(0, 1, temp, 2, 0);
+ if (hicolour_)
+ painter_.drawTiledPixmap(0, 4, 64, titleHeight_ - 8, iTexture_);
+ painter_.end();
+}
+
+void Static::_drawResizeCentralAreaBackground()
+{
+ QPixmap temp(70, titleHeight_);
+ temp.fill(Qt::black);
+
+ transy = 1.0;
+
+ palette_ = aResizePal_;
+ _drawBorder(temp, 70, resizeHeight_ - 3);
+
+ painter_.begin(&aResizeMid_);
+ painter_.drawPixmap(0, 0, temp, 2, 0);
+ if (hicolour_)
+ painter_.drawTiledPixmap(0, 4, 64, resizeHeight_ - 8, aTexture_);
+ painter_.end();
+
+ palette_ = iResizePal_;
+ _drawBorder(temp, 70, 7);
+
+ painter_.begin(&iResizeMid_);
+ painter_.drawPixmap(0, 0, temp, 2, 0);
+ if (hicolour_)
+ painter_.drawTiledPixmap(0, 4, 64, resizeHeight_ - 8, iTexture_);
+ painter_.end();
+}
+
+void Static::_drawResizeHandles()
+{
+ transx = transy = 1.0;
+
+ down_ = false;
+
+ palette_ = aResizePal_;
+ _drawBorder(aResize_, 28, resizeHeight_ - 3);
+
+ if (hicolour_)
+ {
+ painter_.begin(&aResize_);
+ painter_.drawTiledPixmap(4, 4, 20, resizeHeight_ - 8, aTexture_);
+ painter_.end();
+ }
+
+ palette_ = iResizePal_;
+ _drawBorder(iResize_, 28, resizeHeight_ - 3);
+
+ if (hicolour_)
+ {
+ painter_.begin(&iResize_);
+ painter_.drawTiledPixmap(4, 4, 20, resizeHeight_ - 8, iTexture_);
+ painter_.end();
+ }
+}
+
+void Static::_drawButtonBackgrounds()
+{
+ buttonSize_ -= 2;
+
+ down_ = false;
+ transx = 0.0;
+ transy = 1.0;
+ palette_ = aButPal_;
+ _drawBorder(aButtonUp_, buttonSize_, buttonSize_);
+ down_ = true;
+ _drawBorder(aButtonDown_, buttonSize_, buttonSize_);
+
+ palette_ = iButPal_;
+ _drawBorder(iButtonDown_, buttonSize_, buttonSize_);
+ down_ = false;
+ _drawBorder(iButtonUp_, buttonSize_, buttonSize_);
+
+ painter_.begin(&aButtonUp_);
+
+ if (hicolour_)
+ painter_.drawTiledPixmap(2, 4, buttonSize_ - 4, buttonSize_ - 5,
+ abTexture_);
+
+ painter_.end();
+
+ painter_.begin(&iButtonUp_);
+ if (hicolour_)
+ painter_.drawTiledPixmap(2, 4, buttonSize_ - 4, buttonSize_ - 5,
+ ibTexture_);
+
+ painter_.end();
+}
+
+} // End namespace
+
+// vim:ts=2:sw=2:tw=78
+
diff --git a/kwin-styles/riscos/Static.h b/kwin-styles/riscos/Static.h
new file mode 100644
index 00000000..8a01d03b
--- /dev/null
+++ b/kwin-styles/riscos/Static.h
@@ -0,0 +1,134 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RISC_OS_STATIC_H
+#define RISC_OS_STATIC_H
+
+#include <qimage.h>
+#include <qpixmap.h>
+#include <qpainter.h>
+#include <qstringlist.h>
+
+#include "Palette.h"
+
+namespace RiscOS
+{
+
+enum SymbolType { Lower, Close, Iconify, Max, Unmax };
+
+class Static
+{
+ public:
+
+ Static();
+
+ ~Static();
+
+ static Static* instance()
+ {
+ if (instance_ == 0)
+ new Static;
+
+ return instance_;
+ }
+
+ void reset();
+ void updatePixmaps();
+
+ const QPixmap& titleTextLeft(bool active) const;
+ const QPixmap& titleTextRight(bool active) const;
+ const QPixmap& resizeMidLeft(bool active) const;
+ const QPixmap& resizeMidRight(bool active) const;
+ const QPixmap& titleTextMid(bool active) const;
+ const QPixmap& resizeMidMid(bool active) const;
+ const QPixmap& buttonBase(bool active, bool down) const;
+ const QPixmap& resize(bool active) const;
+
+ int animationStyle() const;
+ int titleHeight() const;
+ int resizeHeight() const;
+
+ private:
+
+ void _init();
+
+ void _drawBorder(QPixmap&, int, int);
+ void _createTexture(QPixmap&, int, bool);
+
+ void _initSizes();
+
+ void _resizeAllPixmaps();
+ void _blankAllPixmaps();
+
+ void _initPalettes();
+ void _initTextures();
+
+ void _drawTitleTextAreaSides();
+ void _drawResizeCentralAreaSides();
+ void _drawTitleTextAreaBackground();
+ void _drawResizeCentralAreaBackground();
+ void _drawResizeHandles();
+ void _drawButtonBackgrounds();
+
+ static Static *instance_;
+
+ Palette
+ aTitlePal_,
+ iTitlePal_,
+ aResizePal_,
+ iResizePal_,
+ aButPal_,
+ iButPal_;
+
+ QPixmap
+ aButtonUp_, iButtonUp_,
+ aButtonDown_, iButtonDown_,
+ aResize_, iResize_,
+ aResizeDown_, iResizeDown_,
+ aTitleTextLeft_, iTitleTextLeft_,
+ aTitleTextRight_, iTitleTextRight_,
+ aTitleTextMid_, iTitleTextMid_,
+ aResizeMidLeft_, iResizeMidLeft_,
+ aResizeMidRight_, iResizeMidRight_,
+ aResizeMid_, iResizeMid_;
+
+ QPixmap aTexture_, iTexture_, abTexture_, ibTexture_;
+
+ QPainter painter_;
+ bool down_;
+ Palette palette_;
+ double transx, transy;
+
+ int animationStyle_;
+
+ int titleHeight_;
+ int buttonSize_;
+ int resizeHeight_;
+
+ bool hicolour_;
+};
+
+} // End namespace
+
+#endif
+
+// vim:ts=2:sw=2:tw=78
diff --git a/kwin-styles/riscos/StickyButton.cpp b/kwin-styles/riscos/StickyButton.cpp
new file mode 100644
index 00000000..808f04c7
--- /dev/null
+++ b/kwin-styles/riscos/StickyButton.cpp
@@ -0,0 +1,99 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "StickyButton.h"
+
+#include <qtooltip.h>
+
+namespace RiscOS
+{
+
+/* XPM */
+static const char * const unsticky_xpm[] = {
+"12 12 3 1",
+" c None",
+". c #000000",
+"+ c #FFFFFF",
+" ... ",
+" .+++. ",
+" .+++. ",
+" .+++. ",
+" .+++. ",
+" .+++++. ",
+" .+++++++. ",
+".+++++++++. ",
+".....+..... ",
+" .+. ",
+" .+. ",
+" . "};
+
+/* XPM */
+static const char * const sticky_xpm[] = {
+"12 12 3 1",
+" c None",
+". c #000000",
+"+ c #FFFFFF",
+" . ",
+" .+. ",
+" .+++. ",
+" .+++++.",
+" ....+++++. ",
+" .++++++. ",
+" .++++. ",
+" .+++. ",
+" .+..+. ",
+" .+. .. ",
+".+. . ",
+".. "};
+
+
+StickyButton::StickyButton(QWidget *parent)
+ : Button(parent, i18n("On all desktops")), on_(false)
+{
+ setPixmap(QPixmap((const char **)sticky_xpm));
+}
+
+void StickyButton::setOn(bool on)
+{
+ on_ = on;
+ setPixmap(on_ ? QPixmap((const char **)unsticky_xpm) :
+ QPixmap((const char **)sticky_xpm));
+ repaint();
+ QToolTip::remove(this);
+ QToolTip::add(this, on_ ? i18n("Not on all desktops")
+ : i18n("On all desktops"));
+}
+
+void StickyButton::mouseReleaseEvent(QMouseEvent *e)
+{
+ Button::mouseReleaseEvent(e);
+
+ if (!rect().contains(e->pos()))
+ return;
+
+ emit(toggleSticky());
+}
+
+} // End namespace
+
+// vim:ts=2:sw=2:tw=78
+#include "StickyButton.moc"
diff --git a/kwin-styles/riscos/StickyButton.h b/kwin-styles/riscos/StickyButton.h
new file mode 100644
index 00000000..fb7746ae
--- /dev/null
+++ b/kwin-styles/riscos/StickyButton.h
@@ -0,0 +1,60 @@
+/*
+ RISC OS KWin client
+
+ Copyright 2000
+ Rik Hemsley <rik@kde.org>
+
+ 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 the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef RISC_OS_STICKY_BUTTON_H
+#define RISC_OS_STICKY_BUTTON_H
+
+#include "Button.h"
+
+namespace RiscOS
+{
+
+class StickyButton : public Button
+{
+ Q_OBJECT
+
+ public:
+
+ StickyButton(QWidget *parent);
+
+ public slots:
+
+ void setOn(bool);
+
+ signals:
+
+ void toggleSticky();
+
+ protected:
+
+ void mouseReleaseEvent(QMouseEvent *);
+
+ private:
+
+ bool on_;
+};
+
+} // End namespace
+
+#endif
+
+// vim:ts=2:sw=2:tw=78
diff --git a/kwin-styles/riscos/riscos.desktop b/kwin-styles/riscos/riscos.desktop
new file mode 100644
index 00000000..194b3017
--- /dev/null
+++ b/kwin-styles/riscos/riscos.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=RISC OS
+Name[cs]=Risc OS
+Name[cy]= RISC OS
+Name[hi]=रिस्क ओएस
+Name[ta]=RISC இ.த
+Name[th]=ระบบปฏิบัติการบนชิพ RISC
+Name[uk]=RISC ОС
+Name[xh]=i RISC OS
+Name[zu]=IRISC OS
+X-KDE-Library=kwin3_riscos
diff --git a/kwin-styles/smooth-blend/AUTHORS b/kwin-styles/smooth-blend/AUTHORS
new file mode 100644
index 00000000..c96228bb
--- /dev/null
+++ b/kwin-styles/smooth-blend/AUTHORS
@@ -0,0 +1 @@
+Ryan Nickell p0z3r@users.sourceforge.net
diff --git a/kwin-styles/smooth-blend/COPYING b/kwin-styles/smooth-blend/COPYING
new file mode 100644
index 00000000..e065ffa0
--- /dev/null
+++ b/kwin-styles/smooth-blend/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/kwin-styles/smooth-blend/CREDITS b/kwin-styles/smooth-blend/CREDITS
new file mode 100644
index 00000000..f473e2ea
--- /dev/null
+++ b/kwin-styles/smooth-blend/CREDITS
@@ -0,0 +1,5 @@
+Justin Berstler aka spasemunkie on kdelook.org - spasemunkie at gmail.com : for his buttons!
+Rick aka bitwit on kdelook.org - bitwit at digilanti.org : for his kwin_template
+David Johnson - david at usermode.org : for his example kwin tutorial
+Thomas Lübking aka thomas12777 on kdelook.org - baghira-style at gmx.net : for answering questions on getting pixmap buttons into code
+Scott Grayban aka sgrayban on kdelook.org : for testing and hosting the files to be downloaded
diff --git a/kwin-styles/smooth-blend/ChangeLog b/kwin-styles/smooth-blend/ChangeLog
new file mode 100644
index 00000000..7b8fbcf2
--- /dev/null
+++ b/kwin-styles/smooth-blend/ChangeLog
@@ -0,0 +1,22 @@
+03.16.2005: (1.0 release)
+-----------
+Double click actions to maximize now show corresponding buttons
+when maximized.
+Windows that open maximized show the correct button and restoring
+changes the button to the restore button as one would expect.
+Removal of the title bar separator line, to complete the feel of
+a "smooth blend".
+
+02.28.2005: (beta2)
+-----------
+Added kcontrol config option to remove titlebar separator line.
+Application icons now resize to match the size of the buttons
+instead of being a fixed size 16x16 icon.
+Added button animations for mouse hover; configurable in kcontrol
+to either Intensify or Fade.
+Fixed some title bar drawing that wasn't correctly sectioned off.
+
+
+02.22.2005: (beta1)
+-----------
+smoothblend-beta1 released.
diff --git a/kwin-styles/smooth-blend/INSTALL b/kwin-styles/smooth-blend/INSTALL
new file mode 100644
index 00000000..02a4a074
--- /dev/null
+++ b/kwin-styles/smooth-blend/INSTALL
@@ -0,0 +1,167 @@
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes a while. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 4. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made.
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
+
diff --git a/kwin-styles/smooth-blend/Makefile.am b/kwin-styles/smooth-blend/Makefile.am
new file mode 100644
index 00000000..44ac1828
--- /dev/null
+++ b/kwin-styles/smooth-blend/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = client
diff --git a/kwin-styles/smooth-blend/NEWS b/kwin-styles/smooth-blend/NEWS
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/kwin-styles/smooth-blend/NEWS
diff --git a/kwin-styles/smooth-blend/README b/kwin-styles/smooth-blend/README
new file mode 100644
index 00000000..836fbe5d
--- /dev/null
+++ b/kwin-styles/smooth-blend/README
@@ -0,0 +1,15 @@
+Smooth Blend - a smooth blending of the window background color into the titlebar.
+
+This is my first attempt at a KDE window decoration.
+Any comments would be much appreciated and can be sent
+to me directly at p0z3r@users.sourceforge.net.
+
+Limitations:
+The Frame Width can not be smaller than 2 pixels because it will lose the top gradient.
+The buttonsize can not be larger than the Title Height - Frame Width.
+
+Known Problems:
+The Shade button doesn't work correctly although the code is there for it.
+The Resize button is also afflicted with the same problem.
+Support for the Shade button and Resize buttons may or may not be supported depending
+upon what I find through the kde mailing lists and other documentation.
diff --git a/kwin-styles/smooth-blend/TODO b/kwin-styles/smooth-blend/TODO
new file mode 100644
index 00000000..6a7bd0a8
--- /dev/null
+++ b/kwin-styles/smooth-blend/TODO
@@ -0,0 +1,4 @@
+TODO
+----
+Code cleanup and separation of different classes into individual files.
+Use pixmaps instead of images for reducing the drawing impact.
diff --git a/kwin-styles/smooth-blend/client/Makefile.am b/kwin-styles/smooth-blend/client/Makefile.am
new file mode 100644
index 00000000..bd64ee62
--- /dev/null
+++ b/kwin-styles/smooth-blend/client/Makefile.am
@@ -0,0 +1,20 @@
+AUTOMAKE_OPTIONS = foreign
+
+SUBDIRS = config
+
+KDE_CXXFLAGS = -DQT_PLUGIN
+
+INCLUDES = $(all_includes) -I$(kde_includes)/kwin
+
+kwindir = $(kde_datadir)/kwin/
+kwin_DATA = smoothblend.desktop
+
+noinst_HEADERS = smoothblend.h buttons.h
+
+kde_module_LTLIBRARIES = kwin3_smoothblend.la
+kwin3_smoothblend_la_SOURCES = smoothblend.cc
+kwin3_smoothblend_la_LIBADD = -lkdecorations
+kwin3_smoothblend_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -lkdecore -module
+kwin3_smoothblend_la_METASOURCES = AUTO
+
+DISTCLEANFILES = $(kwin3_smoothblend_la_METASOURCES)
diff --git a/kwin-styles/smooth-blend/client/buttons.h b/kwin-styles/smooth-blend/client/buttons.h
new file mode 100644
index 00000000..a62268b7
--- /dev/null
+++ b/kwin-styles/smooth-blend/client/buttons.h
@@ -0,0 +1,1798 @@
+/****************************************************************************
+** Image collection for project 'smoothblend'.
+**
+** Generated from reading image files:
+** circle.png
+** close.png
+** help.png
+** keep_above_lit.png
+** keep_above.png
+** keep_below_lit.png
+** keep_below.png
+** maximize.png
+** minimize.png
+** restore.png
+** shade.png
+** splat.png
+** titlealpha.png
+** window_background.png
+** window_foreground.png
+**
+** Created: Sun Jul 31 20:04:32 2005
+** by: The User Interface Compiler ($Id$)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+
+#include <qimage.h>
+#include <qdict.h>
+#include <qmime.h>
+#include <qdragobject.h>
+
+// circle.png
+static const unsigned char image_0_data[] = {
+ 0x00,0x00,0x1a,0x44,0x78,0x9c,0xcd,0x99,0x09,0x4c,0x55,0x47,0x14,0x86,
+ 0x51,0x2b,0xee,0x28,0x04,0x23,0x31,0x06,0x6d,0x50,0xa3,0x46,0x8d,0x4b,
+ 0x24,0xae,0x18,0x8c,0xbb,0x56,0x50,0xc1,0x14,0x63,0xb0,0xda,0x52,0x53,
+ 0x44,0xb1,0xb1,0x35,0x8a,0x8a,0x58,0x82,0x1b,0x45,0x52,0xb0,0x01,0xa9,
+ 0xb5,0xa4,0x56,0xa0,0xa5,0x54,0x6d,0xc3,0x52,0x89,0xb1,0xd8,0xb2,0xd3,
+ 0x57,0x40,0x2b,0xc8,0x8e,0xc8,0x0e,0x56,0x11,0x78,0x50,0x1e,0x6f,0xfa,
+ 0x9f,0xf1,0xde,0x97,0x7b,0xe1,0xdd,0xc7,0x43,0x8b,0x30,0xc9,0x17,0x75,
+ 0xee,0x3d,0x73,0xfe,0x99,0x3b,0xe7,0x9c,0x99,0xa7,0x89,0x49,0xb7,0x66,
+ 0x03,0x3e,0x04,0x61,0x20,0x13,0x3c,0xe8,0x63,0xee,0x83,0x78,0x10,0x00,
+ 0x76,0x81,0xb7,0xba,0x4b,0xd2,0x35,0x2b,0x10,0x0a,0x3a,0x00,0x13,0x31,
+ 0x33,0x33,0xeb,0xe8,0x4b,0xc6,0x8c,0x19,0x23,0xf3,0x07,0xea,0xc1,0x01,
+ 0x60,0xda,0x45,0x9f,0xf5,0xa0,0x41,0x83,0x1a,0xe9,0x1d,0x4b,0x4b,0xcb,
+ 0x8e,0xa0,0xa0,0xa0,0xca,0xb4,0xb4,0xb4,0xe2,0x8e,0x8e,0x8e,0xbf,0x19,
+ 0x63,0x7d,0x8e,0x5a,0xad,0x7e,0x78,0xfb,0xf6,0xed,0x52,0x1f,0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0x0b,0x1a,0xdf,0x01,0x6f,0x03,0xba,0x97,0x6a,
+ 0x90,0x2f,0x28,0x37,0x38,0xf5,0x27,0x38,0xab,0x39,0x23,0x86,0xe3,0x04,
+ 0x7d,0x74,0x07,0x10,0x7f,0x6f,0xb6,0x07,0x74,0x97,0x65,0x53,0xa6,0x4c,
+ 0x49,0x45,0x4d,0xf8,0x04,0xef,0x3a,0xc2,0xc6,0xe1,0x4d,0xd1,0xd6,0xd6,
+ 0xe6,0xe8,0xe1,0xe1,0xe1,0x8b,0x3c,0x5f,0x2d,0xe8,0x2b,0x00,0x16,0x26,
+ 0xf2,0x66,0x2b,0xc6,0x90,0x80,0xd6,0xcc,0xcc,0xac,0x1c,0xf7,0xd2,0x9c,
+ 0x3e,0x26,0x17,0x67,0xb0,0x3a,0x89,0x5f,0xfa,0xcd,0xfe,0x6b,0x93,0x97,
+ 0xff,0xcf,0xa1,0xd4,0xde,0x07,0x5f,0x82,0x0c,0xd0,0xae,0x94,0x9f,0xff,
+ 0x67,0xaa,0xc0,0x1d,0x93,0x97,0xbf,0xcd,0x5b,0x76,0x15,0xf4,0x1f,0x5e,
+ 0xdb,0x58,0x54
+};
+
+// close.png
+static const unsigned char image_1_data[] = {
+ 0x00,0x00,0x1a,0x44,0x78,0x9c,0xcd,0x98,0x6b,0x4c,0x14,0x57,0x14,0xc7,
+ 0x51,0x09,0xf8,0xc4,0x67,0x51,0x8b,0x60,0xd0,0xc4,0x0f,0x46,0xa2,0xe2,
+ 0x5b,0x8c,0xaf,0x88,0x6f,0x03,0x1f,0x68,0x2c,0x49,0x51,0x2c,0x42,0x42,
+ 0x02,0x18,0x24,0x88,0xa9,0x48,0x52,0x2a,0xa8,0x10,0x4b,0xb0,0xb6,0xb5,
+ 0x49,0xdb,0x14,0x53,0x28,0x6b,0x40,0x62,0x08,0x5a,0x1f,0x60,0xd2,0x92,
+ 0x15,0x57,0x58,0x1f,0x6b,0x17,0x90,0xa7,0x02,0x45,0x8b,0x08,0x08,0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0x7b,0x7b,0x23,
+ 0x70,0x97,0xa2,0x6f,0x00,0x14,0x23,0x8c,0x98,0xf7,0x41,0xec,0x33,0xfa,
+ 0xef,0x93,0xf7,0x45,0x99,0x99,0x99,0xa9,0xfc,0xbe,0xfa,0x06,0xfa,0x9a,
+ 0x8f,0x51,0x54,0x57,0x7e,0xfc,0x3e,0xc8,0x6a,0xb5,0x86,0x62,0x6d,0x1f,
+ 0xf0,0x8c,0x1f,0x41,0xde,0x50,0x27,0xce,0xa8,0xed,0xd8,0xb1,0x63,0x5f,
+ 0xe0,0x99,0x90,0xd1,0x14,0xee,0xb1,0x21,0xc8,0xcd,0xc5,0x3c,0x5f,0xa5,
+ 0xcb,0x3f,0xdf,0x9b,0x03,0x20,0xba,0xcb,0x32,0x1f,0x1f,0x1f,0xdd,0xe9,
+ 0xd3,0xa7,0x13,0xf1,0x2e,0xc1,0xb0,0x09,0xfa,0xbf,0x84,0x7a,0x3d,0xf8,
+ 0xc8,0x91,0x23,0x9f,0xa3,0x8e,0x68,0xe3,0xf9,0xe8,0xfb,0xc3,0x07,0x2e,
+ 0xff,0x6e,0xfe,0xfc,0xfe,0x14,0xe2,0x8b,0x1d,0xf1,0xe5,0xf9,0xec,0xd9,
+ 0xb3,0x1f,0x8d,0xb0,0x1e,0xe3,0xfc,0xbe,0x14,0xf9,0xa5,0x6f,0xf6,0xf4,
+ 0x1d,0xfc,0x43,0x17,0xe5,0xf6,0x29,0xbf,0x47,0xef,0x41,0x26,0x91,0xed,
+ 0x48,0xea,0x05,0x44,0xf9,0xe2,0x9c,0xcc,0xdc,0xb9,0xfc,0x0d,0x45,0xac,
+ 0x59,0xc3
+};
+
+// help.png
+static const unsigned char image_2_data[] = {
+ 0x00,0x00,0x1a,0x44,0x78,0x9c,0xcd,0x98,0x79,0x4c,0x54,0x57,0x14,0xc6,
+ 0x87,0x45,0x45,0x21,0x4a,0x88,0x62,0x70,0xa9,0x31,0x11,0x81,0x49,0xf9,
+ 0x03,0x35,0x51,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d0,0x8f,0xf3,0xb9,0x11,0x34,0xcc,
+ 0x26,0x98,0x9d,0x14,0x1a,0x5d,0x93,0x7d,0x82,0x3e,0x0f,0xbe,0x27,0x11,
+ 0x5e,0xd6,0x20,0x01,0x54,0x00,0xa5,0x44,0x22,0x6e,0x66,0xfc,0x9f,0xd0,
+ 0xfb,0x5a,0x07,0xae,0x80,0x13,0xc0,0x44,0x5b,0xd0,0xbf,0x6f,0xf5,0xde,
+ 0xd4
+};
+
+// keep_above_lit.png
+static const unsigned char image_3_data[] = {
+ 0x00,0x00,0x1a,0xe8,0x78,0x9c,0xcd,0x98,0x79,0x4c,0x15,0x57,0x14,0xc6,
+ 0x11,0x31,0xa2,0x28,0xae,0xb8,0xc7,0xdd,0x58,0x97,0x18,0xe3,0x82,0x1a,
+ 0x71,0x89,0x26,0xfd,0x83,0x54,0x6b,0x5d,0x08,0x1a,0xb4,0xb8,0xa0,0x52,
+ 0x45,0x2c,0x2e,0x68,0x5d,0x2a,0xc6,0x82,0x40,0x28,0x34,0x48,0x31,0x96,
+ 0x96,0x1a,0xaa,0x88,0xd5,0x82,0x28,0x60,0x01,0x2b,0x8b,0x20,0x8b,0xec,
+ 0xfb,0xe2,0x82,0x28,0x22,0xa4,0x96,0x36,0x61,0x7f,0xbc,0xe9,0x77,0xa6,
+ 0x33,0xe9,0xf5,0xf0,0xa0,0x56,0xfa,0x8a,0x37,0xf9,0x85,0x97,0xf9,0x66,
+ 0xe6,0x7c,0x33,0x73,0xef,0x39,0xe7,0x62,0x60,0xd0,0x6e,0xf4,0x00,0x1b,
+ 0x80,0x2b,0x08,0x05,0xb9,0x20,0x5f,0xcf,0x64,0x82,0x8b,0xe0,0x08,0x30,
+ 0x6f,0x6f,0xa9,0x9d,0xbf,0xf5,0xa0,0x0c,0x48,0x2a,0x7d,0xfa,0xf4,0x69,
+ 0x33,0x35,0x35,0x6d,0xd5,0x27,0x46,0x46,0x46,0x5a,0x31,0x26,0x08,0x03,
+ 0xd3,0x3a,0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xda,
+ 0x0f,0x13,0x70,0x06,0x34,0xaa,0xeb,0x12,0x9e,0x7f,0x1b,0x3e,0x7c,0x78,
+ 0x2e,0xc8,0xd1,0x27,0xc8,0x4d,0xf9,0x94,0x03,0x84,0x9c,0x50,0x09,0x3e,
+ 0xd0,0xe1,0x51,0x1c,0xfd,0x14,0xbf,0x54,0x5b,0x1f,0xff,0x17,0x79,0xe8,
+ 0x0d,0xa0,0xf7,0x97,0x03,0xae,0x00,0x27,0x60,0xc8,0x4d,0xfd,0x09,0xc2,
+ 0x58,0x25,0x81
+};
+
+// keep_above.png
+static const unsigned char image_4_data[] = {
+ 0x00,0x00,0x1a,0x44,0x78,0x9c,0xcd,0x99,0x6b,0x4c,0x54,0x47,0x14,0xc7,
+ 0x57,0xf1,0x81,0xe2,0x03,0x71,0xf1,0x85,0x8a,0xf8,0x16,0xc5,0xf7,0x03,
+ 0xe5,0x83,0xb1,0xfa,0xc5,0x17,0x35,0xda,0x0f,0x0d,0x41,0xd3,0x10,0x5a,
+ 0x62,0x93,0x26,0x6d,0x08,0x58,0x8c,0xb5,0xd4,0x3e,0x68,0x81,0x60,0xb4,
+ 0xa8,0x24,0x85,0x56,0xa2,0xb5,0x08,0x02,0xb1,0x46,0x2d,0x52,0x8b,0x0a,
+ 0xc5,0xb4,0xe9,0x23,0xed,0xea,0x56,0x40,0x40,0x11,0x76,0x81,0x5d,0x40,
+ 0x14,0x5c,0xd8,0x95,0xbd,0xfd,0x9f,0x75,0x86,0x4e,0x67,0xef,0x22,0xa5,
+ 0xae,0x78,0x93,0x5f,0x80,0x73,0xee,0xcc,0xfc,0x77,0xe6,0x9c,0x33,0x33,
+ 0x8b,0x46,0xe3,0xf4,0xf8,0x81,0x48,0x70,0x04,0xfc,0x04,0x6e,0x3c,0x07,
+ 0x0a,0xc1,0x61,0x10,0x01,0x7c,0x9d,0x25,0x75,0x3f,0xde,0xe0,0x33,0x60,
+ 0x01,0x0a,0x67,0xd4,0xa8,0x51,0x36,0x77,0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f,0x2e,0x61,0x1a,0x77,0x03,0x2d,0x9b,0x4f,0x3b,0xce,0xfa,0xb4,0x57,
+ 0xbd,0xd2,0xdf,0xac,0x5b,0xb7,0x2e,0x8b,0xe9,0xbb,0xa5,0xf9,0xe7,0xfb,
+ 0xe6,0x20,0xcd,0x93,0xef,0xca,0x15,0xc4,0x66,0x59,0x7c,0x7c,0xfc,0xbb,
+ 0x36,0x9b,0x6d,0x1b,0xde,0x7f,0xf9,0x79,0x61,0xb5,0x5a,0xb7,0xed,0xd9,
+ 0xb3,0xe7,0x3d,0x9c,0x41,0xee,0x30,0x7d,0xb4,0x0f,0xfa,0x6b,0xfe,0xfd,
+ 0x04,0x82,0x02,0x21,0xff,0xec,0xa8,0xbf,0xb5,0xd8,0x23,0xfe,0x70,0x37,
+ 0xc8,0x73,0xa3,0x38,0x2e,0xa0,0x73,0x73,0x80,0xc6,0xf5,0xf3,0x12,0xa0,
+ 0xf3,0x2d,0x7d,0xdf,0xd3,0xf1,0x2c,0x6a,0x4d,0x2f,0x78,0x44,0xb9,0xab,
+ 0x79,0xf2,0x3f,0x9a,0x60,0x59,0xd0,0xdf,0x12,0xee,0x16,0x45
+};
+
+// keep_below_lit.png
+static const unsigned char image_5_data[] = {
+ 0x00,0x00,0x1a,0x44,0x78,0x9c,0xcd,0x98,0x79,0x4c,0x54,0x57,0x14,0xc6,
+ 0xc1,0x05,0x51,0x5c,0x41,0x05,0x94,0x62,0xdc,0x77,0x5c,0xc0,0x7d,0x01,
+ 0x97,0x3f,0x30,0xc6,0x96,0xc4,0xaa,0x98,0x34,0x15,0x1b,0x68,0xda,0x26,
+ 0x35,0x69,0x4c,0x0d,0x45,0x5b,0x1b,0x44,0x25,0xb4,0x0d,0x18,0x0b,0x88,
+ 0x69,0x6d,0x69,0xdd,0xab,0x2d,0x26,0x4a,0x34,0xed,0x34,0x20,0x55,0x42,
+ 0x01,0xed,0x80,0x33,0x30,0x2c,0xca,0x32,0x3a,0x53,0x06,0x65,0x44,0x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e,0xf2,0x8f,0x38,0x46,0x87,0x98,0xb0,0xe2,0xae,0xdf,
+ 0x89,0xf6,0xa8,0x17,0x81,0x33,0xfc,0x3e,0xee,0xff,0x8f,0x7a,0x4a,0x6d,
+ 0x6d,0xed,0x07,0x2f,0xe3,0x87,0x40,0xed,0x5a,0x29,0xae,0xb7,0x70,0x1e,
+ 0x33,0x32,0x32,0xf6,0xa1,0xfd,0x9d,0xbe,0xc2,0xfd,0xfb,0xf7,0xdf,0xc3,
+ 0x3d,0x4f,0xbf,0x47,0x15,0x83,0x77,0xc5,0x5c,0x51,0x08,0x5b,0x64,0x5f,
+ 0x21,0x3c,0x3c,0xfc,0xb4,0xb8,0xcf,0x5f,0xbb,0x3d,0xfd,0x9d,0x59,0x38,
+ 0x3f,0xa8,0x9b,0xe9,0x7c,0xbd,0xfd,0xba,0xd9,0xb5,0x6b,0x57,0xa2,0xb8,
+ 0xc7,0xff,0x02,0x3f,0xb7,0xa7,0x8f,0x3f,0x10,0xde,0x1d,0x70,0x7e,0xea,
+ 0x77,0xef,0xde,0xbd,0x1f,0xef,0x2d,0x11,0xe8,0xff,0xd6,0xab,0x02,0xef,
+ 0x6e,0x11,0x09,0x09,0x09,0x7b,0x02,0x02,0x02,0x8a,0xc5,0xf5,0xa3,0xdf,
+ 0x9a,0x42,0xdc,0x9e,0x7f,0xde,0x00,0xa7,0xa5,0x9c,0x40,0xe0,0x8e,0x31,
+ 0xa2,0x7e,0x54,0xbb,0x1a,0xd4,0xa9,0xf5,0x72,0xbf,0xa0,0x08,0x04,0xb9,
+ 0x39,0x7f,0x82,0x01,0xe5,0xee,0x1c,0x71,0xad,0x7b,0x9d,0x6b,0x5e,0x82,
+ 0x56,0x90,0x0f,0xbe,0x05,0x51,0xbc,0xa0,0xff,0x00,0xbc,0x45,0x33,0x49
+};
+
+// keep_below.png
+static const unsigned char image_6_data[] = {
+ 0x00,0x00,0x1a,0x44,0x78,0x9c,0xcd,0x99,0x09,0x4c,0x94,0x47,0x14,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fd,0x73,0x02,0xe7,0x73,0x8c,0xa8,0xd1,
+ 0x19,0xd0,0x1d,0x51,0x85,0x7b,0x34,0xe5,0x4e,0xeb,0xcf,0x01,0x9c,0xe3,
+ 0x3b,0x50,0xeb,0x57,0x89,0x1a,0x4d,0x81,0x39,0xa0,0x7a,0xb0,0x3d,0x2a,
+ 0x2a,0x8a,0x72,0x8c,0xe5,0xa7,0x04,0x79,0xce,0x0a,0xfb,0xea,0xbe,0xa8,
+ 0x8f,0xfe,0x6f,0xa0,0x79,0x6c,0x34,0x7b,0x17,0xe7,0xd2,0xf5,0xf0,0xf0,
+ 0xf0,0x7d,0x68,0x6f,0xf1,0x31,0x69,0x6b,0x6b,0xfb,0x0a,0xf5,0x4b,0x30,
+ 0xea,0xe7,0x67,0xa2,0xbe,0x0c,0x60,0xa0,0xf7,0xfa,0xf3,0xa5,0xde,0x7f,
+ 0xdf,0xe9,0x6b,0xee,0x52,0x4a,0x9c,0xc3,0x4f,0x8c,0x8c,0x8c,0x1e,0xeb,
+ 0x98,0x5c,0x03,0x03,0x03,0x8d,0x2e,0x82,0xf2,0x52,0x20,0x30,0xd4,0xd3,
+ 0xfe,0xd0,0xff,0x1b,0xf6,0x89,0x7b,0xe9,0x21,0xe8,0xfa,0x3f,0x72,0xcd,
+ 0x7b,0x50,0x09,0x52,0x81,0xaf,0x36,0x6d,0xff,0x02,0x1b,0x15,0xfd,0xbb
+};
+
+// maximize.png
+static const unsigned char image_7_data[] = {
+ 0x00,0x00,0x1a,0xe8,0x78,0x9c,0xcd,0x99,0x7b,0x2c,0x64,0x57,0x1c,0xc7,
+ 0xbd,0x0d,0x4d,0xf8,0x83,0xec,0x56,0x42,0xb2,0x7f,0x14,0xf1,0xb7,0x84,
+ 0x15,0x99,0x0d,0x09,0xa5,0x95,0xd5,0x6d,0x42,0x23,0x22,0xed,0x24,0xd2,
+ 0x04,0x29,0xeb,0x55,0x15,0xef,0xd7,0xaa,0xdd,0x7a,0x84,0x7a,0xac,0x32,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x80,0x70,0x03,0x8e,0xf4,
+ 0x10,0x81,0x1c,0xd0,0x0b,0x9e,0xe9,0xce,0x3d,0xc7,0x33,0xc4,0x71,0x05,
+ 0x90,0xfb,0x8e,0x4f,0x80,0x19,0x2b,0xf5,0x37,0x31,0x12,0xfd,0x45
+};
+
+// minimize.png
+static const unsigned char image_8_data[] = {
+ 0x00,0x00,0x1a,0xe8,0x78,0x9c,0xcd,0x99,0x6b,0x48,0x5b,0x67,0x18,0xc7,
+ 0xe3,0x25,0xd3,0xa9,0x28,0xec,0x83,0x37,0x10,0x11,0xc9,0x27,0x15,0xe6,
+ 0x05,0x3f,0x08,0xfa,0x45,0x14,0x41,0x71,0x4c,0xc5,0xe5,0xc3,0x06,0x1b,
+ 0xe2,0xc2,0x82,0x73,0x88,0x6e,0x5a,0x75,0x5e,0x9a,0x60,0xd4,0x7a,0x99,
+ 0x8e,0x20,0x95,0xc0,0x0c,0xcd,0x24,0x8b,0x76,0xa6,0xce,0x4b,0xaa,0x8d,
+ 0x51,0x51,0x43,0x2a,0xd5,0x45,0xd3,0x6e,0xb3,0x71,0x32,0x5b,0xdd,0xd8,
+ 0x84,0x52,0x5c,0xa4,0x12,0x93,0xb3,0xe7,0x8d,0xe7,0x94,0xec,0x59,0xec,
+ 0x87,0xc5,0xd4,0xf7,0x85,0x1f,0x1c,0xfc,0x27,0x3e,0xbf,0xf7,0xf5,0x9c,
+ 0xf7,0xe2,0xe1,0xf1,0x3c,0xb6,0x6c,0xa0,0x09,0x50,0x01,0x9b,0x80,0xc5,
+ 0xc7,0x98,0x81,0x71,0x40,0x02,0x94,0x00,0x7e,0x9e,0xb5,0x5e,0xb6,0xb7,
+ 0x81,0xbb,0x00,0xc3,0xc1,0xe7,0xf3,0x1d,0xe1,0xe1,0xe1,0x76,0x5f,0x12,
+ 0x1c,0x1c,0xec,0x70,0xaf,0xc9,0xba,0x17,0x5e,0xe0,0x48,0xfa,0xe1,0x24,
+ 0x9f,0x13,0x08,0x04,0x2f,0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c,0xd6,0x00,0x31,0x7c,0xae,
+ 0xec,0x2a,0x39,0x3e,0x3e,0x7e,0x2f,0x3a,0x3a,0xfa,0x11,0x3b,0x96,0x12,
+ 0xde,0xbf,0xdb,0x35,0xf6,0x79,0xb6,0xa7,0xa7,0xa7,0x6b,0x87,0x87,0x87,
+ 0xc9,0xdc,0xf0,0xce,0xeb,0x44,0xa9,0x54,0x8a,0x0b,0x0a,0x0a,0x14,0x7c,
+ 0x3e,0xff,0x98,0x75,0x24,0xef,0x40,0xfc,0x79,0xff,0x6d,0x42,0xe0,0x0f,
+ 0x6e,0xce,0x80,0xb5,0xdd,0x01,0xf3,0x86,0x25,0x2a,0x2a,0xca,0xec,0x4b,
+ 0xa0,0xc6,0x16,0xd4,0xb2,0xbb,0xed,0xa3,0xfe,0xe6,0x9d,0xbf,0x17,0x0a,
+ 0xf2,0xe0,0xc8,0xb5,0x40,0xe0,0x0b,0x60,0x8c,0x77,0xfe,0x7e,0xe4,0xcc,
+ 0xed,0xfb,0xbe,0x82,0xec,0x19,0xad,0xc0,0x0f,0x00,0x99,0x8b,0xde,0xc4,
+ 0x52,0xff,0x00,0x74,0x7b,0x34,0xdf
+};
+
+// restore.png
+static const unsigned char image_9_data[] = {
+ 0x00,0x00,0x1a,0x44,0x78,0x9c,0xcd,0x98,0x6b,0x4c,0x54,0x47,0x14,0xc7,
+ 0xd1,0x8a,0xe2,0xb2,0x2a,0xe1,0xe5,0x03,0x14,0x51,0x41,0x45,0xf0,0x2d,
+ 0xa0,0xc6,0x57,0xaa,0x89,0xf1,0x03,0xf5,0x43,0x3f,0xb4,0x01,0x03,0x58,
+ 0x48,0x69,0x42,0x3f,0x68,0x68,0x24,0x84,0x6e,0x00,0x09,0x96,0x20,0x62,
+ 0x2b,0xa5,0xc1,0x54,0xfa,0x08,0x41,0xb1,0x25,0x69,0x63,0x4c,0xb1,0xd6,
+ 0x12,0x24,0x42,0x30,0xa9,0xda,0xd4,0xc5,0xfa,0x80,0x6e,0x51,0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0x49,0x67,0x85,0xb4,0xb1,0xc0,0xda,0x75,0x10,0xb9,
+ 0xf8,0xde,0x78,0xc1,0xde,0xeb,0xe0,0x78,0xfa,0x1d,0x0d,0xe4,0x09,0xad,
+ 0x85,0xf4,0x3d,0xf2,0xbc,0xeb,0x7b,0x01,0xe5,0x52,0xca,0xeb,0x82,0x5a,
+ 0xad,0x7e,0x1f,0xfb,0x1d,0x3a,0xef,0xb5,0x80,0x2c,0x72,0x44,0xbd,0xbc,
+ 0x86,0x7b,0xef,0xbc,0x2e,0xe0,0x5c,0xd9,0xe0,0x7a,0xcf,0x85,0xc0,0x1f,
+ 0x38,0xf3,0x67,0xd7,0xae,0x5d,0x54,0x4b,0xdf,0x7e,0xd5,0x24,0x27,0x27,
+ 0x57,0xc2,0x67,0x04,0xd0,0x1e,0x37,0xd8,0xe7,0xdf,0x2b,0x02,0x38,0xcf,
+ 0x37,0x01,0x01,0x01,0x1a,0xe4,0xf0,0xc7,0x56,0xab,0x75,0x3f,0x9e,0x7f,
+ 0x6b,0xb2,0xb0,0xd9,0x6c,0xfb,0xb1,0xb7,0xc8,0x45,0x5e,0x49,0x35,0x91,
+ 0xbe,0x99,0xc5,0xf9,0xfc,0xf7,0x8a,0x04,0xdf,0xbb,0xfc,0x9d,0x39,0x89,
+ 0x5c,0xee,0x43,0x1e,0xfe,0xee,0x6d,0x94,0x4a,0xe5,0x23,0x79,0x5c,0x40,
+ 0xdf,0x06,0x62,0x7c,0x46,0xbf,0x12,0xc0,0x67,0xa0,0x19,0x98,0xdc,0xa9,
+ 0x37,0x6e,0x40,0x75,0xed,0x1a,0xa0,0x77,0xfc,0x26,0x2f,0xf4,0x0f,0x37,
+ 0x76,0x25,0x15
+};
+
+// shade.png
+static const unsigned char image_10_data[] = {
+ 0x00,0x00,0x1f,0xa4,0x78,0x9c,0xd5,0x99,0xd1,0x4b,0x53,0x51,0x1c,0xc7,
+ 0xbd,0xd3,0xa1,0xa0,0xf8,0xa2,0xff,0x81,0xef,0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x45,0xf6,0x61,0xe9,0x19,0x93,
+ 0xae,0x14,0xcc,0x1a,0x13,0xbb,0x0f,0x2b,0xfe,0xb3,0xfd,0xee,0x5f,0x4b,
+ 0xfc,0x3e,0x57
+};
+
+// splat.png
+static const unsigned char image_11_data[] = {
+ 0x00,0x00,0x1a,0xe8,0x78,0x9c,0xcd,0x59,0x09,0x4c,0x95,0x47,0x10,0xc6,
+ 0x03,0x50,0xf1,0x88,0xf1,0xbe,0xa2,0x36,0xd1,0x78,0xd6,0x98,0xaa,0x69,
+ 0x88,0xda,0xe2,0x81,0x26,0x52,0x89,0x77,0x63,0x8c,0x82,0x82,0x41,0x11,
+ 0x09,0x18,0xad,0xc5,0x70,0x14,0x14,0x0f,0x50,0x6a,0x04,0x41,0x41,0xe4,
+ 0x2a,0x88,0x82,0x02,0xfa,0x12,0x88,0x29,0x86,0xc3,0xa2,0x42,0xb9,0x44,
+ 0x69,0x25,0x4a,0x2d,0xe2,0x85,0x8a,0xa8,0x60,0xb8,0xde,0xf6,0x9b,0xf5,
+ 0xed,0xcb,0xff,0x16,0xde,0x61,0x52,0xd4,0x4d,0xbe,0x04,0xff,0x9d,0xdd,
+ 0xf9,0xd8,0x9d,0xf9,0x66,0x56,0xcc,0xcc,0x3a,0x1d,0xf6,0x80,0x1f,0x70,
+ 0x1e,0x28,0x03,0x2a,0xba,0x18,0xa5,0x40,0x12,0xe0,0x0d,0xd8,0x75,0x4e,
+ 0x49,0x67,0x7c,0x0f,0x14,0x01,0x4c,0xc0,0xd2,0xd2,0xb2,0xbd,0x7f,0xff,
+ 0xfe,0xad,0x5d,0x09,0x0b,0x0b,0x8b,0x76,0xa5,0x4f,0x20,0x1f,0xf8,0x56,
+ 0x0f,0x47,0x77,0x61,0xb7,0x6c,0xd9,0xb2,0x86,0x98,0x98,0x98,0x9a,0x7b,
+ 0x18,0x8c,0xb1,0x3b,0x5d,0x0d,0xb5,0x5a,0x7d,0xa7,0xb2,0xb2,0xb2,0x2a,
+ 0x3a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 0xd7,0x80,0x05,0xd0,0x84,0x7c,0x68,0xb8,0x7e,0xfd,0xba,0x0b,0xe6,0x7f,
+ 0xfc,0x12,0xa0,0x52,0xa9,0xdc,0x10,0x33,0x8d,0xe0,0x46,0xbd,0x6c,0x37,
+ 0xb3,0x0f,0xc3,0x93,0x78,0xe3,0xad,0xfb,0x04,0xfa,0xe3,0x08,0xbb,0xd5,
+ 0x9f,0x13,0x78,0xef,0x3b,0x43,0xab,0x5f,0x68,0xce,0x72,0x9d,0x99,0xee,
+ 0x88,0xd2,0xf4,0x65,0x4d,0x36,0x36,0x36,0xf1,0x67,0xcf,0x9e,0xdd,0x8e,
+ 0x35,0xf6,0x9f,0x12,0xe8,0xd9,0x5c,0xad,0xad,0xad,0x93,0x51,0x13,0x9a,
+ 0x35,0x1c,0x83,0xcc,0x3a,0x0e,0x3a,0x5b,0x67,0xe0,0xb5,0xc8,0x69,0xe8,
+ 0x63,0xdb,0xd0,0xa1,0x43,0x6f,0x0f,0x1b,0x36,0xac,0xac,0x2b,0x41,0x3e,
+ 0xc8,0x97,0x42,0x4f,0xe8,0x2c,0x37,0x75,0xc2,0x51,0x39,0x2c,0xcd,0x3e,
+ 0xfc,0x1d,0x87,0xb4,0x9a,0x7a,0x79,0x9d,0x9a,0xd8,0x45,0xa0,0xbf,0xcb,
+ 0x50,0xef,0x90,0x0a,0x78,0x01,0xe6,0x32,0xa9,0xff,0x00,0x99,0xf6,0xbe,
+ 0x01
+};
+
+// titlealpha.png
+static const unsigned char image_12_data[] = {
+ 0x00,0x00,0x00,0x78,0x78,0x9c,0xe3,0xe7,0xe7,0xaf,0x64,0x00,0x82,0xff,
+ 0xff,0xff,0x87,0x02,0x71,0x08,0x10,0x7b,0x01,0xb1,0x33,0x10,0x5b,0x01,
+ 0xb1,0x3e,0x10,0x6b,0x00,0xb1,0x02,0x10,0x4b,0x02,0x31,0x27,0x03,0x0e,
+ 0x00,0x94,0x63,0x05,0x62,0x09,0x34,0x0c,0xd2,0xa7,0x07,0xc4,0x36,0x50,
+ 0x73,0x23,0x3f,0x7c,0xf8,0x20,0xc3,0xcf,0xcf,0xcf,0x06,0x00,0x83,0xf5,
+ 0x43,0x25
+};
+
+// window_background.png
+static const unsigned char image_13_data[] = {
+ 0x00,0x00,0x1a,0xe8,0x78,0x9c,0xcd,0x98,0x69,0x4c,0x54,0x57,0x14,0xc7,
+ 0x59,0x04,0xdc,0xe2,0xbe,0xf3,0xc1,0x15,0xfc,0x60,0x4c,0xda,0xc4,0x2f,
+ 0x96,0x2a,0xa6,0xf1,0x8b,0x24,0x84,0x0f,0xd6,0xa4,0x8d,0x34,0x01,0xa4,
+ 0x09,0x54,0x28,0x21,0x85,0x26,0x1a,0x36,0x6b,0xad,0x10,0x2c,0x8b,0x20,
+ 0x8b,0xac,0xb2,0x14,0x90,0x1d,0x0a,0x08,0x6d,0xa1,0x92,0x40,0x8a,0x24,
+ 0xb6,0x28,0x76,0x18,0x16,0x69,0x3b,0x5a,0x05,0x2d,0x1d,0xc5,0x51,0x96,
+ 0x19,0x5e,0xff,0xe7,0x39,0xb7,0xb9,0xdc,0x62,0x99,0xf7,0xa6,0xb4,0xbd,
+ 0xc9,0x2f,0x19,0xee,0x99,0x73,0xee,0x7f,0xde,0xbb,0xe7,0x9c,0x7b,0xb1,
+ 0xb1,0x99,0x73,0x78,0x81,0x18,0x50,0x06,0x7e,0x00,0xbd,0x0b,0x0c,0xad,
+ 0x51,0x02,0xa2,0x80,0xe7,0xdc,0x92,0x66,0x0d,0x77,0xd0,0x0d,0x24,0x86,
+ 0x93,0x93,0x93,0x69,0xc5,0x8a,0x15,0xd3,0x0b,0x89,0xa3,0xa3,0xa3,0x89,
+ 0x5f,0x13,0x74,0x80,0x37,0x5e,0xa1,0x31,0x88,0x7d,0xcf,0xc3,0xc3,0xe3,
+ 0x49,0x7e,0x7e,0xbe,0x4e,0xab,0xd5,0xf6,0xcf,0xcc,0xcc,0xdc,0x91,0x24,
+ 0x69,0x41,0xa1,0x35,0x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a8,0x08,0xc3,0x1d,0xf4,0xbd,0xbf,0x8b,0x39,0x1f,0x7b,
+ 0xf7,0xee,0x65,0xe7,0xf9,0xd7,0x81,0x03,0x30,0xe0,0x77,0x3f,0x6d,0x6f,
+ 0x6f,0x0f,0x80,0xfd,0x9d,0xff,0x03,0xd7,0xae,0x5d,0x0b,0xc2,0xd9,0xc4,
+ 0x00,0x6d,0xbf,0x03,0x3b,0x9b,0x97,0x23,0x84,0x74,0x2f,0x5f,0xbe,0xfc,
+ 0x61,0x57,0x57,0x97,0x1f,0xbe,0xf7,0xf6,0x7f,0x09,0xee,0xd4,0xfe,0xc8,
+ 0x0d,0x76,0xfe,0x7d,0xd7,0x66,0xf6,0xc8,0x34,0xe7,0xcc,0x0b,0x77,0x77,
+ 0xf7,0x22,0x9c,0x9b,0x4f,0xc2,0xc7,0xeb,0xdf,0x04,0x67,0xdd,0x93,0x6e,
+ 0x6e,0x6e,0xa5,0xf6,0xf6,0xf6,0x13,0x66,0x8d,0x09,0x36,0x7f,0x1d,0xb6,
+ 0xc0,0x1f,0xe8,0x59,0x0e,0x20,0x7f,0x8c,0x38,0x43,0xdc,0x46,0x6d,0xea,
+ 0x59,0x48,0x68,0x0d,0x5a,0x8b,0xcb,0xbf,0xdf,0x80,0xcf,0x1c,0x1a,0xf9,
+ 0xe1,0x04,0x22,0x41,0x0d,0xd0,0x02,0xd5,0xb9,0xae,0x00,0x5a,0x83,0xfa,
+ 0x0a,0x9d,0x37,0x4f,0x03,0x47,0x51,0xd4,0x1f,0xb7,0x84,0x65,0x15
+};
+
+// window_foreground.png
+static const unsigned char image_14_data[] = {
+ 0x00,0x00,0x1a,0x44,0x78,0x9c,0xcd,0x98,0x7b,0x4c,0x14,0x57,0x14,0x87,
+ 0x57,0x79,0xfa,0x42,0xb0,0x44,0xaa,0x86,0x10,0x9b,0xe8,0x1f,0xbc,0x82,
+ 0x8a,0x1a,0x8d,0x12,0x89,0x8f,0xf8,0x88,0x02,0x11,0x48,0x37,0x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e7,0x4b,0xd0,0xda,0xd9,0xd9,0xf5,0xa3,0xfe,0xfc,0x32,0xcf,
+ 0xdc,0x46,0xef,0xf0,0x88,0xb9,0x2f,0xf9,0x66,0x7f,0x15,0xbc,0x2a,0x7a,
+ 0xf1,0xf1,0x16,0xc8,0xe0,0x9f,0xf3,0xd3,0xb9,0xee,0x19,0x4c,0xe4,0x4f,
+ 0x50,0x03,0x92,0x81,0xa3,0xa1,0xd0,0x5f,0x5b,0xa8,0xfc,0xc8
+};
+
+static struct EmbedImage {
+ int width, height, depth;
+ const unsigned char *data;
+ ulong compressed;
+ int numColors;
+ const QRgb *colorTable;
+ bool alpha;
+ const char *name;
+} embed_image_vec[] = {
+ { 41, 41, 32, (const unsigned char*)image_0_data, 1781, 0, 0, TRUE, "circle.png" },
+ { 41, 41, 32, (const unsigned char*)image_1_data, 1724, 0, 0, TRUE, "close.png" },
+ { 41, 41, 32, (const unsigned char*)image_2_data, 1555, 0, 0, TRUE, "help.png" },
+ { 42, 41, 32, (const unsigned char*)image_3_data, 1879, 0, 0, TRUE, "keep_above_lit.png" },
+ { 41, 41, 32, (const unsigned char*)image_4_data, 1734, 0, 0, TRUE, "keep_above.png" },
+ { 41, 41, 32, (const unsigned char*)image_5_data, 1750, 0, 0, TRUE, "keep_below_lit.png" },
+ { 41, 41, 32, (const unsigned char*)image_6_data, 1848, 0, 0, TRUE, "keep_below.png" },
+ { 42, 41, 32, (const unsigned char*)image_7_data, 1343, 0, 0, TRUE, "maximize.png" },
+ { 42, 41, 32, (const unsigned char*)image_8_data, 1141, 0, 0, TRUE, "minimize.png" },
+ { 41, 41, 32, (const unsigned char*)image_9_data, 1529, 0, 0, TRUE, "restore.png" },
+ { 45, 45, 32, (const unsigned char*)image_10_data, 885, 0, 0, TRUE, "shade.png" },
+ { 42, 41, 32, (const unsigned char*)image_11_data, 2017, 0, 0, TRUE, "splat.png" },
+ { 1, 30, 32, (const unsigned char*)image_12_data, 72, 0, 0, TRUE, "titlealpha.png" },
+ { 42, 41, 32, (const unsigned char*)image_13_data, 1609, 0, 0, TRUE, "window_background.png" },
+ { 41, 41, 32, (const unsigned char*)image_14_data, 1566, 0, 0, TRUE, "window_foreground.png" },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+static QImage uic_findImage( const QString& name )
+{
+ for ( int i=0; embed_image_vec[i].data; i++ ) {
+ if ( QString::fromUtf8(embed_image_vec[i].name) == name ) {
+ QByteArray baunzip;
+ baunzip = qUncompress( embed_image_vec[i].data,
+ embed_image_vec[i].compressed );
+ QImage img((uchar*)baunzip.data(),
+ embed_image_vec[i].width,
+ embed_image_vec[i].height,
+ embed_image_vec[i].depth,
+ (QRgb*)embed_image_vec[i].colorTable,
+ embed_image_vec[i].numColors,
+ QImage::BigEndian
+ );
+ img = img.copy();
+ if ( embed_image_vec[i].alpha )
+ img.setAlphaBuffer(TRUE);
+ return img;
+ }
+ }
+ return QImage();
+}
+
+class MimeSourceFactory_smoothblend : public QMimeSourceFactory
+{
+public:
+ MimeSourceFactory_smoothblend() {}
+ ~MimeSourceFactory_smoothblend() {}
+ const QMimeSource* data( const QString& abs_name ) const {
+ const QMimeSource* d = QMimeSourceFactory::data( abs_name );
+ if ( d || abs_name.isNull() ) return d;
+ QImage img = uic_findImage( abs_name );
+ if ( !img.isNull() )
+ ((QMimeSourceFactory*)this)->setImage( abs_name, img );
+ return QMimeSourceFactory::data( abs_name );
+ };
+};
+
+static QMimeSourceFactory* bfactory = 0;
+
+void qInitImages_smoothblend()
+{
+ if ( !bfactory ) {
+ bfactory = new MimeSourceFactory_smoothblend;
+ QMimeSourceFactory::defaultFactory()->addFactory( bfactory );
+ }
+}
+
+void qCleanupImages_smoothblend()
+{
+ if ( bfactory ) {
+ QMimeSourceFactory::defaultFactory()->removeFactory( bfactory );
+ delete bfactory;
+ bfactory = 0;
+ }
+}
+
+class StaticInitImages_smoothblend
+{
+public:
+ StaticInitImages_smoothblend() { qInitImages_smoothblend(); }
+#if defined(Q_OS_SCO) || defined(Q_OS_UNIXWARE)
+ ~StaticInitImages_smoothblend() { }
+#else
+ ~StaticInitImages_smoothblend() { qCleanupImages_smoothblend(); }
+#endif
+};
+
+static StaticInitImages_smoothblend staticImages;
diff --git a/kwin-styles/smooth-blend/client/config/Makefile.am b/kwin-styles/smooth-blend/client/config/Makefile.am
new file mode 100644
index 00000000..618dbca1
--- /dev/null
+++ b/kwin-styles/smooth-blend/client/config/Makefile.am
@@ -0,0 +1,15 @@
+AUTOMAKE_OPTIONS = foreign
+
+KDE_CXXFLAGS = -DQT_PLUGIN
+
+INCLUDES = $(all_includes)
+
+noinst_HEADERS = smoothblendconfig.h
+
+kde_module_LTLIBRARIES = kwin_smoothblend_config.la
+kwin_smoothblend_config_la_SOURCES = configdialog.ui smoothblendconfig.cc
+kwin_smoothblend_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwin_smoothblend_config_la_LIBADD = $(LIB_KDEUI)
+kwin_smoothblend_config_la_METASOURCES = AUTO
+
+DISTCLEANFILES = $(kwin_smoothblend_config_la_METASOURCES)
diff --git a/kwin-styles/smooth-blend/client/config/configdialog.ui b/kwin-styles/smooth-blend/client/config/configdialog.ui
new file mode 100644
index 00000000..f84973dc
--- /dev/null
+++ b/kwin-styles/smooth-blend/client/config/configdialog.ui
@@ -0,0 +1,421 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>ConfigDialog</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ConfigDialog</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>634</width>
+ <height>371</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Config Dialog</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QGroupBox" row="1" column="0">
+ <property name="name">
+ <cstring>buttongroup</cstring>
+ </property>
+ <property name="title">
+ <string>Buttons</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QSpinBox" row="0" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>buttonsize</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="suffix">
+ <string> pixels</string>
+ </property>
+ <property name="specialValueText">
+ <string>1 pixel</string>
+ </property>
+ <property name="buttonSymbols">
+ <enum>UpDownArrows</enum>
+ </property>
+ <property name="maxValue">
+ <number>64</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>16</number>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>animatebuttons</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Animate buttons</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this option if you want to use button animations when hovering with the mouse.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>Button size:</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>menuClose</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Close window when menu double clicked</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>30</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QComboBox" row="2" column="3">
+ <item>
+ <property name="text">
+ <string>Intensify</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Fade</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>btnComboBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Animation style:</string>
+ </property>
+ </widget>
+ <spacer row="0" column="4" rowspan="4" colspan="1">
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>180</width>
+ <height>140</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>titlegroup</cstring>
+ </property>
+ <property name="title">
+ <string>Title Bar</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>Text alignment:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Frame width:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Title height:</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>titlesize</cstring>
+ </property>
+ <property name="suffix">
+ <string> pixels</string>
+ </property>
+ <property name="maxValue">
+ <number>64</number>
+ </property>
+ <property name="minValue">
+ <number>16</number>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="3" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>framesize</cstring>
+ </property>
+ <property name="suffix">
+ <string> pixels</string>
+ </property>
+ <property name="specialValueText">
+ <string>1 pixel</string>
+ </property>
+ <property name="maxValue">
+ <number>64</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>4</number>
+ </property>
+ </widget>
+ <widget class="QButtonGroup" row="0" column="1" rowspan="2" colspan="2">
+ <property name="name">
+ <cstring>titlealign</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>GroupBoxPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <property name="alignment">
+ <set>AlignTop</set>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Use these buttons to set the alignment of the window title</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout14</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>AlignLeft</cstring>
+ </property>
+ <property name="text">
+ <string>Left</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>AlignHCenter</cstring>
+ </property>
+ <property name="text">
+ <string>Center</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>AlignRight</cstring>
+ </property>
+ <property name="text">
+ <string>Right</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="0" column="3" rowspan="4" colspan="1">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>231</width>
+ <height>71</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox" row="4" column="2" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>roundCorners</cstring>
+ </property>
+ <property name="text">
+ <string>Round top corners</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>titleshadow</cstring>
+ </property>
+ <property name="text">
+ <string>Use shadowed text</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this option if you want the titlebar text to have a 3D look with a shadow behind it.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>animatebuttons</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>animatebuttons</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>btnComboBox</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>AlignLeft</tabstop>
+ <tabstop>AlignHCenter</tabstop>
+ <tabstop>AlignRight</tabstop>
+ <tabstop>titlesize</tabstop>
+ <tabstop>framesize</tabstop>
+ <tabstop>titleshadow</tabstop>
+ <tabstop>roundCorners</tabstop>
+ <tabstop>buttonsize</tabstop>
+ <tabstop>animatebuttons</tabstop>
+ <tabstop>btnComboBox</tabstop>
+ <tabstop>menuClose</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kwin-styles/smooth-blend/client/config/smoothblendconfig.cc b/kwin-styles/smooth-blend/client/config/smoothblendconfig.cc
new file mode 100644
index 00000000..30472143
--- /dev/null
+++ b/kwin-styles/smooth-blend/client/config/smoothblendconfig.cc
@@ -0,0 +1,180 @@
+//////////////////////////////////////////////////////////////////////////////
+// smoothblendconfig.cc
+// -------------------
+// Config module for Smooth Blend window decoration
+// -------------------
+// Copyright (c) 2005 Ryan Nickell <p0z3r@users.sourceforge.net>
+// Please see the header file for copyright and license information.
+//////////////////////////////////////////////////////////////////////////////
+
+#include <kconfig.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <qbuttongroup.h>
+#include <qgroupbox.h>
+#include <qradiobutton.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+#include <qwhatsthis.h>
+#include <qcombobox.h>
+
+#include "smoothblendconfig.h"
+#include "configdialog.h"
+
+//////////////////////////////////////////////////////////////////////////////
+// smoothblendConfig()
+// -------------
+// Constructor
+
+smoothblendConfig::smoothblendConfig(KConfig* config, QWidget* parent)
+ : QObject(parent), config_(0), dialog_(0) {
+ // create the configuration object
+ config_ = new KConfig("kwinsmoothblendrc");
+ KGlobal::locale()->insertCatalogue("kwin_smoothblend_config");
+
+ // create and show the configuration dialog
+ dialog_ = new ConfigDialog(parent);
+ dialog_->show();
+
+ // load the configuration
+ load(config_);
+
+ // setup the connections for title align
+ connect(dialog_->titlealign, SIGNAL(clicked(int)),this, SLOT(selectionChanged(int)));
+ // setup the connections for corner rounding
+ connect(dialog_->roundCorners, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int)));
+ // setup title shadow
+ connect(dialog_->titleshadow, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int)));
+ // setup button actions
+ connect(dialog_->animatebuttons, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int)));
+ connect(dialog_->btnComboBox, SIGNAL(activated(int)),this,SLOT(selectionChanged(int)));
+ // setup the connections for spin boxes
+ connect(dialog_->titlesize, SIGNAL(valueChanged(int)),this,SLOT(selectionChanged(int)));
+ connect(dialog_->buttonsize, SIGNAL(valueChanged(int)),this,SLOT(selectionChanged(int)));
+ connect(dialog_->framesize, SIGNAL(valueChanged(int)),this,SLOT(selectionChanged(int)));
+ // double click the menu
+ connect(dialog_->menuClose, SIGNAL(stateChanged(int)),this, SLOT(selectionChanged(int)));
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// ~smoothblendConfig()
+// --------------
+// Destructor
+
+smoothblendConfig::~smoothblendConfig() {
+ if (dialog_)
+ {
+ delete dialog_;
+ }
+ if (config_)
+ {
+ delete config_;
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// selectionChanged()
+// ------------------
+// Selection has changed
+
+void smoothblendConfig::selectionChanged(int) {
+
+ if(dialog_->buttonsize->value() + dialog_->framesize->value() > dialog_->titlesize->value())
+ {
+ dialog_->buttonsize->setValue(dialog_->titlesize->value()- dialog_->framesize->value());
+ }
+ // setting the framesize to less than 2 will lose the top gradient and look flat
+ if(dialog_->framesize->value() < 2)
+ {
+ dialog_->framesize->setValue(2);
+ }
+ emit changed();
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// load()
+// ------
+// Load configuration data
+
+void smoothblendConfig::load(KConfig*) {
+ config_->setGroup("General");
+
+ QString value = config_->readEntry("TitleAlignment", "AlignHCenter");
+ QRadioButton *button = (QRadioButton*)dialog_->titlealign->child(value.latin1());
+ if (button)
+ {
+ button->setChecked(true);
+ }
+
+ dialog_->titlesize->setValue( config_->readNumEntry("TitleSize",30 ) );
+ dialog_->buttonsize->setValue( config_->readNumEntry("ButtonSize",26 ) );
+ dialog_->framesize->setValue( config_->readNumEntry("FrameSize",4 ) );
+
+ bool cornersFlag = config_->readBoolEntry("RoundCorners", true);
+ dialog_->roundCorners->setChecked( cornersFlag );
+ bool titleshadow = config_->readBoolEntry("TitleShadow", true);
+ dialog_->titleshadow->setChecked(titleshadow);
+ bool animatebuttons = config_->readBoolEntry("AnimateButtons", true);
+ dialog_->animatebuttons->setChecked(animatebuttons);
+ dialog_->btnComboBox->setCurrentItem(config_->readNumEntry("ButtonComboBox",0));
+ bool menuClose = config_->readBoolEntry("CloseOnMenuDoubleClick");
+ dialog_->menuClose->setChecked(menuClose);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// save()
+// ------
+// Save configuration data
+
+void smoothblendConfig::save(KConfig*) {
+ config_->setGroup("General");
+
+ QRadioButton *button = (QRadioButton*)dialog_->titlealign->selected();
+ if (button)
+ {
+ config_->writeEntry("TitleAlignment", QString(button->name()));
+ }
+ config_->writeEntry("RoundCorners", dialog_->roundCorners->isChecked() );
+ config_->writeEntry("TitleSize", dialog_->titlesize->value() );
+ config_->writeEntry("ButtonSize", dialog_->buttonsize->value() );
+ config_->writeEntry("FrameSize", dialog_->framesize->value() );
+ config_->writeEntry("TitleShadow", dialog_->titleshadow->isChecked() );
+ config_->writeEntry("AnimateButtons", dialog_->animatebuttons->isChecked() );
+ config_->writeEntry("ButtonComboBox", dialog_->btnComboBox->currentItem());
+ config_->writeEntry("CloseOnMenuDoubleClick", dialog_->menuClose->isChecked() );
+
+ config_->sync();
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// defaults()
+// ----------
+// Set configuration defaults
+
+void smoothblendConfig::defaults() {
+ QRadioButton *button = (QRadioButton*)dialog_->titlealign->child("AlignHCenter");
+ if (button)
+ {
+ button->setChecked(true);
+ }
+ dialog_->roundCorners->setChecked( true );
+ dialog_->titlesize->setValue( 30 );
+ dialog_->buttonsize->setValue( 26 );
+ dialog_->framesize->setValue( 4 );
+ dialog_->titleshadow->setChecked( true );
+ dialog_->animatebuttons->setChecked( true );
+ dialog_->btnComboBox->setCurrentItem( 0 );
+ dialog_->menuClose->setChecked( false );
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// Plugin Stuff //
+//////////////////////////////////////////////////////////////////////////////
+
+extern "C" {
+ QObject* allocate_config(KConfig* config, QWidget* parent) {
+ return (new smoothblendConfig(config, parent));
+ }
+}
+
+#include "smoothblendconfig.moc"
diff --git a/kwin-styles/smooth-blend/client/config/smoothblendconfig.h b/kwin-styles/smooth-blend/client/config/smoothblendconfig.h
new file mode 100644
index 00000000..3c4d18f7
--- /dev/null
+++ b/kwin-styles/smooth-blend/client/config/smoothblendconfig.h
@@ -0,0 +1,55 @@
+//////////////////////////////////////////////////////////////////////////////
+// smoothblendconfig.h
+// -------------------
+// Config module for Smooth Blend window decoration
+// -------------------
+// Copyright (c) 2005 Ryan Nickell <p0z3r@users.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 the file COPYING. If not, write to
+// the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef SMOOTHBLENDCONFIG_H
+#define SMOOTHBLENDCONFIG_H
+
+#include <qobject.h>
+
+class KConfig;
+class ConfigDialog;
+
+class smoothblendConfig : public QObject {
+ Q_OBJECT
+public:
+ smoothblendConfig(KConfig* config, QWidget* parent);
+ ~smoothblendConfig();
+
+signals:
+ void changed();
+
+public slots:
+ void load(KConfig*);
+ void save(KConfig*);
+ void defaults();
+
+protected slots:
+ void selectionChanged(int);
+
+private:
+ KConfig *config_;
+ ConfigDialog *dialog_;
+};
+
+#endif // SMOOTHBLENDCONFIG_H
diff --git a/kwin-styles/smooth-blend/client/smoothblend.cc b/kwin-styles/smooth-blend/client/smoothblend.cc
new file mode 100644
index 00000000..9adb60ac
--- /dev/null
+++ b/kwin-styles/smooth-blend/client/smoothblend.cc
@@ -0,0 +1,1396 @@
+//////////////////////////////////////////////////////////////////////////////
+// smoothblend.cc
+// -------------------
+// Smooth Blend window decoration for KDE
+// -------------------
+// Copyright (c) 2005 Ryan Nickell
+// Please see the header file for copyright and license information.
+//////////////////////////////////////////////////////////////////////////////
+
+#include <kconfig.h>
+#include <kdeversion.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <klocale.h>
+#include <kpixmap.h>
+#include <kimageeffect.h>
+#include <kpixmapeffect.h>
+#include <kpixmap.h>
+
+#include <qbitmap.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qtooltip.h>
+#include <qtimer.h>
+#include <qapplication.h>
+
+#include "smoothblend.h"
+#include "buttons.h"
+
+using namespace smoothblend;
+
+//////////////////////////////////////////////////////////////////////////////
+// smoothblendFactory Class
+//////////////////////////////////////////////////////////////////////////////
+smoothblendFactory* factory=NULL;
+
+bool smoothblendFactory::initialized_ = false;
+Qt::AlignmentFlags smoothblendFactory::titlealign_ = Qt::AlignHCenter;
+bool smoothblendFactory::cornerflags_ = true;
+int smoothblendFactory::titlesize_ = 30;
+int smoothblendFactory::buttonsize_ = 26;
+int smoothblendFactory::framesize_ = 4;
+int smoothblendFactory::roundsize_ = 50;
+bool smoothblendFactory::titleshadow_ = true;
+bool smoothblendFactory::animatebuttons = true;
+int smoothblendFactory::btnComboBox = 0;
+bool smoothblendFactory::menuClose = false;
+
+// global constants
+static const int TOPMARGIN = 4; // do not change
+static const int DECOHEIGHT = 4; // do not change
+static const int SIDETITLEMARGIN = 2;
+// Default button layout
+const char default_left[] = "M";
+const char default_right[] = "HIAX";
+
+static const uint TIMERINTERVAL = 50; // msec
+static const uint ANIMATIONSTEPS = 4;
+
+extern "C" KDecorationFactory* create_factory() {
+ return new smoothblend::smoothblendFactory();
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// smoothblendFactory()
+// ----------------
+// Constructor
+
+smoothblendFactory::smoothblendFactory() {
+ readConfig();
+ initialized_ = true;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// ~smoothblendFactory()
+// -----------------
+// Destructor
+
+smoothblendFactory::~smoothblendFactory() {
+ initialized_ = false;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// createDecoration()
+// -----------------
+// Create the decoration
+
+KDecoration* smoothblendFactory::createDecoration(KDecorationBridge* b) {
+ return new smoothblendClient(b, this);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// reset()
+// -------
+// Reset the handler. Returns true if decorations need to be remade, false if
+// only a repaint is necessary
+
+bool smoothblendFactory::reset(unsigned long changed) {
+ // read in the configuration
+ initialized_ = false;
+ bool confchange = readConfig();
+ initialized_ = true;
+
+ if (confchange ||
+ (changed & (SettingDecoration | SettingButtons | SettingBorder))) {
+ return true;
+ } else {
+ resetDecorations(changed);
+ return false;
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// readConfig()
+// ------------
+// Read in the configuration file
+
+bool smoothblendFactory::readConfig() {
+ // create a config object
+ KConfig config("kwinsmoothblendrc");
+ config.setGroup("General");
+
+ // grab settings
+ QString value = config.readEntry("TitleAlignment", "AlignHCenter");
+ if (value == "AlignLeft")
+ titlealign_ = Qt::AlignLeft;
+ else if (value == "AlignHCenter")
+ titlealign_ = Qt::AlignHCenter;
+ else if (value == "AlignRight")
+ titlealign_ = Qt::AlignRight;
+
+ cornerflags_ = config.readBoolEntry("RoundCorners", true);
+ titlesize_ = config.readNumEntry("TitleSize",30);
+ buttonsize_ = config.readNumEntry("ButtonSize",26);
+ framesize_ = config.readNumEntry("FrameSize",4);
+ roundsize_ = config.readNumEntry("RoundPercent",50);
+ titleshadow_ = config.readBoolEntry("TitleShadow", true);
+ animatebuttons = config.readBoolEntry("AnimateButtons", true);
+ btnComboBox = config.readNumEntry("ButtonComboBox", 0);
+ menuClose = config.readBoolEntry("CloseOnMenuDoubleClick");
+
+ if(buttonsize_ > titlesize_ - framesize_)
+ {
+ buttonsize_ = titlesize_-framesize_;
+ }
+
+ return true;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// smoothblendButton Class
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+// smoothblendButton()
+// ---------------
+// Constructor
+smoothblendButton::smoothblendButton(smoothblendClient *parent, const char *name, const QString& tip, ButtonType type, int button_size, bool toggle): QButton(parent->widget(), name),
+ client_(parent),
+ type_(type),
+ size_(button_size),
+ deco_(0),
+ lastmouse_(NoButton),
+ hover_(false)
+{
+ setBackgroundMode(NoBackground);
+ setFixedSize( ::factory->buttonSize(), ::factory->buttonSize());
+ setCursor(arrowCursor);
+ QToolTip::add(this, tip);
+ setToggleButton(toggle);
+ //button animation setup
+ animTmr = new QTimer(this);
+ connect(animTmr, SIGNAL(timeout() ), this, SLOT(animate() ) );
+ connect(this, SIGNAL(pressed() ), this, SLOT(buttonClicked() ) );
+ connect(this, SIGNAL(released() ), this, SLOT(buttonReleased() ) );
+ animProgress = 0;
+ m_clicked=false;
+}
+
+smoothblendButton::~smoothblendButton() {
+ if ( deco_ )
+ delete deco_;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// sizeHint()
+// ----------
+// Return size hint
+
+QSize smoothblendButton::sizeHint() const {
+ return QSize(::factory->buttonSize(), ::factory->buttonSize());
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// buttonClicked()
+// ----------
+// Button animation progress reset so we don't get any leave event animation
+// when the mouse is still pressed
+void smoothblendButton::buttonClicked() {
+ m_clicked=true;
+ animProgress=0;
+}
+void smoothblendButton::buttonReleased() {
+ //This doesn't work b/c a released() signal is thrown when a leaveEvent occurs
+ //m_clicked=false;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// animate()
+// ----------
+// Button animation timing
+void smoothblendButton::animate() {
+ animTmr->stop();
+
+ if(hover_) {
+ if(animProgress < ANIMATIONSTEPS) {
+ if (::factory->animateButtons() ) {
+ animProgress++;
+ } else {
+ animProgress = ANIMATIONSTEPS;
+ }
+ animTmr->start(TIMERINTERVAL, true); // single-shot
+ }
+ } else {
+ if(animProgress > 0) {
+ if (::factory->animateButtons() ) {
+ animProgress--;
+ } else {
+ animProgress = 0;
+ }
+ animTmr->start(TIMERINTERVAL, true); // single-shot
+ }
+ }
+ repaint(false);
+}
+//////////////////////////////////////////////////////////////////////////////
+// enterEvent()
+// ------------
+// Mouse has entered the button
+
+void smoothblendButton::enterEvent(QEvent *e) {
+ // we wanted to pass on the event
+ QButton::enterEvent(e);
+ // we want to do mouseovers, so keep track of it here
+ hover_=true;
+ if(!m_clicked)
+ {
+ animate();
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// leaveEvent()
+// ------------
+// Mouse has left the button
+
+void smoothblendButton::leaveEvent(QEvent *e) {
+ // we wanted to pass on the event
+ QButton::leaveEvent(e);
+ // we want to do mouseovers, so keep track of it here
+ hover_=false;
+ if(!m_clicked)
+ {
+ animate();
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// mousePressEvent()
+// -----------------
+// Button has been pressed
+
+void smoothblendButton::mousePressEvent(QMouseEvent* e) {
+ lastmouse_ = e->button();
+
+ // translate and pass on mouse event
+ int button = LeftButton;
+ if ((type_ != ButtonMax) && (e->button() != LeftButton)) {
+ button = NoButton; // middle & right buttons inappropriate
+ }
+ QMouseEvent me(e->type(), e->pos(), e->globalPos(),
+ button, e->state());
+ QButton::mousePressEvent(&me);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// mouseReleaseEvent()
+// -----------------
+// Button has been released
+
+void smoothblendButton::mouseReleaseEvent(QMouseEvent* e) {
+ lastmouse_ = e->button();
+
+ // translate and pass on mouse event
+ int button = LeftButton;
+ if ((type_ != ButtonMax) && (e->button() != LeftButton)) {
+ button = NoButton; // middle & right buttons inappropriate
+ }
+ QMouseEvent me(e->type(), e->pos(), e->globalPos(), button, e->state());
+ QButton::mouseReleaseEvent(&me);
+ if(m_clicked)
+ {
+ m_clicked=false;
+ }
+}
+
+void smoothblendButton::setOn(bool on)
+{
+ QButton::setOn(on);
+}
+
+void smoothblendButton::setDown(bool on)
+{
+ QButton::setDown(on);
+}
+
+//////////////////////////////////////////////////////////
+// getButtonImage()
+// ----------------
+// get the button QImage based on type and window mode
+QImage smoothblendButton::getButtonImage(ButtonType type)
+{
+ QImage finalImage;
+ switch(type) {
+ case ButtonClose:
+ finalImage = uic_findImage( "close.png" );
+ break;
+ case ButtonHelp:
+ finalImage = uic_findImage( "help.png" );
+ break;
+ case ButtonMin:
+ finalImage = uic_findImage( "minimize.png" );
+ break;
+ case ButtonMax:
+ if(client_->maximizeMode() == KDecorationDefines::MaximizeFull)
+ {
+ finalImage = uic_findImage( "restore.png" );
+ }
+ else
+ {
+ finalImage = uic_findImage( "maximize.png" );
+ }
+ break;
+ case ButtonSticky:
+ if(client_->isOnAllDesktops())
+ {
+ finalImage = uic_findImage( "splat.png" );
+ }
+ else
+ {
+ finalImage = uic_findImage( "circle.png" );
+ }
+ break;
+ case ButtonShade:
+ if(client_->isShade())
+ {
+ finalImage = uic_findImage( "shade.png" );
+ }
+ else
+ {
+ finalImage = uic_findImage( "shade.png" );
+ }
+ break;
+ case ButtonAbove:
+ if(client_->keepAbove())
+ {
+ finalImage = uic_findImage( "keep_above_lit.png" );
+ }
+ else
+ {
+ finalImage = uic_findImage( "keep_above.png" );
+ }
+ break;
+ case ButtonBelow:
+ if(client_->keepBelow())
+ {
+ finalImage = uic_findImage( "keep_below_lit.png" );
+ }
+ else
+ {
+ finalImage = uic_findImage( "keep_below.png" );
+ }
+ break;
+ default:
+ finalImage = uic_findImage( "splat.png" );
+ break;
+ }
+ return finalImage;
+}
+
+//////////////////////////////////////////////////////////
+// drawButton()
+// -------------------------
+// draw the pixmap button
+
+void smoothblendButton::drawButton( QPainter *painter ) {
+ if ( !smoothblendFactory::initialized() )
+ return ;
+
+ int newWidth = width() - 2;
+ int newHeight = height() - 2;
+ int dx = (width() - newWidth) / 2;
+ int dy = (height() - newHeight) / 2;
+ QImage tmpResult;
+ QColorGroup group;
+ QColor redColor(red);
+ bool active = client_->isActive();
+ QPixmap backgroundTile = client_->getTitleBarTile(active);
+ group = KDecoration::options()->colorGroup(KDecoration::ColorTitleBar, active);
+
+ //draw the titlebar behind the buttons and app icons
+ if ((client_->maximizeMode()==client_->MaximizeFull) && !KDecoration::options()->moveResizeMaximizedWindows())
+ {
+ painter->drawTiledPixmap(0, 0, width(), height(), backgroundTile);
+ }
+ else
+ {
+ painter->drawTiledPixmap(0, 0, width(), height(), backgroundTile, 0, y()-::factory->frameSize());
+ }
+
+ QImage buttonImage = getButtonImage(type_).smoothScale( width(),height());
+ buttonImage = KImageEffect::blend( group.background(), buttonImage, .50);
+ if (type_ == ButtonMenu) {
+ //slight movement to show the menu button is depressed
+ if (isDown()) {
+ dx++;
+ dy++;
+ }
+ QPixmap menuButtonPixmap(client_->icon().pixmap(QIconSet::Large, QIconSet::Normal));
+ QImage menuButtonImage(menuButtonPixmap.convertToImage());
+ //draw the menu button the same size as the other buttons
+ //using QIconSet::Large gives us a 32x32 icon to resize, resizing larger than
+ //that may produce pixilation of the image
+ painter->drawImage( dx, dy, menuButtonImage.smoothScale(newWidth, newHeight) );
+ } else {
+ //highlight on a mouse over repaint
+ double factor = animProgress * 0.13;
+
+ if(!isDown())
+ {
+ switch(::factory->getBtnComboBox())
+ {
+ case 0:
+ tmpResult = KImageEffect::intensity( buttonImage, factor);
+ break;
+ case 1:
+ tmpResult = KImageEffect::fade( buttonImage, factor, group.background());
+ break;
+ }
+ }
+ else
+ {
+ tmpResult = buttonImage;
+ }
+ painter->drawPixmap( 0, 0, QPixmap( tmpResult ) );
+ }
+}
+
+
+//////////////////////////////////////////////////////////////////////////////
+// smoothblendClient Class
+//////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////
+// smoothblendClient()
+// ---------------
+// Constructor
+
+smoothblendClient::smoothblendClient(KDecorationBridge *b, KDecorationFactory *f)
+ : KDecoration(b, f),
+ mainLayout_(0),
+ titleLayout_(0),
+ topSpacer_(0),
+ titleSpacer_(0),
+ leftTitleSpacer_(0), rightTitleSpacer_(0),
+ decoSpacer_(0),
+ leftSpacer_(0), rightSpacer_(0),
+ bottomSpacer_(0), windowSpacer_(0),
+ aCaptionBuffer(0), iCaptionBuffer(0),
+ aTitleBarTile(0), iTitleBarTile(0), aTitleBarTopTile(0), iTitleBarTopTile(0),
+ pixmaps_created(false),
+ //captionBufferDirty(true),
+ s_titleHeight(0),
+ s_titleFont(QFont()),
+ closing(false)
+ {
+ aCaptionBuffer = new QPixmap();
+ iCaptionBuffer = new QPixmap();
+ //s_titleFont = isTool()?smoothblendFactory::titleFontTool():smoothblendFactory::titleFont();
+ s_titleFont = options()->font();
+ s_titleHeight = smoothblendFactory::titleSize();
+ }
+//////////////////////////////////////////////////////////////////////////////////
+// ~smoothblendClient()
+// --------------------
+// Destructor
+smoothblendClient::~smoothblendClient() {
+ delete aCaptionBuffer;
+ delete iCaptionBuffer;
+}
+
+void smoothblendClient::create_pixmaps() {
+ if(pixmaps_created)
+ return;
+ KPixmap tempPixmap;
+ QPainter painter;
+ QColorGroup group,widgetGroup;
+ int FRAMESIZE = ::factory->frameSize();
+ // Get the color groups we need for the gradients
+ group = options()->colorGroup(KDecoration::ColorTitleBar, true);
+ widgetGroup = widget()->colorGroup();
+
+ // active top title bar tile
+ tempPixmap.resize(1, TOPMARGIN);
+ tempPixmap = KPixmapEffect::unbalancedGradient(tempPixmap,
+ group.background(),
+ widgetGroup.background(),
+ KPixmapEffect::VerticalGradient,
+ 100,
+ -100);
+ aTitleBarTopTile = new QPixmap(1, TOPMARGIN);
+ painter.begin(aTitleBarTopTile);
+ painter.drawPixmap(0, 0, tempPixmap);
+ painter.end();
+
+ // inactive top title bar tile
+ group = options()->colorGroup(KDecoration::ColorTitleBar, false);
+ tempPixmap = KPixmapEffect::unbalancedGradient(tempPixmap,
+ group.background(),
+ widgetGroup.background(),
+ KPixmapEffect::VerticalGradient,
+ 100,
+ -100);
+ iTitleBarTopTile = new QPixmap(1, TOPMARGIN);
+ painter.begin(iTitleBarTopTile);
+ painter.drawPixmap(0, 0, tempPixmap);
+ painter.end();
+
+ // active title bar tile
+ tempPixmap.resize(1, s_titleHeight+FRAMESIZE);
+ group = options()->colorGroup(KDecoration::ColorTitleBar, true);
+ tempPixmap = KPixmapEffect::unbalancedGradient(tempPixmap,
+ group.background(),
+ widgetGroup.background(),
+ KPixmapEffect::VerticalGradient,
+ 100,
+ 200);
+ aTitleBarTile = new QPixmap(1, s_titleHeight+FRAMESIZE);
+ painter.begin(aTitleBarTile);
+ painter.drawPixmap(0, 0, tempPixmap);
+ painter.end();
+
+ // inactive title bar tile
+ group = options()->colorGroup(KDecoration::ColorTitleBar, false);
+ tempPixmap = KPixmapEffect::unbalancedGradient(tempPixmap,
+ group.background(),
+ widgetGroup.background(),
+ KPixmapEffect::VerticalGradient,
+ 100,
+ 200);
+ iTitleBarTile = new QPixmap(1, s_titleHeight+FRAMESIZE);
+ painter.begin(iTitleBarTile);
+ painter.drawPixmap(0, 0, tempPixmap);
+ painter.end();
+
+ pixmaps_created = true;
+}
+
+void smoothblendClient::delete_pixmaps() {
+ delete aTitleBarTopTile;
+ aTitleBarTopTile = 0;
+
+ delete iTitleBarTopTile;
+ iTitleBarTopTile = 0;
+
+ delete aTitleBarTile;
+ aTitleBarTile = 0;
+
+ delete iTitleBarTile;
+ iTitleBarTile = 0;
+
+ pixmaps_created = false;
+}
+//////////////////////////////////////////////////////////////////////////////
+// init()
+// ------
+// Actual initializer for class
+
+void smoothblendClient::init() {
+ createMainWidget(WResizeNoErase | WRepaintNoErase);
+ widget()->installEventFilter(this);
+ handlebar = ::factory->frameSize() < 4 ? 4 - ::factory->frameSize() : 0;
+ // for flicker-free redraws
+ widget()->setBackgroundMode(NoBackground);
+
+ _resetLayout();
+
+ create_pixmaps();
+}
+void smoothblendClient::_resetLayout()
+{
+ // basic layout:
+ // _______________________________________________________________
+ // | topSpacer |
+ // |_______________________________________________________________|
+ // | leftTitleSpacer | btns | titlebar | bts | rightTitleSpacer |
+ // |_________________|______|_____________|_____|__________________|
+ // | decoSpacer |
+ // |_______________________________________________________________|
+ // | | | |
+ // | | windowWrapper | |
+ // | | | |
+ // |leftSpacer rightSpacer|
+ // |_|___________________________________________________________|_|
+ // | bottomSpacer |
+ // |_______________________________________________________________|
+ //
+ if (!::factory->initialized()) return;
+
+ delete mainLayout_;
+ delete titleLayout_;
+ delete topSpacer_;
+ delete titleSpacer_;
+ delete leftTitleSpacer_;
+ delete rightTitleSpacer_;
+ delete decoSpacer_;
+ delete leftSpacer_;
+ delete rightSpacer_;
+ delete bottomSpacer_;
+ delete windowSpacer_;
+
+ mainLayout_ = new QVBoxLayout(widget());
+ // title
+ titleLayout_ = new QHBoxLayout();
+ QHBoxLayout *windowLayout_ = new QHBoxLayout();
+ int FRAMESIZE = ::factory->frameSize();
+
+ topSpacer_ = new QSpacerItem(1, FRAMESIZE, QSizePolicy::Expanding, QSizePolicy::Fixed);
+ titlebar_ = new QSpacerItem(1, ::factory->buttonSize(),
+ QSizePolicy::Expanding, QSizePolicy::Fixed);
+ leftTitleSpacer_ = new QSpacerItem(FRAMESIZE, s_titleHeight,
+ QSizePolicy::Fixed, QSizePolicy::Fixed);
+ rightTitleSpacer_ = new QSpacerItem(FRAMESIZE, s_titleHeight,
+ QSizePolicy::Fixed, QSizePolicy::Fixed);
+ decoSpacer_ = new QSpacerItem(1, FRAMESIZE, QSizePolicy::Expanding, QSizePolicy::Fixed);
+ leftSpacer_ = new QSpacerItem(::factory->frameSize(), 1,
+ QSizePolicy::Fixed, QSizePolicy::Expanding);
+ rightSpacer_ = new QSpacerItem(::factory->frameSize(), 1,
+ QSizePolicy::Fixed, QSizePolicy::Expanding);
+ bottomSpacer_ = new QSpacerItem(1, ::factory->frameSize(),
+ QSizePolicy::Expanding, QSizePolicy::Fixed);
+
+ // sizeof(...) is calculated at compile time
+ memset(button, 0, sizeof(smoothblendButton *) * ButtonTypeCount);
+
+ // message in preview widget
+ if (isPreview()) {
+ windowLayout_->addWidget(
+ new QLabel( i18n("<b><center>Smooth Blend</center></b>"), widget() ), 1 );
+ } else {
+ windowLayout_->addItem(new QSpacerItem(0, 0));
+ }
+
+ // setup titlebar buttons
+ for (int n=0; n<ButtonTypeCount; n++)
+ button[n] = 0;
+ //Deal with the title and buttons
+ titleLayout_->addItem(leftTitleSpacer_);
+ addButtons(titleLayout_,
+ options()->customButtonPositions() ? options()->titleButtonsLeft() : QString(default_left),
+ ::factory->titleSize()-1);
+ titleLayout_->addItem(titlebar_);
+ addButtons(titleLayout_,
+ options()->customButtonPositions() ? options()->titleButtonsRight() : QString(default_right),
+ ::factory->titleSize()-1);
+ titleLayout_->addItem(rightTitleSpacer_);
+
+ //Mid - left side, middle contents and right side
+ QHBoxLayout * midLayout_ = new QHBoxLayout();
+ midLayout_->addItem(leftSpacer_);
+ midLayout_->addLayout(windowLayout_);
+ midLayout_->addItem(rightSpacer_);
+
+ //Layout order
+ mainLayout_->addItem( topSpacer_ );
+ mainLayout_->addLayout( titleLayout_ );
+ mainLayout_->addItem( decoSpacer_ );
+ mainLayout_->addLayout( midLayout_ );
+ mainLayout_->addItem( bottomSpacer_ );
+
+ // connections
+ connect(this, SIGNAL(keepAboveChanged(bool)), SLOT(keepAboveChange(bool)));
+ connect(this, SIGNAL(keepBelowChanged(bool)), SLOT(keepBelowChange(bool)));
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// addButtons()
+// ------------
+// Add buttons to title layout
+
+void smoothblendClient::addButtons(QBoxLayout *layout, const QString& s, int button_size) {
+ QString tip;
+ if (s.length() > 0) {
+ for (unsigned n=0; n < s.length(); n++) {
+ switch (s[n]) {
+ case 'M': // Menu button
+ if (!button[ButtonMenu]) {
+ button[ButtonMenu] =
+ new smoothblendButton(this, "splat.png", i18n("Menu"),ButtonMenu,button_size);
+ connect(button[ButtonMenu], SIGNAL(pressed()), this, SLOT(menuButtonPressed()));
+ connect(button[ButtonMenu], SIGNAL(released()), this, SLOT(menuButtonReleased()));
+ layout->addWidget(button[ButtonMenu]);
+ if (n < s.length()-1) layout->addSpacing(1);
+ }
+ break;
+
+ case 'S': // Sticky button
+ if (!button[ButtonSticky]) {
+ if (isOnAllDesktops()) {
+ tip = i18n("Un-Sticky");
+ } else {
+ tip = i18n("Sticky");
+ }
+ button[ButtonSticky] =
+ new smoothblendButton(this, "circle.png", tip, ButtonSticky, button_size, true);
+ connect(button[ButtonSticky], SIGNAL(clicked()),
+ this, SLOT(toggleOnAllDesktops()));
+ layout->addWidget(button[ButtonSticky]);
+ if (n < s.length()-1) layout->addSpacing(1);
+ }
+ break;
+
+ case 'H': // Help button
+ if ((!button[ButtonHelp]) && providesContextHelp()) {
+ button[ButtonHelp] =
+ new smoothblendButton(this, "help.png", i18n("Help"), ButtonHelp, button_size);
+ connect(button[ButtonHelp], SIGNAL(clicked()),
+ this, SLOT(showContextHelp()));
+ layout->addWidget(button[ButtonHelp]);
+ if (n < s.length()-1) layout->addSpacing(1);
+ }
+ break;
+
+ case 'I': // Minimize button
+ if ((!button[ButtonMin]) && isMinimizable()) {
+ button[ButtonMin] =
+ new smoothblendButton(this, "minimize.png", i18n("Minimize"), ButtonMin, button_size);
+ connect(button[ButtonMin], SIGNAL(clicked()),
+ this, SLOT(minimize()));
+ layout->addWidget(button[ButtonMin]);
+ if (n < s.length()-1) layout->addSpacing(1);
+ }
+ break;
+
+ case 'A': // Maximize button
+ if ((!button[ButtonMax]) && isMaximizable()) {
+ if (maximizeMode() == MaximizeFull) {
+ tip = i18n("Restore");
+ } else {
+ tip = i18n("Maximize");
+ }
+ button[ButtonMax] =
+ new smoothblendButton(this, "maximize.png", tip, ButtonMax, button_size, true);
+ connect(button[ButtonMax], SIGNAL(clicked()),
+ this, SLOT(maxButtonPressed()));
+ layout->addWidget(button[ButtonMax]);
+ if (n < s.length()-1) layout->addSpacing(1);
+ }
+ break;
+
+ case 'X': // Close button
+ if ((!button[ButtonClose]) && isCloseable()) {
+ button[ButtonClose] =
+ new smoothblendButton(this, "close.png", i18n("Close"), ButtonClose, button_size);
+ connect(button[ButtonClose], SIGNAL(clicked()),
+ this, SLOT(closeWindow()));
+ layout->addWidget(button[ButtonClose]);
+ if (n < s.length()-1) layout->addSpacing(1);
+ }
+ break;
+
+ case 'F': // Above button
+ if ((!button[ButtonAbove])) {
+ button[ButtonAbove] =
+ new smoothblendButton(this, "keep_above.png",
+ i18n("Keep Above Others"), ButtonAbove, button_size, true);
+ connect(button[ButtonAbove], SIGNAL(clicked()),
+ this, SLOT(aboveButtonPressed()));
+ layout->addWidget(button[ButtonAbove]);
+ if (n < s.length()-1) layout->addSpacing(1);
+ }
+ break;
+
+ case 'B': // Below button
+ if ((!button[ButtonBelow])) {
+ button[ButtonBelow] =
+ new smoothblendButton(this, "keep_below.png",
+ i18n("Keep Below Others"), ButtonBelow, button_size, true);
+ connect(button[ButtonBelow], SIGNAL(clicked()),
+ this, SLOT(belowButtonPressed()));
+ layout->addWidget(button[ButtonBelow]);
+ if (n < s.length()-1) layout->addSpacing(1);
+ }
+ break;
+
+ case 'L': // Shade button
+ if ((!button[ButtonShade]) && isShadeable()) {
+ if ( isSetShade()) {
+ tip = i18n("Unshade");
+ } else {
+ tip = i18n("Shade");
+ }
+ button[ButtonShade] =
+ new smoothblendButton(this, "shade.png", tip, ButtonShade, button_size, true);
+ connect(button[ButtonShade], SIGNAL(clicked()),
+ this, SLOT(shadeButtonPressed()));
+ layout->addWidget(button[ButtonShade]);
+ if (n < s.length()-1) layout->addSpacing(1);
+ }
+ break;
+
+ case '_': // Spacer item
+ layout->addSpacing(::factory->frameSize());
+ }
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// activeChange()
+// --------------
+// window active state has changed
+
+void smoothblendClient::activeChange() {
+ for (int n=0; n<ButtonTypeCount; n++)
+ if (button[n])
+ button[n]->reset();
+ widget()->repaint(false);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// captionChange()
+// ---------------
+// The title has changed
+
+void smoothblendClient::captionChange() {
+ widget()->repaint(titlebar_->geometry(), false);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// desktopChange()
+// ---------------
+// Called when desktop/sticky changes
+
+void smoothblendClient::desktopChange() {
+ bool d = isOnAllDesktops();
+ if (button[ButtonSticky]) {
+ QToolTip::remove(button[ButtonSticky]);
+ QToolTip::add(button[ButtonSticky], d ? i18n("Un-Sticky") : i18n("Sticky"));
+ button[ButtonSticky]->repaint(false);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// iconChange()
+// ------------
+// The title has changed
+
+void smoothblendClient::iconChange() {
+ if (button[ButtonMenu]) {
+ button[ButtonMenu]->repaint(false);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// maximizeChange()
+// ----------------
+// Maximized state has changed
+
+void smoothblendClient::maximizeChange() {
+ bool m = (maximizeMode() == MaximizeFull);
+ if (button[ButtonMax]) {
+ QToolTip::remove(button[ButtonMax]);
+ QToolTip::add(button[ButtonMax], m ? i18n("Restore") : i18n("Maximize"));
+ button[ButtonMax]->repaint(false);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// shadeChange()
+// -------------
+// Called when window shading changes
+
+void smoothblendClient::shadeChange() {
+ bool s = isSetShade();
+ if (button[ButtonShade]) {
+ QToolTip::remove(button[ButtonShade]);
+ QToolTip::add(button[ButtonShade], s ? i18n("Unshade") : i18n("Shade"));
+ button[ButtonShade]->repaint(false);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// keepAboveChange()
+// ------------
+// The above state has changed
+
+void smoothblendClient::keepAboveChange(bool a) {
+ if (button[ButtonAbove]) {
+ button[ButtonAbove]->setOn(a);
+ button[ButtonAbove]->repaint(false);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// keepBelowChange()
+// ------------
+// The below state has changed
+
+void smoothblendClient::keepBelowChange(bool b) {
+ if (button[ButtonBelow]) {
+ button[ButtonBelow]->setOn(b);
+ button[ButtonBelow]->repaint(false);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// borders()
+// ----------
+// Get the size of the borders
+
+void smoothblendClient::borders(int &left, int &right, int &top, int &bottom) const {
+ int FRAMESIZE = ::factory->frameSize();
+
+ if ((maximizeMode()==MaximizeFull) && !options()->moveResizeMaximizedWindows()) {
+ left = right = bottom = 0;
+ top = ::factory->buttonSize();
+
+ // update layout etc.
+ topSpacer_->changeSize(1, 0, QSizePolicy::Expanding, QSizePolicy::Fixed);
+ decoSpacer_->changeSize(1, 0, QSizePolicy::Expanding, QSizePolicy::Fixed);
+ leftSpacer_->changeSize(left, 1, QSizePolicy::Fixed, QSizePolicy::Expanding);
+ leftTitleSpacer_->changeSize(left, top, QSizePolicy::Fixed, QSizePolicy::Fixed);
+ rightSpacer_->changeSize(right, 1, QSizePolicy::Fixed, QSizePolicy::Expanding);
+ rightTitleSpacer_->changeSize(right, top, QSizePolicy::Fixed, QSizePolicy::Fixed);
+ bottomSpacer_->changeSize(1, bottom, QSizePolicy::Expanding, QSizePolicy::Fixed);
+ } else {
+ left = right = bottom = ::factory->frameSize();
+ top = ::factory->titleSize() + (FRAMESIZE*2);
+
+ // update layout etc.
+ topSpacer_->changeSize(1, FRAMESIZE, QSizePolicy::Expanding, QSizePolicy::Fixed);
+ decoSpacer_->changeSize(1, FRAMESIZE, QSizePolicy::Expanding, QSizePolicy::Fixed);
+ leftSpacer_->changeSize(left, 1, QSizePolicy::Fixed, QSizePolicy::Expanding);
+ leftTitleSpacer_->changeSize(left, s_titleHeight, QSizePolicy::Fixed, QSizePolicy::Fixed);
+ rightSpacer_->changeSize(right, 1, QSizePolicy::Fixed, QSizePolicy::Expanding);
+ rightTitleSpacer_->changeSize(right,s_titleHeight,QSizePolicy::Fixed, QSizePolicy::Fixed);
+ bottomSpacer_->changeSize(1, bottom, QSizePolicy::Expanding, QSizePolicy::Fixed);
+ }
+ widget()->layout()->activate();
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// resize()
+// --------
+// Called to resize the window
+
+void smoothblendClient::resize(const QSize &size) {
+ widget()->resize(size);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// minimumSize()
+// -------------
+// Return the minimum allowable size for this window
+
+QSize smoothblendClient::minimumSize() const {
+ return widget()->minimumSize();
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// mousePosition()
+// ---------------
+// Return logical mouse position
+
+KDecoration::Position smoothblendClient::mousePosition(const QPoint &point) const {
+ const int corner = 24;
+ Position pos;
+ int fs = ::factory->frameSize() + handlebar;
+ //int fs = ::factory->frameSize();
+
+ if (point.y() <= fs) {
+ // inside top frame
+ if (point.x() <= corner)
+ pos = PositionTopLeft;
+ else if (point.x() >= (width()-corner))
+ pos = PositionTopRight;
+ else
+ pos = PositionTop;
+ } else if (point.y() >= (height()-fs*2)) {
+ // inside handle
+ if (point.x() <= corner)
+ pos = PositionBottomLeft;
+ else if (point.x() >= (width()-corner))
+ pos = PositionBottomRight;
+ else
+ pos = PositionBottom;
+ } else if (point.x() <= fs ) {
+ // on left frame
+ if (point.y() <= corner)
+ pos = PositionTopLeft;
+ else if (point.y() >= (height()-corner))
+ pos = PositionBottomLeft;
+ else
+ pos = PositionLeft;
+ } else if (point.x() >= width()-fs) {
+ // on right frame
+ if (point.y() <= corner)
+ pos = PositionTopRight;
+ else if (point.y() >= (height()-corner))
+ pos = PositionBottomRight;
+ else
+ pos = PositionRight;
+ } else {
+ // inside the frame
+ pos = PositionCenter;
+ }
+ return pos;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// eventFilter()
+// -------------
+// Event filter
+
+bool smoothblendClient::eventFilter(QObject *obj, QEvent *e) {
+ if (obj != widget())
+ return false;
+
+ switch (e->type()) {
+ case QEvent::MouseButtonDblClick: {
+ mouseDoubleClickEvent(static_cast<QMouseEvent *>(e));
+ return true;
+ }
+ case QEvent::MouseButtonPress: {
+ processMousePressEvent(static_cast<QMouseEvent *>(e));
+ return true;
+ }
+ case QEvent::Paint: {
+ paintEvent(static_cast<QPaintEvent *>(e));
+ return true;
+ }
+ case QEvent::Resize: {
+ resizeEvent(static_cast<QResizeEvent *>(e));
+ return true;
+ }
+ case QEvent::Show: {
+ showEvent(static_cast<QShowEvent *>(e));
+ return true;
+ }
+ case QEvent::Wheel: {
+ wheelEvent( static_cast< QWheelEvent* >( e ));
+ return true;
+ }
+ default: {
+ return false;
+ }
+ }
+
+ return false;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// mouseDoubleClickEvent()
+// -----------------------
+// Doubleclick on title
+
+void smoothblendClient::mouseDoubleClickEvent(QMouseEvent *e) {
+ if (titlebar_->geometry().contains(e->pos()))
+ titlebarDblClickOperation();
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// wheelEvent()
+// ------------
+// Mouse wheel on titlebar
+
+void smoothblendClient::wheelEvent(QWheelEvent *e)
+{
+ if (titleLayout_->geometry().contains(e->pos()) )
+ titlebarMouseWheelOperation( e->delta());
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// paintEvent()
+// ------------
+// Repaint the window
+
+void smoothblendClient::paintEvent(QPaintEvent*) {
+ if (!::factory->initialized())
+ {
+ return;
+ }
+
+ //int FRAMESIZE = ::factory->frameSize();
+ const uint maxCaptionLength = 300; // truncate captions longer than this!
+ QString captionText(caption());
+ if (captionText.length() > maxCaptionLength) {
+ captionText.truncate(maxCaptionLength);
+ captionText.append(" [...]");
+ }
+
+ QColor blackColor(black);
+ QColor redColor(red);
+ QColorGroup group,widgetGroup;
+ QPainter painter(widget());
+ bool active = isActive();
+ //get group information first
+ group = options()->colorGroup(KDecoration::ColorTitleBar, isActive());
+ widgetGroup = widget()->colorGroup();
+
+ QRect topRect( topSpacer_->geometry() );
+ QRect titleRect( titleLayout_->geometry() );
+ QRect textRect( titlebar_->geometry() );
+ QRect Rltitle( leftTitleSpacer_->geometry() );
+ QRect Rrtitle( rightTitleSpacer_->geometry() );
+ QRect Rdeco( decoSpacer_->geometry() );
+ QRect Rleft( leftSpacer_->geometry() );
+ QRect Rright( rightSpacer_->geometry() );
+ QRect Rbottom( bottomSpacer_->geometry() );
+ QRect tempRect;
+
+
+ /*
+ if(active)
+ {
+ qDebug("paintEvent() topRect.y() = %i\tbottom() = %i",topRect.top(),topRect.bottom());
+ qDebug("paintEvent() titleRect.y() = %i\tbottom() = %i",titleRect.top(),titleRect.bottom());
+ qDebug("paintEvent() textRect.y() = %i\tbottom() = %i",textRect.top(),textRect.bottom());
+ qDebug("paintEvent() Rltitle.y() = %i\tbottom() = %i",Rltitle.top(),Rltitle.bottom());
+ qDebug("paintEvent() Rrtitle.y() = %i\tbottom() = %i",Rrtitle.top(),Rrtitle.bottom());
+ qDebug("paintEvent() Rdeco.y() = %i\tbottom() = %i",Rdeco.top(),Rdeco.bottom());
+ qDebug("paintEvent() Rleft.y() = %i\tbottom() = %i",Rleft.top(),Rleft.bottom());
+ qDebug("paintEvent() Rright.y() = %i\tbottom() = %i",Rright.top(),Rright.bottom());
+ qDebug("paintEvent() Rbottom.y() = %i\tbottom() = %i",Rbottom.top(),Rbottom.bottom());
+ }
+ */
+
+ // top
+ painter.drawTiledPixmap(topRect, active ? *aTitleBarTopTile:*iTitleBarTopTile);
+ painter.drawTiledPixmap(titleRect.x(),
+ titleRect.y(),
+ titleRect.width(),
+ titleRect.height() + Rdeco.height(),
+ active ? *aTitleBarTile:*iTitleBarTile);
+
+ textRect.setRect(textRect.x()+SIDETITLEMARGIN,
+ textRect.y(),
+ textRect.width()-SIDETITLEMARGIN*2,
+ textRect.height());
+ QRect shadowRect(textRect.x()+1,textRect.y()+1,textRect.width(),textRect.height());
+ //if we are shadowing title bar text
+ if(::factory->titleShadow())
+ {
+ //shadow text
+ painter.setFont(options()->font(isActive(), false));
+ painter.setPen(blackColor);
+ painter.drawText(shadowRect,
+ ::factory->titleAlign() | AlignVCenter | Qt::SingleLine,
+ captionText);
+ }
+ // draw title text
+ painter.setFont(options()->font(isActive(), false));
+ painter.setPen(options()->color(KDecoration::ColorFont, isActive()));
+ painter.drawText(textRect,
+ ::factory->titleAlign() | AlignVCenter | Qt::SingleLine,
+ captionText);
+
+ //left of buttons and title
+ painter.drawTiledPixmap(Rltitle.x(),
+ Rltitle.y(),
+ Rltitle.width(),
+ Rltitle.height()+Rdeco.height(),
+ active ? *aTitleBarTile:*iTitleBarTile);
+ // left mid layout
+ painter.fillRect(Rleft,widgetGroup.background());
+
+ // right of buttons and title
+ painter.drawTiledPixmap(Rrtitle.x(),
+ Rrtitle.y(),
+ Rrtitle.width(),
+ Rrtitle.height()+Rdeco.height(),
+ active ? *aTitleBarTile:*iTitleBarTile);
+ // right mid layout
+ painter.fillRect(Rright,widgetGroup.background());
+
+ // bottom
+ /*
+ if(isShade())
+ {
+ frame.setRect(0,::factory->titleSize()+FRAMESIZE, width(), FRAMESIZE);
+ }
+ else
+ {
+ frame.setRect(0, height() - (FRAMESIZE*2), width(), (FRAMESIZE*2));
+ }
+ */
+ painter.fillRect(Rbottom, widgetGroup.background());
+
+ //draw a line between title bar and window contents
+ painter.setPen(group.background());
+
+ // outline outside the frame but not the corners if they are rounded
+ tempRect = widget()->rect();
+ painter.drawRect(tempRect);
+
+ bool cornersFlag = ::factory->roundedCorners();
+ if(cornersFlag) {
+ // local temp right and bottom
+ int r(width());
+ painter.setPen(group.background());
+ painter.drawPoint(4, 1);
+ painter.drawPoint(3, 1);
+ painter.drawPoint(2, 2);
+ painter.drawPoint(1, 3);
+ painter.drawPoint(1, 4);
+ painter.drawPoint(r - 5, 1);
+ painter.drawPoint(r - 4, 1);
+ painter.drawPoint(r - 3, 2);
+ painter.drawPoint(r - 2, 3);
+ painter.drawPoint(r - 2, 4);
+ }
+
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// updateMask()
+// ------------
+// update the frame mask
+void smoothblendClient::updateMask() {
+ bool cornersFlag = ::factory->roundedCorners();
+ if ( (!options()->moveResizeMaximizedWindows() && maximizeMode() == MaximizeFull ) )
+ {
+ setMask(QRegion(widget()->rect()));
+ return;
+ }
+
+ int r(width());
+ int b(height());
+ QRegion mask;
+
+ mask=QRegion(widget()->rect());
+
+ // Remove top-left corner.
+ if(cornersFlag) {
+ mask -= QRegion(0, 0, 5, 1);
+ mask -= QRegion(0, 1, 3, 1);
+ mask -= QRegion(0, 2, 2, 1);
+ mask -= QRegion(0, 3, 1, 2);
+ mask -= QRegion(r - 5, 0, 5, 1);
+ mask -= QRegion(r - 3, 1, 3, 1);
+ mask -= QRegion(r - 2, 2, 2, 1);
+ mask -= QRegion(r - 1, 3, 1, 2);
+ }
+ //always remove one corner pixel so it simulates a soft corner like plastik
+ mask -= QRegion(0,0,1,1);
+ mask -= QRegion(r-1,0,1,1);
+ mask -= QRegion(0, b-1, 1,1);
+ mask -= QRegion(r-1,b-1,1,1);
+
+ setMask(mask);
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// resizeEvent()
+// -------------
+// Window is being resized
+
+void smoothblendClient::resizeEvent(QResizeEvent *) {
+ if (widget()->isShown()) {
+ QRegion region = widget()->rect();
+ region = region.subtract(titlebar_->geometry());
+ widget()->erase(region);
+ updateMask();
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// showEvent()
+// -----------
+// Window is being shown
+
+void smoothblendClient::showEvent(QShowEvent *) {
+ updateMask();
+ widget()->repaint();
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// maxButtonPressed()
+// -----------------
+// Max button was pressed
+
+void smoothblendClient::maxButtonPressed() {
+ if (button[ButtonMax]) {
+#if KDE_IS_VERSION(3, 3, 0)
+ maximize(button[ButtonMax]->lastMousePress());
+#else
+
+ switch (button[ButtonMax]->lastMousePress()) {
+ case MidButton:
+ maximize(maximizeMode() ^ MaximizeVertical);
+ break;
+ case RightButton:
+ maximize(maximizeMode() ^ MaximizeHorizontal);
+ break;
+ default:
+ (maximizeMode() == MaximizeFull) ? maximize(MaximizeRestore)
+ : maximize(MaximizeFull);
+ }
+#endif
+
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// shadeButtonPressed()
+// -----------------
+// Shade button was pressed
+
+void smoothblendClient::shadeButtonPressed() {
+ if (button[ButtonShade]) {
+ setShade( !isSetShade());
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// aboveButtonPressed()
+// -----------------
+// Above button was pressed
+
+void smoothblendClient::aboveButtonPressed() {
+ if (button[ButtonAbove]) {
+ setKeepAbove( !keepAbove());
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// belowButtonPressed()
+// -----------------
+// Below button was pressed
+
+void smoothblendClient::belowButtonPressed() {
+ if (button[ButtonBelow]) {
+ setKeepBelow( !keepBelow());
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// menuButtonPressed()
+// -------------------
+// Menu button was pressed (popup the menu)
+
+void smoothblendClient::menuButtonPressed() {
+ static QTime* t = NULL;
+ static smoothblendClient* lastClient = NULL;
+ if (t == NULL)
+ t = new QTime;
+ bool dbl = (lastClient==this && t->elapsed() <= QApplication::doubleClickInterval());
+ lastClient = this;
+ t->start();
+ //if (button[ButtonMenu] && !dbl && !::factory->menuClosed()) {
+ if ( !dbl || !::factory->menuClosed()) {
+ QPoint p(button[ButtonMenu]->rect().bottomLeft().x(),
+ button[ButtonMenu]->rect().bottomLeft().y());
+ KDecorationFactory* f = factory();
+ showWindowMenu(button[ButtonMenu]->mapToGlobal(p));
+ if (!f->exists(this))
+ return; // decoration was destroyed
+ button[ButtonMenu]->setDown(false);
+ }
+ else
+ {
+ closing = true;
+ }
+}
+
+void smoothblendClient::menuButtonReleased()
+{
+ if(closing)
+ {
+ closeWindow();
+ }
+}
+
+#include "smoothblend.moc"
diff --git a/kwin-styles/smooth-blend/client/smoothblend.desktop b/kwin-styles/smooth-blend/client/smoothblend.desktop
new file mode 100644
index 00000000..047f92a1
--- /dev/null
+++ b/kwin-styles/smooth-blend/client/smoothblend.desktop
@@ -0,0 +1,40 @@
+# KDE Desktop Entry
+[Desktop Entry]
+Name=Smooth Blend
+Name[ca]=Barreja suau
+Name[cs]=Jemný přechod
+Name[cy]=Cymysgedd Llyfn
+Name[da]=Glat blanding
+Name[el]=Ομαλή μείξη
+Name[eo]=Glata Miksaĵo
+Name[es]=Mezcla suave
+Name[et]=Mahe ühtesulamine
+Name[fa]=ترکیب یکدست
+Name[fi]=Pehmeä sekoitus
+Name[fr]=Fusion douce
+Name[fy]=Sêfte ferminging
+Name[gl]=Mistura Suave
+Name[hu]=Sima színátmenet
+Name[is]=Mjúk blöndun
+Name[it]=Mistura scorrevole
+Name[ja]=綺麗なブレンド
+Name[ka]=გლუვი და რბილი
+Name[mk]=Рамномерно мешање
+Name[nb]=Jevn overgang
+Name[nds]=Week Mischen
+Name[ne]=महिन मिश्रण
+Name[nl]=Zachte vermenging
+Name[nn]=Jamn overgang
+Name[pl]=Gładkie łączenie kolorów
+Name[pt]=Mistura Suave
+Name[pt_BR]=Mistura Suave
+Name[ru]=Полутона
+Name[sl]=Enakomeren preliv
+Name[sr]=Глатко претапање
+Name[sr@Latn]=Glatko pretapanje
+Name[sv]=Jämn blandning
+Name[tr]=Düz Karışım
+Name[uk]=Гладке змішання
+Name[vi]=Trộn màu Mượt mà
+Name[zh_TW]=平順混合
+X-KDE-Library=kwin3_smoothblend
diff --git a/kwin-styles/smooth-blend/client/smoothblend.h b/kwin-styles/smooth-blend/client/smoothblend.h
new file mode 100644
index 00000000..d5f07576
--- /dev/null
+++ b/kwin-styles/smooth-blend/client/smoothblend.h
@@ -0,0 +1,254 @@
+//////////////////////////////////////////////////////////////////////////////
+// smoothblend.h
+// -------------------
+// Smooth Blend window decoration for KDE
+// -------------------
+// Copyright (c) 2005 Ryan Nickell <p0z3r@users.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 the file COPYING. If not, write to
+// the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+// Boston, MA 02110-1301, USA.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef SMOOTHBLEND_H
+#define SMOOTHBLEND_H
+
+#include <qbutton.h>
+#include <kdecoration.h>
+#include <kdecorationfactory.h>
+
+class QSpacerItem;
+class QPoint;
+
+namespace smoothblend {
+
+class smoothblendClient;
+
+enum ButtonType {
+ ButtonHelp=0,
+ ButtonMax,
+ ButtonMin,
+ ButtonClose,
+ ButtonMenu,
+ ButtonSticky,
+ ButtonAbove,
+ ButtonBelow,
+ ButtonShade,
+ ButtonTypeCount
+};
+
+// smoothblendFactory /////////////////////////////////////////////////////////
+//
+// add variables and flags for config like...
+//
+// public: type function()
+// private: type var_
+// inline type function(){ return var_ };
+//
+
+class smoothblendFactory: public KDecorationFactory {
+public:
+ smoothblendFactory();
+ virtual ~smoothblendFactory();
+ virtual KDecoration *createDecoration(KDecorationBridge *b);
+ virtual bool reset(unsigned long changed);
+ static bool initialized();
+ static Qt::AlignmentFlags titleAlign();
+ static bool roundedCorners();
+ static int titleSize();
+ static int buttonSize();
+ static int frameSize();
+ static int roundSize();
+ static QFont titleFontTool() { return m_titleFontTool; }
+ static bool titleShadow();
+ static bool animateButtons() { return animatebuttons; }
+ static int getBtnComboBox() { return btnComboBox; }
+ static bool menuClosed() { return menuClose; }
+
+private:
+ bool readConfig();
+
+private:
+ static bool initialized_;
+ static Qt::AlignmentFlags titlealign_;
+ static bool cornerflags_;
+ static int titlesize_;
+ static int buttonsize_;
+ static int framesize_;
+ static int roundsize_;
+ static QFont m_titleFontTool;
+ static bool titleshadow_;
+ static bool animatebuttons;
+ static int btnComboBox;
+ static bool menuClose;
+};
+
+inline bool smoothblendFactory::initialized() {
+ return initialized_;
+}
+inline Qt::AlignmentFlags smoothblendFactory::titleAlign() {
+ return titlealign_;
+}
+inline bool smoothblendFactory::roundedCorners() {
+ return cornerflags_;
+}
+inline int smoothblendFactory::titleSize() {
+ return titlesize_;
+}
+inline int smoothblendFactory::buttonSize() {
+ return buttonsize_;
+}
+inline int smoothblendFactory::frameSize() {
+ return framesize_;
+}
+inline int smoothblendFactory::roundSize() {
+ return roundsize_;
+}
+inline bool smoothblendFactory::titleShadow() {
+ return titleshadow_;
+}
+
+// smoothblendButton //////////////////////////////////////////////////////////
+
+class smoothblendButton : public QButton {
+ Q_OBJECT
+public:
+ smoothblendButton(smoothblendClient *parent=0, const char *name=0,
+ const QString &tip=NULL,
+ ButtonType type=ButtonHelp,
+ int button_size=18,
+ bool toggle=false);
+ //const unsigned char *bitmap=0);
+ ~smoothblendButton();
+
+ void setBitmap(const unsigned char *bitmap);
+ QSize sizeHint() const;
+ ButtonState lastMousePress() const;
+ void reset();
+ QImage getButtonImage(ButtonType type);
+ virtual void setOn(bool on);
+ virtual void setDown(bool on);
+
+protected slots:
+ void animate();
+ void buttonClicked();
+ void buttonReleased();
+
+private:
+ void enterEvent(QEvent *e);
+ void leaveEvent(QEvent *e);
+ void mousePressEvent(QMouseEvent *e);
+ void mouseReleaseEvent(QMouseEvent *e);
+ void drawButton(QPainter *painter);
+
+private:
+ smoothblendClient *client_;
+ ButtonType type_;
+ int size_;
+ QBitmap *deco_;
+ QPixmap *pixmap[2][4];
+ ButtonState lastmouse_;
+ bool hover_;
+ bool m_clicked;
+ QTimer *animTmr;
+ uint animProgress;
+};
+
+inline Qt::ButtonState smoothblendButton::lastMousePress() const {
+ return lastmouse_;
+}
+inline void smoothblendButton::reset() {
+ repaint(false);
+}
+
+// smoothblendClient //////////////////////////////////////////////////////////
+
+class smoothblendClient : public KDecoration {
+ Q_OBJECT
+public:
+ smoothblendClient(KDecorationBridge *b, KDecorationFactory *f);
+ virtual ~smoothblendClient();
+
+ virtual void init();
+
+ virtual void activeChange();
+ virtual void desktopChange();
+ virtual void captionChange();
+ virtual void iconChange();
+ virtual void maximizeChange();
+ virtual void shadeChange();
+
+
+ virtual void borders(int &l, int &r, int &t, int &b) const;
+ virtual void resize(const QSize &size);
+ virtual QSize minimumSize() const;
+ virtual Position mousePosition(const QPoint &point) const;
+
+ QPixmap getTitleBarTile(bool active) const
+ {
+ return active ? *aTitleBarTile : *iTitleBarTile;
+ }
+
+private:
+ void addButtons(QBoxLayout* layout, const QString& buttons, int buttonSize = 18);
+ bool eventFilter(QObject *obj, QEvent *e);
+ void mouseDoubleClickEvent(QMouseEvent *e);
+ void wheelEvent(QWheelEvent *e);
+ void paintEvent(QPaintEvent *e);
+ void resizeEvent(QResizeEvent *);
+ void showEvent(QShowEvent *);
+ void updateMask();
+ void _resetLayout();
+ QVBoxLayout *mainLayout_;
+ QHBoxLayout *titleLayout_;
+ QSpacerItem *topSpacer_,
+ *titleSpacer_,
+ *leftTitleSpacer_, *rightTitleSpacer_,
+ *decoSpacer_,
+ *leftSpacer_, *rightSpacer_,
+ *bottomSpacer_, *windowSpacer_;
+ QPixmap *aCaptionBuffer, *iCaptionBuffer;
+
+private slots:
+ void maxButtonPressed();
+ void menuButtonPressed();
+ void menuButtonReleased();
+ void aboveButtonPressed();
+ void belowButtonPressed();
+ void shadeButtonPressed();
+ void keepAboveChange(bool);
+ void keepBelowChange(bool);
+
+signals:
+ void keepAboveChanged(bool);
+ void keepBelowChanged(bool);
+
+private:
+ QPixmap *aTitleBarTile, *iTitleBarTile, *aTitleBarTopTile, *iTitleBarTopTile;
+ smoothblendButton *button[ButtonTypeCount];
+ QSpacerItem *titlebar_;
+ bool pixmaps_created;
+ int s_titleHeight;
+ QFont s_titleFont;
+ int handlebar;
+ bool closing;
+
+ void create_pixmaps();
+ void delete_pixmaps();
+};
+
+} // namespace smoothblend
+
+#endif // SMOOTHBLEND_H
diff --git a/kwin-styles/system/Makefile.am b/kwin-styles/system/Makefile.am
new file mode 100644
index 00000000..21a2119a
--- /dev/null
+++ b/kwin-styles/system/Makefile.am
@@ -0,0 +1,21 @@
+
+INCLUDES = $(all_includes)
+
+kde_module_LTLIBRARIES = kwin3_system.la
+
+kwin3_system_la_SOURCES = systemclient.cpp
+kwin3_system_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+#kwin_system_la_LDFLAGS = $(all_libraries) -avoid-version -module $(KDE_RPATH) $(KDE_MT_LDFLAGS)
+kwin3_system_la_LIBADD = $(LIB_KDEUI) -lkdecorations
+
+METASOURCES = AUTO
+noinst_HEADERS = systemclient.h
+
+lnkdir = $(kde_datadir)/kwin/
+lnk_DATA = system.desktop
+
+EXTRA_DIST = $(lnk_DATA)
+
+###KMAKE-start (don't edit or delete this block)
+
+###KMAKE-end
diff --git a/kwin-styles/system/system.desktop b/kwin-styles/system/system.desktop
new file mode 100644
index 00000000..acadcdda
--- /dev/null
+++ b/kwin-styles/system/system.desktop
@@ -0,0 +1,27 @@
+[Desktop Entry]
+Name=System++
+Name[br]=Reizhiad++
+Name[cs]=Systém++
+Name[cy]=Cysawd++
+Name[eo]=Sistem++
+Name[fa]=سیستم++
+Name[fi]=Järjestelmä++
+Name[fr]=Système++
+Name[fy]=Systeem++
+Name[hi]=सिस्टम++
+Name[it]=Sistem++
+Name[ja]=システム++
+Name[lt]=Sistema++
+Name[lv]=Sistēma++
+Name[nds]=Systeem++
+Name[nl]=Systeem++
+Name[pa]=ਸਿਸਟਮ++
+Name[sl]=Sistem++
+Name[ta]=தளம்++
+Name[tg]=Системаи++
+Name[th]=แบบ System++
+Name[tr]=Sistem++
+Name[ven]=Sisitemu++
+Name[xh]=Indlela esetyenziswayo++
+Name[zu]=Indlela esetshenziswayo++
+X-KDE-Library=kwin3_system
diff --git a/kwin-styles/system/systemclient.cpp b/kwin-styles/system/systemclient.cpp
new file mode 100644
index 00000000..e3d85e8e
--- /dev/null
+++ b/kwin-styles/system/systemclient.cpp
@@ -0,0 +1,737 @@
+#include "systemclient.h"
+
+#include <qlayout.h>
+#include <qdrawutil.h>
+#include <qbitmap.h>
+#include <qtooltip.h>
+#include <qlabel.h>
+#include <qcursor.h>
+
+#include <kpixmapeffect.h>
+#include <kdrawutil.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <kdebug.h>
+
+// Default button layout
+const char default_left[] = "X";
+const char default_right[] = "HSIA";
+
+namespace System {
+
+static unsigned char iconify_bits[] = {
+ 0x00, 0x00, 0xff, 0xff, 0x7e, 0x3c, 0x18, 0x00};
+
+static unsigned char maximize_bits[] = {
+ 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x00, 0x00};
+
+static unsigned char r_minmax_bits[] = {
+ 0x0c, 0x18, 0x33, 0x67, 0xcf, 0x9f, 0x3f, 0x3f};
+
+static unsigned char l_minmax_bits[] = {
+ 0x30, 0x18, 0xcc, 0xe6, 0xf3, 0xf9, 0xfc, 0xfc};
+
+static unsigned char unsticky_bits[] = {
+ 0x00, 0x18, 0x18, 0x7e, 0x7e, 0x18, 0x18, 0x00};
+
+static unsigned char sticky_bits[] = {
+ 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x00, 0x00, 0x00};
+
+static unsigned char question_bits[] = {
+ 0x3c, 0x66, 0x60, 0x30, 0x18, 0x00, 0x18, 0x18};
+
+static KPixmap *aUpperGradient=0;
+static KPixmap *iUpperGradient=0;
+
+static KPixmap *btnPix=0;
+static KPixmap *btnPixDown=0;
+static KPixmap *iBtnPix=0;
+static KPixmap *iBtnPixDown=0;
+static QColor *btnForeground;
+
+static bool pixmaps_created = false;
+
+static void drawButtonFrame(KPixmap *pix, const QColorGroup &g)
+{
+ QPainter p;
+ p.begin(pix);
+ p.setPen(g.mid());
+ p.drawLine(0, 0, 13, 0);
+ p.drawLine(0, 0, 0, 13);
+ p.setPen(g.light());
+ p.drawLine(13, 0, 13, 13);
+ p.drawLine(0, 13, 13, 13);
+ p.setPen(g.dark());
+ p.drawRect(1, 1, 12, 12);
+ p.end();
+}
+
+static void create_pixmaps()
+{
+ if(pixmaps_created)
+ return;
+ pixmaps_created = true;
+
+ if(QPixmap::defaultDepth() > 8){
+ // titlebar
+ aUpperGradient = new KPixmap;
+ aUpperGradient->resize(32, 18);
+ iUpperGradient = new KPixmap;
+ iUpperGradient->resize(32, 18);
+ QColor bgColor = kapp->palette().active().background();
+ KPixmapEffect::gradient(*aUpperGradient,
+ KDecoration::options()->color(KDecorationOptions::ColorFrame, true).light(130),
+ bgColor,
+ KPixmapEffect::VerticalGradient);
+ KPixmapEffect::gradient(*iUpperGradient,
+ KDecoration::options()->color(KDecorationOptions::ColorFrame, false).light(130),
+ bgColor,
+ KPixmapEffect::VerticalGradient);
+
+ // buttons
+ KPixmap aPix;
+ aPix.resize(12, 12);
+ KPixmap iPix;
+ iPix.resize(12, 12);
+ KPixmap aInternal;
+ aInternal.resize(8, 8);
+ KPixmap iInternal;
+ iInternal.resize(8, 8);
+
+ QColor hColor(KDecoration::options()->color(KDecorationOptions::ColorButtonBg, false));
+ KPixmapEffect::gradient(iInternal,
+ hColor.dark(120),
+ hColor.light(120),
+ KPixmapEffect::DiagonalGradient);
+ KPixmapEffect::gradient(iPix,
+ hColor.light(150),
+ hColor.dark(150),
+ KPixmapEffect::DiagonalGradient);
+
+ hColor =KDecoration::options()->color(KDecorationOptions::ColorButtonBg, true);
+ KPixmapEffect::gradient(aInternal,
+ hColor.dark(120),
+ hColor.light(120),
+ KPixmapEffect::DiagonalGradient);
+ KPixmapEffect::gradient(aPix,
+ hColor.light(150),
+ hColor.dark(150),
+ KPixmapEffect::DiagonalGradient);
+ bitBlt(&aPix, 1, 1, &aInternal, 0, 0, 8, 8, Qt::CopyROP, true);
+ bitBlt(&iPix, 1, 1, &iInternal, 0, 0, 8, 8, Qt::CopyROP, true);
+
+ // normal buttons
+ btnPix = new KPixmap;
+ btnPix->resize(14, 14);
+ bitBlt(btnPix, 2, 2, &aPix, 0, 0, 10, 10, Qt::CopyROP, true);
+ drawButtonFrame(btnPix, KDecoration::options()->colorGroup(KDecorationOptions::ColorFrame, true));
+
+ iBtnPix = new KPixmap;
+ iBtnPix->resize(14, 14);
+ bitBlt(iBtnPix, 2, 2, &iPix, 0, 0, 10, 10, Qt::CopyROP, true);
+ drawButtonFrame(iBtnPix, KDecoration::options()->colorGroup(KDecorationOptions::ColorFrame, false));
+
+
+ // pressed buttons
+ hColor = KDecoration::options()->color(KDecorationOptions::ColorButtonBg, false);
+ KPixmapEffect::gradient(iInternal,
+ hColor.light(130),
+ hColor.dark(130),
+ KPixmapEffect::DiagonalGradient);
+ KPixmapEffect::gradient(iPix,
+ hColor.light(150),
+ hColor.dark(150),
+ KPixmapEffect::DiagonalGradient);
+
+ hColor =KDecoration::options()->color(KDecorationOptions::ColorButtonBg, true);
+ KPixmapEffect::gradient(aInternal,
+ hColor.light(130),
+ hColor.dark(130),
+ KPixmapEffect::DiagonalGradient);
+ KPixmapEffect::gradient(aPix,
+ hColor.light(150),
+ hColor.dark(150),
+ KPixmapEffect::DiagonalGradient);
+ bitBlt(&aPix, 1, 1, &aInternal, 0, 0, 8, 8, Qt::CopyROP, true);
+ bitBlt(&iPix, 1, 1, &iInternal, 0, 0, 8, 8, Qt::CopyROP, true);
+
+ btnPixDown = new KPixmap;
+ btnPixDown->resize(14, 14);
+ bitBlt(btnPixDown, 2, 2, &aPix, 0, 0, 10, 10, Qt::CopyROP, true);
+ drawButtonFrame(btnPixDown, KDecoration::options()->colorGroup(KDecorationOptions::ColorFrame,
+ true));
+
+ iBtnPixDown = new KPixmap;
+ iBtnPixDown->resize(14, 14);
+ bitBlt(iBtnPixDown, 2, 2, &iPix, 0, 0, 10, 10, Qt::CopyROP, true);
+ drawButtonFrame(iBtnPixDown, KDecoration::options()->colorGroup(KDecorationOptions::ColorFrame,
+ false));
+ }
+ if(qGray(KDecoration::options()->color(KDecorationOptions::ColorButtonBg, true).rgb()) > 128)
+ btnForeground = new QColor(Qt::black);
+ else
+ btnForeground = new QColor(Qt::white);
+}
+
+static void delete_pixmaps()
+{
+ if(aUpperGradient){
+ delete aUpperGradient;
+ delete iUpperGradient;
+ delete btnPix;
+ delete btnPixDown;
+ delete iBtnPix;
+ delete iBtnPixDown;
+ aUpperGradient = 0;
+ }
+ delete btnForeground;
+ pixmaps_created = false;
+}
+
+SystemButton::SystemButton(SystemClient *parent, const char *name,
+ const unsigned char *bitmap, const QString& tip)
+: QButton(parent->widget(), name)
+{
+ setTipText(tip);
+ setBackgroundMode( NoBackground );
+ setCursor(ArrowCursor);
+ resize(14, 14);
+ if(bitmap)
+ setBitmap(bitmap);
+ client = parent;
+}
+
+void SystemButton::setTipText(const QString &tip)
+{
+ if (KDecoration::options()->showTooltips())
+ {
+ QToolTip::remove(this );
+ QToolTip::add(this, tip );
+ }
+}
+
+
+QSize SystemButton::sizeHint() const
+{
+ return(QSize(14, 14));
+}
+
+void SystemButton::reset()
+{
+ repaint(false);
+}
+
+void SystemButton::setBitmap(const unsigned char *bitmap)
+{
+ deco = QBitmap(8, 8, bitmap, true);
+ deco.setMask(deco);
+ repaint();
+}
+
+void SystemButton::drawButton(QPainter *p)
+{
+ if(btnPixDown){
+ if(client->isActive())
+ p->drawPixmap(0, 0, isDown() ? *btnPixDown : *btnPix);
+ else
+ p->drawPixmap(0, 0, isDown() ? *iBtnPixDown : *iBtnPix);
+ }
+ else{
+ QColorGroup g = KDecoration::options()->colorGroup(KDecorationOptions::ColorFrame,
+ client->isActive());
+ int x2 = width()-1;
+ int y2 = height()-1;
+ // outer frame
+ p->setPen(g.mid());
+ p->drawLine(0, 0, x2, 0);
+ p->drawLine(0, 0, 0, y2);
+ p->setPen(g.light());
+ p->drawLine(x2, 0, x2, y2);
+ p->drawLine(0, x2, y2, x2);
+ p->setPen(g.dark());
+ p->drawRect(1, 1, width()-2, height()-2);
+ // inner frame
+ g = KDecoration::options()->colorGroup(KDecorationOptions::ColorButtonBg, client->isActive());
+ p->fillRect(3, 3, width()-6, height()-6, g.background());
+ p->setPen(isDown() ? g.mid() : g.light());
+ p->drawLine(2, 2, x2-2, 2);
+ p->drawLine(2, 2, 2, y2-2);
+ p->setPen(isDown() ? g.light() : g.mid());
+ p->drawLine(x2-2, 2, x2-2, y2-2);
+ p->drawLine(2, x2-2, y2-2, x2-2);
+
+ }
+
+ if(!deco.isNull()){
+ p->setPen(*btnForeground);
+ p->drawPixmap(isDown() ? 4 : 3, isDown() ? 4 : 3, deco);
+ }
+}
+
+void SystemButton::mousePressEvent( QMouseEvent* e )
+{
+ last_button = e->button();
+ QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() );
+ QButton::mousePressEvent( &me );
+}
+
+void SystemButton::mouseReleaseEvent( QMouseEvent* e )
+{
+ last_button = e->button();
+ QMouseEvent me ( e->type(), e->pos(), e->globalPos(), LeftButton, e->state() );
+ QButton::mouseReleaseEvent( &me );
+}
+
+
+
+SystemClient::SystemClient(KDecorationBridge* bridge, KDecorationFactory* factory)
+ : KDecoration(bridge, factory)
+{}
+
+SystemClient::~SystemClient()
+{
+ for (int n=0; n<ButtonTypeCount; n++) {
+ if (button[n]) delete button[n];
+ }
+}
+
+void SystemClient::init()
+{
+ createMainWidget(0);
+ widget()->installEventFilter( this );
+
+ QGridLayout* g = new QGridLayout(widget(), 0, 0, 2);
+
+ if (isPreview())
+ {
+ g->addWidget(new QLabel(i18n("<center><b>System++ preview</b></center>"), widget()), 1, 1);
+ }
+ else
+ {
+ g->addItem(new QSpacerItem( 0, 0 ), 1, 1); // no widget in the middle
+ }
+// g->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );
+ g->setRowStretch(1, 10);
+
+ g->addColSpacing(0, 2);
+ g->addColSpacing(2, 2);
+ g->addRowSpacing(2, 6);
+
+ QBoxLayout* hb = new QBoxLayout(0, QBoxLayout::LeftToRight, 0, 0, 0);
+ hb->setResizeMode(QLayout::FreeResize);
+ g->addLayout( hb, 0, 1 );
+ hb->addSpacing(3);
+
+ titlebar = new QSpacerItem(10, 14, QSizePolicy::Expanding,
+ QSizePolicy::Minimum);
+
+ // setup titlebar buttons
+ for (int n=0; n<ButtonTypeCount; n++) button[n] = 0;
+ addButtons(hb, KDecoration::options()->customButtonPositions() ?
+ KDecoration::options()->titleButtonsLeft() : QString(default_left));
+ hb->addSpacing(2);
+ hb->addItem(titlebar);
+ hb->addSpacing(3);
+ addButtons(hb, KDecoration::options()->customButtonPositions() ?
+ KDecoration::options()->titleButtonsRight() : QString(default_right));
+ hb->addSpacing(2);
+
+ widget()->setBackgroundMode(QWidget::NoBackground);
+ recalcTitleBuffer();
+}
+
+void SystemClient::addButtons(QBoxLayout *hb, const QString& s)
+{
+ unsigned char *minmax_bits;
+ int l_max = KDecoration::options()->titleButtonsLeft().find('A');
+ if (s.length() > 0) {
+ for (unsigned n=0; n < s.length(); n++) {
+ switch (s[n]) {
+ case 'X': // Close button
+ if ((!button[ButtonClose]) && isCloseable()) {
+ button[ButtonClose] = new SystemButton(this, "close", NULL, i18n("Close"));
+ connect( button[ButtonClose], SIGNAL( clicked() ), this, ( SLOT( closeWindow() ) ) );
+ hb->addWidget(button[ButtonClose]);
+ hb->addSpacing(1);
+ }
+ break;
+
+ case 'S': // Sticky button
+ if (!button[ButtonSticky]) {
+ button[ButtonSticky] = new SystemButton(this, "sticky", NULL, i18n("On all desktops"));
+ if(isOnAllDesktops())
+ button[ButtonSticky]->setBitmap(unsticky_bits);
+ else
+ button[ButtonSticky]->setBitmap(sticky_bits);
+ connect( button[ButtonSticky], SIGNAL( clicked() ), this, ( SLOT( toggleOnAllDesktops() ) ) );
+ hb->addWidget(button[ButtonSticky]);
+ hb->addSpacing(1);
+ }
+ break;
+
+ case 'I': // Minimize button
+ if ((!button[ButtonMinimize]) && isMinimizable()) {
+ button[ButtonMinimize] = new SystemButton(this, "iconify", iconify_bits, i18n("Minimize"));
+ connect( button[ButtonMinimize], SIGNAL( clicked() ), this, ( SLOT( minimize() ) ) );
+ hb->addWidget(button[ButtonMinimize]);
+ hb->addSpacing(1);
+ }
+ break;
+
+ case 'A': // Maximize button
+ if ((!button[ButtonMaximize]) && isMaximizable()) {
+ if (maximizeMode()==MaximizeFull) {
+ if (KDecoration::options()->customButtonPositions() && (l_max>-1))
+ minmax_bits = l_minmax_bits;
+ else
+ minmax_bits = r_minmax_bits;
+ button[ButtonMaximize] = new SystemButton(this, "maximize", minmax_bits, i18n("Restore"));
+ }
+ else
+ button[ButtonMaximize] = new SystemButton(this, "maximize", maximize_bits, i18n("Maximize"));
+ connect( button[ButtonMaximize], SIGNAL( clicked() ), this, ( SLOT( maxButtonClicked() ) ) );
+ hb->addWidget(button[ButtonMaximize]);
+ hb->addSpacing(1);
+ }
+ break;
+
+ case 'H': // Help button
+ if ((!button[ButtonHelp]) && providesContextHelp()) {
+ button[ButtonHelp] = new SystemButton(this, "help", question_bits, i18n("Help"));
+ connect( button[ButtonHelp], SIGNAL( clicked() ), this, ( SLOT( showContextHelp() ) ) );
+ hb->addWidget(button[ButtonHelp]);
+ hb->addSpacing(1);
+ }
+ break;
+
+ }
+ }
+ }
+}
+
+bool SystemClient::eventFilter( QObject* o, QEvent* e )
+{
+ if( o != widget())
+ return false;
+ switch( e->type())
+ {
+ case QEvent::Resize:
+ resizeEvent(static_cast< QResizeEvent* >( e ) );
+ return true;
+ case QEvent::Paint:
+ paintEvent(static_cast< QPaintEvent* >( e ) );
+ return true;
+ case QEvent::MouseButtonDblClick:
+ mouseDoubleClickEvent(static_cast< QMouseEvent* >( e ) );
+ return true;
+ case QEvent::MouseButtonPress:
+ processMousePressEvent(static_cast< QMouseEvent* >( e ) );
+ return true;
+ case QEvent::Wheel:
+ wheelEvent( static_cast< QWheelEvent* >( e ));
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+void SystemClient::reset(unsigned long)
+{
+ titleBuffer.resize(0, 0);
+ recalcTitleBuffer();
+ widget()->repaint();
+ if (button[ButtonClose])
+ button[ButtonClose]->reset();
+ if (button[ButtonSticky])
+ button[ButtonSticky]->reset();
+ if (button[ButtonMinimize])
+ button[ButtonMinimize]->reset();
+ if (button[ButtonMaximize])
+ button[ButtonMaximize]->reset();
+ if (button[ButtonHelp])
+ button[ButtonHelp]->reset();
+}
+
+void SystemClient::maxButtonClicked()
+{
+ maximize( button[ButtonMaximize]->last_button );
+}
+
+void SystemClient::resizeEvent( QResizeEvent* )
+{
+ //Client::resizeEvent( e );
+ recalcTitleBuffer();
+ doShape();
+ /*
+ if ( isVisibleToTLW() && !testWFlags( WStaticContents )) {
+ QPainter p( this );
+ QRect t = titlebar->geometry();
+ t.setTop( 0 );
+ QRegion r = rect();
+ r = r.subtract( t );
+ p.setClipRegion( r );
+ p.eraseRect( rect() );
+ }*/
+}
+
+void SystemClient::resize( const QSize& s )
+{
+ widget()->resize( s );
+}
+
+
+QSize SystemClient::minimumSize() const
+{
+ return widget()->minimumSize();
+}
+
+
+void SystemClient::recalcTitleBuffer()
+{
+ if(oldTitle == caption() && width() == titleBuffer.width())
+ return;
+ QFontMetrics fm(options()->font(true));
+ titleBuffer.resize(width(), 18);
+ QPainter p;
+ p.begin(&titleBuffer);
+ if(aUpperGradient)
+ p.drawTiledPixmap(0, 0, width(), 18, *aUpperGradient);
+ else
+ p.fillRect(0, 0, width(), 18,
+ options()->colorGroup(KDecorationOptions::ColorFrame, true).
+ brush(QColorGroup::Button));
+
+ QRect t = titlebar->geometry();
+ t.setTop( 2 );
+ t.setLeft( t.left() + 4 );
+ t.setRight( t.right() - 2 );
+
+ QRegion r(t.x(), 0, t.width(), 18);
+ r -= QRect(t.x()+((t.width()-fm.width(caption()))/2)-4,
+ 0, fm.width(caption())+8, 18);
+ p.setClipRegion(r);
+ int i, ly;
+ for(i=0, ly=4; i < 4; ++i, ly+=3){
+ p.setPen(options()->color(KDecorationOptions::ColorTitleBar, true).light(150));
+ p.drawLine(0, ly, width()-1, ly);
+ p.setPen(options()->color(KDecorationOptions::ColorTitleBar, true).dark(120));
+ p.drawLine(0, ly+1, width()-1, ly+1);
+ }
+ p.setClipRect(t);
+ p.setPen(options()->color(KDecorationOptions::ColorFont, true));
+ p.setFont(options()->font(true));
+
+ p.drawText(t.x()+((t.width()-fm.width(caption()))/2)-4,
+ 0, fm.width(caption())+8, 18, AlignCenter, caption());
+ p.setClipping(false);
+ p.end();
+ oldTitle = caption();
+}
+
+void SystemClient::captionChange()
+{
+ recalcTitleBuffer();
+ widget()->repaint(titlebar->geometry(), false);
+}
+
+void SystemClient::drawRoundFrame(QPainter &p, int x, int y, int w, int h)
+{
+ kDrawRoundButton(&p, x, y, w, h,
+ options()->colorGroup(KDecorationOptions::ColorFrame, isActive()), false);
+
+}
+
+void SystemClient::paintEvent( QPaintEvent* )
+{
+ QPainter p(widget());
+ QRect t = titlebar->geometry();
+
+ QBrush fillBrush(widget()->colorGroup().brush(QColorGroup::Background).pixmap() ?
+ widget()->colorGroup().brush(QColorGroup::Background) :
+ options()->colorGroup(KDecorationOptions::ColorFrame, isActive()).
+ brush(QColorGroup::Button));
+
+ p.fillRect(1, 18, width()-2, height()-19, fillBrush);
+
+ t.setTop( 2 );
+ t.setLeft( t.left() + 4 );
+ t.setRight( t.right() - 2 );
+
+ if(isActive())
+ p.drawPixmap(0, 0, titleBuffer);
+ else{
+ if(iUpperGradient)
+ p.drawTiledPixmap(0, 0, width(), 18, *iUpperGradient);
+ else
+ p.fillRect(0, 0, width(), 18, fillBrush);
+ p.setPen(options()->color(KDecorationOptions::ColorFont, isActive()));
+ p.setFont(options()->font(isActive()));
+ p.drawText(t, AlignCenter, caption() );
+ }
+
+ p.setPen(options()->colorGroup(KDecorationOptions::ColorFrame, isActive()).light());
+ p.drawLine(width()-20, height()-7, width()-10, height()-7);
+ p.drawLine(width()-20, height()-5, width()-10, height()-5);
+ p.setPen(options()->colorGroup(KDecorationOptions::ColorFrame, isActive()).dark());
+ p.drawLine(width()-20, height()-6, width()-10, height()-6);
+ p.drawLine(width()-20, height()-4, width()-10, height()-4);
+
+ drawRoundFrame(p, 0, 0, width(), height());
+}
+
+#define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2)
+
+void SystemClient::doShape()
+{
+ // using a bunch of QRect lines seems much more efficent than bitmaps or
+ // point arrays
+
+ QRegion mask;
+ kRoundMaskRegion(mask, 0, 0, width(), height());
+ setMask(mask);
+}
+
+void SystemClient::showEvent(QShowEvent *)
+{
+// Client::showEvent(ev);
+ doShape();
+ widget()->show();
+// widget()->repaint();
+}
+
+/*void SystemClient::windowWrapperShowEvent( QShowEvent* )
+{
+ doShape();
+}*/
+
+void SystemClient::mouseDoubleClickEvent( QMouseEvent * e )
+{
+ if ( e->button() == LeftButton && titlebar->geometry().contains( e->pos() ) )
+ titlebarDblClickOperation();
+}
+
+void SystemClient::wheelEvent( QWheelEvent *e )
+{
+ if (isSetShade() || QRect( 0, 0, width(), titlebar->geometry().height() ).contains( e->pos() ) )
+ titlebarMouseWheelOperation( e->delta());
+}
+
+void SystemClient::maximizeChange()
+{
+ unsigned char *minmax_bits;
+ int l_max = KDecoration::options()->titleButtonsLeft().find('A');
+ if (KDecoration::options()->customButtonPositions() && (l_max>-1))
+ minmax_bits = l_minmax_bits;
+ else
+ minmax_bits = r_minmax_bits;
+ if (button[ButtonMaximize]) {
+ button[ButtonMaximize]->setBitmap((maximizeMode()==MaximizeFull) ? minmax_bits : maximize_bits);
+ button[ButtonMaximize]->setTipText((maximizeMode()==MaximizeFull) ? i18n("Restore") : i18n("Maximize"));
+ }
+}
+
+void SystemClient::activeChange()
+{
+ widget()->repaint(false);
+ if (button[ButtonClose])
+ button[ButtonClose]->reset();
+ if (button[ButtonSticky])
+ button[ButtonSticky]->reset();
+ if (button[ButtonMinimize])
+ button[ButtonMinimize]->reset();
+ if (button[ButtonMaximize])
+ button[ButtonMaximize]->reset();
+ if (button[ButtonHelp])
+ button[ButtonHelp]->reset();
+}
+
+void SystemClient::iconChange()
+{
+// if (button[BtnMenu] && button[BtnMenu]->isVisible())
+// button[BtnMenu]->repaint(false);
+}
+
+void SystemClient::desktopChange()
+{
+ if (button[ButtonSticky]) {
+ button[ButtonSticky]->setBitmap(isOnAllDesktops() ? unsticky_bits : sticky_bits);
+ button[ButtonSticky]->setTipText(isOnAllDesktops() ? i18n("Not on all desktops") : i18n("On all desktops"));
+ }
+}
+
+/*void SystemClient::stickyChange(bool on)
+{
+}*/
+
+KDecoration::Position SystemClient::mousePosition(const QPoint &p) const
+{
+ return KDecoration::mousePosition(p);
+}
+
+void SystemClient::borders(int& left, int& right, int& top, int& bottom) const
+{
+ left = 4;
+ right = 4;
+ top = 18;
+ bottom = 8;
+
+/* if ((maximizeMode()==MaximizeFull) && !options()->moveResizeMaximizedWindows()) {
+ left = right = bottom = 0;
+ top = 1 + titleHeight + (borderSize-1);
+ }*/
+}
+
+SystemDecoFactory::SystemDecoFactory()
+{
+ create_pixmaps();
+}
+
+SystemDecoFactory::~SystemDecoFactory()
+{
+ delete_pixmaps();
+}
+
+KDecoration *SystemDecoFactory::createDecoration( KDecorationBridge *b )
+{
+ return new SystemClient(b, this);
+}
+
+bool SystemDecoFactory::reset( unsigned long changed )
+{
+ System::delete_pixmaps();
+ System::create_pixmaps();
+ // Ensure changes in tooltip state get applied
+ resetDecorations(changed);
+ return true;
+}
+
+bool SystemDecoFactory::supports( Ability ability )
+{
+ switch( ability )
+ {
+ case AbilityAnnounceButtons:
+ case AbilityButtonOnAllDesktops:
+ case AbilityButtonHelp:
+ case AbilityButtonMinimize:
+ case AbilityButtonMaximize:
+ case AbilityButtonClose:
+ return true;
+ default:
+ return false;
+ };
+}
+
+QValueList<KDecorationFactory::BorderSize> SystemDecoFactory::borderSizes() const
+{ // the list must be sorted
+ return QValueList< BorderSize >() << BorderNormal;
+}
+
+}
+
+extern "C" KDE_EXPORT KDecorationFactory *create_factory()
+{
+ return new System::SystemDecoFactory();
+}
+
+#include "systemclient.moc"
diff --git a/kwin-styles/system/systemclient.h b/kwin-styles/system/systemclient.h
new file mode 100644
index 00000000..360f204d
--- /dev/null
+++ b/kwin-styles/system/systemclient.h
@@ -0,0 +1,111 @@
+#ifndef __SYSTEMCLIENT_H
+#define __SYSTEMCLIENT_H
+
+#include <qvariant.h>
+#include <qbitmap.h>
+#include <qbutton.h>
+
+#include <kpixmap.h>
+#include <kdecoration.h>
+#include <kdecorationfactory.h>
+
+
+class QLabel;
+class QSpacerItem;
+class QBoxLayout;
+
+namespace System {
+
+class SystemButton;
+
+enum ButtonType {
+ ButtonClose=0,
+ ButtonSticky,
+ ButtonMinimize,
+ ButtonMaximize,
+ ButtonHelp,
+ ButtonTypeCount
+};
+
+class SystemClient : public KDecoration
+{
+ Q_OBJECT
+ public:
+ SystemClient(KDecorationBridge* bridge, KDecorationFactory* factory);
+ ~SystemClient();
+ virtual Position mousePosition(const QPoint& p) const;
+ virtual void resize(const QSize&);
+ virtual bool eventFilter(QObject* o, QEvent* e);
+ virtual void init();
+ protected:
+ virtual void maximizeChange();
+ virtual void captionChange();
+ virtual void shadeChange() {};
+ virtual void iconChange();
+ virtual void desktopChange();
+ virtual void activeChange();
+ virtual QSize minimumSize() const;
+ virtual void borders(int&, int&, int&, int&) const;
+ virtual void reset( unsigned long changed );
+ void drawRoundFrame(QPainter &p, int x, int y, int w, int h);
+ void resizeEvent( QResizeEvent* );
+ void paintEvent( QPaintEvent* );
+ void showEvent( QShowEvent* );
+ void mouseDoubleClickEvent( QMouseEvent * );
+ void wheelEvent(QWheelEvent *e);
+ void doShape();
+ void recalcTitleBuffer();
+ private:
+ void addButtons(QBoxLayout* hb, const QString& buttons);
+ private slots:
+ void maxButtonClicked();
+
+ private:
+ SystemButton* button[ButtonTypeCount];
+ QSpacerItem* titlebar;
+ QPixmap titleBuffer;
+ QString oldTitle;
+};
+
+class SystemButton : public QButton
+{
+ public:
+ SystemButton(SystemClient *parent=0, const char *name=0,
+ const unsigned char *bitmap=NULL, const QString& tip=NULL);
+ void setBitmap(const unsigned char *bitmap);
+ void reset();
+ QSize sizeHint() const;
+ void setTipText(const QString &tip);
+ ButtonState last_button;
+ protected:
+ virtual void drawButton(QPainter *p);
+ void drawButtonLabel(QPainter *){}
+ QBitmap deco;
+
+ void mousePressEvent( QMouseEvent* e );
+ void mouseReleaseEvent( QMouseEvent* e );
+
+ private:
+ SystemClient* client;
+};
+
+
+class SystemDecoFactory : public QObject, public KDecorationFactory
+{
+ Q_OBJECT
+ public:
+ SystemDecoFactory();
+ virtual ~SystemDecoFactory();
+ virtual KDecoration *createDecoration(KDecorationBridge *);
+ virtual bool reset(unsigned long);
+ virtual bool supports( Ability ability );
+ virtual QValueList< BorderSize > borderSizes() const;
+ private:
+ void readConfig();
+};
+
+
+
+}
+
+#endif