JWM Source Documentation
Data Structures | Typedefs | Functions | Variables
icon.h File Reference

Header file for icon functions. More...

Go to the source code of this file.

Data Structures

struct  ScaledIconNode
 Structure to hold a scaled icon. More...
struct  IconNode
 Structure to hold an icon. More...


typedef struct ScaledIconNode ScaledIconNode
 Structure to hold a scaled icon.
typedef struct IconNode IconNode
 Structure to hold an icon.


void AddIconPath (char *path)
 Add an icon path.
void PutIcon (IconNode *icon, Drawable d, long fg, int x, int y, int width, int height)
 Render an icon.
void LoadIcon (struct ClientNode *np)
 Load an icon for a client.
IconNodeLoadNamedIcon (const char *name, char save, char preserveAspect)
 Load an icon.
IconNodeGetDefaultIcon (void)
 Load the default icon.
void DestroyIcon (IconNode *icon)
 Destroy an icon.
void SetDefaultIcon (const char *name)
 Set the default icon.
void InitializeIcons (void)
 Initialize icon data.
void StartupIcons (void)
 Startup icon support.
void ShutdownIcons (void)
 Shutdown icon support.
void DestroyIcons (void)
 Destroy icon data.


IconNode emptyIcon

Detailed Description

Header file for icon functions.

Joe Wingbermuehle

Definition in file icon.h.

Typedef Documentation

typedef struct IconNode IconNode

Structure to hold an icon.

Structure to hold a scaled icon.

Function Documentation

void AddIconPath ( char *  path)

Add an icon path.

This adds a path to the list of icon search paths.

pathThe icon path to add.

Definition at line 159 of file icon.c.

References Allocate, ExpandPath(), IconPathNode::next, IconPathNode::path, and Trim().

Referenced by Parse().

void DestroyIcon ( IconNode icon)

Destroy an icon.

iconThe icon to destroy.

Definition at line 860 of file icon.c.

References DoDestroyIcon(), GetHash(), IconNode::name, and IconNode::transient.

Referenced by ApplyGroup(), LoadIcon(), LoadImageBackground(), and RemoveClient().

void DestroyIcons ( void  )

Destroy icon data.

Definition at line 138 of file icon.c.

References defaultIconName, IconPathNode::next, IconPathNode::path, and Release.

Referenced by Destroy().

IconNode* GetDefaultIcon ( void  )

Load the default icon.

The default icon.

Definition at line 446 of file icon.c.

References CopyString(), CreateIcon(), CreateImage(), ImageNode::data, defaultIconName, emptyIcon, FindIcon(), IconNode::images, InsertIcon(), LoadNamedIcon(), IconNode::name, and ImageNode::render.

Referenced by Render(), ShowClientList(), and StartupBorders().

void InitializeIcons ( void  )

Initialize icon data.

This must be initialized before parsing the configuration.

Definition at line 92 of file icon.c.

References Allocate, defaultIconName, HASH_SIZE, and iconSizeSet.

Referenced by Initialize().

void LoadIcon ( ClientNode np)

Load an icon for a client.

npThe client.

Definition at line 251 of file icon.c.

References DestroyIcon(), ClientNode::icon, ClientNode::instanceName, LoadNamedIcon(), ClientNode::owner, ReadNetWMIcon(), ReadWMHintIcon(), and ClientNode::window.

Referenced by AddClientWindow(), and HandlePropertyNotify().

IconNode* LoadNamedIcon ( const char *  name,
char  save,
char  preserveAspect 

Load an icon.

nameThe name of the icon to load.
saveSet if this icon should be saved in the icon hash.
preserveAspectSet to preserve the aspect ratio when scaling.
A pointer to the icon (NULL if not found).

Definition at line 291 of file icon.c.

References Assert, CopyString(), CreateIcon(), DestroyImage(), emptyIcon, FindIcon(), InsertIcon(), LoadImage(), LoadNamedIconHelper(), IconNode::name, IconPathNode::next, IconPathNode::path, and IconNode::preserveAspect.

Referenced by ApplyGroup(), GetDefaultIcon(), InitializeMenu(), LoadIcon(), LoadImageBackground(), StartupBorders(), and StartupTrayButtons().

void PutIcon ( IconNode icon,
Drawable  d,
long  fg,
int  x,
int  y,
int  width,
int  height 

Render an icon.

This will scale an icon if necessary to fit the requested size. The aspect ratio of the icon is preserved.

iconThe icon to render.
dThe drawable on which to place the icon.
fgThe foreground color.
xThe x offset on the drawable to render the icon.
yThe y offset on the drawable to render the icon.
widthThe width of the icon to display.
heightThe height of the icon to display.

Definition at line 199 of file icon.c.

References Assert, display, GetScaledIcon(), ScaledIconNode::height, iconGC, ScaledIconNode::image, JXCopyArea, JXSetClipMask, JXSetClipOrigin, ScaledIconNode::mask, PutScaledRenderIcon(), IconNode::render, and ScaledIconNode::width.

Referenced by DrawBorderHelper(), DrawBorderIcon(), DrawButton(), and LoadImageBackground().

void SetDefaultIcon ( const char *  name)

Set the default icon.

Definition at line 914 of file icon.c.

References CopyString(), defaultIconName, and Release.

Referenced by Parse().

void ShutdownIcons ( void  )

Shutdown icon support.

Definition at line 126 of file icon.c.

References display, DoDestroyIcon(), HASH_SIZE, iconGC, and JXFreeGC.

Referenced by Shutdown().

void StartupIcons ( void  )

Startup icon support.

Definition at line 107 of file icon.c.

References display, GetBorderIconSize(), iconGC, JXCreateGC, JXSetIconSizes, and rootWindow.

Referenced by Startup().

Variable Documentation

IconNode emptyIcon

Definition at line 22 of file icon.c.

Referenced by DrawButton(), GetDefaultIcon(), InitializeMenu(), and LoadNamedIcon().

joewing.net / Projects / JWM