/*
O_HELLO
*/

#include <hwimman.g>
#include <hello.g>
#include <hello.rsg>

GLREF_D WSERV_SPEC *wserv_channel;
GLREF_D VOID *w_am;

GLDEF_C VOID main(VOID)
    {
    IN_HWIMMAN app;
    IN_WSERV ws;

    p_linklib(0);
    app.flags=/*FLG_APPMAN_FULLSCREEN|*/FLG_APPMAN_RSCFILE|FLG_APPMAN_CLEAN|
        FLG_APPMAN_SRSCFILE/*|FLG_APPMAN_IPCS|FLG_APPMAN_LINKING*/;
    app.wserv_cat=p_getlibh(CAT_HELLO_HELLO);
    ws.com_cat=p_getlibh(CAT_HELLO_HWIM);
    app.wserv_class=C_HELLOWS;
    ws.com_class=C_COMMAN;
    p_send4(p_new(CAT_HELLO_HWIM,C_HWIMMAN),O_AM_INIT,&app,&ws);
    }

#pragma METHOD_CALL

METHOD VOID hellows_ws_dyn_init(PR_HELLOWS *self)
    {
    self->wserv.cli=f_new(CAT_HELLO_HELLO,C_HELLOBW);
    p_send2(self->wserv.cli,O_WN_INIT);
    }

METHOD VOID hellobw_wn_init(PR_HELLOBW *self)
    {
    W_WINDATA wd;

    wd.extent.tl.x=0;
    wd.extent.tl.y=0;
    wd.extent.width=wserv_channel->conn.info.pixels.x;
    wd.extent.height=wserv_channel->conn.info.pixels.y;
    p_send5(self,O_WN_CONNECT,NULL,W_WIN_EXTENT,&wd);
    p_send3(self,O_WN_VISIBLE,WV_INITVIS);
    p_send3(self,O_WN_EMPHASISE,TRUE);
    }

METHOD VOID hellobw_wn_draw(PR_HELLOBW *self)
    {
    p_supersend2(self,O_WN_DRAW);
    gPrintText(50,50,"Hello World",11);
    }
