JWM Source Documentation
Data Structures | Macros | Typedefs | Functions
button.h File Reference

Functions for rendering buttons. More...

#include "font.h"
#include "settings.h"

Go to the source code of this file.

Data Structures

struct  ButtonNode
 Data used for drawing a button. More...
 

Macros

#define BUTTON_LABEL   0
 Label.
 
#define BUTTON_MENU   1
 Menu item.
 
#define BUTTON_MENU_ACTIVE   2
 Active menu item.
 
#define BUTTON_TRAY   3
 Inactive tray button.
 
#define BUTTON_TRAY_ACTIVE   4
 Active tray button.
 
#define BUTTON_TASK   5
 Item in the task list.
 
#define BUTTON_TASK_ACTIVE   6
 Active item in the task list.
 

Typedefs

typedef unsigned char ButtonType
 Button types.
 

Functions

void DrawButton (ButtonNode *bp)
 Draw a button.
 
void ResetButton (ButtonNode *bp, Drawable d)
 Reset the contents of a ButtonNode structure.
 

Detailed Description

Functions for rendering buttons.

Author
Joe Wingbermuehle
Date
2004-2006

Definition in file button.h.

Macro Definition Documentation

#define BUTTON_LABEL   0

Label.

Definition at line 20 of file button.h.

Referenced by DrawButton(), and DrawMenuItem().

#define BUTTON_MENU   1

Menu item.

Definition at line 21 of file button.h.

Referenced by DrawButton(), DrawButtons(), and ResetButton().

#define BUTTON_MENU_ACTIVE   2

Active menu item.

Definition at line 22 of file button.h.

Referenced by DrawButton(), DrawButtons(), and DrawMenuItem().

#define BUTTON_TASK   5

Item in the task list.

Definition at line 25 of file button.h.

Referenced by DrawButton(), and Render().

#define BUTTON_TASK_ACTIVE   6

Active item in the task list.

Definition at line 26 of file button.h.

Referenced by DrawButton(), and Render().

#define BUTTON_TRAY   3

Inactive tray button.

Definition at line 23 of file button.h.

Referenced by Draw(), and DrawButton().

#define BUTTON_TRAY_ACTIVE   4

Active tray button.

Definition at line 24 of file button.h.

Referenced by Draw(), and DrawButton().

Typedef Documentation

typedef unsigned char ButtonType

Button types.

Definition at line 16 of file button.h.

Function Documentation

void DrawButton ( ButtonNode bp)

Draw a button.

Parameters
bpThe button to draw.

Definition at line 20 of file button.c.

References ALIGN_CENTER, ButtonNode::alignment, Assert, ButtonNode::border, BUTTON_LABEL, BUTTON_MENU, BUTTON_MENU_ACTIVE, BUTTON_TASK, BUTTON_TASK_ACTIVE, BUTTON_TRAY, BUTTON_TRAY_ACTIVE, COLOR_MENU_ACTIVE_BG1, COLOR_MENU_ACTIVE_BG2, COLOR_MENU_ACTIVE_DOWN, COLOR_MENU_ACTIVE_FG, COLOR_MENU_ACTIVE_UP, COLOR_MENU_BG, COLOR_MENU_DOWN, COLOR_MENU_FG, COLOR_MENU_UP, COLOR_TASKLIST_ACTIVE_BG1, COLOR_TASKLIST_ACTIVE_BG2, COLOR_TASKLIST_ACTIVE_DOWN, COLOR_TASKLIST_ACTIVE_FG, COLOR_TASKLIST_ACTIVE_UP, COLOR_TASKLIST_BG1, COLOR_TASKLIST_BG2, COLOR_TASKLIST_DOWN, COLOR_TASKLIST_FG, COLOR_TASKLIST_UP, COLOR_TRAYBUTTON_ACTIVE_BG1, COLOR_TRAYBUTTON_ACTIVE_BG2, COLOR_TRAYBUTTON_ACTIVE_DOWN, COLOR_TRAYBUTTON_ACTIVE_FG, COLOR_TRAYBUTTON_ACTIVE_UP, COLOR_TRAYBUTTON_BG1, COLOR_TRAYBUTTON_BG2, COLOR_TRAYBUTTON_DOWN, COLOR_TRAYBUTTON_FG, COLOR_TRAYBUTTON_UP, colors, DECO_MOTIF, display, down, ButtonNode::drawable, DrawHorizontalGradient(), emptyIcon, ButtonNode::fill, ButtonNode::font, GetStringHeight(), GetStringWidth(), IconNode::height, ButtonNode::height, ButtonNode::icon, JXCreateGC, JXDrawLine, JXDrawRectangle, JXFillRectangle, JXFreeGC, JXSetForeground, Settings::menuDecorations, Min, PutIcon(), RenderString(), settings, Settings::taskListDecorations, ButtonNode::text, Settings::trayDecorations, ButtonNode::type, up, IconNode::width, ButtonNode::width, ButtonNode::x, and ButtonNode::y.

Referenced by Draw(), DrawButtons(), DrawMenuItem(), and Render().

void ResetButton ( ButtonNode bp,
Drawable  d 
)

Reset the contents of a ButtonNode structure.

Parameters
bpThe structure to reset.
dThe drawable to use.

Definition at line 205 of file button.c.

References ALIGN_LEFT, ButtonNode::alignment, Assert, ButtonNode::border, BUTTON_MENU, ButtonNode::drawable, ButtonNode::fill, ButtonNode::font, FONT_TRAY, ButtonNode::height, ButtonNode::icon, ButtonNode::text, ButtonNode::type, ButtonNode::width, ButtonNode::x, and ButtonNode::y.

Referenced by Draw(), DrawButtons(), DrawMenuItem(), and Render().

joewing.net / Projects / JWM