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

Functions for handling window groups. More...

#include "jwm.h"
#include "group.h"
#include "client.h"
#include "icon.h"
#include "error.h"
#include "match.h"
#include "misc.h"
#include "settings.h"

Go to the source code of this file.

Data Structures

struct  PatternListType
 List of match patterns for a group. More...
 
struct  OptionListType
 List of options for a group. More...
 
struct  GroupType
 List of groups. More...
 

Macros

#define MATCH_NAME   0
 Match the window name.
 
#define MATCH_CLASS   1
 Match the window class.
 

Typedefs

typedef unsigned int MatchType
 What part of the window to match.
 
typedef struct PatternListType PatternListType
 List of match patterns for a group.
 
typedef struct OptionListType OptionListType
 List of options for a group.
 
typedef struct GroupType GroupType
 List of groups.
 

Functions

static void ReleasePatternList (PatternListType *lp)
 Release a group pattern list.
 
static void ReleaseOptionList (OptionListType *lp)
 Release a group option list.
 
static void AddPattern (PatternListType **lp, const char *pattern, MatchType match)
 Add a pattern to a pattern list.
 
static void ApplyGroup (const GroupType *gp, ClientNode *np)
 Apply a group to a client.
 
void DestroyGroups (void)
 Destroy group data.
 
GroupTypeCreateGroup (void)
 Create an empty group.
 
void AddGroupClass (GroupType *gp, const char *pattern)
 Add a window class to a group.
 
void AddGroupName (GroupType *gp, const char *pattern)
 Add a window name to a group.
 
void AddGroupOption (GroupType *gp, OptionType option)
 Add an option to a group.
 
void AddGroupOptionString (GroupType *gp, OptionType option, const char *value)
 Add an option (with a string) to a group.
 
void AddGroupOptionUnsigned (GroupType *gp, OptionType option, unsigned int value)
 Add an option (with an unsigned integer) to a group.
 
void ApplyGroups (ClientNode *np)
 Apply groups to a client.
 

Variables

static GroupTypegroups = NULL
 

Detailed Description

Functions for handling window groups.

Author
Joe Wingbermuehle
Date
2004-2006

Definition in file group.c.

Macro Definition Documentation

#define MATCH_CLASS   1

Match the window class.

Definition at line 22 of file group.c.

Referenced by AddGroupClass(), and ApplyGroups().

#define MATCH_NAME   0

Match the window name.

Definition at line 21 of file group.c.

Referenced by AddGroupName(), and ApplyGroups().

Typedef Documentation

typedef struct GroupType GroupType

List of groups.

typedef unsigned int MatchType

What part of the window to match.

Definition at line 20 of file group.c.

List of options for a group.

List of match patterns for a group.

Function Documentation

void AddGroupClass ( GroupType gp,
const char *  pattern 
)

Add a window class to a group.

Definition at line 106 of file group.c.

References _, AddPattern(), Assert, JLIKELY, MATCH_CLASS, GroupType::patterns, and Warning().

Referenced by ParseGroup().

void AddGroupName ( GroupType gp,
const char *  pattern 
)

Add a window name to a group.

Definition at line 117 of file group.c.

References _, AddPattern(), Assert, JLIKELY, MATCH_NAME, GroupType::patterns, and Warning().

Referenced by ParseGroup().

void AddGroupOption ( GroupType gp,
OptionType  option 
)

Add an option to a group.

Add a group option that doesn't take a value.

Definition at line 141 of file group.c.

References Allocate, OptionListType::next, OptionListType::option, GroupType::options, and OptionListType::svalue.

Referenced by ParseGroupOption().

void AddGroupOptionString ( GroupType gp,
OptionType  option,
const char *  value 
)

Add an option (with a string) to a group.

Add a group option that takes a string.

Definition at line 152 of file group.c.

References Allocate, Assert, CopyString(), OptionListType::next, OptionListType::option, GroupType::options, and OptionListType::svalue.

Referenced by ParseGroupOption().

void AddGroupOptionUnsigned ( GroupType gp,
OptionType  option,
unsigned int  value 
)

Add an option (with an unsigned integer) to a group.

Add a group option that takes an unsigned integer.

Definition at line 165 of file group.c.

References Allocate, Assert, OptionListType::next, OptionListType::option, GroupType::options, OptionListType::svalue, and OptionListType::uvalue.

Referenced by ParseGroupOption().

