2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <proto/layers.h>
8 #include "intuition_intern.h"
9 #include "inputhandler_actions.h"
12 # include "renderwindowframe.h"
17 struct SetWindowTitlesActionMsg
19 struct IntuiActionMsg msg
;
20 struct Window
*window
;
21 CONST_STRPTR windowTitle
;
22 CONST_STRPTR screenTitle
;
25 static VOID
int_setwindowtitles(struct SetWindowTitlesActionMsg
*msg
,
26 struct IntuitionBase
*IntuitionBase
);
28 /*****************************************************************************
31 #include <proto/intuition.h>
33 AROS_LH3(void, SetWindowTitles
,
36 AROS_LHA(struct Window
*, window
, A0
),
37 AROS_LHA(CONST_STRPTR
, windowTitle
, A1
),
38 AROS_LHA(CONST_STRPTR
, screenTitle
, A2
),
41 struct IntuitionBase
*, IntuitionBase
, 46, Intuition
)
44 Changes the current window and/or the screen title.
47 window - Change the title for this window or the screen which the
49 windowTitle - New title for the window or ((UBYTE *)~0L) to keep the
50 old title or NULL for no title. If you specify a string,
51 this string is *NOT* copied.
52 screenTitle - New title for the screen of the window or ((UBYTE *)~0L)
53 to keep the old title or NULL for no title. If you specify
54 a title for the screen, this title will be shown when the
55 window becomes active. If you specify a string, this string
62 You should be careful with specifying a screen title because that
63 may irritate the user.
73 *****************************************************************************/
76 AROS_LIBBASE_EXT_DECL(struct IntuitionBase
*,IntuitionBase
)
78 struct SetWindowTitlesActionMsg msg
;
83 msg
.windowTitle
= windowTitle
;
84 msg
.screenTitle
= screenTitle
;
86 DoASyncAction((APTR
)int_setwindowtitles
, &msg
.msg
, sizeof(msg
), IntuitionBase
);
89 } /* SetWindowTitles */
91 static VOID
int_setwindowtitles(struct SetWindowTitlesActionMsg
*msg
,
92 struct IntuitionBase
*IntuitionBase
)
94 struct Window
*window
= msg
->window
;
95 CONST_STRPTR windowTitle
= msg
->windowTitle
;
96 CONST_STRPTR screenTitle
= msg
->screenTitle
;
99 LOCKWINDOWLAYERS(window
);
101 if (windowTitle
== (CONST_STRPTR
)~0L)
107 window
->Title
= windowTitle
;
109 if (strncmp(windowTitle
,IW(window
)->titlebuffer
,TITLEBUFFERLEN
) == 0) change
= FALSE
;
115 if (window
== GetPrivScreen(window
->WScreen
)->TitlebarBufferWin
) GetPrivScreen(window
->WScreen
)->TitlebarBufferWin
= 0;
117 int_RefreshWindowFrame(window
, REFRESHGAD_TOPBORDER
, 0, DOUBLEBUFFER
, IntuitionBase
);
120 /* Change screen's title */
123 if ((screenTitle
== window
->ScreenTitle
) || (screenTitle
== (CONST_STRPTR
)~0L)) change
= FALSE
;
127 //LONG lock = LockIBase(0);
129 window
->ScreenTitle
= screenTitle
;
131 if (window
->Flags
& WFLG_WINDOWACTIVE
)
134 window
->WScreen
->Title
= screenTitle
;
136 window
->WScreen
->Title
= window
->WScreen
->DefaultTitle
;
139 RenderScreenBar(window
->WScreen
, FALSE
, IntuitionBase
);
142 UNLOCKWINDOWLAYERS(window
);