diff -Nur old/kmail/headerstyle.cpp new/kmail/headerstyle.cpp
--- old/kmail/headerstyle.cpp	Thu Nov 11 01:03:14 2004
+++ new/kmail/headerstyle.cpp	Sat Nov 13 00:39:24 2004
@@ -40,6 +40,7 @@
 #include "kmmessage.h"
 #include "kmkernel.h"
 
+#include <libkdepim/kxface.h>
 #include <libemailfunctions/email.h>
 
 #include <mimelib/string.h>
@@ -55,10 +56,13 @@
 #include <kmdcodec.h>
 #include <qdatetime.h>
 #include <qbuffer.h>
+#include <qbitmap.h>
 #include <qimage.h>
 #include <qapplication.h>
 #include <qregexp.h>
 
+using namespace KPIM;
+
 namespace KMail {
 
   //
@@ -253,6 +257,17 @@
 			   strToHtml(message->subject()) + "</b></div>\n")
                         .arg(subjectDir);
 
+    // add a X-Face if the Header is present
+    QString xfhead = message->headerField( "X-Face" );
+    QString xface;
+    if ( !xfhead.isEmpty() )
+    {
+      KXFace xf;
+      xface = QString::fromLatin1( "<img style=\"border:1px solid #000000; float:right;\" src=\"%1\">" )
+          .arg( imgToDataUrl( xf.uncomp(xfhead).convertToImage() ) );
+      headerStr.append( xface );
+    }
+
     if ( strategy->showHeader( "date" ) )
       headerStr.append(i18n("Date: ") + strToHtml(dateString)+"<br>\n");
 
@@ -340,7 +355,6 @@
 
     QString format( const KMMessage * message, const HeaderStrategy * strategy,
             const QString & vCardName, bool printing ) const;
-    static QString imgToDataUrl( const QImage &image );
 
   };
 
@@ -382,6 +396,16 @@
       dateString = message->dateStr();
     }
 
+    // add a X-Face if the Header is present
+    QString xfhead = message->headerField("X-Face");
+    QString xface;
+    if (!xfhead.isEmpty())
+    {
+      KXFace xf;
+      xface = QString::fromLatin1("<img style=\"border:1px solid #000000\" src=\"%1\">")
+                         .arg( imgToDataUrl( xf.uncomp(xfhead).convertToImage() ) );
+    }
+
     QString userHTML;
     QString presence;
 
@@ -546,21 +570,12 @@
                                     .arg(onlineStatus));
     */
     headerStr.append(
-          QString("</table></td><td align=\"center\">%1</td></tr></table>\n").arg(userHTML)
-                     );
+          QString( "</table></td><td align=\"center\">%1%2</td></tr></table>\n").arg(xface).arg(userHTML) );
 
     headerStr += "</div>\n\n";
     return headerStr;
   }
 
-QString FancyHeaderStyle::imgToDataUrl( const QImage &image )
-{
-  QByteArray ba;
-  QBuffer buffer( ba );
-  buffer.open( IO_WriteOnly );
-  image.save( &buffer, "PNG" );
-  return QString::fromLatin1("data:image/png;base64,%1").arg( KCodecs::base64Encode( ba ) );
-}
   //
   // HeaderStyle abstract base:
   //
@@ -614,6 +629,15 @@
     if ( !fancyStyle )
       fancyStyle = new FancyHeaderStyle();
     return fancyStyle;
+  }
+
+  QString HeaderStyle::imgToDataUrl( const QImage &image )
+  {
+    QByteArray ba;
+    QBuffer buffer( ba );
+    buffer.open( IO_WriteOnly );
+    image.save( &buffer, "PNG" );
+    return QString::fromLatin1("data:image/png;base64,%1").arg( KCodecs::base64Encode( ba ) );
   }
 
 } // namespace KMail
diff -Nur old/kmail/headerstyle.h new/kmail/headerstyle.h
--- old/kmail/headerstyle.h	Thu Nov 11 01:03:17 2004
+++ new/kmail/headerstyle.h	Thu Nov 11 23:40:27 2004
@@ -33,6 +33,7 @@
 #define __KMAIL_HEADERSTYLE_H__
 
 class QString;
+class QImage;
 class KMMessage;
 
 namespace KMail {
@@ -80,6 +81,8 @@
 			    const KMail::HeaderStrategy * strategy,
 			    const QString & vCardName,
 			    bool printing=false ) const = 0;
+
+    static QString imgToDataUrl( const QImage &image );
   };
 
 } // namespace KMail
diff -Nur old/kmail/identitydialog.cpp new/kmail/identitydialog.cpp
--- old/kmail/identitydialog.cpp	Thu Nov 11 01:02:47 2004
+++ new/kmail/identitydialog.cpp	Fri Nov 12 21:50:43 2004
@@ -37,6 +37,7 @@
 
 // other KMail headers:
 #include "signatureconfigurator.h"
+#include "xfaceconfigurator.h"
 #include "kmfoldercombobox.h"
 #include "kmfoldermgr.h"
 #include "transportmanager.h"
@@ -360,6 +361,10 @@
     mSignatureConfigurator->layout()->setMargin( KDialog::marginHint() );
     tabWidget->addTab( mSignatureConfigurator, i18n("&Signature") );
 
+    mXFaceConfigurator = new XFaceConfigurator( tabWidget );
+    mXFaceConfigurator->layout()->setMargin( KDialog::marginHint() );
+    tabWidget->addTab( mXFaceConfigurator, i18n("&X-Face") );
+
     KConfigGroup geometry( KMKernel::config(), "Geometry" );
     if ( geometry.hasKey( "Identity Dialog size" ) )
       resize( geometry.readSizeEntry( "Identity Dialog size" ) );
@@ -522,6 +527,8 @@
 
     // "Signature" tab:
     mSignatureConfigurator->setSignature( ident.signature() );
+    mXFaceConfigurator->setXFace( ident.xface() );
+    mXFaceConfigurator->setXFaceEnabled( ident.isXFaceEnabled() );
   }
 
   void IdentityDialog::updateIdentity( KPIM::Identity & ident ) {
@@ -564,6 +571,8 @@
                      mDraftsCombo->getFolder()->idString() : QString::null );
     // "Signature" tab:
     ident.setSignature( mSignatureConfigurator->signature() );
+    ident.setXFace( mXFaceConfigurator->xface() );
+    ident.setXFaceEnabled( mXFaceConfigurator->isXFaceEnabled() );
   }
 
   void IdentityDialog::slotUpdateTransportCombo( const QStringList & sl ) {
diff -Nur old/kmail/identitydialog.h new/kmail/identitydialog.h
--- old/kmail/identitydialog.h	Thu Nov 11 01:02:50 2004
+++ new/kmail/identitydialog.h	Wed Sep  8 01:59:28 2004
@@ -50,6 +50,7 @@
 }
 namespace KMail {
   class SignatureConfigurator;
+  class XFaceConfigurator;
   class DictionaryComboBox;
 }
 
@@ -98,6 +99,8 @@
     QComboBox                    *mTransportCombo; // should be a KMTransportCombo...
     // "signature" tab:
     KMail::SignatureConfigurator *mSignatureConfigurator;
+    // "X-Face" tab:
+    KMail::XFaceConfigurator *mXFaceConfigurator;
   };
 
 } // namespace KMail
diff -Nur old/kmail/kmcomposewin.cpp new/kmail/kmcomposewin.cpp
--- old/kmail/kmcomposewin.cpp	Fri Nov 12 21:11:14 2004
+++ new/kmail/kmcomposewin.cpp	Fri Nov 12 21:22:17 2004
@@ -1412,6 +1412,11 @@
   // check for presence of a priority header, indicating urgent mail:
   mUrgentAction->setChecked( newMsg->isUrgent() );
 
+  if (!ident.isXFaceEnabled() || ident.xface().isEmpty())
+    mMsg->removeHeaderField("X-Face");
+  else
+    mMsg->setHeaderField("X-Face", ident.xface());
+
   // enable/disable encryption if the message was/wasn't encrypted
   switch ( mMsg->encryptionState() ) {
     case KMMsgFullyEncrypted: // fall through
@@ -3476,6 +3481,11 @@
     mMsg->removeHeaderField("Organization");
   else
     mMsg->setHeaderField("Organization", ident.organization());
+
+  if (!ident.isXFaceEnabled() || ident.xface().isEmpty())
+    mMsg->removeHeaderField("X-Face");
+  else
+    mMsg->setHeaderField("X-Face", ident.xface());
 
   if ( !mBtnTransport->isChecked() ) {
     QString transp = ident.transport();
diff -Nur old/kmail/xfaceconfigurator.cpp new/kmail/xfaceconfigurator.cpp
--- old/kmail/xfaceconfigurator.cpp	Thu Jan  1 01:00:00 1970
+++ new/kmail/xfaceconfigurator.cpp	Tue Nov  2 18:53:23 2004
@@ -0,0 +1,127 @@
+/*  -*- c++ -*-
+    xfaceconfigurator.cpp
+
+    KMail, the KDE mail client.
+    Copyright (c) 2004 Jakob Schröter <js@camaya.net>
+    Copyright (c) 2002 the KMail authors.
+    See file AUTHORS for details
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License,
+    version 2.0, as published by the Free Software Foundation.
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software Foundation,
+    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
+*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "xfaceconfigurator.h"
+#include "kxface.h"
+
+#include <klocale.h>
+#include <kdialog.h>
+#include <kglobalsettings.h>
+#include <kactivelabel.h>
+#include <kurl.h>
+#include <kmessagebox.h>
+
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qcheckbox.h>
+#include <qwhatsthis.h>
+#include <qbitmap.h>
+
+#include <assert.h>
+
+using namespace KMail;
+using namespace KPIM;
+
+namespace KMail {
+
+  XFaceConfigurator::XFaceConfigurator( QWidget * parent, const char * name )
+    : QWidget( parent, name )
+  {
+    // tmp. vars:
+    QLabel * label1;
+    KActiveLabel * label2;
+    QVBoxLayout * vlay;
+    QHBoxLayout * hlay;
+
+    vlay = new QVBoxLayout( this, 0, KDialog::spacingHint(), "main layout" );
+    hlay = new QHBoxLayout( vlay );
+
+    // "enable X-Face" checkbox:
+    mEnableCheck = new QCheckBox( i18n("&Enable X-Face header"), this );
+    QWhatsThis::add(mEnableCheck, 
+        i18n("Check this box if you want KMail to add a X-Face header to mails "
+             "written with this identity. A X-Face is a small (48x48 pixels) black and "
+             "white image."));
+    hlay->addWidget( mEnableCheck, Qt::AlignLeft | Qt::AlignVCenter );
+    
+    mXFaceLabel = new QLabel( this );
+    QWhatsThis::add(mXFaceLabel, 
+        i18n("This is a preview of the X-Face entered in the text box below."));
+    mXFaceLabel->setFixedSize(48, 48);
+    hlay->addWidget( mXFaceLabel );
+
+    label1 = new QLabel( "X-Face:", this );
+    vlay->addWidget( label1 );
+    
+    mTextEdit = new QTextEdit( this );
+    QWhatsThis::add(mTextEdit, 
+        i18n("Use this field to enter an X-Face header."));
+    mTextEdit->setFont( KGlobalSettings::fixedFont() );
+    mTextEdit->setWordWrap( QTextEdit::NoWrap );
+    mTextEdit->setTextFormat( Qt::PlainText );
+    vlay->addWidget( mTextEdit );
+    
+    label2 = new KActiveLabel( i18n("Get example X-Faces at <a href=\"http://www.xs4all.nl/~ace/X-Faces/\">http://www.xs4all.nl/~ace/X-Faces/</a><br>or create your own at <a href=\"http://www.dairiki.org/xface/\">http://www.dairiki.org/xface/</a>"), this );
+    vlay->addWidget( label2 );
+    
+    connect(mTextEdit, SIGNAL(textChanged()), this, SLOT(slotUpdateXFace()));
+  }
+
+  XFaceConfigurator::~XFaceConfigurator() {
+
+  }
+
+  bool XFaceConfigurator::isXFaceEnabled() const {
+    return mEnableCheck->isChecked();
+  }
+
+  void XFaceConfigurator::setXFaceEnabled( bool enable ) {
+    mEnableCheck->setChecked( enable );
+  }
+
+  QString XFaceConfigurator::xface() const {
+    return mTextEdit->text();
+  }
+
+  void XFaceConfigurator::setXFace( const QString & text ) {
+    mTextEdit->setText( text );
+  }
+  
+  void XFaceConfigurator::slotUpdateXFace()
+  {
+    QString str = mTextEdit->text();
+    if (!str.isEmpty())
+    {
+      if ( str.startsWith("x-face:", false) )
+      {
+        str = str.remove("x-face:", false);
+        mTextEdit->setText(str);
+      }
+      KXFace xf;
+      mXFaceLabel->setPixmap( xf.uncomp(str) );
+    }
+    else
+      mXFaceLabel->setPixmap( 0L );
+  }
+  
+} // namespace KMail
+
+#include "xfaceconfigurator.moc"
diff -Nur old/kmail/xfaceconfigurator.h new/kmail/xfaceconfigurator.h
--- old/kmail/xfaceconfigurator.h	Thu Jan  1 01:00:00 1970
+++ new/kmail/xfaceconfigurator.h	Wed Sep  8 01:59:28 2004
@@ -0,0 +1,54 @@
+/*  -*- c++ -*-
+    xfaceconfigurator.cpp
+
+    KMail, the KDE mail client.
+    Copyright (c) 2004 Jakob Schröter <js@camaya.net>
+    Copyright (c) 2002 the KMail authors.
+    See file AUTHORS for details
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License,
+    version 2.0, as published by the Free Software Foundation.
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software Foundation,
+    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
+*/
+
+#ifndef __KMAIL_XFACECONFIGURATOR_H__
+#define __KMAIL_XFACECONFIGURATOR_H__
+
+#include <qwidget.h>
+#include <qtextedit.h>
+
+class QCheckBox;
+class QString;
+class QLabel;
+
+namespace KMail {
+
+  class XFaceConfigurator : public QWidget {
+    Q_OBJECT
+  public:
+    XFaceConfigurator( QWidget * parent=0, const char * name=0 );
+    virtual ~XFaceConfigurator();
+
+    bool isXFaceEnabled() const;
+    void setXFaceEnabled( bool enable );
+
+
+    QString xface() const;
+    void setXFace( const QString & text );
+
+  protected:
+    QCheckBox     * mEnableCheck;
+    QTextEdit     * mTextEdit;
+    QLabel        * mXFaceLabel;
+    
+  private slots:
+    void slotUpdateXFace();
+  };
+} // namespace KMail
+
+#endif // __KMAIL_XFACECONFIGURATOR_H__
+
+
diff -Nur old/knode/knarticlewidget.cpp new/knode/knarticlewidget.cpp
--- old/knode/knarticlewidget.cpp	Fri Nov 12 21:52:04 2004
+++ new/knode/knarticlewidget.cpp	Sat Nov 13 00:00:50 2004
@@ -25,6 +25,8 @@
 #include <qpainter.h>
 #include <qtimer.h>
 #include <qurl.h>
+#include <qbuffer.h>
+#include <qbitmap.h>
 
 #include <kprinter.h>
 #include <kiconloader.h>
@@ -40,6 +42,8 @@
 #include <kpgpblock.h>
 #include <kstringhandler.h>
 
+#include <libkdepim/kxface.h>
+
 #include "resource.h"
 #include "knarticlewidget.h"
 #include "knglobals.h"
@@ -58,6 +62,7 @@
 #include <kstandarddirs.h>
 #include <kbookmarkmanager.h>
 #include <kaddrbook.h>
+#include <ktempfile.h>
 
 #define PUP_OPEN    1000
 #define PUP_SAVE    2000
@@ -222,6 +227,10 @@
   r_ot13=false;
   a_ctToggleRot13->setChecked(false);
   applyConfig();
+
+  t_mpFile = new KTempFile(locateLocal("tmp", "knode"), ".png");
+  t_mpFile->close();
+  t_mpFile->setAutoDelete(true);
 }
 
 
@@ -242,6 +251,7 @@
   delete t_imer;
   delete f_inddialog;
   delete u_mailtoPopup;
+  delete t_mpFile;
 }
 
 void KNArticleWidget::setText( const QString& text, const QString& context )
