appletquickdraw.c File Reference

#include <GestaltEqu.h>
#include <Palettes.h>
#include <QDOffscreen.h>
#include "appletdefs.h"
#include "appletfont.h"
#include "appletmemory.h"
#include "appletquickdraw.h"

Include dependency graph for appletquickdraw.c:

Go to the source code of this file.

Data Structures

struct  tyoffscreen

Defines

#define useoffscreenworlds
#define ctpens   5
#define ctports   25
#define ctclip   5
#define ctstyle   5
#define ctforecolors   5
#define ctbackcolors   5
#define gestalttrap   0xA1AD
#define unimplementedtrap   0xA09F

Typedefs

typedef char smalliconbits [32]
typedef smalliconbitsptrsmalliconbits
typedef smalliconbits ** hdlsmalliconbits

Functions

boolean pushpen ()
boolean poppen ()
boolean pushmacport (GrafPtr p)
boolean popmacport ()
boolean pushclip (Rect r)
boolean popclip ()
boolean pushstyle (short fnum, short fsize, short fstyle)
boolean popstyle (void)
short getmenubarheight (void)
void setrect (Rect *rset, short top, short left, short bottom, short right)
void localtoglobalrect (Rect *rchanged)
void eraserect (Rect r)
void movepento (short h, short v)
void pendrawline (short h, short v)
void invalrect (Rect r)
void smashrect (Rect r)
void insetrect (Rect *r, short dh, short dv)
boolean equalpoints (Point p1, Point p2)
boolean emptyrect (Rect r)
boolean rectlessthan (Rect r1, Rect r2)
static short absint (short x)
short pointdist (Point pt1, Point pt2)
void centerrect (Rect *rcentered, Rect rcontains)
void dropshadowrect (Rect rorig, short width, boolean flerase)
void invaldropshadow (Rect r, short width)
static boolean gestaltavailable (void)
static boolean getgestaltattr (OSType selector, long *response)
boolean systemhascolor (void)
static short maxdepth (void)
boolean colorenabled (void)
static short iscolorport (GrafPtr pport)
static boolean getclut (short resid, CTabHandle *hdlctab)
boolean oldclutconverter (short index, RGBColor *rgb)
boolean pushforecolor (RGBColor *rgb)
boolean popforecolor (void)
boolean pushbackcolor (RGBColor *rgb)
boolean popbackcolor (void)
boolean pushcolors (RGBColor *forecolor, RGBColor *backcolor)
boolean popcolors (void)
boolean equalcolors (RGBColor *rgb1, RGBColor *rgb2)
boolean pushgridcolor (RGBColor *rgbbase)
boolean pushhighlightcolor (RGBColor *rgbbase)
boolean getcolorpalette (WindowPtr w)
static boolean openworld (Rect r, WindowPtr w)
static void closeworld (WindowPtr w)
static boolean openmono (Rect r, WindowPtr w)
static void closemono (WindowPtr w)
static boolean systemhas32bitqd (void)
boolean openbitmap (Rect r, WindowPtr w)
void closebitmap (WindowPtr w)
boolean plotsmallicon (Rect r, short iconlist, short iconnum, boolean flinvert)
void drawicon (Rect r, short bitdepth, Handle hbits)
static void constraintorect (Rect *rconstrained, Rect rcontains, boolean flcenter)
void constraintodesktop (Rect *rconstrained)
void ellipsize (Str255 bs, short width)
void centerstring (Rect r, bigstring bs)
void centerwindow (WindowPtr w, Rect rscreen)
void grayrect (Rect r)
boolean pointinrect (Point pt, Rect r)
void validrect (Rect r)
void zerorect (Rect *rzero)
boolean pushemptyclip (void)
void globaltolocalpoint (WindowPtr w, Point *pt)
void localtoglobalpoint (WindowPtr w, Point *pt)
void scrollrect (Rect r, short dh, short dv)
boolean equalrects (Rect r1, Rect r2)

Variables

