2 Copyright © 1995-2003, 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 *****************************************************************************/
71 AROS_LIBBASE_EXT_DECL(struct IntuitionBase
*,IntuitionBase
)
73 #ifdef CGXSHOWHIDESUPPORT
74 struct HideWindowActionMsg msg
;
76 DEBUG_HIDEWINDOW(dprintf("HideWindow: Window 0x%lx\n", (ULONG
) window
));
79 if (window
->Flags
& WFLG_BACKDROP
) return;
82 DoASyncAction((APTR
)int_hidewindow
, &msg
.msg
, sizeof(msg
), IntuitionBase
);
85 #ifdef ChangeLayerVisibility
86 struct HideWindowActionMsg msg
;
88 DEBUG_HIDEWINDOW(dprintf("HideWindow: Window 0x%lx\n", window
));
91 DoASyncAction((APTR
)int_hidewindow
, &msg
.msg
, sizeof(msg
), IntuitionBase
);
98 #ifdef CGXSHOWHIDESUPPORT
99 static VOID
int_hidewindow(struct HideWindowActionMsg
*msg
,
100 struct IntuitionBase
*IntuitionBase
)
102 struct Window
*window
= msg
->window
;
103 struct Library
*CGXSystemBase
;
107 if (!ResourceExisting(window
, RESOURCE_WINDOW
, IntuitionBase
)) return;
109 if (window
->Flags
& WFLG_BACKDROP
) return;
111 if (((struct IntWindow
*)(window
))->specialflags
& SPFLAG_NOICONIFY
) return;
113 if ((CGXSystemBase
= OpenLibrary("cgxsystem.library", 0)))
115 CGXHideWindow(window
);
116 ((struct IntWindow
*)(window
))->specialflags
|= SPFLAG_ICONIFIED
;
117 CloseLibrary(CGXSystemBase
);
122 #ifdef ChangeLayerVisibility
123 static VOID
int_hidewindow(struct HideWindowActionMsg
*msg
,
124 struct IntuitionBase
*IntuitionBase
)
126 struct Window
*window
= msg
->window
;
127 struct Screen
*screen
;
129 if (!ResourceExisting(window
, RESOURCE_WINDOW
, IntuitionBase
)) return;
131 screen
= window
->WScreen
;
133 if (IsWindowVisible(window
))
135 struct Requester
*req
;
137 LOCK_REFRESH(screen
);
141 ChangeLayerVisibility(BLAYER(window
), FALSE
);
143 ChangeLayerVisibility(WLAYER(window
), FALSE
);
145 for (req
= window
->FirstRequest
; req
; req
= req
->OlderRequest
)
147 ChangeLayerVisibility(req
->ReqLayer
, FALSE
);
150 UNLOCK_REFRESH(screen
);
152 CheckLayers(screen
, IntuitionBase
);