JWM Source Documentation
Macros | Typedefs | Functions
border.h File Reference

Functions for handling window borders. More...

#include "gradient.h"

Go to the source code of this file.

Macros

#define BI_CLOSE   0
 
#define BI_MAX   1
 
#define BI_MAX_ACTIVE   2
 
#define BI_MENU   3
 
#define BI_MIN   4
 
#define BI_COUNT   5
 
#define BA_NONE   0
 Do nothing.
 
#define BA_RESIZE   1
 Resize the window.
 
#define BA_MOVE   2
 Move the window.
 
#define BA_CLOSE   3
 Close the window.
 
#define BA_MAXIMIZE   4
 Maximize the window.
 
#define BA_MINIMIZE   5
 Minimize the window.
 
#define BA_MENU   6
 Show the window menu.
 
#define BA_RESIZE_N   0x10
 Resize north.
 
#define BA_RESIZE_S   0x20
 Resize south.
 
#define BA_RESIZE_E   0x40
 Resize east.
 
#define BA_RESIZE_W   0x80
 Resize west.
 

Typedefs

typedef unsigned char BorderIconType
 Border icon types.
 
typedef unsigned char BorderActionType
 Flags to determine what action to take on the border.
 

Functions

BorderActionType GetBorderActionType (const struct ClientNode *np, int x, int y)
 Determine the action to take for a client.
 
void ResetBorder (const struct ClientNode *np)
 Reset the shape of a window border.
 
void DrawBorder (struct ClientNode *np)
 Draw a window border.
 
int GetBorderIconSize (void)
 Get the size of a border icon.
 
unsigned GetTitleHeight (void)
 Get the height of a window title bar.
 
void GetBorderSize (const struct ClientState *state, int *north, int *south, int *east, int *west)
 Get the size of a window border.
 
void ExposeCurrentDesktop (void)
 Redraw all borders on the current desktop.
 
void DrawRoundedRectangle (Drawable d, GC gc, int x, int y, int width, int height, int radius)
 Draw a rounded rectangle.
 
void SetBorderIcon (BorderIconType t, const char *name)
 Set the icon to use for a border button.
 
#define ShutdownBorders()   (void)(0)
 
void InitializeBorders (void)
 Initialize structures.
 
void StartupBorders (void)
 Initialize server resources.
 
void DestroyBorders (void)
 Destroy structures.
 

Detailed Description

Functions for handling window borders.

Author
Joe Wingbermuehle
Date
2004-2006

Definition in file border.h.

Macro Definition Documentation

#define BA_CLOSE   3

Close the window.

Definition at line 32 of file border.h.

Referenced by DispatchBorderButtonEvent(), GetBorderActionType(), and GetFrameCursor().

#define BA_MAXIMIZE   4

Maximize the window.

Definition at line 33 of file border.h.

Referenced by DispatchBorderButtonEvent(), GetBorderActionType(), and GetFrameCursor().

#define BA_MENU   6

Show the window menu.

Definition at line 35 of file border.h.

Referenced by DispatchBorderButtonEvent(), and GetBorderActionType().

#define BA_MINIMIZE   5

Minimize the window.

Definition at line 34 of file border.h.

Referenced by DispatchBorderButtonEvent(), GetBorderActionType(), and GetFrameCursor().

#define BA_MOVE   2

Move the window.

Definition at line 31 of file border.h.

Referenced by DispatchBorderButtonEvent(), GetBorderActionType(), and GetFrameCursor().

#define BA_NONE   0

Do nothing.

Definition at line 29 of file border.h.

Referenced by AddClientWindow(), GetBorderActionType(), and HandleEnterNotify().

#define BA_RESIZE   1
#define BA_RESIZE_E   0x40
#define BA_RESIZE_N   0x10

Resize north.

Definition at line 36 of file border.h.

Referenced by GetBorderActionType(), GetResizeCursor(), HandleNetWMMoveResize(), and ResizeClient().

#define BA_RESIZE_S   0x20
#define BA_RESIZE_W   0x80

Resize west.

Definition at line 39 of file border.h.

Referenced by GetBorderActionType(), GetResizeCursor(), HandleNetWMMoveResize(), and ResizeClient().