RGBColor whitecolor = {65535, 65535, 65535}
RGBColor blackcolor = {0, 0, 0}
RGBColor lightbluecolor = {52428, 52428, 65535}
RGBColor darkbluecolor = {0, 0, 32767}
RGBColor darkgraycolor = {10922, 10922, 10922}
RGBColor graycolor = {32767, 32767, 32767}
RGBColor mediumgraycolor = {52428, 52428, 52428}
RGBColor lightgraycolor = {61166, 61166, 61166}
RGBColor lightyellowcolor = {65535, 65535, 52428}
RGBColor lightgreencolor = {52428, 65535, 52428}
RGBColor lightpurplecolor = {65535, 52428, 65535}
RGBColor darkpurplecolor = {16384, 0, 16384}
RGBColor lightredcolor = {65535, 52428, 52428}
RGBColor darkredcolor = {32767, 0, 0}
RGBColor darkgreencolor = {0, 32767, 0}
static boolean flhas32bitqd = false
static tyoffscreen bitoffscreen = {false, nil, nil, nil, {0, 0, 0, 0}, nil}
short toppens = 0
PenState penstack [ctpens]
short topport = 0
GrafPtr portstack [ctports]
short topclip = 0
Rect clipstack [ctclip]
short topstyle = 0
struct {
   short   errornumber
   hdltreenode   htree
   hdlhashnode   hnode
   hdltreenode   hcode
   long   offset
   hdlheadrecord   hnode
   FSSpec *   fsfile
   FSSpec   fsalias
   boolean   fl
   boolean   launched
   OSType   apptype
   bigstring   errormessage
   short   fnum
   short   fsize
   short   fstyle
stylestack [ctstyle]
short topforecolor = 0
RGBColor forecolorstack [ctforecolors]
short topbackcolor = 0
RGBColor backcolorstack [ctbackcolors]


Define Documentation

#define ctbackcolors   5
 

Definition at line 135 of file appletquickdraw.c.

#define ctclip   5
 

Definition at line 114 of file appletquickdraw.c.

#define ctforecolors   5
 

Definition at line 128 of file appletquickdraw.c.

#define ctpens   5
 

Definition at line 100 of file appletquickdraw.c.

#define ctports   25
 

Definition at line 107 of file appletquickdraw.c.

#define ctstyle   5
 

Definition at line 121 of file appletquickdraw.c.

#define gestalttrap   0xA1AD
 

Definition at line 491 of file appletquickdraw.c.

#define unimplementedtrap   0xA09F
 

Definition at line 492 of file appletquickdraw.c.

#define useoffscreenworlds
 

Definition at line 54 of file appletquickdraw.c.


Typedef Documentation

typedef smalliconbits ** hdlsmalliconbits
 

Definition at line 51 of file appletquickdraw.c.

typedef smalliconbits* ptrsmalliconbits
 

Definition at line 51 of file appletquickdraw.c.

typedef char smalliconbits[32]
 

Definition at line 49 of file appletquickdraw.c.


Function Documentation

static short absint short  x  )  [static]
 

Definition at line 393 of file appletquickdraw.c.

void centerrect Rect rcentered,
Rect  rcontains
 

Definition at line 408 of file appletquickdraw.c.

References r.

void centerstring Rect  r,
bigstring  bs
 

Definition at line 1387 of file appletquickdraw.c.

References tyFontInfo::ascent, tyFontInfo::descent, ellipsize(), globalfontinfo, h, popclip(), pushclip(), and v.

Here is the call graph for this function:

void centerwindow WindowPtr  w,
Rect  rscreen
 

Definition at line 1415 of file appletquickdraw.c.

References doctitlebarheight, getmenubarheight(), h, r, and v.

Here is the call graph for this function:

void closebitmap WindowPtr  w  ) 
 

Definition at line 981 of file appletquickdraw.c.

References bitoffscreen, closemono(), closeworld(), flbitmapopen, tyoffscreen::flbitmapopen, flbitmapsenabled, and flhas32bitqd.

Here is the call graph for this function:

static void closemono WindowPtr  w  )  [static]
 

Definition at line 935 of file appletquickdraw.c.

