define __KERNEL_STRICT_NAMES to avoid inclusion of kernel types on systems that carry...
[cake.git] / rom / intuition / changewindowshape.c
blob2aa2337d22d472a4bb2ddd52e292512d031e869b
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 "intuition_intern.h"
9 #include "inputhandler_actions.h"
11 #ifdef ChangeLayerShape
13 struct ChangeWindowShapeActionMsg
15 struct IntuiActionMsg msg;
16 struct Window *window;
17 struct Region *shape;
18 struct Hook *callback;
21 static VOID int_changewindowshape(struct ChangeWindowShapeActionMsg *msg,
22 struct IntuitionBase *IntuitionBase);
24 #endif
26 /*****************************************************************************
28 NAME */
29 #include <proto/intuition.h>
31 AROS_LH3(struct Region *, ChangeWindowShape,
33 /* SYNOPSIS */
34 AROS_LHA(struct Window *, window, A0),
35 AROS_LHA(struct Region *, newshape, A1),
36 AROS_LHA(struct Hook *, callback, A2),
38 /* LOCATION */
39 struct IntuitionBase *, IntuitionBase, 143, Intuition)
41 /* FUNCTION
42 Make a window invisible.
44 INPUTS
45 window - The window to affect.
47 RESULT
49 NOTES
51 EXAMPLE
53 BUGS
55 SEE ALSO
57 INTERNALS
59 HISTORY
61 *****************************************************************************/
63 AROS_LIBFUNC_INIT
65 #ifdef ChangeLayerShape
66 struct ChangeWindowShapeActionMsg msg;
68 ASSERT_VALID_PTR(window);
70 if (IS_GZZWINDOW(window)) return NULL;
72 msg.window = window;
73 msg.shape = newshape;
74 msg.callback = callback;
75 DoSyncAction((APTR)int_changewindowshape, &msg.msg, IntuitionBase);
77 return msg.shape;
78 #else
80 /* shut up the compiler */
81 IntuitionBase = IntuitionBase;
82 callback = callback;
83 newshape = newshape;
84 window = window;
86 return NULL;
87 #endif
89 AROS_LIBFUNC_EXIT
91 } /* ChangeWindowShape */
94 #ifdef ChangeLayerShape
95 static VOID int_changewindowshape(struct ChangeWindowShapeActionMsg *msg,
96 struct IntuitionBase *IntuitionBase)
98 struct Window *window = msg->window;
99 struct Region *shape = msg->shape;
100 struct Hook *callback = msg->callback;
101 struct Screen *screen = window->WScreen;
103 if (!ResourceExisting(window, RESOURCE_WINDOW, IntuitionBase)) return;
105 LOCK_REFRESH(screen);
106 msg->shape = ChangeLayerShape(window->WLayer, shape, callback);
107 UNLOCK_REFRESH(screen);
109 CheckLayers(screen, IntuitionBase);
111 #endif