Back to index

kdeartwork  4.3.2
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
RiscOS::Static Class Reference

#include <Static.h>

Collaboration diagram for RiscOS::Static:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Static ()
 ~Static ()
void reset ()
void updatePixmaps ()
const QPixmap & titleTextLeft (bool active) const
const QPixmap & titleTextRight (bool active) const
const QPixmap & resizeMidLeft (bool active) const
const QPixmap & resizeMidRight (bool active) const
const QPixmap & titleTextMid (bool active) const
const QPixmap & resizeMidMid (bool active) const
const QPixmap & buttonBase (bool active, bool down) const
const QPixmap & resize (bool active) const
int animationStyle () const
int titleHeight () const
int resizeHeight () const

Static Public Member Functions

static Staticinstance ()

Private Member Functions

void _init ()
void _drawBorder (QPixmap &, int, int)
void _createTexture (QPixmap &, int, bool)
void _initSizes ()
void _resizeAllPixmaps ()
void _blankAllPixmaps ()
void _initPalettes ()
void _initTextures ()
void _drawTitleTextAreaSides ()
void _drawResizeCentralAreaSides ()
void _drawTitleTextAreaBackground ()
void _drawResizeCentralAreaBackground ()
void _drawResizeHandles ()
void _drawButtonBackgrounds ()

Private Attributes

Palette aTitlePal_
Palette iTitlePal_
Palette aResizePal_
Palette iResizePal_
Palette aButPal_
Palette iButPal_
QPixmap aButtonUp_
QPixmap iButtonUp_
QPixmap aButtonDown_
QPixmap iButtonDown_
QPixmap aResize_
QPixmap iResize_
QPixmap aResizeDown_
QPixmap iResizeDown_
QPixmap aTitleTextLeft_
QPixmap iTitleTextLeft_
QPixmap aTitleTextRight_
QPixmap iTitleTextRight_
QPixmap aTitleTextMid_
QPixmap iTitleTextMid_
QPixmap aResizeMidLeft_
QPixmap iResizeMidLeft_
QPixmap aResizeMidRight_
QPixmap iResizeMidRight_
QPixmap aResizeMid_
QPixmap iResizeMid_
QPixmap aTexture_
QPixmap iTexture_
QPixmap abTexture_
QPixmap ibTexture_
QPainter painter_
bool down_
Palette palette_
double transx
double transy
int animationStyle_
int titleHeight_
int buttonSize_
int resizeHeight_
bool hicolour_

Static Private Attributes

static Staticinstance_ = NULL

Detailed Description

Definition at line 38 of file Static.h.


Constructor & Destructor Documentation

Definition at line 63 of file Static.cpp.