References tyoffscreen::bitmapbasehandle, bitoffscreen, DisposeHandle, HUnlock, nil, tyoffscreen::offscreenbitmap, and tyoffscreen::savedbitmap.

static void closeworld WindowPtr  w  )  [static]
 

Definition at line 862 of file appletquickdraw.c.

References bitoffscreen, blackcolor, tyoffscreen::hsavedgd, nil, tyoffscreen::offscreenrect, tyoffscreen::poffscreenworld, popbackcolor(), popforecolor(), tyoffscreen::psavedport, pushbackcolor(), pushforecolor(), and whitecolor.

Here is the call graph for this function:

boolean colorenabled void   ) 
 

Definition at line 558 of file appletquickdraw.c.

References bounds, maxdepth, NULL, quickdrawglobal, and systemhascolor().

Here is the call graph for this function:

void constraintodesktop Rect rconstrained  ) 
 

Definition at line 1340 of file appletquickdraw.c.

References constraintorect(), and doctitlebarheight.

Here is the call graph for this function:

static void constraintorect Rect rconstrained,
Rect  rcontains,
boolean  flcenter
[static]
 

Definition at line 1283 of file appletquickdraw.c.

References centerrect(), min, and r.

Here is the call graph for this function:

void drawicon Rect  r,
short  bitdepth,
Handle  hbits
 

Definition at line 1272 of file appletquickdraw.c.

void dropshadowrect Rect  rorig,
short  width,
boolean  flerase
 

Definition at line 435 of file appletquickdraw.c.

References fillrect(), h, i, pushpen(), r, and v.

Here is the call graph for this function:

void ellipsize Str255  bs,
short  width
 

Definition at line 1352 of file appletquickdraw.c.

boolean emptyrect Rect  r  ) 
 

Definition at line 359 of file appletquickdraw.c.

boolean equalcolors RGBColor rgb1,
RGBColor rgb2
 

Definition at line 710 of file appletquickdraw.c.

Referenced by pushgridcolor(), and setcardtextcolor().

boolean equalpoints Point  p1,
Point  p2
 

Definition at line 353 of file appletquickdraw.c.

References tyPoint::h, and tyPoint::v.

boolean equalrects Rect  r1,
Rect  r2
 

Definition at line 1527 of file appletquickdraw.c.

void eraserect Rect  r  ) 
 

Definition at line 309 of file appletquickdraw.c.

References isemptyrect, recttowinrect(), and topbackcolor.

Here is the call graph for this function:

static boolean gestaltavailable void   )  [static]
 

Definition at line 495 of file appletquickdraw.c.

References gestalttrap, and unimplementedtrap.

static boolean getclut short  resid,
CTabHandle *  hdlctab
[static]
 

Definition at line 573 of file appletquickdraw.c.

References nil, and noErr.

boolean getcolorpalette WindowPtr  w  ) 
 

Definition at line 783 of file appletquickdraw.c.

References getclut(), and nil.

Referenced by newappwindow().

Here is the call graph for this function:

static boolean getgestaltattr OSType  selector,
long response
[static]
 

Definition at line 508 of file appletquickdraw.c.

References gestaltavailable(), and noErr.

Here is the call graph for this function:

short getmenubarheight void   ) 
 

Definition at line 264 of file appletquickdraw.c.

void globaltolocalpoint WindowPtr  w,
Point pt
 

Definition at line 1484 of file appletquickdraw.c.

References popmacport(), popport(), pt, pushmacport(), pushport(), and short.

Here is the call graph for this function:

void grayrect Rect  r  ) 
 

Definition at line 1436 of file appletquickdraw.c.

References poppen(), pushpen(), and quickdrawglobal.

Here is the call graph for this function:

void insetrect Rect r,
short  dh,
short  dv
 

Definition at line 347 of file appletquickdraw.c.

References recttowinrect(), and winrecttorect().

Here is the call graph for this function:

void invaldropshadow Rect  r,
short  width
 

Definition at line 473 of file appletquickdraw.c.

void invalrect Rect  r  ) 
 

Definition at line 327 of file appletquickdraw.c.

References getcurrentwindow(), and recttowinrect().

