Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / muiscreen / fileformat.h
blob62d4d7fce780655cadd00232ca1c40e3cb206ef5
1 #ifndef FILEFORMAT_H
2 #define FILEFORMAT_H
4 /*
5 Copyright © 2009, The AROS Development Team. All rights reserved.
6 $Id$
7 */
9 #include <exec/types.h>
10 #include <libraries/iffparse.h>
12 struct FilePrefHeader
14 UBYTE ph_Version;
15 UBYTE ph_Type;
16 UBYTE ph_Flags[4];
19 struct MUI_RGBcolorArray
21 UBYTE red[4];
22 UBYTE green[4];
23 UBYTE blue[4];
26 struct MUI_PenSpecArray
28 UBYTE ps_buf[32];
31 struct MUI_PubScreenDescArray
33 UBYTE Version[4];
35 char Name[PSD_MAXLEN_NAME];
36 char Title[PSD_MAXLEN_TITLE];
37 char Font[PSD_MAXLEN_FONT];
38 char Background[PSD_MAXLEN_BACKGROUND];
40 UBYTE DisplayID[4];
42 UBYTE DisplayWidth[2];
43 UBYTE DisplayHeight[2];
45 UBYTE DisplayDepth;
46 UBYTE OverscanType;
47 UBYTE AutoScroll;
48 UBYTE NoDrag;
49 UBYTE Exclusive;
50 UBYTE Interleaved;
51 UBYTE SysDefault;
52 UBYTE Behind;
53 UBYTE AutoClose;
54 UBYTE CloseGadget;
55 UBYTE DummyWasForeign;
57 BYTE SystemPens[PSD_MAXSYSPENS];
58 UBYTE Reserved[1+7*4-PSD_MAXSYSPENS];
60 struct MUI_RGBcolorArray Palette[PSD_NUMCOLS];
61 struct MUI_RGBcolorArray rsvd[PSD_MAXSYSPENS-PSD_NUMCOLS];
63 struct MUI_PenSpecArray rsvd2[PSD_MAXMUIPENS];
65 UBYTE Changed[4];
66 UBYTE UserData[4];
69 #define ARRAY_TO_LONG(x) ( ((x)[0] << 24UL) + \
70 ((x)[1] << 16UL) + \
71 ((x)[2] << 8UL) + \
72 ((x)[3]) )
74 #define ARRAY_TO_WORD(x) ( ((x)[0] << 8UL) + ((x)[1]) )
76 #define LONG_TO_ARRAY(x,y) (y)[0] = (UBYTE)(ULONG)((x) >> 24UL); \
77 (y)[1] = (UBYTE)(ULONG)((x) >> 16UL); \
78 (y)[2] = (UBYTE)(ULONG)((x) >> 8UL); \
79 (y)[3] = (UBYTE)(ULONG)((x));
81 #define WORD_TO_ARRAY(x,y) (y)[0] = (UBYTE)(ULONG)((x) >> 8UL); \
82 (y)[1] = (UBYTE)(ULONG)((x));
84 #define ARRAY_TO_COLS(x,y) do { \
85 int i; \
86 for(i = 0; i < sizeof(x) / sizeof(x[0]); i++) \
87 { \
88 struct MUI_RGBcolorArray *src = &x[i]; \
89 struct MUI_RGBcolor *dst = &y[i]; \
90 dst->red = ARRAY_TO_LONG(src->red); \
91 dst->green = ARRAY_TO_LONG(src->green); \
92 dst->blue = ARRAY_TO_LONG(src->blue); \
93 } \
94 } while(0);
96 #define COLS_TO_ARRAY(x,y) do { \
97 int i; \
98 for(i = 0; i < sizeof(x) / sizeof(x[0]); i++) \
99 { \
100 struct MUI_RGBcolor *src = &x[i]; \
101 struct MUI_RGBcolorArray *dst = &y[i]; \
102 LONG_TO_ARRAY(src->red, dst->red); \
103 LONG_TO_ARRAY(src->green, dst->green); \
104 LONG_TO_ARRAY(src->blue, dst->blue); \
106 } while(0);
108 #define ID_MPUB MAKE_ID('M','P','U','B')
110 #endif