2 Copyright © 1995-2007, 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 #ifdef CGXSHOWHIDESUPPORT
13 #undef ChangeLayerVisibility
14 struct HideWindowActionMsg
16 struct IntuiActionMsg msg
;
17 struct Window
*window
;
20 static VOID
int_hidewindow(struct HideWindowActionMsg
*msg
,
21 struct IntuitionBase
*IntuitionBase
);
24 #ifdef ChangeLayerVisibility
25 struct HideWindowActionMsg
27 struct IntuiActionMsg msg
;
28 struct Window
*window
;
31 static VOID
int_hidewindow(struct HideWindowActionMsg
*msg
,
32 struct IntuitionBase
*IntuitionBase
);
35 /*****************************************************************************
38 #include <proto/intuition.h>
40 AROS_LH1(VOID
, HideWindow
,
43 AROS_LHA(struct Window
*, window
, A0
),
46 struct IntuitionBase
*, IntuitionBase
, 141, Intuition
)
49 Make a window invisible.
52 window - The window to affect.
68 *****************************************************************************/
72 #ifdef CGXSHOWHIDESUPPORT
73 struct HideWindowActionMsg msg
;
75 DEBUG_HIDEWINDOW(dprintf("HideWindow: Window 0x%lx\n", (ULONG
) window
));
78 if (window
->Flags
& WFLG_BACKDROP
) return;
81 DoASyncAction((APTR
)int_hidewindow
, &msg
.msg
, sizeof(msg
), IntuitionBase
);
84 #ifdef ChangeLayerVisibility
85 struct HideWindowActionMsg msg
;
87 DEBUG_HIDEWINDOW(dprintf("HideWindow: Window 0x%lx\n", window
));
90 DoASyncAction((APTR
)int_hidewindow
, &msg
.msg
, sizeof(msg
), IntuitionBase
);
97 #ifdef CGXSHOWHIDESUPPORT
98 static VOID
int_hidewindow(struct HideWindowActionMsg
*msg
,
99 struct IntuitionBase
*IntuitionBase
)
101 struct Window
*window
= msg
->window
;
102 struct Library
*CGXSystemBase
;
106 if (!ResourceExisting(window
, RESOURCE_WINDOW
, IntuitionBase
)) return;
108 if (window
->Flags
& WFLG_BACKDROP
) return;
110 if (((struct IntWindow
*)(window
))->specialflags
& SPFLAG_NOICONIFY
) return;
112 if ((CGXSystemBase
= OpenLibrary("cgxsystem.library", 0)))
114 CGXHideWindow(window
);
115 ((struct IntWindow
*)(window
))->specialflags
|= SPFLAG_ICONIFIED
;
116 CloseLibrary(CGXSystemBase
);
121 #ifdef ChangeLayerVisibility
122 static VOID
int_hidewindow(struct HideWindowActionMsg
*msg
,
123 struct IntuitionBase
*IntuitionBase
)
125 struct Window
*window
= msg
->window
;
126 struct Screen
*screen
;
128 if (!ResourceExisting(window
, RESOURCE_WINDOW
, IntuitionBase
)) return;
130 screen
= window
->WScreen
;
132 if (IsWindowVisible(window
))
134 struct Requester
*req
;
136 LOCK_REFRESH(screen
);
140 ChangeLayerVisibility(BLAYER(window
), FALSE
);
142 ChangeLayerVisibility(WLAYER(window
), FALSE
);
144 for (req
= window
->FirstRequest
; req
; req
= req
->OlderRequest
)
146 ChangeLayerVisibility(req
->ReqLayer
, FALSE
);
149 UNLOCK_REFRESH(screen
);
151 CheckLayers(screen
, IntuitionBase
);