tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / rom / intuition / showtitle.c
blobae679efc1605504ae9c5bbcd6740a0cfcfa37128
1 /*
2 Copyright © 1995-2013, 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.
39 If ShowIt is TRUE the screen's title bar will be shown in front of
40 WFLG_BACKDROP windows. A value of FALSE will bring the title bar
41 behind all windows.
43 INPUTS
45 RESULT
46 None.
48 NOTES
49 The default of the SHOWTITLE flag for new screens is TRUE.
51 EXAMPLE
53 BUGS
55 SEE ALSO
57 INTERNALS
59 *****************************************************************************/
61 AROS_LIBFUNC_INIT
63 if (screen && screen->BarLayer)
65 struct ShowTitleActionMsg msg;
67 #ifdef SKINS
68 if (GetPrivScreen(screen)->SpecialFlags & (SF_InvisibleBar|SF_AppearingBar)) return;
69 #endif
71 msg.screen = screen;
72 msg.showit = ShowIt;
73 DoASyncAction((APTR)int_showtitle, &msg.msg, sizeof(msg), IntuitionBase);
76 AROS_LIBFUNC_EXIT
78 } /* ShowTitle */
81 static VOID int_showtitle(struct ShowTitleActionMsg *msg,
82 struct IntuitionBase *IntuitionBase)
84 struct LayersBase *LayersBase = GetPrivIBase(IntuitionBase)->LayersBase;
85 struct Screen *screen = msg->screen;
87 if (!msg->showit)
89 if (screen->Flags & SHOWTITLE)
91 LOCK_REFRESH(screen);
93 BehindLayer(0, screen->BarLayer);
95 AROS_ATOMIC_AND(screen->Flags, ~SHOWTITLE);
97 CheckLayers(screen, IntuitionBase);
99 UNLOCK_REFRESH(screen);
102 else
104 if (!(screen->Flags & SHOWTITLE))
106 LOCK_REFRESH(screen);
108 UpfrontLayer(0, screen->BarLayer);
110 AROS_ATOMIC_OR(screen->Flags, SHOWTITLE);
112 CheckLayers(screen, IntuitionBase);
114 UNLOCK_REFRESH(screen);