Back to index

kdeartwork  4.3.2
Classes | Functions | Variables
KStep Namespace Reference

Classes

class  NextButton
class  NextClient
class  NextClientFactory

Functions

static const KDecorationOptions * options ()
static void verticalGradient (QPixmap *pix, QColor first, QColor second)
static void diagonalGradient (QPixmap *pix, QColor first, QColor second)
static void create_pixmaps (NextClientFactory *f)
static void delete_pixmaps ()

Variables

static const unsigned char close_bits []
static const unsigned char iconify_bits []
static const unsigned char question_bits []
static const unsigned char sticky_bits []
static const unsigned char unsticky_bits []
static const unsigned char maximize_bits []
static const unsigned char shade_bits []
static const unsigned char unshade_bits []
static const unsigned char keep_above_bits []
static const unsigned char from_above_bits []
static const unsigned char keep_below_bits []
static const unsigned char from_below_bits []
static const unsigned char resize_bits []
static QPixmap * aTitlePix
static QPixmap * iTitlePix
static QPixmap * aFramePix
static QPixmap * iFramePix
static QPixmap * aHandlePix
static QPixmap * iHandlePix
static QPixmap * aBtn
static QPixmap * aBtnDown
static QPixmap * iBtn
static QPixmap * iBtnDown
static QColor * btnForeground
static bool pixmaps_created = false
static int titleHeight = 16
static const int borderSizes [] = { 4, 6, 9, 14, 21, 32, 48 }
static int handleSize = 6

Function Documentation

static void KStep::create_pixmaps ( NextClientFactory *  f) [static]

Definition at line 227 of file nextclient.cpp.

