grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / intuition / changewindowshape.c
blobcf42232fc3e5a1423df9c496f9f6bd08af5ec3b5
1 /*
2 Copyright © 1995-2013, 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
43 INPUTS
44 window - The window to affect.
46 RESULT
48 NOTES
49 This function is also present in MorphOS v50, however
50 not implemented and reserved.
52 EXAMPLE
54 BUGS
56 SEE ALSO
58 INTERNALS
60 *****************************************************************************/
62 AROS_LIBFUNC_INIT
64 #ifdef ChangeLayerShape
65 struct ChangeWindowShapeActionMsg msg;
67 ASSERT_VALID_PTR(window);
69 if (IS_GZZWINDOW(window)) return NULL;
71 msg.window = window;
72 msg.shape = newshape;
73 msg.callback = callback;
74 DoSyncAction((APTR)int_changewindowshape, &msg.msg, IntuitionBase);
76 return msg.shape;
77 #else
79 /* shut up the compiler */
80 IntuitionBase = IntuitionBase;
81 callback = callback;
82 newshape = newshape;
83 window = window;
85 return NULL;
86 #endif
88 AROS_LIBFUNC_EXIT
90 } /* ChangeWindowShape */
93 #ifdef ChangeLayerShape
94 static VOID int_changewindowshape(struct ChangeWindowShapeActionMsg *msg,
95 struct IntuitionBase *IntuitionBase)
97 struct LayersBase *LayersBase = GetPrivIBase(IntuitionBase)->LayersBase;
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