Back to index

kdeartwork  4.3.2
Classes | Enumerations | Functions | Variables
CDE Namespace Reference

Classes

class  CdeButton
class  CdeClient
class  CdeClientFactory

Enumerations

enum  Buttons {
  BtnMenu = 0, BtnHelp, BtnIconify, BtnMax,
  BtnClose, BtnCount
}

Functions

static const KDecorationOptions * options ()
static void fixColorGroup (QColorGroup &colorGroup)
static int scaleCoord (int c)
static void readConfig (CdeClientFactory *f)

Variables

static int s_frameWidth = 5
static int s_buttonSize = 19
static bool titlebarButtonMode = true
static bool coloredFrame = true
static Qt::AlignmentFlags textAlignment = Qt::AlignHCenter
static const int borderSizes [] = { 4, 6, 9, 12, 18, 26, 42 }
static int s_o1 = 4
static int s_o2 = 7
static int s_w1 = 11
static int s_w2 = 5
static const int NUM_CLOSEL_COORDS = 2 * 14
static const QCOORD closeLLinesTemplate [NUM_CLOSEL_COORDS]
static const int NUM_CLOSED_COORDS = 2 * 18
static const QCOORD closeDLinesTemplate [NUM_CLOSED_COORDS]
static QCOORD closeLLines [NUM_CLOSEL_COORDS]
static QCOORD closeDLines [NUM_CLOSED_COORDS]
static const int NUM_HELPL_COORDS = 2 * 16
static const QCOORD helpLLinesTemplate [NUM_HELPL_COORDS]
static const int NUM_HELPD_COORDS = 2 * 14
static const QCOORD helpDLinesTemplate [NUM_HELPD_COORDS]
static QCOORD helpLLines [NUM_HELPL_COORDS]
static QCOORD helpDLines [NUM_HELPD_COORDS]

Enumeration Type Documentation

Enumerator:
BtnMenu 
BtnHelp 
BtnIconify 
BtnMax 
BtnClose 
BtnCount 

Definition at line 46 of file cdeclient.h.


Function Documentation

static void CDE::fixColorGroup ( QColorGroup &  colorGroup) [static]

Definition at line 127 of file cdeclient.cpp.

{
    QColor light = colorGroup.light();

    int hue, saturation, value;

    light.hsv(&hue, &saturation, &value);

    if (value < 128)
    {
      light.setHsv(hue, saturation, 128);
      colorGroup.setColor(QPalette::Light, light);
    }

    QColor dark = colorGroup.dark();

    dark.hsv(&hue, &saturation, &value);

    if (value < 84)
    {
      dark.setHsv(hue, saturation, 84);
      colorGroup.setColor(QPalette::Dark, dark);
    }
}

Here is the caller graph for this function:

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

Definition at line 122 of file cdeclient.cpp.

{
    return KDecoration::options();
}

Here is the caller graph for this function:

static void CDE::readConfig ( CdeClientFactory *  f) [static]

Definition at line 161 of file cdeclient.cpp.

