commit fe791debdaad5e167dee9b11d1a3052432002349
parent ccf85c6c9006552b35906be82babb3645afd48ed
Author: Anselm R. Garbe <garbeam@wmii.de>
Date: Wed, 8 Mar 2006 13:00:10 +0100
rearranged client.c/frame.c
Diffstat:
4 files changed, 43 insertions(+), 35 deletions(-)
diff --git a/cmd/wm/Makefile b/cmd/wm/Makefile
@@ -9,7 +9,7 @@ LDFLAGS += -L../../liblitz -llitz -L../../libixp -lixp -L../../libcext -lcext
# Solaris
# LDFLAGS += -lsocket
-SRC = area.c bar.c fs.c wm.c kb.c client.c event.c mouse.c tag.c
+SRC = area.c bar.c fs.c frame.c wm.c kb.c client.c event.c mouse.c tag.c
OBJ = ${SRC:.c=.o}
all: wmiiwm
diff --git a/cmd/wm/client.c b/cmd/wm/client.c
@@ -368,16 +368,6 @@ sel_client()
return ntag ? sel_client_of_tag(tag[sel]) : nil;
}
-Client *
-win2clientframe(Window w)
-{
- unsigned int i;
- for(i = 0; (i < clientsz) && client[i]; i++)
- if(client[i]->framewin == w)
- return client[i];
- return nil;
-}
-
static void
match_sizehints(Client *c)
{
@@ -448,27 +438,6 @@ resize_client(Client *c, XRectangle *r, XPoint *pt, Bool ignore_xcall)
}
}
-int
-frid2index(Area *a, unsigned short id)
-{
- int i;
- for(i = 0; i < a->nframe; i++)
- if(a->frame[i]->id == id)
- return i;
- return -1;
-}
-
-int
-frame2index(Frame *f)
-{
- int i;
- Area *a = f->area;
- for(i = 0; i < a->nframe; i++)
- if(a->frame[i] == f)
- return i;
- return -1;
-}
-
void
select_client(Client *c, char *arg)
{
diff --git a/cmd/wm/frame.c b/cmd/wm/frame.c
@@ -0,0 +1,37 @@
+/*
+ * (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
+ * See LICENSE file for license details.
+ */
+
+#include "wm.h"
+
+int
+frid2index(Area *a, unsigned short id)
+{
+ int i;
+ for(i = 0; i < a->nframe; i++)
+ if(a->frame[i]->id == id)
+ return i;
+ return -1;
+}
+
+int
+frame2index(Frame *f)
+{
+ int i;
+ Area *a = f->area;
+ for(i = 0; i < a->nframe; i++)
+ if(a->frame[i] == f)
+ return i;
+ return -1;
+}
+
+Client *
+win2clientframe(Window w)
+{
+ unsigned int i;
+ for(i = 0; (i < clientsz) && client[i]; i++)
+ if(client[i]->framewin == w)
+ return client[i];
+ return nil;
+}
diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h
@@ -241,10 +241,7 @@ void detach_client(Client *c, Bool unmap);
Client *sel_client();
Client *sel_client_of_tag(Tag *t);
void focus_client(Client *c);
-Client *win2clientframe(Window w);
void resize_client(Client *c, XRectangle *r, XPoint *pt, Bool ignore_xcall);
-int frid2index(Area *a, unsigned short id);
-int frame2index(Frame *f);
void select_client(Client *c, char *arg);
void sendtoarea_client(Client *c, char *arg);
void resize_all_clients();
@@ -255,6 +252,11 @@ int cid2index(unsigned short id);
void init_x_event_handler();
void check_x_event(IXPConn *c);
+/* frame.c */
+int frid2index(Area *a, unsigned short id);
+int frame2index(Frame *f);
+Client *win2clientframe(Window w);
+
/* fs.c */
unsigned long long mkqpath(unsigned char type, unsigned short pg,
unsigned short area, unsigned short cl);