{
   instance_ = this;
   _init();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 69 of file Static.cpp.

{
   instance_ = NULL;
}

Member Function Documentation

Definition at line 319 of file Static.cpp.

{
   aResize_        .fill(Qt::black);
   iResize_        .fill(Qt::black);
   aTitleTextLeft_ .fill(Qt::black);
   aTitleTextRight_.fill(Qt::black);
   iTitleTextLeft_ .fill(Qt::black);
   iTitleTextRight_.fill(Qt::black);
   aTitleTextMid_  .fill(Qt::black);
   iTitleTextMid_  .fill(Qt::black);
   aResizeMidLeft_ .fill(Qt::black);
   aResizeMidRight_.fill(Qt::black);
   iResizeMidLeft_ .fill(Qt::black);
   iResizeMidRight_.fill(Qt::black);
   aResizeMid_     .fill(Qt::black);
   iResizeMid_     .fill(Qt::black);
   aButtonUp_      .fill(Qt::black);
   iButtonUp_      .fill(Qt::black);
   aButtonDown_    .fill(Qt::black);
   iButtonDown_    .fill(Qt::black);
}

Here is the caller graph for this function:

void RiscOS::Static::_createTexture ( QPixmap &  px,
int  t,
bool  active 
) [private]

Definition at line 245 of file Static.cpp.

{
   const QImage texture(QPixmap((const char **)texture_xpm).convertToImage());
   const QRgb w(qRgb(255, 255, 255));
   const QRgb b(qRgb(0, 0, 0));

   QColor c(KDecoration::options()->color(KDecoration::ColorType(t), active));

   QRgb mid    (c.rgb());
   QRgb light  (c.light(110).rgb());
   QRgb dark   (c.dark(110).rgb());

   QRgb* data(reinterpret_cast<QRgb *>(texture.bits()));

   for (int x = 0; x < 64*12; x++)
      if (data[x] == w)
         data[x] = light;
      else if (data[x] == b)
         data[x] = dark;
      else
         data[x] = mid;

   px.convertFromImage(texture);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RiscOS::Static::_drawBorder ( QPixmap &  pix,
int  w,
int  h 
) [private]

Definition at line 124 of file Static.cpp.

{
   // 0111111113
   // 1122222235
   // 12      46
   // 12      46
   // 12      46
   // 1344444476
   // 3566666667

   painter_.begin(&pix);
   painter_.translate(transx, transy);

   QColor c0 = down_ ? palette_[7] : palette_[0];
   QColor c1 = down_ ? palette_[6] : palette_[1];
   QColor c2 = down_ ? palette_[5] : palette_[2];
   QColor c3 = down_ ? palette_[4] : palette_[3];
   QColor c4 = down_ ? palette_[3] : palette_[4];
   QColor c5 = down_ ? palette_[2] : palette_[5];
   QColor c6 = down_ ? palette_[2] : palette_[6];
   QColor c7 = down_ ? palette_[1] : palette_[7];

   painter_.setPen(c0);
   painter_.drawPoint(0, 0);

   painter_.setPen(c1);
   painter_.drawPoint(1, 1);
   painter_.drawLine(1, 0, w - 1, 0);
   painter_.drawLine(0, 1, 0, h - 1);

   painter_.setPen(c2);
   painter_.drawLine(2, 1, w - 2, 1);
   painter_.drawLine(1, 2, 1, h - 2);

   painter_.setPen(c3);
   painter_.drawPoint(0, h);
   painter_.drawPoint(1, h - 1);
   painter_.drawPoint(w, 0);
   painter_.drawPoint(w - 1, 1);
   painter_.fillRect(2, 2, w - 2, h - 2, c3);

   painter_.setPen(c4);
   painter_.drawLine(2, h - 1, w - 2, h - 1);
   painter_.drawLine(w - 1, 2, w - 1, h - 2);

   painter_.setPen(c5);
   painter_.drawPoint(w, 1);
   painter_.drawPoint(1, h);

   painter_.setPen(c6);
   painter_.drawLine(w, 2, w, h - 1);
   painter_.drawLine(2, h, w - 1, h);

   painter_.setPen(c7);
   painter_.drawPoint(w - 1, h - 1);
   painter_.drawPoint(w, h);

   painter_.end();

   painter_.resetXForm();
}

Here is the caller graph for this function:

Definition at line 504 of file Static.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 451 of file Static.cpp.

{
   QPixmap temp(70, titleHeight_);
   temp.fill(Qt::black);

   transy = 1.0;

   palette_ = aResizePal_;
   _drawBorder(temp, 70, resizeHeight_ - 3);

   painter_.begin(&aResizeMid_);
   painter_.drawPixmap(0, 0, temp, 2, 0);
   if (hicolour_)
      painter_.drawTiledPixmap(0, 4, 64, resizeHeight_ - 8, aTexture_);
   painter_.end();

   palette_ = iResizePal_;
   _drawBorder(temp, 70, 7);

   painter_.begin(&iResizeMid_);
   painter_.drawPixmap(0, 0, temp, 2, 0);
   if (hicolour_)
      painter_.drawTiledPixmap(0, 4, 64, resizeHeight_ - 8, iTexture_);
   painter_.end();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 394 of file Static.cpp.

{
   QPixmap temp(4, resizeHeight_);
   temp.fill(Qt::black);

   transy = 1.0;

   palette_ = aResizePal_;

   _drawBorder(temp, 4, resizeHeight_ - 3);

   painter_.begin(&aResizeMidLeft_);
   painter_.drawPixmap(0, 1, temp, 0, 1);
   painter_.end();

   painter_.begin(&aResizeMidRight_);
   painter_.drawPixmap(0, 1, temp, 2, 1);
   painter_.end();

   palette_ = iResizePal_;
   _drawBorder(temp, 4, resizeHeight_ - 3);

   painter_.begin(&iResizeMidLeft_);
   painter_.drawPixmap(0, 1, temp, 0, 1);
   painter_.end();

   painter_.begin(&iResizeMidRight_);
   painter_.drawPixmap(0, 1, temp, 2, 1);
   painter_.end();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 477 of file Static.cpp.

{
   transx = transy = 1.0;

   down_ = false;

   palette_ = aResizePal_;
   _drawBorder(aResize_, 28, resizeHeight_ - 3);

   if (hicolour_)
   {
      painter_.begin(&aResize_);
      painter_.drawTiledPixmap(4, 4, 20, resizeHeight_ - 8, aTexture_);
      painter_.end();
   }

   palette_ = iResizePal_;
   _drawBorder(iResize_, 28, resizeHeight_ - 3);

   if (hicolour_)
   {
      painter_.begin(&iResize_);
      painter_.drawTiledPixmap(4, 4, 20, resizeHeight_ - 8, iTexture_);
      painter_.end();
   }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 425 of file Static.cpp.

{
   QPixmap temp(70, titleHeight_);
   temp.fill(Qt::black);

   transx = transy = 0.0;

   palette_ = aTitlePal_;
   _drawBorder(temp, 70, titleHeight_ - 3);

   painter_.begin(&aTitleTextMid_);
   painter_.drawPixmap(0, 1, temp, 2, 0);
   if (hicolour_)
      painter_.drawTiledPixmap(0, 4, 64, titleHeight_ - 8, aTexture_);
   painter_.end();

   palette_ = iTitlePal_;
   _drawBorder(temp, 70, titleHeight_ - 3);

   painter_.begin(&iTitleTextMid_);
   painter_.drawPixmap(0, 1, temp, 2, 0);
   if (hicolour_)
      painter_.drawTiledPixmap(0, 4, 64, titleHeight_ - 8, iTexture_);
   painter_.end();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 362 of file Static.cpp.

{
   QPixmap temp(4, titleHeight_);
   temp.fill(Qt::black);

   transx = transy = 0.0;

   palette_ = aTitlePal_;
   down_ = false;

   _drawBorder(temp, 4, titleHeight_ - 2);

   painter_.begin(&aTitleTextLeft_);
   painter_.drawPixmap(1, 1, temp, 0, 1);
   painter_.end();

   painter_.begin(&aTitleTextRight_);
   painter_.drawPixmap(0, 1, temp, 2, 1);
   painter_.end();

   palette_ = iTitlePal_;
   _drawBorder(temp, 4, titleHeight_ - 2);

   painter_.begin(&iTitleTextLeft_);
   painter_.drawPixmap(1, 1, temp, 0, 1);
   painter_.end();

   painter_.begin(&iTitleTextRight_);
   painter_.drawPixmap(0, 1, temp, 2, 1);
   painter_.end();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RiscOS::Static::_init ( ) [private]

Definition at line 205 of file Static.cpp.

{
   hicolour_ = QPixmap::defaultDepth() > 8;
   animationStyle_ = 0;
   updatePixmaps();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RiscOS::Static::_initPalettes ( ) [private]

Definition at line 341 of file Static.cpp.

{
   const KDecorationOptions* options = KDecoration::options();
   setPalette(aButPal_, options->color(KDecoration::ColorButtonBg, true));
   setPalette(iButPal_, options->color(KDecoration::ColorButtonBg, false));

   setPalette(aTitlePal_,  options->color(KDecoration::ColorTitleBar, true));
   setPalette(iTitlePal_,  options->color(KDecoration::ColorTitleBar, false));

   setPalette(aResizePal_, options->color(KDecoration::ColorTitleBar, true));
   setPalette(iResizePal_, options->color(KDecoration::ColorTitleBar, false));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RiscOS::Static::_initSizes ( ) [private]

Definition at line 278 of file Static.cpp.

{
   QFont f(KDecoration::options()->font(true)); // XXX false doesn't work right at the moment

   QFontMetrics fm(f);

   int h = fm.height();

   titleHeight_ = h + 6;

   if (titleHeight_ < 20)
      titleHeight_ = 20;

   buttonSize_ = titleHeight_ - 1;

   resizeHeight_ = 10;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void RiscOS::Static::_initTextures ( ) [private]

Definition at line 354 of file Static.cpp.

{
   _createTexture(aTexture_,  KDecoration::ColorTitleBar, true);
   _createTexture(iTexture_,  KDecoration::ColorTitleBar, false);
   _createTexture(abTexture_, KDecoration::ColorButtonBg, true);
   _createTexture(ibTexture_, KDecoration::ColorButtonBg, false);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 296 of file Static.cpp.

Here is the caller graph for this function:

Definition at line 109 of file Static.cpp.

{
   return animationStyle_;
}

Here is the caller graph for this function:

const QPixmap & RiscOS::Static::buttonBase ( bool  active,
bool  down 
) const

Definition at line 270 of file Static.cpp.

{
   if (active)
      return down ? aButtonDown_ : aButtonUp_;
   else
      return down ? iButtonDown_ : iButtonUp_;
}
static Static* RiscOS::Static::instance ( ) [inline, static]

Definition at line 46 of file Static.h.

      {
         if (instance_ == 0)
         new Static;

         return instance_;
      }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 212 of file Static.cpp.

{
   updatePixmaps();
//   Workspace::self()->slotResetAllClientsDelayed();
}

Here is the call graph for this function:

Here is the caller graph for this function:

const QPixmap & RiscOS::Static::resize ( bool  active) const

Definition at line 104 of file Static.cpp.

{
   return active ? aResize_ : iResize_;
}

Here is the caller graph for this function:

Definition at line 119 of file Static.cpp.

{
   return resizeHeight_;
}

Here is the caller graph for this function:

const QPixmap & RiscOS::Static::resizeMidLeft ( bool  active) const

Definition at line 84 of file Static.cpp.

{
   return active ? aResizeMidLeft_ : iResizeMidLeft_;
}

Here is the caller graph for this function:

const QPixmap & RiscOS::Static::resizeMidMid ( bool  active) const

Definition at line 99 of file Static.cpp.

{
   return active ? aResizeMid_ : iResizeMid_;
}

Here is the caller graph for this function:

const QPixmap & RiscOS::Static::resizeMidRight ( bool  active) const

Definition at line 89 of file Static.cpp.

{
   return active ? aResizeMidRight_ : iResizeMidRight_;
}

Here is the caller graph for this function:

Definition at line 114 of file Static.cpp.

{
   return titleHeight_;
}

Here is the caller graph for this function:

const QPixmap & RiscOS::Static::titleTextLeft ( bool  active) const

Definition at line 74 of file Static.cpp.

{
   return active ? aTitleTextLeft_ : iTitleTextLeft_;
}

Here is the caller graph for this function:

const QPixmap & RiscOS::Static::titleTextMid ( bool  active) const

Definition at line 94 of file Static.cpp.

{
   return active ? aTitleTextMid_ : iTitleTextMid_;
}

Here is the caller graph for this function:

const QPixmap & RiscOS::Static::titleTextRight ( bool  active) const

Definition at line 79 of file Static.cpp.

{
   return active ? aTitleTextRight_ : iTitleTextRight_;
}

Here is the caller graph for this function:

Definition at line 218 of file Static.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

QPixmap RiscOS::Static::abTexture_ [private]

Definition at line 114 of file Static.h.

Definition at line 95 of file Static.h.

QPixmap RiscOS::Static::aButtonDown_ [private]

Definition at line 103 of file Static.h.

QPixmap RiscOS::Static::aButtonUp_ [private]

Definition at line 103 of file Static.h.

Definition at line 121 of file Static.h.

QPixmap RiscOS::Static::aResize_ [private]

Definition at line 103 of file Static.h.

QPixmap RiscOS::Static::aResizeDown_ [private]

Definition at line 103 of file Static.h.

QPixmap RiscOS::Static::aResizeMid_ [private]

Definition at line 103 of file Static.h.

Definition at line 103 of file Static.h.

Definition at line 103 of file Static.h.

Definition at line 95 of file Static.h.

QPixmap RiscOS::Static::aTexture_ [private]

Definition at line 114 of file Static.h.

Definition at line 95 of file Static.h.

Definition at line 103 of file Static.h.

QPixmap RiscOS::Static::aTitleTextMid_ [private]

Definition at line 103 of file Static.h.

Definition at line 103 of file Static.h.

Definition at line 124 of file Static.h.

bool RiscOS::Static::down_ [private]

Definition at line 117 of file Static.h.

bool RiscOS::Static::hicolour_ [private]

Definition at line 127 of file Static.h.

QPixmap RiscOS::Static::ibTexture_ [private]

Definition at line 114 of file Static.h.

Definition at line 95 of file Static.h.

QPixmap RiscOS::Static::iButtonDown_ [private]

Definition at line 103 of file Static.h.

QPixmap RiscOS::Static::iButtonUp_ [private]

Definition at line 103 of file Static.h.

Static * RiscOS::Static::instance_ = NULL [static, private]

Definition at line 92 of file Static.h.

QPixmap RiscOS::Static::iResize_ [private]

Definition at line 103 of file Static.h.

QPixmap RiscOS::Static::iResizeDown_ [private]

Definition at line 103 of file Static.h.

QPixmap RiscOS::Static::iResizeMid_ [private]

Definition at line 103 of file Static.h.

Definition at line 103 of file Static.h.

Definition at line 103 of file Static.h.

Definition at line 95 of file Static.h.

QPixmap RiscOS::Static::iTexture_ [private]

Definition at line 114 of file Static.h.

Definition at line 95 of file Static.h.

Definition at line 103 of file Static.h.

QPixmap RiscOS::Static::iTitleTextMid_ [private]

Definition at line 103 of file Static.h.

Definition at line 103 of file Static.h.

QPainter RiscOS::Static::painter_ [private]

Definition at line 116 of file Static.h.

Definition at line 118 of file Static.h.

Definition at line 125 of file Static.h.

Definition at line 123 of file Static.h.

double RiscOS::Static::transx [private]

Definition at line 119 of file Static.h.

double RiscOS::Static::transy [private]

Definition at line 119 of file Static.h.


The documentation for this class was generated from the following files: