1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-27 00:42:32 +01:00
Files
wmaker/src/wsmap.c
Carlos R. Mafra 688a56e8ab Change to the linux kernel coding style
for arq in `git ls-files *.c`; do
    echo $arq;
    indent -linux -l115 $arq;
    done

The different line break at 115 columns is because
I use a widescreen monitor :-)
2009-08-20 00:59:40 +02:00

84 lines
1.3 KiB
C

#include "WindowMaker.h"
#include "window.h"
typedef struct {
WWindow *wwin;
WMLabel *mini;
} WSMWindow;
typedef struct {
WScreen *scr;
WMWindow *win;
WSMWindow *windows;
int windowCount;
int xcount, ycount;
int wswidth, wsheight;
} WWorkspaceMap;
#define WSMAP_DEFAULT_WIDTH 150
static WWorkspaceMap *createWorkspaceMap(WMScreen * scr, int xcount, int ycount)
{
WWorkspaceMap *wsm = wnew0(WWorkspaceMap, 1);
WMRect rect;
//
rect.width = 1024;
rect.height = 768;
wsm->win = WMCreateWindow(scr, "wsmap");
/* find out the ideal size of the mini-workspaces */
wsm->wswidth = WSMAP_DEFAULT_WIDTH;
wsm->wsheight = (wsm->wswidth * rect.height) / rect.width;
// check if it fits screen
wsm->xcount = xcount;
wsm->ycount = ycount;
return wsm;
}
static void handleEvent(WWorkspaceMap * map, XEvent * event)
{
switch (event->type) {
}
}
void wShowWorkspaceMap(WScreen * scr)
{
}
Display *dpy;
int main(int argc, char **argv)
{
WWorkspaceMap *wsmap;
WMScreen *scr;
WMInitializeApplication("WSMap", &argc, argv);
dpy = XOpenDisplay("");
if (!dpy) {
wfatal("cant open display");
exit(0);
}
scr = WMCreateSimpleApplicationScreen(dpy);
wsmap = createWorkspaceMap(scr);
WMRealizeWidget(wsmap->win);
WMMapWidget(wsmap->win);
WMScreenMainLoop(scr);
return 0;
}