@@ -1073,6 +1083,22 @@
 
   QString headerHtml;
   int headerLines=0;
+  int headerCols=3;
+
+  QString xfhead;
+  KMime::Headers::Base *temp = a_rticle->getHeaderByType("X-Face");
+  if (temp)
+    xfhead = temp->asUnicodeString();
+  QString xface = "";
+  if ( !xfhead.isEmpty() )
+  {
+    KPIM::KXFace xf;
+    xf.uncomp(xfhead).convertToImage().save(t_mpFile->name(), "PNG");
+    xface = QString::fromLatin1(
+        "<td rowspan=\"4\" width=\"48\" height=\"48\"><img border=\"1\" src=\"%1\"></td>")
+        .arg(t_mpFile->name());
+    ++headerCols;
+  }
 
   if(a_ctToggleFullHdrs->isChecked()) {
     QCString head = a_rticle->head();
@@ -1083,9 +1109,11 @@
       if (header) {
         if (headerLines > 0)
           headerHtml += "<tr>";
-        headerHtml+=QString("<td align=right><articlefont><b>%1</b></articlefont></td><td width=\"100%\"><articlefont>%2</articlefont></td></tr>")
+        headerHtml+=QString("<td align=right><articlefont><b>%1</b></articlefont></td><td width=\"100%\"><articlefont>%2</articlefont></td>%3</tr>")
                       .arg(toHtmlString(header->type())+":")
-                      .arg(toHtmlString(header->asUnicodeString(),true, false, false, true));
+                      .arg(toHtmlString(header->asUnicodeString(),true, false, false, true))
+                      .arg(xface);
+        xface = "";
         delete header;
         headerLines++;
       }
@@ -1122,7 +1150,8 @@
       } else
         headerHtml+=toHtmlString(hb->asUnicodeString(),true, false, false, true);
 
-      headerHtml += dh->headerCloseTag()+"</articlefont></td></tr>";
+      headerHtml += dh->headerCloseTag()+"</articlefont></td>"+xface+"</tr>";
+      xface = "";
       headerLines++;
     }
   }
@@ -1135,8 +1164,8 @@
     if (headerLines > 0) {
       html+=QString("<tr><td width=\"40\" bgcolor=\"%1\" rowspan=\"%2\"></td>"+headerHtml)
            .arg(app->headerDecoHexcode()).arg(headerLines);
-      html+=QString("<tr><td colspan=\"3\" bgcolor=\"%1\"><articlefont>")
-            .arg(app->headerDecoHexcode());
+      html+=QString("<tr><td colspan=\"%1\" bgcolor=\"%2\"><articlefont>")
+          .arg(headerCols).arg(app->headerDecoHexcode());
     } else {
       html+=QString("<tr><td bgcolor=\"%1\"><articlefont>")
           .arg(app->headerDecoHexcode());
diff -Nur old/knode/knarticlewidget.h new/knode/knarticlewidget.h
--- old/knode/knarticlewidget.h	Thu Nov 11 01:07:09 2004
+++ new/knode/knarticlewidget.h	Fri Nov 12 23:21:40 2004
@@ -30,6 +30,7 @@
 class KToggleAction;
 class KSelectAction;
 class KPopupMenu;
+class KTempFile;
 
 class KNArticle;
 class KNArticleCollection;
@@ -208,6 +209,9 @@
   protected:
     static QPtrList<KNArticleWidget> *i_nstances;
     static QPtrList<KNArticleWidget> *instances();
+
+  private:
+    KTempFile *t_mpFile;
 
 };
 
