/* DEWSERV.C */

#include <demo.g>
#include <hwim.h>

GLREF_D WSERV_SPEC *wserv_channel;

LOCAL_C INT StatusWindowWidth(VOID)
    {
    P_EXTENT ext;

    wInquireStatusWindow(-1,&ext);
    return(ext.width);
    }

LOCAL_C VOID InitClientWindow(PR_DEWSERV *self)
    {
    W_WINDATA wd;
    PR_WIN *cliwin;

    wd.extent.tl.x=wd.extent.tl.y=0;
    wd.extent.height=wserv_channel->conn.info.pixels.y;
    wd.extent.width=wserv_channel->conn.info.pixels.x-StatusWindowWidth();
    cliwin=f_newsend(CAT_DEMO_HWIM,C_BWIN,O_WN_CONNECT,NULL,W_WIN_EXTENT,&wd);
    self->wserv.cli=cliwin;
    cliwin->win.flags=PR_BWIN_CORNER_4|PR_BWIN_SHADOW_1;
    p_send3(cliwin,O_WN_EMPHASISE,TRUE);
    hInitVis(cliwin);
    }

#pragma METHOD_CALL

METHOD VOID dewserv_ws_dyn_init(PR_DEWSERV *self)
    {
    wsSetList(W_STATUS_WINDOW_ICON,NULL,0);
    wStatusWindow(W_STATUS_WINDOW_BIG);
    InitClientWindow(self);
    }
