2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 #include <intuition/diattr.h>
7 #include <intuition/iobsolete.h>
8 #include <proto/intuition.h>
18 static UWORD test_pens
[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
20 static struct DrawInfo test_di
=
25 (APTR
)(IPTR
)0xC0DEBAD1,
29 (APTR
)(IPTR
)0xC0DEBAD2,
30 (APTR
)(IPTR
)0xC0DEBAD3
33 static void TestAttr(ULONG id
, struct DrawInfo
*dinfo
)
36 IPTR val
= GetDrawInfoAttr(dinfo
, id
, &err
);
38 printf("AttrID 0x%08lX Value %08llX\tError: %lld\n", (unsigned long)id
, (unsigned long long)val
, (long long)err
);
41 static void TestAllAttrs(struct DrawInfo
*dinfo
)
45 /* All colors, including invalid one */
46 for (attr
= DRIPEN_DETAIL
; attr
<= DRIPEN_NUMDRIPENS
; attr
++)
48 TestAttr(GDIA_Color
| attr
, dinfo
);
52 for (attr
= DRIPEN_DETAIL
; attr
<= DRIPEN_NUMDRIPENS
; attr
++)
54 TestAttr(GDIA_Pen
| attr
, dinfo
);
57 /* The rest of attributes, including invalid attr */
58 for (attr
= GDIA_Version
; attr
<= 0x00C00000; attr
+= 0x00100000)
60 TestAttr(attr
, dinfo
);
66 struct Screen
*scr
= LockPubScreen(NULL
);
71 printf("Failed to lock default public screen!\n");
75 di
= GetScreenDrawInfo(scr
);
76 printf("Checking attributes for DrawInfo %p public screen %p\n", di
, scr
);
80 /* On MorphOS the function simply fails if meets non-own dri_Version */
81 test_di
.dri_Version
= di
->dri_Version
;
83 printf("Checking test DrawInfo\n");
84 TestAllAttrs(&test_di
);
86 UnlockPubScreen(NULL
, scr
);
87 printf("Checking default values...\n");