diff -Nur old/libkdepim/Makefile.am new/libkdepim/Makefile.am
--- old/libkdepim/Makefile.am	Thu Nov 11 01:07:43 2004
+++ new/libkdepim/Makefile.am	Thu Nov 11 01:19:47 2004
@@ -1,6 +1,6 @@
 SUBDIRS = cfgc interfaces tests pics
 
-INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/libkdepim \
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/libkdepim -I$(top_srcdir)/libkmime \
            $(all_includes)
 
 lib_LTLIBRARIES   = libkdepim.la
@@ -25,7 +25,7 @@
   resourceabc.cpp diffalgo.cpp addresseediffalgo.cpp calendardiffalgo.cpp \
   htmldiffalgodisplay.cpp broadcaststatus.cpp kresourceprefs.cpp \
   kpixmapregionselectorwidget.cpp kpixmapregionselectordialog.cpp \
-  kabcresourcecached.cpp \
+  kabcresourcecached.cpp kxface.cpp \
   kaccount.cpp kaddrbook.cpp kfoldertree.cpp kregexp3.cpp \
   kscoring.cpp kscoringeditor.cpp ksubscription.cpp kwidgetlister.cpp \
   linklocator.cpp qutf7codec.cpp \
@@ -45,7 +45,8 @@
 
 libkdepim_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 1:0:0
 libkdepim_la_LIBADD  = $(LIB_KIO) $(LIB_KABC) $(LIB_KPARTS) $(LIB_KIMPROXY) \
-  $(top_builddir)/libkcal/libkcal.la $(LIB_POLL) -lqui
+  $(top_builddir)/libkcal/libkcal.la $(LIB_POLL) -lqui \
+  $(top_builddir)/libkmime/libkmime.la
 #               $top_builddir)/libkdepim/resources/libkpimresources.la
 
 
