#include "desktoppixmap.h"
#include <kapp.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <stdio.h>
#define SCR2PAGER(x) x*width()/kapp->desktop()->width()
#define PAGER2SCR(x) x*kapp->desktop()->width()/width()

KPagerDesktop::WindowData *KPagerDesktopPixmap::winData(WId id, WindowData */*wd*/)
{
  WindowDataPixmap *w=new WindowDataPixmap;
  KPagerDesktop::winData(id,w);
  w->thumbnail=new QPixmap(20,20);
  return w;
}

KPagerDesktopPixmap::KPagerDesktopPixmap(int desk, class KWinModule *kwinmod, QWidget *parent)
   : KPagerDesktop(desk,kwinmod,parent)
{
}

QPixmap *KPagerDesktopPixmap::paintWindow(const WindowData *wdd, QPoint *pos)
{
  QPixmap *window=KPagerDesktop::paintWindow(wdd,pos);

  // TODO: Guess it ! ;-)

  window->fill(QColor(130,180,254));

  return window;
}

/*
void KPagerDesktopPixmap::paintEvent(QPaintEvent *ev)
{
  QPainter p(this);
  p.setFont(font());

  p.fillRect(rect(), Qt::yellow);
  p.setPen(Qt::blue);
  p.drawLine(0, 0, width()-1, 0);
  p.drawLine(0, 0, 0, height()-1);
  p.setPen(Qt::black);
  p.drawLine(0, height()-1, width()-1, height()-1);
  p.drawLine(width()-1, 0, width()-1, height()-1);
  p.setPen(Qt::white);

  QListIterator<WindowData> it(winList);
  for( ; it.current(); ++it)
  {
    printf("wid: %d\n",it.current()->wid);
    QRect r(it.current()->rect);
    r.setRect(SCR2PAGER(r.x()),SCR2PAGER(r.y()),SCR2PAGER(r.width()),SCR2PAGER(r.height()));
    p.fillRect(r, colorGroup().brush(QColorGroup::Base));
  };

}
*/
