JWM Source Documentation
Macros | Typedefs | Functions | Variables
color.h File Reference

Functions to handle loading colors. More...

Go to the source code of this file.

Macros

#define COLOR_TITLE_FG   0
 
#define COLOR_TITLE_ACTIVE_FG   1
 
#define COLOR_TITLE_BG1   2
 
#define COLOR_TITLE_BG2   3
 
#define COLOR_TITLE_ACTIVE_BG1   4
 
#define COLOR_TITLE_ACTIVE_BG2   5
 
#define COLOR_TRAY_FG   6
 
#define COLOR_TRAY_BG1   7
 
#define COLOR_TRAY_BG2   8
 
#define COLOR_TRAY_ACTIVE_FG   9
 
#define COLOR_TRAY_ACTIVE_BG1   10
 
#define COLOR_TRAY_ACTIVE_BG2   11
 
#define COLOR_TRAY_UP   12
 
#define COLOR_TRAY_DOWN   13
 
#define COLOR_TRAY_ACTIVE_UP   14
 
#define COLOR_TRAY_ACTIVE_DOWN   15
 
#define COLOR_TASKLIST_FG   16
 
#define COLOR_TASKLIST_BG1   17
 
#define COLOR_TASKLIST_BG2   18
 
#define COLOR_TASKLIST_ACTIVE_FG   19
 
#define COLOR_TASKLIST_ACTIVE_BG1   20
 
#define COLOR_TASKLIST_ACTIVE_BG2   21
 
#define COLOR_TASKLIST_UP   22
 
#define COLOR_TASKLIST_DOWN   23
 
#define COLOR_TASKLIST_ACTIVE_UP   24
 
#define COLOR_TASKLIST_ACTIVE_DOWN   25
 
#define COLOR_TRAYBUTTON_FG   26
 
#define COLOR_TRAYBUTTON_BG1   27
 
#define COLOR_TRAYBUTTON_BG2   28
 
#define COLOR_TRAYBUTTON_ACTIVE_FG   29
 
#define COLOR_TRAYBUTTON_ACTIVE_BG1   30
 
#define COLOR_TRAYBUTTON_ACTIVE_BG2   31
 
#define COLOR_TRAYBUTTON_UP   32
 
#define COLOR_TRAYBUTTON_DOWN   33
 
#define COLOR_TRAYBUTTON_ACTIVE_UP   34
 
#define COLOR_TRAYBUTTON_ACTIVE_DOWN   35
 
#define COLOR_PAGER_BG   36
 
#define COLOR_PAGER_FG   37
 
#define COLOR_PAGER_ACTIVE_BG   38
 
#define COLOR_PAGER_ACTIVE_FG   39
 
#define COLOR_PAGER_OUTLINE   40
 
#define COLOR_PAGER_TEXT   41
 
#define COLOR_MENU_BG   42
 
#define COLOR_MENU_FG   43
 
#define COLOR_MENU_UP   44
 
#define COLOR_MENU_DOWN   45
 
#define COLOR_MENU_ACTIVE_BG1   46
 
#define COLOR_MENU_ACTIVE_BG2   47
 
#define COLOR_MENU_ACTIVE_FG   48
 
#define COLOR_MENU_ACTIVE_UP   49
 
#define COLOR_MENU_ACTIVE_DOWN   50
 
#define COLOR_POPUP_BG   51
 
#define COLOR_POPUP_FG   52
 
#define COLOR_POPUP_OUTLINE   53
 
#define COLOR_TITLE_UP   54
 
#define COLOR_TITLE_DOWN   55
 
#define COLOR_TITLE_ACTIVE_UP   56
 
#define COLOR_TITLE_ACTIVE_DOWN   57
 
#define COLOR_CLOCK_FG   58
 
#define COLOR_CLOCK_BG1   59
 
#define COLOR_CLOCK_BG2   60
 
#define COLOR_COUNT   61
 

Typedefs

typedef unsigned char ColorType
 Enumeration of colors used for various JWM components.
 

Functions

void SetColor (ColorType c, const char *value)
 Set the color to use for a component.
 
char ParseColor (const char *value, XColor *c)
 Parse a color.
 
