JWM Source Documentation
Data Structures | Typedefs | Functions | Variables
place.c File Reference

Client placement functions. More...

#include "jwm.h"
#include "place.h"
#include "client.h"
#include "border.h"
#include "screen.h"
#include "tray.h"
#include "settings.h"
#include "clientlist.h"
#include "misc.h"

Go to the source code of this file.

Data Structures

struct  Strut
 

Typedefs

typedef struct Strut Strut
 

Functions

static char DoRemoveClientStrut (ClientNode *np)
 Remove struts associated with a client.
 
static void InsertStrut (const BoundingBox *box, ClientNode *np)
 Insert a bounding box to the list of struts.
 
static void CenterClient (const BoundingBox *box, ClientNode *np)
 Centered placement.
 
static int IntComparator (const void *a, const void *b)
 Compare two integers.
 
static int TryTileClient (const BoundingBox *box, ClientNode *np, int x, int y)
 Attempt to place the client at the specified coordinates.
 
static char TileClient (const BoundingBox *box, ClientNode *np)
 Tiled placement.
 
static void CascadeClient (const BoundingBox *box, ClientNode *np)
 Cascade placement.
 
static void SubtractStrutBounds (BoundingBox *box, const ClientNode *np)
 Remove struts from the bounding box.
 
static void SubtractBounds (const BoundingBox *src, BoundingBox *dest)
 Shrink dest such that it does not intersect with src.
 
static void SubtractTrayBounds (BoundingBox *box, unsigned int layer)
 Subtract tray area from the bounding box.
 
static void SetWorkarea (void)
 Set _NET_WORKAREA.
 
void StartupPlacement (void)
 Startup placement.
 
void ShutdownPlacement (void)
 Shutdown placement.
 
void RemoveClientStrut (ClientNode *np)
 Remove struts associated with a client.
 
void ReadClientStrut (ClientNode *np)
 Add client specified struts to our list.
 
void GetScreenBounds (const ScreenType *sp, BoundingBox *box)
 Get the screen bounds.
 
void PlaceClient (ClientNode *np, char alreadyMapped)
 Place a client on the screen.
 
char ConstrainSize (ClientNode *np)
 Constrain the size of the client.
 
void ConstrainPosition (ClientNode *np)
 Constrain the position of a client.
 
void PlaceMaximizedClient (ClientNode *np, MaxFlags flags)
 Place a maximized client on the screen.
 
void GetGravityDelta (const ClientNode *np, int gravity, int *x, int *y)
 Determine which way to move the client for the border.
 
void GravitateClient (ClientNode *np, char negate)
 Move the window in the specified direction for reparenting.
 

Variables

static Strutstruts = NULL
 
static int * cascadeOffsets = NULL
 

Detailed Description

Client placement functions.

Author
Joe Wingbermuehle
Date
2004-2006

Definition in file place.c.

Typedef Documentation

typedef struct Strut Strut

Function Documentation

void CascadeClient ( const BoundingBox box,
ClientNode np 
)
static
void CenterClient ( const BoundingBox box,
ClientNode np 
)
static
void ConstrainPosition ( ClientNode np)
char ConstrainSize ( ClientNode np)
char DoRemoveClientStrut ( ClientNode np)
static

Remove struts associated with a client.

Definition at line 88 of file place.c.

References Strut::client, Strut::next, Release, and struts.

Referenced by ReadClientStrut(), and RemoveClientStrut().

void GetGravityDelta ( const ClientNode np,
int  gravity,
int *  x,
int *  y 
)

Determine which way to move the client for the border.

Get the x and y deltas for gravitating a client.

Definition at line 876 of file place.c.

References GetBorderSize(), and ClientNode::state.

Referenced by GravitateClient(), HandleConfigureRequest(), HandleNetMoveResize(), and HandleNetWMMoveResize().

void GetScreenBounds ( const ScreenType sp,
BoundingBox box 
)
void GravitateClient ( ClientNode np,
char  negate 
)

Move the window in the specified direction for reparenting.

Move a client window for a border.

Definition at line 925 of file place.c.

References GetGravityDelta(), ClientNode::gravity, ClientNode::x, and ClientNode::y.

Referenced by HandleUnmapNotify(), PlaceClient(), and RemoveClient().

void InsertStrut ( const BoundingBox box,
ClientNode np 
)
static

Insert a bounding box to the list of struts.

Definition at line 107 of file place.c.

References Allocate, Strut::box, Strut::client, BoundingBox::height, JLIKELY, Strut::next, struts, and BoundingBox::width.

Referenced by ReadClientStrut().

int IntComparator ( const void *  a,
const void *  b 
)
static

Compare two integers.

Definition at line 412 of file place.c.

Referenced by TileClient().

void PlaceClient ( ClientNode np,
char  alreadyMapped 
)
void PlaceMaximizedClient ( ClientNode np,
MaxFlags  flags 
)
void ReadClientStrut ( ClientNode np)
void RemoveClientStrut ( ClientNode np)

Remove struts associated with a client.

Definition at line 80 of file place.c.

References DoRemoveClientStrut(), and SetWorkarea().

Referenced by RemoveClient().

void SetWorkarea ( void  )
static
void ShutdownPlacement ( void  )

Shutdown placement.

Definition at line 64 of file place.c.

References cascadeOffsets, Strut::next, and Release.

Referenced by Shutdown().

void StartupPlacement ( void  )

Startup placement.

Definition at line 47 of file place.c.

References Allocate, Settings::borderWidth, cascadeOffsets, Settings::desktopCount, GetScreenCount(), GetTitleHeight(), settings, and SetWorkarea().

Referenced by Startup().

void SubtractBounds ( const BoundingBox src,
BoundingBox dest 
)
static

Shrink dest such that it does not intersect with src.

Definition at line 280 of file place.c.

References dest, BoundingBox::height, BoundingBox::width, BoundingBox::x, and BoundingBox::y.

Referenced by SubtractStrutBounds(), and SubtractTrayBounds().

void SubtractStrutBounds ( BoundingBox box,
const ClientNode np 
)
static
void SubtractTrayBounds ( BoundingBox box,
unsigned int  layer 
)
static
char TileClient ( const BoundingBox box,
ClientNode np 
)
static
int TryTileClient ( const BoundingBox box,
ClientNode np,
int  x,
int  y 
)
static

Variable Documentation

int* cascadeOffsets = NULL
static

Definition at line 30 of file place.c.

Referenced by CascadeClient(), ShutdownPlacement(), and StartupPlacement().

Strut* struts = NULL
static

Definition at line 26 of file place.c.

Referenced by DoRemoveClientStrut(), and InsertStrut().

joewing.net / Projects / JWM