Improved debug messages and added missing properties.
[AROS.git] / rom / intuition / showtitle.c
blob97c61607545a4945e8521cce4c09055ffe6d9e38
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
5 */
7 #include <proto/layers.h>
8 #include "intuition_intern.h"
9 #include "inputhandler_actions.h"
11 struct ShowTitleActionMsg
13 struct IntuiActionMsg msg;
14 struct Screen *screen;
15 BOOL showit;
18 static VOID int_showtitle(struct ShowTitleActionMsg *msg,
19 struct IntuitionBase *IntuitionBase);
21 /*****************************************************************************
23 NAME */
24 #include <proto/intuition.h>
26 AROS_LH2(void, ShowTitle,
28 /* SYNOPSIS */
29 AROS_LHA(struct Screen *, screen, A0),
30 AROS_LHA(BOOL , ShowIt, D0),
32 /* LOCATION */
33 struct IntuitionBase *, IntuitionBase, 47, Intuition)
35 /* FUNCTION
36 Modify SHOWTITLE flag of the screen and refresh the screen and
37 its windows.
38 If ShowIt is TRUE the screen's title bar will be shown in front of
39 WFLG_BACKDROP windows. A value of FALSE will bring the title bar
40 behind all windows.
42 INPUTS
44 RESULT
45 None.
47 NOTES
48 The default of the SHOWTITLE flag for new screens is TRUE.
50 EXAMPLE
52 BUGS
54 SEE ALSO
56 INTERNALS
58 HISTORY
60 *****************************************************************************/
62 AROS_LIBFUNC_INIT
64 if (screen && screen->BarLayer)
66 struct ShowTitleActionMsg msg;
68 #ifdef SKINS
69 if (GetPrivScreen(screen)->SpecialFlags & (SF_InvisibleBar|SF_AppearingBar)) return;
70 #endif
72 msg.screen = screen;
73 msg.showit = ShowIt;
74 DoASyncAction((APTR)int_showtitle, &msg.msg, sizeof(msg), IntuitionBase);
77 AROS_LIBFUNC_EXIT
79 } /* ShowTitle */
82 static VOID int_showtitle(struct ShowTitleActionMsg *msg,
83 struct IntuitionBase *IntuitionBase)
85 struct LayersBase *LayersBase = GetPrivIBase(IntuitionBase)->LayersBase;
86 struct Screen *screen = msg->screen;
88 if (!msg->showit)
90 if (screen->Flags & SHOWTITLE)
92 LOCK_REFRESH(screen);
94 BehindLayer(0, screen->BarLayer);
96 AROS_ATOMIC_AND(screen->Flags, ~SHOWTITLE);
98 CheckLayers(screen, IntuitionBase);
100 UNLOCK_REFRESH(screen);
103 else
105 if (!(screen->Flags & SHOWTITLE))
107 LOCK_REFRESH(screen);
109 UpfrontLayer(0, screen->BarLayer);
111 AROS_ATOMIC_OR(screen->Flags, SHOWTITLE);
113 CheckLayers(screen, IntuitionBase);
115 UNLOCK_REFRESH(screen);