void GetColor (XColor *c)
 Get the color pixel from red, green, and blue values.
 
XftColor * GetXftColor (ColorType type)
 Get an XFT color.
 

Variables

unsigned long colors [COLOR_COUNT]
 
#define InitializeColors()   (void)(0)
 
void StartupColors (void)
 Startup color support.
 
void ShutdownColors (void)
 Shutdown color support.
 
void DestroyColors (void)
 Release color data.
 

Detailed Description

Functions to handle loading colors.

Author
Joe Wingbermuehle
Date
2004-2006

Definition in file color.h.

Macro Definition Documentation

#define COLOR_CLOCK_BG1   59

Definition at line 77 of file color.h.

Referenced by DrawClock(), and ParseClockStyle().

#define COLOR_CLOCK_BG2   60

Definition at line 78 of file color.h.

Referenced by DrawClock(), and ParseClockStyle().

#define COLOR_CLOCK_FG   58

Definition at line 76 of file color.h.

Referenced by DrawClock(), and ParseClockStyle().

#define COLOR_COUNT   61
#define COLOR_MENU_ACTIVE_BG1   46

Definition at line 64 of file color.h.

Referenced by DrawButton(), and ParseMenuStyle().

#define COLOR_MENU_ACTIVE_BG2   47

Definition at line 65 of file color.h.

Referenced by DrawButton(), and ParseMenuStyle().

#define COLOR_MENU_ACTIVE_DOWN   50

Definition at line 68 of file color.h.

Referenced by DrawButton(), and ParseMenuStyle().

#define COLOR_MENU_ACTIVE_FG   48

Definition at line 66 of file color.h.

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

#define COLOR_MENU_ACTIVE_UP   49

Definition at line 67 of file color.h.

Referenced by DrawButton(), and ParseMenuStyle().

#define COLOR_MENU_BG   42
#define COLOR_MENU_DOWN   45

Definition at line 63 of file color.h.

Referenced by DrawButton(), DrawMenu(), DrawMenuItem(), DrawMoveResizeWindow(), and ParseMenuStyle().

#define COLOR_MENU_FG   43
#define COLOR_MENU_UP   44

Definition at line 62 of file color.h.

Referenced by DrawButton(), DrawMenu(), DrawMenuItem(), DrawMoveResizeWindow(), and ParseMenuStyle().

#define COLOR_PAGER_ACTIVE_BG   38

Definition at line 56 of file color.h.

Referenced by DrawPager(), and ParsePagerStyle().

#define COLOR_PAGER_ACTIVE_FG   39

Definition at line 57 of file color.h.

Referenced by DrawPagerClient(), and ParsePagerStyle().

#define COLOR_PAGER_BG   36

Definition at line 54 of file color.h.

Referenced by DrawPager(), and ParsePagerStyle().

#define COLOR_PAGER_FG   37

Definition at line 55 of file color.h.

Referenced by DrawPagerClient(), and ParsePagerStyle().

#define COLOR_PAGER_OUTLINE   40

Definition at line 58 of file color.h.

Referenced by DrawPager(), DrawPagerClient(), and ParsePagerStyle().

#define COLOR_PAGER_TEXT   41

Definition at line 59 of file color.h.

Referenced by DrawPager(), and ParsePagerStyle().

#define COLOR_POPUP_BG   51

Definition at line 69 of file color.h.

Referenced by ParsePopupStyle(), and ShowPopup().

#define COLOR_POPUP_FG   52

Definition at line 70 of file color.h.

Referenced by ParsePopupStyle(), and ShowPopup().

#define COLOR_POPUP_OUTLINE   53

Definition at line 71 of file color.h.

Referenced by ParsePopupStyle(), and ShowPopup().

#define COLOR_TASKLIST_ACTIVE_BG1   20

Definition at line 38 of file color.h.

Referenced by DrawButton().

#define COLOR_TASKLIST_ACTIVE_BG2   21

Definition at line 39 of file color.h.

Referenced by DrawButton().

#define COLOR_TASKLIST_ACTIVE_DOWN   25

Definition at line 43 of file color.h.

Referenced by DrawButton().

#define COLOR_TASKLIST_ACTIVE_FG   19

Definition at line 37 of file color.h.

