Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

PrettyDrawer Class Reference

#include <drawer.h>

Inheritance diagram for PrettyDrawer:

Inheritance graph
[legend]
Collaboration diagram for PrettyDrawer:

Collaboration graph
[legend]
List of all members.

Public Methods

 PrettyDrawer (Gdk_Window const awindow)
void operator() (EntryRect const &cur, Gdk_Color rcolor)
void brightness (Gdk_Color &curcolor, float amount) const
void fg_brightness (Gdk_Color curcolor, float amount)

Constructor & Destructor Documentation

PrettyDrawer::PrettyDrawer Gdk_Window const    awindow
 

00042    : Drawer(awindow)
00043 {}


Member Function Documentation

void PrettyDrawer::operator() EntryRect const &    cur,
Gdk_Color    rcolor
[virtual]
 

Reimplemented from Drawer.

Reimplemented in DarkFirst.

00046 {
00047    float left=cur.left;
00048    float top=cur.top;
00049    float width=cur.width;
00050    float height=cur.height;
00051    float brightness=1;
00052    for (; width>0 && height >0; left++, width-=2, top++, height-=2, brightness*=.985)
00053    {
00054       fg_brightness(curcolor, brightness);
00055       window.draw_rectangle(context, true, static_cast<int>(left), 
00056     static_cast<int>(top), static_cast<int>(width+1), 
00057     static_cast<int>(height));
00058    }
00059 }

void PrettyDrawer::brightness Gdk_Color &    curcolor,
float    amount
const
 

00062 {
00063    curcolor.set_red(static_cast<int>(curcolor.get_red()*amount));
00064    curcolor.set_green(static_cast<int>(curcolor.get_green()*amount));
00065    curcolor.set_blue(static_cast<int>(curcolor.get_blue()*amount));
00066 }

void PrettyDrawer::fg_brightness Gdk_Color    curcolor,
float    amount
 

00069 {
00070    brightness(curcolor, amount);
00071    colormap.alloc(curcolor);
00072    context.set_foreground(curcolor);
00073 }


The documentation for this class was generated from the following files:
Generated on Mon Apr 7 19:43:24 2003 for DuTree by doxygen1.2.18