summaryrefslogtreecommitdiff
path: root/staging
diff options
context:
space:
mode:
Diffstat (limited to 'staging')
-rw-r--r--staging/gnome-color-manager/PKGBUILD36
-rw-r--r--staging/gnome-color-manager/gnome-color-manager.install19
-rw-r--r--staging/kdelibs/PKGBUILD28
-rw-r--r--staging/koffice/PKGBUILD306
-rw-r--r--staging/koffice/filters.install11
-rw-r--r--staging/koffice/gcc46.patch23
-rw-r--r--staging/koffice/kde4-koffice-libwpg02.patch1323
-rw-r--r--staging/koffice/koffice.install12
-rw-r--r--staging/koffice/krita.install13
-rw-r--r--staging/koffice/qt48fix.patch10
-rw-r--r--staging/libgnome-media-profiles/PKGBUILD39
-rw-r--r--staging/libgnome-media-profiles/libgnome-media-profiles.install17
-rw-r--r--staging/opencv/PKGBUILD2
-rw-r--r--staging/plotutils/PKGBUILD32
-rw-r--r--staging/plotutils/plotutils-2.6-libpng-1.5.patch31
-rw-r--r--staging/plotutils/plotutils.install15
-rw-r--r--staging/r/PKGBUILD69
-rw-r--r--staging/r/r.desktop11
-rw-r--r--staging/r/r.install12
-rw-r--r--staging/r/r.pngbin0 -> 4771 bytes
-rw-r--r--staging/slim/PKGBUILD68
-rw-r--r--staging/slim/install7
-rw-r--r--staging/slim/logrotate9
-rw-r--r--staging/slim/no-host.patch29
-rw-r--r--staging/slim/pam.d10
-rw-r--r--staging/slim/ptr_pam.patch52
-rwxr-xr-xstaging/slim/rc.d36
-rw-r--r--staging/slim/restart.patch144
-rw-r--r--staging/slim/session-name.patch21
-rw-r--r--staging/slim/sigterm.patch45
-rw-r--r--staging/slim/slim-1.3.2-libpng15.patch11
-rw-r--r--staging/slim/tty-slowness.patch30
32 files changed, 2454 insertions, 17 deletions
diff --git a/staging/gnome-color-manager/PKGBUILD b/staging/gnome-color-manager/PKGBUILD
new file mode 100644
index 000000000..3fcef2e0e
--- /dev/null
+++ b/staging/gnome-color-manager/PKGBUILD
@@ -0,0 +1,36 @@
+# $Id: PKGBUILD 147672 2012-01-26 09:42:51Z heftig $
+# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
+
+pkgname=gnome-color-manager
+pkgver=3.2.2
+pkgrel=2
+pkgdesc="Color profile manager for the GNOME desktop"
+arch=(i686 x86_64)
+url="http://projects.gnome.org/gnome-color-manager/"
+license=(GPL2)
+depends=('libcanberra' 'vte3' 'exiv2' 'hicolor-icon-theme' 'desktop-file-utils' 'clutter-gtk' 'mash' 'shared-color-profiles' 'shared-color-targets')
+makedepends=('intltool' 'gtk-doc')
+install=gnome-color-manager.install
+options=('!libtool' '!emptydirs')
+groups=('gnome-extra')
+source=(http://ftp.gnome.org/pub/GNOME/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz)
+sha256sums=('4898fe8c29761d8dc0859c4a3a1bf725d3b80d552caab1225202f6030a118d9a')
+
+build(){
+ cd "$srcdir/$pkgname-$pkgver"
+
+ # man pages need docbook-sgml, which we don't have
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --localstatedir=/var \
+ --libexecdir=/usr/lib/gnome-color-manager \
+ --disable-static --disable-man-pages
+
+ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0 /g' -e 's/ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then/ func_append compile_command " -Wl,-O1,--as-needed"\n func_append finalize_command " -Wl,-O1,--as-needed"\n\0/' libtool
+
+ make
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install
+}
diff --git a/staging/gnome-color-manager/gnome-color-manager.install b/staging/gnome-color-manager/gnome-color-manager.install
new file mode 100644
index 000000000..04fda0ddc
--- /dev/null
+++ b/staging/gnome-color-manager/gnome-color-manager.install
@@ -0,0 +1,19 @@
+post_install() {
+ usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas
+ update-desktop-database -q
+ gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
+}
+
+pre_upgrade() {
+ if (( $(vercmp $2 2.90.0) < 0 )); then
+ usr/sbin/gconfpkg --uninstall gnome-color-manager
+ fi
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/staging/kdelibs/PKGBUILD b/staging/kdelibs/PKGBUILD
index ddb31c773..36452a1cb 100644
--- a/staging/kdelibs/PKGBUILD
+++ b/staging/kdelibs/PKGBUILD
@@ -1,30 +1,28 @@
-# $Id: PKGBUILD 145730 2011-12-29 13:52:20Z andrea $
+# $Id: PKGBUILD 147665 2012-01-26 07:10:36Z andrea $
# Maintainer: Andrea Scarpino <andrea@archlinux.org
# Contributor: Pierre Schmitz <pierre@archlinux.de>
pkgname=kdelibs
-pkgver=4.7.4
-pkgrel=6
+pkgver=4.8.0
+pkgrel=2
pkgdesc="KDE Core Libraries"
arch=('i686' 'x86_64')
url='http://www.kde.org'
license=('GPL' 'LGPL' 'FDL')
-depends=('strigi' 'attica' 'libxss' 'xz' 'openssl' 'soprano' 'krb5'
- 'shared-desktop-ontologies' 'qca' 'libdbusmenu-qt' 'polkit-qt' 'grantlee'
- 'shared-mime-info' 'enchant' 'giflib' 'jasper' 'openexr' 'xdg-utils'
- 'phonon' 'hicolor-icon-theme' 'upower' 'udisks' 'libxcursor'
- 'docbook-xsl' 'qtwebkit')
-makedepends=('pkgconfig' 'cmake' 'automoc4' 'avahi' 'libgl' 'hspell')
+depends=('strigi' 'attica' 'libxss' 'xz' 'soprano' 'krb5' 'grantlee'
+ 'shared-desktop-ontologies' 'qca' 'libdbusmenu-qt' 'polkit-qt'
+ 'shared-mime-info' 'enchant' 'giflib' 'jasper' 'openexr' 'docbook-xsl'
+ 'upower' 'udisks' 'libxcursor' 'phonon' 'qtwebkit')
+makedepends=('cmake' 'automoc4' 'avahi' 'libgl' 'hspell')
replaces=('kdelibs-experimental')
-install='kdelibs.install'
+install=${pkgname}.install
source=("http://download.kde.org/stable/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2"
'kde-applications-menu.patch' 'archlinux-menu.patch'
- 'fix-knotify-filepath.patch' 'kdelibs-4.7.4-xinelib12x.patch')
-sha1sums=('78b25e93a8c70ccc1e0f117cce960fe4e1deb8d8'
+ 'fix-knotify-filepath.patch')
+sha1sums=('5e4744405734e6c3ce572ef7d16054390692b38a'
'86ee8c8660f19de8141ac99cd6943964d97a1ed7'
'63a850ab4196b9d06934f2b4a13acd9f7739bc67'
- '3312f6005aa56a9b992c74008fe5b314f1c8ffba'
- '9cb83cb7f6394549354c6837977f9e9529127041')
+ '3312f6005aa56a9b992c74008fe5b314f1c8ffba')
build() {
cd "${srcdir}"/${pkgname}-${pkgver}
@@ -37,8 +35,6 @@ build() {
# https://bugs.kde.org/show_bug.cgi?id=285028
patch -p1 -i "${srcdir}"/fix-knotify-filepath.patch
- patch -p1 -i "${srcdir}"/kdelibs-4.7.4-xinelib12x.patch
-
cd "${srcdir}"
mkdir build
cd build
diff --git a/staging/koffice/PKGBUILD b/staging/koffice/PKGBUILD
new file mode 100644
index 000000000..3206bc566
--- /dev/null
+++ b/staging/koffice/PKGBUILD
@@ -0,0 +1,306 @@
+# $Id: PKGBUILD 147690 2012-01-27 04:08:22Z eric $
+# Maintainer: Ronald van Haren <ronald.archlinux.org>
+# Contributor: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: BlackEagle < ike DOT devolder AT gmail DOT com >
+
+pkgbase=koffice
+pkgname=(
+ 'koffice-filters'
+ 'koffice-interfaces'
+ 'koffice-libs'
+ 'koffice-plugins'
+ 'koffice-pics'
+ 'koffice-servicetypes'
+ 'koffice-templates'
+ 'koffice-tools'
+ 'koffice-karbon'
+ 'koffice-karbon-doc'
+# 'koffice-kchart'
+# 'koffice-kchart-doc'
+ 'koffice-kexi'
+ 'koffice-kexi-doc'
+ 'koffice-kformula'
+ 'koffice-kformula-doc'
+ 'koffice-kounavail'
+ 'koffice-kplato'
+# 'koffice-kplato-doc'
+ 'koffice-kpresenter'
+ 'koffice-kpresenter-doc'
+ 'koffice-krita'
+# 'koffice-krita-doc' # no krita-doc anymore upstream
+ 'koffice-kspread'
+ 'koffice-kspread-doc'
+ 'koffice-kword'
+# 'koffice-kword-doc' # see http://userbase.kde.org/KWord/Manual for documentation (not supplied by upstream anymore in the sources)
+ 'koffice-handbook'
+ 'koffice-thesaurus-doc'
+# 'koffice-kdgantt' # still an empty package
+)
+pkgver=2.3.3
+pkgrel=12
+arch=('i686' 'x86_64')
+url='http://koffice.kde.org'
+license=('GPL' 'LGPL' 'FDL')
+makedepends=('pkg-config' 'cmake' 'automoc4' 'boost' 'eigen' 'gsl' 'lcms'
+ 'glew' 'qimageblitz' 'kdepimlibs' 'pstoedit' 'poppler-qt' 'libwpd'
+ 'libwpg' 'opengtl' 'libkdcraw' 'oxygen-icons' 'libgsf')
+groups=('koffice')
+source=("http://download.kde.org/stable/${pkgbase}-${pkgver}/${pkgbase}-${pkgver}.tar.bz2"
+ 'kde4-koffice-libwpg02.patch' 'gcc46.patch' 'qt48fix.patch')
+sha256sums=('31ba0d98c0d29c7b8ab97efdeb6c618b82177b2b0ec85da088178254da43c099'
+ '69106deb4081d71b5bd8f2e4f5af67ca689e4ce9f2bb49c11dbce5fb3409d612'
+ 'e095c0b2bbedf41da6535a68b2275464dafd3f194566028d0135322f596e4739'
+ 'a20d7412ceeefdf7987b1c5179a740c7ee188e314ffb94cc226967ee194bc2aa')
+build() {
+ cd "${srcdir}/${pkgbase}-${pkgver}"
+
+ patch -p1 -i "${srcdir}/kde4-koffice-libwpg02.patch"
+ patch -p1 -i "${srcdir}"/gcc46.patch
+ patch -p1 -i "${srcdir}"/qt48fix.patch
+
+ cd "${srcdir}"
+ mkdir build
+ cd build
+ cmake ../${pkgbase}-${pkgver} \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SKIP_RPATH=ON \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+##### 1st package common files, depends, optdepends of the koffice applications #####
+
+package_koffice-filters(){
+ pkgdesc="Filters for the KDE office suite"
+ depends=('shared-mime-info' 'libgsf')
+ optdepends=('libwpd: WordPerfect document importer'
+ 'libwpg: Corel WordPerfect Graphics image importer' 'pstoedit: Karbon EPS import filter'
+ 'libkdcraw: support for raw images' 'poppler: support for pdf'
+ 'koffice-kspread: Kspread filters' 'koffice-karbon: Karbon filters'
+ 'koffice-kplato: Kplato filters')
+ install=filters.install
+ cd "${srcdir}/build/filters"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-interfaces(){
+ pkgdesc="Interfaces for the KDE office suite"
+ depends=('koffice-libs')
+ cd "${srcdir}/build/interfaces"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-libs(){
+ pkgdesc="Libs for the KDE office suite"
+ depends=('kdepimlibs' 'lcms' 'koffice-servicetypes')
+ cd "${srcdir}/build/libs"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-plugins(){
+ pkgdesc="Plugins for the KDE office suite"
+ depends=('koffice-libs')
+ replaces=('koffice-kchart')
+ conflicts=('koffice-kchart')
+ cd "${srcdir}/build/plugins"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-pics(){
+ pkgdesc="Icons for the KDE office suite"
+ depends=('desktop-file-utils' 'xdg-utils')
+ install=koffice.install
+ cd "${srcdir}/build/pics"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-servicetypes(){
+ pkgdesc="Servicetypes for the KDE office suite"
+ cd "${srcdir}/build/servicetypes"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-templates(){
+ pkgdesc="Templates for the KDE office suite"
+ cd "${srcdir}/build/templates"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-tools(){
+ pkgdesc="Tools for the KDE office suite"
+ depends=('koffice-libs' 'oxygen-icons')
+ cd "${srcdir}/build/tools"
+ make DESTDIR="${pkgdir}" install
+}
+
+#### package common files done #####
+
+#### package apps and their docs #####
+
+package_koffice-karbon(){
+ pkgdesc="Vector drawing application for KDE"
+ depends=('koffice-libs' 'koffice-templates' 'oxygen-icons')
+ optdepends=('koffice-filters: import/export filters')
+ install=koffice.install
+ cd "${srcdir}/build/karbon"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-karbon-doc(){
+ pkgdesc="Documentation for karbon"
+ cd "${srcdir}/build/doc/karbon"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-kexi(){
+ pkgdesc="Integrated data management application for the KDE office suite"
+ depends=('koffice-kspread' 'oxygen-icons')
+ install=koffice.install
+ cd "${srcdir}/build/kexi"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-kexi-doc(){
+ pkgdesc="Documentation for kexi"
+ cd "${srcdir}/build/doc/kexi"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-kformula(){
+ pkgdesc="Formula editor for the KDE office suite"
+ depends=('koffice-libs')
+ install=koffice.install
+ cd "${srcdir}/build/kformula"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-kformula-doc() {
+ pkgdesc="Documentation for koffice-kformula"
+ cd "${srcdir}/build/doc/kformula"
+ make DESTDIR="${pkgdir}" install
+}
+
+
+package_koffice-kounavail(){
+ pkgdesc="Kounavail for the KDE office suite"
+ depends=('koffice-libs')
+ cd "${srcdir}/build/kounavail"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-kplato(){
+ pkgdesc="Project management application for KDE"
+ depends=('koffice-kword' 'oxygen-icons')
+ install=koffice.install
+ cd "${srcdir}/build/kplato"
+ make DESTDIR="${pkgdir}" install
+}
+
+#package_koffice-kplato-doc(){
+# pkgdesc="Documentation for kplato"
+# cd ${srcdir}/build/doc/kplato
+# make DESTDIR="${pkgdir}" install
+#}
+
+package_koffice-kpresenter(){
+ pkgdesc="Presentation tool for KDE"
+ depends=('koffice-libs' 'koffice-templates' 'oxygen-icons')
+ optdepends=('koffice-filters: import/export filters')
+ install=koffice.install
+ cd "${srcdir}/build/kpresenter"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-kpresenter-doc(){
+ pkgdesc="Documentation for kpresenter"
+ cd "${srcdir}/build/doc/kpresenter"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-krita(){
+ pkgdesc="Graphics editor for KDE"
+ depends=('glew' 'qimageblitz' 'oxygen-icons' 'koffice-templates' \
+ 'koffice-plugins' 'poppler-qt' 'opengtl')
+ optdepends=('koffice-filters: import/export filters' 'libkdcraw: support for raw images')
+ install=krita.install
+ cd "${srcdir}/build/krita"
+ make DESTDIR="${pkgdir}" install
+}
+
+#package_koffice-krita-doc(){
+# pkgdesc="Documentation for krita"
+# cd ${srcdir}/build/doc/krita
+# make DESTDIR="${pkgdir}" install
+#}
+
+
+package_koffice-kspread(){
+ pkgdesc="Spreadsheet application for KDE"
+ depends=('gsl' 'koffice-templates' 'koffice-plugins' 'oxygen-icons')
+ optdepends=('koffice-filters: import/export filters')
+ install=koffice.install
+ cd "${srcdir}/build/kspread"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-kspread-doc(){
+ pkgdesc="Documentation for kspread"
+ cd "${srcdir}/build/doc/kspread"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-kword(){
+ pkgdesc="Wordprocessor for KDE"
+ depends=('koffice-templates' 'koffice-pics' 'oxygen-icons' \
+ 'koffice-kounavail' 'koffice-plugins')
+ optdepends=('koffice-filters: import/export filters')
+ install=koffice.install
+ cd "${srcdir}/build/kword"
+ make DESTDIR="${pkgdir}" install
+
+ # some sed lines to have python2 in extension scripts
+ sed -i "s|/usr/bin/env python|/usr/bin/env python2|" "${pkgdir}/usr/share/apps/kword/scripts/extensions/oouno.py"
+ sed -i "s|/usr/bin/env python|/usr/bin/env python2|" "${pkgdir}/usr/share/apps/kword/scripts/extensions/importdoxyxml.py"
+ sed -i "s|/usr/bin/env python|/usr/bin/env python2|" "${pkgdir}/usr/share/apps/kword/scripts/extensions/onlinehelp.py"
+}
+
+#package_koffice-kword-doc(){
+# pkgdesc="Documentation for kword"
+# cd ${srcdir}/build/doc/kword
+# make DESTDIR="${pkgdir}" install
+#}
+
+##### package apps done #####
+
+#package_koffice-kchart(){
+# pkgdesc="Charting tool for KDE"
+# depends=('hicolor-icon-theme' 'koffice-interfaces' 'koffice-templates')
+# optdepends=('koffice-filters: import/export filters')
+# install=koffice.install
+# cd "${srcdir}/build/kchart"
+# make DESTDIR="${pkgdir}" install
+#}
+
+#package_koffice-kchart-doc(){
+# pkgdesc="Documentation for kchart"
+# cd "${srcdir}/build/doc/kchart"
+# make DESTDIR="${pkgdir}" install
+#}
+
+#package_koffice-kdgantt(){
+# pkgdesc="Gantt for KDE"
+# cd "${srcdir}/build/kdgantt"
+# make DESTDIR="${pkgdir}" install
+#}
+
+package_koffice-handbook() {
+ pkgdesc="Documentation for koffice"
+ cd "${srcdir}/build/doc/koffice"
+ make DESTDIR="${pkgdir}" install
+}
+
+package_koffice-thesaurus-doc(){
+ pkgdesc="Documentation for koffice-thesaurus"
+ cd "${srcdir}/build/doc/thesaurus"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/staging/koffice/filters.install b/staging/koffice/filters.install
new file mode 100644
index 000000000..7c8a8bd2b
--- /dev/null
+++ b/staging/koffice/filters.install
@@ -0,0 +1,11 @@
+post_install() {
+ update-mime-database usr/share/mime &> /dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/staging/koffice/gcc46.patch b/staging/koffice/gcc46.patch
new file mode 100644
index 000000000..dcf8a4f85
--- /dev/null
+++ b/staging/koffice/gcc46.patch
@@ -0,0 +1,23 @@
+diff -up koffice-2.3.2/krita/plugins/formats/exr/exr_converter.cc.gcc46 koffice-2.3.2/krita/plugins/formats/exr/exr_converter.cc
+--- koffice-2.3.2/krita/plugins/formats/exr/exr_converter.cc.gcc46 2011-02-17 06:13:40.000000000 -0600
++++ koffice-2.3.2/krita/plugins/formats/exr/exr_converter.cc 2011-02-19 21:15:56.597142885 -0600
+@@ -80,6 +80,9 @@ ImageType imfTypeToKisType(Imf::PixelTyp
+ return IT_FLOAT16;
+ case Imf::FLOAT:
+ return IT_FLOAT32;
++ default:
++ // shouldn't reach here
++ return IT_UNSUPPORTED;
+ }
+ }
+
+@@ -93,6 +96,9 @@ const KoColorSpace* kisTypeToColorSpace(
+ case IT_UNKNOWN:
+ case IT_UNSUPPORTED:
+ return 0;
++ default:
++ // shouldn't reach here
++ return 0;
+ }
+ }
+
diff --git a/staging/koffice/kde4-koffice-libwpg02.patch b/staging/koffice/kde4-koffice-libwpg02.patch
new file mode 100644
index 000000000..e2a55a216
--- /dev/null
+++ b/staging/koffice/kde4-koffice-libwpg02.patch
@@ -0,0 +1,1323 @@
+diff -Nur koffice-2.3.1/filters/karbon/wpg/import/CMakeLists.txt koffice-2.3.1-libwpg02/filters/karbon/wpg/import/CMakeLists.txt
+--- koffice-2.3.1/filters/karbon/wpg/import/CMakeLists.txt 2011-01-15 21:05:35.000000000 +0100
++++ koffice-2.3.1-libwpg02/filters/karbon/wpg/import/CMakeLists.txt 2011-01-18 07:40:25.000000000 +0100
+@@ -1,16 +1,11 @@
+
+-
+ include_directories(${CMAKE_BINARY_DIR}/filters/ ${WPD_INCLUDE_DIR} ${LIBWPG_INCLUDE_DIR}/)
+
+-set(wpgimport_PART_SRCS
+-WPGImport.cpp
+-OdgExporter.cxx
+-FileOutputHandler.cxx
+-GraphicsElement.cxx)
++set(wpgimport_PART_SRCS WPGImport.cpp)
+
+ kde4_add_plugin(wpgimport ${wpgimport_PART_SRCS})
+
+-target_link_libraries(wpgimport komain ${LIBWPG_LIBRARIES} ${LIBWPG_STREAM_LIBRARIES})
++target_link_libraries(wpgimport komain ${LIBWPG_LIBRARIES} ${LIBWPG_STREAM_LIBRARIES} ${WPD_LIBRARIES})
+
+ install(TARGETS wpgimport DESTINATION ${PLUGIN_INSTALL_DIR})
+ install(FILES karbon_wpg_import.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+diff -Nur koffice-2.3.1/filters/karbon/wpg/import/FileOutputHandler.cxx koffice-2.3.1-libwpg02/filters/karbon/wpg/import/FileOutputHandler.cxx
+--- koffice-2.3.1/filters/karbon/wpg/import/FileOutputHandler.cxx 2011-01-15 21:05:35.000000000 +0100
++++ koffice-2.3.1-libwpg02/filters/karbon/wpg/import/FileOutputHandler.cxx 1970-01-01 01:00:00.000000000 +0100
+@@ -1,95 +0,0 @@
+-/* libwpg
+- * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
+- *
+- * This library is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU Library General Public
+- * License as published by the Free Software Foundation; either
+- * version 2 of the License, or (at your option) any later version.
+- *
+- * 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; if not, write to the
+- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+- * Boston, MA 02111-1301 USA
+- *
+- * For further information visit http://libwpg.sourceforge.net
+- */
+-
+-/* "This product is not manufactured, approved, or supported by
+- * Corel Corporation or Corel Corporation Limited."
+- */
+-
+-#include "FileOutputHandler.hxx"
+-
+-FileOutputHandler::FileOutputHandler(std::ostringstream &contentStream) :
+- mbIsTagOpened(false),
+- mContentStream(contentStream)
+-{
+-}
+-
+-void FileOutputHandler::startDocument()
+-{
+-}
+-
+-void FileOutputHandler::startElement(const char *psName, const std::vector<std::pair<std::string, std::string> > &xPropList)
+-{
+- if (mbIsTagOpened)
+- {
+- mContentStream << ">";
+- mbIsTagOpened = false;
+- }
+- mContentStream << "<" << psName;
+-
+- for (std::vector<std::pair<std::string, std::string> >::const_iterator i = xPropList.begin(); i != xPropList.end(); i++)
+- {
+- mContentStream << " " << (*i).first.c_str() << "=\"" << (*i).second.c_str() << "\"";
+- }
+- mbIsTagOpened = true;
+- msOpenedTagName = psName;
+-}
+-
+-void FileOutputHandler::endElement(const char *psName)
+-{
+- if (mbIsTagOpened)
+- {
+- if( msOpenedTagName == psName )
+- {
+- mContentStream << "/>";
+- mbIsTagOpened = false;
+- }
+- else // should not happen, but handle it
+- {
+- mContentStream << ">";
+- mContentStream << "</" << psName << ">";
+- mbIsTagOpened = false;
+- }
+- }
+- else
+- {
+- mContentStream << "</" << psName << ">";
+- mbIsTagOpened = false;
+- }
+-}
+-
+-void FileOutputHandler::characters(const std::string &sCharacters)
+-{
+- if (mbIsTagOpened)
+- {
+- mContentStream << ">";
+- mbIsTagOpened = false;
+- }
+- mContentStream << sCharacters.c_str();
+-}
+-
+-void FileOutputHandler::endDocument()
+-{
+- if (mbIsTagOpened)
+- {
+- mContentStream << ">";
+- mbIsTagOpened = false;
+- }
+-}
+diff -Nur koffice-2.3.1/filters/karbon/wpg/import/FileOutputHandler.hxx koffice-2.3.1-libwpg02/filters/karbon/wpg/import/FileOutputHandler.hxx
+--- koffice-2.3.1/filters/karbon/wpg/import/FileOutputHandler.hxx 2011-01-15 21:05:35.000000000 +0100
++++ koffice-2.3.1-libwpg02/filters/karbon/wpg/import/FileOutputHandler.hxx 1970-01-01 01:00:00.000000000 +0100
+@@ -1,49 +0,0 @@
+-/* libwpg
+- * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
+- *
+- * This library is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU Library General Public
+- * License as published by the Free Software Foundation; either
+- * version 2 of the License, or (at your option) any later version.
+- *
+- * 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; if not, write to the
+- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+- * Boston, MA 02111-1301 USA
+- *
+- * For further information visit http://libwpg.sourceforge.net
+- */
+-
+-/* "This product is not manufactured, approved, or supported by
+- * Corel Corporation or Corel Corporation Limited."
+- */
+-
+-#ifndef FILEOUTPUTHANDLER_H
+-#define FILEOUTPUTHANDLER_H
+-
+-#include <iostream>
+-#include <sstream>
+-#include <string>
+-#include "GraphicsHandler.hxx"
+-
+-class FileOutputHandler : public GraphicsHandler
+-{
+- public:
+- explicit FileOutputHandler(std::ostringstream &contentStream);
+- virtual void startDocument();
+- virtual void endDocument();
+- virtual void startElement(const char *psName, const std::vector<std::pair<std::string, std::string> > &xPropList);
+- virtual void endElement(const char *psName);
+- virtual void characters(const std::string &sCharacters);
+-
+- private:
+- bool mbIsTagOpened;
+- std::string msOpenedTagName;
+- std::ostringstream &mContentStream;
+-};
+-#endif
+diff -Nur koffice-2.3.1/filters/karbon/wpg/import/GraphicsElement.cxx koffice-2.3.1-libwpg02/filters/karbon/wpg/import/GraphicsElement.cxx
+--- koffice-2.3.1/filters/karbon/wpg/import/GraphicsElement.cxx 2011-01-15 21:05:35.000000000 +0100
++++ koffice-2.3.1-libwpg02/filters/karbon/wpg/import/GraphicsElement.cxx 1970-01-01 01:00:00.000000000 +0100
+@@ -1,66 +0,0 @@
+-/* GraphicsElement: The items we are collecting to be put into the Writer
+- * document: paragraph and spans of text, as well as section breaks.
+- *
+- * Copyright (C) 2002-2003 William Lachance (william.lachance@sympatico.ca)
+- *
+- * This program is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU Lesser 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
+- * Library General Public License for more details.
+- *
+- * You should have received a copy of the GNU Library General Public
+- * License along with this library; if not, write to the
+- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+- * Boston, MA 02111-1301 USA
+- *
+- * For further information visit http://libwpg.sourceforge.net
+- *
+- */
+-
+-/* "This product is not manufactured, approved, or supported by
+- * Corel Corporation or Corel Corporation Limited."
+- */
+-
+-#include "GraphicsElement.hxx"
+-#include "GraphicsHandler.hxx"
+-#include <string.h>
+-
+-#define ASCII_SPACE 0x0020
+-
+-void TagGraphicsElement::print() const
+-{
+-}
+-
+-void OpenTagGraphicsElement::write(GraphicsHandler *pHandler) const
+-{
+- pHandler->startElement(getTagName().c_str(), maAttrList);
+-}
+-
+-void OpenTagGraphicsElement::print() const
+-{
+- TagGraphicsElement::print();
+-}
+-
+-void OpenTagGraphicsElement::addAttribute(const std::string &szAttributeName, const std::string &sAttributeValue)
+-{
+- std::pair<std::string, std::string> tmpAttribute;
+- tmpAttribute.first = szAttributeName;
+- tmpAttribute.second = sAttributeValue;
+- maAttrList.push_back(tmpAttribute);
+-}
+-
+-void CloseTagGraphicsElement::write(GraphicsHandler *pHandler) const
+-{
+-
+- pHandler->endElement(getTagName().c_str());
+-}
+-
+-void CharDataGraphicsElement::write(GraphicsHandler *pHandler) const
+-{
+- pHandler->characters(msData);
+-}
+diff -Nur koffice-2.3.1/filters/karbon/wpg/import/GraphicsElement.hxx koffice-2.3.1-libwpg02/filters/karbon/wpg/import/GraphicsElement.hxx
+--- koffice-2.3.1/filters/karbon/wpg/import/GraphicsElement.hxx 2011-01-15 21:05:35.000000000 +0100
++++ koffice-2.3.1-libwpg02/filters/karbon/wpg/import/GraphicsElement.hxx 1970-01-01 01:00:00.000000000 +0100
+@@ -1,84 +0,0 @@
+-/* GraphicsElement: The items we are collecting to be put into the Writer
+- * document: paragraph and spans of text, as well as section breaks.
+- *
+- * Copyright (C) 2002-2003 William Lachance (william.lachance@sympatico.ca)
+- *
+- * This program is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU Lesser 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
+- * Library General Public License for more details.
+- *
+- * You should have received a copy of the GNU Library General Public
+- * License along with this library; if not, write to the
+- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+- * Boston, MA 02111-1301 USA
+- *
+- * For further information visit http://libwpd.sourceforge.net
+- *
+- */
+-
+-/* "This product is not manufactured, approved, or supported by
+- * Corel Corporation or Corel Corporation Limited."
+- */
+-
+-#ifndef _GRAPHICSELEMENT_H
+-#define _GRAPHICSELEMENT_H
+-#include <string>
+-#include <map>
+-#include <vector>
+-
+-#include "GraphicsHandler.hxx"
+-
+-class GraphicsElement
+-{
+-public:
+- virtual ~GraphicsElement() {}
+- virtual void write(GraphicsHandler *pHandler) const = 0;
+- virtual void print() const {}
+-};
+-
+-class TagGraphicsElement : public GraphicsElement
+-{
+-public:
+- explicit TagGraphicsElement(const char *szTagName) : msTagName(szTagName) {}
+- const std::string &getTagName() const { return msTagName; }
+- virtual void print() const;
+-private:
+- const std::string msTagName;
+-};
+-
+-class OpenTagGraphicsElement : public TagGraphicsElement
+-{
+-public:
+- explicit OpenTagGraphicsElement(const char *szTagName) : TagGraphicsElement(szTagName) {}
+- ~OpenTagGraphicsElement() {}
+- void addAttribute(const std::string &szAttributeName, const std::string &sAttributeValue);
+- virtual void write(GraphicsHandler *pHandler) const;
+- virtual void print () const;
+-private:
+- std::vector<std::pair<std::string, std::string> > maAttrList;
+-};
+-
+-class CloseTagGraphicsElement : public TagGraphicsElement
+-{
+-public:
+- explicit CloseTagGraphicsElement(const char *szTagName) : TagGraphicsElement(szTagName) {}
+- virtual void write(GraphicsHandler *pHandler) const;
+-};
+-
+-class CharDataGraphicsElement : public GraphicsElement
+-{
+-public:
+- CharDataGraphicsElement(const char *sData) : GraphicsElement(), msData(sData) {}
+- virtual void write(GraphicsHandler *pHandler) const;
+-private:
+- std::string msData;
+-};
+-
+-
+-#endif
+diff -Nur koffice-2.3.1/filters/karbon/wpg/import/GraphicsHandler.hxx koffice-2.3.1-libwpg02/filters/karbon/wpg/import/GraphicsHandler.hxx
+--- koffice-2.3.1/filters/karbon/wpg/import/GraphicsHandler.hxx 2011-01-15 21:05:35.000000000 +0100
++++ koffice-2.3.1-libwpg02/filters/karbon/wpg/import/GraphicsHandler.hxx 1970-01-01 01:00:00.000000000 +0100
+@@ -1,43 +0,0 @@
+-/*
+- * Copyright (C) 2004 William Lachance (wlach@interlog.com)
+- * Copyright (C) 2004 Net Integration Technologies (http://www.net-itech.com)
+- *
+- * 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 Library General Public
+- * License along with this library; if not, write to the
+- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+- * Boston, MA 02111-1301 USA
+- *
+- * Contributor(s): Martin Gallwey (gallwey@sun.com)
+- *
+- */
+-
+-/* "This product is not manufactured, approved, or supported by
+- * Corel Corporation or Corel Corporation Limited."
+- */
+-#ifndef _GRAPHICSHANDLER_H
+-#define _GRAPHICSHANDLER_H
+-#include <string>
+-#include <map>
+-#include <vector>
+-
+-class GraphicsHandler
+-{
+-public:
+- virtual ~GraphicsHandler() {}
+- virtual void startDocument() = 0;
+- virtual void endDocument() = 0;
+- virtual void startElement(const char *psName, const std::vector< std::pair <std::string, std::string> > &xPropList) = 0;
+- virtual void endElement(const char *psName) = 0;
+- virtual void characters(const std::string &sCharacters) = 0;
+-};
+-#endif
+diff -Nur koffice-2.3.1/filters/karbon/wpg/import/OdgExporter.cxx koffice-2.3.1-libwpg02/filters/karbon/wpg/import/OdgExporter.cxx
+--- koffice-2.3.1/filters/karbon/wpg/import/OdgExporter.cxx 2011-01-15 21:05:35.000000000 +0100
++++ koffice-2.3.1-libwpg02/filters/karbon/wpg/import/OdgExporter.cxx 1970-01-01 01:00:00.000000000 +0100
+@@ -1,662 +0,0 @@
+-/* libwpg
+- * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
+- * Copyright (C) 2006 Fridrich Strba (fridrich.strba@bluewin.ch)
+- *
+- * This library is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU Library General Public
+- * License as published by the Free Software Foundation; either
+- * version 2 of the License, or (at your option) any later version.
+- *
+- * 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; if not, write to the
+- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+- * Boston, MA 02111-1301 USA
+- *
+- * For further information visit http://libwpg.sourceforge.net
+- */
+-
+-/* "This product is not manufactured, approved, or supported by
+- * Corel Corporation or Corel Corporation Limited."
+- */
+-
+-#include "OdgExporter.hxx"
+-#include "GraphicsElement.hxx"
+-#include "GraphicsHandler.hxx"
+-#include <locale.h>
+-
+-static std::string doubleToString(const double value)
+-{
+- std::ostringstream tempStream;
+- tempStream << value;
+- std::string decimalPoint(localeconv()->decimal_point);
+- if ((decimalPoint.size() == 0) || (decimalPoint == "."))
+- return tempStream.str();
+- std::string stringValue(tempStream.str());
+- if (!stringValue.empty())
+- {
+- std::string::size_type pos;
+- while ((pos = stringValue.find(decimalPoint)) != std::string::npos)
+- stringValue.replace(pos,decimalPoint.size(),".");
+- }
+- return stringValue;
+-}
+-
+-
+-OdgExporter::OdgExporter(GraphicsHandler *pHandler, const bool isFlatXML):
+- mpHandler(pHandler),
+- m_fillRule(AlternatingFill),
+- m_gradientIndex(1),
+- m_dashIndex(1),
+- m_styleIndex(1),
+- m_width(0.0f),
+- m_height(0.0f),
+- m_isFlatXML(isFlatXML)
+-{
+-}
+-
+-OdgExporter::~OdgExporter()
+-{
+- for (std::vector <GraphicsElement *>::iterator iterStroke = mStrokeDashElements.begin();
+- iterStroke != mStrokeDashElements.end(); iterStroke++)
+- delete (*iterStroke);
+-
+- for (std::vector <GraphicsElement *>::iterator iterGradient = mGradientElements.begin();
+- iterGradient != mGradientElements.end(); iterGradient++)
+- delete (*iterGradient);
+-
+- for (std::vector <GraphicsElement *>::iterator iterAutomaticStyles = mAutomaticStylesElements.begin();
+- iterAutomaticStyles != mAutomaticStylesElements.end(); iterAutomaticStyles++)
+- delete (*iterAutomaticStyles);
+-
+- for (std::vector<GraphicsElement *>::iterator bodyIter = mBodyElements.begin();
+- bodyIter != mBodyElements.end(); bodyIter++)
+- delete (*bodyIter);
+-}
+-
+-void OdgExporter::startGraphics(double width, double height)
+-{
+- m_gradientIndex = 1;
+- m_dashIndex = 1;
+- m_styleIndex = 1;
+- m_width = width;
+- m_height = height;
+-
+-
+- mpHandler->startDocument();
+- OpenTagGraphicsElement tmpOfficeDocumentContent("office:document");
+- tmpOfficeDocumentContent.addAttribute("xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0");
+- tmpOfficeDocumentContent.addAttribute("xmlns:style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0");
+- tmpOfficeDocumentContent.addAttribute("xmlns:text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0");
+- tmpOfficeDocumentContent.addAttribute("xmlns:draw", "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0");
+- tmpOfficeDocumentContent.addAttribute("xmlns:dc", "http://purl.org/dc/elements/1.1/");
+- tmpOfficeDocumentContent.addAttribute("xmlns:svg", "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
+- tmpOfficeDocumentContent.addAttribute("xmlns:fo", "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0");
+- tmpOfficeDocumentContent.addAttribute("xmlns:config", "urn:oasis:names:tc:opendocument:xmlns:config:1.0");
+- tmpOfficeDocumentContent.addAttribute("xmlns:ooo", "http://openoffice.org/2004/office");
+- tmpOfficeDocumentContent.addAttribute("office:version", "1.0");
+- if (m_isFlatXML)
+- tmpOfficeDocumentContent.addAttribute("office:mimetype", "application/x-vnd.oasis.openoffice.drawing");
+- tmpOfficeDocumentContent.write(mpHandler);
+-
+- OpenTagGraphicsElement("office:settings").write(mpHandler);
+-
+- OpenTagGraphicsElement configItemSetOpenElement("config:config-item-set");
+- configItemSetOpenElement.addAttribute("config:name", "ooo:view-settings");
+- configItemSetOpenElement.write(mpHandler);
+-
+- OpenTagGraphicsElement configItemOpenElement1("config:config-item");
+- configItemOpenElement1.addAttribute("config:name", "VisibleAreaTop");
+- configItemOpenElement1.addAttribute("config:type", "int");
+- configItemOpenElement1.write(mpHandler);
+- mpHandler->characters("0");
+- mpHandler->endElement("config:config-item");
+-
+- OpenTagGraphicsElement configItemOpenElement2("config:config-item");
+- configItemOpenElement2.addAttribute("config:name", "VisibleAreaLeft");
+- configItemOpenElement2.addAttribute("config:type", "int");
+- configItemOpenElement2.write(mpHandler);
+- mpHandler->characters("0");
+- mpHandler->endElement("config:config-item");
+-
+- OpenTagGraphicsElement configItemOpenElement3("config:config-item");
+- configItemOpenElement3.addAttribute("config:name", "VisibleAreaWidth");
+- configItemOpenElement3.addAttribute("config:type", "int");
+- configItemOpenElement3.write(mpHandler);
+- m_value.str("");
+- m_value << (unsigned)(2540 * width);
+- mpHandler->characters(m_value.str());
+- mpHandler->endElement("config:config-item");
+-
+- OpenTagGraphicsElement configItemOpenElement4("config:config-item");
+- configItemOpenElement4.addAttribute("config:name", "VisibleAreaHeight");
+- configItemOpenElement4.addAttribute("config:type", "int");
+- configItemOpenElement4.write(mpHandler);
+- m_value.str("");
+- m_value << (unsigned)(2540 * height);
+- mpHandler->characters(m_value.str());
+- mpHandler->endElement("config:config-item");
+-
+- mpHandler->endElement("config:config-item-set");
+-
+- mpHandler->endElement("office:settings");
+-
+-}
+-
+-void OdgExporter::endGraphics()
+-{
+- OpenTagGraphicsElement("office:styles").write(mpHandler);
+-
+- for (std::vector <GraphicsElement *>::const_iterator iterStroke = mStrokeDashElements.begin();
+- iterStroke != mStrokeDashElements.end(); iterStroke++)
+- (*iterStroke)->write(mpHandler);
+-
+- for (std::vector <GraphicsElement *>::const_iterator iterGradient = mGradientElements.begin();
+- iterGradient != mGradientElements.end(); iterGradient++)
+- (*iterGradient)->write(mpHandler);
+-
+- mpHandler->endElement("office:styles");
+-
+- OpenTagGraphicsElement("office:automatic-styles").write(mpHandler);
+-
+- for (std::vector <GraphicsElement *>::const_iterator iterAutomaticStyles = mAutomaticStylesElements.begin();
+- iterAutomaticStyles != mAutomaticStylesElements.end(); iterAutomaticStyles++)
+- (*iterAutomaticStyles)->write(mpHandler);
+-
+- OpenTagGraphicsElement tmpStylePageLayoutOpenElement("style:page-layout");
+- tmpStylePageLayoutOpenElement.addAttribute("style:name", "PM0");
+- tmpStylePageLayoutOpenElement.write(mpHandler);
+-
+- OpenTagGraphicsElement tmpStylePageLayoutPropertiesOpenElement("style:page-layout-properties");
+- tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-top", "0in");
+- tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-bottom", "0in");
+- tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-left", "0in");
+- tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-right", "0in");
+- m_value.str("");
+- m_value << doubleToString(m_width) << "in";
+- tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:page-width", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(m_height) << "in";
+- tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:page-height", m_value.str());
+- m_value.str("");
+- tmpStylePageLayoutPropertiesOpenElement.addAttribute("style:print-orientation", "portrait");
+- tmpStylePageLayoutPropertiesOpenElement.write(mpHandler);
+-
+- mpHandler->endElement("style:page-layout-properties");
+-
+- mpHandler->endElement("style:page-layout");
+-
+- OpenTagGraphicsElement tmpStyleStyleOpenElement("style:style");
+- tmpStyleStyleOpenElement.addAttribute("style:name", "dp1");
+- tmpStyleStyleOpenElement.addAttribute("style:family", "drawing-page");
+- tmpStyleStyleOpenElement.write(mpHandler);
+-
+- OpenTagGraphicsElement tmpStyleDrawingPagePropertiesOpenElement("style:drawing-page-properties");
+- // tmpStyleDrawingPagePropertiesOpenElement.addAttribute("draw:background-size", "border");
+- tmpStyleDrawingPagePropertiesOpenElement.addAttribute("draw:fill", "none");
+- tmpStyleDrawingPagePropertiesOpenElement.write(mpHandler);
+-
+- mpHandler->endElement("style:drawing-page-properties");
+-
+- mpHandler->endElement("style:style");
+-
+- mpHandler->endElement("office:automatic-styles");
+-
+- OpenTagGraphicsElement("office:master-styles").write(mpHandler);
+-
+- OpenTagGraphicsElement tmpStyleMasterPageOpenElement("style:master-page");
+- tmpStyleMasterPageOpenElement.addAttribute("style:name", "Default");
+- tmpStyleMasterPageOpenElement.addAttribute("style:page-layout-name", "PM0");
+- tmpStyleMasterPageOpenElement.addAttribute("draw:style-name", "dp1");
+- tmpStyleMasterPageOpenElement.write(mpHandler);
+-
+- mpHandler->endElement("style:master-page");
+-
+- mpHandler->endElement("office:master-styles");
+-
+- OpenTagGraphicsElement("office:body").write(mpHandler);
+-
+- OpenTagGraphicsElement("office:drawing").write(mpHandler);
+-
+- OpenTagGraphicsElement tmpDrawPageOpenElement("draw:page");
+- tmpDrawPageOpenElement.addAttribute("draw:name", "page1");
+- tmpDrawPageOpenElement.addAttribute("draw:style-name", "dp1");
+- tmpDrawPageOpenElement.addAttribute("draw:master-page-name", "Default");
+- tmpDrawPageOpenElement.write(mpHandler);
+-
+- for (std::vector<GraphicsElement *>::const_iterator bodyIter = mBodyElements.begin();
+- bodyIter != mBodyElements.end(); bodyIter++)
+- {
+- (*bodyIter)->write(mpHandler);
+- }
+-
+- mpHandler->endElement("draw:page");
+- mpHandler->endElement("office:drawing");
+- mpHandler->endElement("office:body");
+- mpHandler->endElement("office:document");
+-
+- mpHandler->endDocument();
+-}
+-
+-void OdgExporter::setPen(const libwpg::WPGPen& pen)
+-{
+- m_pen = pen;
+-}
+-
+-void OdgExporter::setBrush(const libwpg::WPGBrush& brush)
+-{
+- m_brush = brush;
+-}
+-
+-void OdgExporter::setFillRule(FillRule rule)
+-{
+- m_fillRule = rule;
+-}
+-
+-void OdgExporter::startLayer(unsigned int)
+-{
+-}
+-
+-void OdgExporter::endLayer(unsigned int)
+-{
+-}
+-
+-void OdgExporter::drawRectangle(const libwpg::WPGRect& rect, double rx, double )
+-{
+- writeStyle();
+- OpenTagGraphicsElement *pDrawRectElement = new OpenTagGraphicsElement("draw:rect");
+- m_value.str("");
+- m_value << "gr" << m_styleIndex-1;
+- pDrawRectElement->addAttribute("draw:style-name", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(rect.x1) << "in";
+- pDrawRectElement->addAttribute("svg:x", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(rect.y1) << "in";
+- pDrawRectElement->addAttribute("svg:y", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(rect.x2-rect.x1) << "in";
+- pDrawRectElement->addAttribute("svg:width", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(rect.y2-rect.y1) << "in";
+- pDrawRectElement->addAttribute("svg:height", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(rx) << "in";
+- // FIXME: what to do when rx != ry ?
+- pDrawRectElement->addAttribute("draw:corner-radius", m_value.str());
+- m_value.str("");
+- mBodyElements.push_back(static_cast<GraphicsElement *>(pDrawRectElement));
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("draw:rect")));
+-}
+-
+-void OdgExporter::drawEllipse(const libwpg::WPGPoint& center, double rx, double ry)
+-{
+- writeStyle();
+- OpenTagGraphicsElement *pDrawEllipseElement = new OpenTagGraphicsElement("draw:ellipse");
+- m_value.str("");
+- m_value << "gr" << m_styleIndex-1;
+- pDrawEllipseElement->addAttribute("draw:style-name", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(center.x - rx) << "in";
+- pDrawEllipseElement->addAttribute("svg:x", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(center.y - ry) << "in";
+- pDrawEllipseElement->addAttribute("svg:y", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(2 * rx) << "in";
+- pDrawEllipseElement->addAttribute("svg:width", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(2 * ry) << "in";
+- pDrawEllipseElement->addAttribute("svg:height", m_value.str());
+- m_value.str("");
+- mBodyElements.push_back(static_cast<GraphicsElement *>(pDrawEllipseElement));
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("draw:ellipse")));
+-}
+-
+-void OdgExporter::drawPolygon(const libwpg::WPGPointArray& vertices)
+-{
+- if(vertices.count() < 2)
+- return;
+-
+- if(vertices.count() == 2)
+- {
+- const libwpg::WPGPoint& p1 = vertices[0];
+- const libwpg::WPGPoint& p2 = vertices[1];
+-
+- writeStyle();
+- OpenTagGraphicsElement *pDrawLineElement = new OpenTagGraphicsElement("draw:line");
+- m_value.str("");
+- m_value << "gr" << m_styleIndex-1;
+- pDrawLineElement->addAttribute("draw:style-name", m_value.str());
+- m_value.str("");
+- pDrawLineElement->addAttribute("draw:text-style-name", "P1");
+- pDrawLineElement->addAttribute("draw:layer", "layout");
+- m_value << doubleToString(p1.x) << "in";
+- pDrawLineElement->addAttribute("svg:x1", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(p1.y) << "in";
+- pDrawLineElement->addAttribute("svg:y1", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(p2.x) << "in";
+- pDrawLineElement->addAttribute("svg:x2", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(p2.y) << "in";
+- pDrawLineElement->addAttribute("svg:y2", m_value.str());
+- m_value.str("");
+- mBodyElements.push_back(static_cast<GraphicsElement *>(pDrawLineElement));
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("draw:line")));
+- }
+- else
+- {
+- // draw as path
+- libwpg::WPGPath path;
+- path.moveTo(vertices[0]);
+- for(unsigned long ii = 1; ii < vertices.count(); ii++)
+- path.lineTo(vertices[ii]);
+- path.closed = true;
+- drawPath(path);
+- }
+-}
+-
+-void OdgExporter::drawPath(const libwpg::WPGPath& path)
+-{
+- if(path.count() == 0)
+- return;
+-
+- // try to find the bounding box
+- // this is simple convex hull technique, the bounding box might not be
+- // accurate but that should be enough for this purpose
+- libwpg::WPGPoint p = path.element(0).point;
+- libwpg::WPGPoint q = path.element(0).point;
+- for(unsigned k = 0; k < path.count(); k++)
+- {
+- libwpg::WPGPathElement element = path.element(k);
+- p.x = (p.x > element.point.x) ? element.point.x : p.x;
+- p.y = (p.y > element.point.y) ? element.point.y : p.y;
+- q.x = (q.x < element.point.x) ? element.point.x : q.x;
+- q.y = (q.y < element.point.y) ? element.point.y : q.y;
+- if(element.type == libwpg::WPGPathElement::CurveToElement)
+- {
+- p.x = (p.x > element.extra1.x) ? element.extra1.x : p.x;
+- p.y = (p.y > element.extra1.y) ? element.extra1.y : p.y;
+- q.x = (q.x < element.extra1.x) ? element.extra1.x : q.x;
+- q.y = (q.y < element.extra1.y) ? element.extra1.y : q.y;
+- p.x = (p.x > element.extra2.x) ? element.extra2.x : p.x;
+- p.y = (p.y > element.extra2.y) ? element.extra2.y : p.y;
+- q.x = (q.x < element.extra2.x) ? element.extra2.x : q.x;
+- q.y = (q.y < element.extra2.y) ? element.extra2.y : q.y;
+- }
+- }
+- double vw = q.x - p.x;
+- double vh = q.y - p.y;
+-
+- writeStyle();
+-
+- OpenTagGraphicsElement *pDrawPathElement = new OpenTagGraphicsElement("draw:path");
+- m_value.str("");
+- m_value << "gr" << m_styleIndex-1;
+- pDrawPathElement->addAttribute("draw:style-name", m_value.str());
+- m_value.str("");
+- pDrawPathElement->addAttribute("draw:text-style-name", "P1");
+- pDrawPathElement->addAttribute("draw:layer", "layout");
+- m_value << doubleToString(p.x) << "in";
+- pDrawPathElement->addAttribute("svg:x", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(p.y) << "in";
+- pDrawPathElement->addAttribute("svg:y", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(vw) << "in";
+- pDrawPathElement->addAttribute("svg:width", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(vh) << "in";
+- pDrawPathElement->addAttribute("svg:height", m_value.str());
+- m_value.str("");
+- m_value << "0 0 " << (int)(vw*2540) << " " << (int)(vh*2540);
+- pDrawPathElement->addAttribute("svg:viewBox", m_value.str());
+- m_value.str("");
+-
+- for(unsigned i = 0; i < path.count(); i++)
+- {
+- libwpg::WPGPathElement element = path.element(i);
+- libwpg::WPGPoint point = element.point;
+- switch(element.type)
+- {
+- // 2540 is 2.54*1000, 2.54 in = 1 in
+- case libwpg::WPGPathElement::MoveToElement:
+- m_value << "M" << (int)((point.x-p.x)*2540) << " ";
+- m_value << (int)((point.y-p.y)*2540);
+- break;
+-
+- case libwpg::WPGPathElement::LineToElement:
+- m_value << "L" << (int)((point.x-p.x)*2540) << " ";
+- m_value << (int)((point.y-p.y)*2540);
+- break;
+-
+- case libwpg::WPGPathElement::CurveToElement:
+- m_value << "C" << (int)((element.extra1.x-p.x)*2540) << " ";
+- m_value << (int)((element.extra1.y-p.y)*2540) << " ";
+- m_value << (int)((element.extra2.x-p.x)*2540) << " ";
+- m_value << (int)((element.extra2.y-p.y)*2540) << " ";
+- m_value << (int)((point.x-p.x)*2540) << " ";
+- m_value << (int)((point.y-p.y)*2540);
+- break;
+-
+- default:
+- break;
+- }
+- }
+- if(path.closed)
+- m_value << " Z";
+- pDrawPathElement->addAttribute("svg:d", m_value.str());
+- m_value.str("");
+- mBodyElements.push_back(static_cast<GraphicsElement *>(pDrawPathElement));
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("draw:path")));
+-}
+-
+-
+-void OdgExporter::drawBitmap(const libwpg::WPGBitmap& bitmap)
+-{
+- OpenTagGraphicsElement *pDrawFrameElement = new OpenTagGraphicsElement("draw:frame");
+- m_value.str("");
+- m_value << doubleToString(bitmap.rect.x1) << "in";
+- pDrawFrameElement->addAttribute("svg:x", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(bitmap.rect.y1) << "in";
+- pDrawFrameElement->addAttribute("svg:y", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(bitmap.rect.height()) << "in";
+- pDrawFrameElement->addAttribute("svg:height", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(bitmap.rect.width()) << "in";
+- pDrawFrameElement->addAttribute("svg:width", m_value.str());
+- mBodyElements.push_back(static_cast<GraphicsElement *>(pDrawFrameElement));
+-
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new OpenTagGraphicsElement("draw:image")));
+-
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new OpenTagGraphicsElement("office:binary-data")));
+-
+- libwpg::WPGString base64Binary;
+- bitmap.generateBase64DIB(base64Binary);
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new CharDataGraphicsElement(base64Binary.cstr())));
+-
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("office:binary-data")));
+-
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("draw:image")));
+-
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("draw:frame")));
+-}
+-
+-void OdgExporter::drawImageObject(const libwpg::WPGBinaryData& binaryData)
+-{
+- if (binaryData.mimeType.length() <= 0)
+- return;
+- OpenTagGraphicsElement *pDrawFrameElement = new OpenTagGraphicsElement("draw:frame");
+- m_value.str("");
+- m_value << doubleToString(binaryData.rect.x1) << "in";
+- pDrawFrameElement->addAttribute("svg:x", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(binaryData.rect.y1) << "in";
+- pDrawFrameElement->addAttribute("svg:y", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(binaryData.rect.height()) << "in";
+- pDrawFrameElement->addAttribute("svg:height", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(binaryData.rect.width()) << "in";
+- pDrawFrameElement->addAttribute("svg:width", m_value.str());
+- mBodyElements.push_back(static_cast<GraphicsElement *>(pDrawFrameElement));
+-
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new OpenTagGraphicsElement("draw:image")));
+-
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new OpenTagGraphicsElement("office:binary-data")));
+-
+- libwpg::WPGString base64Binary = binaryData.getBase64Data();
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new CharDataGraphicsElement(base64Binary.cstr())));
+-
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("office:binary-data")));
+-
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("draw:image")));
+-
+- mBodyElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("draw:frame")));
+-}
+-
+-
+-static std::string colorToHex(const libwpg::WPGColor& color)
+-{
+- char hexdigits[] = "0123456789abcdef";
+- char buffer[] = "123456";
+- buffer[0] = hexdigits[(color.red >> 4) & 15];
+- buffer[1] = hexdigits[color.red & 15];
+- buffer[2] = hexdigits[(color.green >> 4) & 15];
+- buffer[3] = hexdigits[color.green & 15];
+- buffer[4] = hexdigits[(color.blue >> 4) & 15];
+- buffer[5] = hexdigits[color.blue & 15];
+- return std::string(buffer);
+-}
+-
+-void OdgExporter::writeStyle()
+-{
+- m_value.str("");
+- m_name.str("");
+-
+- if(!m_pen.solid && (m_pen.dashArray.count() >=2 ) )
+- {
+- // ODG only supports dashes with the same length of spaces inbetween
+- // here we take the first space and assume everything else the same
+- // note that dash length is written in percentage
+- double distance = m_pen.dashArray.at(1);
+- OpenTagGraphicsElement *tmpDrawStrokeDashElement = new OpenTagGraphicsElement("draw:stroke-dash");
+- tmpDrawStrokeDashElement->addAttribute("draw:style", "rect");
+- m_value << "Dash_" << m_dashIndex++;
+- tmpDrawStrokeDashElement->addAttribute("draw:name", m_value.str());
+- m_value.str("");
+- m_value << doubleToString(distance*100) << "%";
+- tmpDrawStrokeDashElement->addAttribute("draw:distance", m_value.str());
+- m_value.str("");
+- for(unsigned i = 0; i < m_pen.dashArray.count()/2; i++)
+- {
+- m_name << "draw:dots" << i+1;
+- tmpDrawStrokeDashElement->addAttribute(m_name.str(), "1");
+- m_name.str("");
+- m_name << "draw:dots" << i+1 << "-length";
+- m_value << doubleToString(100*m_pen.dashArray.at(i*2)) << "%";
+- tmpDrawStrokeDashElement->addAttribute(m_name.str(), m_value.str());
+- m_name.str("");
+- m_value.str("");
+- }
+- mStrokeDashElements.push_back(static_cast<GraphicsElement *>(tmpDrawStrokeDashElement));
+- mStrokeDashElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("draw:stroke-dash")));
+- }
+-
+- if(m_brush.style == libwpg::WPGBrush::Gradient)
+- {
+- OpenTagGraphicsElement *tmpDrawGradientElement = new OpenTagGraphicsElement("draw:gradient");
+- tmpDrawGradientElement->addAttribute("draw:style", "linear");
+- m_value << "Gradient_" << m_gradientIndex++;
+- tmpDrawGradientElement->addAttribute("draw:name", m_value.str());
+- m_value.str("");
+-
+- // ODG angle unit is 0.1 degree
+- double angle = -m_brush.gradient.angle();
+- while(angle < 0)
+- angle += 360;
+- while(angle > 360)
+- angle -= 360;
+-
+- m_value << (unsigned)(angle*10);
+- tmpDrawGradientElement->addAttribute("draw:angle", m_value.str());
+- m_value.str("");
+-
+- libwpg::WPGColor startColor = m_brush.gradient.stopColor(0);
+- libwpg::WPGColor stopColor = m_brush.gradient.stopColor(1);
+- m_value << "#" << colorToHex(startColor);
+- tmpDrawGradientElement->addAttribute("draw:start-color", m_value.str());
+- m_value.str("");
+- m_value << "#" << colorToHex(stopColor);
+- tmpDrawGradientElement->addAttribute("draw:end-color", m_value.str());
+- m_value.str("");
+- tmpDrawGradientElement->addAttribute("draw:start-intensity", "100%");
+- tmpDrawGradientElement->addAttribute("draw:end-intensity", "100%");
+- tmpDrawGradientElement->addAttribute("draw:border", "0%");
+- mGradientElements.push_back(static_cast<GraphicsElement *>(tmpDrawGradientElement));
+- mGradientElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("draw:gradient")));
+- }
+-
+- OpenTagGraphicsElement *tmpStyleStyleElement = new OpenTagGraphicsElement("style:style");
+- m_value << "gr" << m_styleIndex;
+- tmpStyleStyleElement->addAttribute("style:name", m_value.str());
+- m_value.str("");
+- tmpStyleStyleElement->addAttribute("style:family", "graphic");
+- tmpStyleStyleElement->addAttribute("style:parent-style-name", "standard");
+- mAutomaticStylesElements.push_back(static_cast<GraphicsElement *>(tmpStyleStyleElement));
+-
+- OpenTagGraphicsElement *tmpStyleGraphicPropertiesElement = new OpenTagGraphicsElement("style:graphic-properties");
+-
+- if(m_pen.width > 0.0)
+- {
+- m_value << doubleToString(m_pen.width) << "in";
+- tmpStyleGraphicPropertiesElement->addAttribute("svg:stroke-width", m_value.str());
+- m_value.str("");
+- m_value << "#" << colorToHex(m_pen.foreColor);
+- tmpStyleGraphicPropertiesElement->addAttribute("svg:stroke-color", m_value.str());
+- m_value.str("");
+-
+- if(!m_pen.solid)
+- {
+- tmpStyleGraphicPropertiesElement->addAttribute("draw:stroke", "dash");
+- m_value << "Dash_" << m_dashIndex-1;
+- tmpStyleGraphicPropertiesElement->addAttribute("draw:stroke-dash", m_value.str());
+- m_value.str("");
+- }
+- }
+- else
+- tmpStyleGraphicPropertiesElement->addAttribute("draw:stroke", "none");
+-
+- if(m_brush.style == libwpg::WPGBrush::NoBrush)
+- tmpStyleGraphicPropertiesElement->addAttribute("draw:fill", "none");
+-
+- if(m_brush.style == libwpg::WPGBrush::Solid)
+- {
+- tmpStyleGraphicPropertiesElement->addAttribute("draw:fill", "solid");
+- m_value << "#" << colorToHex(m_brush.foreColor);
+- tmpStyleGraphicPropertiesElement->addAttribute("draw:fill-color", m_value.str());
+- m_value.str("");
+- }
+-
+- if(m_brush.style == libwpg::WPGBrush::Gradient)
+- {
+- tmpStyleGraphicPropertiesElement->addAttribute("draw:fill", "gradient");
+- m_value << "Gradient_" << m_gradientIndex-1;
+- tmpStyleGraphicPropertiesElement->addAttribute("draw:fill-gradient-name", m_value.str());
+- m_value.str("");
+- }
+-
+- mAutomaticStylesElements.push_back(static_cast<GraphicsElement *>(tmpStyleGraphicPropertiesElement));
+- mAutomaticStylesElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("style:graphic-properties")));
+-
+- mAutomaticStylesElements.push_back(static_cast<GraphicsElement *>(new CloseTagGraphicsElement("style:style")));
+- m_styleIndex++;
+-}
+diff -Nur koffice-2.3.1/filters/karbon/wpg/import/OdgExporter.hxx koffice-2.3.1-libwpg02/filters/karbon/wpg/import/OdgExporter.hxx
+--- koffice-2.3.1/filters/karbon/wpg/import/OdgExporter.hxx 2011-01-15 21:05:35.000000000 +0100
++++ koffice-2.3.1-libwpg02/filters/karbon/wpg/import/OdgExporter.hxx 1970-01-01 01:00:00.000000000 +0100
+@@ -1,116 +0,0 @@
+-/* libwpg
+- * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
+- *
+- * This library is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU Library General Public
+- * License as published by the Free Software Foundation; either
+- * version 2 of the License, or (at your option) any later version.
+- *
+- * 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; if not, write to the
+- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+- * Boston, MA 02111-1301 USA
+- *
+- * For further information visit http://libwpg.sourceforge.net
+- */
+-
+-/* "This product is not manufactured, approved, or supported by
+- * Corel Corporation or Corel Corporation Limited."
+- */
+-
+-#ifndef __ODGEXPORTER_H__
+-#define __ODGEXPORTER_H__
+-
+-#include <iostream>
+-#include <sstream>
+-#include <string>
+-
+-#include <libwpg/libwpg.h>
+-#include "GraphicsElement.hxx"
+-
+-class OdgExporter : public libwpg::WPGPaintInterface {
+-public:
+- explicit OdgExporter(GraphicsHandler *pHandler,
+- const bool isFlatXML = false);
+- ~OdgExporter();
+-
+-#if LIBWPG_VERSION_MINOR<2
+- void startGraphics(double imageWidth, double imageHeight);
+- void endGraphics();
+- void startLayer(unsigned int id);
+- void endLayer(unsigned int id);
+-
+- void setPen(const libwpg::WPGPen& pen);
+- void setBrush(const libwpg::WPGBrush& brush);
+- void setFillRule(FillRule rule);
+-
+- void drawRectangle(const libwpg::WPGRect& rect, double rx, double ry);
+- void drawEllipse(const libwpg::WPGPoint& center, double rx, double ry);
+- void drawPolygon(const libwpg::WPGPointArray& vertices);
+- void drawPath(const libwpg::WPGPath& path);
+- void drawBitmap(const libwpg::WPGBitmap& bitmap);
+- void drawImageObject(const libwpg::WPGBinaryData& binaryData);
+-
+-private:
+- std::vector <GraphicsElement *> mBodyElements;
+- std::vector <GraphicsElement *> mAutomaticStylesElements;
+- std::vector <GraphicsElement *> mStrokeDashElements;
+- std::vector <GraphicsElement *> mGradientElements;
+- GraphicsHandler *mpHandler;
+-
+- libwpg::WPGPen m_pen;
+- libwpg::WPGBrush m_brush;
+- FillRule m_fillRule;
+- int m_gradientIndex;
+- int m_dashIndex;
+- int m_styleIndex;
+- void writeStyle();
+- std::ostringstream m_value, m_name;
+- double m_width, m_height;
+- const bool m_isFlatXML;
+-#else
+- virtual void startGraphics(const ::WPXPropertyList &propList);
+- virtual void endGraphics();
+- virtual void setStyle(const ::WPXPropertyList &propList, const ::WPXPropertyListVector &gradient);
+- virtual void startLayer(const ::WPXPropertyList &propList);
+- virtual void endLayer();
+- virtual void drawRectangle(const ::WPXPropertyList& propList);
+- virtual void drawEllipse(const ::WPXPropertyList& propList);
+- virtual void drawPolygon(const ::WPXPropertyListVector &vertices);
+- virtual void drawPath(const ::WPXPropertyListVector &path);
+- virtual void drawGraphicObject(const ::WPXPropertyList &propList, const ::WPXBinaryData &binaryData);
+- virtual void startEmbeddedGraphics(const ::WPXPropertyList &propList);
+- virtual void endEmbeddedGraphics();
+- virtual void drawPolyline(const ::WPXPropertyListVector &vertices);
+- virtual void startTextObject(const ::WPXPropertyList &propList, const ::WPXPropertyListVector &path);
+- virtual void endTextObject();
+- virtual void startTextLine(const ::WPXPropertyList &propList);
+- virtual void endTextLine();
+- virtual void startTextSpan(const ::WPXPropertyList &propList);
+- virtual void endTextSpan();
+- virtual void insertText(const ::WPXString &str);
+-
+-
+-private:
+- std::vector <GraphicsElement *> mBodyElements;
+- std::vector <GraphicsElement *> mAutomaticStylesElements;
+- std::vector <GraphicsElement *> mStrokeDashElements;
+- std::vector <GraphicsElement *> mGradientElements;
+- GraphicsHandler *mpHandler;
+-
+- int m_gradientIndex;
+- int m_dashIndex;
+- int m_styleIndex;
+- void writeStyle();
+- std::ostringstream m_value, m_name;
+- double m_width, m_height;
+- const bool m_isFlatXML;
+-#endif
+-};
+-
+-#endif // __ODGEXPORTER_H__
+diff -Nur koffice-2.3.1/filters/karbon/wpg/import/WPGImport.cpp koffice-2.3.1-libwpg02/filters/karbon/wpg/import/WPGImport.cpp
+--- koffice-2.3.1/filters/karbon/wpg/import/WPGImport.cpp 2011-01-15 21:05:35.000000000 +0100
++++ koffice-2.3.1-libwpg02/filters/karbon/wpg/import/WPGImport.cpp 2011-01-02 17:46:15.000000000 +0100
+@@ -20,28 +20,26 @@
+ #include <WPGImport.h>
+ #include <WPGImport.moc>
+
+-#include <QBuffer>
+-#include <QByteArray>
+-#include <QString>
+-
+-#include <kdebug.h>
+ #include <KoFilterChain.h>
+ #include <KoGlobal.h>
+ #include <KoUnit.h>
++#include <KoXmlWriter.h>
++
+ #include <kpluginfactory.h>
++#include <KDebug>
+
+-#include <KoXmlWriter.h>
++
++#include <QtCore/QString>
++#include <QtCore/QFile>
+
+ #include <libwpg/libwpg.h>
+ #if LIBWPG_VERSION_MINOR<2
+ #include <libwpg/WPGStreamImplementation.h>
+ #else
+ #include <libwpd-stream/libwpd-stream.h>
++#include <libwpd/libwpd.h>
+ #endif
+
+-#include "FileOutputHandler.hxx"
+-#include "OdgExporter.hxx"
+-
+ #include <iostream>
+
+ K_PLUGIN_FACTORY(WPGImportFactory, registerPlugin<WPGImport>();)
+@@ -56,35 +54,13 @@
+ {
+ }
+
+-static QByteArray createManifest()
+-{
+- KoXmlWriter* manifestWriter;
+- QByteArray manifestData;
+- QBuffer manifestBuffer(&manifestData);
+-
+- manifestBuffer.open(QIODevice::WriteOnly);
+- manifestWriter = new KoXmlWriter(&manifestBuffer);
+-
+- manifestWriter->startDocument("manifest:manifest");
+- manifestWriter->startElement("manifest:manifest");
+- manifestWriter->addAttribute("xmlns:manifest", "urn:oasis:names:tc:openoffice:xmlns:manifest:1.0");
+- manifestWriter->addManifestEntry("/", "application/vnd.oasis.opendocument.graphics");
+- //manifestWriter->addManifestEntry( "styles.xml", "text/xml" );
+- manifestWriter->addManifestEntry("content.xml", "text/xml");
+- manifestWriter->endElement();
+- manifestWriter->endDocument();
+- delete manifestWriter;
+-
+- return manifestData;
+-}
+-
+
+ KoFilter::ConversionStatus WPGImport::convert(const QByteArray& from, const QByteArray& to)
+ {
+ if (from != "application/x-wpg")
+ return KoFilter::NotImplemented;
+
+- if (to != "application/vnd.oasis.opendocument.graphics")
++ if (to != "image/svg+xml")
+ return KoFilter::NotImplemented;
+
+ #if LIBWPG_VERSION_MINOR<2
+@@ -96,6 +72,7 @@
+ input = olestream;
+ }
+ }
++ libwpg::WPGString output;
+ #else
+ WPXInputStream* input = new WPXFileStream(m_chain->inputFile().toLocal8Bit());
+ if (input->isOLEStream()) {
+@@ -105,59 +82,31 @@
+ input = olestream;
+ }
+ }
++ ::WPXString output;
+ #endif
+
+ if (!libwpg::WPGraphics::isSupported(input)) {
+- std::cerr << "ERROR: Unsupported file format (unsupported version) or file is encrypted!" << std::endl;
++ kWarning() << "ERROR: Unsupported file format (unsupported version) or file is encrypted!";
+ delete input;
+ return KoFilter::NotImplemented;
+ }
+
+- // do the conversion
+- std::ostringstream tmpStringStream;
+- FileOutputHandler tmpHandler(tmpStringStream);
+- OdgExporter exporter(&tmpHandler);
+- libwpg::WPGraphics::parse(input, &exporter);
+- delete input;
+-
+-
+- // create output store
+- KoStore* storeout;
+- storeout = KoStore::createStore(m_chain->outputFile(), KoStore::Write,
+- "application/vnd.oasis.opendocument.graphics", KoStore::Zip);
+-
+- if (!storeout) {
+- kWarning() << "Couldn't open the requested file.";
+- return KoFilter::FileNotFound;
+- }
+-
+-#if 0
+- if (!storeout->open("styles.xml")) {
+- kWarning() << "Couldn't open the file 'styles.xml'.";
+- return KoFilter::CreationError;
++ if (!libwpg::WPGraphics::generateSVG(input, output)) {
++ kWarning() << "ERROR: SVG Generation failed!";
++ delete input;
++ return KoFilter::ParsingError;
+ }
+- //storeout->write( createStyles() );
+- storeout->close();
+-#endif
+
+- if (!storeout->open("content.xml")) {
+- kWarning() << "Couldn't open the file 'content.xml'.";
+- return KoFilter::CreationError;
+- }
+- storeout->write(tmpStringStream.str().c_str());
+- storeout->close();
++ delete input;
+
+- // store document manifest
+- storeout->enterDirectory("META-INF");
+- if (!storeout->open("manifest.xml")) {
+- kWarning() << "Couldn't open the file 'META-INF/manifest.xml'.";
+- return KoFilter::CreationError;
++ QFile outputFile(m_chain->outputFile());
++ if(!outputFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
++ kWarning() << "ERROR: Could not open output file" << m_chain->outputFile();
++ return KoFilter::InternalError;
+ }
+- storeout->write(createManifest());
+- storeout->close();
+
+- // we are done!
+- delete storeout;
++ outputFile.write(output.cstr());
++ outputFile.close();
+
+ return KoFilter::OK;
+ }
+
diff --git a/staging/koffice/koffice.install b/staging/koffice/koffice.install
new file mode 100644
index 000000000..6c87527e2
--- /dev/null
+++ b/staging/koffice/koffice.install
@@ -0,0 +1,12 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/staging/koffice/krita.install b/staging/koffice/krita.install
new file mode 100644
index 000000000..5d458de55
--- /dev/null
+++ b/staging/koffice/krita.install
@@ -0,0 +1,13 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-mime-database usr/share/mime &> /dev/null
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
diff --git a/staging/koffice/qt48fix.patch b/staging/koffice/qt48fix.patch
new file mode 100644
index 000000000..de72926d5
--- /dev/null
+++ b/staging/koffice/qt48fix.patch
@@ -0,0 +1,10 @@
+--- koffice-2.3.3/plugins/chartshape/kdchart/src/KDChartBackgroundAttributes.cpp 2011-02-17 13:10:38.000000000 +0100
++++ koffice-2.3.3/plugins/chartshape/kdchart/src/KDChartBackgroundAttributes.cpp 2011-09-08 15:03:31.932039128 +0200
+@@ -150,7 +150,6 @@ QDebug operator<<(QDebug dbg, const KDCh
+ << "visible="<<ba.isVisible()
+ << "brush="<<ba.brush()
+ << "pixmapmode="<<ba.pixmapMode()
+- << "pixmap="<<ba.pixmap()
+ << ")";
+ return dbg;
+ }
diff --git a/staging/libgnome-media-profiles/PKGBUILD b/staging/libgnome-media-profiles/PKGBUILD
new file mode 100644
index 000000000..7844a833a
--- /dev/null
+++ b/staging/libgnome-media-profiles/PKGBUILD
@@ -0,0 +1,39 @@
+# $Id: PKGBUILD 147671 2012-01-26 09:41:28Z heftig $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+pkgname=libgnome-media-profiles
+pkgver=3.0.0
+pkgrel=3
+pkgdesc="Library for management of audio recording profiles"
+arch=(i686 x86_64)
+url="http://www.gnome.org"
+license=('GPL2')
+depends=('gconf' 'gtk3' 'gstreamer0.10-base-plugins')
+makedepends=('intltool' 'gnome-doc-utils')
+options=('!emptydirs' '!libtool')
+install=libgnome-media-profiles.install
+source=(http://download.gnome.org/sources/${pkgname}/3.0/${pkgname}-${pkgver}.tar.bz2)
+sha256sums=('ab1288e53a8fccca3e8fa59757ef586901e236e09a737a1178eeb8d74428c061')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ ./configure --prefix=/usr --sysconfdir=/etc \
+ --disable-static -disable-scrollkeeper \
+ --disable-schemas-install
+
+ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0 /g' -e 's/ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then/ func_append compile_command " -Wl,-O1,--as-needed"\n func_append finalize_command " -Wl,-O1,--as-needed"\n\0/' libtool
+
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make DESTDIR="${pkgdir}" install
+
+ install -m755 -d "${pkgdir}/usr/share/gconf/schemas"
+ gconf-merge-schema "${pkgdir}/usr/share/gconf/schemas/${pkgname}.schemas" --domain gnome-audio-profiles "${pkgdir}"/etc/gconf/schemas/*.schemas
+ rm -f "${pkgdir}"/etc/gconf/schemas/*.schemas
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/staging/libgnome-media-profiles/libgnome-media-profiles.install b/staging/libgnome-media-profiles/libgnome-media-profiles.install
new file mode 100644
index 000000000..22b4c8f12
--- /dev/null
+++ b/staging/libgnome-media-profiles/libgnome-media-profiles.install
@@ -0,0 +1,17 @@
+pkgname=libgnome-media-profiles
+
+post_install(){
+ usr/sbin/gconfpkg --install ${pkgname}
+}
+
+pre_upgrade() {
+ pre_remove $1
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ usr/sbin/gconfpkg --uninstall ${pkgname}
+}
diff --git a/staging/opencv/PKGBUILD b/staging/opencv/PKGBUILD
index 8829b6e70..be1122504 100644
--- a/staging/opencv/PKGBUILD
+++ b/staging/opencv/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 147051 2012-01-21 05:36:50Z schiv $
+# $Id: PKGBUILD 147678 2012-01-26 14:03:05Z schiv $
# Maintainer: Ray Rashif <schiv@archlinux.org>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
diff --git a/staging/plotutils/PKGBUILD b/staging/plotutils/PKGBUILD
new file mode 100644
index 000000000..14d4c736e
--- /dev/null
+++ b/staging/plotutils/PKGBUILD
@@ -0,0 +1,32 @@
+# $Id: PKGBUILD 147686 2012-01-27 01:31:15Z eric $
+# Maintainer: damir <damir@archlinux.org>
+# Packager: Maksim Sipos (maxsipos at gmail dot com)
+
+pkgname=plotutils
+pkgver=2.6
+pkgrel=2
+arch=('x86_64' 'i686')
+pkgdesc="Set of utilities and libraries for plotting."
+url="http://directory.fsf.org/graphics/plotutils.html"
+license=("GPL")
+depends=("libpng" "gcc-libs" "libxaw>=1.0.5")
+options=('!libtool')
+install=plotutils.install
+source=(http://ftp.gnu.org/pub/gnu/plotutils/$pkgname-$pkgver.tar.gz plotutils-2.6-libpng-1.5.patch)
+sha1sums=('7921301d9dfe8991e3df2829bd733df6b2a70838'
+ '426f6ee04186af5059ab54322efaf0a6a976682b')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -p0 -i ../plotutils-2.6-libpng-1.5.patch
+ ./configure --prefix=/usr \
+ --with-gnu-ld \
+ --with-x \
+ --enable-libplotter
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+}
diff --git a/staging/plotutils/plotutils-2.6-libpng-1.5.patch b/staging/plotutils/plotutils-2.6-libpng-1.5.patch
new file mode 100644
index 000000000..b86d9f457
--- /dev/null
+++ b/staging/plotutils/plotutils-2.6-libpng-1.5.patch
@@ -0,0 +1,31 @@
+fix building with libpng-1.5
+
+--- libplot/z_write.c
++++ libplot/z_write.c
+@@ -164,7 +164,7 @@
+ }
+
+ /* cleanup after libpng errors (error handler does a longjmp) */
+- if (setjmp (png_ptr->jmpbuf))
++ if (png_jmpbuf (png_ptr))
+ {
+ png_destroy_write_struct (&png_ptr, (png_info **)NULL);
+ return -1;
+@@ -444,7 +444,7 @@
+ #endif
+ }
+
+- longjmp (png_ptr->jmpbuf, 1);
++ longjmp (png_jmpbuf (png_ptr), 1);
+ }
+
+ static void
+@@ -515,7 +515,7 @@
+ #endif
+ }
+
+- longjmp (png_ptr->jmpbuf, 1);
++ longjmp (png_jmpbuf (png_ptr), 1);
+ }
+
+ static void
diff --git a/staging/plotutils/plotutils.install b/staging/plotutils/plotutils.install
new file mode 100644
index 000000000..d3d033e0c
--- /dev/null
+++ b/staging/plotutils/plotutils.install
@@ -0,0 +1,15 @@
+infodir=usr/share/info
+
+post_install() {
+ [[ -x usr/bin/install-info ]] || return 0
+ install-info $infodir/plotutils.info.gz $infodir/dir 2> /dev/null
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ [[ -x usr/bin/install-info ]] || return 0
+ install-info --delete $infodir/plotutils.info.gz $infodir/dir 2> /dev/null
+}
diff --git a/staging/r/PKGBUILD b/staging/r/PKGBUILD
new file mode 100644
index 000000000..835723982
--- /dev/null
+++ b/staging/r/PKGBUILD
@@ -0,0 +1,69 @@
+# $Id: PKGBUILD 147684 2012-01-27 00:28:38Z eric $
+# Maintainer: Ronald van Haren <ronald.archlinux.org>
+# Contributor: Damir Perisa <damir.perisa@bluewin.ch>
+# Contributor: K. Piche <kpiche@rogers.com>
+
+pkgname=r
+pkgver=2.14.0
+pkgrel=2
+pkgdesc="Language and environment for statistical computing and graphics"
+arch=('i686' 'x86_64')
+license=('GPL')
+url=('http://www.r-project.org/')
+depends=('blas' 'lapack' 'bzip2' 'libpng' 'libjpeg' 'libtiff'
+ 'ncurses' 'pcre' 'readline' 'zlib' 'perl' 'gcc-libs'
+ 'tk' 'libxt' 'libxmu' 'pango' 'xz')
+makedepends=('openjdk6' 'gcc-fortran')
+backup=('etc/R/Makeconf' 'etc/R/Renviron' 'etc/R/ldpaths' 'etc/R/repositories')
+options=('!makeflags')
+source=("http://cran.r-project.org/src/base/R-2/R-${pkgver}.tar.gz"
+ 'r.desktop'
+ 'r.png')
+install=r.install
+sha1sums=('0f46bf75a7c150350b1142c29a98e7994d2b4bef'
+ '13aa29219bcaa102e575de8c1c8e0833d233e836'
+ 'a69a07ec363440efc18ce0a7f2af103375dea978')
+
+build() {
+ cd "${srcdir}/R-${pkgver}"
+ sed -i 's|#define NeedFunctionPrototypes 0|#define NeedFunctionPrototypes 1|g' src/modules/X11/dataentry.c
+ ./configure --prefix=/usr \
+ --libdir=/usr/lib \
+ --sysconfdir=/etc/R \
+ --datarootdir=/usr/share \
+ rsharedir=/usr/share/R/ \
+ rincludedir=/usr/include/R/ \
+ rdocdir=/usr/share/doc/R/ \
+ --with-x \
+ --enable-R-shlib \
+ --with-lapack \
+ --with-blas \
+ F77=gfortran \
+ LIBnn=lib
+ make
+}
+
+package() {
+ cd "${srcdir}/R-${pkgver}"
+ make -j1 DESTDIR="${pkgdir}" install
+
+ # Fixup R wrapper scripts.
+ sed -i "s|${pkgdir} ||" "${pkgdir}/usr/bin/R"
+ rm "${pkgdir}/usr/lib/R/bin/R"
+ cd "${pkgdir}/usr/lib/R/bin"
+ ln -s ../../../bin/R
+
+ # install some freedesktop.org compatibility
+ install -Dm644 "${srcdir}/r.desktop" \
+ "${pkgdir}/usr/share/applications/r.desktop"
+ install -Dm644 "${srcdir}/r.png" \
+ "${pkgdir}/usr/share/pixmaps/r.png"
+
+ # move the config directory to /etc and create symlinks
+ install -d "${pkgdir}/etc/R"
+ cd "${pkgdir}/usr/lib/R/etc"
+ for i in *; do
+ mv -f ${i} "${pkgdir}/etc/R"
+ ln -s /etc/R/${i} ${i}
+ done
+}
diff --git a/staging/r/r.desktop b/staging/r/r.desktop
new file mode 100644
index 000000000..68b49c447
--- /dev/null
+++ b/staging/r/r.desktop
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=R
+GenericName=environment for statistical computing
+Comment=language and environment for statistical computing and graphics
+Exec=R
+Icon=/usr/share/pixmaps/r.png
+DocPath=/usr/lib/R/doc/html/index.html
+StartupNotify=true
+Terminal=true
+Type=Application
+Categories=Education;Science;Math;
diff --git a/staging/r/r.install b/staging/r/r.install
new file mode 100644
index 000000000..d3289ab64
--- /dev/null
+++ b/staging/r/r.install
@@ -0,0 +1,12 @@
+post_install() {
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}
+
diff --git a/staging/r/r.png b/staging/r/r.png
new file mode 100644
index 000000000..1303ccdb9
--- /dev/null
+++ b/staging/r/r.png
Binary files differ
diff --git a/staging/slim/PKGBUILD b/staging/slim/PKGBUILD
new file mode 100644
index 000000000..f7f5406c1
--- /dev/null
+++ b/staging/slim/PKGBUILD
@@ -0,0 +1,68 @@
+# $Id: PKGBUILD 147688 2012-01-27 02:04:48Z eric $
+# Maintainer: Gaetan Bisson <bisson@archlinux.org>
+# Contributor: Thayer Williams <thayer@archlinux.org>
+# Contributor: Alexander Fehr <pizzapunk gmail com>
+# Contributor: Hugo Ideler <hugoideler@dse.nl>
+
+pkgname=slim
+pkgver=1.3.2
+pkgrel=7
+pkgdesc='Desktop-independent graphical login manager for X11'
+arch=('i686' 'x86_64')
+url='http://slim.berlios.de/'
+license=('GPL2')
+depends=('pam' 'libxmu' 'libpng' 'libjpeg' 'libxft')
+backup=('etc/slim.conf' 'etc/logrotate.d/slim' 'etc/pam.d/slim')
+source=("http://download.berlios.de/${pkgname}/${pkgname}-${pkgver}.tar.gz"
+ 'rc.d'
+ 'pam.d'
+ 'logrotate'
+ 'ptr_pam.patch'
+ 'no-host.patch'
+ 'restart.patch'
+ 'sigterm.patch'
+ 'session-name.patch'
+ 'tty-slowness.patch'
+ 'slim-1.3.2-libpng15.patch')
+sha1sums=('e421d5487732c8317f8f591906661e014b036358'
+ '6fe0ba83509af634bce47be34e30995965bffc79'
+ 'a0e991ef0ac5120465a3be014a26e70ba073b6ae'
+ 'b969cc902c1d9915a5609141a652c77b2732407b'
+ '640668c984a13593a1bfba8d3b503c005d5f401e'
+ 'b86eddd083fb9f6259e46c735f55ebe76c655bd3'
+ '2d526bc0c498bf307ee50e2d22b4f53ffa0c4435'
+ '0b35048723c527fb824c5e0f9b9064f751871785'
+ 'fdd35562ce010babaeb793f92f9906fdcdaf3f9f'
+ '213fefe8533c845ea8c40585b6a8097820d5e5d2'
+ '3cd674e548f4e0aadbbd32a67b4efd1ed263afef')
+
+install=install
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ sed -i -e 's/png12/png15/g' Makefile
+ patch -p1 -i ../ptr_pam.patch # FS#23995: pointer mishandling confuses PAM
+ patch -p1 -i ../no-host.patch # cf patch: do not set PAM host
+ patch -p1 -i ../restart.patch # cf patch: restart X server if killed
+ patch -p1 -i ../sigterm.patch # FS#23984: do not wait for input when SIGTERM'd
+ patch -p1 -i ../session-name.patch # FS#26693: fix default session name
+ patch -p1 -i ../tty-slowness.patch # FS#18313: fix sluggish TTY after slim start
+ patch -p0 -i ../slim-1.3.2-libpng15.patch
+
+ make USE_PAM=1
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make DESTDIR="${pkgdir}" MANDIR=/usr/share/man install
+
+ install -D -m755 ../rc.d "${pkgdir}"/etc/rc.d/slim
+ install -D -m644 ../pam.d "${pkgdir}"/etc/pam.d/slim
+ install -D -m644 ../logrotate "${pkgdir}"/etc/logrotate.d/slim
+
+ # Provide sane defaults
+ sed -i 's|#xserver_arguments.*|xserver_arguments -nolisten tcp vt07|' "${pkgdir}"/etc/slim.conf
+ sed -i 's|/var/run/slim.lock|/var/lock/slim.lock|' "${pkgdir}"/etc/slim.conf
+}
diff --git a/staging/slim/install b/staging/slim/install
new file mode 100644
index 000000000..65aa77d72
--- /dev/null
+++ b/staging/slim/install
@@ -0,0 +1,7 @@
+post_install() {
+ cat <<EOF
+
+==> Add slim to the DAEMONS array in /etc/rc.conf or update /etc/inittab.
+
+EOF
+}
diff --git a/staging/slim/logrotate b/staging/slim/logrotate
new file mode 100644
index 000000000..26ec3b0f4
--- /dev/null
+++ b/staging/slim/logrotate
@@ -0,0 +1,9 @@
+/var/log/slim.log {
+ compress
+ rotate 1
+ size 1024k
+ notifempty
+ missingok
+ copytruncate
+ noolddir
+}
diff --git a/staging/slim/no-host.patch b/staging/slim/no-host.patch
new file mode 100644
index 000000000..c40f25bca
--- /dev/null
+++ b/staging/slim/no-host.patch
@@ -0,0 +1,29 @@
+Datum: Sun, 30 Jan 2011 12:49:00 +0200
+Von: Samuli Suominen <ssuominen@gentoo.org>
+An: jgc@archlinux.org, andyrtr@archlinux.org, thayer@archlinux.org
+Betreff: SLIM and ConsoleKit 0.4.2 (and up)
+
+People have been coming to #xfce after Arch's ConsoleKit 0.4.3 upgrade
+to ask for help why Suspend / Hibernate / and such doesn't work.
+
+It's because SLIM is using pam_ck_connector.so and SLIM sets Host to localhost
+and makes pam_ck_connector.so believe it's actually a *remote host* called
+localhost and will refuse access.
+
+http://bugs.gentoo.org/346037
+https://developer.berlios.de/bugs/?func=detailbug&bug_id=17757&group_id=2663
+http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-misc/slim/files/346037-stop_setting_host_for_pam_ck_connector_so.patch?view=log
+
+
+diff -aur old/app.cpp new/app.cpp
+--- old/app.cpp 2011-01-30 12:39:34.033337944 +0100
++++ new/app.cpp 2011-01-30 12:40:25.843337943 +0100
+@@ -228,8 +228,6 @@
+ pam.start("slim");
+ pam.set_item(PAM::Authenticator::TTY, DisplayName);
+ pam.set_item(PAM::Authenticator::Requestor, "root");
+- pam.set_item(PAM::Authenticator::Host, "localhost");
+-
+ }
+ catch(PAM::Exception& e){
+ cerr << APPNAME << ": " << e << endl;
diff --git a/staging/slim/pam.d b/staging/slim/pam.d
new file mode 100644
index 000000000..78a981f74
--- /dev/null
+++ b/staging/slim/pam.d
@@ -0,0 +1,10 @@
+#%PAM-1.0
+auth requisite pam_nologin.so
+auth required pam_env.so
+auth required pam_unix.so
+account required pam_unix.so
+password required pam_unix.so
+session required pam_limits.so
+session required pam_unix.so
+session optional pam_loginuid.so
+session optional pam_ck_connector.so
diff --git a/staging/slim/ptr_pam.patch b/staging/slim/ptr_pam.patch
new file mode 100644
index 000000000..3a3fbcdb7
--- /dev/null
+++ b/staging/slim/ptr_pam.patch
@@ -0,0 +1,52 @@
+diff -aur old/app.cpp new/app.cpp
+--- old/app.cpp 2010-07-08 07:04:10.000000000 +0200
++++ new/app.cpp 2011-05-01 18:30:52.933844872 +0200
+@@ -43,8 +43,8 @@
+ Panel* panel = *static_cast<Panel**>(appdata_ptr);
+ int result = PAM_SUCCESS;
+ for (int i=0; i<num_msg; i++){
+- resp[i]->resp=0;
+- resp[i]->resp_retcode=0;
++ (*resp)[i].resp=0;
++ (*resp)[i].resp_retcode=0;
+ switch(msg[i]->msg_style){
+ case PAM_PROMPT_ECHO_ON:
+ // We assume PAM is asking for the username
+@@ -53,13 +53,13 @@
+ case Panel::Suspend:
+ case Panel::Halt:
+ case Panel::Reboot:
+- resp[i]->resp=strdup("root");
++ (*resp)[i].resp=strdup("root");
+ break;
+
+ case Panel::Console:
+ case Panel::Exit:
+ case Panel::Login:
+- resp[i]->resp=strdup(panel->GetName().c_str());
++ (*resp)[i].resp=strdup(panel->GetName().c_str());
+ break;
+ }
+ break;
+@@ -75,7 +75,7 @@
+
+ default:
+ panel->EventHandler(Panel::Get_Passwd);
+- resp[i]->resp=strdup(panel->GetPasswd().c_str());
++ (*resp)[i].resp=strdup(panel->GetPasswd().c_str());
+ break;
+ }
+ break;
+@@ -91,9 +91,9 @@
+ }
+ if (result!=PAM_SUCCESS){
+ for (int i=0; i<num_msg; i++){
+- if (resp[i]->resp==0) continue;
+- free(resp[i]->resp);
+- resp[i]->resp=0;
++ if ((*resp)[i].resp==0) continue;
++ free((*resp)[i].resp);
++ (*resp)[i].resp=0;
+ };
+ free(*resp);
+ *resp=0;
diff --git a/staging/slim/rc.d b/staging/slim/rc.d
new file mode 100755
index 000000000..b0be7ffc5
--- /dev/null
+++ b/staging/slim/rc.d
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/bin/slim`
+case "$1" in
+ start)
+ stat_busy "Starting Simple Login Manager"
+ [ -z "$PID" ] && /usr/bin/slim -d &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon slim
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Simple Login Manager"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon slim
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 3
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/staging/slim/restart.patch b/staging/slim/restart.patch
new file mode 100644
index 000000000..4e5049000
--- /dev/null
+++ b/staging/slim/restart.patch
@@ -0,0 +1,144 @@
+http://developer.berlios.de/patch/?func=detailpatch&patch_id=2378&group_id=2663
+
+
+diff -aur slim-1.3.2.b/app.cpp slim-1.3.2.c/app.cpp
+--- slim-1.3.2.b/app.cpp 2010-08-21 15:10:48.579631179 +0200
++++ slim-1.3.2.c/app.cpp 2010-08-21 15:11:03.946389843 +0200
+@@ -104,6 +104,11 @@
+
+ extern App* LoginApp;
+
++int xioerror(Display *disp) {
++ LoginApp->RestartServer();
++ return 0;
++}
++
+ void CatchSignal(int sig) {
+ cerr << APPNAME << ": unexpected signal " << sig << endl;
+
+@@ -114,19 +119,6 @@
+ exit(ERR_EXIT);
+ }
+
+-
+-void AlarmSignal(int sig) {
+- int pid = LoginApp->GetServerPID();
+- if(waitpid(pid, NULL, WNOHANG) == pid) {
+- LoginApp->StopServer();
+- LoginApp->RemoveLock();
+- exit(OK_EXIT);
+- }
+- signal(sig, AlarmSignal);
+- alarm(2);
+-}
+-
+-
+ void User1Signal(int sig) {
+ signal(sig, User1Signal);
+ }
+@@ -277,7 +269,6 @@
+ signal(SIGHUP, CatchSignal);
+ signal(SIGPIPE, CatchSignal);
+ signal(SIGUSR1, User1Signal);
+- signal(SIGALRM, AlarmSignal);
+
+ #ifndef XNEST_DEBUG
+ if (!force_nodaemon && cfg->getOption("daemon") == "yes") {
+@@ -298,7 +289,6 @@
+
+ CreateServerAuth();
+ StartServer();
+- alarm(2);
+ #endif
+
+ }
+@@ -614,6 +604,8 @@
+ int status;
+ while (wpid != pid) {
+ wpid = wait(&status);
++ if (wpid == ServerPID)
++ xioerror(Dpy); // Server died, simulate IO error
+ }
+ if (WIFEXITED(status) && WEXITSTATUS(status)) {
+ LoginPanel->Message("Failed to execute login command");
+@@ -659,9 +651,6 @@
+
+
+ void App::Reboot() {
+- // Stop alarm clock
+- alarm(0);
+-
+ #ifdef USE_PAM
+ try{
+ pam.end();
+@@ -684,9 +673,6 @@
+
+
+ void App::Halt() {
+- // Stop alarm clock
+- alarm(0);
+-
+ #ifdef USE_PAM
+ try{
+ pam.end();
+@@ -772,6 +758,7 @@
+
+ StopServer();
+ RemoveLock();
++ while (waitpid(-1, NULL, WNOHANG) > 0); // Collects all dead childrens
+ Run();
+ }
+
+@@ -842,6 +829,7 @@
+
+ for(cycles = 0; cycles < ncycles; cycles++) {
+ if((Dpy = XOpenDisplay(DisplayName))) {
++ XSetIOErrorHandler(xioerror);
+ return 1;
+ } else {
+ if(!ServerTimeout(1, (char *) "X server to begin accepting connections"))
+@@ -926,9 +914,6 @@
+ ServerPID = -1;
+ break;
+ }
+- alarm(15);
+- pause();
+- alarm(0);
+
+ // Wait for server to start up
+ if(WaitForServer() == 0) {
+@@ -963,15 +948,12 @@
+
+
+ void App::StopServer() {
+- // Stop alars clock and ignore signals
+- alarm(0);
+ signal(SIGQUIT, SIG_IGN);
+ signal(SIGINT, SIG_IGN);
+ signal(SIGHUP, SIG_IGN);
+ signal(SIGPIPE, SIG_IGN);
+ signal(SIGTERM, SIG_DFL);
+ signal(SIGKILL, SIG_DFL);
+- signal(SIGALRM, SIG_DFL);
+
+ // Catch X error
+ XSetIOErrorHandler(IgnoreXIO);
+diff -aur slim-1.3.2.b/app.h slim-1.3.2.c/app.h
+--- slim-1.3.2.b/app.h 2010-08-21 15:10:40.499582804 +0200
++++ slim-1.3.2.c/app.h 2010-08-21 15:11:03.946389843 +0200
+@@ -34,6 +34,7 @@
+ ~App();
+ void Run();
+ int GetServerPID();
++ void RestartServer();
+ void StopServer();
+
+ bool serverStarted;
+@@ -49,7 +50,6 @@
+ void Console();
+ void Exit();
+ void KillAllClients(Bool top);
+- void RestartServer();
+ void ReadConfig();
+ void OpenLog();
+ void CloseLog();
diff --git a/staging/slim/session-name.patch b/staging/slim/session-name.patch
new file mode 100644
index 000000000..8211c4f72
--- /dev/null
+++ b/staging/slim/session-name.patch
@@ -0,0 +1,21 @@
+diff -Naur slim-1.3.2.old/panel.cpp slim-1.3.2.new/panel.cpp
+--- slim-1.3.2.old/panel.cpp 2010-10-24 06:01:15.117000019 +0000
++++ slim-1.3.2.new/panel.cpp 2010-10-24 17:26:30.987999967 +0000
+@@ -23,7 +23,7 @@
+ Root = root;
+ cfg = config;
+
+- session = "";
++ session = cfg->nextSession(session);
+
+ // Init GC
+ XGCValues gcv;
+@@ -188,7 +188,7 @@
+ }
+
+ void Panel::ClearPanel() {
+- session = "";
++ session = cfg->nextSession(session);
+ Reset();
+ XClearWindow(Dpy, Root);
+ XClearWindow(Dpy, Win);
diff --git a/staging/slim/sigterm.patch b/staging/slim/sigterm.patch
new file mode 100644
index 000000000..fbaeb7116
--- /dev/null
+++ b/staging/slim/sigterm.patch
@@ -0,0 +1,45 @@
+diff -aur old/panel.cpp new/panel.cpp
+--- old/panel.cpp 2011-04-29 15:15:57.210134850 +0200
++++ new/panel.cpp 2011-04-29 15:16:17.260285407 +0200
+@@ -10,6 +10,7 @@
+ */
+
+ #include <sstream>
++#include <poll.h>
+ #include "panel.h"
+
+ using namespace std;
+@@ -288,16 +289,24 @@
+ field=curfield;
+ bool loop = true;
+ OnExpose();
++
++ struct pollfd x11_pfd = {0};
++ x11_pfd.fd = ConnectionNumber(Dpy);
++ x11_pfd.events = POLLIN;
+ while(loop) {
+- XNextEvent(Dpy, &event);
+- switch(event.type) {
+- case Expose:
+- OnExpose();
+- break;
+-
+- case KeyPress:
+- loop=OnKeyPress(event);
+- break;
++ if(XPending(Dpy) || poll(&x11_pfd, 1, -1) > 0) {
++ while(XPending(Dpy)) {
++ XNextEvent(Dpy, &event);
++ switch(event.type) {
++ case Expose:
++ OnExpose();
++ break;
++
++ case KeyPress:
++ loop=OnKeyPress(event);
++ break;
++ }
++ }
+ }
+ }
+
diff --git a/staging/slim/slim-1.3.2-libpng15.patch b/staging/slim/slim-1.3.2-libpng15.patch
new file mode 100644
index 000000000..720608567
--- /dev/null
+++ b/staging/slim/slim-1.3.2-libpng15.patch
@@ -0,0 +1,11 @@
+--- png.c
++++ png.c
+@@ -57,7 +57,7 @@
+ return(0);
+ }
+
+- if (setjmp(png_ptr->jmpbuf))
++ if (setjmp(png_jmpbuf(png_ptr)))
+ {
+ png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp) NULL);
+ fclose(infile);
diff --git a/staging/slim/tty-slowness.patch b/staging/slim/tty-slowness.patch
new file mode 100644
index 000000000..c590fbed8
--- /dev/null
+++ b/staging/slim/tty-slowness.patch
@@ -0,0 +1,30 @@
+diff -aur slim-1.3.2.a/app.cpp slim-1.3.2.b/app.cpp
+--- slim-1.3.2.a/app.cpp 2010-08-21 15:10:13.702755711 +0200
++++ slim-1.3.2.b/app.cpp 2010-08-21 15:10:48.579631179 +0200
+@@ -280,21 +280,22 @@
+ signal(SIGALRM, AlarmSignal);
+
+ #ifndef XNEST_DEBUG
+- OpenLog();
+-
+ if (!force_nodaemon && cfg->getOption("daemon") == "yes") {
+ daemonmode = true;
+ }
+
+ // Daemonize
+ if (daemonmode) {
+- if (daemon(0, 1) == -1) {
++ if (daemon(0, 0) == -1) {
+ cerr << APPNAME << ": " << strerror(errno) << endl;
+ exit(ERR_EXIT);
+ }
+- UpdatePid();
+ }
+
++ OpenLog();
++
++ if (daemonmode) UpdatePid();
++
+ CreateServerAuth();
+ StartServer();
+ alarm(2);