2 (C) 1999 AROS - The Amiga Research OS
5 Desc: Demo showing moving and sizing of windows
11 #include <exec/types.h>
12 #include <graphics/rastport.h>
13 #include <graphics/gfxmacros.h>
14 #include <intuition/intuition.h>
15 #include <proto/dos.h>
16 #include <proto/exec.h>
17 #include <proto/graphics.h>
18 #include <proto/intuition.h>
20 struct IntuitionBase
*IntuitionBase
;
21 struct GfxBase
*GfxBase
;
22 struct Library
*LayersBase
;
23 struct DosLibrary
*DOSBase
;
25 struct IntuiMessage
*msg
;
27 struct Window
*openwindow(LONG x
, LONG y
, LONG w
, LONG h
);
30 int main(int argc
, char **argv
)
34 if ((IntuitionBase
= (struct IntuitionBase
*) OpenLibrary("intuition.library", 0)))
36 if ((GfxBase
= (struct GfxBase
*)OpenLibrary("graphics.library", 0)))
38 if ((DOSBase
= (struct DosLibrary
*) OpenLibrary("dos.library",0)))
42 w1
= openwindow(100, 100, 100, 100);
46 printf( "MoveWindow()...\n" );
47 for( x
=0 ; x
<50 ; x
++ )
50 // RefreshWindowFrame(w1);
52 for( y
=0 ; y
<50 ; y
++ )
55 // RefreshWindowFrame(w1);
58 printf( "ChangeWindowBox()...\n" );
59 for( x
=0 ; x
<50 ; x
++ )
61 ChangeWindowBox(w1
,150-x
,150-x
,100+x
,100+x
);
62 RefreshWindowFrame(w1
);
65 printf( "SizeWindow()...\n" );
66 for( y
=0 ; y
<50 ; y
++ )
69 RefreshWindowFrame(w1
);
72 printf( "Done!\nPress a key or click closegadget to quit.\n" );
74 Wait(1L<<w1
->UserPort
->mp_SigBit
);
75 msg
= (struct IntuiMessage
*)GetMsg(w1
->UserPort
);
76 /* Catch any message to quit */
77 ReplyMsg((struct Message
*)msg
);
81 CloseLibrary((struct Library
*)DOSBase
);
83 CloseLibrary((struct Library
*)GfxBase
);
85 CloseLibrary((struct Library
*) IntuitionBase
);
92 struct Window
*openwindow(LONG x
, LONG y
, LONG w
, LONG h
)
95 struct Window
*window
;
102 window
= OpenWindowTags(NULL
,
103 WA_IDCMP
, IDCMP_RAWKEY
|IDCMP_CLOSEWINDOW
,
109 WA_DepthGadget
, TRUE
,
111 WA_CloseGadget
, TRUE
,
112 WA_Title
, (IPTR
)"Windowing demo",
115 printf("Window opened\n");