{
    if(pixmaps_created)
        return;
    pixmaps_created = true;

    // find preferred border size
    int i = options()->preferredBorderSize(f);
    if (i >= 0 && i <= 6) handleSize = borderSizes[i];

    titleHeight = QFontMetrics(options()->font(true)).height() + 4;
    if (titleHeight < handleSize) titleHeight = handleSize;
    titleHeight &= ~1; // Make title height even
    if (titleHeight < 16) titleHeight = 16;

    const int gradientHeight = titleHeight - 2;
    aTitlePix = new QPixmap(32, gradientHeight);

    verticalGradient(aTitlePix,
           options()->color(KDecoration::ColorTitleBar, true),
           options()->color(KDecoration::ColorTitleBlend, true));
    iTitlePix = new QPixmap(32, titleHeight - 2);
    
    verticalGradient(iTitlePix,
           options()->color(KDecoration::ColorTitleBar, false),
           options()->color(KDecoration::ColorTitleBlend, false));
    // Bottom frame gradient
    aFramePix = new QPixmap(32, handleSize);
    verticalGradient(aFramePix,
           options()->color(KDecoration::ColorFrame, true).light(150),
           options()->color(KDecoration::ColorFrame, true).dark(120));
    iFramePix = new QPixmap(32, handleSize);
    verticalGradient(iFramePix,
           options()->color(KDecoration::ColorFrame, false).light(150),
           options()->color(KDecoration::ColorFrame, false).dark(120));
    // Handle gradient
    aHandlePix = new QPixmap(32, handleSize);
    verticalGradient(aHandlePix,
           options()->color(KDecoration::ColorHandle, true).light(150),
           options()->color(KDecoration::ColorHandle, true).dark(120));
    iHandlePix = new QPixmap(32, handleSize);
    verticalGradient(iHandlePix,
           options()->color(KDecoration::ColorHandle, true).light(150),
           options()->color(KDecoration::ColorHandle, true).dark(120));

    int btnWidth = titleHeight;
    iBtn = new QPixmap(btnWidth, btnWidth);
    iBtnDown = new QPixmap(btnWidth, btnWidth);
    aBtn = new QPixmap(btnWidth, btnWidth);
    aBtnDown = new QPixmap(btnWidth, btnWidth);
    int internalHeight = btnWidth - 6;
    QPixmap internal(internalHeight, internalHeight);
    QRect dest(internal.rect());
    dest.moveTo(3, 3);

    QPainter p;

    // inactive buttons
    QColor c(options()->color(KDecoration::ColorButtonBg, false));
    diagonalGradient(iBtn, c.light(120), c.dark(120));
    diagonalGradient(&internal, c.dark(120), c.light(120));
    p.begin(iBtn);
    p.drawPixmap(dest, internal, internal.rect());
    p.end();
    //bitBlt(iBtn, 3, 3, &internal, 0, 0, internalHeight, internalHeight, Qt::CopyROP, true);


    diagonalGradient(iBtnDown, c.dark(120), c.light(120));
    diagonalGradient(&internal, c.light(120), c.dark(120));
    //bitBlt(iBtnDown, 3, 3, &internal, 0, 0, internalHeight, internalHeight, Qt::CopyROP, true);
    p.begin(iBtnDown);
    dest.moveTo(3, 3);
    p.drawPixmap(dest, internal, internal.rect());
    p.end();

    // active buttons
    c = options()->color(KDecoration::ColorButtonBg, true);
    diagonalGradient(aBtn, c.light(120), c.dark(120));
    diagonalGradient(&internal, c.dark(120), c.light(120));
    //bitBlt(aBtn, 3, 3, &internal, 0, 0, internalHeight, internalHeight, Qt::CopyROP, true);
    p.begin(aBtn);
    p.drawPixmap(dest, internal, internal.rect());
    p.end();

    diagonalGradient(aBtnDown, c.dark(120), c.light(120));
    diagonalGradient(&internal, c.light(120), c.dark(120));
    //bitBlt(aBtnDown, 3, 3, &internal, 0, 0, internalHeight, internalHeight, Qt::CopyROP, true);
    p.begin(aBtnDown);
    p.drawPixmap(dest, internal, internal.rect());
    p.end();

    p.begin(aBtn);
    p.setPen(Qt::black);
    p.drawRect(0, 0, btnWidth, btnWidth);
    p.end();
    p.begin(iBtn);
    p.setPen(Qt::black);
    p.drawRect(0, 0, btnWidth, btnWidth);
    p.end();
    p.begin(aBtnDown);
    p.setPen(Qt::black);
    p.drawRect(0, 0, btnWidth, btnWidth);
    p.end();
    p.begin(iBtnDown);
    p.setPen(Qt::black);
    p.drawRect(0, 0, btnWidth, btnWidth);
    p.end();

    if(qGray(options()->color(KDecoration::ColorButtonBg, true).rgb()) > 128)
        btnForeground = new QColor(Qt::black);
    else
        btnForeground = new QColor(Qt::white);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void KStep::delete_pixmaps ( ) [static]

Definition at line 341 of file nextclient.cpp.

{
    delete aTitlePix;
    delete iTitlePix;
    delete aFramePix;
    delete iFramePix;
    delete aHandlePix;
    delete iHandlePix;
    delete aBtn;
    delete iBtn;
    delete aBtnDown;
    delete iBtnDown;
    delete btnForeground;

    pixmaps_created = false;
}

Here is the caller graph for this function:

static void KStep::diagonalGradient ( QPixmap *  pix,
QColor  first,
QColor  second 
) [static]

Definition at line 215 of file nextclient.cpp.

{
    QLinearGradient gradient(0, 0, pix->width(), pix->height());
    gradient.setColorAt(0.0, first);
    gradient.setColorAt(1.0, second);
    QBrush brush(gradient);
    QPainter p;
    p.begin(pix);
    p.fillRect(pix->rect(), brush);
    p.end();
}

Here is the caller graph for this function:

static const KDecorationOptions* KStep::options ( ) [inline, static]

Definition at line 198 of file nextclient.cpp.

{
    return KDecoration::options();
}

Here is the caller graph for this function:

static void KStep::verticalGradient ( QPixmap *  pix,
QColor  first,
QColor  second 
) [static]

Definition at line 203 of file nextclient.cpp.

{
    QLinearGradient gradient(0, 0, 0, pix->height());
    gradient.setColorAt(0.0, first);
    gradient.setColorAt(1.0, second);
    QBrush brush(gradient);
    QPainter p;
    p.begin(pix);
    p.fillRect(pix->rect(), brush);
    p.end();
}

Here is the caller graph for this function:


Variable Documentation

QPixmap* KStep::aBtn [static]

Definition at line 183 of file nextclient.cpp.

QPixmap* KStep::aBtnDown [static]

Definition at line 184 of file nextclient.cpp.

QPixmap* KStep::aFramePix [static]

Definition at line 179 of file nextclient.cpp.

QPixmap* KStep::aHandlePix [static]

Definition at line 181 of file nextclient.cpp.

QPixmap* KStep::aTitlePix [static]

Definition at line 177 of file nextclient.cpp.

const int KStep::borderSizes[] = { 4, 6, 9, 14, 21, 32, 48 } [static]

Definition at line 194 of file nextclient.cpp.

QColor* KStep::btnForeground [static]

Definition at line 187 of file nextclient.cpp.

const unsigned char KStep::close_bits[] [static]
Initial value:
 {
  0x03, 0x03, 0x87, 0x03, 0xce, 0x01, 0xfc, 0x00, 0x78, 0x00, 0x78, 0x00,
  0xfc, 0x00, 0xce, 0x01, 0x87, 0x03, 0x03, 0x03}

Definition at line 34 of file nextclient.cpp.

const unsigned char KStep::from_above_bits[] [static]
Initial value:
 {
    0xff,0x03,
    0xff,0x03,
    0x00,0x00,
    0xfc,0x00,
    0x78,0x00,
    0x30,0x00,
    0x00,0x00,
    0x00,0x00,
    0x00,0x00,
    0x00,0x00
}

Definition at line 97 of file nextclient.cpp.

const unsigned char KStep::from_below_bits[] [static]
Initial value:
 {
    0x00,0x00,
    0x00,0x00,
    0x00,0x00,
    0x00,0x00,
    0x30,0x00,
    0x78,0x00,
    0xfc,0x00,
    0x00,0x00,
    0xff,0x03,
    0xff,0x03
}

Definition at line 123 of file nextclient.cpp.

int KStep::handleSize = 6 [static]

Definition at line 196 of file nextclient.cpp.

QPixmap* KStep::iBtn [static]

Definition at line 185 of file nextclient.cpp.

QPixmap* KStep::iBtnDown [static]

Definition at line 186 of file nextclient.cpp.

const unsigned char KStep::iconify_bits[] [static]
Initial value:
 {
  0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0xff, 0x03, 0x03, 0x03, 0x03, 0x03,
  0x03, 0x03, 0x03, 0x03, 0xff, 0x03, 0xff, 0x03}

Definition at line 38 of file nextclient.cpp.

QPixmap* KStep::iFramePix [static]

Definition at line 180 of file nextclient.cpp.

QPixmap* KStep::iHandlePix [static]

Definition at line 182 of file nextclient.cpp.

QPixmap* KStep::iTitlePix [static]

Definition at line 178 of file nextclient.cpp.

const unsigned char KStep::keep_above_bits[] [static]
Initial value:
 {
    0x30,0x00,
    0x78,0x00,
    0xfc,0x00,
    0x00,0x00,
    0xff,0x03,
    0xff,0x03,
    0x00,0x00,
    0x00,0x00,
    0x00,0x00,
    0x00,0x00
}

Definition at line 84 of file nextclient.cpp.

const unsigned char KStep::keep_below_bits[] [static]
Initial value:
 {
    0x00,0x00,
    0x00,0x00,
    0x00,0x00,
    0x00,0x00,
    0xff,0x03,
    0xff,0x03,
    0x00,0x00,
    0xfc,0x00,
    0x78,0x00,
    0x30,0x00
}

Definition at line 110 of file nextclient.cpp.

const unsigned char KStep::maximize_bits[] [static]
Initial value:
 {
   0x30, 0x00, 0x78, 0x00, 0xfc, 0x00, 0xfe, 0x01, 0x00, 0x00, 0xfe, 0x01,
   0x02, 0x01, 0x84, 0x00, 0x48, 0x00, 0x30, 0x00 }

Definition at line 54 of file nextclient.cpp.

bool KStep::pixmaps_created = false [static]

Definition at line 188 of file nextclient.cpp.

const unsigned char KStep::question_bits[] [static]
Initial value:
 {
  0x00, 0x00, 0x78, 0x00, 0xcc, 0x00, 0xc0, 0x00, 0x60, 0x00, 0x30, 0x00,
  0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00}

Definition at line 42 of file nextclient.cpp.

const unsigned char KStep::resize_bits[] [static]
Initial value:
 {
    0xff, 0x03,
    0xff, 0x03,
    0x33, 0x03,
    0x33, 0x03,
    0xf3, 0x03,
    0xf3, 0x03,
    0x03, 0x03,
    0x03, 0x03,
    0xff, 0x03,
    0xff, 0x03
}

Definition at line 136 of file nextclient.cpp.

const unsigned char KStep::shade_bits[] [static]
Initial value:
 {
    0xff,0x03,
    0xff,0x03,
    0x03,0x03,
    0xff,0x03,
    0xff,0x03,
    0x00,0x00,
    0x00,0x00,
    0x00,0x00,
    0x00,0x00,
    0x00,0x00
}

Definition at line 58 of file nextclient.cpp.

const unsigned char KStep::sticky_bits[] [static]
Initial value:
 {
  0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0xfe, 0x01, 0xfe, 0x01,
  0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00}

Definition at line 46 of file nextclient.cpp.

int KStep::titleHeight = 16 [static]

Definition at line 190 of file nextclient.cpp.

const unsigned char KStep::unshade_bits[] [static]
Initial value:
 {
    0xff,0x03,
    0xff,0x03,
    0x03,0x03,
    0x03,0x03,
    0x03,0x03,
    0x03,0x03,
    0x03,0x03,
    0x03,0x03,
    0xff,0x03,
    0xff,0x03
}

Definition at line 71 of file nextclient.cpp.

const unsigned char KStep::unsticky_bits[] [static]
Initial value:
 {
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0xfe, 0x01,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}

Definition at line 50 of file nextclient.cpp.