Change to the linux kernel coding style
[wmaker-crm.git] / src / wsmap.c
blob1b9d3c9c44d37f05c55ff7dfa0c1f6b16b9e4a18
2 #include "WindowMaker.h"
3 #include "window.h"
5 typedef struct {
6 WWindow *wwin;
7 WMLabel *mini;
8 } WSMWindow;
10 typedef struct {
11 WScreen *scr;
13 WMWindow *win;
15 WSMWindow *windows;
16 int windowCount;
18 int xcount, ycount;
19 int wswidth, wsheight;
20 } WWorkspaceMap;
22 #define WSMAP_DEFAULT_WIDTH 150
24 static WWorkspaceMap *createWorkspaceMap(WMScreen * scr, int xcount, int ycount)
25 {
26 WWorkspaceMap *wsm = wnew0(WWorkspaceMap, 1);
27 WMRect rect;
28 //
29 rect.width = 1024;
30 rect.height = 768;
32 wsm->win = WMCreateWindow(scr, "wsmap");
34 /* find out the ideal size of the mini-workspaces */
36 wsm->wswidth = WSMAP_DEFAULT_WIDTH;
37 wsm->wsheight = (wsm->wswidth * rect.height) / rect.width;
39 // check if it fits screen
41 wsm->xcount = xcount;
42 wsm->ycount = ycount;
44 return wsm;
45 }
47 static void handleEvent(WWorkspaceMap * map, XEvent * event)
48 {
49 switch (event->type) {
50 }
51 }
53 void wShowWorkspaceMap(WScreen * scr)
54 {
56 }
58 Display *dpy;
60 int main(int argc, char **argv)
61 {
62 WWorkspaceMap *wsmap;
63 WMScreen *scr;
65 WMInitializeApplication("WSMap", &argc, argv);
67 dpy = XOpenDisplay("");
68 if (!dpy) {
69 wfatal("cant open display");
70 exit(0);
71 }
73 scr = WMCreateSimpleApplicationScreen(dpy);
75 wsmap = createWorkspaceMap(scr);
77 WMRealizeWidget(wsmap->win);
78 WMMapWidget(wsmap->win);
80 WMScreenMainLoop(scr);
82 return 0;
83 }