2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <proto/layers.h>
9 #include "intuition_intern.h"
10 #include "inputhandler_actions.h"
12 struct HideWindowActionMsg
14 struct IntuiActionMsg msg
;
15 struct Window
*window
;
18 static VOID
int_hidewindow(struct HideWindowActionMsg
*msg
,
19 struct IntuitionBase
*IntuitionBase
);
21 /*****************************************************************************
24 #include <proto/intuition.h>
26 AROS_LH1(BOOL
, HideWindow
,
29 AROS_LHA(struct Window
*, window
, A0
),
32 struct IntuitionBase
*, IntuitionBase
, 141, Intuition
)
35 Make a window invisible.
38 window - The window to affect.
41 Success indicator. On AROS this is always TRUE.
44 This function is source-compatible with AmigaOS v4.
45 This function is also present in MorphOS v50, however
57 *****************************************************************************/
61 struct HideWindowActionMsg msg
;
63 DEBUG_HIDEWINDOW(dprintf("HideWindow: Window 0x%lx\n", (ULONG
) window
));
64 SANITY_CHECKR(window
, FALSE
)
66 #ifdef CGXSHOWHIDESUPPORT
67 if (window
->Flags
& WFLG_BACKDROP
) return;
71 DoASyncAction((APTR
)int_hidewindow
, &msg
.msg
, sizeof(msg
), IntuitionBase
);
79 static VOID
int_hidewindow(struct HideWindowActionMsg
*msg
,
80 struct IntuitionBase
*IntuitionBase
)
82 struct LayersBase
*LayersBase
= GetPrivIBase(IntuitionBase
)->LayersBase
;
83 struct Window
*window
= msg
->window
;
84 #ifdef CGXSHOWHIDESUPPORT
85 struct Library
*CGXSystemBase
;
89 if (!ResourceExisting(window
, RESOURCE_WINDOW
, IntuitionBase
)) return;
91 if (window
->Flags
& WFLG_BACKDROP
) return;
93 if (((struct IntWindow
*)(window
))->specialflags
& SPFLAG_NOICONIFY
) return;
95 if ((CGXSystemBase
= OpenLibrary("cgxsystem.library", 0)))
97 CGXHideWindow(window
);
98 ((struct IntWindow
*)(window
))->specialflags
|= SPFLAG_ICONIFIED
;
99 CloseLibrary(CGXSystemBase
);
102 struct Screen
*screen
;
104 if (!ResourceExisting(window
, RESOURCE_WINDOW
, IntuitionBase
)) return;
106 screen
= window
->WScreen
;
108 if (IsWindowVisible(window
))
110 struct Requester
*req
;
112 LOCK_REFRESH(screen
);
116 ChangeLayerVisibility(BLAYER(window
), FALSE
);
118 ChangeLayerVisibility(WLAYER(window
), FALSE
);
120 for (req
= window
->FirstRequest
; req
; req
= req
->OlderRequest
)
122 ChangeLayerVisibility(req
->ReqLayer
, FALSE
);
125 UNLOCK_REFRESH(screen
);
127 CheckLayers(screen
, IntuitionBase
);