2 Copyright © 1995-2011, 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 ShowWindowActionMsg
14 struct IntuiActionMsg msg
;
15 struct Window
*window
;
18 static VOID
int_showwindow(struct ShowWindowActionMsg
*msg
,
19 struct IntuitionBase
*IntuitionBase
);
21 /*****************************************************************************
24 #include <proto/intuition.h>
26 AROS_LH2(BOOL
, ShowWindow
,
29 AROS_LHA(struct Window
*, window
, A0
),
30 AROS_LHA(struct Window
*, other
, A1
),
33 struct IntuitionBase
*, IntuitionBase
, 140, Intuition
)
36 Make a window visible. This function does not bring the
37 window back into the visible area of the screen but rather
38 switches it into visible state.
41 window - The window to affect.
44 Success indicator. On AROS it's always TRUE.
47 This function is soure-compatible with AmigaOS v4.
60 *****************************************************************************/
64 struct ShowWindowActionMsg msg
;
66 DEBUG_SHOWWINDOW(dprintf("ShowWindow: Window 0x%p\n", window
));
67 SANITY_CHECKR(window
, FALSE
)
70 * TODO: in AmigaOS v4 we have additional 'other' parameter,
71 * and the window is moved in front of that window. Implement this.
75 DoASyncAction((APTR
)int_showwindow
, &msg
.msg
, sizeof(msg
), IntuitionBase
);
82 static VOID
int_showwindow(struct ShowWindowActionMsg
*msg
,
83 struct IntuitionBase
*IntuitionBase
)
85 struct LayersBase
*LayersBase
= GetPrivIBase(IntuitionBase
)->LayersBase
;
86 struct Window
*window
= msg
->window
;
87 #ifdef CGXSHOWHIDESUPPORT
88 struct Library
*CGXSystemBase
;
90 if (!ResourceExisting(window
, RESOURCE_WINDOW
, IntuitionBase
)) return;
93 if ((CGXSystemBase
= OpenLibrary("cgxsystem.library", 0)))
95 CGXShowWindow(window
);
96 ((struct IntWindow
*)(window
))->specialflags
&= ~SPFLAG_ICONIFIED
;
97 CloseLibrary(CGXSystemBase
);
98 ActivateWindow(window
);
101 struct Screen
*screen
;
103 if (!ResourceExisting(window
, RESOURCE_WINDOW
, IntuitionBase
)) return;
104 screen
= window
->WScreen
;
106 if (!IsWindowVisible(window
))
108 struct Requester
*req
;
110 LOCK_REFRESH(screen
);
114 ChangeLayerVisibility(BLAYER(window
), TRUE
);
116 ChangeLayerVisibility(WLAYER(window
), TRUE
);
118 for (req
= window
->FirstRequest
; req
; req
= req
->OlderRequest
)
120 ChangeLayerVisibility(req
->ReqLayer
, TRUE
);
123 CheckLayers(screen
, IntuitionBase
);
125 UNLOCK_REFRESH(screen
);