Here is the call graph for this function:

static short iscolorport GrafPtr  pport  )  [static]
 

Definition at line 567 of file appletquickdraw.c.

void localtoglobalpoint WindowPtr  w,
Point pt
 

Definition at line 1494 of file appletquickdraw.c.

References nil, popmacport(), popport(), pt, pushmacport(), pushport(), quickdrawglobal, and short.

Here is the call graph for this function:

void localtoglobalrect Rect rchanged  ) 
 

Definition at line 284 of file appletquickdraw.c.

References tyPoint::h, r, and tyPoint::v.

static short maxdepth void   )  [static]
 

Definition at line 542 of file appletquickdraw.c.

References bounds, nil, quickdrawglobal, and systemhascolor().

Here is the call graph for this function:

void movepento short  h,
short  v
 

Definition at line 315 of file appletquickdraw.c.

References NULL.

boolean oldclutconverter short  index,
RGBColor rgb
 

Definition at line 590 of file appletquickdraw.c.

References getclut().

Here is the call graph for this function:

boolean openbitmap Rect  r,
WindowPtr  w
 

Definition at line 963 of file appletquickdraw.c.

References bitoffscreen, fl, flbitmapopen, tyoffscreen::flbitmapopen, flbitmapsenabled, flhas32bitqd, openmono(), openworld(), and systemhas32bitqd().

Here is the call graph for this function:

static boolean openmono Rect  r,
WindowPtr  w
[static]
 

Definition at line 902 of file appletquickdraw.c.

References appnewhandle(), tyoffscreen::bitmapbasehandle, bitoffscreen, HLock, nil, odd, tyoffscreen::offscreenbitmap, and tyoffscreen::savedbitmap.

Here is the call graph for this function:

static boolean openworld Rect  r,
WindowPtr  w
[static]
 

Definition at line 807 of file appletquickdraw.c.

References bitoffscreen, getfontsizestyle(), tyoffscreen::hsavedgd, localtoglobalrect(), nil, noErr, tyoffscreen::offscreenrect, tyoffscreen::poffscreenworld, tyoffscreen::psavedport, and setfontsizestyle().

Here is the call graph for this function:

void pendrawline short  h,
short  v
 

Definition at line 321 of file appletquickdraw.c.

boolean plotsmallicon Rect  r,
short  iconlist,
short  iconnum,
boolean  flinvert
 

Definition at line 1233 of file appletquickdraw.c.

References heightsmallicon, nil, and widthsmallicon.

short pointdist Point  pt1,
Point  pt2
 

Definition at line 402 of file appletquickdraw.c.

References absint(), tyPoint::h, and tyPoint::v.

Here is the call graph for this function:

boolean pointinrect Point  pt,
Rect  r
 

Definition at line 1450 of file appletquickdraw.c.

References pt, and recttowinrect().

Here is the call graph for this function:

boolean popbackcolor void   ) 
 

Definition at line 676 of file appletquickdraw.c.

References backcolorstack, BIGSTRING, colorenabled(), DebugStr(), and topbackcolor.

Here is the call graph for this function:

boolean popclip void   ) 
 

Definition at line 215 of file appletquickdraw.c.

References BIGSTRING, clipstack, idclipstackempty, NULL, shellinternalerror, and topclip.

boolean popcolors void   ) 
 

Definition at line 702 of file appletquickdraw.c.

References popbackcolor(), and popforecolor().

Here is the call graph for this function:

boolean popforecolor void   ) 
 

Definition at line 630 of file appletquickdraw.c.

References BIGSTRING, colorenabled(), DebugStr(), forecolorstack, poppen(), and topforecolor.

Here is the call graph for this function:

boolean popmacport void   ) 
 

Definition at line 185 of file appletquickdraw.c.

References portstack, and topport.

boolean poppen void   ) 
 

Definition at line 156 of file appletquickdraw.c.

References BIGSTRING, idpenstackempty, penstack, shellinternalerror, toppen, and toppens.

boolean popstyle void   ) 
 

Definition at line 246 of file appletquickdraw.c.