{
    KConfig conf( "kwincderc" );

    conf.setGroup("General");
    coloredFrame = conf.readEntry( "UseTitleBarBorderColors", true );
    titlebarButtonMode = conf.readEntry( "TitlebarButtonMode", true );

    QString value = conf.readEntry( "TextAlignment", "AlignHCenter" );
    if ( value == "AlignLeft" )
       textAlignment = Qt::AlignLeft;
    else if ( value == "AlignHCenter" )
       textAlignment = Qt::AlignHCenter;
    else if ( value == "AlignRight" )
       textAlignment = Qt::AlignRight;


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

    // Do not allow malicious users or corrupt config files to
    // go past the domain of the valid border sizes.

    // Size limit increased for accessability. LM
    if (s_frameWidth < 0)  s_frameWidth = 0;
    if (s_frameWidth > 30) s_frameWidth = 30;

    // Force button size to be in a reasonable range.
    // If the frame width is large, the button size must be large too.
    s_buttonSize = QFontMetrics(options()->font( true )).height() + 2;
    if (s_buttonSize < 19) s_buttonSize = 19;
    if (s_buttonSize < s_frameWidth) s_buttonSize = s_frameWidth;
    s_buttonSize |= 1; // Be sure the button size is odd.

    // Calculate widths and offsets for the button icons
    s_o1 = s_buttonSize * 4 / 19;
    s_o2 = s_buttonSize * 7 / 19;
    s_w1 = s_buttonSize - 2 * s_o1;
    s_w2 = s_buttonSize - 2 * s_o2;

    // Copy and scale the close icon
    int offset = (s_buttonSize - 19) / 2;
    for (int i = 0; i < NUM_CLOSEL_COORDS; i++) {
       closeLLines[i] = scaleCoord(closeLLinesTemplate[i]);
    }
    for (int i = 0; i < NUM_CLOSED_COORDS; i++) {
       closeDLines[i] = scaleCoord(closeDLinesTemplate[i]);
    }
    // Copy and center the help icon
    for (int i = 0; i < NUM_HELPL_COORDS; i++) {
       helpLLines[i] = helpLLinesTemplate[i] + offset;
    }
    for (int i = 0; i < NUM_HELPD_COORDS; i++) {
       helpDLines[i] = helpDLinesTemplate[i] + offset;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static int CDE::scaleCoord ( int  c) [static]

Definition at line 154 of file cdeclient.cpp.

{
    if (c < 6) return c;
    if (c <= 11) return c + (s_buttonSize - 19) / 2;
    return c + s_buttonSize - 19;
}

Here is the caller graph for this function:


Variable Documentation

const int CDE::borderSizes[] = { 4, 6, 9, 12, 18, 26, 42 } [static]

Definition at line 59 of file cdeclient.cpp.

Definition at line 81 of file cdeclient.cpp.

Initial value:
    { 5,3, 8,6,  14,4, 14,5,  14,5, 11,8,  11,9, 14,12,  14,12, 14,14,
      14,14, 12,14,  12,14, 9,11,  8,11, 5,14,  5,14, 4,14 }

Definition at line 75 of file cdeclient.cpp.

Definition at line 79 of file cdeclient.cpp.

Initial value:
    { 14,3, 12,3,  12,3, 9,6,  5,3, 3,3,  3,3, 3,5,
      3,5, 6,8, 6,9, 3,12,  3,12, 3,14 }

Definition at line 70 of file cdeclient.cpp.

bool CDE::coloredFrame = true [static]

Definition at line 53 of file cdeclient.cpp.

Definition at line 96 of file cdeclient.cpp.

const QCOORD CDE::helpDLinesTemplate[NUM_HELPD_COORDS] [static]
Initial value:
    {  5,7, 8,6,  12,5, 12,8,  12,8, 10,10,  10,10, 10,11,
       10,11, 8,11,  10,14, 10,13,  9,15, 8,15 }

Definition at line 90 of file cdeclient.cpp.

Definition at line 94 of file cdeclient.cpp.

const QCOORD CDE::helpLLinesTemplate[NUM_HELPL_COORDS] [static]
Initial value:
    { 4,6, 4,5,  4,5, 6,3,  6,3, 9,3,  10,3, 11,4,
      9,7, 7,9,  7,9, 7,10,  7,14, 7,13,  8,12, 9,12  }

Definition at line 85 of file cdeclient.cpp.

const int CDE::NUM_CLOSED_COORDS = 2 * 18 [static]

Definition at line 74 of file cdeclient.cpp.

const int CDE::NUM_CLOSEL_COORDS = 2 * 14 [static]

Definition at line 69 of file cdeclient.cpp.

const int CDE::NUM_HELPD_COORDS = 2 * 14 [static]

Definition at line 89 of file cdeclient.cpp.

const int CDE::NUM_HELPL_COORDS = 2 * 16 [static]

Definition at line 84 of file cdeclient.cpp.

int CDE::s_buttonSize = 19 [static]

Definition at line 51 of file cdeclient.cpp.

int CDE::s_frameWidth = 5 [static]

Definition at line 50 of file cdeclient.cpp.

int CDE::s_o1 = 4 [static]

Definition at line 62 of file cdeclient.cpp.

int CDE::s_o2 = 7 [static]

Definition at line 63 of file cdeclient.cpp.

int CDE::s_w1 = 11 [static]

Definition at line 64 of file cdeclient.cpp.

int CDE::s_w2 = 5 [static]

Definition at line 65 of file cdeclient.cpp.

Qt::AlignmentFlags CDE::textAlignment = Qt::AlignHCenter [static]

Definition at line 54 of file cdeclient.cpp.

bool CDE::titlebarButtonMode = true [static]

Definition at line 52 of file cdeclient.cpp.