home *** CD-ROM | disk | FTP | other *** search
- /*
- winload.c
-
- % winreq_load
-
- OWL 1.1
- Copyright (c) 1988, 1989 by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 09/01/89 jdc added win_IsCharSize
- */
-
- #include "oakhead.h"
- #include "disppriv.h"
- #include "jadecl.h"
- #include "symldecl.h"
-
- #include "bordobj.h"
- #include "winod.h"
- #include "winsfile.h"
- #include "winspriv.h"
-
- OSTATIC objreq_func (winreq_load);
-
- void win_LoadInit()
- {
- winreq_loadfptr = winreq_load;
- }
-
- static VOID_FPTR null_funcptr = FNULL;
-
- int winreq_load(objdata, msg, indata, outdata)
- VOID *objdata;
- int msg; /* message */
- VOID *indata; /* message input data */
- VOID *outdata; /* message output data */
- {
- ocbox box;
- opbox pbox;
- int shadow_x, shadow_y, shadow_attr, clip;
- int bd_attr, handle;
- unsigned bd_feature;
- bd_fptr border;
- char *sbuf;
- bfile_type bfile;
- sfile_type sfile;
- win_type win;
-
- oak_notused(msg);
- oak_notused(outdata);
-
- win = winod_GetSelf((win_od *)objdata);
- sfile = (sfile_type)indata;
-
- bfile = sfile->bfile;
- sbuf = sfile->buf;
-
- /* win info:
- ymin, xmin, ymax, xmax, parent clip,
- shadow x, shadow y, shadow attr, border attr, border features,
- font, border, border title, mouse, explode
- */
- if (_bfile_gets(bfile, sbuf, SFILE_BUFLEN, '\0') == 0) {
- return(FALSE);
- }
- sscanf(sbuf, "%d %d %d %d %d %d %d %d %d %d",
- &box.toprow, &box.leftcol, &box.botrow, &box.rightcol, &clip,
- &shadow_x, &shadow_y, &shadow_attr,
- &bd_attr, &bd_feature);
-
- /* ignore font for now */
- if (_bfile_gets(bfile, sbuf, SFILE_BUFLEN, '\0') == 0) {
- return(FALSE);
- }
- win_SetFont(win, disp_GetDefFont());
-
- win_SetParentClip(win, clip);
- win_SetShadowAttr(win, (byte)shadow_attr);
-
- /* border */
- if (_bfile_gets(bfile, sbuf, SFILE_BUFLEN, '\0') == 0) {
- return(FALSE);
- }
- if (*sbuf == '\0') {
- border = FNULL;
- handle = -1;
- }
- else if ((border = sfile_FindBorderFunc(sfile, sbuf, &handle)) == FNULL) {
- border = bd_prompt;
- }
- win_SetBorder(win, border);
- if (handle == -1) {
- handle = sfile_PutBorderFunc(sfile, sbuf, border);
- }
- win_SetBorderHandle(win, handle);
-
- /* win init */
- if (win_IsCharSize(win)) {
- ocbox_pixcoords(&box, win_GetFont(win), &pbox);
- shadow_x *= win_GetFontWidth(win);
- shadow_y *= win_GetFontHeight(win);
- }
- else {
- pbox.ymin = box.toprow;
- pbox.xmin = box.leftcol;
- pbox.ymax = box.botrow;
- pbox.xmax = box.rightcol;
- }
- win_ReallySetPixPosition(win, pbox.xmin, pbox.ymin);
- win_ReallySetPixSize(win, opbox_GetWidth(&pbox), opbox_GetHeight(&pbox));
-
- win_SetPixShadow(win, shadow_x, shadow_y);
-
- bord_SetAttr(win, (byte)bd_attr);
- bord_SetFeature(win, bd_feature);
-
- /* border title */
- if (_bfile_gets(bfile, sbuf, SFILE_BUFLEN, '\0') == 0) {
- return(FALSE);
- }
- if (strcmp(sbuf, FSYM_NULLSTR) != 0) {
- bord_Do(win, BDM_SETTITLE, sbuf, NULL);
- }
-
- /* mouse */
- if (_bfile_gets(bfile, sbuf, SFILE_BUFLEN, '\0') == 0) {
- return(FALSE);
- }
- win_SetMouse(win, sfile_FindMouseFunc(sfile, sbuf, &handle));
- if (handle == -1) {
- handle = sfile_PutMouseFunc(sfile, sbuf, null_funcptr);
- }
- win_SetMouseHandle(win, handle);
-
- /* explode */
- if (_bfile_gets(bfile, sbuf, SFILE_BUFLEN, '\0') == 0) {
- return(FALSE);
- }
- win_SetExplode(win, sfile_FindExplodeFunc(sfile, sbuf, &handle));
- if (handle == -1) {
- handle = sfile_PutExplodeFunc(sfile, sbuf, null_funcptr);
- }
- win_SetExplodeHandle(win, handle);
-
- /* Put window into unemployed list (at the top) */
- win_ListAdd(curr_wmgr->unemployedhead, win);
-
- return(TRUE);
- }
-