2 Copyright © 2009, The AROS Development Team. All rights reserved.
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>
12 #include <aros/debug.h>
14 /*****************************************************************************
17 #include <proto/muiscreen.h>
19 AROS_LH1(struct MUI_PubScreenDesc
*, MUIS_AllocPubScreenDesc
,
22 AROS_LHA(struct MUI_PubScreenDesc
*, src
, A0
),
25 struct Library
*, MUIScreenBase
, 5, MUIScreen
)
43 ******************************************************************************/
48 struct MUI_PubScreenDesc
*psd
;
50 D(bug("MUIS_AllocPubScreenDesc(%p)\n", src
));
52 psd
= AllocMem (sizeof (struct MUI_PubScreenDesc
), MEMF_ANY
|MEMF_CLEAR
);
55 CopyMem(src
, psd
, sizeof(struct MUI_PubScreenDesc
));
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
;
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 };
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
));