2 #include "WindowMaker.h"
21 int wswidth
, wsheight
;
25 #define WSMAP_DEFAULT_WIDTH 150
28 static WWorkspaceMap
*createWorkspaceMap(WMScreen
*scr
, int xcount
, int ycount
)
30 WWorkspaceMap
*wsm
= wnew0(WWorkspaceMap
, 1);
36 wsm
->win
= WMCreateWindow(scr
, "wsmap");
38 /* find out the ideal size of the mini-workspaces */
40 wsm
->wswidth
= WSMAP_DEFAULT_WIDTH
;
41 wsm
->wsheight
= (wsm
->wswidth
*rect
.height
) / rect
.width
;
43 // check if it fits screen
55 static void handleEvent(WWorkspaceMap
*map
, XEvent
*event
)
64 void wShowWorkspaceMap(WScreen
*scr
)
73 int main(int argc
, char **argv
)
78 WMInitializeApplication("WSMap", &argc
, argv
);
80 dpy
= XOpenDisplay("");
82 wfatal("cant open display");
86 scr
= WMCreateSimpleApplicationScreen(dpy
);
88 wsmap
= createWorkspaceMap(scr
);
90 WMRealizeWidget(wsmap
->win
);
91 WMMapWidget(wsmap
->win
);
93 WMScreenMainLoop(scr
);