diff -Nur old/libkdepim/kxface.cpp new/libkdepim/kxface.cpp
--- old/libkdepim/kxface.cpp	Thu Jan  1 01:00:00 1970
+++ new/libkdepim/kxface.cpp	Fri Nov 12 21:35:16 2004
@@ -0,0 +1,798 @@
+/*
+  This file is part of libkdepim.
+
+  Original compface:
+  Copyright (c) James Ashton - Sydney University - June 1990.
+
+  Additions for KDE:
+  Copyright (c) 2004 Jakob Schröter <js@camaya.net>
+
+  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; see the file COPYING.LIB.  If not, write to
+  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+  Boston, MA 02111-1307, USA.
+*/
+
+#include "kxface.h"
+
+#include <kdebug.h>
+
+#include <qpixmap.h>
+#include <qbitmap.h>
+#include <qstring.h>
+#include <qpainter.h>
+
+#include <stdlib.h>
+#include <string.h>
+
+using namespace KPIM;
+
+KXFace::KXFace()
+{
+  NumProbs = 0;
+  compface_xbitmap = 0;
+}
+
+KXFace::~KXFace()
+{
+}
+
+QBitmap KXFace::toPixmap(QString ikon)
+{
+  QBitmap b(48, 48, true);
+  QPainter p(&b);
+  p.setPen( Qt::color1 );
+
+  ikon = ikon.remove("0x", true);
+  ikon = ikon.remove(",", true);
+  ikon = ikon.remove("\n", true);
+  ikon = ikon.remove(" ", true);
+  
+  QString tmp = "";
+  uint i = 0;
+  int pos = 0;
+  for(i=0;i<ikon.length();i++)
+  {
+    tmp = ikon.mid(i, 1);
+    if(tmp == "0")
+      pos += 4;
+    else if (tmp == "1")
+    {
+      pos += 3;
+      p.drawPoint(x(pos), y(pos)); pos++;
+    }
+    else if (tmp == "2")
+    {
+      pos += 2;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      pos++;
+    }
+    else if (tmp == "3")
+    {
+      pos += 2;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+    }
+    else if (tmp == "4")
+    {
+      pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      pos += 2;
+    }
+    else if (tmp == "5")
+    {
+      pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+    }
+    else if (tmp == "6")
+    {
+      pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      pos++;
+    }
+    else if (tmp == "7")
+    {
+      pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+    }
+    else if (tmp == "8")
+    {
+      p.drawPoint(x(pos), y(pos)); pos++;
+      pos += 3;
+    }
+    else if (tmp == "9")
+    {
+      p.drawPoint(x(pos), y(pos)); pos++;
+      pos += 2;
+      p.drawPoint(x(pos), y(pos)); pos++;
+    }
+    else if (tmp == "a" || tmp == "A")
+    {
+      p.drawPoint(x(pos), y(pos)); pos++;
+      pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      pos++;
+    }
+    else if (tmp == "b" || tmp == "B")
+    {
+      p.drawPoint(x(pos), y(pos)); pos++;
+      pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+    }
+    else if (tmp == "c" || tmp == "C")
+    {
+      p.drawPoint(x(pos), y(pos)); pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      pos += 2;
+    }
+    else if (tmp == "d" || tmp == "D")
+    {
+      p.drawPoint(x(pos), y(pos)); pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+    }
+    else if (tmp == "e" || tmp == "E")
+    {
+      p.drawPoint(x(pos), y(pos)); pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      pos++;
+    }
+    else if (tmp == "f" || tmp == "F")
+    {
+      p.drawPoint(x(pos), y(pos)); pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+      p.drawPoint(x(pos), y(pos)); pos++;
+    }
+  }
+  p.end();
+  b.setMask(b);
+  //b.save("test.png", "PNG");
+  return b;
+}
+
+
+QString KXFace::comp(const QString str)
+{
+  char *fbuf = (char *)malloc(MAX_XFACE_LENGTH);
+  memset(fbuf, '\0', MAX_XFACE_LENGTH);
+  strncpy(fbuf, str.latin1(), str.length());
+//  printf("%s\n", fbuf);
+  compface(fbuf);
+//  printf("%s\n", fbuf);
+  QString ret(fbuf);
+  free(fbuf);
+  return ret;
+}
+
+
+QBitmap KXFace::uncomp(const QString str)
+{
+  if (str.length() > MAX_XFACE_LENGTH)
+    return QBitmap();
+  
+  char *fbuf = (char *)malloc(MAX_XFACE_LENGTH);
+  memset(fbuf, '\0', MAX_XFACE_LENGTH);
+  strncpy(fbuf, str.latin1(), str.length());
+//  printf("%s\n", fbuf);
+  uncompface(fbuf);
+//  printf("%s\n", fbuf);
+  QString ret(fbuf);
+  free(fbuf);
+  return toPixmap(ret);
+}
+
+int KXFace::x(int &pos)
+{
+  return pos%48;
+}
+
+int KXFace::y(int &pos)
+{
+  return pos/48;
+}
+
+int KXFace::uncompface(char *fbuf)
+{
+	if (!(status = setjmp(comp_env)))
+	{
+		UnCompAll(fbuf);/* compress otherwise */
+		UnGenFace();
+		WriteFace(fbuf);
+	}
+	return status;
+}
+
+int KXFace::compface(char *fbuf)
+{
+	if (!(status = setjmp(comp_env)))
+	{
+		ReadFace(fbuf);
+		GenFace();
+		CompAll(fbuf);
+	}
+	return status;
+}
+
+void KXFace::RevPush(const Prob *p)
+{
+	if (NumProbs >= PIXELS * 2 - 1)
+		longjmp(comp_env, ERR_INTERNAL);
+	ProbBuf[NumProbs++] = (Prob *) p;
+}
+ 
+void KXFace::BigPush(Prob *p)
+{
+	static WORD tmp;
+
+	BigDiv(p->p_range, &tmp);
+	BigMul(0);
+	BigAdd(tmp + p->p_offset);
+}
+
+int KXFace::BigPop(register const Prob *p)
+{
+	static WORD tmp;
+	register int i;
+
+	BigDiv(0, &tmp);
+	i = 0;
+	while ((tmp < p->p_offset) || (tmp >= p->p_range + p->p_offset))
+	{
+		p++;
+		i++;
+	}
+	BigMul(p->p_range);
+	BigAdd(tmp - p->p_offset);
+	return i;
+}
+
+
+/* Divide B by a storing the result in B and the remainder in the word
+ * pointer to by r
+ */
+void KXFace::BigDiv(register WORD a, register WORD *r)
+{
+	register int i;
+	register WORD *w;
+	register COMP c, d;
+
+	a &= WORDMASK;
+	if ((a == 1) || (B.b_words == 0))
+	{
+		*r = 0;
+		return;
+	}
+	if (a == 0)	/* treat this as a == WORDCARRY */
+	{			/* and just shift everything right a WORD */
+		i = --B.b_words;
+		w = B.b_word;
+		*r = *w;
+		while (i--)
+		{
+			*w = *(w + 1);
+			w++;
+		}
+		*w = 0;
+		return;
+	}
+	w = B.b_word + (i = B.b_words);
+	c = 0;
+	while (i--)
+	{
+		c <<= BITSPERWORD;
+		c += (COMP)*--w;
+		d = c / (COMP)a;
+		c = c % (COMP)a;
+		*w = (WORD)(d & WORDMASK);
+	}
+	*r = c;
+	if (B.b_word[B.b_words - 1] == 0)
+		B.b_words--;
+}
+
+/* Multiply a by B storing the result in B
+ */
+void KXFace::BigMul(register WORD a)
+{
+	register int i;
+	register WORD *w;
+	register COMP c;
+
+	a &= WORDMASK;
+	if ((a == 1) || (B.b_words == 0))
+		return;
+	if (a == 0)	/* treat this as a == WORDCARRY */
+	{			/* and just shift everything left a WORD */
+		if ((i = B.b_words++) >= MAXWORDS - 1)
+			longjmp(comp_env, ERR_INTERNAL);
+		w = B.b_word + i;
+		while (i--)
+		{
+			*w = *(w - 1);
+			w--;
+		}
+		*w = 0;
+		return;
+	}
+	i = B.b_words;
+	w = B.b_word;
+	c = 0;
+	while (i--)
+	{
+		c += (COMP)*w * (COMP)a;
+		*(w++) = (WORD)(c & WORDMASK);
+		c >>= BITSPERWORD;
+	}
+	if (c)
+	{
+		if (B.b_words++ >= MAXWORDS)
+			longjmp(comp_env, ERR_INTERNAL);
+		*w = (COMP)(c & WORDMASK);
+	}
+}
+
+/* Add to a to B storing the result in B
+ */
+void KXFace::BigAdd(WORD a)
+{
+	register int i;
+	register WORD *w;
+	register COMP c;
+
+	a &= WORDMASK;
+	if (a == 0)
+		return;
+	i = 0;
+	w = B.b_word;
+	c = a;
+	while ((i < B.b_words) && c)
+	{
+		c += (COMP)*w;
+		*w++ = (WORD)(c & WORDMASK);
+		c >>= BITSPERWORD;
+		i++;
+	}
+	if ((i == B.b_words) && c)
+	{
+		if (B.b_words++ >= MAXWORDS)
+			longjmp(comp_env, ERR_INTERNAL);
+		*w = (COMP)(c & WORDMASK);
+	}
+}
+
+void KXFace::BigClear()
+{
+	B.b_words = 0;
+}
+
+void KXFace::WriteFace(char *fbuf)
+{
+	register char *s, *t;
+	register int i, bits, digits, words;
+	int digsperword = DIGSPERWORD;
+	int wordsperline = WORDSPERLINE;
+
+	s = F;
+	t = fbuf;
+	bits = digits = words = i = 0;
+	if (compface_xbitmap) {
+		sprintf(t,"#define noname_width 48\n#define noname_height 48\nstatic char noname_bits[] = {\n ");
+		while (*t) t++;
+		digsperword = 2;
+		wordsperline = 15;
+	}
+	while (s < F + PIXELS)
+	{
+		if ((bits == 0) && (digits == 0))
+		{
+			*(t++) = '0';
+			*(t++) = 'x';
+		}
+		if (compface_xbitmap) {
+			if (*(s++))
+				i = (i >> 1) | 0x8;
+			else
+				i >>= 1;
+		}
+		else {
+			if (*(s++))
+				i = i * 2 + 1;
+			else
+				i *= 2;
+		}
+		if (++bits == BITSPERDIG)
+		{
+			if (compface_xbitmap) {
+				t++;
+				t[-(digits & 1) * 2] = *(i + HexDigits);
+			}
+			else *(t++) = *(i + HexDigits);
+			bits = i = 0;
+			if (++digits == digsperword)
+			{
+				if (compface_xbitmap && (s >= F + PIXELS))
+				  break;
+				*(t++) = ',';
+				digits = 0;
+				if (++words == wordsperline)
+				{
+					*(t++) = '\n';
+					if (compface_xbitmap) *(t++) = ' ';
+					words = 0;
+				}
+			}
+		}
+	}
+	if (compface_xbitmap) {
+		sprintf(t, "};\n");
+		while (*t) t++;
+	}
+	*(t++) = '\0';
+}
+
+void KXFace::UnCompAll(char *fbuf)
+{
+	register char *p;
+
+	BigClear();
+	BigRead(fbuf);
+	p = F;
+	while (p < F + PIXELS)
+		*(p++) = 0;
+	UnCompress(F, 16, 16, 0);
+	UnCompress(F + 16, 16, 16, 0);
+	UnCompress(F + 32, 16, 16, 0);
+	UnCompress(F + WIDTH * 16, 16, 16, 0);
+	UnCompress(F + WIDTH * 16 + 16, 16, 16, 0);
+	UnCompress(F + WIDTH * 16 + 32, 16, 16, 0);
+	UnCompress(F + WIDTH * 32, 16, 16, 0);
+	UnCompress(F + WIDTH * 32 + 16, 16, 16, 0);
+	UnCompress(F + WIDTH * 32 + 32, 16, 16, 0);
+}
+
+void KXFace::UnCompress(char *f, int wid, int hei, int lev)
+{
+	switch (BigPop(&levels[lev][0]))
+	{
+		case WHITE :
+			return;
+		case BLACK :
+			PopGreys(f, wid, hei);
+			return;
+		default :
+			wid /= 2;
+			hei /= 2;
+			lev++;
+			UnCompress(f, wid, hei, lev);
+			UnCompress(f + wid, wid, hei, lev);
+			UnCompress(f + hei * WIDTH, wid, hei, lev);
+			UnCompress(f + wid + hei * WIDTH, wid, hei, lev);
+			return;
+	}
+}
+
+void KXFace::BigWrite(register char *fbuf)
+{
+	static WORD tmp;
+	static char buf[DIGITS];
+	register char *s;
+	register int i;
+
+	s = buf;
+	while (B.b_words > 0)
+	{
+		BigDiv(NUMPRINTS, &tmp);
+		*(s++) = tmp + FIRSTPRINT;
+	}
+	i = 7;	// leave room for the field name on the first line
+	*(fbuf++) = ' ';
+	while (s-- > buf)
+	{
+		if (i == 0)
+			*(fbuf++) = ' ';
+		*(fbuf++) = *s;
+		if (++i >= MAXLINELEN)
+		{
+			*(fbuf++) = '\n';
+			i = 0;
+		}
+	}
+	if (i > 0)
+		*(fbuf++) = '\n';
+	*(fbuf++) = '\0';
+}
+
+void KXFace::BigRead(register char *fbuf)
+{
+	register int c;
+
+	while (*fbuf != '\0')
+	{
+		c = *(fbuf++);
+		if ((c < FIRSTPRINT) || (c > LASTPRINT))
+			continue;
+		BigMul(NUMPRINTS);
+		BigAdd((WORD)(c - FIRSTPRINT));
+	}
+}
+
+void KXFace::ReadFace(char *fbuf)
+{
+	register int c, i;
+	register char *s, *t;
+
+	t = s = fbuf;
+	for(i = strlen(s); i > 0; i--)
+	{
+		c = (int)*(s++);
+		if ((c >= '0') && (c <= '9'))
+		{
+			if (t >= fbuf + DIGITS)
+			{
+				status = ERR_EXCESS;
+				break;
+			}
+			*(t++) = c - '0';
+		}
+		else if ((c >= 'A') && (c <= 'F'))
+		{
+			if (t >= fbuf + DIGITS)
+			{
+				status = ERR_EXCESS;
+				break;
+			}
+			*(t++) = c - 'A' + 10;
+		}
+		else if ((c >= 'a') && (c <= 'f'))
+		{
+			if (t >= fbuf + DIGITS)
+			{
+				status = ERR_EXCESS;
+				break;
+			}
+			*(t++) = c - 'a' + 10;
+		}
+		else if (((c == 'x') || (c == 'X')) && (t > fbuf) && (*(t-1) == 0))
+			t--;
+	}
+	if (t < fbuf + DIGITS)
+		longjmp(comp_env, ERR_INSUFF);
+	s = fbuf;
+	t = F;
+	c = 1 << (BITSPERDIG - 1);
+	while (t < F + PIXELS)
+	{
+		*(t++) = (*s & c) ? 1 : 0;
+		if ((c >>= 1) == 0)
+		{
+			s++;
+			c = 1 << (BITSPERDIG - 1);
+		}
+	}
+}
+
+void KXFace::GenFace()
+{
+	static char newp[PIXELS];
+	register char *f1;
+	register char *f2;
+	register int i;
+
+	f1 = newp;
+	f2 = F;
+	i = PIXELS;
+	while (i-- > 0)
+		*(f1++) = *(f2++);
+	Gen(newp);
+}
+
+void KXFace::UnGenFace()
+{
+	Gen(F);
+}
+
+// static
+void KXFace::Gen(register char *f)
+{
+	register int m, l, k, j, i, h;
+
+	for (j = 0; j < HEIGHT;  j++)
+	{
+		for (i = 0; i < WIDTH;  i++)
+		{
+			h = i + j * WIDTH;
+			k = 0;
+			for (l = i - 2; l <= i + 2; l++)
+				for (m = j - 2; m <= j; m++)
+				{
+					if ((l >= i) && (m == j))
+						continue;
+					if ((l > 0) && (l <= WIDTH) && (m > 0))
+						k = *(f + l + m * WIDTH) ? k * 2 + 1 : k * 2;
+				}
+			switch (i)
+			{
+				case 1 :
+					switch (j)
+					{
+						case 1 : GEN(g_22);
+						case 2 : GEN(g_21);
+						default : GEN(g_20);
+					}
+					break;
+				case 2 :
+					switch (j)
+					{
+						case 1 : GEN(g_12);
+						case 2 : GEN(g_11);
+						default : GEN(g_10);
+					}
+					break;
+				case WIDTH - 1 :
+					switch (j)
+					{
+						case 1 : GEN(g_42);
+						case 2 : GEN(g_41);
+						default : GEN(g_40);
+					}
+					break;
+				case WIDTH :
+					switch (j)
+					{
+						case 1 : GEN(g_32);
+						case 2 : GEN(g_31);
+						default : GEN(g_30);
+					}
+					break;
+				default :
+					switch (j)
+					{
+						case 1 : GEN(g_02);
+						case 2 : GEN(g_01);
+						default : GEN(g_00);
+					}
+					break;
+			}
+		}
+	}
+}
+
+void KXFace::PopGreys(char *f, int wid, int hei)
+{
+	if (wid > 3)
+	{
+		wid /= 2;
+		hei /= 2;
+		PopGreys(f, wid, hei);
+		PopGreys(f + wid, wid, hei);
+		PopGreys(f + WIDTH * hei, wid, hei);
+		PopGreys(f + WIDTH * hei + wid, wid, hei);
+	}
+	else
+	{
+		wid = BigPop(freqs);
+		if (wid & 1)
+			*f = 1;
+		if (wid & 2)
+			*(f + 1) = 1;
+		if (wid & 4)
+			*(f + WIDTH) = 1;
+		if (wid & 8)
+			*(f + WIDTH + 1) = 1;
+	}
+}
+
+void KXFace::CompAll(char *fbuf)
+{
+	Compress(F, 16, 16, 0);
+	Compress(F + 16, 16, 16, 0);
+	Compress(F + 32, 16, 16, 0);
+	Compress(F + WIDTH * 16, 16, 16, 0);
+	Compress(F + WIDTH * 16 + 16, 16, 16, 0);
+	Compress(F + WIDTH * 16 + 32, 16, 16, 0);
+	Compress(F + WIDTH * 32, 16, 16, 0);
+	Compress(F + WIDTH * 32 + 16, 16, 16, 0);
+	Compress(F + WIDTH * 32 + 32, 16, 16, 0);
+	BigClear();
+	while (NumProbs > 0)
+		BigPush(ProbBuf[--NumProbs]);
+	BigWrite(fbuf);
+}
+
+void KXFace::Compress(register char *f, register int wid, register int hei, register int lev)
+{
+	if (AllWhite(f, wid, hei))
+	{
+		RevPush(&levels[lev][WHITE]);
+		return;
+	}
+	if (AllBlack(f, wid, hei))
+	{
+		RevPush(&levels[lev][BLACK]);
+		PushGreys(f, wid, hei);
+		return;
+	}
+	RevPush(&levels[lev][GREY]);
+	wid /= 2;
+	hei /= 2;
+	lev++;
+	Compress(f, wid, hei, lev);
+	Compress(f + wid, wid, hei, lev);
+	Compress(f + hei * WIDTH, wid, hei, lev);
+	Compress(f + wid + hei * WIDTH, wid, hei, lev);
+}
+
+int KXFace::AllWhite(char *f, int wid, int hei)
+{
+	return ((*f == 0) && Same(f, wid, hei));
+}
+
+int KXFace::AllBlack(char *f, int wid, int hei)
+{
+	if (wid > 3)
+	{
+		wid /= 2;
+		hei /= 2;
+		return (AllBlack(f, wid, hei) && AllBlack(f + wid, wid, hei) &&
+		  AllBlack(f + WIDTH * hei, wid, hei) &&
+		  AllBlack(f + WIDTH * hei + wid, wid, hei));
+	}
+	else
+		return (*f || *(f + 1) || *(f + WIDTH) || *(f + WIDTH + 1));
+}
+
+int KXFace::Same(register char *f, register int wid, register int hei)
+{
+	register char val, *row;
+	register int x;
+
+	val = *f;
+	while (hei--)
+	{
+		row = f;
+		x = wid;
+		while (x--)
+			if (*(row++) != val)
+				return(0);
+		f += WIDTH;
+	}
+	return 1;
+}
+
+void KXFace::PushGreys(char *f, int wid, int hei)
+{
+	if (wid > 3)
+	{
+		wid /= 2;
+		hei /= 2;
+		PushGreys(f, wid, hei);
+		PushGreys(f + wid, wid, hei);
+		PushGreys(f + WIDTH * hei, wid, hei);
+		PushGreys(f + WIDTH * hei + wid, wid, hei);
+	}
+	else
+		RevPush(freqs + *f + 2 * *(f + 1) + 4 * *(f + WIDTH) +
+		  8 * *(f + WIDTH + 1));
+}
+
+
+#include "kxface.moc"
diff -Nur old/libkdepim/kxface.h new/libkdepim/kxface.h
--- old/libkdepim/kxface.h	Thu Jan  1 01:00:00 1970
+++ new/libkdepim/kxface.h	Fri Nov 12 21:35:13 2004
@@ -0,0 +1,620 @@
+/*
+  This file is part of libkdepim.
+
+  Original compface:
+  Copyright (c) James Ashton - Sydney University - June 1990.
+
+  Additions for KDE:
+  Copyright (c) 2004 Jakob Schröter <js@camaya.net>
+
+  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; see the file COPYING.LIB.  If not, write to
+  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+  Boston, MA 02111-1307, USA.
+*/
+
+
+#ifndef __KXFACE_H
+#define __KXFACE_H
+
+
+#include <qobject.h>
+#include <setjmp.h>
+
+#define GEN(g) F[h] ^= G.g[k]; break
+
+#define BITSPERDIG 4
+#define WIDTH 48
+#define HEIGHT WIDTH
+
+/* total number of pixels and digits */
+#define PIXELS (WIDTH * HEIGHT)
+#define DIGITS (PIXELS / BITSPERDIG)
+#define DIGSPERWORD 4
+#define WORDSPERLINE (WIDTH / DIGSPERWORD / BITSPERDIG)
+
+/* compressed output uses the full range of printable characters.
+ * in ascii these are in a contiguous block so we just need to know
+ * the first and last.  The total number of printables is needed too */
+#define FIRSTPRINT '!'
+#define LASTPRINT '~'
+#define NUMPRINTS (LASTPRINT - FIRSTPRINT + 1)
+
+/* output line length for compressed data */
+#define MAXLINELEN 78
+
+/* Portable, very large unsigned integer arithmetic is needed.
+ * Implementation uses arrays of WORDs.  COMPs must have at least
+ * twice as many bits as WORDs to handle intermediate results */
+#define WORD unsigned char
+#define COMP unsigned long
+#define BITSPERWORD 8
+#define WORDCARRY (1 << BITSPERWORD)
+#define WORDMASK (WORDCARRY - 1)
+#define MAXWORDS ((PIXELS * 2 + BITSPERWORD - 1) / BITSPERWORD)
+
+#define ERR_OK		0	/* successful completion */
+#define ERR_EXCESS	1	/* completed OK but some input was ignored */
+#define ERR_INSUFF	-1	/* insufficient input.  Bad face format? */
+#define ERR_INTERNAL	-2	/* Arithmetic overflow or buffer overflow */
+
+#define BLACK 0
+#define GREY 1
+#define WHITE 2
+
+#define MAX_XFACE_LENGTH 2048
+
+
+
+typedef struct guesses
+  {
+    char g_00[1<<12];
+    char g_01[1<<7];
+    char g_02[1<<2];
+    char g_10[1<<9];
+    char g_20[1<<6];
+    char g_30[1<<8];
+    char g_40[1<<10];
+    char g_11[1<<5];
+    char g_21[1<<3];
+    char g_31[1<<5];
+    char g_41[1<<6];
+    char g_12[1<<1];
+    char g_22[1<<0];
+    char g_32[1<<2];
+    char g_42[1<<2];
+  } Guesses;
+
+static const Guesses G =
+{
+	{
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1,
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1,
+		0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1,
+		0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 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+  int p_range;
+  int p_offset;
+} Prob;
+
+  
+  
+static const Prob levels[4][3] = {
+  {{1, 255},  {251, 0}, {4, 251}},	/* Top of tree almost always grey */
+  {{1, 255},  {200, 0}, {55, 200}},
+  {{33, 223}, {159, 0}, {64, 159}},
+  {{131, 0},  {0, 0},   {125, 131}}	/* Grey disallowed at bottom */
+};
+
+static const Prob freqs[16] = {
+  {0, 0},    {38, 0},   {38, 38},  {13, 152},
+  {38, 76},  {13, 165}, {13, 178}, {6, 230},
+  {38, 114}, {13, 191}, {13, 204}, {6, 236},
+  {13, 217}, {6, 242},  {5, 248},  {3, 253}
+};
+
+static const char HexDigits[] = "0123456789ABCDEF";
+
+
+class QBitmap;
+class QString;
+
+namespace KPIM {
+
+class KXFace : public QObject
+{
+Q_OBJECT
+
+public:
+  KXFace();
+  virtual ~KXFace();
+  QString comp(const QString str);
+  QBitmap uncomp(const QString str);
+  
+  
+private:
+
+  int NumProbs;
+  int status;
+  int compface_xbitmap;
+  
+  char F[PIXELS];
+  Prob *ProbBuf[PIXELS * 2];
+  
+  jmp_buf comp_env;  
+  
+  typedef struct bigint
+  {
+    int b_words;
+    WORD b_word[MAXWORDS];
+  } BigInt;
+  
+  BigInt B;
+ 
+  int x(int &pos);
+  int y(int &pos);
+  QBitmap toPixmap(QString ikon);
+  
+  int  uncompface(char *fbuf);
+  int  compface(char *fbuf);
+  void RevPush(const Prob *p);
+  void BigPush(Prob *p);
+  int  BigPop(register const Prob *p);
+  void BigDiv(register WORD a, register WORD *r);
+  void BigMul(register WORD a);
+  void BigAdd(WORD a);
+  void BigClear();
+  
+  void WriteFace(char *fbuf);
+  void UnCompAll(char *fbuf);
+  void UnCompress(register char *f, register int wid, register int hei, register int lev);
+  void BigWrite(register char *fbuf);
+  void BigRead(register char *fbuf);
+  void ReadFace(char *fbuf);
+  void GenFace();
+  void UnGenFace();
+  void Gen(register char *f);
+  void PopGreys(char *f, int wid, int hei);
+  void CompAll(char *fbuf);
+  void Compress(register char *f, register int wid, register int hei, register int lev);
+  int  AllWhite(char *f, int wid, int hei);
+  int  AllBlack(char *f, int wid, int hei);
+  int  Same(register char *f, register int wid, register int hei);
+  void PushGreys(char *f, int wid, int hei);
+  
+
+};
+} // namespace KPIM
+#endif // __KXFACE_H
diff -Nur old/libkpimidentities/identity.cpp new/libkpimidentities/identity.cpp
--- old/libkpimidentities/identity.cpp	Thu Nov 11 01:07:23 2004
+++ new/libkpimidentities/identity.cpp	Fri Nov 12 21:56:26 2004
@@ -237,7 +237,8 @@
     mSMIMEEncryptionKey.isEmpty() && mSMIMESigningKey.isEmpty() &&
     mTransport.isEmpty() && mDictionary.isEmpty() &&
     mPreferredCryptoMessageFormat == Kleo::AutoFormat &&
-    mSignature.type() == Signature::Disabled;
+    mSignature.type() == Signature::Disabled &&
+    mXFace.isNull();
 }
 
 bool Identity::operator==( const Identity & other ) const {
@@ -253,7 +254,8 @@
       mSMIMESigningKey == other.mSMIMESigningKey &&
       mPreferredCryptoMessageFormat == other.mPreferredCryptoMessageFormat &&
       mDrafts == other.mDrafts && mTransport == other.mTransport &&
-      mDictionary == other.mDictionary && mSignature == other.mSignature;
+      mDictionary == other.mDictionary && mSignature == other.mSignature &&
+      mXFace == other.mXFace && mXFaceEnabled == other.mXFaceEnabled;
 
 #if 0
   if ( same )
@@ -325,6 +327,8 @@
     mDrafts = "drafts";
   mTransport = config->readEntry("Transport");
   mDictionary = config->readEntry( "Dictionary" );
+  mXFace = config->readEntry( "X-Face" );
+  mXFaceEnabled = config->readBoolEntry( "X-FaceEnabled", false );
 
   mSignature.readConfig( config );
   kdDebug(5006) << "Identity::readConfig(): UOID = " << mUoid
@@ -352,6 +356,8 @@
   config->writeEntry("Fcc", mFcc);
   config->writeEntry("Drafts", mDrafts);
   config->writeEntry( "Dictionary", mDictionary );
+  config->writeEntry( "X-Face", mXFace );
+  config->writeEntry( "X-FaceEnabled", mXFaceEnabled );
 
   mSignature.writeConfig( config );
 }
