Rev 193 | Rev 268 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
259 | daniel-mar | 1 | /* |
2 | This file is part of a common library |
||
3 | Copyright (C) 1990-2006 Toby Thain, toby@telegraphics.com.au |
||
4 | |||
5 | This program is free software; you can redistribute it and/or modify |
||
6 | it under the terms of the GNU General Public License as published by |
||
7 | the Free Software Foundation; either version 2 of the License, or |
||
8 | (at your option) any later version. |
||
9 | |||
10 | This program is distributed in the hope that it will be useful, |
||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
13 | GNU General Public License for more details. |
||
14 | |||
15 | You should have received a copy of the GNU General Public License |
||
16 | along with this program; if not, write to the Free Software |
||
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
18 | */ |
||
19 | |||
20 | #include <quickdraw.h> |
||
21 | #include <qdoffscreen.h> |
||
22 | #include <osutils.h> // SetCurrentA5 |
||
23 | #include <stddef.h> // offsetof |
||
24 | |||
25 | #ifndef TOPLEFT |
||
26 | #define TOPLEFT(r) (*(Point*)&(r).top) |
||
27 | #define BOTRIGHT(r) (*(Point*)&(r).bottom) |
||
28 | #endif |
||
29 | #define WIDTHOF(r) ((r).right - (r).left) |
||
30 | #define HEIGHTOF(r) ((r).bottom - (r).top) |
||
31 | |||
32 | #define ENTER_GW(g) { CGrafPtr _port; GDHandle _gdh; PixMapHandle _pm;\ |
||
33 | if(LockPixels(_pm = GetGWorldPixMap(g))){\ |
||
34 | GetGWorld(&_port,&_gdh);\ |
||
35 | SetGWorld(g,0); |
||
36 | #define LEAVE_GW() \ |
||
37 | SetGWorld(_port,_gdh);\ |
||
38 | UnlockPixels(_pm);\ |
||
39 | } } |
||
40 | |||
41 | #if TARGET_CPU_68K |
||
42 | char *QDG() = 0x2015; // move.l GrafGlobals(a5),d0 ; assumes a valid A5 |
||
43 | #define QD(x) (((QDGlobals*)(QDG()-offsetof(QDGlobals,thePort)))->x) |
||
44 | #else |
||
45 | // extern QDGlobals qd; |
||
46 | #define QD(x) qd.x |
||
47 | #endif |
||
48 | |||
49 | #define SAFE_QD(x) \ |
||
50 | (((QDGlobals*)(*(char**)SetCurrentA5()-offsetof(QDGlobals,thePort)))->x) |
||
51 | |||
52 | void decompose_region(RgnHandle rgn,void (*func)(Rect*)); |
||
53 | Fixed fractional_width(unsigned char *s); |
||
54 | void rect2g(Rect *r); |
||
55 | void rgn2g(RgnHandle rgn); |
||
56 | void dashed_lineto(short h,short v); |
||
57 | Boolean only_greys(CTabHandle ct); |
||
58 | Boolean has_colour_QD(void); |