| Index: > A B C D E F G H I J K L M N O P Q R S T U V W X Y Z |
|
|||||
| First Prev [ 1 2 3 ] Next Last |
Quickdraw, being grounded in the LisaGraf development work of the early 1980s, uses a data structures + algorithms programming paradigm (as opposed to the now more common object oriented paradigm). This fitted well with the Pascal programming language based interfaces and development environments of the early Apple systems.
Quickdraw defines a key data structure, the graphics port, or GrafPort. This is a logical drawing area where graphics can be drawn. The most obvious on-screen "object" corresponding to a grafport is a window, though so is the entire desktop view and off-screen ports can also exist.
The Grafport defines a coordinate system. In Quickdraw, this has a resolution of 16 bits, giving 65,535 unique vertical and horizontal locations. These are numbered from -32,767 on the extreme left (or top), to +32,768 on the extreme right (or bottom). A window is usually set up so that its top, left corner is located at 0,0 in the associated grafport.
Quickdraw coordinates refer to the infinitely thin lines between pixelA pixel (a contraction of picture element is one of the many tiny dots that make up the representation of a picture in a computer's memory. Usually the dots are so small and so numerous that, when printed on paper or displayed on a computer monitor, they locations. An actual pixel is drawn in the space to the immediate right and below the coordinate. This eliminates the so-called "end-point paranoia" and associated off-by-one errors.
On the Macintosh, pixels are square and a grafport has a default resolution of 72 pixels to the inch, chosen to match conventions established by the printing industry of having 72 points to the inch.
Quickdraw also contains a number of scaling and mapping functions.
Quickdraw maintains a number of global variableIn computer programming, a global variable is a variable that does not belong to any subroutine in particular and can therefore can be accessed from any context in a program. They are contrasted with local variables. See also, scope. They are considered bs per process, chief among these being the current port. This simplifies the API, since all operations pertain to "the current port", but as the OS has developed, this has made Quickdraw much harder to integrate with modern design approaches such as multi-threading, pre-emptive multitasking and so on.
Everything you see on a classic Mac OS screen is drawn by Quickdraw, but the library itself is quite low level. The primitive objects it can draw are:
Each of these objects (except text) may be drawn using a "pen", which can have any rectangular dimensions, pattern or colour. Note that, because the pen is rectangular and axis-aligned, diagonal lines will end up thicker than horizontal or vertical ones. Shapes may be drawn filled or framed, using any pattern or colour. A filled Arc forms a wedge. Text may be drawn in any installed font, in a variety of stylistic variations, and at any size and colour. Text is scaled in a variety of ways depending on how it is stored - TrueTypeTrueType is an outline font standard developed by Apple Computer in the late 1980s as a competitor to Adobe's Type 1 fonts used in PostScript. The primary strength of TrueType is that it offers font developers a high degree of control over precisely how t fonts will scale smoothly to any size, whereas bitmapped font s do not usually scale well.
An important feature of QuickDraw was support for transfer modes, which governed how a destination pixel value was related to its previous value and the colour of the object being drawn.
The set of attributes of the pen and text drawing are associated with the GrafPort.
Regions are a key data structure in Quickdraw. They define an arbitrary set of pixels, rather like a bitmap, but in a compressed form which can be very rapidly manipulated in complex ways. Regions can be combined (union), subtracted (difference), and XORed to form other Regions. They can be used within a GrafPort for clippingClipping has several meanings: Telecommunications In telecommunication, the term clipping has the following meanings: #In telephony, the loss of the initial or final parts of a word, words, or syllable, usually caused by the nonideal operation of voice-ac, or drawn filled or framed like any other shape. A series of framed shapes and connected lines may be combined into a Region. A Region need not consist of a contiguous set of pixels - disconnected regions are possible and common. Regions underpin the rest of Quickdraw, permitting clipping to arbitrary shapes, essential for the implementation of multiple overlapping windows. Invented by Bill Atkinson, Regions were patented as a separate invention by Apple.