#define BI_CLOSE   0

Definition at line 20 of file border.h.

Referenced by DrawCloseButton(), and Parse().

#define BI_COUNT   5

Definition at line 25 of file border.h.

Referenced by DestroyBorders(), and StartupBorders().

#define BI_MAX   1

Definition at line 21 of file border.h.

Referenced by DrawMaxIButton(), and Parse().

#define BI_MAX_ACTIVE   2

Definition at line 22 of file border.h.

Referenced by DrawMaxAButton(), and Parse().

#define BI_MENU   3

Definition at line 23 of file border.h.

Referenced by DrawBorderHelper(), Parse(), and StartupBorders().

#define BI_MIN   4

Definition at line 24 of file border.h.

Referenced by DrawMinButton(), and Parse().

#define ShutdownBorders ( )    (void)(0)

Definition at line 44 of file border.h.

Referenced by Shutdown().

Typedef Documentation

typedef unsigned char BorderActionType

Flags to determine what action to take on the border.

Definition at line 28 of file border.h.

typedef unsigned char BorderIconType

Border icon types.

Definition at line 16 of file border.h.

Function Documentation

void DestroyBorders ( void  )

Destroy structures.

Definition at line 75 of file border.c.

References BI_COUNT, buttonNames, and Release.

Referenced by Destroy().

void DrawBorder ( ClientNode np)
void DrawRoundedRectangle ( Drawable  d,
GC  gc,
int  x,
int  y,
int  width,
int  height,
int  radius 
)

Draw a rounded rectangle.

Parameters
dThe drawable on which to render.
gcThe graphics context.
xThe x-coodinate.
yThe y-coordinate.
widthThe width.
heightThe height.
radiusThe corner radius.

Definition at line 1230 of file border.c.

References display, JXDrawArcs, JXDrawRectangle, and JXDrawSegments.

Referenced by DrawBorderHelper().

void ExposeCurrentDesktop ( void  )

Redraw all borders on the current desktop.

Redraw all borders on the current desktop.

This should be done after loading clients since the stacking order may cause borders on the current desktop to become visible after moving clients to their assigned desktops.

Definition at line 1139 of file border.c.

References DrawBorder(), LAYER_COUNT, ClientNode::next, nodes, STAT_HIDDEN, STAT_MINIMIZED, ClientNode::state, and ClientState::status.

Referenced by Startup().

BorderActionType GetBorderActionType ( const struct ClientNode np,
int  x,
int  y 
)

Determine the action to take for a client.

Parameters
npThe client.
xThe x-coordinate of the mouse (frame relative).
yThe y-coordinate of the mouse (frame relative).
Returns
The action to take.
int GetBorderIconSize ( void  )

Get the size of a border icon.

Returns
The size in pixels (note that icons are square).

Definition at line 88 of file border.c.

References DECO_MOTIF, GetTitleHeight(), Max, settings, and Settings::windowDecorations.

Referenced by DrawBorderHelper(), and StartupIcons().

void GetBorderSize ( const struct ClientState state,
int *  north,
int *  south,
int *  east,
int *  west 
)

Get the size of a window border.

Parameters
stateThe client state.
northPointer to the value to contain the north border size.
southPointer to the value to contain the south border size.
eastPointer to the value to contain the east border size.
westPointer to the value to contain the west border size.
unsigned GetTitleHeight ( void  )
void InitializeBorders ( void  )

Initialize structures.

Definition at line 48 of file border.c.

References buttonNames.

Referenced by Initialize().

void ResetBorder ( const struct ClientNode np)

Reset the shape of a window border.

Parameters
npThe client.
void SetBorderIcon ( BorderIconType  t,
const char *  name 
)

Set the icon to use for a border button.

Definition at line 1358 of file border.c.

References buttonNames, CopyString(), and Release.

Referenced by Parse().

void StartupBorders ( void  )

Initialize server resources.

Definition at line 54 of file border.c.

References BI_COUNT, BI_MENU, buttonNames, GetDefaultIcon(), LoadNamedIcon(), and Release.

Referenced by Startup().

joewing.net / Projects / JWM