Referenced by DrawButton().

#define COLOR_TASKLIST_ACTIVE_UP   24

Definition at line 42 of file color.h.

Referenced by DrawButton().

#define COLOR_TASKLIST_BG1   17

Definition at line 35 of file color.h.

Referenced by DrawButton().

#define COLOR_TASKLIST_BG2   18

Definition at line 36 of file color.h.

Referenced by DrawButton().

#define COLOR_TASKLIST_DOWN   23

Definition at line 41 of file color.h.

Referenced by DrawButton().

#define COLOR_TASKLIST_FG   16

Definition at line 34 of file color.h.

Referenced by DrawButton(), and Parse().

#define COLOR_TASKLIST_UP   22

Definition at line 40 of file color.h.

Referenced by DrawButton().

#define COLOR_TITLE_ACTIVE_BG1   4

Definition at line 22 of file color.h.

Referenced by DrawBorderHelper(), and ParseActiveWindowStyle().

#define COLOR_TITLE_ACTIVE_BG2   5

Definition at line 23 of file color.h.

Referenced by DrawBorderHelper(), and ParseActiveWindowStyle().

#define COLOR_TITLE_ACTIVE_DOWN   57
#define COLOR_TITLE_ACTIVE_FG   1

Definition at line 19 of file color.h.

Referenced by DrawBorderButtons(), DrawBorderHelper(), and ParseActiveWindowStyle().

#define COLOR_TITLE_ACTIVE_UP   56

Definition at line 74 of file color.h.

Referenced by DrawBorderButtons(), DrawBorderHandles(), and ParseActiveWindowStyle().

#define COLOR_TITLE_BG1   2

Definition at line 20 of file color.h.

Referenced by DrawBorderHelper(), and ParseWindowStyle().

#define COLOR_TITLE_BG2   3

Definition at line 21 of file color.h.

Referenced by DrawBorderHelper(), ParseWindowStyle(), and ReparentClient().

#define COLOR_TITLE_DOWN   55

Definition at line 73 of file color.h.

Referenced by DrawBorderButtons(), DrawBorderHandles(), DrawBorderHelper(), and ParseWindowStyle().

#define COLOR_TITLE_FG   0

Definition at line 18 of file color.h.

Referenced by DrawBorderButtons(), DrawBorderHelper(), and ParseWindowStyle().

#define COLOR_TITLE_UP   54

Definition at line 72 of file color.h.

Referenced by DrawBorderButtons(), DrawBorderHandles(), and ParseWindowStyle().

#define COLOR_TRAY_ACTIVE_BG1   10

Definition at line 28 of file color.h.

Referenced by ParseTrayStyle().

#define COLOR_TRAY_ACTIVE_BG2   11

Definition at line 29 of file color.h.

Referenced by ParseTrayStyle().

#define COLOR_TRAY_ACTIVE_DOWN   15

Definition at line 33 of file color.h.

Referenced by ParseTrayStyle().

#define COLOR_TRAY_ACTIVE_FG   9

Definition at line 27 of file color.h.

Referenced by ParseTrayStyle().

#define COLOR_TRAY_ACTIVE_UP   14

Definition at line 32 of file color.h.

Referenced by ParseTrayStyle().

#define COLOR_TRAY_BG1   7

Definition at line 25 of file color.h.

Referenced by ClearTrayDrawable(), and ParseTrayStyle().

#define COLOR_TRAY_BG2   8

Definition at line 26 of file color.h.

Referenced by CheckSwallowMap(), ClearTrayDrawable(), ParseTrayStyle(), StartupDock(), and StartupTray().

#define COLOR_TRAY_DOWN   13

Definition at line 31 of file color.h.

Referenced by DrawSpecificTray(), and ParseTrayStyle().

#define COLOR_TRAY_FG   6

Definition at line 24 of file color.h.

Referenced by Parse(), and ParseTrayStyle().

#define COLOR_TRAY_UP   12

Definition at line 30 of file color.h.

Referenced by DrawSpecificTray(), and ParseTrayStyle().

#define COLOR_TRAYBUTTON_ACTIVE_BG1   30

Definition at line 48 of file color.h.

Referenced by DrawButton(), and ParseTrayButtonStyle().

