quickdraw.h

Go to the documentation of this file.
00001 
00002 /*  $Id: quickdraw.h 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 #ifndef quickdrawinclude
00029 #define quickdrawinclude /*so other includes can tell if we've been loaded*/
00030 
00031 #ifdef HEADERTRACE
00032 #pragma message( "**Compiling " __FILE__ )
00033 #endif
00034 
00035 #ifndef shelltypesinclude
00036     
00037     #include "shelltypes.h"
00038 
00039 #endif
00040 
00041 #define blackindex 0
00042 #define whiteindex 1
00043 #define lighterblueindex 2 /*a very common color in System 7 culture*/
00044 #define lightblueindex 2 /*another very common color*/
00045 
00046 
00047 #ifdef MACVERSION
00048     #define blackpattern qd.black
00049     #define whitepattern qd.white
00050     #define graypattern qd.gray
00051 #endif
00052 
00053 #ifdef WIN95VERSION
00054     #define blackpattern GetStockObject (BLACK_BRUSH)
00055     #define whitebackground GetStockObject (WHITE_BRUSH)
00056     #define buttonbackground GetStockObject (GRAY_BRUSH)
00057 #endif
00058 
00059 #if TARGET_API_MAC_CARBON == 1 /*7.0b53 PBS: common code -- QDFlushPortBuffer on OS X*/
00060 
00061     #define flushwindowbuffer(w) QDFlushPortBuffer (GetWindowPort (w), nil)
00062 
00063 #else
00064 
00065     #define flushwindowbuffer(w) /*nothing*/
00066 #endif
00067 
00068 extern RGBColor blackcolor, whitecolor, lightbluecolor, lightgraycolor, graycolor, darkgraycolor;
00069 
00070 extern RGBColor lightyellowcolor, lightgreencolor, lightpurplecolor, lightredcolor;
00071 
00072 extern RGBColor darkredcolor, darkbluecolor, darkgreencolor, mediumgraycolor, darkpurplecolor;
00073 
00074 
00075 extern short getmenubarheight (void);
00076 
00077 extern boolean pushpen (void);
00078 
00079 extern boolean poppen (void);
00080 
00081 extern void getpenpoint (Point *);
00082 
00083 extern boolean equalpoints (Point, Point);
00084 
00085 extern short pointdist (Point, Point);
00086 
00087 extern void movepento (short, short);
00088 
00089 extern void pendrawline (short, short);
00090 
00091 extern void pendrawstring (bigstring);
00092 
00093 extern void graydrawstring (bigstring);
00094 
00095 extern short stringpixels (bigstring);
00096 
00097 extern void setport (GrafPtr);
00098 
00099 extern GrafPtr getport (void);
00100 
00101 #ifdef WIN95VERSION
00102     extern boolean winpushport (WindowPtr, HDC);
00103 
00104     extern boolean winpopport (void);
00105 
00106     extern HDC getcurrentDC (void);
00107 #endif
00108 
00109 extern boolean pushport (CGrafPtr);
00110 
00111 extern boolean popport (void);
00112 
00113 extern boolean pushscratchport (void);
00114 
00115 extern boolean pushcliprgn (hdlregion, boolean);
00116 
00117 extern boolean pushclip (Rect);
00118 
00119 extern boolean superpushclip (Rect);
00120 
00121 extern boolean pushvalidrgnclip (void);
00122 
00123 extern boolean pushemptyclip (void);
00124 
00125 extern boolean popclip (void);
00126 
00127 extern boolean pushstyle (short, short, short);
00128 
00129 extern boolean popstyle (void);
00130 
00131 extern boolean pushforecolor (const RGBColor *);
00132 
00133 extern boolean popforecolor (void);
00134 
00135 extern boolean pushbackcolor (const RGBColor *);
00136 
00137 extern boolean popbackcolor (void);
00138 
00139 extern boolean pushcolors (const RGBColor *, const RGBColor *);
00140 
00141 extern boolean popcolors (void);
00142 
00143 extern void centerrect (Rect *, Rect);
00144 
00145 extern void centerrectondesktop (Rect *);
00146 
00147 extern void centerbuttonstring (const Rect *, bigstring, boolean);
00148 
00149 #define centerstring(r, bs) centerbuttonstring (&r, bs, false)
00150 
00151 extern void grayrect (Rect);
00152 
00153 extern void evenrectangle (Rect *);
00154 
00155 extern void oddrectangle (Rect *);
00156 
00157 extern void zerorect (Rect *);
00158 
00159 extern boolean equalrects (Rect, Rect);
00160 
00161 extern boolean issubrect (Rect, Rect);
00162 
00163 extern void cyclecolor (long *);
00164 
00165 extern void globaltolocalrgn (hdlregion);
00166 
00167 extern void localtoglobalrect (WindowPtr, Rect *);
00168 
00169 extern void globaltolocalpoint (WindowPtr, Point *);
00170 
00171 extern void localtoglobalpoint (WindowPtr, Point *);
00172 
00173 extern void flashrect (Rect, short);
00174 
00175 extern void dropshadowrect (Rect, short, boolean);
00176 
00177 extern void smashrect (Rect);
00178 
00179 extern void invalrect (Rect);
00180 
00181 extern void invalwindowrect (WindowPtr, Rect);
00182 
00183 extern void validrect (Rect);
00184 
00185 extern void eraserect (Rect);
00186 
00187 extern void framerect (Rect);
00188 
00189 extern void setgraypen (void);
00190 
00191 extern void setthemepen (const short brush, Rect r, boolean flupdate); /*7.0b51 PBS*/
00192 
00193 extern void graydrawline (short, short);
00194 
00195 extern void grayframerrgn (hdlregion rgn);
00196 
00197 extern void grayframerect (Rect);
00198 
00199 extern void fillrect (Rect, xppattern);
00200 
00201 extern void paintrect (Rect);
00202 
00203 extern void frame3sides (Rect);
00204 
00205 extern void eraseandframerect (Rect);
00206 
00207 extern void invertrect (Rect);
00208 
00209 extern void setrect (Rect *, short, short, short, short);
00210 
00211 extern void insetrect (Rect *, short, short);
00212 
00213 extern void offsetrect (Rect *, short, short);
00214 
00215 extern boolean pointinrect (Point, Rect);
00216 
00217 extern boolean rectinregion (Rect, hdlregion);
00218 
00219 extern void scrollrect (Rect, short, short);
00220 
00221 extern void scrollrectvert (Rect, short);
00222 
00223 extern void scrollrecthoriz (Rect, short);
00224 
00225 extern void unionrect (Rect, Rect, Rect *);
00226 
00227 extern boolean intersectrect (Rect, Rect, Rect *);
00228 
00229 extern void getdesktopbounds (Rect *);
00230 
00231 extern void getwindowscreenbounds (const Rect *, Rect *);
00232 
00233 extern boolean constraintodesktop (WindowPtr, Rect *);
00234 
00235 extern boolean constraintoscreenbounds (WindowPtr, boolean, Rect *);
00236 
00237 extern boolean pushdesktopport (CGrafPtr);
00238 
00239 extern void popdesktopport (CGrafPtr);
00240 
00241 extern boolean havecolorquickdraw (void);
00242 
00243 extern void getmainscreenrect (Rect *);
00244 
00245 extern void getsystemoriginrect (Rect *);
00246 
00247 extern void getcurrentscreenbounds (Rect *);
00248 
00249 extern boolean systemhascolor (void);
00250 
00251 extern boolean colorenabled (void);
00252 
00253 extern short iscolorport (CGrafPtr);
00254 
00255 extern void fillcolorrect (Rect, short);
00256 
00257 /*
00258 extern boolean pushforecolor (short);
00259 
00260 extern boolean popforecolor (void);
00261 
00262 extern boolean pushbackcolor (short);
00263 
00264 extern boolean popbackcolor (void);
00265 */
00266 
00267 void diskrecttorect (diskrect *rdisk, Rect *r);
00268 
00269 void recttodiskrect (Rect *r, diskrect *rdisk);
00270 
00271 void diskrgbtorgb (diskrgb *rgbdisk, RGBColor *r);
00272 
00273 void rgbtodiskrgb (RGBColor *r, diskrgb *rgbdisk);
00274 
00275 extern void drawthemeborder (Rect r, Rect rcontent); /*7.0b52 PBS: scan-lines border on OS X*/
00276 
00277 extern void initquickdraw (void);
00278 
00279 #endif
00280 
00281 
00282 

Generated on Wed May 31 18:20:00 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6