2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id: sendintuimessage.c 23476 2005-07-31 17:07:04Z stegerg $
7 #include <proto/utility.h>
8 #include <intuition/windecorclass.h>
9 #include <intuition/scrdecorclass.h>
10 #include <intuition/screens.h>
12 #include "intuition_intern.h"
13 #include "inputhandler_actions.h"
15 struct ChangeDecorationActionMsg
17 struct IntuiActionMsg msg
;
20 struct SignalSemaphore
*decorsem
;
24 static VOID
int_changedecoration(struct ChangeDecorationActionMsg
*msg
,
25 struct IntuitionBase
*IntuitionBase
);
27 /*****************************************************************************
30 #include <proto/intuition.h>
32 AROS_LH4(Object
*, ChangeDecorationA
,
35 AROS_LHA(ULONG
, which
, D0
),
36 AROS_LHA(CONST_STRPTR
, classID
, A1
),
37 AROS_LHA(struct DrawInfo
*, dri
, A0
),
38 AROS_LHA(struct TagItem
*, tagList
, A2
),
41 struct IntuitionBase
*, IntuitionBase
, 153, Intuition
)
59 *****************************************************************************/
62 AROS_LIBBASE_EXT_DECL(struct IntuitionBase
*,IntuitionBase
)
64 Object
*old
= 0, *new;
65 struct TagItem decor_tags
[] =
67 {TAG_IGNORE
, (IPTR
)dri
},
68 {TAG_IGNORE
, (IPTR
)((struct IntDrawInfo
*)dri
)->dri_Screen
},
71 struct ChangeDecorationActionMsg msg
;
73 ASSERT_VALID_PTR(dri
);
77 case DECORATION_WINDOW
:
78 decor_tags
[0].ti_Tag
= WDA_DrawInfo
;
79 decor_tags
[1].ti_Tag
= WDA_Screen
;
80 msg
.decorobjptr
= &((struct IntDrawInfo
*)dri
)->dri_WinDecorObj
;
81 msg
.decorsem
= &((struct IntDrawInfo
*)dri
)->dri_WinDecorSem
;
84 case DECORATION_SCREEN
:
85 decor_tags
[0].ti_Tag
= SDA_DrawInfo
;
86 decor_tags
[1].ti_Tag
= SDA_Screen
;
87 msg
.decorobjptr
= &((struct IntDrawInfo
*)dri
)->dri_ScrDecorObj
;
88 msg
.decorsem
= &((struct IntDrawInfo
*)dri
)->dri_ScrDecorSem
;
95 new = NewObjectA(NULL
, (UBYTE
*)classID
, decor_tags
);
98 ObtainSemaphore(msg
.decorsem
);
99 old
= *msg
.decorobjptr
;
100 *msg
.decorobjptr
= new;
101 ReleaseSemaphore(msg
.decorsem
);
106 DoASyncAction((APTR
)int_changedecoration
, &msg
.msg
, sizeof(msg
), IntuitionBase
);
113 static VOID
int_changedecoration(struct ChangeDecorationActionMsg
*msg
,
114 struct IntuitionBase
*IntuitionBase
)
116 struct Screen
*scr
= ((struct IntDrawInfo
*)msg
->dri
)->dri_Screen
;
119 if (!ResourceExisting(scr
, RESOURCE_SCREEN
, IntuitionBase
)) return;
123 case DECORATION_WINDOW
:
124 for(win
= scr
->FirstWindow
; win
; win
= win
->NextWindow
)
128 if (win
->FirstGadget
)
130 struct wdpLayoutBorderGadgets layoutmsg
;
132 layoutmsg
.MethodID
= WDM_LAYOUT_BORDERGADGETS
;
133 layoutmsg
.wdp_Window
= win
;
134 layoutmsg
.wdp_Gadgets
= win
->FirstGadget
;
135 layoutmsg
.wdp_Flags
= WDF_LBG_MULTIPLE
|
138 LOCKSHARED_WINDECOR(msg
->dri
);
139 DoMethodA(((struct IntDrawInfo
*)msg
->dri
)->dri_WinDecorObj
, (Msg
)&layoutmsg
);
140 UNLOCK_WINDECOR(msg
->dri
);
145 RefreshWindowFrame(win
);
147 } /* for(win = scr->FirstWindow; win; win = win->NextWindow) */
150 case DECORATION_SCREEN
:
151 RenderScreenBar(scr
, FALSE
, IntuitionBase
);
154 } /* switch(msg->which) */