revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / muiscreen / openpubscreen.c
blobab6fbdac2a59fadabc10c95e9efbd99ca8f5db4a
1 /*
2 Copyright © 2009-2011, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <libraries/muiscreen.h>
7 #include <utility/hooks.h>
8 #include <intuition/screens.h>
9 #include <proto/intuition.h>
10 #include <proto/exec.h>
11 #include <exec/lists.h>
12 #define DEBUG 1
13 #include <aros/debug.h>
15 #include "muiscreen_intern.h"
17 /*****************************************************************************
19 NAME */
20 #include <proto/muiscreen.h>
22 AROS_LH1(char *, MUIS_OpenPubScreen,
24 /* SYNOPSIS */
25 AROS_LHA(struct MUI_PubScreenDesc *, desc, A0),
27 /* LOCATION */
28 struct MUIScreenBase_intern *, MUIScreenBase, 7, MUIScreen)
30 /* FUNCTION
32 INPUTS
34 RESULT
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
44 INTERNALS
46 ******************************************************************************/
49 AROS_LIBFUNC_INIT
51 struct TextAttr *font = NULL;
52 struct Hook *backfillHook = NULL;
53 char *ret = NULL;
55 D(bug("MUIS_OpenPubScreen(%p) name %s\n", desc, desc->Name));
57 // TODO desc->SysDefault
58 // TODO desc->AutoClose
59 // TODO desc->CloseGadget
60 // TODO desc->SystemPens
61 // TODO desc->Palette
63 struct Screen *screen = OpenScreenTags(NULL,
64 SA_Type, (IPTR) PUBLICSCREEN,
65 SA_PubName, desc->Name,
66 SA_Title, desc->Title,
67 SA_Font, font,
68 (backfillHook ? SA_BackFill : TAG_IGNORE), backfillHook,
69 SA_DisplayID, (IPTR) desc->DisplayID,
70 SA_Width, (IPTR) desc->DisplayWidth,
71 SA_Height, (IPTR) desc->DisplayHeight,
72 SA_Depth, (IPTR) desc->DisplayDepth,
73 SA_Overscan, (IPTR) desc->OverscanType,
74 SA_AutoScroll, (IPTR) desc->AutoScroll,
75 SA_Draggable, (IPTR) !desc->NoDrag,
76 SA_Exclusive, (IPTR) desc->Exclusive,
77 SA_Interleaved, (IPTR) desc->Interleaved,
78 SA_Behind, (IPTR) desc->Behind,
79 TAG_DONE);
81 if(screen)
83 if ((PubScreenStatus(screen, 0) & 1) == 0)
85 D(bug("Can't make screen public\n"));
86 CloseScreen(screen);
88 else
90 ret = desc->Name;
91 struct Node *node;
92 ForeachNode(&MUIScreenBase->clients, node)
94 struct MUIS_InfoClient *client = (struct MUIS_InfoClient*) node;
95 Signal(client->task, client->sigbit);
100 return ret;
102 AROS_LIBFUNC_EXIT