summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am27
-rw-r--r--src/Makefile.in972
-rw-r--r--src/SUSE2.cpp334
-rw-r--r--src/SUSE2.desktop4
-rw-r--r--src/SUSE2.h146
-rw-r--r--src/SUSE2.kcsrc27
-rw-r--r--src/SUSE2button.cpp983
-rw-r--r--src/SUSE2button.h109
-rw-r--r--src/SUSE2client.cpp768
-rw-r--r--src/SUSE2client.h87
-rw-r--r--src/config/Makefile.am9
-rw-r--r--src/config/Makefile.in783
-rw-r--r--src/config/config.cpp284
-rw-r--r--src/config/config.h62
-rw-r--r--src/config/configdialog.ui840
-rw-r--r--src/misc.cpp86
-rw-r--r--src/misc.h30
-rw-r--r--src/shadow.cpp126
-rw-r--r--src/shadow.h52
-rw-r--r--src/titlebar_decor.pngbin0 -> 1399 bytes
20 files changed, 5729 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..425cbeb
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,27 @@
+INCLUDES = -I$(top_srcdir) $(all_includes)
+
+SUBDIRS = config
+
+kde_module_LTLIBRARIES = kwin3_SUSE2.la
+
+kwin3_SUSE2_la_SOURCES = SUSE2.cpp SUSE2client.cpp SUSE2button.cpp misc.cpp shadow.cpp
+
+kwin3_SUSE2_la_LIBADD = $(LIB_KDEUI) -lkdecorations
+kwin3_SUSE2_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+METASOURCES = AUTO
+
+messages: rc.cpp
+ $(EXTRACTRC) config/*.ui >> rc.cpp
+ $(XGETTEXT) *.cpp config/*.cpp -o $(podir)/kwin_SUSE2.pot
+
+linkdir = $(kde_datadir)/kwin/
+link_DATA = SUSE2.desktop
+
+kwin_pics_data_DATA = titlebar_decor.png
+kwin_pics_datadir = $(kde_datadir)/kwin/pics
+
+kdisplay_colorscheme_DATA = SUSE2.kcsrc
+kdisplay_colorschemedir = $(kde_datadir)/kdisplay/color-schemes
+
+EXTRA_DIST = $(kwin_pics_data_DATA) $(link_DATA) $(kdisplay_colorscheme_DATA)
+
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..6127792
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,972 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 483858 $
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(kde_moduledir)" \
+ "$(DESTDIR)$(kdisplay_colorschemedir)" \
+ "$(DESTDIR)$(kwin_pics_datadir)" "$(DESTDIR)$(linkdir)"
+kde_moduleLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(kde_module_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+kwin3_SUSE2_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_kwin3_SUSE2_la_OBJECTS = SUSE2.lo SUSE2client.lo SUSE2button.lo \
+ misc.lo shadow.lo
+#>- kwin3_SUSE2_la_OBJECTS = $(am_kwin3_SUSE2_la_OBJECTS)
+#>+ 5
+kwin3_SUSE2_la_final_OBJECTS = kwin3_SUSE2_la.all_cpp.lo
+kwin3_SUSE2_la_nofinal_OBJECTS = SUSE2.lo SUSE2client.lo SUSE2button.lo \
+ misc.lo shadow.lo
+@KDE_USE_FINAL_FALSE@kwin3_SUSE2_la_OBJECTS = $(kwin3_SUSE2_la_nofinal_OBJECTS)
+@KDE_USE_FINAL_TRUE@kwin3_SUSE2_la_OBJECTS = $(kwin3_SUSE2_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+#>- $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+#>+ 2
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(kwin3_SUSE2_la_SOURCES)
+DIST_SOURCES = $(kwin3_SUSE2_la_SOURCES)
+#>- RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+#>- html-recursive info-recursive install-data-recursive \
+#>- install-exec-recursive install-info-recursive \
+#>- install-recursive installcheck-recursive installdirs-recursive \
+#>- pdf-recursive ps-recursive uninstall-info-recursive \
+#>- uninstall-recursive
+#>+ 6
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive nmcheck-recursive bcheck-recursive
+kdisplay_colorschemeDATA_INSTALL = $(INSTALL_DATA)
+kwin_pics_dataDATA_INSTALL = $(INSTALL_DATA)
+linkDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(kdisplay_colorscheme_DATA) $(kwin_pics_data_DATA) \
+ $(link_DATA)
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+ARTSCCONFIG = @ARTSCCONFIG@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCOPIDL = @DCOPIDL@
+DCOPIDL2CPP = @DCOPIDL2CPP@
+DCOPIDLNG = @DCOPIDLNG@
+DCOP_DEPENDENCIES = @DCOP_DEPENDENCIES@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FRAMEWORK_COREAUDIO = @FRAMEWORK_COREAUDIO@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KCFG_DEPENDENCIES = @KCFG_DEPENDENCIES@
+KCONFIG_COMPILER = @KCONFIG_COMPILER@
+KDECONFIG = @KDECONFIG@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_EXTRA_RPATH = @KDE_EXTRA_RPATH@
+KDE_INCLUDES = @KDE_INCLUDES@
+KDE_LDFLAGS = @KDE_LDFLAGS@
+KDE_MT_LDFLAGS = @KDE_MT_LDFLAGS@
+KDE_MT_LIBS = @KDE_MT_LIBS@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_RPATH = @KDE_RPATH@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_FPIE = @KDE_USE_FPIE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+KDE_USE_PIE = @KDE_USE_PIE@
+KDE_XSL_STYLESHEET = @KDE_XSL_STYLESHEET@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBCOMPAT = @LIBCOMPAT@
+LIBCRYPT = @LIBCRYPT@
+LIBDL = @LIBDL@
+LIBJPEG = @LIBJPEG@
+LIBOBJS = @LIBOBJS@
+LIBPNG = @LIBPNG@
+LIBPTHREAD = @LIBPTHREAD@
+LIBRESOLV = @LIBRESOLV@
+LIBS = @LIBS@
+LIBSM = @LIBSM@
+LIBSOCKET = @LIBSOCKET@
+LIBTOOL = @LIBTOOL@
+LIBUCB = @LIBUCB@
+LIBUTIL = @LIBUTIL@
+LIBZ = @LIBZ@
+LIB_KAB = @LIB_KAB@
+LIB_KABC = @LIB_KABC@
+LIB_KDECORE = @LIB_KDECORE@
+LIB_KDED = @LIB_KDED@
+LIB_KDEPIM = @LIB_KDEPIM@
+LIB_KDEPRINT = @LIB_KDEPRINT@
+LIB_KDEUI = @LIB_KDEUI@
+LIB_KDNSSD = @LIB_KDNSSD@
+LIB_KFILE = @LIB_KFILE@
+LIB_KFM = @LIB_KFM@
+LIB_KHTML = @LIB_KHTML@
+LIB_KIMPROXY = @LIB_KIMPROXY@
+LIB_KIO = @LIB_KIO@
+LIB_KJS = @LIB_KJS@
+LIB_KNEWSTUFF = @LIB_KNEWSTUFF@
+LIB_KPARTS = @LIB_KPARTS@
+LIB_KSPELL = @LIB_KSPELL@
+LIB_KSYCOCA = @LIB_KSYCOCA@
+LIB_KUNITTEST = @LIB_KUNITTEST@
+LIB_KUTILS = @LIB_KUTILS@
+LIB_POLL = @LIB_POLL@
+LIB_QPE = @LIB_QPE@
+LIB_QT = @LIB_QT@
+LIB_SMB = @LIB_SMB@
+LIB_X11 = @LIB_X11@
+LIB_XEXT = @LIB_XEXT@
+LIB_XRENDER = @LIB_XRENDER@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKEKDEWIDGETS = @MAKEKDEWIDGETS@
+MCOPIDL = @MCOPIDL@
+MEINPROC = @MEINPROC@
+MOC = @MOC@
+MSGFMT = @MSGFMT@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+QTE_NORTTI = @QTE_NORTTI@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+UIC = @UIC@
+UIC_TR = @UIC_TR@
+USER_INCLUDES = @USER_INCLUDES@
+USER_LDFLAGS = @USER_LDFLAGS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+USE_THREADS = @USE_THREADS@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+XGETTEXT = @XGETTEXT@
+XMKMF = @XMKMF@
+XMLLINT = @XMLLINT@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_INCLUDES = @X_INCLUDES@
+X_LDFLAGS = @X_LDFLAGS@
+X_PRE_LIBS = @X_PRE_LIBS@
+X_RPATH = @X_RPATH@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+include_ARTS_FALSE = @include_ARTS_FALSE@
+include_ARTS_TRUE = @include_ARTS_TRUE@
+include_x11_FALSE = @include_x11_FALSE@
+include_x11_TRUE = @include_x11_TRUE@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kde_appsdir = @kde_appsdir@
+kde_bindir = @kde_bindir@
+kde_confdir = @kde_confdir@
+kde_datadir = @kde_datadir@
+kde_htmldir = @kde_htmldir@
+kde_icondir = @kde_icondir@
+kde_includes = @kde_includes@
+kde_kcfgdir = @kde_kcfgdir@
+kde_libraries = @kde_libraries@
+kde_libs_htmldir = @kde_libs_htmldir@
+kde_libs_prefix = @kde_libs_prefix@
+kde_locale = @kde_locale@
+kde_mimedir = @kde_mimedir@
+kde_moduledir = @kde_moduledir@
+kde_qtver = @kde_qtver@
+kde_servicesdir = @kde_servicesdir@
+kde_servicetypesdir = @kde_servicetypesdir@
+kde_sounddir = @kde_sounddir@
+kde_styledir = @kde_styledir@
+kde_templatesdir = @kde_templatesdir@
+kde_wallpaperdir = @kde_wallpaperdir@
+kde_widgetdir = @kde_widgetdir@
+kdeinitdir = @kdeinitdir@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+qt_includes = @qt_includes@
+qt_libraries = @qt_libraries@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@
+unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@
+x_includes = @x_includes@
+x_libraries = @x_libraries@
+xdg_appsdir = @xdg_appsdir@
+xdg_directorydir = @xdg_directorydir@
+xdg_menudir = @xdg_menudir@
+INCLUDES = -I$(top_srcdir) $(all_includes)
+SUBDIRS = config
+kde_module_LTLIBRARIES = kwin3_SUSE2.la
+kwin3_SUSE2_la_SOURCES = SUSE2.cpp SUSE2client.cpp SUSE2button.cpp misc.cpp shadow.cpp
+kwin3_SUSE2_la_LIBADD = $(LIB_KDEUI) -lkdecorations
+kwin3_SUSE2_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+#>- METASOURCES = AUTO
+linkdir = $(kde_datadir)/kwin/
+link_DATA = SUSE2.desktop
+kwin_pics_data_DATA = titlebar_decor.png
+kwin_pics_datadir = $(kde_datadir)/kwin/pics
+kdisplay_colorscheme_DATA = SUSE2.kcsrc
+kdisplay_colorschemedir = $(kde_datadir)/kdisplay/color-schemes
+EXTRA_DIST = $(kwin_pics_data_DATA) $(link_DATA) $(kdisplay_colorscheme_DATA)
+#>- all: all-recursive
+#>+ 1
+all: docs-am all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+#>- @for dep in $?; do \
+#>- case '$(am__configure_deps)' in \
+#>- *$$dep*) \
+#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+#>- && exit 0; \
+#>- exit 1;; \
+#>- esac; \
+#>- done; \
+#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+#>- cd $(top_srcdir) && \
+#>- $(AUTOMAKE) --gnu src/Makefile
+#>+ 12
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/Makefile
+ cd $(top_srcdir) && perl admin/am_edit src/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-kde_moduleLTLIBRARIES: $(kde_module_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(kde_moduledir)" || $(mkdir_p) "$(DESTDIR)$(kde_moduledir)"
+ @list='$(kde_module_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(kde_moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(kde_moduledir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(kde_moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(kde_moduledir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-kde_moduleLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @set -x; list='$(kde_module_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(kde_moduledir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(kde_moduledir)/$$p"; \
+ done
+
+clean-kde_moduleLTLIBRARIES:
+ -test -z "$(kde_module_LTLIBRARIES)" || rm -f $(kde_module_LTLIBRARIES)
+ @list='$(kde_module_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+#>- kwin3_SUSE2.la: $(kwin3_SUSE2_la_OBJECTS) $(kwin3_SUSE2_la_DEPENDENCIES)
+#>+ 2
+@KDE_USE_CLOSURE_TRUE@kwin3_SUSE2.la: kwin3_SUSE2.la.closure $(kwin3_SUSE2_la_OBJECTS) $(kwin3_SUSE2_la_DEPENDENCIES)
+@KDE_USE_CLOSURE_FALSE@kwin3_SUSE2.la: $(kwin3_SUSE2_la_OBJECTS) $(kwin3_SUSE2_la_DEPENDENCIES)
+ $(CXXLINK) -rpath $(kde_moduledir) $(kwin3_SUSE2_la_LDFLAGS) $(kwin3_SUSE2_la_OBJECTS) $(kwin3_SUSE2_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUSE2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUSE2button.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SUSE2client.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadow.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+install-kdisplay_colorschemeDATA: $(kdisplay_colorscheme_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(kdisplay_colorschemedir)" || $(mkdir_p) "$(DESTDIR)$(kdisplay_colorschemedir)"
+ @list='$(kdisplay_colorscheme_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(kdisplay_colorschemeDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(kdisplay_colorschemedir)/$$f'"; \
+ $(kdisplay_colorschemeDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(kdisplay_colorschemedir)/$$f"; \
+ done
+
+uninstall-kdisplay_colorschemeDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(kdisplay_colorscheme_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(kdisplay_colorschemedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(kdisplay_colorschemedir)/$$f"; \
+ done
+install-kwin_pics_dataDATA: $(kwin_pics_data_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(kwin_pics_datadir)" || $(mkdir_p) "$(DESTDIR)$(kwin_pics_datadir)"
+ @list='$(kwin_pics_data_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(kwin_pics_dataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(kwin_pics_datadir)/$$f'"; \
+ $(kwin_pics_dataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(kwin_pics_datadir)/$$f"; \
+ done
+
+uninstall-kwin_pics_dataDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(kwin_pics_data_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(kwin_pics_datadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(kwin_pics_datadir)/$$f"; \
+ done
+install-linkDATA: $(link_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(linkdir)" || $(mkdir_p) "$(DESTDIR)$(linkdir)"
+ @list='$(link_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(linkDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(linkdir)/$$f'"; \
+ $(linkDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(linkdir)/$$f"; \
+ done
+
+uninstall-linkDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(link_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(linkdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(linkdir)/$$f"; \
+ done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LTLIBRARIES) $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(kde_moduledir)" "$(DESTDIR)$(kdisplay_colorschemedir)" "$(DESTDIR)$(kwin_pics_datadir)" "$(DESTDIR)$(linkdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-recursive
+#>+ 1
+clean: kde-rpo-clean clean-recursive
+
+#>- clean-am: clean-generic clean-kde_moduleLTLIBRARIES clean-libtool \
+#>- mostlyclean-am
+#>+ 2
+clean-am: clean-metasources clean-closures clean-bcheck clean-final clean-generic clean-kde_moduleLTLIBRARIES clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+#>- install-data-am: install-kde_moduleLTLIBRARIES \
+#>- install-kdisplay_colorschemeDATA install-kwin_pics_dataDATA \
+#>- install-linkDATA
+#>+ 3
+install-data-am: \
+ install-kdisplay_colorschemeDATA install-kwin_pics_dataDATA \
+ install-linkDATA
+
+#>- install-exec-am:
+#>+ 1
+install-exec-am: install-kde_moduleLTLIBRARIES
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-kde_moduleLTLIBRARIES \
+ uninstall-kdisplay_colorschemeDATA \
+ uninstall-kwin_pics_dataDATA uninstall-linkDATA
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-kde_moduleLTLIBRARIES clean-libtool \
+ clean-recursive ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-kde_moduleLTLIBRARIES \
+ install-kdisplay_colorschemeDATA install-kwin_pics_dataDATA \
+ install-linkDATA install-man install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am uninstall-info-am \
+ uninstall-kde_moduleLTLIBRARIES \
+ uninstall-kdisplay_colorschemeDATA \
+ uninstall-kwin_pics_dataDATA uninstall-linkDATA
+
+
+messages: rc.cpp
+ $(EXTRACTRC) config/*.ui >> rc.cpp
+ $(XGETTEXT) *.cpp config/*.cpp -o $(podir)/kwin_SUSE2.pot
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 8
+kwin3_SUSE2.la.closure: $(kwin3_SUSE2_la_OBJECTS) $(kwin3_SUSE2_la_DEPENDENCIES)
+ @echo "int main() {return 0;}" > kwin3_SUSE2_la_closure.cpp
+ @$(LTCXXCOMPILE) -c kwin3_SUSE2_la_closure.cpp
+ $(CXXLINK) kwin3_SUSE2_la_closure.lo $(kwin3_SUSE2_la_LDFLAGS) $(kwin3_SUSE2_la_OBJECTS) $(kwin3_SUSE2_la_LIBADD) $(LIBS)
+ @rm -f kwin3_SUSE2_la_closure.* kwin3_SUSE2.la.closure
+ @echo "timestamp" > kwin3_SUSE2.la.closure
+
+
+#>+ 3
+SUSE2button.moc: $(srcdir)/SUSE2button.h
+ $(MOC) $(srcdir)/SUSE2button.h -o SUSE2button.moc
+
+#>+ 2
+mocs: SUSE2button.moc
+
+#>+ 3
+SUSE2.moc: $(srcdir)/SUSE2.h
+ $(MOC) $(srcdir)/SUSE2.h -o SUSE2.moc
+
+#>+ 2
+mocs: SUSE2.moc
+
+#>+ 3
+clean-metasources:
+ -rm -f SUSE2button.moc SUSE2.moc
+
+#>+ 2
+KDE_DIST=shadow.h SUSE2button.h misc.h SUSE2client.h SUSE2.kcsrc titlebar_decor.png Makefile.in SUSE2.desktop SUSE2.h Makefile.am
+
+#>+ 3
+clean-closures:
+ -rm -f kwin3_SUSE2.la.closure
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/Makefile
+ cd $(top_srcdir) && perl admin/am_edit src/Makefile.in
+
+
+#>+ 21
+clean-bcheck:
+ rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-recursive
+
+bcheck-am:
+ @for i in ; do \
+ if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+ echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+ echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+ echo "$$i"; \
+ if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+ rm -f $$i.bchecktest.cc; exit 1; \
+ fi ; \
+ echo "" >> $$i.bchecktest.cc.class; \
+ perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+ rm -f a.out; \
+ fi ; \
+ done
+
+
+#>+ 11
+kwin3_SUSE2_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/SUSE2.cpp $(srcdir)/SUSE2client.cpp $(srcdir)/SUSE2button.cpp $(srcdir)/misc.cpp $(srcdir)/shadow.cpp SUSE2button.moc SUSE2.moc
+ @echo 'creating kwin3_SUSE2_la.all_cpp.cpp ...'; \
+ rm -f kwin3_SUSE2_la.all_cpp.files kwin3_SUSE2_la.all_cpp.final; \
+ echo "#define KDE_USE_FINAL 1" >> kwin3_SUSE2_la.all_cpp.final; \
+ for file in SUSE2.cpp SUSE2client.cpp SUSE2button.cpp misc.cpp shadow.cpp ; do \
+ echo "#include \"$$file\"" >> kwin3_SUSE2_la.all_cpp.files; \
+ test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> kwin3_SUSE2_la.all_cpp.final; \
+ done; \
+ cat kwin3_SUSE2_la.all_cpp.final kwin3_SUSE2_la.all_cpp.files > kwin3_SUSE2_la.all_cpp.cpp; \
+ rm -f kwin3_SUSE2_la.all_cpp.final kwin3_SUSE2_la.all_cpp.files
+
+#>+ 3
+clean-final:
+ -rm -f kwin3_SUSE2_la.all_cpp.cpp
+
+#>+ 3
+final:
+ $(MAKE) kwin3_SUSE2_la_OBJECTS="$(kwin3_SUSE2_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+ $(MAKE) kwin3_SUSE2_la_OBJECTS="$(kwin3_SUSE2_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+ $(MAKE) kwin3_SUSE2_la_OBJECTS="$(kwin3_SUSE2_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+ $(MAKE) kwin3_SUSE2_la_OBJECTS="$(kwin3_SUSE2_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+ -rm -f *.rpo
+
+#>+ 7
+nmcheck:
+SUSE2button.o: SUSE2button.moc
+SUSE2.o: SUSE2.moc
+nmcheck-am: nmcheck
+SUSE2.lo: SUSE2.moc
+SUSE2button.lo: SUSE2button.moc
diff --git a/src/SUSE2.cpp b/src/SUSE2.cpp
new file mode 100644
index 0000000..971d146
--- /dev/null
+++ b/src/SUSE2.cpp
@@ -0,0 +1,334 @@
+/* SuSE KWin window decoration
+ Copyright (C) 2005 Gerd Fleischer <gerdfleischer@web.de>
+ Copyright (C) 2005 Adrian Schroeter <adrian@suse.de>
+
+ based on the window decoration "Plastik" and "Web":
+ Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
+ Copyright (C) 2001 Rik Hemsley (rikkus) <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 St, Fifth Floor,
+ Boston, MA 02110-1301 USA.
+*/
+
+//#include <kdebug.h>
+
+#include <qpainter.h>
+#include <qbitmap.h>
+
+#include <kconfig.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <kstandarddirs.h>
+#include <kpixmap.h>
+
+#include "misc.h"
+#include "shadow.h"
+#include "SUSE2.h"
+#include "SUSE2.moc"
+#include "SUSE2client.h"
+#include "SUSE2button.h"
+
+namespace KWinSUSE2
+{
+
+SUSE2Handler::SUSE2Handler()
+{
+ memset(m_pixmaps, 0, sizeof(QPixmap *) * NumButtonStatus * NumButtonIcons); // set elements to 0
+
+ KGlobal::locale()->insertCatalogue("kwin_clients");
+ KGlobal::locale()->insertCatalogue("kwin_SUSE2");
+
+ reset(0);
+}
+
+SUSE2Handler::~SUSE2Handler()
+{
+ for (int t = 0; t < NumButtonStatus; ++t)
+ for (int i = 0; i < NumButtonIcons; ++i)
+ delete m_pixmaps[t][i];
+}
+
+bool SUSE2Handler::reset(unsigned long /*changed*/)
+{
+ // we assume the active font to be the same as the inactive font since the control
+ // center doesn't offer different settings anyways.
+ m_titleFont = KDecoration::options()->font(true, false); // not small
+ m_titleFontTool = KDecoration::options()->font(true, true); // small
+
+ switch(KDecoration::options()->preferredBorderSize( this )) {
+ case BorderTiny:
+ m_borderSize = 3;
+ break;
+ case BorderLarge:
+ m_borderSize = 8;
+ break;
+ case BorderVeryLarge:
+ m_borderSize = 12;
+ break;
+ case BorderHuge:
+ m_borderSize = 18;
+ break;
+ case BorderVeryHuge:
+ m_borderSize = 27;
+ break;
+ case BorderOversized:
+ m_borderSize = 40;
+ break;
+ case BorderNormal:
+ default:
+ m_borderSize = 4;
+ }
+
+ // check if we are in reverse layout mode
+ m_reverse = QApplication::reverseLayout();
+
+ // read in the configuration
+ readConfig();
+
+ for (int t = 0; t < NumButtonStatus; ++t) {
+ for (int i = 0; i < NumButtonIcons; ++i) {
+ if (m_pixmaps[t][i]) {
+ delete m_pixmaps[t][i];
+ m_pixmaps[t][i] = 0;
+ }
+ }
+ }
+
+ /// I dont want to do smart things here
+ /// just for cases that do not happen very often.
+ return true;
+}
+
+KDecoration* SUSE2Handler::createDecoration( KDecorationBridge* bridge )
+{
+ return new SUSE2Client( bridge, this );
+}
+
+bool SUSE2Handler::supports( Ability ability ) const
+{
+ switch( ability )
+ {
+ case AbilityAnnounceButtons:
+ case AbilityButtonMenu:
+ case AbilityButtonOnAllDesktops:
+ case AbilityButtonSpacer:
+ case AbilityButtonHelp:
+ case AbilityButtonMinimize:
+ case AbilityButtonMaximize:
+ case AbilityButtonClose:
+ case AbilityButtonAboveOthers:
+ case AbilityButtonBelowOthers:
+ case AbilityButtonShade:
+ return true;
+ default:
+ return false;
+ };
+}
+
+void SUSE2Handler::readConfig()
+{
+ // create a config object
+ KConfig config("kwinSUSE2rc");
+ config.setGroup("General");
+
+ // grab settings
+ QString alignValue = config.readEntry("TitleAlignment", "AlignLeft");
+ if (alignValue == "AlignLeft") m_titleAlign = Qt::AlignLeft;
+ else if (alignValue == "AlignHCenter") m_titleAlign = Qt::AlignHCenter;
+ else if (alignValue == "AlignRight") m_titleAlign = Qt::AlignRight;
+
+ QString roundValue = config.readEntry("RoundCorners", "NotMaximized");
+ if (roundValue == "RoundAlways") m_roundCorners = 1;
+ else if (roundValue == "NotMaximized") m_roundCorners = 2;
+ else if (roundValue == "RoundNever") m_roundCorners = 3;
+
+ m_menuClose = config.readBoolEntry("CloseOnMenuDoubleClick", true);
+ m_titleShadow = config.readBoolEntry("TitleShadow", true);
+
+ QFontMetrics fm(m_titleFont); // active font = inactive font
+ int addSpace = config.readNumEntry("AddSpace", 4);
+ // The title should stretch with bigger font sizes!
+ m_titleHeight = QMAX(16, fm.height() + addSpace);
+
+ fm = QFontMetrics(m_titleFontTool); // active font = inactive font
+ m_titleHeightTool = QMAX(13, fm.height() ); // don't care about the shadow etc.
+
+ m_titlebarStyle = config.readNumEntry("TitleBarStyle", 0);
+
+ m_buttonType = config.readNumEntry("TitleBarButtonType", 0);
+ m_customColors = config.readBoolEntry("CustomColors", false);
+ m_useTitleProps = config.readBoolEntry("UseTitleProps", false);
+ m_animateButtons = config.readBoolEntry("AnimateButtons", true);
+ m_redCloseButton = config.readBoolEntry("RedCloseButton", false);
+ m_iconSize = (config.readNumEntry("IconSize", 45))/100.0;
+ m_customIconColors = config.readBoolEntry("CustomIconColors", false);
+ QColor afgcolor = QColor(10, 20, 40);
+ m_aFgColor = config.readColorEntry("AFgColor", &afgcolor);
+ QColor abgcolor = QColor(210, 220, 240);
+ m_aBgColor = config.readColorEntry("ABgColor", &abgcolor);
+ QColor ifgcolor = QColor(40, 40, 40);
+ m_iFgColor = config.readColorEntry("IFgColor", &ifgcolor);
+ QColor ibgcolor = QColor(240, 240, 240);
+ m_iBgColor = config.readColorEntry("IBgColor", &ibgcolor);
+ m_iconShadow = config.readBoolEntry("IconShadow", false);
+
+ m_titleLogo = config.readBoolEntry("TitleBarLogo", true);
+ m_titleLogoOffset = config.readNumEntry("TitleBarLogoOffset", 3);
+ m_titleLogoURL = config.readEntry("TitleBarLogoURL", locate("data", "kwin/pics/titlebar_decor.png"));
+}
+
+QColor SUSE2Handler::getColor(KWinSUSE2::ColorType type, const bool active) const
+{
+ switch (type) {
+ case TitleGradientFrom:
+ return KDecoration::options()->color(ColorTitleBar, active);
+ break;
+ case TitleGradientTo:
+ return KDecoration::options()->color(ColorTitleBlend, active);
+ break;
+ case WindowContour:
+ case Border:
+ return KDecoration::options()->color(ColorFrame, active);
+ break;
+ case TitleFont:
+ return KDecoration::options()->color(ColorFont, active);
+ break;
+ case BtnBg:
+ return KDecoration::options()->color(ColorButtonBg, active);
+ break;
+ default:
+ return Qt::black;
+ }
+}
+
+const KPixmap &SUSE2Handler::buttonPixmap(ButtonIcon type, int size, ButtonStatus status)
+{
+ if (m_pixmaps[status][type]) {
+ if (status != Shadow && m_pixmaps[status][type]->size() == QSize(size, size))
+ return *m_pixmaps[status][type];
+ else if (status == Shadow && m_pixmaps[status][type]->size() == QSize(size+4, size+4))
+ return *m_pixmaps[status][type];
+ }
+
+ // no matching pixmap found, create a new one...
+
+ delete m_pixmaps[status][type];
+ m_pixmaps[status][type] = 0;
+
+ QColor aDecoFgDark = alphaBlendColors(getColor(TitleGradientTo, true), Qt::black, 50);
+ QColor aDecoFgLight = alphaBlendColors(getColor(TitleGradientTo, true), Qt::white, 50);
+ QColor iDecoFgDark = alphaBlendColors(getColor(TitleGradientTo, false), Qt::black, 50);
+ QColor iDecoFgLight = alphaBlendColors(getColor(TitleGradientTo, false), Qt::white, 50);
+
+ if (m_customIconColors && !m_useTitleProps) {
+ aDecoFgDark = m_aFgColor;
+ aDecoFgLight = m_aBgColor;
+ iDecoFgDark = m_iFgColor;
+ iDecoFgLight = m_iBgColor;
+ }
+
+ KPixmap icon = IconEngine::icon(type, size);
+ QImage img = icon.convertToImage();
+
+ KPixmap *pixmap;
+ QImage tmpImage;
+ ShadowEngine se;
+ QPainter painter;
+ KPixmap tmpShadow;
+ switch (status) {
+ case ActiveUp:
+ if (m_useTitleProps)
+ tmpImage = recolorImage(&img, getColor(TitleFont, true));
+ else
+ tmpImage = recolorImage(&img, aDecoFgDark);
+
+ pixmap = new KPixmap(tmpImage);
+ break;
+ case ActiveDown:
+ if (m_useTitleProps)
+ tmpImage = recolorImage(&img, getColor(TitleFont, true));
+ else
+ tmpImage = recolorImage(&img, aDecoFgLight);
+
+ pixmap = new KPixmap(tmpImage);
+ break;
+ case InactiveUp:
+ if (m_useTitleProps)
+ tmpImage = recolorImage(&img, getColor(TitleFont, false));
+ else
+ tmpImage = recolorImage(&img, iDecoFgDark);
+
+ pixmap = new KPixmap(tmpImage);
+ break;
+ case InactiveDown:
+ if (m_useTitleProps)
+ tmpImage = recolorImage(&img, getColor(TitleFont, false));
+ else
+ tmpImage = recolorImage(&img, iDecoFgLight);
+
+ pixmap = new KPixmap(tmpImage);
+ break;
+ case Shadow:
+ // prepare shadow
+ tmpShadow = QPixmap(icon.width()+4, icon.height()+4);
+ tmpShadow.fill(QColor(0,0,0));
+ tmpShadow.setMask(tmpShadow.createHeuristicMask(true));
+ painter.begin(&tmpShadow);
+ painter.setPen(white);
+ painter.drawPixmap(0,0, icon);
+ painter.end();
+ tmpImage = se.makeShadow(tmpShadow, QColor(0, 0, 0));
+ pixmap = new KPixmap(tmpImage);
+ break;
+ default:
+ pixmap = new KPixmap();
+ }
+
+ m_pixmaps[status][type] = pixmap;
+ return *pixmap;
+}
+
+QValueList< SUSE2Handler::BorderSize >
+SUSE2Handler::borderSizes() const
+{
+ // the list must be sorted
+ return QValueList< BorderSize >() << BorderTiny << BorderNormal <<
+ BorderLarge << BorderVeryLarge << BorderHuge <<
+ BorderVeryHuge << BorderOversized;
+}
+
+static SUSE2Handler *handler = 0;
+
+SUSE2Handler *Handler()
+{
+ return handler;
+}
+
+} // KWinSUSE2
+
+//////////////////////////////////////////////////////////////////////////////
+// Plugin Stuff //
+//////////////////////////////////////////////////////////////////////////////
+
+extern "C"
+{
+ KDE_EXPORT KDecorationFactory *create_factory()
+ {
+ KWinSUSE2::handler = new KWinSUSE2::SUSE2Handler();
+ return KWinSUSE2::handler;
+ }
+}
+
+// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/src/SUSE2.desktop b/src/SUSE2.desktop
new file mode 100644
index 0000000..906eadd
--- /dev/null
+++ b/src/SUSE2.desktop
@@ -0,0 +1,4 @@
+[Desktop Entry]
+Name=SUSE2
+Name[xx]=xxSUSE2xx
+X-KDE-Library=kwin3_SUSE2
diff --git a/src/SUSE2.h b/src/SUSE2.h
new file mode 100644
index 0000000..463f1ce
--- /dev/null
+++ b/src/SUSE2.h
@@ -0,0 +1,146 @@
+/* SuSE KWin window decoration
+ Copyright (C) 2005 Gerd Fleischer <gerdfleischer@web.de>
+ Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
+
+ based on the window decoration "Web":
+ Copyright (C) 2001 Rik Hemsley (rikkus) <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 St, Fifth Floor,
+ Boston, MA 02110-1301 USA.
+*/
+
+#ifndef SUSE2_H
+#define SUSE2_H
+
+#include <qfont.h>
+
+#include <kdecoration.h>
+#include <kdecorationfactory.h>
+
+namespace KWinSUSE2 {
+
+enum ButtonStatus {
+ ActiveUp = 0,
+ ActiveDown,
+ InactiveUp,
+ InactiveDown,
+ Shadow,
+ NumButtonStatus
+};
+
+enum ButtonIcon {
+ CloseIcon = 0,
+ MaxIcon,
+ MaxRestoreIcon,
+ MinIcon,
+ HelpIcon,
+ OnAllDesktopsIcon,
+ NotOnAllDesktopsIcon,
+ KeepAboveIcon,
+ NoKeepAboveIcon,
+ KeepBelowIcon,
+ NoKeepBelowIcon,
+ ShadeIcon,
+ UnShadeIcon,
+ NumButtonIcons
+};
+
+enum ColorType {
+ WindowContour = 0,
+ TitleGradientFrom,
+ TitleGradientTo,
+ Border,
+ TitleFont,
+ BtnBg
+};
+
+class SUSE2Handler: public QObject, public KDecorationFactory
+{
+ Q_OBJECT
+public:
+ SUSE2Handler();
+ ~SUSE2Handler();
+ virtual bool reset( unsigned long changed );
+
+ virtual KDecoration *createDecoration( KDecorationBridge * );
+ virtual bool supports( Ability ability ) const;
+
+ const KPixmap &buttonPixmap(ButtonIcon type, int size, ButtonStatus status);
+
+ int titleHeight() const { return m_titleHeight; }
+ int titleHeightTool() const { return m_titleHeightTool; }
+ QFont titleFont() const { return m_titleFont; }
+ QFont titleFontTool() const { return m_titleFontTool; }
+ bool titleLogo() const { return m_titleLogo; }
+ int titleLogoOffset() const { return m_titleLogoOffset; }
+ QString titleLogoURL() const { return m_titleLogoURL; }
+ bool titleShadow() const { return m_titleShadow; }
+ int borderSize() const { return m_borderSize; }
+ int titlebarStyle() const { return m_titlebarStyle; }
+ int buttonType() const { return m_buttonType; }
+ bool customColors() const { return m_customColors; }
+ bool useTitleProps() const { return m_useTitleProps; }
+ bool animateButtons() const { return m_animateButtons; }
+ bool redCloseButton() const { return m_redCloseButton; }
+ float iconSize() const { return m_iconSize; }
+ bool iconShadow() const { return m_iconShadow; }
+ bool menuClose() const { return m_menuClose; }
+ Qt::AlignmentFlags titleAlign() const { return m_titleAlign; }
+ int roundCorners() const { return m_roundCorners; }
+ bool reverseLayout() const { return m_reverse; }
+ QColor getColor(KWinSUSE2::ColorType type, const bool active = true) const;
+ QValueList< SUSE2Handler::BorderSize > borderSizes() const;
+
+private:
+ void readConfig();
+
+ bool m_titleLogo;
+ bool m_titleShadow;
+ bool m_shrinkBorders;
+ int m_buttonType;
+ bool m_customColors;
+ float m_iconSize;
+ int m_titlebarStyle;
+ bool m_customIconColors;
+ QColor m_aFgColor;
+ QColor m_aBgColor;
+ QColor m_iFgColor;
+ QColor m_iBgColor;
+ bool m_iconShadow;
+ bool m_animateButtons;
+ bool m_redCloseButton;
+ bool m_menuClose;
+ bool m_reverse;
+ int m_borderSize;
+ int m_titleHeight;
+ int m_titleHeightTool;
+ QFont m_titleFont;
+ QFont m_titleFontTool;
+ Qt::AlignmentFlags m_titleAlign;
+ int m_roundCorners;
+ int m_titleLogoOffset;
+ QString m_titleLogoURL;
+ bool m_useTitleProps;
+
+ KPixmap *m_pixmaps[NumButtonStatus][NumButtonIcons];
+};
+
+SUSE2Handler* Handler();
+
+} // KWinSUSE2
+
+#endif
+
+// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/src/SUSE2.kcsrc b/src/SUSE2.kcsrc
new file mode 100644
index 0000000..5fd21ee
--- /dev/null
+++ b/src/SUSE2.kcsrc
@@ -0,0 +1,27 @@
+[Color Scheme]
+Name=SUSE2
+Name[xx]=xxSUSE2xx
+activeBackground=82,129,205
+activeBlend=44,85,177
+activeForeground=255,255,255
+activeTitleBtnBg=55,95,190
+alternateBackground=238,246,255
+background=238,238,238
+buttonBackground=244,244,244
+buttonForeground=0,0,0
+contrast=7
+foreground=0,0,0
+frame=40,40,40
+handle=238,238,238
+inactiveBackground=238,238,238
+inactiveBlend=207,207,207
+inactiveForeground=0,0,0
+inactiveFrame=132,132,132
+inactiveHandle=238,238,238
+inactiveTitleBtnBg=195,195,195
+linkColor=83,83,120
+selectBackground=68,123,205
+selectForeground=255,255,255
+visitedLinkColor=0,64,0
+windowBackground=255,255,255
+windowForeground=0,0,0
diff --git a/src/SUSE2button.cpp b/src/SUSE2button.cpp
new file mode 100644
index 0000000..8665ff2
--- /dev/null
+++ b/src/SUSE2button.cpp
@@ -0,0 +1,983 @@
+/* SUSE KWin window decoration
+ Copyright (C) 2005 Gerd Fleischer <gerdfleischer@web.de>
+ Copyright (C) 2005 Adrian Schroeter <adrian@suse.de>
+
+ based on the window decoration "Plastik" and "Web":
+ Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
+ Copyright (C) 2001 Rik Hemsley (rikkus) <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 St, Fifth Floor,
+ Boston, MA 02110-1301 USA.
+*/
+
+#include <kdebug.h>
+
+#include <math.h>
+
+#include <qbitmap.h>
+#include <qcursor.h>
+#include <qimage.h>
+#include <qpainter.h>
+#include <qpixmap.h>
+#include <qtooltip.h>
+#include <qtimer.h>
+
+#include <kpixmap.h>
+#include <kpixmapeffect.h>
+#include <kdecoration.h>
+
+#include "misc.h"
+#include "shadow.h"
+#include "SUSE2client.h"
+#include "SUSE2button.h"
+#include "SUSE2button.moc"
+
+#define PLASTIK_FLAT 0
+#define LIPSTIK_FLAT 1
+#define PLASTIK_3D 2
+#define LIPSTIK_3D 3
+#define LIPSTIK_BRIGHT 4
+
+namespace KWinSUSE2
+{
+
+SUSE2Button::SUSE2Button(ButtonType type, SUSE2Client *parent, const char *name)
+ : KCommonDecorationButton(type, parent, name),
+ m_client(parent),
+ m_iconType(NumButtonIcons),
+ hover(false)
+{
+ memset(lipstikCache, 0, sizeof(QPixmap*)*(8 + 3*(ANIMATIONSTEPS+1))*2); // set elements to 0
+
+ setBackgroundMode(NoBackground);
+
+ animTmr = new QTimer(this);
+ connect(animTmr, SIGNAL(timeout() ), this, SLOT(animate() ) );
+ animProgress = 0;
+}
+
+SUSE2Button::~SUSE2Button()
+{
+ for (uint t = 0; t < (8 + 3*ANIMATIONSTEPS+1); ++t)
+ for (int i = 0; i < 2; ++i)
+ delete lipstikCache[t][i];
+}
+
+void SUSE2Button::reset(unsigned long changed)
+{
+ if (changed&DecorationReset || changed&ManualReset || changed&SizeChange || changed&StateChange) {
+ switch (type()) {
+ case CloseButton:
+ m_iconType = CloseIcon;
+ break;
+ case HelpButton:
+ m_iconType = HelpIcon;
+ break;
+ case MinButton:
+ m_iconType = MinIcon;
+ break;
+ case MaxButton:
+ if (isOn()) {
+ m_iconType = MaxRestoreIcon;
+ } else {
+ m_iconType = MaxIcon;
+ }
+ break;
+ case OnAllDesktopsButton:
+ if (isOn()) {
+ m_iconType = NotOnAllDesktopsIcon;
+ } else {
+ m_iconType = OnAllDesktopsIcon;
+ }
+ break;
+ case ShadeButton:
+ if (isOn()) {
+ m_iconType = UnShadeIcon;
+ } else {
+ m_iconType = ShadeIcon;
+ }
+ break;
+ case AboveButton:
+ if (isOn()) {
+ m_iconType = NoKeepAboveIcon;
+ } else {
+ m_iconType = KeepAboveIcon;
+ }
+ break;
+ case BelowButton:
+ if (isOn()) {
+ m_iconType = NoKeepBelowIcon;
+ } else {
+ m_iconType = KeepBelowIcon;
+ }
+ break;
+ default:
+ m_iconType = NumButtonIcons;
+ break;
+ }
+
+ for (uint t = 0; t < (8 + 3*(ANIMATIONSTEPS+1)); ++t) {
+ for (int i = 0; i < 2; ++i) {
+ if (lipstikCache[t][i]) {
+ delete lipstikCache[t][i];
+ lipstikCache[t][i] = 0;
+ }
+ }
+ }
+
+ this->update();
+ }
+}
+
+void SUSE2Button::animate()
+{
+ animTmr->stop();
+
+ if(hover) {
+ if(animProgress < ANIMATIONSTEPS) {
+ if (Handler()->animateButtons() ) {
+ animProgress++;
+ } else {
+ animProgress = ANIMATIONSTEPS;
+ }
+ animTmr->start(TIMERINTERVAL, true); // single-shot
+ }
+ } else {
+ if(animProgress > 0) {
+ if (Handler()->animateButtons() ) {
+ animProgress--;
+ } else {
+ animProgress = 0;
+ }
+ animTmr->start(TIMERINTERVAL, true); // single-shot
+ }
+ }
+
+ repaint(false);
+}
+
+void SUSE2Button::enterEvent(QEvent *e)
+{
+ QButton::enterEvent(e);
+
+ hover = true;
+ animate();
+// repaint(false);
+}
+
+void SUSE2Button::leaveEvent(QEvent *e)
+{
+ QButton::leaveEvent(e);
+
+ hover = false;
+ animate();
+// repaint(false);
+}
+
+void SUSE2Button::drawButton(QPainter *painter)
+{
+ int type = Handler()->buttonType();
+
+ switch (type) {
+ case PLASTIK_FLAT:
+ case LIPSTIK_FLAT:
+ case LIPSTIK_BRIGHT:
+ drawPlastikBtn(painter);
+ break;
+ case PLASTIK_3D:
+ case LIPSTIK_3D:
+ drawLipstikBtn(painter);
+ break;
+ default:
+ drawPlastikBtn(painter);
+ break;
+ }
+}
+
+void SUSE2Button::drawPlastikBtn(QPainter *painter)
+{
+ QRect r(0, 0, width(), height());
+
+ bool active = m_client->isActive();
+ bool down = isDown();
+ KPixmap backgroundTile = m_client->getTitleBarTile(active);
+ KPixmap tempKPixmap;
+
+ QColor highlightColor;
+ if(type() == CloseButton) {
+ highlightColor = QColor(255,64,0);
+ } else {
+ highlightColor = Qt::white;
+ }
+
+ QColor contourTop = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active),
+ Qt::black, 220);
+ QColor contourBottom = alphaBlendColors(Handler()->getColor(TitleGradientTo, active),
+ Qt::black, 220);
+ QColor surfaceTop = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active),
+ Qt::white, 220);
+ QColor surfaceBottom = alphaBlendColors(Handler()->getColor(TitleGradientTo, active),
+ Qt::white, 220);
+
+ if (type() == CloseButton && active && Handler()->redCloseButton()) {
+ contourTop = QColor(170,70,70);
+ contourBottom = QColor(120,50,50);
+ surfaceTop = QColor(255,70,70);
+ surfaceBottom = QColor(170,50,50);
+ highlightColor = QColor(140,10,10);
+ } else if (Handler()->customColors()) {
+ contourTop = alphaBlendColors(Handler()->getColor(BtnBg, active), Qt::black, 185);
+ contourBottom = alphaBlendColors(Handler()->getColor(BtnBg, active), Qt::black, 135);
+ surfaceTop = Handler()->getColor(BtnBg, active);
+ surfaceBottom = alphaBlendColors(Handler()->getColor(BtnBg, active), Qt::black, 185);
+ }
+
+
+ int highlightAlpha = static_cast<int>(255-((60/static_cast<double>(ANIMATIONSTEPS))*
+ static_cast<double>(animProgress) ) );
+ contourTop = alphaBlendColors(contourTop, highlightColor, highlightAlpha );
+ contourBottom = alphaBlendColors(contourBottom, highlightColor, highlightAlpha);
+ surfaceTop = alphaBlendColors(surfaceTop, highlightColor, highlightAlpha);
+ surfaceBottom = alphaBlendColors(surfaceBottom, highlightColor, highlightAlpha);
+
+ if (down) {
+ contourTop = alphaBlendColors(contourTop, Qt::black, 200);
+ contourBottom = alphaBlendColors(contourBottom, Qt::black, 200);
+ surfaceTop = alphaBlendColors(surfaceTop, Qt::black, 200);
+ surfaceBottom = alphaBlendColors(surfaceBottom, Qt::black, 200);
+ }
+
+ KPixmap buffer;
+ buffer.resize(width(), height());
+ QPainter bP(&buffer);
+
+ // fill with the titlebar background
+ bP.drawTiledPixmap(0, 0, width(), width(), backgroundTile, 0, TOPMARGIN);
+
+ if (type() == MenuButton) {
+ KPixmap menuIcon(m_client->icon().pixmap( QIconSet::Small, QIconSet::Normal));
+ if (width() < menuIcon.width() || height() < menuIcon.height() ) {
+ menuIcon.convertFromImage( menuIcon.convertToImage().smoothScale(width(), height()));
+ }
+ double fade = animProgress * 0.09;
+ KPixmapEffect::fade(menuIcon, fade, QColor(240, 240, 240));
+ bP.drawPixmap((width()-menuIcon.width())/2, (height()-menuIcon.height())/2, menuIcon);
+ } else {
+ // contour
+ bP.setPen(contourTop);
+ bP.drawLine(r.x()+2, r.y(), r.right()-2, r.y() );
+ bP.drawPoint(r.x()+1, r.y()+1);
+ bP.drawPoint(r.right()-1, r.y()+1);
+ bP.setPen(contourBottom);
+ bP.drawLine(r.x()+2, r.bottom(), r.right()-2, r.bottom() );
+ bP.drawPoint(r.x()+1, r.bottom()-1);
+ bP.drawPoint(r.right()-1, r.bottom()-1);
+ // sides of the contour
+ tempKPixmap.resize(1, r.height()-2*2);
+ KPixmapEffect::gradient(tempKPixmap,
+ contourTop,
+ contourBottom,
+ KPixmapEffect::VerticalGradient);
+ bP.drawPixmap(r.x(), r.y()+2, tempKPixmap);
+ bP.drawPixmap(r.right(), r.y()+2, tempKPixmap);
+ // sort of anti-alias for the contour
+ bP.setPen(alphaBlendColors(Handler()->getColor(TitleGradientFrom, active),
+ contourTop, 150) );
+ bP.drawPoint(r.x()+1, r.y());
+ bP.drawPoint(r.right()-1, r.y());
+ bP.drawPoint(r.x(), r.y()+1);
+ bP.drawPoint(r.right(), r.y()+1);
+ bP.setPen(alphaBlendColors(Handler()->getColor(TitleGradientTo, active),
+ contourBottom, 150) );
+ bP.drawPoint(r.x()+1, r.bottom());
+ bP.drawPoint(r.right()-1, r.bottom());
+ bP.drawPoint(r.x(), r.bottom()-1);
+ bP.drawPoint(r.right(), r.bottom()-1);
+
+ // surface
+ // fill top and bottom
+ if (Handler()->buttonType() == PLASTIK_FLAT) {
+ bP.setPen(surfaceTop);
+ bP.drawLine(r.x()+2, r.y()+1, r.right()-2, r.y()+1 );
+ bP.setPen(surfaceBottom);
+ bP.drawLine(r.x()+2, r.bottom()-1, r.right()-2, r.bottom()-1 );
+ } else if (Handler()->buttonType() == LIPSTIK_FLAT || down) {
+ bP.setPen(surfaceBottom);
+ bP.drawLine(r.x()+2, r.y()+1, r.right()-2, r.y()+1 );
+ bP.setPen(surfaceTop);
+ bP.drawLine(r.x()+2, r.bottom()-1, r.right()-2, r.bottom()-1 );
+ } else {
+ bP.setPen(surfaceBottom.light(117));
+ bP.drawLine(r.x()+2, r.y()+1, r.right()-2, r.y()+1 );
+ bP.setPen(surfaceTop.dark(122));
+ bP.drawLine(r.x()+2, r.bottom()-1, r.right()-2, r.bottom()-1 );
+ }
+
+ // fill the rest! :)
+ tempKPixmap.resize(1, r.height()-2*2);
+ if (Handler()->buttonType() == PLASTIK_FLAT) {
+ KPixmapEffect::gradient(tempKPixmap,
+ surfaceTop,
+ surfaceBottom,
+ KPixmapEffect::VerticalGradient);
+ } else {
+ KPixmapEffect::gradient(tempKPixmap,
+ surfaceBottom,
+ surfaceTop,
+ KPixmapEffect::VerticalGradient);
+ }
+ bP.drawTiledPixmap(r.x()+1, r.y()+2, r.width()-2, r.height()-4, tempKPixmap);
+
+ int dX,dY;
+ KPixmap deco;
+ int s = lroundf(r.height()*Handler()->iconSize());
+ if ((s + r.height())%2 != 0) --s;
+
+ if (down) {
+ deco = active ? Handler()->buttonPixmap(m_iconType, s, ActiveDown) : Handler()->buttonPixmap(m_iconType, s, InactiveDown);
+ } else {
+ deco = active ? Handler()->buttonPixmap(m_iconType, s, ActiveUp) : Handler()->buttonPixmap(m_iconType, s, InactiveUp);
+ }
+ dX = r.x()+(r.width()-deco.width())/2;
+ dY = r.y()+(r.height()-deco.height())/2;
+ if (down) {
+ dY++;
+ }
+
+ if(active && !down &&
+ (Handler()->useTitleProps() && Handler()->titleShadow() || Handler()->iconShadow())) {
+ bP.drawPixmap(dX+1, dY+1, Handler()->buttonPixmap(m_iconType, s, Shadow));
+ }
+
+ bP.drawPixmap(dX, dY, deco);
+ }
+
+ bP.end();
+ painter->drawPixmap(0, 0, buffer);
+}
+
+void SUSE2Button::drawLipstikBtn(QPainter *painter)
+{
+ QRect r(0, 0, width(), height());
+
+ bool active = m_client->isActive();
+ bool down = isDown();
+ KPixmap backgroundTile = m_client->getTitleBarTile(active);
+
+ KPixmap buffer;
+ buffer.resize(width(), height());
+ QPainter bP(&buffer);
+
+ // fill with the titlebar background
+ bP.drawTiledPixmap(0, 0, width(), width(), backgroundTile, 0, TOPMARGIN);
+
+ if (type() == MenuButton)
+ {
+ KPixmap menuIcon(m_client->icon().pixmap( QIconSet::Small, QIconSet::Normal));
+ if (width() < menuIcon.width() || height() < menuIcon.height() ) {
+ menuIcon.convertFromImage( menuIcon.convertToImage().smoothScale(width(), height()));
+ }
+ double fade = animProgress * 0.09;
+ KPixmapEffect::fade(menuIcon, fade, QColor(240, 240, 240));
+ bP.drawPixmap((width()-menuIcon.width())/2, (height()-menuIcon.height())/2, menuIcon);
+ } else {
+ renderBtnContour(&bP, r);
+ if (down) {
+ QColor downColor;
+ if (type() == CloseButton && active && Handler()->redCloseButton()) {
+ downColor = QColor(220,65,65).dark(115);
+ } else if (Handler()->customColors()) {
+ downColor = Handler()->getColor(BtnBg, active).dark(115);
+ } else {
+ downColor = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), Qt::black, 220).dark(115);
+ }
+ bP.fillRect(r.left()+1, r.top()+2, r.width()-2, r.height()-4, downColor);
+ bP.setPen(downColor);
+ // top line
+ bP.drawLine(r.left()+2, r.top()+1, r.right()-2, r.top()+1);
+ // bottom and right lines
+ bP.setPen(downColor.light(106));
+ bP.drawLine(r.left()+2, r.bottom()-1, r.right()-2, r.bottom()-1);
+ bP.drawLine(r.right()-1, r.top()+2, r.right()-1, r.bottom()-2);
+ } else {
+ renderBtnSurface(&bP, QRect(r.left()+1, r.top()+1, r.width()-2, r.height()-2));
+ }
+
+ int dX,dY;
+ KPixmap deco;
+ int s = lroundf(r.height() * Handler()->iconSize());
+ if ((s + r.height())%2 != 0) --s;
+
+ if (down) {
+ deco = active ? Handler()->buttonPixmap(m_iconType, s, ActiveDown) : Handler()->buttonPixmap(m_iconType, s, InactiveDown);
+ } else {
+ deco = active ? Handler()->buttonPixmap(m_iconType, s, ActiveUp) : Handler()->buttonPixmap(m_iconType, s, InactiveUp);
+ }
+
+ dX = r.x()+(r.width()-deco.width())/2;
+ dY = r.y()+(r.height()-deco.height())/2;
+ if (down) {
+ dY++;
+ }
+
+ if(active && !down &&
+ (Handler()->useTitleProps() && Handler()->titleShadow() || Handler()->iconShadow())) {
+ bP.drawPixmap(dX+1, dY+1, Handler()->buttonPixmap(m_iconType, s, Shadow));
+ }
+
+ bP.drawPixmap(dX, dY, deco);
+ }
+
+ bP.end();
+ painter->drawPixmap(0, 0, buffer);
+}
+
+void SUSE2Button::renderBtnContour(QPainter *p, const QRect &r)
+{
+ if((r.width() <= 0)||(r.height() <= 0))
+ return;
+
+ bool active = m_client->isActive();
+
+ QColor backgroundColor;
+ if (type() == CloseButton && active && Handler()->redCloseButton()) {
+ backgroundColor = QColor(220,65,65);
+ } else if (Handler()->customColors()) {
+ backgroundColor = Handler()->getColor(BtnBg, active);
+ } else {
+ backgroundColor = alphaBlendColors(Handler()->getColor(TitleGradientFrom, active), Qt::black, 220);
+ }
+
+ QColor contourColor = backgroundColor.dark(135);
+
+// sides
+ p->setPen(contourColor);
+ p->drawLine(r.left(), r.top()+2, r.left(), r.bottom()-2);
+ p->drawLine(r.right(), r.top()+2, r.right(), r.bottom()-2);
+ p->drawLine(r.left()+2, r.top(), r.right()-2, r.top());
+ p->drawLine(r.left()+2, r.bottom(), r.right()-2, r.bottom());
+
+// edges
+ const int alphaAA = 110; // the alpha value for anti-aliasing...
+
+ // first part...
+ p->setPen(contourColor);
+ p->drawPoint(r.left()+1, r.top()+1);
+ p->drawPoint(r.left()+1, r.bottom()-1);
+ p->drawPoint(r.right()-1, r.top()+1);
+ p->drawPoint(r.right()-1, r.bottom()-1);
+
+ // second part... fill edges in case we don't paint alpha-blended
+ p->setPen( backgroundColor );
+
+ // third part... anti-aliasing...
+ int intActive = active ? 0 : 1;
+ renderPixel(p,QPoint(r.left()+1,r.top()),alphaAA,contourColor, 0, intActive);
+ renderPixel(p,QPoint(r.left(),r.top()+1),alphaAA,contourColor, 1, intActive);
+ renderPixel(p,QPoint(r.left()+1,r.bottom()),alphaAA,contourColor, 2, intActive);
+ renderPixel(p,QPoint(r.left(),r.bottom()-1),alphaAA,contourColor, 3, intActive);
+ renderPixel(p,QPoint(r.right()-1,r.top()),alphaAA,contourColor, 4, intActive);
+ renderPixel(p,QPoint(r.right(),r.top()+1),alphaAA,contourColor, 5, intActive);
+ renderPixel(p,QPoint(r.right()-1,r.bottom()),alphaAA,contourColor, 6, intActive);
+ renderPixel(p,QPoint(r.right(),r.bottom()-1),alphaAA,contourColor, 7, intActive);
+}
+
+void SUSE2Button::renderBtnSurface(QPainter *p, const QRect &r)
+{
+ if((r.width() <= 0)||(r.height() <= 0))
+ return;
+
+ bool active = m_client->isActive();
+
+ QColor backgroundColor;
+ if (type() == CloseButton && active && Handler()->redCloseButton()) {
+ backgroundColor = QColor(220,65,65);
+ } else if (Handler()->customColors()) {
+ backgroundColor = Handler()->getColor(BtnBg, active);
+ } else {
+ backgroundColor = Handler()->getColor(TitleGradientFrom, active);
+ if (!active)
+ backgroundColor = alphaBlendColors(backgroundColor,
+ Handler()->getColor(TitleGradientTo, active), 128);
+ backgroundColor = alphaBlendColors(backgroundColor, Qt::black, 220);
+ }
+
+ QColor highlightColor;
+ if(type() == CloseButton) {
+ highlightColor = QColor(255,0,0);
+ } else {
+ highlightColor = Qt::white;
+ }
+
+ int highlightAlpha = static_cast<int>(255-((60/static_cast<double>(ANIMATIONSTEPS)) *
+ static_cast<double>(animProgress) ) );
+
+ QColor buttonColor, bottomColor, topLineColor, bottomLineColor;
+
+ if (Handler()->buttonType() == LIPSTIK_3D) { // Lipstik
+ buttonColor = backgroundColor;
+ bottomColor = buttonColor.light(112);
+ topLineColor = buttonColor.light(112);
+ bottomLineColor = buttonColor.dark(102);
+ } else { // Plastik
+ bottomColor = backgroundColor;
+ buttonColor = bottomColor.light(130);
+ topLineColor = buttonColor.light(108);
+ bottomLineColor = bottomColor.dark(108);
+ }
+
+ buttonColor = alphaBlendColors(buttonColor, highlightColor, highlightAlpha);
+ bottomColor = alphaBlendColors(bottomColor, highlightColor, highlightAlpha);
+ topLineColor = alphaBlendColors(topLineColor, highlightColor, highlightAlpha);
+ bottomLineColor = alphaBlendColors(bottomLineColor, highlightColor, highlightAlpha);
+
+ int intActive = active ? 0 : 1;
+
+// sides,left
+ int height = r.height() - 2;
+ renderGradient(p, QRect(r.left(), r.top()+1, 1, height), bottomColor, buttonColor, 8+animProgress, intActive);
+//right
+ renderGradient(p, QRect(r.right(), r.top()+1, 1, height), bottomColor, buttonColor, 9+ANIMATIONSTEPS+animProgress, intActive);
+//top
+ p->setPen(topLineColor);
+ p->drawLine(r.left()+1, r.top(), r.right()-1, r.top() );
+//bottom
+ p->setPen(bottomLineColor);
+ p->drawLine(r.left()+1, r.bottom(), r.right()-1, r.bottom() );
+
+// button area...
+ int width = r.width();
+ height = r.height();
+ width-=2;
+ height-=2;
+ renderGradient(p, QRect(r.left()+1, r.top()+1, width, height), bottomColor, buttonColor,
+ 10 + 2 * ANIMATIONSTEPS+animProgress, intActive);
+}
+
+void SUSE2Button::renderPixel(QPainter *p, const QPoint &pos, const int alpha, const QColor &color,
+ const int pixelPos, const int active)
+{
+ if (lipstikCache[pixelPos][active]) {
+ p->drawPixmap(pos, *(lipstikCache[pixelPos][active]));
+ } else {
+ QRgb rgb = color.rgb();
+ QImage aImg(1,1,32); // 1x1
+ aImg.setAlphaBuffer(true);
+ aImg.setPixel(0,0,qRgba(qRed(rgb),qGreen(rgb),qBlue(rgb),alpha));
+ QPixmap *result = new QPixmap(aImg);
+
+ p->drawPixmap(pos, *result);
+
+ // add to the cache...
+ lipstikCache[pixelPos][active] = result;
+ }
+}
+
+void SUSE2Button::renderGradient(QPainter *painter, const QRect &rect, const QColor &c1, const QColor &c2,
+ const int gradient, const int active)
+{
+ if((rect.width() <= 0)||(rect.height() <= 0))
+ return;
+
+ if (lipstikCache[gradient][active]) {
+ painter->drawTiledPixmap(rect, *(lipstikCache[gradient][active]));
+ } else {
+ // there wasn't anything matching in the cache, create the pixmap now...
+ QPixmap *result = new QPixmap(10, rect.height());
+ QPainter p(result);
+
+ int r_h = result->rect().height();
+ int r_x, r_y, r_x2, r_y2;
+ result->rect().coords(&r_x, &r_y, &r_x2, &r_y2);
+
+ int rDiff, gDiff, bDiff;
+ int rc, gc, bc;
+
+ register int y;
+
+ rDiff = ( c1.red()) - (rc = c2.red());
+ gDiff = ( c1.green()) - (gc = c2.green());
+ bDiff = ( c1.blue()) - (bc = c2.blue());
+
+ register int rl = rc << 16;
+ register int gl = gc << 16;
+ register int bl = bc << 16;
+
+ int rdelta = ((1<<16) / r_h) * rDiff;
+ int gdelta = ((1<<16) / r_h) * gDiff;
+ int bdelta = ((1<<16) / r_h) * bDiff;
+
+ // these for-loops could be merged, but the if's in the inner loop
+ // would make it slow
+ for ( y = 0; y < r_h; y++ ) {
+ rl += rdelta;
+ gl += gdelta;
+ bl += bdelta;
+
+ p.setPen(QColor(rl>>16, gl>>16, bl>>16));
+ p.drawLine(r_x, r_y+y, r_x2, r_y+y);
+ }
+
+ p.end();
+
+ // draw the result...
+ painter->drawTiledPixmap(rect, *result);
+
+ // add to the cache...
+ lipstikCache[gradient][active] = result;
+ }
+}
+
+QBitmap IconEngine::icon(ButtonIcon icon, int size)
+{
+ QBitmap bitmap(size,size);
+ bitmap.fill(Qt::color0);
+ QPainter p(&bitmap);
+
+ p.setPen(Qt::color1);
+
+ QRect r = bitmap.rect();
+
+ // line widths
+ int lwTitleBar = 1;
+ if (r.width() > 16) {
+ lwTitleBar = 4;
+ } else if (r.width() > 4) {
+ lwTitleBar = 2;
+ }
+ int lwArrow = 1;
+ if (r.width() > 16) {
+ lwArrow = 4;
+ } else if (r.width() > 7) {
+ lwArrow = 2;
+ }
+
+ switch(icon) {
+ case CloseIcon:
+ {
+ int lineWidth = 1;
+ if (r.width() > 16) {
+ lineWidth = 3;
+ } else if (r.width() > 4) {
+ lineWidth = 2;
+ }
+
+ drawObject(p, DiagonalLine, r.x(), r.y(), r.width(), lineWidth);
+ drawObject(p, CrossDiagonalLine, r.x(), r.bottom(), r.width(), lineWidth);
+
+ break;
+ }
+
+ case MaxIcon:
+ {
+ int lineWidth2 = 1; // frame
+ if (r.width() > 16) {
+ lineWidth2 = 2;
+ } else if (r.width() > 4) {
+ lineWidth2 = 1;
+ }
+
+ drawObject(p, HorizontalLine, r.x(), r.top(), r.width(), lwTitleBar);
+ drawObject(p, HorizontalLine, r.x(), r.bottom()-(lineWidth2-1), r.width(), lineWidth2);
+ drawObject(p, VerticalLine, r.x(), r.top(), r.height(), lineWidth2);
+ drawObject(p, VerticalLine, r.right()-(lineWidth2-1), r.top(), r.height(), lineWidth2);
+
+ break;
+ }
+
+ case MaxRestoreIcon:
+ {
+ int lineWidth2 = 1; // frame
+ if (r.width() > 16) {
+ lineWidth2 = 2;
+ } else if (r.width() > 4) {
+ lineWidth2 = 1;
+ }
+
+ int margin1, margin2;
+ margin1 = margin2 = lineWidth2 * 2;
+ if (r.width() < 8)
+ margin1 = 1;
+
+ // background window
+ drawObject(p, HorizontalLine, r.x()+margin1, r.top(), r.width()-margin1, lineWidth2);
+ drawObject(p, HorizontalLine, r.right()-margin2, r.bottom()-(lineWidth2 - 1)-margin1, margin2, lineWidth2);
+ drawObject(p, VerticalLine, r.x()+margin1, r.top(), margin2, lineWidth2);
+ drawObject(p, VerticalLine, r.right()-(lineWidth2 - 1), r.top(), r.height()-margin1, lineWidth2);
+
+ // foreground window
+ drawObject(p, HorizontalLine, r.x(), r.top()+margin2, r.width()-margin2, lwTitleBar);
+ drawObject(p, HorizontalLine, r.x(), r.bottom()-(lineWidth2 - 1), r.width()-margin2, lineWidth2);
+ drawObject(p, VerticalLine, r.x(), r.top()+margin2, r.height(), lineWidth2);
+ drawObject(p, VerticalLine, r.right()-(lineWidth2 - 1)-margin2, r.top()+margin2, r.height(), lineWidth2);
+
+ break;
+ }
+
+ case MinIcon:
+ {
+ drawObject(p, HorizontalLine, r.x(), r.bottom()-(lwTitleBar - 1), r.width(), lwTitleBar);
+
+ break;
+ }
+
+ case HelpIcon:
+ {
+ int center = r.x()+r.width() / 2 - 1;
+ int side = r.width() / 4;
+
+ // paint a question mark... code is quite messy, to be cleaned up later...! :o
+
+ if (r.width() > 16) {
+ int lineWidth = 3;
+
+ // top bar
+ drawObject(p, HorizontalLine, center-side + 3, r.y(), 2 * side - 3 - 1, lineWidth);
+ // top bar rounding
+ drawObject(p, CrossDiagonalLine, center - side - 1, r.y() + 5, 6, lineWidth);
+ drawObject(p, DiagonalLine, center+side-3, r.y(), 5, lineWidth);
+ // right bar
+ drawObject(p, VerticalLine, center+side+2-lineWidth, r.y()+3, r.height()-(2*lineWidth+side+2+1), lineWidth);
+ // bottom bar
+ drawObject(p, CrossDiagonalLine, center, r.bottom()-2*lineWidth, side+2, lineWidth);
+ drawObject(p, HorizontalLine, center, r.bottom()-3*lineWidth+2, lineWidth, lineWidth);
+ // the dot
+ drawObject(p, HorizontalLine, center, r.bottom()-(lineWidth-1), lineWidth, lineWidth);
+ } else if (r.width() > 8) {
+ int lineWidth = 2;
+
+ // top bar
+ drawObject(p, HorizontalLine, center-(side-1), r.y(), 2*side-1, lineWidth);
+ // top bar rounding
+ if (r.width() > 9) {
+ drawObject(p, CrossDiagonalLine, center-side-1, r.y()+3, 3, lineWidth);
+ } else {
+ drawObject(p, CrossDiagonalLine, center-side-1, r.y()+2, 3, lineWidth);
+ }
+ drawObject(p, DiagonalLine, center+side-1, r.y(), 3, lineWidth);
+ // right bar
+ drawObject(p, VerticalLine, center+side+2-lineWidth, r.y()+2, r.height()-(2*lineWidth+side+1), lineWidth);
+ // bottom bar
+ drawObject(p, CrossDiagonalLine, center, r.bottom()-2*lineWidth+1, side+2, lineWidth);
+ // the dot
+ drawObject(p, HorizontalLine, center, r.bottom()-(lineWidth-1), lineWidth, lineWidth);
+ } else {
+ int lineWidth = 1;
+
+ // top bar
+ drawObject(p, HorizontalLine, center-(side-1), r.y(), 2*side, lineWidth);
+ // top bar rounding
+ drawObject(p, CrossDiagonalLine, center-side-1, r.y()+1, 2, lineWidth);
+ // right bar
+ drawObject(p, VerticalLine, center+side+1, r.y(), r.height()-(side+2+1), lineWidth);
+ // bottom bar
+ drawObject(p, CrossDiagonalLine, center, r.bottom()-2, side+2, lineWidth);
+ // the dot
+ drawObject(p, HorizontalLine, center, r.bottom(), 1, 1);
+ }
+
+ break;
+ }
+
+ case NotOnAllDesktopsIcon:
+ {
+ int lwMark = r.width()-lwTitleBar*2-2;
+ if (lwMark < 1)
+ lwMark = 3;
+
+ drawObject(p, HorizontalLine, r.x()+(r.width()-lwMark)/2, r.y()+(r.height()-lwMark)/2, lwMark, lwMark);
+
+ // Fall through to OnAllDesktopsIcon intended!
+ }
+ case OnAllDesktopsIcon:
+ {
+ // horizontal bars
+ drawObject(p, HorizontalLine, r.x()+lwTitleBar, r.y(), r.width()-2*lwTitleBar, lwTitleBar);
+ drawObject(p, HorizontalLine, r.x()+lwTitleBar, r.bottom()-(lwTitleBar-1), r.width()-2*lwTitleBar, lwTitleBar);
+ // vertical bars
+ drawObject(p, VerticalLine, r.x(), r.y()+lwTitleBar, r.height()-2*lwTitleBar, lwTitleBar);
+ drawObject(p, VerticalLine, r.right()-(lwTitleBar-1), r.y()+lwTitleBar, r.height()-2*lwTitleBar, lwTitleBar);
+
+
+ break;
+ }
+
+ case NoKeepAboveIcon:
+ {
+ int center = r.x()+r.width()/2;
+
+ // arrow
+ drawObject(p, CrossDiagonalLine, r.x(), center+2*lwArrow, center-r.x(), lwArrow);
+ drawObject(p, DiagonalLine, r.x()+center, r.y()+1+2*lwArrow, center-r.x(), lwArrow);
+ if (lwArrow>1)
+ drawObject(p, HorizontalLine, center-(lwArrow-2), r.y()+2*lwArrow, (lwArrow-2)*2, lwArrow);
+
+ // Fall through to KeepAboveIcon intended!
+ }
+ case KeepAboveIcon:
+ {
+ int center = r.x()+r.width()/2;
+
+ // arrow
+ drawObject(p, CrossDiagonalLine, r.x(), center, center-r.x(), lwArrow);
+ drawObject(p, DiagonalLine, r.x()+center, r.y()+1, center-r.x(), lwArrow);
+ if (lwArrow>1)
+ drawObject(p, HorizontalLine, center-(lwArrow-2), r.y(), (lwArrow-2)*2, lwArrow);
+
+ break;
+ }
+
+ case NoKeepBelowIcon:
+ {
+ int center = r.x()+r.width()/2;
+
+ // arrow
+ drawObject(p, DiagonalLine, r.x(), center-2*lwArrow, center-r.x(), lwArrow);
+ drawObject(p, CrossDiagonalLine, r.x()+center, r.bottom()-1-2*lwArrow, center-r.x(), lwArrow);
+ if (lwArrow>1)
+ drawObject(p, HorizontalLine, center-(lwArrow-2), r.bottom()-(lwArrow-1)-2*lwArrow, (lwArrow-2)*2, lwArrow);
+
+ // Fall through to KeepBelowIcon intended!
+ }
+ case KeepBelowIcon:
+ {
+ int center = r.x()+r.width()/2;
+
+ // arrow
+ drawObject(p, DiagonalLine, r.x(), center, center-r.x(), lwArrow);
+ drawObject(p, CrossDiagonalLine, r.x()+center, r.bottom()-1, center-r.x(), lwArrow);
+ if (lwArrow>1)
+ drawObject(p, HorizontalLine, center-(lwArrow-2), r.bottom()-(lwArrow-1), (lwArrow-2)*2, lwArrow);
+
+ break;
+ }
+
+ case ShadeIcon:
+ {
+ drawObject(p, HorizontalLine, r.x(), r.y(), r.width(), lwTitleBar);
+
+ break;
+ }
+
+ case UnShadeIcon:
+ {
+ int lw1 = 1;
+ int lw2 = 1;
+ if (r.width() > 16) {
+ lw1 = 4;
+ lw2 = 2;
+ } else if (r.width() > 7) {
+ lw1 = 2;
+ lw2 = 1;
+ }
+
+ int h = QMAX( (r.width()/2), (lw1+2*lw2) );
+
+ // horizontal bars
+ drawObject(p, HorizontalLine, r.x(), r.y(), r.width(), lw1);
+ drawObject(p, HorizontalLine, r.x(), r.x()+h-(lw2-1), r.width(), lw2);
+ // vertical bars
+ drawObject(p, VerticalLine, r.x(), r.y(), h, lw2);
+ drawObject(p, VerticalLine, r.right()-(lw2-1), r.y(), h, lw2);
+
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ p.end();
+
+ bitmap.setMask(bitmap);
+
+ return bitmap;
+}
+
+void IconEngine::drawObject(QPainter &p, Object object, int x, int y, int length, int lineWidth)
+{
+ switch(object) {
+ case DiagonalLine:
+ if (lineWidth <= 1) {
+ for (int i = 0; i < length; ++i) {
+ p.drawPoint(x+i,y+i);
+ }
+ } else if (lineWidth <= 2) {
+ for (int i = 0; i < length; ++i) {
+ p.drawPoint(x+i,y+i);
+ }
+ for (int i = 0; i < (length-1); ++i) {
+ p.drawPoint(x+1+i,y+i);
+ p.drawPoint(x+i,y+1+i);
+ }
+ } else {
+ for (int i = 1; i < (length-1); ++i) {
+ p.drawPoint(x+i,y+i);
+ }
+ for (int i = 0; i < (length-1); ++i) {
+ p.drawPoint(x+1+i,y+i);
+ p.drawPoint(x+i,y+1+i);
+ }
+ for (int i = 0; i < (length-2); ++i) {
+ p.drawPoint(x+2+i,y+i);
+ p.drawPoint(x+i,y+2+i);
+ }
+ }
+ break;
+ case CrossDiagonalLine:
+ if (lineWidth <= 1) {
+ for (int i = 0; i < length; ++i) {
+ p.drawPoint(x+i,y-i);
+ }
+ } else if (lineWidth <= 2) {
+ for (int i = 0; i < length; ++i) {
+ p.drawPoint(x+i,y-i);
+ }
+ for (int i = 0; i < (length-1); ++i) {
+ p.drawPoint(x+1+i,y-i);
+ p.drawPoint(x+i,y-1-i);
+ }
+ } else {
+ for (int i = 1; i < (length-1); ++i) {
+ p.drawPoint(x+i,y-i);
+ }
+ for (int i = 0; i < (length-1); ++i) {
+ p.drawPoint(x+1+i,y-i);
+ p.drawPoint(x+i,y-1-i);
+ }
+ for (int i = 0; i < (length-2); ++i) {
+ p.drawPoint(x+2+i,y-i);
+ p.drawPoint(x+i,y-2-i);
+ }
+ }
+ break;
+ case HorizontalLine:
+ for (int i = 0; i < lineWidth; ++i) {
+ p.drawLine(x,y+i, x+length-1, y+i);
+ }
+ break;
+ case VerticalLine:
+ for (int i = 0; i < lineWidth; ++i) {
+ p.drawLine(x+i,y, x+i, y+length-1);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+} // KWinSUSE2
+
+// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/src/SUSE2button.h b/src/SUSE2button.h
new file mode 100644
index 0000000..08b2305
--- /dev/null
+++ b/src/SUSE2button.h
@@ -0,0 +1,109 @@
+/* SuSE KWin window decoration
+ Copyright (C) 2005 Gerd Fleischer <gerdfleischer@web.de>
+ Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
+
+ based on the window decoration "Web":
+ Copyright (C) 2001 Rik Hemsley (rikkus) <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 St, Fifth Floor,
+ Boston, MA 02110-1301 USA.
+*/
+
+#ifndef SUSE2BUTTON_H
+#define SUSE2BUTTON_H
+
+#include <qbutton.h>
+#include <qpixmap.h>
+
+#include <kcommondecoration.h>
+
+#include "SUSE2.h"
+
+class QTimer;
+
+namespace KWinSUSE2 {
+
+static const uint TIMERINTERVAL = 50; // msec
+static const uint ANIMATIONSTEPS = 4;
+
+class SUSE2Client;
+
+class SUSE2Button : public KCommonDecorationButton
+{
+ Q_OBJECT
+public:
+ SUSE2Button(ButtonType type, SUSE2Client *parent, const char *name);
+ ~SUSE2Button();
+
+ void reset(unsigned long changed);
+ SUSE2Client *client() { return m_client; }
+
+protected slots:
+ void animate();
+
+private:
+ void enterEvent(QEvent *e);
+ void leaveEvent(QEvent *e);
+ void drawButton(QPainter *painter);
+ void drawPlastikBtn(QPainter *painter);
+ void drawLipstikBtn(QPainter *painter);
+ void renderBtnContour(QPainter *p, const QRect &r);
+ void renderBtnSurface(QPainter *p, const QRect &r);
+ void renderPixel(QPainter *p, const QPoint &pos, const int alpha, const QColor &color,
+ const int pixelPos, const int active);
+ void renderGradient(QPainter *p, const QRect &r, const QColor &c1, const QColor &c2,
+ const int gradient, const int active);
+
+
+private:
+ SUSE2Client *m_client;
+
+ ButtonIcon m_iconType;
+ bool hover;
+
+ QTimer *animTmr;
+ uint animProgress;
+
+ QPixmap *lipstikCache[8+3*(ANIMATIONSTEPS+1)][2];
+};
+
+/**
+ * This class creates bitmaps which can be used as icons on buttons. The icons
+ * are "hardcoded".
+ * Over the previous "Gimp->xpm->QImage->recolor->SmoothScale->QPixmap" solution
+ * it has the important advantage that icons are more scalable and at the same
+ * time sharp and not blurred.
+ */
+class IconEngine
+{
+ public:
+ static QBitmap icon(ButtonIcon icon, int size);
+
+ private:
+ enum Object {
+ HorizontalLine,
+ VerticalLine,
+ DiagonalLine,
+ CrossDiagonalLine
+ };
+
+ static void drawObject(QPainter &p, Object object, int x, int y, int length, int lineWidth);
+};
+
+} // namespace KWinSUSE2
+
+#endif
+
+// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/src/SUSE2client.cpp b/src/SUSE2client.cpp
new file mode 100644
index 0000000..7d92417
--- /dev/null
+++ b/src/SUSE2client.cpp
@@ -0,0 +1,768 @@
+/* SuSE KWin window decoration
+ Copyright (C) 2005 Gerd Fleischer <gerdfleischer@web.de>
+ Copyright (C) 2005 Adrian Schroeter <adrian@suse.de>
+
+ based on the window decoration "Plastik" and "Web":
+ Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
+ Copyright (C) 2001 Rik Hemsley (rikkus) <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 St, Fifth Floor,
+ Boston, MA 02110-1301 USA.
+*/
+
+#include <klocale.h>
+#include <kpixmap.h>
+#include <kimageeffect.h>
+#include <kpixmapeffect.h>
+#include <kstandarddirs.h>
+#include <kdecoration.h>
+
+#include <qbitmap.h>
+#include <qdatetime.h>
+#include <qfontmetrics.h>
+#include <qimage.h>
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qpainter.h>
+#include <qpixmap.h>
+#include <qimage.h>
+
+#include "SUSE2client.h"
+#include "SUSE2button.h"
+#include "misc.h"
+#include "shadow.h"
+
+namespace KWinSUSE2
+{
+SUSE2Client::SUSE2Client(KDecorationBridge* bridge, KDecorationFactory* factory)
+ : KCommonDecoration(bridge, factory),
+ aCaptionBuffer(0), iCaptionBuffer(0),
+ aTitleBarTile(0), iTitleBarTile(0),
+ pixmaps_created(false),
+ captionBufferDirty(true),
+ s_titleFont(QFont())
+{}
+
+SUSE2Client::~SUSE2Client()
+{
+ delete_pixmaps();
+
+ delete aCaptionBuffer;
+ delete iCaptionBuffer;
+}
+
+// pure virtual methods from KCommonDecoration
+QString SUSE2Client::visibleName() const
+{
+ return i18n("SUSE2 (Version %1)").arg("0.4.1");
+}
+
+QString SUSE2Client::defaultButtonsLeft() const
+{
+ return "M";
+}
+
+QString SUSE2Client::defaultButtonsRight() const
+{
+ return "HIA___X";
+}
+
+bool SUSE2Client::decorationBehaviour(DecorationBehaviour behaviour) const
+{
+ switch (behaviour) {
+ case DB_MenuClose:
+ return Handler()->menuClose();
+
+ case DB_WindowMask:
+ return true;
+
+ default:
+ return KCommonDecoration::decorationBehaviour(behaviour);
+ }
+}
+
+KCommonDecorationButton *SUSE2Client::createButton(ButtonType type)
+{
+ switch (type) {
+ case MenuButton:
+ return new SUSE2Button(MenuButton, this, "menu");
+
+ case OnAllDesktopsButton:
+ return new SUSE2Button(OnAllDesktopsButton, this, "on_all_desktops");
+
+ case HelpButton:
+ return new SUSE2Button(HelpButton, this, "help");
+
+ case MinButton:
+ return new SUSE2Button(MinButton, this, "minimize");
+
+ case MaxButton:
+ return new SUSE2Button(MaxButton, this, "maximize");
+
+ case CloseButton:
+ return new SUSE2Button(CloseButton, this, "close");
+
+ case AboveButton:
+ return new SUSE2Button(AboveButton, this, "above");
+
+ case BelowButton:
+ return new SUSE2Button(BelowButton, this, "below");
+
+ case ShadeButton:
+ return new SUSE2Button(ShadeButton, this, "shade");
+
+ default:
+ return 0;
+ }
+}
+
+int SUSE2Client::layoutMetric(LayoutMetric lm, bool respectWindowState, const KCommonDecorationButton *btn) const
+{
+ bool maximized = maximizeMode()==MaximizeFull && !options()->moveResizeMaximizedWindows();
+
+ switch (lm) {
+ case LM_BorderLeft:
+ case LM_BorderRight:
+ case LM_BorderBottom:
+ if (respectWindowState && maximized)
+ return 0;
+ return Handler()->borderSize();
+
+ case LM_TitleEdgeTop:
+ if (respectWindowState && maximized) {
+ return 0;
+ } else {
+ return TOPMARGIN;
+ }
+
+ case LM_TitleEdgeBottom:
+ if (respectWindowState && maximized) {
+ return 1;
+ } else {
+ return DECOHEIGHT;
+ }
+
+ case LM_TitleEdgeLeft:
+ case LM_TitleEdgeRight:
+ if (respectWindowState && maximized) {
+ return 0;
+ } else {
+ return 6;
+ }
+
+ case LM_TitleBorderLeft:
+ case LM_TitleBorderRight:
+ return 5;
+
+ case LM_ButtonWidth:
+ case LM_ButtonHeight:
+ case LM_TitleHeight:
+ if (respectWindowState && isToolWindow()) {
+ return Handler()->titleHeightTool();
+ } else {
+ return Handler()->titleHeight();
+ }
+
+ case LM_ButtonSpacing:
+ return 1;
+
+ case LM_ButtonMarginTop:
+ return 0;
+
+ case LM_ExplicitButtonSpacer:
+ return 3;
+
+ default:
+ return KCommonDecoration::layoutMetric(lm, respectWindowState, btn);
+ }
+}
+
+void SUSE2Client::init()
+{
+ s_titleFont = isToolWindow() ?
+ Handler()->titleFontTool()
+ : Handler()->titleFont();
+
+ create_pixmaps();
+
+ aCaptionBuffer = new QPixmap();
+ iCaptionBuffer = new QPixmap();
+ captionBufferDirty = true;
+
+ KCommonDecoration::init();
+}
+
+QRegion SUSE2Client::cornerShape(WindowCorner corner)
+{
+ int w = widget()->width();
+ int h = widget()->height();
+
+ switch (corner) {
+ case WC_TopLeft:
+ if (layoutMetric(LM_TitleEdgeLeft) > 0 &&
+ (Handler()->roundCorners() == 1 ||
+ (Handler()->roundCorners() == 2 && maximizeMode() != MaximizeFull))) {
+ return QRegion(0, 0, 1, 5) + QRegion(0, 0, 2, 3) + QRegion(0, 0, 3, 2) + QRegion(0, 0, 5, 1);
+ } else {
+ return QRegion(0, 0, 1, 1);
+ }
+
+ case WC_TopRight:
+ if (layoutMetric(LM_TitleEdgeRight) > 0 &&
+ (Handler()->roundCorners() == 1 ||
+ (Handler()->roundCorners() == 2 && maximizeMode() != MaximizeFull))) {
+ return QRegion(w-1, 0, 1, 5) + QRegion(w-2, 0, 2, 3) + QRegion(w-3, 0, 3, 2) + QRegion(w-5, 0, 5, 1);
+ } else {
+ return QRegion(w-1, 0, 1, 1);
+ }
+
+ case WC_BottomLeft:
+ if (layoutMetric(LM_BorderLeft) > 0)
+ return QRegion(0, h-1, 1, 1);
+ else
+ return QRegion();
+
+ case WC_BottomRight:
+ if (layoutMetric(LM_BorderRight) > 0)
+ return QRegion(w-1, h-1, 1, 1);
+ else
+ return QRegion();
+
+ default:
+ return QRegion();
+ }
+}
+
+void SUSE2Client::paintEvent(QPaintEvent *e)
+{
+ QRegion region = e->region();
+
+ if (captionBufferDirty) update_captionBuffer();
+
+ bool active = isActive();
+
+ QPainter painter(widget());
+
+ // colors...
+ const QColor windowContour = Handler()->getColor(WindowContour, active);
+ const QColor innerWindowContour = Handler()->getColor(TitleGradientTo, active);
+ const QColor deco = Handler()->getColor(TitleGradientTo, active);
+ const QColor aBorder = Handler()->getColor(Border, active);
+ const QColor darkAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 140);
+ const QColor midAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 120);
+ const QColor brightAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 80);
+ const QColor innerAntiAlias = alphaBlendColors(innerWindowContour, active ? aAntialiasBase : iAntialiasBase, 170);
+
+ QRect r = widget()->rect();
+
+ int r_w = r.width();
+ int r_x, r_y, r_x2, r_y2;
+ r.coords(&r_x, &r_y, &r_x2, &r_y2);
+ const int borderLeft = layoutMetric(LM_BorderLeft);
+ const int borderRight = layoutMetric(LM_BorderRight);
+ const int borderBottom = layoutMetric(LM_BorderBottom);
+ const int titleHeight = layoutMetric(LM_TitleHeight);
+ const int titleEdgeTop = layoutMetric(LM_TitleEdgeTop);
+ const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom);
+ const int titleEdgeLeft = layoutMetric(LM_TitleEdgeLeft);
+ const int titleEdgeRight = layoutMetric(LM_TitleEdgeRight);
+ const int btnMarginTop = layoutMetric(LM_ButtonMarginTop);
+ const int titleMargin = layoutMetric(LM_TitleBorderLeft);
+
+ const int borderBottomTop = r_y2-borderBottom+1;
+ const int borderLeftRight = r_x+borderLeft-1;
+ const int borderRightLeft = r_x2-borderRight+1;
+ const int titleEdgeBottomBottom = r_y+titleEdgeTop+titleHeight+titleEdgeBottom-1;
+
+ const int sideHeight = borderBottomTop-titleEdgeBottomBottom-1;
+
+ // the title background over full width
+ if (maximizeMode()==MaximizeFull && !options()->moveResizeMaximizedWindows()) {
+ painter.drawTiledPixmap(r_x, r_y,
+ r_w, titleHeight + titleEdgeTop + titleEdgeBottom,
+ active ? *aTitleBarTile : *iTitleBarTile, 0, TOPMARGIN - btnMarginTop);
+ } else {
+ painter.drawTiledPixmap(r_x, r_y,
+ r_w, titleHeight + titleEdgeTop + titleEdgeBottom,
+ active ? *aTitleBarTile : *iTitleBarTile);
+ }
+
+ QRect Rtitle = QRect(r_x+titleEdgeLeft+buttonsLeftWidth(), r_y+titleEdgeTop,
+ r_x2-titleEdgeRight-buttonsRightWidth()-(r_x+titleEdgeLeft+buttonsLeftWidth()),
+ titleEdgeBottomBottom-(r_y+titleEdgeTop) );
+
+ QRect tmpRect;
+
+ // topSpacer
+ if(titleEdgeTop > 0) {
+ tmpRect.setRect(r_x, r_y, r_w, titleEdgeTop );
+ if (tmpRect.isValid() && region.contains(tmpRect) ) {
+ painter.setPen(windowContour);
+ if (Handler()->roundCorners() == 1 ||
+ (Handler()->roundCorners() == 2 && maximizeMode() != MaximizeFull)) {
+ // top line
+ if (maximizeMode() != MaximizeFull || options()->moveResizeMaximizedWindows()) {
+ painter.fillRect(tmpRect.left(), tmpRect.top(), 2, titleEdgeTop+1, windowContour);
+ painter.fillRect(tmpRect.left()+2, tmpRect.top(), 3, 3, windowContour);
+ painter.fillRect(tmpRect.right()-1, tmpRect.top(), 2, titleEdgeTop+1, windowContour);
+ painter.fillRect(tmpRect.right()-4, tmpRect.top(), 3, 3, windowContour);
+ painter.drawLine(tmpRect.left()+5, tmpRect.top(), tmpRect.right()-5, tmpRect.top());
+ painter.setPen(innerWindowContour);
+ painter.drawLine(tmpRect.left()+5, tmpRect.top()+1, tmpRect.right()-5, tmpRect.top()+1);
+ painter.setPen(windowContour);
+ }
+
+ painter.setPen(innerWindowContour);
+ // left inner corner
+ painter.drawPoint(tmpRect.left()+3, tmpRect.top()+2);
+ painter.drawPoint(tmpRect.left()+2, tmpRect.top()+3);
+ // right inner corner
+ painter.drawPoint(tmpRect.right()-3, tmpRect.top()+2);
+ painter.drawPoint(tmpRect.right()-2, tmpRect.top()+3);
+ painter.setPen(midAntiAlias);
+ painter.drawPoint(tmpRect.left()+3, tmpRect.top()+3);
+ painter.drawPoint(tmpRect.right()-3, tmpRect.top()+3);
+ painter.setPen(brightAntiAlias);
+ painter.drawPoint(tmpRect.left()+5, tmpRect.top()+2);
+ painter.drawPoint(tmpRect.right()-5, tmpRect.top()+2);
+ painter.setPen(innerAntiAlias);
+ painter.drawPoint(tmpRect.left()+4, tmpRect.top()+2);
+ painter.drawPoint(tmpRect.left()+2, tmpRect.top()+4);
+ painter.drawPoint(tmpRect.right()-4, tmpRect.top()+2);
+ painter.drawPoint(tmpRect.right()-2, tmpRect.top()+4);
+ } else {
+ // top line
+ if (maximizeMode() != MaximizeFull || options()->moveResizeMaximizedWindows()) {
+ painter.fillRect(tmpRect.left(), tmpRect.top(), 2, titleEdgeTop+1, windowContour);
+ painter.fillRect(tmpRect.left()+2, tmpRect.top(), 3, 2, windowContour);
+ painter.fillRect(tmpRect.right()-1, tmpRect.top(), 2, titleEdgeTop+1, windowContour);
+ painter.fillRect(tmpRect.right()-4, tmpRect.top(), 3, 2, windowContour);
+ painter.drawLine(tmpRect.left()+2, tmpRect.top(), tmpRect.right()-2, tmpRect.top() );
+ painter.setPen(innerWindowContour);
+ painter.drawLine(tmpRect.left()+1, tmpRect.top()+1, tmpRect.right()-1, tmpRect.top()+1);
+ painter.setPen(windowContour);
+ }
+
+ painter.setPen(alphaBlendColors(innerWindowContour, windowContour, 110));
+ // left corner
+ painter.drawLine(tmpRect.left(), tmpRect.top(), tmpRect.left()+1, tmpRect.top());
+ painter.drawPoint(tmpRect.left(), tmpRect.top()+1);
+ // right corner
+ painter.drawLine(tmpRect.right(), tmpRect.top(), tmpRect.right()-1, tmpRect.top());
+ painter.drawPoint(tmpRect.right(), tmpRect.top()+1);
+
+ painter.setPen(windowContour);
+ // left side
+ painter.drawLine(tmpRect.left(), tmpRect.top()+2, tmpRect.left(), tmpRect.bottom());
+ // right side
+ painter.drawLine(tmpRect.right(), tmpRect.top()+2, tmpRect.right(), tmpRect.bottom());
+
+ painter.setPen(innerWindowContour);
+ // left inner corner
+ painter.drawLine(tmpRect.left()+1, tmpRect.top()+2, tmpRect.left()+1, tmpRect.top()+4);
+ // right inner corner
+ painter.drawLine(tmpRect.right()-1, tmpRect.top()+2, tmpRect.right()-1, tmpRect.top()+4);
+ }
+ }
+ }
+
+ // leftTitleSpacer
+ if(titleEdgeLeft > 1)
+ {
+ tmpRect.setRect(r_x, titleEdgeTop, borderLeft, titleEdgeTop+titleHeight+titleEdgeBottom);
+ if (tmpRect.isValid() && region.contains(tmpRect) ) {
+ painter.setPen(windowContour);
+ painter.drawLine(tmpRect.left(), tmpRect.top(),
+ tmpRect.left(), tmpRect.bottom() );
+
+ painter.setPen(innerWindowContour);
+ painter.drawLine(tmpRect.left()+1, tmpRect.top()+1,
+ tmpRect.left()+1, tmpRect.bottom() );
+ if (Handler()->roundCorners() == 1 ||
+ (Handler()->roundCorners() == 2 && maximizeMode() != MaximizeFull)) {
+ painter.setPen(darkAntiAlias);
+ painter.drawPoint(tmpRect.left()+2, tmpRect.top()+1);
+ }
+ }
+ }
+
+ // rightTitleSpacer
+ if(titleEdgeRight > 1)
+ {
+ tmpRect.setRect(borderRightLeft, titleEdgeTop, borderRight, titleEdgeTop+titleHeight+titleEdgeBottom);
+ if (tmpRect.isValid() && region.contains(tmpRect) ) {
+ painter.setPen(windowContour );
+ painter.drawLine(tmpRect.right(), tmpRect.top(),
+ tmpRect.right(), tmpRect.bottom() );
+
+ painter.setPen(innerWindowContour );
+ painter.drawLine(tmpRect.right()-1, tmpRect.top()+1,
+ tmpRect.right()-1, tmpRect.bottom() );
+ if (Handler()->roundCorners() == 1 ||
+ (Handler()->roundCorners() == 2 && maximizeMode() != MaximizeFull)) {
+ painter.setPen(darkAntiAlias);
+ painter.drawPoint(tmpRect.right()-2, tmpRect.top()+1);
+ }
+ }
+ }
+
+ // titleSpacer
+ QPixmap *titleBfrPtr = active ? aCaptionBuffer : iCaptionBuffer;
+ if (Rtitle.width() > 0 && titleBfrPtr != 0) {
+
+ int tX, tW;
+ switch (Handler()->titleAlign()) {
+ // AlignCenter
+ case Qt::AlignHCenter:
+ tX = (titleBfrPtr->width() > Rtitle.width()-2 * titleMargin) ?
+ (Rtitle.left()+titleMargin)
+ : Rtitle.left()+(Rtitle.width()- titleBfrPtr->width())/2;
+ tW = (titleBfrPtr->width() > Rtitle.width()-2 * titleMargin) ?
+ (Rtitle.width()-2 * titleMargin)
+ : titleBfrPtr->width();
+ break;
+ // AlignRight
+ case Qt::AlignRight:
+ tX = (titleBfrPtr->width() > Rtitle.width()-2 * titleMargin) ?
+ (Rtitle.left()+titleMargin)
+ : Rtitle.right()-titleMargin-titleBfrPtr->width();
+ tW = (titleBfrPtr->width() > Rtitle.width()-2 * titleMargin) ?
+ (Rtitle.width()-2 * titleMargin)
+ : titleBfrPtr->width();
+ break;
+ // AlignLeft
+ default:
+ tX = (Rtitle.left()+titleMargin);
+ tW = (titleBfrPtr->width() > Rtitle.width()-2 * titleMargin) ?
+ (Rtitle.width()-2 * titleMargin)
+ : titleBfrPtr->width();
+ }
+
+ if(tW > 0) {
+ if (titleBfrPtr->width()+2*titleMargin > Rtitle.width()) {
+ QPixmap *tmp = new QPixmap(30, Rtitle.height());
+ QPainter fade;
+ fade.begin(tmp);
+ fade.drawPixmap(0, 0, *titleBfrPtr, Rtitle.right()-30-2*titleMargin-Rtitle.left(), 0);
+ QImage background = (active ? *aTitleBarTile : *iTitleBarTile).convertToImage();
+ QImage tmpImg = tmp->convertToImage();
+ QImage blended = KImageEffect::blend(tmpImg, background, gradient, KImageEffect::Red);
+
+ painter.drawPixmap(tX, Rtitle.top() - TOPMARGIN + btnMarginTop+2, *titleBfrPtr,
+ 0, 2, tW - 2* titleMargin, -1);
+ painter.drawImage(Rtitle.right()-30-titleMargin, Rtitle.top() - TOPMARGIN + btnMarginTop+2,
+ blended, 0, 2);
+ } else {
+ painter.drawPixmap(tX, Rtitle.top() - TOPMARGIN + btnMarginTop+2, *titleBfrPtr, 0, 2);
+ }
+ }
+ }
+
+ // leftSpacer
+ if (borderLeft > 0 && sideHeight > 0) {
+ tmpRect.setCoords(r_x, titleEdgeBottomBottom+1, borderLeftRight, borderBottomTop-1);
+ if (tmpRect.isValid() && region.contains(tmpRect) ) {
+ if (tmpRect.width() > 2) {
+ painter.fillRect(tmpRect, active ? aGradientBottom : iGradientBottom);
+ }
+ painter.setPen(windowContour);
+ painter.drawLine(tmpRect.left(), tmpRect.top(), tmpRect.left(), tmpRect.bottom());
+ painter.drawLine(tmpRect.right(), tmpRect.top(), tmpRect.right(), tmpRect.bottom());
+
+ painter.setPen(innerWindowContour);
+ painter.drawLine(tmpRect.left()+1, tmpRect.top(), tmpRect.left()+1, tmpRect.bottom());
+ }
+ }
+
+ // rightSpacer
+ if (borderRight > 0 && sideHeight > 0) {
+ tmpRect.setCoords(borderRightLeft, titleEdgeBottomBottom+1, r_x2, borderBottomTop-1);
+ if (tmpRect.isValid() && region.contains(tmpRect) ) {
+ if (tmpRect.width() > 2) {
+ painter.fillRect(tmpRect, active ? aGradientBottom : iGradientBottom);
+ }
+ painter.setPen(windowContour);
+ painter.drawLine(tmpRect.right(), tmpRect.top(), tmpRect.right(), tmpRect.bottom());
+ painter.drawLine(tmpRect.left(), tmpRect.top(), tmpRect.left(), tmpRect.bottom());
+
+ painter.setPen(innerWindowContour);
+ painter.drawLine(tmpRect.right()-1, tmpRect.top(), tmpRect.right()-1, tmpRect.bottom());
+ }
+ }
+
+ // bottomSpacer
+ if (borderBottom > 0) {
+ tmpRect.setCoords(r_x, borderBottomTop, r_x2, r_y2);
+ if (tmpRect.isValid() && region.contains(tmpRect) ) {
+
+ if (borderBottomTop > 2) {
+ painter.fillRect(tmpRect, active ? aGradientBottom : iGradientBottom);
+ }
+
+ // bottom lines
+ painter.setPen(innerWindowContour);
+ painter.drawLine(r_x, r_y2-1, r_x2, r_y2-1);
+
+ painter.setPen(windowContour);
+ painter.drawLine(r_x, r_y2, r_x2, r_y2); //bottom line
+ //bottom upper line
+ painter.drawLine(borderLeft-1, borderBottomTop, r_x2-borderRight+1, borderBottomTop);
+
+ if (borderLeft > 0) {
+ painter.setPen(innerWindowContour);
+ painter.drawLine(tmpRect.left()+1, tmpRect.top(), tmpRect.left()+1, tmpRect.bottom()-1);
+
+ painter.setPen(windowContour);
+ // rounded left bottom corner - side
+ painter.drawLine(tmpRect.left(), tmpRect.top(), tmpRect.left(), tmpRect.bottom()-2);
+
+ // anti-alias for the window contour...
+ painter.setPen(alphaBlendColors(innerWindowContour, windowContour, 90) );
+ painter.drawLine(tmpRect.left(), tmpRect.bottom()-1, tmpRect.left(), tmpRect.bottom());
+ painter.drawPoint(tmpRect.left()+1, tmpRect.bottom());
+ }
+
+ if (borderRight > 0) {
+ painter.setPen(innerWindowContour);
+ painter.drawLine(tmpRect.right()-1, tmpRect.top(), tmpRect.right()-1, tmpRect.bottom()-1);
+
+ painter.setPen(windowContour);
+ // rounded right bottom corner - side
+ painter.drawLine(tmpRect.right(), tmpRect.top(), tmpRect.right(), tmpRect.bottom()-2);
+
+ // anti-alias for the window contour...
+ painter.setPen(alphaBlendColors(innerWindowContour, windowContour, 110) );
+ painter.drawLine(tmpRect.right(), tmpRect.bottom()-1, tmpRect.right(), tmpRect.bottom());
+ painter.drawPoint(tmpRect.right()-1, tmpRect.bottom());
+ }
+ }
+ }
+}
+
+void SUSE2Client::updateCaption()
+{
+ captionBufferDirty = true;
+
+ const int titleHeight = layoutMetric(LM_TitleHeight);
+ const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom);
+ const int titleEdgeTop = layoutMetric(LM_TitleEdgeTop);
+ const int titleEdgeLeft = layoutMetric(LM_TitleEdgeLeft);
+ const int marginLeft = layoutMetric(LM_TitleBorderLeft);
+ const int marginRight = layoutMetric(LM_TitleBorderRight);
+
+ QRect g = QRect(titleEdgeLeft, titleEdgeTop, (widget()->rect()).width()-marginLeft-marginRight, titleHeight + titleEdgeBottom);
+ widget()->update(g);
+}
+
+void SUSE2Client::reset(unsigned long changed)
+{
+ if (changed & SettingColors) {
+ // repaint the whole thing
+ delete_pixmaps();
+ create_pixmaps();
+ captionBufferDirty = true;
+ widget()->update();
+ updateButtons();
+ } else if (changed & SettingFont) {
+ s_titleFont = isToolWindow() ?
+ Handler()->titleFontTool()
+ : Handler()->titleFont();
+
+ // then repaint
+ delete_pixmaps();
+ create_pixmaps();
+ captionBufferDirty = true;
+ widget()->update();
+ updateButtons();
+ }
+
+ KCommonDecoration::reset(changed);
+}
+
+void SUSE2Client::create_pixmaps()
+{
+ if(pixmaps_created)
+ return;
+
+ KPixmap tempPixmap;
+ QPainter painter;
+
+ const int titleHeight = layoutMetric(LM_TitleHeight);
+
+ // aTitleBarTile
+ tempPixmap.resize(30, titleHeight + TOPMARGIN + DECOHEIGHT);
+ KPixmapEffect::gradient(tempPixmap,
+ Handler()->getColor(TitleGradientFrom, true),
+ Handler()->getColor(TitleGradientTo, true),
+ KPixmapEffect::VerticalGradient);
+ aTitleBarTile = new QPixmap(30, titleHeight + TOPMARGIN + DECOHEIGHT);
+ painter.begin(aTitleBarTile);
+ painter.drawPixmap(0, 0, tempPixmap);
+
+ QImage t;
+ if (Handler()->titlebarStyle() == 0) { // new, Toplight
+ t = QImage(30, (titleHeight + TOPMARGIN + DECOHEIGHT)/3 + 1, 32 );
+ t = KImageEffect::gradient(QSize(30, t.height()),
+ Handler()->getColor(TitleGradientFrom, true).light(130),
+ Handler()->getColor(TitleGradientTo, true),
+ KImageEffect::VerticalGradient/*, 100, 100*/);
+ painter.drawImage(0, 2, t, 0, 0, -1, tempPixmap.height()-2);
+ t.create(t.width(), t.height()*2, t.depth());
+ t = KImageEffect::unbalancedGradient(QSize(30, t.height()),
+ Handler()->getColor(TitleGradientTo, true),
+ Handler()->getColor(TitleGradientFrom, true),
+ KImageEffect::VerticalGradient, 100, 100);
+ painter.drawImage(0, t.height()/2, t, 0, 0, -1, t.height());
+ } else { // older, Balanced
+ t = QImage(30, (titleHeight + TOPMARGIN + DECOHEIGHT)/2 + 1, 32 );
+ t = KImageEffect::gradient(QSize(30, t.height()),
+ Handler()->getColor(TitleGradientFrom, true).light(150),
+ Handler()->getColor(TitleGradientTo, true).light(110),
+ KImageEffect::VerticalGradient);
+ painter.drawImage(0, 2, t, 0, 0, -1, tempPixmap.height()-2);
+ t = KImageEffect::gradient(QSize(30, t.height()),
+ Handler()->getColor(TitleGradientTo, true),
+ Handler()->getColor(TitleGradientFrom, true),
+ KImageEffect::VerticalGradient);
+ painter.drawImage(0, t.height(), t, 0, 0, -1, t.height());
+ }
+
+ painter.end();
+
+ // iTitleBarTile
+ tempPixmap.resize(30, titleHeight + TOPMARGIN + DECOHEIGHT);
+ KPixmapEffect::gradient(tempPixmap,
+ Handler()->getColor(TitleGradientFrom, false),
+ Handler()->getColor(TitleGradientTo, false),
+ KPixmapEffect::VerticalGradient);
+ iTitleBarTile = new QPixmap(30, titleHeight + TOPMARGIN + DECOHEIGHT);
+ painter.begin(iTitleBarTile);
+ painter.drawPixmap(0, 0, tempPixmap);
+ painter.end();
+
+ QImage aTempImage = aTitleBarTile->convertToImage();
+ aGradientBottom = QColor::QColor(aTempImage.pixel(0, aTempImage.height()-1));
+ aAntialiasBase = QColor::QColor(aTempImage.pixel(0, 2));
+ QImage iTempImage = iTitleBarTile->convertToImage();
+ iGradientBottom = QColor::QColor(iTempImage.pixel(0, iTempImage.height()-1));
+ iAntialiasBase = QColor::QColor(iTempImage.pixel(0, 2));
+
+ // the gradient for the fade out effect
+ gradient = KImageEffect::gradient(QSize(30, titleHeight + TOPMARGIN + DECOHEIGHT),
+ QColor(255,255,255),
+ QColor(0,0,0),
+ KImageEffect::HorizontalGradient);
+
+ pixmaps_created = true;
+}
+
+void SUSE2Client::delete_pixmaps()
+{
+ delete aTitleBarTile;
+ aTitleBarTile = 0;
+
+ delete iTitleBarTile;
+ iTitleBarTile = 0;
+
+ pixmaps_created = false;
+}
+
+void SUSE2Client::update_captionBuffer()
+{
+ const uint maxCaptionLength = 110; // truncate captions longer than this!
+ QString c(caption());
+ if (c.length() > maxCaptionLength) {
+ QString tmpLeft = c.left(50);
+ QString tmpRight = c.right(50);
+ c = tmpLeft + QString::fromUtf8("[...]") + tmpRight;
+ }
+
+ QImage logo(Handler()->titleLogoURL());
+ int logoOffset = Handler()->titleLogoOffset();
+ QFontMetrics fm(s_titleFont);
+ int captionWidth = fm.width(c);
+ int logoWidth = 0;
+
+ if (Handler()->titleLogo()) {
+ logoWidth = logo.width() + logoOffset;
+ captionWidth += logoWidth;
+ if (logo.height()+1 > fm.height())
+ logo.scaleHeight(fm.height()-1);
+ }
+
+ const int titleEdgeTop = layoutMetric(LM_TitleEdgeTop);
+ const int titleEdgeBottom = layoutMetric(LM_TitleEdgeBottom);
+ const int titleHeight = layoutMetric(LM_TitleHeight);
+ QPixmap textPixmap;
+ QPainter painter;
+ if(Handler()->titleShadow()) {
+ // prepare the shadow
+ textPixmap = QPixmap(captionWidth+4, titleHeight + TOPMARGIN + DECOHEIGHT); // 4 px shadow space
+ textPixmap.fill(QColor(0,0,0));
+ textPixmap.setMask(textPixmap.createHeuristicMask(true));
+ painter.begin(&textPixmap);
+ painter.setFont(s_titleFont);
+ painter.setPen(white);
+ if (Handler()->titleLogo()) {
+ painter.drawText(textPixmap.rect().left(), textPixmap.rect().top()+titleEdgeTop,
+ textPixmap.rect().width()-logo.width() - logoOffset, textPixmap.rect().height()-titleEdgeTop-titleEdgeBottom,
+ AlignCenter, c);
+ painter.drawImage(captionWidth - logo.width(), textPixmap.rect().top() + TOPMARGIN, logo);
+ } else {
+ painter.drawText(textPixmap.rect().left(), textPixmap.rect().top()+titleEdgeTop,
+ textPixmap.rect().width(), textPixmap.rect().height()-titleEdgeTop-titleEdgeBottom,
+ AlignCenter, c);
+ }
+ painter.end();
+ }
+
+ QImage shadow;
+ ShadowEngine se;
+
+ // active
+ aCaptionBuffer->resize(captionWidth+4, titleHeight + TOPMARGIN + DECOHEIGHT); // 4 px shadow
+ painter.begin(aCaptionBuffer);
+ painter.drawTiledPixmap(aCaptionBuffer->rect(), *aTitleBarTile);
+ if(Handler()->titleShadow()) {
+ shadow = se.makeShadow(textPixmap, QColor(0, 0, 0));
+ painter.drawImage(1, 1, shadow);
+ }
+ painter.setFont(s_titleFont);
+ painter.setPen(Handler()->getColor(TitleFont,true));
+ painter.drawText(aCaptionBuffer->rect().left(), aCaptionBuffer->rect().top() + titleEdgeTop,
+ aCaptionBuffer->rect().width()-logoWidth, aCaptionBuffer->rect().height() - titleEdgeTop-titleEdgeBottom,
+ AlignCenter, c);
+ if (Handler()->titleLogo())
+ painter.drawImage(captionWidth - logo.width(), aCaptionBuffer->rect().top() + TOPMARGIN, logo);
+ painter.end();
+
+ // inactive -> no shadow and no logo
+ iCaptionBuffer->resize(captionWidth+4, titleHeight + TOPMARGIN + DECOHEIGHT);
+ painter.begin(iCaptionBuffer);
+ painter.drawTiledPixmap(iCaptionBuffer->rect(), *iTitleBarTile);
+ painter.setFont(s_titleFont);
+ painter.setPen(Handler()->getColor(TitleFont,false));
+ painter.drawText(iCaptionBuffer->rect().left(), iCaptionBuffer->rect().top() + titleEdgeTop,
+ iCaptionBuffer->rect().width() - logoWidth, iCaptionBuffer->rect().height() - titleEdgeTop - titleEdgeBottom,
+ AlignCenter, c);
+ painter.end();
+
+ captionBufferDirty = false;
+}
+
+} // KWinSUSE2
+
+// kate: space-indent on; indent-width 4; replace-tabs on;
+
diff --git a/src/SUSE2client.h b/src/SUSE2client.h
new file mode 100644
index 0000000..ad62a1c
--- /dev/null
+++ b/src/SUSE2client.h
@@ -0,0 +1,87 @@
+/* SuSE KWin window decoration
+ Copyright (C) 2005 Gerd Fleischer <gerdfleischer@web.de>
+ Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
+
+ based on the window decoration "Web":
+ Copyright (C) 2001 Rik Hemsley (rikkus) <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 St, Fifth Floor,
+ Boston, MA 02110-1301 USA.
+*/
+
+#ifndef SUSE2CLIENT_H
+#define SUSE2CLIENT_H
+
+#include <kcommondecoration.h>
+
+#include "SUSE2.h"
+
+namespace KWinSUSE2 {
+
+// global constants
+static const int TOPMARGIN = 4;
+static const int DECOHEIGHT = 2;
+static const int SIDETITLEMARGIN = 6;
+
+class SUSE2Button;
+
+class SUSE2Client : public KCommonDecoration
+{
+public:
+ SUSE2Client(KDecorationBridge *bridge, KDecorationFactory *factory);
+ ~SUSE2Client();
+
+ // pure virtual methods from KCommonDecoration
+ virtual QString visibleName() const;
+ virtual QString defaultButtonsLeft() const;
+ virtual QString defaultButtonsRight() const;
+ virtual KCommonDecorationButton *createButton(ButtonType type);
+
+ virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
+ virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
+ virtual QRegion cornerShape(WindowCorner corner);
+ virtual void updateCaption();
+
+ virtual void init();
+
+ const QPixmap &getTitleBarTile(bool active) const
+ {
+ return active ? *aTitleBarTile : *iTitleBarTile;
+ }
+
+protected:
+ virtual void paintEvent(QPaintEvent *e);
+ virtual void reset(unsigned long changed);
+
+private:
+ QPixmap *aCaptionBuffer, *iCaptionBuffer;
+ void update_captionBuffer();
+
+ QPixmap *aTitleBarTile, *iTitleBarTile;
+ QImage gradient;
+ QColor aGradientBottom, iGradientBottom, aAntialiasBase, iAntialiasBase;
+ bool pixmaps_created;
+ void create_pixmaps();
+ void delete_pixmaps();
+
+ bool captionBufferDirty;
+
+ // settings...
+ QFont s_titleFont;
+};
+
+} // KWinSUSE2
+
+#endif
diff --git a/src/config/Makefile.am b/src/config/Makefile.am
new file mode 100644
index 0000000..57d3bb8
--- /dev/null
+++ b/src/config/Makefile.am
@@ -0,0 +1,9 @@
+INCLUDES = $(all_includes)
+
+kde_module_LTLIBRARIES = kwin_SUSE2_config.la
+
+kwin_SUSE2_config_la_SOURCES = config.cpp configdialog.ui
+kwin_SUSE2_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwin_SUSE2_config_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO)
+
+METASOURCES = AUTO
diff --git a/src/config/Makefile.in b/src/config/Makefile.in
new file mode 100644
index 0000000..35d4251
--- /dev/null
+++ b/src/config/Makefile.in
@@ -0,0 +1,783 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# KDE tags expanded automatically by am_edit - $Revision: 483858 $
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/config
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(kde_moduledir)"
+kde_moduleLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(kde_module_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+kwin_SUSE2_config_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_kwin_SUSE2_config_la_OBJECTS = config.lo
+#>- kwin_SUSE2_config_la_OBJECTS = $(am_kwin_SUSE2_config_la_OBJECTS)
+#>+ 4
+kwin_SUSE2_config_la_final_OBJECTS = kwin_SUSE2_config_la.all_cpp.lo
+kwin_SUSE2_config_la_nofinal_OBJECTS = config.lo configdialog.lo
+@KDE_USE_FINAL_FALSE@kwin_SUSE2_config_la_OBJECTS = $(kwin_SUSE2_config_la_nofinal_OBJECTS)
+@KDE_USE_FINAL_TRUE@kwin_SUSE2_config_la_OBJECTS = $(kwin_SUSE2_config_la_final_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/admin/depcomp
+am__depfiles_maybe = depfiles
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+#>- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 2
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+#>- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+#>- $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 3
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+#>- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+#>+ 2
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(kwin_SUSE2_config_la_SOURCES)
+DIST_SOURCES = $(kwin_SUSE2_config_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+#>- DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 1
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+ARTSCCONFIG = @ARTSCCONFIG@
+AUTOCONF = @AUTOCONF@
+AUTODIRS = @AUTODIRS@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DCOPIDL = @DCOPIDL@
+DCOPIDL2CPP = @DCOPIDL2CPP@
+DCOPIDLNG = @DCOPIDLNG@
+DCOP_DEPENDENCIES = @DCOP_DEPENDENCIES@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_PERMISSIVE_FLAG = @ENABLE_PERMISSIVE_FLAG@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FRAMEWORK_COREAUDIO = @FRAMEWORK_COREAUDIO@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+HAVE_GCC_VISIBILITY = @HAVE_GCC_VISIBILITY@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KCFG_DEPENDENCIES = @KCFG_DEPENDENCIES@
+KCONFIG_COMPILER = @KCONFIG_COMPILER@
+KDECONFIG = @KDECONFIG@
+KDE_CHECK_PLUGIN = @KDE_CHECK_PLUGIN@
+KDE_EXTRA_RPATH = @KDE_EXTRA_RPATH@
+KDE_INCLUDES = @KDE_INCLUDES@
+KDE_LDFLAGS = @KDE_LDFLAGS@
+KDE_MT_LDFLAGS = @KDE_MT_LDFLAGS@
+KDE_MT_LIBS = @KDE_MT_LIBS@
+KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_RPATH = @KDE_RPATH@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+KDE_USE_FPIE = @KDE_USE_FPIE@
+KDE_USE_NMCHECK_FALSE = @KDE_USE_NMCHECK_FALSE@
+KDE_USE_NMCHECK_TRUE = @KDE_USE_NMCHECK_TRUE@
+KDE_USE_PIE = @KDE_USE_PIE@
+KDE_XSL_STYLESHEET = @KDE_XSL_STYLESHEET@
+LDFLAGS = @LDFLAGS@
+LDFLAGS_AS_NEEDED = @LDFLAGS_AS_NEEDED@
+LDFLAGS_NEW_DTAGS = @LDFLAGS_NEW_DTAGS@
+LIBCOMPAT = @LIBCOMPAT@
+LIBCRYPT = @LIBCRYPT@
+LIBDL = @LIBDL@
+LIBJPEG = @LIBJPEG@
+LIBOBJS = @LIBOBJS@
+LIBPNG = @LIBPNG@
+LIBPTHREAD = @LIBPTHREAD@
+LIBRESOLV = @LIBRESOLV@
+LIBS = @LIBS@
+LIBSM = @LIBSM@
+LIBSOCKET = @LIBSOCKET@
+LIBTOOL = @LIBTOOL@
+LIBUCB = @LIBUCB@
+LIBUTIL = @LIBUTIL@
+LIBZ = @LIBZ@
+LIB_KAB = @LIB_KAB@
+LIB_KABC = @LIB_KABC@
+LIB_KDECORE = @LIB_KDECORE@
+LIB_KDED = @LIB_KDED@
+LIB_KDEPIM = @LIB_KDEPIM@
+LIB_KDEPRINT = @LIB_KDEPRINT@
+LIB_KDEUI = @LIB_KDEUI@
+LIB_KDNSSD = @LIB_KDNSSD@
+LIB_KFILE = @LIB_KFILE@
+LIB_KFM = @LIB_KFM@
+LIB_KHTML = @LIB_KHTML@
+LIB_KIMPROXY = @LIB_KIMPROXY@
+LIB_KIO = @LIB_KIO@
+LIB_KJS = @LIB_KJS@
+LIB_KNEWSTUFF = @LIB_KNEWSTUFF@
+LIB_KPARTS = @LIB_KPARTS@
+LIB_KSPELL = @LIB_KSPELL@
+LIB_KSYCOCA = @LIB_KSYCOCA@
+LIB_KUNITTEST = @LIB_KUNITTEST@
+LIB_KUTILS = @LIB_KUTILS@
+LIB_POLL = @LIB_POLL@
+LIB_QPE = @LIB_QPE@
+LIB_QT = @LIB_QT@
+LIB_SMB = @LIB_SMB@
+LIB_X11 = @LIB_X11@
+LIB_XEXT = @LIB_XEXT@
+LIB_XRENDER = @LIB_XRENDER@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MAKEKDEWIDGETS = @MAKEKDEWIDGETS@
+MCOPIDL = @MCOPIDL@
+MEINPROC = @MEINPROC@
+MOC = @MOC@
+MSGFMT = @MSGFMT@
+NOOPT_CFLAGS = @NOOPT_CFLAGS@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+QTE_NORTTI = @QTE_NORTTI@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+UIC = @UIC@
+UIC_TR = @UIC_TR@
+USER_INCLUDES = @USER_INCLUDES@
+USER_LDFLAGS = @USER_LDFLAGS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+USE_THREADS = @USE_THREADS@
+VERSION = @VERSION@
+WOVERLOADED_VIRTUAL = @WOVERLOADED_VIRTUAL@
+XGETTEXT = @XGETTEXT@
+XMKMF = @XMKMF@
+XMLLINT = @XMLLINT@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_INCLUDES = @X_INCLUDES@
+X_LDFLAGS = @X_LDFLAGS@
+X_PRE_LIBS = @X_PRE_LIBS@
+X_RPATH = @X_RPATH@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+include_ARTS_FALSE = @include_ARTS_FALSE@
+include_ARTS_TRUE = @include_ARTS_TRUE@
+include_x11_FALSE = @include_x11_FALSE@
+include_x11_TRUE = @include_x11_TRUE@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kde_appsdir = @kde_appsdir@
+kde_bindir = @kde_bindir@
+kde_confdir = @kde_confdir@
+kde_datadir = @kde_datadir@
+kde_htmldir = @kde_htmldir@
+kde_icondir = @kde_icondir@
+kde_includes = @kde_includes@
+kde_kcfgdir = @kde_kcfgdir@
+kde_libraries = @kde_libraries@
+kde_libs_htmldir = @kde_libs_htmldir@
+kde_libs_prefix = @kde_libs_prefix@
+kde_locale = @kde_locale@
+kde_mimedir = @kde_mimedir@
+kde_moduledir = @kde_moduledir@
+kde_qtver = @kde_qtver@
+kde_servicesdir = @kde_servicesdir@
+kde_servicetypesdir = @kde_servicetypesdir@
+kde_sounddir = @kde_sounddir@
+kde_styledir = @kde_styledir@
+kde_templatesdir = @kde_templatesdir@
+kde_wallpaperdir = @kde_wallpaperdir@
+kde_widgetdir = @kde_widgetdir@
+kdeinitdir = @kdeinitdir@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+qt_includes = @qt_includes@
+qt_libraries = @qt_libraries@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+unsermake_enable_pch_FALSE = @unsermake_enable_pch_FALSE@
+unsermake_enable_pch_TRUE = @unsermake_enable_pch_TRUE@
+x_includes = @x_includes@
+x_libraries = @x_libraries@
+xdg_appsdir = @xdg_appsdir@
+xdg_directorydir = @xdg_directorydir@
+xdg_menudir = @xdg_menudir@
+INCLUDES = $(all_includes)
+kde_module_LTLIBRARIES = kwin_SUSE2_config.la
+#>- kwin_SUSE2_config_la_SOURCES = config.cpp configdialog.ui
+#>+ 1
+kwin_SUSE2_config_la_SOURCES=config.cpp configdialog.cpp
+kwin_SUSE2_config_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
+kwin_SUSE2_config_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO)
+#>- METASOURCES = AUTO
+#>- all: all-am
+#>+ 1
+all: docs-am all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+#>- @for dep in $?; do \
+#>- case '$(am__configure_deps)' in \
+#>- *$$dep*) \
+#>- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+#>- && exit 0; \
+#>- exit 1;; \
+#>- esac; \
+#>- done; \
+#>- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/config/Makefile'; \
+#>- cd $(top_srcdir) && \
+#>- $(AUTOMAKE) --gnu src/config/Makefile
+#>+ 12
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/config/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/config/Makefile
+ cd $(top_srcdir) && perl admin/am_edit src/config/Makefile.in
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-kde_moduleLTLIBRARIES: $(kde_module_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(kde_moduledir)" || $(mkdir_p) "$(DESTDIR)$(kde_moduledir)"
+ @list='$(kde_module_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(kde_moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(kde_moduledir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(kde_moduleLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(kde_moduledir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-kde_moduleLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @set -x; list='$(kde_module_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(kde_moduledir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(kde_moduledir)/$$p"; \
+ done
+
+clean-kde_moduleLTLIBRARIES:
+ -test -z "$(kde_module_LTLIBRARIES)" || rm -f $(kde_module_LTLIBRARIES)
+ @list='$(kde_module_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+#>- kwin_SUSE2_config.la: $(kwin_SUSE2_config_la_OBJECTS) $(kwin_SUSE2_config_la_DEPENDENCIES)
+#>+ 2
+@KDE_USE_CLOSURE_TRUE@kwin_SUSE2_config.la: kwin_SUSE2_config.la.closure $(kwin_SUSE2_config_la_OBJECTS) $(kwin_SUSE2_config_la_DEPENDENCIES)
+@KDE_USE_CLOSURE_FALSE@kwin_SUSE2_config.la: $(kwin_SUSE2_config_la_OBJECTS) $(kwin_SUSE2_config_la_DEPENDENCIES)
+ $(CXXLINK) -rpath $(kde_moduledir) $(kwin_SUSE2_config_la_LDFLAGS) $(kwin_SUSE2_config_la_OBJECTS) $(kwin_SUSE2_config_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+ for dir in "$(DESTDIR)$(kde_moduledir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean clean-am
+
+#>- clean-am: clean-generic clean-kde_moduleLTLIBRARIES clean-libtool \
+#>- mostlyclean-am
+#>+ 2
+clean-am: clean-metasources clean-ui clean-closures clean-bcheck clean-final clean-generic clean-kde_moduleLTLIBRARIES clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+#>- install-data-am: install-kde_moduleLTLIBRARIES
+#>+ 1
+install-data-am:
+
+#>- install-exec-am:
+#>+ 1
+install-exec-am: install-kde_moduleLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-kde_moduleLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-kde_moduleLTLIBRARIES clean-libtool ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am \
+ install-kde_moduleLTLIBRARIES install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am \
+ uninstall-kde_moduleLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
+
+#>+ 8
+kwin_SUSE2_config.la.closure: $(kwin_SUSE2_config_la_OBJECTS) $(kwin_SUSE2_config_la_DEPENDENCIES)
+ @echo "int main() {return 0;}" > kwin_SUSE2_config_la_closure.cpp
+ @$(LTCXXCOMPILE) -c kwin_SUSE2_config_la_closure.cpp
+ $(CXXLINK) kwin_SUSE2_config_la_closure.lo $(kwin_SUSE2_config_la_LDFLAGS) $(kwin_SUSE2_config_la_OBJECTS) $(kwin_SUSE2_config_la_LIBADD) $(LIBS)
+ @rm -f kwin_SUSE2_config_la_closure.* kwin_SUSE2_config.la.closure
+ @echo "timestamp" > kwin_SUSE2_config.la.closure
+
+
+#>+ 3
+config.moc: $(srcdir)/config.h
+ $(MOC) $(srcdir)/config.h -o config.moc
+
+#>+ 2
+mocs: config.moc
+
+#>+ 3
+clean-metasources:
+ -rm -f config.moc
+
+#>+ 2
+KDE_DIST=configdialog.ui configdialog.h Makefile.in Makefile.am
+
+#>+ 4
+clean-ui:
+ -rm -f \
+ configdialog.cpp configdialog.h configdialog.moc
+
+#>+ 3
+clean-closures:
+ -rm -f kwin_SUSE2_config.la.closure
+
+#>+ 2
+docs-am:
+
+#>+ 15
+force-reedit:
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/config/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/config/Makefile
+ cd $(top_srcdir) && perl admin/am_edit src/config/Makefile.in
+
+
+#>+ 21
+clean-bcheck:
+ rm -f *.bchecktest.cc *.bchecktest.cc.class a.out
+
+bcheck: bcheck-am
+
+bcheck-am:
+ @for i in ; do \
+ if test $(srcdir)/$$i -nt $$i.bchecktest.cc; then \
+ echo "int main() {return 0;}" > $$i.bchecktest.cc ; \
+ echo "#include \"$$i\"" >> $$i.bchecktest.cc ; \
+ echo "$$i"; \
+ if ! $(CXXCOMPILE) --dump-class-hierarchy -c $$i.bchecktest.cc; then \
+ rm -f $$i.bchecktest.cc; exit 1; \
+ fi ; \
+ echo "" >> $$i.bchecktest.cc.class; \
+ perl $(top_srcdir)/admin/bcheck.pl $$i.bchecktest.cc.class || { rm -f $$i.bchecktest.cc; exit 1; }; \
+ rm -f a.out; \
+ fi ; \
+ done
+
+
+#>+ 11
+kwin_SUSE2_config_la.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/config.cpp $(srcdir)/configdialog.cpp configdialog.moc config.moc
+ @echo 'creating kwin_SUSE2_config_la.all_cpp.cpp ...'; \
+ rm -f kwin_SUSE2_config_la.all_cpp.files kwin_SUSE2_config_la.all_cpp.final; \
+ echo "#define KDE_USE_FINAL 1" >> kwin_SUSE2_config_la.all_cpp.final; \
+ for file in config.cpp configdialog.cpp ; do \
+ echo "#include \"$$file\"" >> kwin_SUSE2_config_la.all_cpp.files; \
+ test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> kwin_SUSE2_config_la.all_cpp.final; \
+ done; \
+ cat kwin_SUSE2_config_la.all_cpp.final kwin_SUSE2_config_la.all_cpp.files > kwin_SUSE2_config_la.all_cpp.cpp; \
+ rm -f kwin_SUSE2_config_la.all_cpp.final kwin_SUSE2_config_la.all_cpp.files
+
+#>+ 3
+clean-final:
+ -rm -f kwin_SUSE2_config_la.all_cpp.cpp
+
+#>+ 3
+final:
+ $(MAKE) kwin_SUSE2_config_la_OBJECTS="$(kwin_SUSE2_config_la_final_OBJECTS)" all-am
+
+#>+ 3
+final-install:
+ $(MAKE) kwin_SUSE2_config_la_OBJECTS="$(kwin_SUSE2_config_la_final_OBJECTS)" install-am
+
+#>+ 3
+no-final:
+ $(MAKE) kwin_SUSE2_config_la_OBJECTS="$(kwin_SUSE2_config_la_nofinal_OBJECTS)" all-am
+
+#>+ 3
+no-final-install:
+ $(MAKE) kwin_SUSE2_config_la_OBJECTS="$(kwin_SUSE2_config_la_nofinal_OBJECTS)" install-am
+
+#>+ 3
+kde-rpo-clean:
+ -rm -f *.rpo
+
+#>+ 6
+nmcheck:
+config.lo: config.moc
+nmcheck-am: nmcheck
+$(srcdir)/config.cpp: configdialog.h
+config.o: config.moc
+
+#>+ 15
+configdialog.cpp: $(srcdir)/configdialog.ui configdialog.h configdialog.moc
+ rm -f configdialog.cpp
+ echo '#include <kdialog.h>' > configdialog.cpp
+ echo '#include <klocale.h>' >> configdialog.cpp
+ $(UIC) -tr ${UIC_TR} -i configdialog.h $(srcdir)/configdialog.ui > configdialog.cpp.temp ; ret=$$?; \
+ $(PERL) -pe "s,${UIC_TR}( \"\" ),QString::null,g" configdialog.cpp.temp | $(PERL) -pe "s,${UIC_TR}( \"\"\, \"\" ),QString::null,g" | $(PERL) -pe "s,image([0-9][0-9]*)_data,img\$$1_configdialog,g" | $(PERL) -pe "s,: QWizard\(,: KWizard(,g" >> configdialog.cpp ;\
+ rm -f configdialog.cpp.temp ;\
+ if test "$$ret" = 0; then echo '#include "configdialog.moc"' >> configdialog.cpp; else rm -f configdialog.cpp ; exit $$ret ; fi
+
+configdialog.h: $(srcdir)/configdialog.ui
+ rm -rf configdialog.h;
+ $(UIC) $(srcdir)/configdialog.ui | $(PERL) -pi -e "s,public QWizard,public KWizard,g; s,#include <qwizard.h>,#include <kwizard.h>,g" >> configdialog.h ;
+configdialog.moc: configdialog.h
+ $(MOC) configdialog.h -o configdialog.moc
diff --git a/src/config/config.cpp b/src/config/config.cpp
new file mode 100644
index 0000000..bc70aa6
--- /dev/null
+++ b/src/config/config.cpp
@@ -0,0 +1,284 @@
+/* SUSE2 KWin window decoration
+ Copyright (C) 2005 Gerd Fleischer <gerdfleischer@web.de>
+
+ based on the window decoration "Plastik"
+ Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
+
+ based on the window decoration "Web":
+ Copyright (C) 2001 Rik Hemsley (rikkus) <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 St, Fifth Floor,
+ Boston, MA 02110-1301 USA.
+*/
+
+//#include <kdebug.h>
+
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qslider.h>
+#include <qspinbox.h>
+#include <qwhatsthis.h>
+#include <qimage.h>
+#include <qlabel.h>
+#include <qcombobox.h>
+
+#include <kdeversion.h>
+#include <kconfig.h>
+#include <klocale.h>
+#include <kglobal.h>
+#include <kurlrequester.h>
+#include <kstandarddirs.h>
+#include <kurl.h>
+#include <kfiledialog.h>
+#include <knuminput.h>
+#include <kfileitem.h>
+#include <kcolorbutton.h>
+
+#include "config.h"
+#include "configdialog.h"
+
+SUSE2Config::SUSE2Config(KConfig *config, QWidget *parent)
+ : QObject(parent), m_config(0), m_dialog(0)
+{
+ m_parent = parent;
+ // create the configuration object
+ m_config = new KConfig("kwinSUSE2rc");
+ KGlobal::locale()->insertCatalogue("kwin_clients");
+ KGlobal::locale()->insertCatalogue("kwin_SUSE2");
+
+ // create and show the configuration dialog
+ m_dialog = new ConfigDialog(parent);
+
+ m_dialog->show();
+
+ // load the configuration
+ load(config);
+ toggleIconSettings(m_dialog->useTitleProps->isChecked());
+
+ // setup the connections
+ connect(m_dialog->titleAlign, SIGNAL(clicked(int)), SIGNAL(changed()));
+ connect(m_dialog->roundCorners, SIGNAL(clicked(int)), SIGNAL(changed()));
+ connect(m_dialog->menuClose, SIGNAL(toggled(bool)), SIGNAL(changed()));
+ connect(m_dialog->titleShadow, SIGNAL(toggled(bool)), SIGNAL(changed()));
+ connect(m_dialog->addSpace, SIGNAL(valueChanged(int)), SIGNAL(changed()));
+ connect(m_dialog->titlebarStyle, SIGNAL(activated(int)), SIGNAL(changed()));
+
+ connect(m_dialog->buttonType, SIGNAL(activated(int)), SIGNAL(changed()));
+ connect(m_dialog->customColors, SIGNAL(toggled(bool)), SIGNAL(changed()));
+ connect(m_dialog->useTitleProps, SIGNAL(toggled(bool)), SIGNAL(changed()));
+ connect(m_dialog->animateButtons, SIGNAL(toggled(bool)), SIGNAL(changed()));
+ connect(m_dialog->redCloseButton, SIGNAL(toggled(bool)), SIGNAL(changed()));
+ connect(m_dialog->iconSize, SIGNAL(valueChanged(int)), SIGNAL(changed()));
+ connect(m_dialog->customIconColors, SIGNAL(toggled(bool)), SIGNAL(changed()));
+ connect(m_dialog->activeFgColor, SIGNAL(changed(const QColor &)), SIGNAL(changed()));
+ connect(m_dialog->activeBgColor, SIGNAL(changed(const QColor &)), SIGNAL(changed()));
+ connect(m_dialog->inactiveFgColor, SIGNAL(changed(const QColor &)), SIGNAL(changed()));
+ connect(m_dialog->inactiveBgColor, SIGNAL(changed(const QColor &)), SIGNAL(changed()));
+ connect(m_dialog->iconShadow, SIGNAL(toggled(bool)), SIGNAL(changed()));
+
+ connect(m_dialog->titleBarLogo, SIGNAL(toggled(bool)), SIGNAL(changed()));
+ connect(m_dialog->titleBarLogoOffset, SIGNAL(valueChanged(int)), SIGNAL(changed()));
+
+ connect(m_dialog->useTitleProps, SIGNAL(toggled(bool)), SLOT(toggleIconSettings(bool)));
+ connect(m_dialog->selectButton, SIGNAL(clicked()), SLOT(selectImage()));
+}
+
+SUSE2Config::~SUSE2Config()
+{
+ if (m_dialog) delete m_dialog;
+ if (m_config) delete m_config;
+}
+
+void SUSE2Config::load(KConfig *)
+{
+ m_config->setGroup("General");
+
+ QString alignValue = m_config->readEntry("TitleAlignment", "AlignLeft");
+ QRadioButton *alignButton = (QRadioButton*)m_dialog->titleAlign->child(alignValue.latin1());
+ if (alignButton) alignButton->setChecked(true);
+
+ QString roundValue = m_config->readEntry("RoundCorners", "NotMaximized");
+ QRadioButton *roundButton = (QRadioButton*)m_dialog->roundCorners->child(roundValue.latin1());
+ if (roundButton) roundButton->setChecked(true);
+
+ bool menuClose = m_config->readBoolEntry("CloseOnMenuDoubleClick", false);
+ m_dialog->menuClose->setChecked(menuClose);
+
+ bool titleShadow = m_config->readBoolEntry("TitleShadow", true);
+ m_dialog->titleShadow->setChecked(titleShadow);
+
+ int addSpace = m_config->readNumEntry("AddSpace", 4);
+ m_dialog->addSpace->setValue(addSpace);
+
+ int titlebarStyle = m_config->readNumEntry("TitleBarStyle", 0);
+ m_dialog->titlebarStyle->setCurrentItem(titlebarStyle);
+
+ int titleButtonType = m_config->readNumEntry("TitleBarButtonType", 2);
+ m_dialog->buttonType->setCurrentItem(titleButtonType);
+
+ bool customColors = m_config->readBoolEntry("CustomColors", false);
+ m_dialog->customColors->setChecked(customColors);
+
+ bool useTitleProps = m_config->readBoolEntry("UseTitleProps", true);
+ m_dialog->useTitleProps->setChecked(useTitleProps);
+
+ bool animateButtons = m_config->readBoolEntry("AnimateButtons", true);
+ m_dialog->animateButtons->setChecked(animateButtons);
+
+ bool redCloseButton = m_config->readBoolEntry("RedCloseButton", false);
+ m_dialog->redCloseButton->setChecked(redCloseButton);
+
+ int iconSize = m_config->readNumEntry("IconSize", 45);
+ m_dialog->iconSize->setValue(iconSize);
+
+ bool customIconColors = m_config->readBoolEntry("CustomIconColors", false);
+ m_dialog->customIconColors->setChecked(customIconColors);
+
+ QColor afgcolor = QColor(10, 20, 40);
+ QColor aFgColor = m_config->readColorEntry("AFgColor", &afgcolor);
+ m_dialog->activeFgColor->setColor(aFgColor);
+
+ QColor abgcolor = QColor(210, 220, 240);
+ QColor aBgColor = m_config->readColorEntry("ABgColor", &abgcolor);
+ m_dialog->activeBgColor->setColor(aBgColor);
+
+ QColor ifgcolor = QColor(40, 40, 40);
+ QColor iFgColor = m_config->readColorEntry("IFgColor", &ifgcolor);
+ m_dialog->inactiveFgColor->setColor(iFgColor);
+
+ QColor ibgcolor = QColor(240, 240, 240);
+ QColor iBgColor = m_config->readColorEntry("AFgColor", &ibgcolor);
+ m_dialog->inactiveBgColor->setColor(iBgColor);
+
+ bool iconShadow = m_config->readBoolEntry("IconShadow", true);
+ m_dialog->iconShadow->setChecked(iconShadow);
+
+ bool titleBarLogo = m_config->readBoolEntry("TitleBarLogo", false);
+ m_dialog->titleBarLogo->setChecked(titleBarLogo);
+
+ int titleBarLogoOffset = m_config->readNumEntry("TitleBarLogoOffset", 3);
+ m_dialog->titleBarLogoOffset->setValue(titleBarLogoOffset);
+
+ QString titleBarImage = locate("data", "kwin/pics/titlebar_decor.png");
+ titlebarLogoURL = m_config->readEntry("TitleBarLogoURL", titleBarImage);
+ QImage tmpLogo = QImage::QImage(titlebarLogoURL);
+ m_dialog->logoImage->setPixmap(QPixmap(tmpLogo.smoothScale(120, 20, QImage::ScaleMin)));
+
+}
+
+void SUSE2Config::save(KConfig *) const
+{
+ m_config->setGroup("General");
+
+ QRadioButton *alignButton = (QRadioButton*)m_dialog->titleAlign->selected();
+ if (alignButton) m_config->writeEntry("TitleAlignment", QString(alignButton->name()));
+ QRadioButton *roundButton = (QRadioButton*)m_dialog->roundCorners->selected();
+ if (roundButton) m_config->writeEntry("RoundCorners", QString(roundButton->name()));
+ m_config->writeEntry("CloseOnMenuDoubleClick", m_dialog->menuClose->isChecked());
+ m_config->writeEntry("TitleShadow", m_dialog->titleShadow->isChecked());
+ m_config->writeEntry("AddSpace", m_dialog->addSpace->value());
+ m_config->writeEntry("TitleBarStyle", m_dialog->titlebarStyle->currentItem());
+
+ m_config->writeEntry("TitleBarButtonType", m_dialog->buttonType->currentItem());
+ m_config->writeEntry("CustomColors", m_dialog->customColors->isChecked());
+ m_config->writeEntry("UseTitleProps", m_dialog->useTitleProps->isChecked());
+ m_config->writeEntry("AnimateButtons", m_dialog->animateButtons->isChecked());
+ m_config->writeEntry("RedCloseButton", m_dialog->redCloseButton->isChecked());
+ m_config->writeEntry("IconSize", m_dialog->iconSize->value());
+ m_config->writeEntry("CustomIconColors", m_dialog->customIconColors->isChecked());
+ m_config->writeEntry("AFgColor", m_dialog->activeFgColor->color());
+ m_config->writeEntry("ABgColor", m_dialog->activeBgColor->color());
+ m_config->writeEntry("IFgColor", m_dialog->inactiveFgColor->color());
+ m_config->writeEntry("IBgColor", m_dialog->inactiveBgColor->color());
+ m_config->writeEntry("IconShadow", m_dialog->iconShadow->isChecked());
+
+ m_config->writeEntry("TitleBarLogo", m_dialog->titleBarLogo->isChecked());
+ m_config->writeEntry("TitleBarLogoOffset", m_dialog->titleBarLogoOffset->value());
+ m_config->writeEntry("TitleBarLogoURL", QString(titlebarLogoURL));
+ m_config->sync();
+}
+
+void SUSE2Config::defaults()
+{
+ QRadioButton *alignButton = (QRadioButton*)m_dialog->titleAlign->child("AlignLeft");
+ if (alignButton) alignButton->setChecked(true);
+ QRadioButton *roundButton = (QRadioButton*)m_dialog->roundCorners->child("NotMaximized");
+ if (roundButton) roundButton->setChecked(true);
+ m_dialog->menuClose->setChecked(false);
+ m_dialog->titleShadow->setChecked(true);
+ m_dialog->addSpace->setValue(4);
+ m_dialog->titlebarStyle->setCurrentItem(0);
+
+ m_dialog->buttonType->setCurrentItem(2);
+ m_dialog->customColors->setChecked(false);
+ m_dialog->useTitleProps->setChecked(true);
+ m_dialog->animateButtons->setChecked(true);
+ m_dialog->redCloseButton->setChecked(false);
+ m_dialog->iconSize->setValue(45);
+ m_dialog->customIconColors->setChecked(false);
+ m_dialog->activeFgColor->setColor(QColor(10, 20, 40));
+ m_dialog->activeBgColor->setColor(QColor(210, 220, 240));
+ m_dialog->inactiveFgColor->setColor(QColor(40, 40, 40));
+ m_dialog->inactiveBgColor->setColor(QColor(240, 240, 240));
+ m_dialog->iconShadow->setChecked(true);
+
+ m_dialog->titleBarLogo->setChecked(false);
+ m_dialog->titleBarLogoOffset->setValue(3);
+ titlebarLogoURL = locate("data", "kwin/pics/titlebar_decor.png");
+ QImage tmpLogo = QImage::QImage(titlebarLogoURL);
+ m_dialog->logoImage->setPixmap(QPixmap(tmpLogo.smoothScale(120, 20, QImage::ScaleMin)));
+}
+
+void SUSE2Config::toggleIconSettings(bool checked) const
+{
+ m_dialog->customIconColors->setEnabled(!checked);
+ m_dialog->activeLbl->setEnabled(!checked);
+ m_dialog->activeDownLbl->setEnabled(!checked);
+ m_dialog->inactiveLbl->setEnabled(!checked);
+ m_dialog->inactiveDownLbl->setEnabled(!checked);
+ m_dialog->activeFgColor->setEnabled(!checked);
+ m_dialog->activeBgColor->setEnabled(!checked);
+ m_dialog->inactiveFgColor->setEnabled(!checked);
+ m_dialog->inactiveBgColor->setEnabled(!checked);
+ m_dialog->iconShadow->setEnabled(!checked);
+}
+
+void SUSE2Config::selectImage()
+{
+ KURL logoURL = KFileDialog::getImageOpenURL(titlebarLogoURL, m_parent, i18n("Select Logo Image"));
+ KFileItem tmpFileItem = KFileItem(KFileItem::Unknown, KFileItem::Unknown, logoURL);
+ if (!logoURL.isEmpty() && tmpFileItem.isFile() && tmpFileItem.isReadable()) {
+ titlebarLogoURL = logoURL.path();
+ QImage tmpLogo = QImage::QImage(titlebarLogoURL);
+ m_dialog->logoImage->setPixmap(QPixmap(tmpLogo.smoothScale(120, 20, QImage::ScaleMin)));
+ emit changed();
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// Plugin Stuff //
+//////////////////////////////////////////////////////////////////////////////
+
+extern "C"
+{
+ KDE_EXPORT QObject *allocate_config(KConfig *config, QWidget *parent) {
+ return (new SUSE2Config(config, parent));
+ }
+}
+
+#include "config.moc"
+
+// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/src/config/config.h b/src/config/config.h
new file mode 100644
index 0000000..8d05f72
--- /dev/null
+++ b/src/config/config.h
@@ -0,0 +1,62 @@
+/* Plastik KWin window decoration
+ Copyright (C) 2005 Gerd Fleischer <gerdfleischer@web.de>
+ Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
+
+ based on the window decoration "Web":
+ Copyright (C) 2001 Rik Hemsley (rikkus) <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 St, Fifth Floor,
+ Boston, MA 02110-1301 USA.
+ */
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include <qobject.h>
+
+class QButtonGroup;
+class QGroupBox;
+class KConfig;
+class ConfigDialog;
+
+class SUSE2Config : public QObject
+{
+ Q_OBJECT
+
+public:
+ SUSE2Config(KConfig *config, QWidget *parent);
+ ~SUSE2Config();
+
+signals:
+ void changed();
+
+public slots:
+ void load(KConfig *config);
+ void save(KConfig *config) const;
+ void defaults();
+
+private:
+ QWidget *m_parent;
+ KConfig *m_config;
+ ConfigDialog *m_dialog;
+ QString titlebarLogoURL;
+
+private slots:
+ void toggleIconSettings(bool) const;
+ void selectImage();
+};
+
+#endif
+
diff --git a/src/config/configdialog.ui b/src/config/configdialog.ui
new file mode 100644
index 0000000..7efee62
--- /dev/null
+++ b/src/config/configdialog.ui
@@ -0,0 +1,840 @@
+<!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>538</width>
+ <height>277</height>
+ </rect>
+ </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="QTabWidget" row="0" column="0">
+ <property name="name">
+ <cstring>tabWidget2</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Ge&amp;neral</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>titleAlign</cstring>
+ </property>
+ <property name="title">
+ <string>Title Alignment</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>AlignLeft</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Left</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Align the title left.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>AlignHCenter</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Center</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Center the title.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>AlignRight</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Right</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Align the title right.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup" row="1" column="0">
+ <property name="name">
+ <cstring>roundCorners</cstring>
+ </property>
+ <property name="title">
+ <string>Rounded Top Corners</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>RoundAlways</cstring>
+ </property>
+ <property name="text">
+ <string>Alwa&amp;ys</string>
+ </property>
+ <property name="accel">
+ <string>Alt+Y</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Always draw rounded window top corners.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>NotMaximized</cstring>
+ </property>
+ <property name="text">
+ <string>Not maximi&amp;zed</string>
+ </property>
+ <property name="accel">
+ <string>Alt+Z</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Draw rounded top corners if the window is not maximized.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>RoundNever</cstring>
+ </property>
+ <property name="text">
+ <string>Ne&amp;ver</string>
+ </property>
+ <property name="accel">
+ <string>Alt+V</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Never draw rounded window top corners.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>menuClose</cstring>
+ </property>
+ <property name="text">
+ <string>Close &amp;windows by double clicking the menu button</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this option if you want windows to be closed when you double click the menu button, similar to Microsoft Windows.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>titleShadow</cstring>
+ </property>
+ <property name="text">
+ <string>Use shadowed &amp;text</string>
+ </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>
+ <widget class="QLayoutWidget" row="4" column="0">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>addSpace</cstring>
+ </property>
+ <property name="suffix">
+ <string> px</string>
+ </property>
+ <property name="maxValue">
+ <number>20</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Here you can set some additional space for the titlebar height.</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_4</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>additional space for title height</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer8</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>71</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="5" column="0">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_5</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Titlebarstyle:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>Toplight</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Balanced</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>titlebarStyle</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select the titlebar style.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer9</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>301</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Bu&amp;ttons</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Buttontype:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>Plastik flat</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Lipstik flat</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Plastik 3D</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Lipstik 3D</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Lipstik bright</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>buttonType</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select the buttontype.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>41</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <spacer row="6" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>spacer12</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>350</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>customColors</cstring>
+ </property>
+ <property name="text">
+ <string>Custom colors for button bac&amp;kground</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Allow custom colors for the button background. The colors for the buttonbackground from the colorscheme are used then.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>useTitleProps</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Use titlefont settings for button icons</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Use the titlefont settings (color, shadow) for the button icons. Overrides the custom color settings.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>animateButtons</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;nimate buttons</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this option if you want the buttons to fade in when the mouse pointer hovers over them and fade out again when it moves away.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="5" column="0">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Iconsize:</string>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox">
+ <property name="name">
+ <cstring>iconSize</cstring>
+ </property>
+ <property name="suffix">
+ <string> %</string>
+ </property>
+ <property name="maxValue">
+ <number>80</number>
+ </property>
+ <property name="minValue">
+ <number>20</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Here you can set the size of the button icons relative to the button size.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>171</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox" row="4" column="0">
+ <property name="name">
+ <cstring>redCloseButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Red closebutton icon</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Paint the icon of the closebutton in red (this overrides all other colorsettings).</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="1">
+ <property name="name">
+ <cstring>customIconColors</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Custom icon colors</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Allow custom colors for the button icons.</string>
+ </property>
+ </widget>
+ <spacer row="1" column="2" rowspan="4" colspan="1">
+ <property name="name">
+ <cstring>spacer11_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>120</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="1" column="1" rowspan="4" colspan="1">
+ <property name="name">
+ <cstring>layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>activeLbl</cstring>
+ </property>
+ <property name="text">
+ <string>Active:</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>activeDownLbl</cstring>
+ </property>
+ <property name="text">
+ <string>Active down:</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>inactiveLbl</cstring>
+ </property>
+ <property name="text">
+ <string>Inactive:</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>inactiveDownLbl</cstring>
+ </property>
+ <property name="text">
+ <string>Inactive down:</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout12</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KColorButton">
+ <property name="name">
+ <cstring>activeFgColor</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Color for the icon of the active button.</string>
+ </property>
+ </widget>
+ <widget class="KColorButton">
+ <property name="name">
+ <cstring>activeBgColor</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Color for the icon of the active button when pressed.</string>
+ </property>
+ </widget>
+ <widget class="KColorButton">
+ <property name="name">
+ <cstring>inactiveFgColor</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Color for the icon of the inactive button.</string>
+ </property>
+ </widget>
+ <widget class="KColorButton">
+ <property name="name">
+ <cstring>inactiveBgColor</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Color for the icon of the inactive button when pressed.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox" row="5" column="1">
+ <property name="name">
+ <cstring>iconShadow</cstring>
+ </property>
+ <property name="text">
+ <string>Shado&amp;w for icons</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this if you want to have shadows for the button icons on active windows.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Logo</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="3" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>spacer13</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>330</width>
+ <height>41</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Logo preview:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>logoImage</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>120</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>GroupBoxPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Offset from title:</string>
+ </property>
+ </widget>
+ <widget class="KIntSpinBox" row="1" column="2">
+ <property name="name">
+ <cstring>titleBarLogoOffset</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="suffix">
+ <string> px</string>
+ </property>
+ <property name="minValue">
+ <number>0</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Set the offset of the logo from the titletext.</string>
+ </property>
+ </widget>
+ <spacer row="1" column="3" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>336</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="2" column="3">
+ <property name="name">
+ <cstring>selectButton</cstring>
+ </property>
+ <property name="text">
+ <string>Sele&amp;ct Image</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Select the titlebar logo image.</string>
+ </property>
+ </widget>
+ <spacer row="2" column="4">
+ <property name="name">
+ <cstring>spacer3_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>220</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="5">
+ <property name="name">
+ <cstring>titleBarLogo</cstring>
+ </property>
+ <property name="text">
+ <string>Show &amp;titlebar logo</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Check this if you want to see the titlebar logo in the titlebar.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ </grid>
+</widget>
+<tabstops>
+ <tabstop>AlignLeft</tabstop>
+ <tabstop>AlignHCenter</tabstop>
+ <tabstop>AlignRight</tabstop>
+ <tabstop>RoundAlways</tabstop>
+ <tabstop>NotMaximized</tabstop>
+ <tabstop>RoundNever</tabstop>
+ <tabstop>titleShadow</tabstop>
+ <tabstop>animateButtons</tabstop>
+ <tabstop>buttonType</tabstop>
+ <tabstop>menuClose</tabstop>
+ <tabstop>titleBarLogo</tabstop>
+ <tabstop>titleBarLogoOffset</tabstop>
+ <tabstop>selectButton</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>knuminput.h</includehint>
+ <includehint>knuminput.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>knuminput.h</includehint>
+</includehints>
+</UI>
diff --git a/src/misc.cpp b/src/misc.cpp
new file mode 100644
index 0000000..966f7b1
--- /dev/null
+++ b/src/misc.cpp
@@ -0,0 +1,86 @@
+/* SuSE KWin window decoration
+ Copyright (C) 2005 Adrian Schroeter <adrian@suse.de>
+
+ based on the window decoration "Plastik" and "Web":
+ Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
+ Copyright (C) 2001 Rik Hemsley (rikkus) <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 St, Fifth Floor,
+ Boston, MA 02110-1301 USA.
+ */
+
+#include <kpixmap.h>
+#include <kpixmapeffect.h>
+
+#include <qcolor.h>
+#include <qimage.h>
+#include <qpainter.h>
+
+#include "misc.h"
+
+QColor hsvRelative(QColor& baseColor, int relativeH, int relativeS, int relativeV)
+{
+ int h, s, v;
+ baseColor.hsv(&h, &s, &v);
+
+ h += relativeH;
+ s += relativeS;
+ v += relativeV;
+
+ if(h < 0) { h = 0; }
+ else if(h > 359) { h = 359; }
+ if(s < 0) { s = 0; }
+ else if(s > 255) { s = 255; }
+ if(v < 0) { v = 0; }
+ else if(v > 255) { v = 255; }
+
+ QColor c;
+ c.setHsv( h, s, v );
+ return c;
+}
+
+QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a)
+{
+
+ // normal button...
+ QRgb rgb = bgColor.rgb();
+ QRgb rgb_b = fgColor.rgb();
+ int alpha = a;
+ if(alpha>255) alpha = 255;
+ if(alpha<0) alpha = 0;
+ int inv_alpha = 255 - alpha;
+
+ QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255,
+ qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255,
+ qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) );
+
+ return result;
+}
+
+QImage recolorImage(QImage *img, QColor color) {
+ QImage destImg(img->width(),img->height(),32);
+ destImg.setAlphaBuffer(true);
+ for (int x = 0; x < img->width(); x++) {
+ for (int y = 0; y < img->height(); y++) {
+ if(img->pixel(x,y) == qRgb(0,0,0)) {
+ destImg.setPixel(x,y,color.rgb() ); // set to the new color
+ } else {
+ destImg.setPixel(x,y,qRgba(0,0,0,0) ); // set transparent...
+ }
+ }
+ }
+
+ return destImg;
+}
diff --git a/src/misc.h b/src/misc.h
new file mode 100644
index 0000000..8491d52
--- /dev/null
+++ b/src/misc.h
@@ -0,0 +1,30 @@
+/* Plastik KWin window decoration
+ Copyright (C) 2003 Sandro Giessl <ceebx@users.sourceforge.net>
+
+ based on the window decoration "Web":
+ Copyright (C) 2001 Rik Hemsley (rikkus) <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 St, Fifth Floor,
+ Boston, MA 02110-1301 USA.
+ */
+
+#ifndef MISC_H
+#define MISC_H
+
+QColor hsvRelative(QColor& baseColor, int relativeH, int relativeS = 0, int relativeV = 0);
+QColor alphaBlendColors(const QColor &backgroundColor, const QColor &foregroundColor, const int alpha);
+QImage recolorImage(QImage *img, QColor color);
+
+#endif // MISC_H
diff --git a/src/shadow.cpp b/src/shadow.cpp
new file mode 100644
index 0000000..1362679
--- /dev/null
+++ b/src/shadow.cpp
@@ -0,0 +1,126 @@
+/* Copyright (C) 2005 Gerd Fleischer <gerdfleischer@web.de>
+ * Copyright (C) 2003 by Sandro Giessl
+ * based on the nice CVS KDesktop KShadowEngine class. thanks!
+ * looking forward to see KShadowEngine in kdefx somewhen btw.. :)
+ * ------------------------------------------------------------------------
+ * these are the original copyright notes:
+ * This file is proposed to be part of the KDE libraries.
+ * Copyright (C) 2003 Laur Ivan <laurivan@eircom.net>
+ *
+ * Many thanks to:
+ * - Bernardo Hung <deciare@gta.igs.net> for the enhanced shadow
+ * algorithm (currently used)
+ * - Tim Jansen <tim@tjansen.de> for the API updates and fixes.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ */
+
+#include "shadow.h"
+#include <qcolor.h>
+
+ShadowEngine::ShadowEngine()
+{
+ thickness_ = 1;
+ multiplicationFactor_ = 10.0;
+}
+
+ShadowEngine::~ShadowEngine()
+{
+}
+
+QImage ShadowEngine::makeShadow(const QPixmap& textPixmap, const QColor &bgColor)
+{
+ QImage result;
+
+ // create a new image for for the shaddow
+ int w = textPixmap.width();
+ int h = textPixmap.height();
+
+ // avoid calling these methods for every pixel
+ int bgRed = bgColor.red();
+ int bgGreen = bgColor.green();
+ int bgBlue = bgColor.blue();
+
+ float alphaShadow;
+
+ /*
+ * This is the source pixmap
+ */
+ QImage img = textPixmap.convertToImage().convertDepth(32);
+
+ /*
+ * Resize the image if necessary
+ */
+ if ((result.width() != w) || (result.height() != h))
+ {
+ result.create(w, h, 32);
+ }
+
+ result.fill(0); // all black
+ result.setAlphaBuffer(true);
+
+ for (int i = thickness_; i < w - thickness_; i++)
+ {
+ for (int j = thickness_; j < h - thickness_; j++)
+ {
+ alphaShadow = decay(img, i, j);
+ alphaShadow = (alphaShadow > 180.0) ? 180.0 : alphaShadow;
+ // update the shadow's i,j pixel.
+ result.setPixel(i,j, qRgba(bgRed, bgGreen , bgBlue, (int) alphaShadow));
+ }
+ }
+
+ return result;
+}
+
+float ShadowEngine::decay(QImage& source, int i, int j)
+{
+ // create a new image for the shadow
+ int w = source.width();
+ int h = source.height();
+ int sx, sy;
+
+ float alphaShadow = 0;
+ float opacity = 0;
+ for (int k = 1; k <= thickness_; k++) {
+ /* Generate a shadow thickness_ pixels thicker
+ * on either side than the text image. Ensure
+ * that i +/- k and j +/- k are within the
+ * bounds of the text pixmap.
+ */
+ opacity = 0;
+ for (int l = -k; l <= k; l++) {
+ if (i < k)
+ sx = 0;
+ else if (i >= w - k)
+ sx = w - 1;
+ else
+ sx = i + l;
+
+ for (int m = -k; m <= k; m++) {
+ if (j < k)
+ sy = 0;
+ else if (j >= h - k)
+ sy = h - 1;
+ else
+ sy = j + m;
+
+ opacity += qGray(source.pixel(sx, sy));
+ }
+ }
+ alphaShadow += opacity / multiplicationFactor_;
+ }
+ return alphaShadow;
+}
diff --git a/src/shadow.h b/src/shadow.h
new file mode 100644
index 0000000..04facb0
--- /dev/null
+++ b/src/shadow.h
@@ -0,0 +1,52 @@
+/* Copyright (C) 2005 Gerd Fleischer <gerdfleischer@web.de>
+ * Copyright (C) 2003 by Sandro Giessl
+ * based on the nice CVS KDesktop KShadowEngine class. thanks!
+ * looking forward to see KShadowEngine in kdefx somewhen btw.. :)
+ * ------------------------------------------------------------------------
+ * these are the original copyright notes:
+ * This file is proposed to be part of the KDE libraries.
+ * Copyright (C) 2003 Laur Ivan <laurivan@eircom.net>
+ *
+ * Many thanks to:
+ * - Bernardo Hung <deciare@gta.igs.net> for the enhanced shadow
+ * algorithm (currently used)
+ * - Tim Jansen <tim@tjansen.de> for the API updates and fixes.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ */
+
+#ifndef __FX_SHADOW
+#define __FX_SHADOW
+
+#include <qpixmap.h>
+#include <qimage.h>
+#include <qcolor.h>
+
+class ShadowEngine
+{
+ public:
+ ShadowEngine();
+ ~ShadowEngine();
+ void setThickness(int thickness) { thickness_ = thickness; }
+ void setMultiplicationFactor(float factor) { multiplicationFactor_ = factor; }
+ QImage makeShadow(const QPixmap& textPixmap, const QColor &bgColor);
+ private:
+ float decay(QImage& source, int x, int y);
+
+ int thickness_;
+ float multiplicationFactor_;
+};
+
+#endif
diff --git a/src/titlebar_decor.png b/src/titlebar_decor.png
new file mode 100644
index 0000000..0f9260f
--- /dev/null
+++ b/src/titlebar_decor.png
Binary files differ