#define COLOR_TRAYBUTTON_ACTIVE_BG2   31

Definition at line 49 of file color.h.

Referenced by DrawButton(), and ParseTrayButtonStyle().

#define COLOR_TRAYBUTTON_ACTIVE_DOWN   35

Definition at line 53 of file color.h.

Referenced by DrawButton(), and ParseTrayButtonStyle().

#define COLOR_TRAYBUTTON_ACTIVE_FG   29

Definition at line 47 of file color.h.

Referenced by DrawButton(), and ParseTrayButtonStyle().

#define COLOR_TRAYBUTTON_ACTIVE_UP   34

Definition at line 52 of file color.h.

Referenced by DrawButton(), and ParseTrayButtonStyle().

#define COLOR_TRAYBUTTON_BG1   27

Definition at line 45 of file color.h.

Referenced by DrawButton(), and ParseTrayButtonStyle().

#define COLOR_TRAYBUTTON_BG2   28

Definition at line 46 of file color.h.

Referenced by DrawButton(), and ParseTrayButtonStyle().

#define COLOR_TRAYBUTTON_DOWN   33

Definition at line 51 of file color.h.

Referenced by DrawButton(), and ParseTrayButtonStyle().

#define COLOR_TRAYBUTTON_FG   26

Definition at line 44 of file color.h.

Referenced by DrawButton(), Parse(), and ParseTrayButtonStyle().

#define COLOR_TRAYBUTTON_UP   32

Definition at line 50 of file color.h.

Referenced by DrawButton(), and ParseTrayButtonStyle().

#define InitializeColors ( )    (void)(0)

Definition at line 84 of file color.h.

Referenced by Initialize().

Typedef Documentation

typedef unsigned char ColorType

Enumeration of colors used for various JWM components.

For easier parsing, tray components must all have colors ordered the same way as COLOR_TRAY_*.

Definition at line 17 of file color.h.

Function Documentation

void DestroyColors ( void  )

Release color data.

Definition at line 288 of file color.c.

References COLOR_COUNT, names, and Release.

Referenced by Destroy(), and StartupColors().

void GetColor ( XColor *  c)

Get the color pixel from red, green, and blue values.

Parameters
cThe structure containing the rgb values and the pixel value.

Definition at line 466 of file color.c.

References GetDirectPixel(), GetMappedPixel(), and rootVisual.

Referenced by AllocateColor(), CreateScaledRenderIcon(), DrawHorizontalGradient(), GetScaledIcon(), and ParseColor().

XftColor* GetXftColor ( ColorType  type)

Get an XFT color.

Parameters
typeThe color whose XFT color to get.
Returns
The XFT color.

Definition at line 481 of file color.c.

References Allocate, display, JXftColorAllocValue, rgbColors, rootColormap, rootVisual, and xftColors.

Referenced by RenderString().

char ParseColor ( const char *  value,
XColor *  c 
)

Parse a color.

Parameters
valueThe color name or hex value.
cThe color return value (with pixel and components filled).
Returns
1 on success, 0 on failure.

Definition at line 369 of file color.c.

References GetColor(), JLIKELY, and ParseColorToRGB().

Referenced by LoadGradientBackground().

void SetColor ( ColorType  c,
const char *  value 
)

Set the color to use for a component.

Parameters
cThe component whose color to set.
valueThe color to use.

Definition at line 330 of file color.c.

References CopyString(), InitializeNames(), JUNLIKELY, names, Release, and Warning().

Referenced by ParseActive(), ParseActiveWindowStyle(), ParseClockStyle(), ParseGradient(), ParseMenuStyle(), ParsePagerStyle(), ParsePopupStyle(), ParseTrayButtonStyle(), ParseTrayStyle(), and ParseWindowStyle().

void ShutdownColors ( void  )

Shutdown color support.

Definition at line 250 of file color.c.

References COLOR_COUNT, colors, display, JXFreeColors, JXftColorFree, MAX_COLORS, Release, rgbColors, rgbToPixel, rootColormap, rootVisual, and xftColors.

Referenced by Shutdown().

void StartupColors ( void  )

Variable Documentation

unsigned long colors[COLOR_COUNT]

joewing.net / Projects / JWM