@@ -374,6 +380,7 @@
 		<< i.drafts()
 		<< i.mSignature
                 << i.dictionary()
+                << i.xface()
 		<< QString( Kleo::cryptoMessageFormatToString( i.mPreferredCryptoMessageFormat ) );
 }
 
@@ -397,6 +404,7 @@
 		>> i.mDrafts
 		>> i.mSignature
                 >> i.mDictionary
+                >> i.mXFace
 		>> format;
   i.mUoid = uoid;
   i.mPreferredCryptoMessageFormat = Kleo::stringToCryptoMessageFormat( format.latin1() );
@@ -556,6 +564,20 @@
   mDictionary = str;
   if ( mDictionary.isNull() )
     mDictionary = "";
+}
+
+
+//-----------------------------------------------------------------------------
+void Identity::setXFace( const QString &str )
+{
+  mXFace = str;
+}
+
+
+//-----------------------------------------------------------------------------
+void Identity::setXFaceEnabled( const bool on )
+{
+  mXFaceEnabled = on;
 }
 
 
diff -Nur old/libkpimidentities/identity.h new/libkpimidentities/identity.h
--- old/libkpimidentities/identity.h	Thu Nov 11 01:07:26 2004
+++ new/libkpimidentities/identity.h	Fri Nov 12 21:57:01 2004
@@ -273,6 +273,12 @@
   QString dictionary() const { return mDictionary; }
   void setDictionary( const QString& );
 
+  /** a X-Face header for this identity */
+  QString xface() const { return mXFace; }
+  void setXFace( const QString& );
+  bool isXFaceEnabled() const { return mXFaceEnabled; }
+  void setXFaceEnabled( const bool );
+
   static Identity null;
   bool isNull() const;
 protected:
@@ -288,6 +294,8 @@
   QCString mPGPEncryptionKey, mPGPSigningKey, mSMIMEEncryptionKey, mSMIMESigningKey;
   QString mFcc, mDrafts, mTransport;
   QString mDictionary;
+  QString mXFace;
+  bool mXFaceEnabled;
   Signature mSignature;
   bool      mIsDefault;
   Kleo::CryptoMessageFormat mPreferredCryptoMessageFormat;