References BIGSTRING, fnum, fsize, fstyle, getfontsizestyle(), idstylestackempty, setfontsizestyle(), setglobalfontsizestyle(), shellinternalerror, stylestack, and topstyle.

Here is the call graph for this function:

boolean pushbackcolor RGBColor rgb  ) 
 

Definition at line 648 of file appletquickdraw.c.

References backcolorstack, colorenabled(), ctbackcolors, DebugStr(), and topbackcolor.

Here is the call graph for this function:

boolean pushclip Rect  r  ) 
 

Definition at line 196 of file appletquickdraw.c.

References clipstack, ctclip, DisposeRgn, NewRgn, pushcliprgn(), rgn, and topclip.

Here is the call graph for this function:

boolean pushcolors RGBColor forecolor,
RGBColor backcolor
 

Definition at line 694 of file appletquickdraw.c.

References pushbackcolor(), and pushforecolor().

Here is the call graph for this function:

boolean pushemptyclip void   ) 
 

Definition at line 1470 of file appletquickdraw.c.

References pushclip(), pushcliprgn(), r, rgn, and zerorect().

Here is the call graph for this function:

boolean pushforecolor RGBColor rgb  ) 
 

Definition at line 602 of file appletquickdraw.c.

References colorenabled(), ctforecolors, DebugStr(), forecolorstack, and topforecolor.

Here is the call graph for this function:

boolean pushgridcolor RGBColor rgbbase  ) 
 

Definition at line 721 of file appletquickdraw.c.

References equalcolors(), lightbluecolor, pushforecolor(), tyRGBColor::red, and whitecolor.

Referenced by drawgrid().

Here is the call graph for this function:

boolean pushhighlightcolor RGBColor rgbbase  ) 
 

Definition at line 756 of file appletquickdraw.c.

References blackcolor, tyRGBColor::blue, tyRGBColor::green, pushforecolor(), tyRGBColor::red, and whitecolor.

Here is the call graph for this function:

boolean pushmacport GrafPtr  p  ) 
 

Definition at line 167 of file appletquickdraw.c.

References ctports, DebugStr(), nil, portstack, quickdrawglobal, and topport.

Here is the call graph for this function:

boolean pushpen void   ) 
 

Definition at line 145 of file appletquickdraw.c.

References checkdepth, ctpens, penstack, toppen, and toppens.

boolean pushstyle short  fnum,
short  fsize,
short  fstyle
 

Definition at line 226 of file appletquickdraw.c.

References BIGSTRING, checkdepth, ctstyle, getfontsizestyle(), idstylestackfull, setglobalfontsizestyle(), shellinternalerror, stylestack, and topstyle.

Here is the call graph for this function:

boolean rectlessthan Rect  r1,
Rect  r2
 

Definition at line 369 of file appletquickdraw.c.

void scrollrect Rect  r,
short  dh,
short  dv
 

Definition at line 1507 of file appletquickdraw.c.

References DisposeRgn, NewRgn, noErr, recttowinrect(), and rgn.

Here is the call graph for this function:

void setrect Rect rset,
short  top,
short  left,
short  bottom,
short  right
 

Definition at line 270 of file appletquickdraw.c.

References r.

void smashrect Rect  r  ) 
 

Definition at line 339 of file appletquickdraw.c.

References eraserect(), getcurrentwindow(), invalrect(), and recttowinrect().

Here is the call graph for this function:

static boolean systemhas32bitqd void   )  [static]
 

Definition at line 950 of file appletquickdraw.c.

References flhas32bitqd, and noErr.

Referenced by openbitmap().

boolean systemhascolor void   ) 
 

Definition at line 521 of file appletquickdraw.c.

References gestalt(), and getgestaltattr().

Here is the call graph for this function:

void validrect Rect  r  ) 
 

Definition at line 1456 of file appletquickdraw.c.

References getcurrentwindow(), recttowinrect(), and shellwindow.

Here is the call graph for this function:

void zerorect Rect rzero  ) 
 

Definition at line 1462 of file appletquickdraw.c.

References r.


Variable Documentation

