Container is an object(struct with defined methods) used to store and manage related to it data
-
ApplicationContainer
Main WM container that holds all data and mothods
Fields:
environment
- holdsEnvironmentContainer
api
- holdsApiContrainer
-
EnvironmentContainer
Container that holds everything related to user side of WM
Fields:
config
- holdsConfigurationContainer
window_system
- holdsWindowSystemContainer
-
ConfigurationContainer
Stores immutable data like UI preferences, shortcuts, arrangement rules, etc.
Fields:
visual_preferences
- holdsVec
ofVisualPreference
actions
- holdsVec
ofAction
layout_rules
- holdsVec
ofLayoutRule
status_bar_builder
- holdsVec
StatusBarBuilder
-
VisualPreference
Holds UI settings like: colors, workspace names etc.
Not yet implemented
-
Action
Container for storing bindings of trigger -> actions
Fields:
trigger
-ActionTrigger
result
-ActionResult
-
ActionTrigger
Enum which defines events which should occur to run
Action
Fields:
KeyPress
-KeyPressTrigger
ButtonClick
-ButtonClickTrigger
-
KeyPressTrigger
Struct which defines KeyPress event
Fields:
modifier
- key modifier ofXEvent.key
eventkeycode
- keycode -
ButtonClickTrigger
Struct which defines several types of button click(which because of complexity will be calculated in other place)
Not yet implemented
-
-
ActionResult
Enum which defines function that will be executed after succesful trigger
Fields:
KillClient
- kills current clientSpawn
- executes providedCommand
MoveToScreen
- moves current client toScreen
specified byScreenSwitching
MoveToWorkspace
- moves current client to specifiedWorkspace
FocusScreen
- focuses onScreen
specified byScreenSwitching
FocusWorkspace
- focuses on specifiedWorkspace
Quit
- exits WM gracefuly-
ScreenSwitching
Enum which specifies requested
Screen
Fields:
Next
- moves to next screenPrevious
- moves to previous screen
-
-
-
LayoutRule
Stores information about preferred layouts, window arrangement rules, etc
Not yet implemented
-
StatusBarBuilder
Stores user-defined set of rules for builfing status bar
Not yet implemented
-
-
WindowSystemContainer
Main container that stores mutable data manipulated during each iteration of main loop. Including: apps,
Screen
s, workspaces and everything related to X windowsFields:
status_bar
- holdsStatusBarContainer
variables
- holdsVariablesContainer
screens
- holds collection ofScreen
scurrent_screen
- holds index of current_screen-
StatusBarContainer
Stores constucred status bar ready to be rendered
Not yet implemented
-
VariablesContainer
Stores some session-only data like scales, selected layout type, active window info, etc.
Fields:
display
- hold default X server displayroot_win
- holds default window ofdisplay
Not yet implemented
-
Screen
An abstract type above screen
Fields:
number
- holds number of given screenx
- holds x position in Xinerama layouty
- holds y position in Xinerama layoutwidth
- holds the width of screenheight
- holds the height if screenworkspaces
- holdsVec
ofWorkspace
scurrent_workspace
- stores current workspace index-
Workspace
An abstract type for workspace
Fields
number
- holds the number of workspace inWorkspaceContainer
clients
- holdsVec
(Vec
in this case used as stack implementation) ofClientContainer
current_client
- stores index of current client-
Client
abstract type over window
Fields
window_id
- holdsu64
representing X server id of corresponding windowwindow_name
- holds name of given windowx
,y
,w
,h
- basic geometry of windowvisible
- states if window is currently observed by userpx
,py
- stores previous position in case of hiding window(moving away from screen)
-
-
-
-
-
ApiContrainer
TODO: Design API container reference
-
formal functions
are functions that will exit in code as they are shown hereinformal actions are simpified explanations of what code does at given stage
-
main
Main entry function of WM, every varible storing in scope of this function
-
setup
Declares all variables in
VariableContainer
, creates LUTs, prepares WM to function normally -
scan
Gets windows that are already present and adds them to
ClientsArrangementContainer
with rules fromLayoutRulesContainer
applied -
run
Main loop for processing events, triggering actions, updating status bar, managing opened windows
TODO: Design main loop call stack
- Fetch events
- Update status bar
-
cleanup
Close all connections to X server, delete all temporary data, flush data to cache, finish logging and finally gracefuly quit WM
-