1 #include <intuition/diattr.h>
2 #include <intuition/iobsolete.h>
3 #include <proto/intuition.h>
13 static UWORD test_pens
[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
15 static struct DrawInfo test_di
=
20 (APTR
)(IPTR
)0xC0DEBAD1,
24 (APTR
)(IPTR
)0xC0DEBAD2,
25 (APTR
)(IPTR
)0xC0DEBAD3
28 static void TestAttr(ULONG id
, struct DrawInfo
*dinfo
)
31 IPTR val
= GetDrawInfoAttr(dinfo
, id
, &err
);
33 printf("AttrID 0x%08lX Value %08llX\tError: %lld\n", (unsigned long)id
, (unsigned long long)val
, (long long)err
);
36 static void TestAllAttrs(struct DrawInfo
*dinfo
)
40 /* All colors, including invalid one */
41 for (attr
= DRIPEN_DETAIL
; attr
<= DRIPEN_NUMDRIPENS
; attr
++)
43 TestAttr(GDIA_Color
| attr
, dinfo
);
47 for (attr
= DRIPEN_DETAIL
; attr
<= DRIPEN_NUMDRIPENS
; attr
++)
49 TestAttr(GDIA_Pen
| attr
, dinfo
);
52 /* The rest of attributes, including invalid attr */
53 for (attr
= GDIA_Version
; attr
<= 0x00C00000; attr
+= 0x00100000)
55 TestAttr(attr
, dinfo
);
61 struct Screen
*scr
= LockPubScreen(NULL
);
66 printf("Failed to lock default public screen!\n");
70 di
= GetScreenDrawInfo(scr
);
71 printf("Checking attributes for DrawInfo %p public screen %p\n", di
, scr
);
75 /* On MorphOS the function simply fails if meets non-own dri_Version */
76 test_di
.dri_Version
= di
->dri_Version
;
78 printf("Checking test DrawInfo\n");
79 TestAllAttrs(&test_di
);
81 UnlockPubScreen(NULL
, scr
);
82 printf("Checking default values...\n");