void AddPattern ( PatternListType **  lp,
const char *  pattern,
MatchType  match 
)
static

Add a pattern to a pattern list.

Definition at line 128 of file group.c.

References Allocate, Assert, CopyString(), PatternListType::match, PatternListType::next, and PatternListType::pattern.

Referenced by AddGroupClass(), and AddGroupName().

void ApplyGroup ( const GroupType gp,
ClientNode np 
)
static

Apply a group to a client.

Definition at line 216 of file group.c.

References _, Assert, ClientState::border, BORDER_CLOSE, BORDER_CONSTRAIN, BORDER_FULLSCREEN, BORDER_MAX, BORDER_MAX_H, BORDER_MAX_V, BORDER_MIN, BORDER_MOVE, BORDER_OUTLINE, BORDER_RESIZE, BORDER_SHADE, BORDER_TITLE, Debug(), ClientState::desktop, Settings::desktopCount, DestroyIcon(), ClientNode::icon, JLIKELY, ClientState::layer, LoadNamedIcon(), MAX_HORIZ, MAX_VERT, ClientState::maxFlags, OptionListType::next, ClientState::opacity, OptionListType::option, OPTION_AEROSNAP, OPTION_BORDER, OPTION_CENTERED, OPTION_CONSTRAIN, OPTION_DESKTOP, OPTION_DRAG, OPTION_FIXED, OPTION_FULLSCREEN, OPTION_ICON, OPTION_IIGNORE, OPTION_ILIST, OPTION_IPAGER, OPTION_LAYER, OPTION_MAX_H, OPTION_MAX_V, OPTION_MAXIMIZED, OPTION_MINIMIZED, OPTION_NOBORDER, OPTION_NOCLOSE, OPTION_NODRAG, OPTION_NOFOCUS, OPTION_NOFULLSCREEN, OPTION_NOLIST, OPTION_NOMAX, OPTION_NOMIN, OPTION_NOMOVE, OPTION_NOPAGER, OPTION_NORESIZE, OPTION_NOSHADE, OPTION_NOTITLE, OPTION_NOTURGENT, OPTION_OPACITY, OPTION_PIGNORE, OPTION_SHADED, OPTION_STICKY, OPTION_TILED, OPTION_TITLE, GroupType::options, settings, STAT_AEROSNAP, STAT_CENTERED, STAT_DRAG, STAT_FIXED, STAT_FULLSCREEN, STAT_IIGNORE, STAT_ILIST, STAT_IPAGER, STAT_MINIMIZED, STAT_NODRAG, STAT_NOFOCUS, STAT_NOLIST, STAT_NOPAGER, STAT_NOTURGENT, STAT_OPACITY, STAT_PIGNORE, STAT_SHADED, STAT_STICKY, STAT_TILED, ClientNode::state, ClientState::status, OptionListType::svalue, OptionListType::uvalue, and Warning().

Referenced by ApplyGroups().

void ApplyGroups ( ClientNode np)

Apply groups to a client.

Apply any matching groups to a client.

Definition at line 178 of file group.c.

References ApplyGroup(), Assert, ClientNode::className, Debug(), ClientNode::instanceName, Match(), PatternListType::match, MATCH_CLASS, MATCH_NAME, PatternListType::next, GroupType::next, PatternListType::pattern, and GroupType::patterns.

Referenced by AddClientWindow().

GroupType* CreateGroup ( void  )
read

Create an empty group.

Definition at line 94 of file group.c.

References Allocate, groups, GroupType::next, GroupType::options, and GroupType::patterns.

Referenced by ParseGroup().

void DestroyGroups ( void  )

Destroy group data.

Definition at line 55 of file group.c.

References GroupType::next, GroupType::options, GroupType::patterns, Release, ReleaseOptionList(), and ReleasePatternList().

Referenced by Destroy().

void ReleaseOptionList ( OptionListType lp)
static

Release a group option list.

Definition at line 80 of file group.c.

References OptionListType::next, Release, and OptionListType::svalue.

Referenced by DestroyGroups().

void ReleasePatternList ( PatternListType lp)
static

Release a group pattern list.

Definition at line 68 of file group.c.

References PatternListType::next, PatternListType::pattern, and Release.

Referenced by DestroyGroups().

Variable Documentation

GroupType* groups = NULL
static

Definition at line 46 of file group.c.

Referenced by CreateGroup().

joewing.net / Projects / JWM