]> git.corax.cc Git - mwm/log
mwm
4 years agoloop: Add convenience functions and a foreach function without data
Matthias Kruk [Tue, 18 May 2021 23:03:51 +0000 (08:03 +0900)]
loop: Add convenience functions and a foreach function without data

This commit adds convenience functions to the loop data type that
allow the caller to find the elements that come before or after an
element in a loop.
This further adds functions to shift the position of an element in
the loop to the back or the front, and a foreach function that
passes only the element pointer to the callback (this is useful for
calling things like free() from the foreach function).

4 years agoloop: Fix several issues in the loop implementation
Matthias Kruk [Sat, 8 May 2021 01:18:33 +0000 (10:18 +0900)]
loop: Fix several issues in the loop implementation

There were several bugs in the loop implementation, most notably
in the search and remove methods. This commit fixes the bugs so
that it is possible to retrieve elements and remove elements
from loop structures.

4 years agomwm: Use loopy lists to keep track of workspaces and monitors
Matthias Kruk [Mon, 3 May 2021 21:31:01 +0000 (06:31 +0900)]
mwm: Use loopy lists to keep track of workspaces and monitors

The arrays used by the mwm type to track workspaces and monitors are
not ideal for some operations if they are sparsely populated.
This commit replaces them with cyclic lists.

4 years agoworkspace: Add type for keeping track of workspaces
Matthias Kruk [Mon, 3 May 2021 21:27:50 +0000 (06:27 +0900)]
workspace: Add type for keeping track of workspaces

A data type is needed that clients can be attached to, and that monitors
can be associated with so that they display a set of clients.
This commit adds the workspace type that keeps track of a set of clients
and can be displayed by a monitor.

4 years agoclient: Add data type for keeping track of clients
Matthias Kruk [Mon, 3 May 2021 21:26:48 +0000 (06:26 +0900)]
client: Add data type for keeping track of clients

A data type is needed to keep track of clients and associate them with
workspaces. This commit adds the client type that serves that purpose.

4 years agoloop: Add cyclic list type
Matthias Kruk [Mon, 3 May 2021 21:18:24 +0000 (06:18 +0900)]
loop: Add cyclic list type

Since we will often cycle through monitors, workspaces, and clients, it
would be beneficial to have a data structure that assists with that.
This commit adds the loop type, which implements a cyclic doubly-linked
list.

4 years agox, common: Add convenience functions and common types
Matthias Kruk [Mon, 3 May 2021 00:29:40 +0000 (09:29 +0900)]
x, common: Add convenience functions and common types

This commit adds convenience functions that wrap functionality provided
by Xlib. Further, it adds a structure that defines the geometry of an
object.

4 years agomwm: Implement monitor detection
Matthias Kruk [Mon, 3 May 2021 00:25:10 +0000 (09:25 +0900)]
mwm: Implement monitor detection

Monitors connected to the X Server have to be detected in order to
provide meaningful window manager functionality.
This commit implements dynamic detection of monitors and adds events
that a callback can be connected to, so that it will be executed when
a monitor has been added.

4 years agoarray: Make array_get() return an error if an element wasn't set
Matthias Kruk [Sun, 2 May 2021 11:39:05 +0000 (20:39 +0900)]
array: Make array_get() return an error if an element wasn't set

The array_get() function returns success when an entry is retrieved that
was never set. This makes it hard to distinguish uninitialized entries.
This commit changes array_get() to return an error if the caller is
attempting to retrieve an uninitialized entry.

4 years agomain: Instantiate and run mwm
Matthias Kruk [Sun, 2 May 2021 00:56:27 +0000 (09:56 +0900)]
main: Instantiate and run mwm

The main() function currently does nothing but parse teh commandline.
This commit changes the main() function so that it creates an mwm
instance and subsequently initializes and executes it.

4 years agomwm: Add datatype to manage global context
Matthias Kruk [Sun, 2 May 2021 00:53:37 +0000 (09:53 +0900)]
mwm: Add datatype to manage global context

This commit adds the mwm data type, which stores the global state of
the window manager, and will be used to handle events.

4 years agomonitor: Add data type for monitor management
Matthias Kruk [Sun, 2 May 2021 00:51:26 +0000 (09:51 +0900)]
monitor: Add data type for monitor management

To keep track of connected monitors, a data type is necessary.
This commit adds the monitor datatype that is used to keep track
of the size and position of a monitor.

4 years agoarray: Add dynamic array type
Matthias Kruk [Sun, 2 May 2021 00:48:18 +0000 (09:48 +0900)]
array: Add dynamic array type

For storage of monitors, a data type is needed that automatically
grows and shrinks as needed.
This commit adds a dynamic array implementation.

4 years agoInitial commit: Start with a minimal Makefile, manpage, and main.c master stable testing
Matthias Kruk [Sat, 1 May 2021 21:48:49 +0000 (06:48 +0900)]
Initial commit: Start with a minimal Makefile, manpage, and main.c

This commit adds a minimal Makefile, a short manpage, and a mwm
implementation that does nothing but print a help text.