Back to index

kdeartwork  4.3.2
Classes | Functions | Variables
System Namespace Reference

Classes

class  SystemClient
class  SystemButton
class  SystemDecoFactory

Functions

static void drawButtonFrame (KPixmap *pix, const QColorGroup &g)
static void create_pixmaps ()
static void delete_pixmaps ()

Variables

static unsigned char iconify_bits []
static unsigned char maximize_bits []
static unsigned char r_minmax_bits []
static unsigned char l_minmax_bits []
static unsigned char unsticky_bits []
static unsigned char sticky_bits []
static unsigned char question_bits []
static KPixmap * aUpperGradient = 0
static KPixmap * iUpperGradient = 0
static KPixmap * btnPix = 0
static KPixmap * btnPixDown = 0
static KPixmap * iBtnPix = 0
static KPixmap * iBtnPixDown = 0
static QColor * btnForeground
static bool pixmaps_created = false

Function Documentation

static void System::create_pixmaps ( ) [static]

Definition at line 91 of file systemclient.cpp.

{
    if(pixmaps_created)
        return;
    pixmaps_created = true;

    if(QPixmap::defaultDepth() > 8){
        // titlebar
        aUpperGradient = new KPixmap;
        aUpperGradient->resize(32, 18);
        iUpperGradient = new KPixmap;
        iUpperGradient->resize(32, 18);
        QColor bgColor = kapp->palette().active().background();
        KPixmapEffect::gradient(*aUpperGradient,
                                KDecoration::options()->color(KDecorationOptions::ColorFrame, true).light(130),
                                bgColor,
                                KPixmapEffect::VerticalGradient);
        KPixmapEffect::gradient(*iUpperGradient,
                                KDecoration::options()->color(KDecorationOptions::ColorFrame, false).light(130),
                                bgColor,
                                KPixmapEffect::VerticalGradient);

        // buttons
        KPixmap aPix;
        aPix.resize(12, 12);
        KPixmap iPix;
        iPix.resize(12, 12);
        KPixmap aInternal;
        aInternal.resize(8, 8);
        KPixmap iInternal;
        iInternal.resize(8, 8);

        QColor hColor(KDecoration::options()->color(KDecorationOptions::ColorButtonBg, false));
        KPixmapEffect::gradient(iInternal,
                                hColor.dark(120),
                                hColor.light(120),
                                KPixmapEffect::DiagonalGradient);
        KPixmapEffect::gradient(iPix,
                                hColor.light(150),
                                hColor.dark(150),
                                KPixmapEffect::DiagonalGradient);

        hColor =KDecoration::options()->color(KDecorationOptions::ColorButtonBg, true);
        KPixmapEffect::gradient(aInternal,
                                hColor.dark(120),
                                hColor.light(120),
                                KPixmapEffect::DiagonalGradient);
        KPixmapEffect::gradient(aPix,
                                hColor.light(150),
                                hColor.dark(150),
                                KPixmapEffect::DiagonalGradient);
        bitBlt(&aPix, 1, 1, &aInternal, 0, 0, 8, 8, Qt::CopyROP, true);
        bitBlt(&iPix, 1, 1, &iInternal, 0, 0, 8, 8, Qt::CopyROP, true);

        // normal buttons
        btnPix = new KPixmap;
        btnPix->resize(14, 14);
        bitBlt(btnPix, 2, 2, &aPix, 0, 0, 10, 10, Qt::CopyROP, true);
        drawButtonFrame(btnPix, KDecoration::options()->colorGroup(KDecorationOptions::ColorFrame, true));

        iBtnPix = new KPixmap;
        iBtnPix->resize(14, 14);
        bitBlt(iBtnPix, 2, 2, &iPix, 0, 0, 10, 10, Qt::CopyROP, true);
        drawButtonFrame(iBtnPix, KDecoration::options()->colorGroup(KDecorationOptions::ColorFrame, false));


        // pressed buttons
        hColor = KDecoration::options()->color(KDecorationOptions::ColorButtonBg, false);
        KPixmapEffect::gradient(iInternal,
                                hColor.light(130),
                                hColor.dark(130),
                                KPixmapEffect::DiagonalGradient);
        KPixmapEffect::gradient(iPix,
                                hColor.light(150),
                                hColor.dark(150),
                                KPixmapEffect::DiagonalGradient);

        hColor =KDecoration::options()->color(KDecorationOptions::ColorButtonBg, true);
        KPixmapEffect::gradient(aInternal,
                                hColor.light(130),
                                hColor.dark(130),
                                KPixmapEffect::DiagonalGradient);
        KPixmapEffect::gradient(aPix,
                                hColor.light(150),
                                hColor.dark(150),
                                KPixmapEffect::DiagonalGradient);
        bitBlt(&aPix, 1, 1, &aInternal, 0, 0, 8, 8, Qt::CopyROP, true);
        bitBlt(&iPix, 1, 1, &iInternal, 0, 0, 8, 8, Qt::CopyROP, true);

        btnPixDown = new KPixmap;
        btnPixDown->resize(14, 14);
        bitBlt(btnPixDown, 2, 2, &aPix, 0, 0, 10, 10, Qt::CopyROP, true);
        drawButtonFrame(btnPixDown, KDecoration::options()->colorGroup(KDecorationOptions::ColorFrame,
                                                        true));

        iBtnPixDown = new KPixmap;
        iBtnPixDown->resize(14, 14);
        bitBlt(iBtnPixDown, 2, 2, &iPix, 0, 0, 10, 10, Qt::CopyROP, true);
        drawButtonFrame(iBtnPixDown, options()->colorGroup(KDecorationOptions::ColorFrame,
                                                         false));
    }
    if(qGray(KDecoration::options()->color(KDecorationOptions::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 System::delete_pixmaps ( ) [static]

Definition at line 198 of file systemclient.cpp.

{
    if(aUpperGradient){
        delete aUpperGradient;
        delete iUpperGradient;
        delete btnPix;
        delete btnPixDown;
        delete iBtnPix;
        delete iBtnPixDown;
        aUpperGradient = 0;
    }
    delete btnForeground;
    pixmaps_created = false;
}

Here is the caller graph for this function:

static void System::drawButtonFrame ( KPixmap *  pix,
const QColorGroup &  g 
) [static]

Definition at line 76 of file systemclient.cpp.

{
    QPainter p;
    p.begin(pix);
    p.setPen(g.mid());
    p.drawLine(0, 0, 13, 0);
    p.drawLine(0, 0, 0, 13);
    p.setPen(g.light());
    p.drawLine(13, 0, 13, 13);
    p.drawLine(0, 13, 13, 13);
    p.setPen(g.dark());
    p.drawRect(1, 1, 12, 12);
    p.end();
}

Here is the caller graph for this function:


Variable Documentation

KPixmap* System::aUpperGradient = 0 [static]

Definition at line 65 of file systemclient.cpp.

QColor* System::btnForeground [static]

Definition at line 72 of file systemclient.cpp.

KPixmap* System::btnPix = 0 [static]

Definition at line 68 of file systemclient.cpp.

KPixmap* System::btnPixDown = 0 [static]

Definition at line 69 of file systemclient.cpp.

KPixmap* System::iBtnPix = 0 [static]

Definition at line 70 of file systemclient.cpp.

KPixmap* System::iBtnPixDown = 0 [static]

Definition at line 71 of file systemclient.cpp.

unsigned char System::iconify_bits[] [static]
Initial value:
 {
    0x00, 0x00, 0xff, 0xff, 0x7e, 0x3c, 0x18, 0x00}

Definition at line 44 of file systemclient.cpp.

KPixmap* System::iUpperGradient = 0 [static]

Definition at line 66 of file systemclient.cpp.

unsigned char System::l_minmax_bits[] [static]
Initial value:
 {
    0x30, 0x18, 0xcc, 0xe6, 0xf3, 0xf9, 0xfc, 0xfc}

Definition at line 53 of file systemclient.cpp.

unsigned char System::maximize_bits[] [static]
Initial value:
 {
    0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x00, 0x00}

Definition at line 47 of file systemclient.cpp.

bool System::pixmaps_created = false [static]

Definition at line 74 of file systemclient.cpp.

unsigned char System::question_bits[] [static]
Initial value:
 {
    0x3c, 0x66, 0x60, 0x30, 0x18, 0x00, 0x18, 0x18}

Definition at line 62 of file systemclient.cpp.

unsigned char System::r_minmax_bits[] [static]
Initial value:
 {
    0x0c, 0x18, 0x33, 0x67, 0xcf, 0x9f, 0x3f, 0x3f}

Definition at line 50 of file systemclient.cpp.

unsigned char System::sticky_bits[] [static]
Initial value:
 {
    0x00, 0x00, 0x00, 0x7e, 0x7e, 0x00, 0x00, 0x00}

Definition at line 59 of file systemclient.cpp.

unsigned char System::unsticky_bits[] [static]
Initial value:
 {
    0x00, 0x18, 0x18, 0x7e, 0x7e, 0x18, 0x18, 0x00}

Definition at line 56 of file systemclient.cpp.