Added kernel module for starting the usb stack at boot time. It's not activated thoug...
[cake.git] / rom / intuition / showwindow.c
bloba103cffe510bfa552d347a5e63801efeed88fca5
1 /*
2 Copyright © 1995-2007, 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 "showhide.h"
9 #include "intuition_intern.h"
10 #include "inputhandler_actions.h"
12 #ifdef CGXSHOWHIDESUPPORT
13 #undef ChangeLayerVisibility
14 struct ShowWindowActionMsg
16 struct IntuiActionMsg msg;
17 struct Window *window;
20 static VOID int_showwindow(struct ShowWindowActionMsg *msg,
21 struct IntuitionBase *IntuitionBase);
22 #endif
24 #ifdef ChangeLayerVisibility
25 struct ShowWindowActionMsg
27 struct IntuiActionMsg msg;
28 struct Window *window;
31 static VOID int_showwindow(struct ShowWindowActionMsg *msg,
32 struct IntuitionBase *IntuitionBase);
33 #endif
35 /*****************************************************************************
37 NAME */
38 #include <proto/intuition.h>
40 AROS_LH1(VOID, ShowWindow,
42 /* SYNOPSIS */
43 AROS_LHA(struct Window *, window, A0),
45 /* LOCATION */
46 struct IntuitionBase *, IntuitionBase, 140, Intuition)
48 /* FUNCTION
49 Make a window visible. This function does not bring the
50 window back into the visible area of the screen but rather
51 switches it into visible state.
54 INPUTS
55 window - The window to affect.
57 RESULT
59 NOTES
61 EXAMPLE
63 BUGS
65 SEE ALSO
67 INTERNALS
69 HISTORY
71 *****************************************************************************/
73 AROS_LIBFUNC_INIT
75 #ifdef CGXSHOWHIDESUPPORT
76 struct ShowWindowActionMsg msg;
78 DEBUG_SHOWWINDOW(dprintf("ShowWindow: Window 0x%lx\n", window));
80 SANITY_CHECK(window)
82 msg.window = window;
83 DoASyncAction((APTR)int_showwindow, &msg.msg, sizeof(msg), IntuitionBase);
84 #endif
86 #ifdef ChangeLayerVisibility
87 struct ShowWindowActionMsg msg;
89 DEBUG_SHOWWINDOW(dprintf("ShowWindow: Window 0x%lx\n", window));
91 msg.window = window;
92 DoASyncAction((APTR)int_showwindow, &msg.msg, sizeof(msg), IntuitionBase);
93 #endif
95 AROS_LIBFUNC_EXIT
96 } /* ShowWindow */
98 #ifdef CGXSHOWHIDESUPPORT
99 static VOID int_showwindow(struct ShowWindowActionMsg *msg,
100 struct IntuitionBase *IntuitionBase)
102 struct Window *window = msg->window;
103 struct Library *CGXSystemBase;
105 if (!ResourceExisting(window, RESOURCE_WINDOW, IntuitionBase)) return;
107 SANITY_CHECK(window)
108 if ((CGXSystemBase = OpenLibrary("cgxsystem.library", 0)))
110 CGXShowWindow(window);
111 ((struct IntWindow *)(window))->specialflags &= ~SPFLAG_ICONIFIED;
112 CloseLibrary(CGXSystemBase);
113 ActivateWindow(window);
116 #endif
118 #ifdef ChangeLayerVisibility
119 static VOID int_showwindow(struct ShowWindowActionMsg *msg,
120 struct IntuitionBase *IntuitionBase)
122 struct Window *window = msg->window;
123 struct Screen *screen;
125 if (!ResourceExisting(window, RESOURCE_WINDOW, IntuitionBase)) return;
126 screen = window->WScreen;
128 if (!IsWindowVisible(window))
130 struct Requester *req;
132 LOCK_REFRESH(screen);
134 if (BLAYER(window))
136 ChangeLayerVisibility(BLAYER(window), TRUE);
138 ChangeLayerVisibility(WLAYER(window), TRUE);
140 for (req = window->FirstRequest; req; req = req->OlderRequest)
142 ChangeLayerVisibility(req->ReqLayer, TRUE);
145 CheckLayers(screen, IntuitionBase);
147 UNLOCK_REFRESH(screen);
150 #endif