]> git.sur5r.net Git - cc65/blob - include/geos/gstruct.h
new MessageBox function
[cc65] / include / geos / gstruct.h
1 /*
2   GEOS structs
3
4   ported to small C on 25-27.10.1999
5   by Maciej 'YTM/Elysium' Witkowiak
6 */
7
8 /*
9    apart from initializing data, structures below can be used to
10    speed up access to data and let cc65 to generate better code
11    e.g. if you have menu defined as TopMenu and you want to change the number of
12    menu items use:
13     ((struct menu*)&TopMenu)->number=newNumber;
14    This will translate into single lda/sta pair
15 */
16
17 #ifndef _GSTRUCT_H
18 #define _GSTRUCT_H
19
20 typedef void (*void_func) (void);
21
22 struct f_date {                 /* date in filedesctiptor */
23         char f_year;
24         char f_month;
25         char f_day;
26         char f_hour;
27         char f_minute;
28 };
29
30 struct s_date {                 /* system date & time */
31         char s_year;
32         char s_month;
33         char s_day;
34         char s_hour;
35         char s_minutes;
36         char s_seconds;
37 };
38
39 struct tr_se {                  /* track and sector */
40         char track;
41         char sector;
42 };
43
44 struct fileheader {             /* header block (like fileHeader) */
45         struct tr_se n_block;
46         char icon_desc[3];
47         char icon_pic[63];
48         char dostype;
49         char type;
50         char structure;
51         unsigned load_address;
52         unsigned end_address;
53         unsigned exec_address;
54         char class_name[19];
55         char column_flag;
56         char author[63];
57         char note[96];
58 };
59
60 struct filehandle {             /* filehandle in directory sectors */
61         char dostype;           /* or in dirEntryBuf               */
62         struct tr_se n_block;
63         char name[16];
64         struct tr_se header;
65         char structure;
66         char type;
67         struct f_date date;
68         unsigned size;
69 };
70
71 struct pixel {                  /* describes point              */
72         unsigned x;
73         char y;
74 };
75
76 struct fontdesc {               /* describes font               */
77         char baseline;
78         char width;
79         char height;
80         char *index_tbl;
81         char *data_ptr;
82 };
83
84 struct window {                 /* describes screen region      */
85         char top;
86         char bot;
87         unsigned left;
88         unsigned right;
89 };
90
91 struct VLIR_info {              /* VLIR information             */
92         char curRecord;         /* currently only used in VLIR  */
93         char usedRecords;       /* as system info (curRecord is mainly of your interest */
94         char fileWritten;
95         unsigned fileSize;
96 };
97
98 struct process {                /* process info, declare table of that type */
99         unsigned pointer;       /* (like: struct process proctab[2]=...    */
100         unsigned jiffies;       /* last entry HAVE TO BE {0,0}              */
101 };
102
103
104 struct iconpic {                /* icon/encoded bitmap description          */
105         char *pic_ptr;          /* ptr to a photo scrap (or encoded bitmap) */
106         char x;                 /* position in cards (*8 pixels)            */
107         char y;
108         char width;             /* in cards                                 */
109         char heigth;            /* in lines (pixels)                        */
110 };
111
112 struct icondef {                /* icon definition for DoIcons              */
113         char *pic_ptr;          /* ptr to a photo scrap (or encoded bitmap) */
114         char x;                 /* position in cards (*8 pixels)            */
115         char y;
116         char width;             /* of icon (in cards)                       */
117         char heigth;            /* of icon in lines (pixels)                */
118         unsigned proc_ptr;      /* pointer to function handling that icon   */
119 };
120
121 struct icontab {
122         char number;            /* number of declared icons                 */
123         struct pixel mousepos;  /* position of mouse after DoIcons          */
124         struct icondef tab[];   /* table of size declared by icontab.number */
125 };
126
127
128 struct menuitem {
129         char *name;
130         char type;
131         void *rest;             /* may be ptr to function, or ptr to struct menu (submenu) */
132 };
133
134 struct menu {
135         struct window size;
136         char number;
137         struct menuitem items[];
138 };
139
140 struct inittab {                /* use struct inittab mytab[n] for initram              */
141         unsigned ptr;           /* ptr to 1st byte                                      */
142         char number;            /* number of following bytes                            */
143         char values[];          /* actual string of bytes                               */
144 };
145
146 #endif