grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / libs / muiscreen / allocpubscreendesc.c
blobe58514d1f728355e443704c6a761a08a7ef26fcb
1 /*
2 Copyright © 2009, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <libraries/muiscreen.h>
7 #include <proto/exec.h>
8 #include <exec/memory.h>
9 #include <proto/intuition.h>
10 #include <proto/graphics.h>
11 #define DEBUG 1
12 #include <aros/debug.h>
14 /*****************************************************************************
16 NAME */
17 #include <proto/muiscreen.h>
19 AROS_LH1(struct MUI_PubScreenDesc *, MUIS_AllocPubScreenDesc,
21 /* SYNOPSIS */
22 AROS_LHA(struct MUI_PubScreenDesc *, src, A0),
24 /* LOCATION */
25 struct Library *, MUIScreenBase, 5, MUIScreen)
27 /* FUNCTION
29 INPUTS
31 RESULT
33 NOTES
35 EXAMPLE
37 BUGS
39 SEE ALSO
41 INTERNALS
43 ******************************************************************************/
46 AROS_LIBFUNC_INIT
48 struct MUI_PubScreenDesc *psd;
50 D(bug("MUIS_AllocPubScreenDesc(%p)\n", src));
52 psd = AllocMem (sizeof (struct MUI_PubScreenDesc), MEMF_ANY|MEMF_CLEAR);
54 if(src)
55 CopyMem(src, psd, sizeof(struct MUI_PubScreenDesc));
56 else
58 /* Copy default values from Workbench screen */
59 struct Screen *wbscreen = LockPubScreen(NULL);
60 CopyMem(PSD_INITIAL_NAME, psd->Name, sizeof(PSD_INITIAL_NAME));
61 CopyMem(PSD_INITIAL_TITLE, psd->Title, sizeof(PSD_INITIAL_TITLE));
62 psd->DisplayID = GetVPModeID(&wbscreen->ViewPort);
63 psd->DisplayWidth = wbscreen->Width;
64 psd->DisplayHeight = wbscreen->Height;
65 psd->DisplayDepth = GetBitMapAttr(wbscreen->RastPort.BitMap, BMA_DEPTH);
66 psd->OverscanType = OSCAN_TEXT;
67 psd->AutoScroll = (wbscreen->Flags & AUTOSCROLL) ? TRUE : FALSE;
68 psd->NoDrag = FALSE;
69 psd->Exclusive = FALSE;
70 psd->Interleaved = (GetBitMapAttr(wbscreen->RastPort.BitMap, BMA_FLAGS) & BMF_INTERLEAVED);
71 psd->SysDefault = FALSE;
72 psd->Behind = (wbscreen->Flags & SCREENBEHIND) ? TRUE : FALSE;
73 psd->AutoClose = FALSE;
74 psd->CloseGadget = FALSE;
76 int def_pens[] = { 0, 1, 1, 2, 1, 3, 1, 0, 2, 1, 2, 1 };
77 int i;
78 for(i = 0; i < sizeof(def_pens)/sizeof(def_pens[0]); i++)
80 psd->SystemPens[i] = def_pens[i];
83 struct MUI_RGBcolor col[8] =
85 { 0xAAAAAAAA,0xAAAAAAAA,0xAAAAAAAA },
86 { 0x00000000,0x00000000,0x00000000 },
87 { 0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF },
88 { 0x66666666,0x88888888,0xBBBBBBBB },
89 { 0xEEEEEEEE,0x44444444,0x44444444 },
90 { 0x55555555,0xDDDDDDDD,0x55555555 },
91 { 0x00000000,0x44444444,0xDDDDDDDD },
92 { 0xEEEEEEEE,0x99999999,0x00000000 }
95 for(i = 0; i < 8; i++)
97 psd->Palette[i] = col[i];
101 D(bug("Allocated struct MUI_PubScreenDesc %p\n", psd));
103 return psd;
105 AROS_LIBFUNC_EXIT