--- /dev/null
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <X11/Xlib.h>
+#include "common.h"
+#include "client.h"
+#include "workspace.h"
+
+struct client {
+ struct geom geom;
+ Window window;
+ client_flags_t flags;
+ struct workspace *workspace;
+};
+
+int client_new(Window window, XWindowAttributes *attrs, struct client **client)
+{
+ struct client *cl;
+
+ if(!client) {
+ return(-EINVAL);
+ }
+
+ cl = malloc(sizeof(*cl));
+
+ if(!cl) {
+ return(-ENOMEM);
+ }
+
+ memset(cl, 0, sizeof(*cl));
+
+ cl->window = window;
+ *client = cl;
+
+ return(0);
+}
+
+int client_free(struct client **client)
+{
+ if(!client) {
+ return(-EINVAL);
+ }
+
+ if(!*client) {
+ return(-EALREADY);
+ }
+
+ free(*client);
+ *client = NULL;
+
+ return(0);
+}
+
+int client_set_geometry(struct client *client, struct geom *geom)
+{
+ if(!client || !geom) {
+ return(-EINVAL);
+ }
+
+ if(memcmp(&client->geom, geom, sizeof(*geom)) == 0) {
+ return(-EALREADY);
+ }
+
+ memcpy(&client->geom, geom, sizeof(*geom));
+
+ return(0);
+}
+
+int client_get_geometry(struct client *client, struct geom *geom)
+{
+ if(!client || !geom) {
+ return(-EINVAL);
+ }
+
+ memcpy(geom, &client->geom, sizeof(*geom));
+ return(0);
+}
--- /dev/null
+#ifndef MWM_CLIENT_H
+#define MWM_CLIENT_H 1
+
+#include <X11/Xlib.h>
+
+typedef enum {
+ CLIENT_FIXED = (1 << 0),
+ CLIENT_FLOATING = (1 << 1),
+ CLIENT_URGENT = (1 << 2),
+ CLIENT_NEVERFOCUS = (1 << 3),
+ CLIENT_FULLSCREEN = (1 << 4)
+} client_flags_t;
+
+struct client;
+
+int client_new(Window window, XWindowAttributes *attrs, struct client**);
+int client_free(struct client**);
+
+#endif /* MWM_CLIENT_H */