RGBColor backcolorstack[ctbackcolors]
 

Definition at line 139 of file appletquickdraw.c.

Referenced by popbackcolor(), and pushbackcolor().

tyoffscreen bitoffscreen = {false, nil, nil, nil, {0, 0, 0, 0}, nil} [static]
 

Definition at line 78 of file appletquickdraw.c.

Referenced by closebitmap(), closemono(), closeworld(), openbitmap(), openmono(), and openworld().

RGBColor blackcolor = {0, 0, 0}
 

Definition at line 21 of file appletquickdraw.c.

Rect clipstack[ctclip]
 

Definition at line 118 of file appletquickdraw.c.

RGBColor darkbluecolor = {0, 0, 32767}
 

Definition at line 25 of file appletquickdraw.c.

RGBColor darkgraycolor = {10922, 10922, 10922}
 

Definition at line 27 of file appletquickdraw.c.

RGBColor darkgreencolor = {0, 32767, 0}
 

Definition at line 47 of file appletquickdraw.c.

RGBColor darkpurplecolor = {16384, 0, 16384}
 

Definition at line 41 of file appletquickdraw.c.

RGBColor darkredcolor = {32767, 0, 0}
 

Definition at line 45 of file appletquickdraw.c.

boolean flhas32bitqd = false [static]
 

Definition at line 59 of file appletquickdraw.c.

short fnum
 

Definition at line 125 of file appletquickdraw.c.

Referenced by ccnewrecord(), ccstart(), fwstransmitfile(), getgifheightwidthverb(), getjpegheightwidthverb(), openappwindow(), openfilespec(), popstyle(), saveappwindow(), shelldatabasesaveas(), shellnewfile(), shellnormalsaveas(), and shellopenfile().

RGBColor forecolorstack[ctforecolors]
 

Definition at line 132 of file appletquickdraw.c.

Referenced by popforecolor(), and pushforecolor().

short fsize
 

Definition at line 125 of file appletquickdraw.c.

Referenced by popstyle(), and webservercallresponder().

short fstyle
 

Definition at line 125 of file appletquickdraw.c.

Referenced by popstyle().

RGBColor graycolor = {32767, 32767, 32767}
 

Definition at line 29 of file appletquickdraw.c.

RGBColor lightbluecolor = {52428, 52428, 65535}
 

Definition at line 23 of file appletquickdraw.c.

RGBColor lightgraycolor = {61166, 61166, 61166}
 

Definition at line 33 of file appletquickdraw.c.

RGBColor lightgreencolor = {52428, 65535, 52428}
 

Definition at line 37 of file appletquickdraw.c.

RGBColor lightpurplecolor = {65535, 52428, 65535}
 

Definition at line 39 of file appletquickdraw.c.

RGBColor lightredcolor = {65535, 52428, 52428}
 

Definition at line 43 of file appletquickdraw.c.

RGBColor lightyellowcolor = {65535, 65535, 52428}
 

Definition at line 35 of file appletquickdraw.c.

RGBColor mediumgraycolor = {52428, 52428, 52428}
 

Definition at line 31 of file appletquickdraw.c.

PenState penstack[ctpens]
 

Definition at line 104 of file appletquickdraw.c.

Referenced by poppen(), pushforecolor(), and pushpen().

GrafPtr portstack[ctports]
 

Definition at line 111 of file appletquickdraw.c.

struct { ... } stylestack[ctstyle]
 

short topbackcolor = 0
 

Definition at line 137 of file appletquickdraw.c.

short topclip = 0
 

Definition at line 116 of file appletquickdraw.c.

short topforecolor = 0
 

Definition at line 130 of file appletquickdraw.c.

short toppens = 0
 

Definition at line 102 of file appletquickdraw.c.

Referenced by poppen(), and pushpen().

short topport = 0
 

Definition at line 109 of file appletquickdraw.c.

short topstyle = 0
 

Definition at line 123 of file appletquickdraw.c.

RGBColor whitecolor = {65535, 65535, 65535}
 

Definition at line 19 of file appletquickdraw.c.


Generated on Wed May 31 21:43:22 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6