home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / docs / pmv3base.inf (.txt) < prev    next >
Encoding:
OS/2 Help File  |  1994-03-07  |  1.1 MB  |  21,294 lines

Text Truncated. Only the first 1MB is shown below. Download the file for the complete contents.
  1.  
  2. ΓòÉΓòÉΓòÉ 1. Introduction to the Graphics Programming Interface ΓòÉΓòÉΓòÉ
  3.  
  4. The OS/2* 2.0 Presentation Manager* (PM) Graphics Programming Interface (GPI) 
  5. provides more than 200 functions.  These functions enable a user to create, 
  6. display, and print graphic images in a PC-based environment, using a variety of 
  7. techniques, media, and formats. 
  8.  
  9. The major advantage of the GPI is device-independence, which is achieved 
  10. through the linking of presentation spaces with device contexts, and the use of 
  11. a wide selection of graphics primitives. 
  12.  
  13. This chapter describes the parts of the operating system that enable you to 
  14. write PM applications, using presentation space-device context associations to 
  15. circumvent having to communicate directly with device drivers.  An overview of 
  16. the following topics is presented: 
  17.  
  18. o Presentation spaces and device contexts 
  19. o Graphics primitives 
  20.  
  21.    - Line and arc primitives 
  22.    - Area primitives and polygons 
  23.    - Character string primitives and fonts 
  24.    - Marker primitives 
  25.  
  26. o Color and mix attributes 
  27. o Bit maps and metafiles 
  28. o Paths and regions 
  29. o Retained and nonretained graphics 
  30. o Correlation 
  31. o Clipping and boundary determination 
  32. o Coordinate spaces and transformation operations and functions 
  33. o Print job submission and manipulation. 
  34.  
  35. Subsequent chapters offer in-depth descriptions of the GPI-its components, 
  36. capabilities, and advantages-to provide the information you need to write 
  37. applications that can prepare graphical output for display and printing. 
  38.  
  39.  
  40. ΓòÉΓòÉΓòÉ 1.1. About the GPI ΓòÉΓòÉΓòÉ
  41.  
  42. In a PM application, you use the graphics functions (most of which are prefixed 
  43. Gpi) to program the desired graphics output.  Many of the GPI functions are 
  44. described in this book.  For a complete alphabetic listing of the GPI 
  45. functions, along with their syntax and parameters, refer to the Presentation 
  46. Manager Programming Reference. Virtually all of the GPI calls conform to the 
  47. IBM Systems Application Architecture* (SAA*). 
  48.  
  49. The applications you write probably will receive window messages about the 
  50. images to be created; your task, then, is to write how to process this input 
  51. into output.  Refer to the OS/2 Programming Guide, Volume II, for details about 
  52. the window messages, the visual parts of the PM user interface, and the 
  53. programming functions for creating and using windows, so that you can produce 
  54. window-based graphics applications. 
  55.  
  56.  
  57. ΓòÉΓòÉΓòÉ 1.1.1. Presentation Spaces and Device Contexts ΓòÉΓòÉΓòÉ
  58.  
  59. A presentation space is a data structure-the programming equivalent of a blank 
  60. piece of paper on which graphic images are created before being sent to an 
  61. output device.  An output device can be, for example, a printer or plotter, 
  62. memory bit map, display screen, or even a facsimile card.  A PM application 
  63. must direct all drawing to a presentation space. 
  64.  
  65. The graphics engine and device drivers are responsible for getting output from 
  66. a presentation space to an output or hardcopy device.  The mapping from the 
  67. presentation space to the hardcopy device is handled by a device context that 
  68. is associated (linked) with the presentation space. 
  69.  
  70. A device context also is a data structure-its purpose is to translate graphics 
  71. commands made to its associated presentation space into commands that the 
  72. physical device can convert to displayed information. The following figure 
  73. illustrates how an application's graphics commands flow through a presentation 
  74. space, to a device context, and on to the physical device. 
  75.  
  76. The Flow of an Application's Graphics Commands 
  77.  
  78.  
  79. ΓòÉΓòÉΓòÉ 1.1.2. Graphics Primitives ΓòÉΓòÉΓòÉ
  80.  
  81. Graphics primitives are building blocks provided by the PM programming 
  82. interface from which to construct pictures.  There are several types of 
  83. primitives: 
  84.  
  85. o Line and arc 
  86. o Area and polygon 
  87. o Character string 
  88. o Marker. 
  89.  
  90.  
  91. ΓòÉΓòÉΓòÉ 1.1.2.1. Primitive Attributes ΓòÉΓòÉΓòÉ
  92.  
  93.  
  94. Each graphic primitive has a set of properties that further defines its 
  95. appearance.  A line, for example, can be drawn in different colors and 
  96. different widths; it can be dotted, solid, or even invisible.  Such properties 
  97. are called primitive attributes. 
  98.  
  99. In general, primitive attributes are set for the type of primitive rather than 
  100. for a single instance of the primitive.  If you set the line-type attribute to 
  101. LINETYPE_DOT, for example, all lines subsequently drawn appear as dotted lines. 
  102.  
  103. All primitive attributes have default settings that apply when a presentation 
  104. space is first created and continue to apply until you change them.  When an 
  105. attribute value is set, it is called the current attribute value, and remains 
  106. in effect until changed. 
  107.  
  108.  
  109. ΓòÉΓòÉΓòÉ 1.1.2.2. Line and Arc Primitives ΓòÉΓòÉΓòÉ
  110.  
  111.  
  112. Simple drawing applications, such as pie and bar charts and graphs, use line 
  113. and arc primitives as their drawing tools.  Computer-aided design (CAD) 
  114. applications combine the numerous styles and forms of straight and curved lines 
  115. that compose line and arc primitives to draw more complex pictures. 
  116.  
  117. Line and arc primitive attributes are stored in the LINEBUNDLE data structure. 
  118. Their relative attributes include width, type, color, and mix. 
  119.  
  120. See Line and Arc Primitives for detailed information about line and arc 
  121. primitives and their use in PM applications. 
  122.  
  123.  
  124. ΓòÉΓòÉΓòÉ 1.1.2.3. Area Primitives ΓòÉΓòÉΓòÉ
  125.  
  126.  
  127. An area is a closed shape that can be defined with line and arc primitives; 
  128. area primitives are produced by functions that can define and draw an area. 
  129.  
  130. Area primitives are contained in the AREABUNDLE data structure.  Area primitive 
  131. attributes include pattern symbol and reference point, pattern set, foreground 
  132. and background colors, and foreground and background mix modes. 
  133.  
  134. Areas are also referred to as area brackets because the functions that create 
  135. and define an area always are bracketed by the functions GpiBeginArea and 
  136. GpiEndArea.  The power of area brackets is their complete flexibility to draw 
  137. any combination of curved or straight lines and combine the results into a 
  138. closed figure. 
  139.  
  140.  
  141. ΓòÉΓòÉΓòÉ 1.1.2.4. Polygon Primitives ΓòÉΓòÉΓòÉ
  142.  
  143.  
  144. A polygon is a closed plane figure bounded by straight lines.  A polygon 
  145. primitive is any set of polygons with specified vertices that can be filled or 
  146. filled and outlined. 
  147.  
  148. The GPI has a function (GpiPolygons) that allows you to draw multiple 
  149. straight-lined closed areas outside of an area bracket; but like areas, they 
  150. can be adjacent, intersecting, or completely separate. 
  151.  
  152. See Area and Polygon Primitives for guidance on how and when to use area 
  153. primitives and polygons in PM applications. 
  154.  
  155.  
  156. ΓòÉΓòÉΓòÉ 1.1.2.5. Character String Primitives and Fonts ΓòÉΓòÉΓòÉ
  157.  
  158.  
  159. A character string primitive is used to create text.  A font is a collection of 
  160. character string primitives that share a common height, line weight, and 
  161. appearance. 
  162.  
  163. Both character string primitive functions and font functions are used to 
  164. ascertain the available fonts, select a font for text output, draw a string of 
  165. the selected characters, and modify a character string. 
  166.  
  167. Character string primitives are stored in the CHARBUNDLE data structure. 
  168. Attributes of the character string primitives include set, precision, cell, 
  169. angle, direction, text alignment, color, and mix. 
  170.  
  171. See Character String Primitives for details about character string primitives, 
  172. and Fonts for details about fonts, and how to use both in PM applications. 
  173.  
  174.  
  175. ΓòÉΓòÉΓòÉ 1.1.2.6. Marker Primitives ΓòÉΓòÉΓòÉ
  176.  
  177.  
  178. Marker primitives are graphics objects, used, for example, to indicate the 
  179. peaks and valleys on a line graph.  The GPI has a base marker set that includes 
  180. visible marker symbols, such as squares, diamonds, stars, circles, and crosses. 
  181.  
  182. Marker primitives are contained in the MARKERBUNDLE data structure.  Marker 
  183. primitive attributes consist of marker symbols, marker box, the aforementioned 
  184. marker set, colors, and mix modes. 
  185.  
  186. See Marker Primitives for detailed information about marker primitives and how 
  187. to use them in PM applications. 
  188.  
  189.  
  190. ΓòÉΓòÉΓòÉ 1.1.3. Color and Mix Attributes ΓòÉΓòÉΓòÉ
  191.  
  192. Color and Mix are two attributes that apply to primitives.  The color attribute 
  193. describes the color of a line, arc, character, area, or image.  The mix 
  194. attribute controls how each primitive is combined with an existing drawing and 
  195. affects, among other things, the resulting color when primitives of different 
  196. colors overlap. 
  197.  
  198. Some primitives have foreground and background color attributes.  For example, 
  199. the character primitive has a foreground color attribute that specifies the 
  200. color of the character and a background color attribute that specifies the 
  201. color surrounding the character.  Primitives that have foreground and 
  202. background color attributes also have foreground and background mix attributes. 
  203.  
  204. See Color and Mix Attributes for details about color implementation using the 
  205. GPI. 
  206.  
  207.  
  208. ΓòÉΓòÉΓòÉ 1.1.4. Bit Maps ΓòÉΓòÉΓòÉ
  209.  
  210. A bit map is a graphic image stored in memory.  Bit maps can be created using 
  211. the Icon Editor or hard-coded using GPI functions.  The bit maps can be stored 
  212. in a memory device context or in disk files.  PM supports both monochrome and 
  213. color bit maps. 
  214.  
  215. Applications can use bit maps for the following: 
  216.  
  217. o To store and display scanned images, icons, and pointers 
  218. o To create fill patterns for area primitives and paths. 
  219. o To animate graphics for multimedia displays. 
  220.  
  221. See Bit Maps for more information about bit maps, icons, and pointers, and how 
  222. to make them available to the PM-application user. 
  223.  
  224.  
  225. ΓòÉΓòÉΓòÉ 1.1.5. Metafiles ΓòÉΓòÉΓòÉ
  226.  
  227. Metafiles are files that contain low-level graphics commands that describe a 
  228. picture. 
  229.  
  230. The OS/2 operating system supports long-term retention ofgraphic so that 
  231. pictures can be saved for use by any PM application, or even by non-PM 
  232. applications that support the Mixed Object Document Content Architecture 
  233. (MO:DCA) interchange standard.  Graphics data that is to be exchanged among PM 
  234. and non-PM applications is transferred to those applications in a metafile. 
  235.  
  236. See Metafiles for complete details about metafiles and their use in both PM and 
  237. non-PM applications. 
  238.  
  239.  
  240. ΓòÉΓòÉΓòÉ 1.1.6. Paths ΓòÉΓòÉΓòÉ
  241.  
  242. A path is an object defined by a sequence of graphic primitive and attribute 
  243. functions issued between GpiBeginPath and GpiEndPath.  A path can be used for 
  244. defining a filled area, a complex clipping shape, an outline, and for drawing 
  245. geometric (wide) lines.  As a matter of fact, paths are the only means of 
  246. drawing lines with a geometric (scalable) width, and clipping to circular, 
  247. elliptical, or other nonrectangular figures, as well as being an efficient way 
  248. of producing text in an outline font. 
  249.  
  250. See Paths to learn how to define and use paths with several different drawing 
  251. techniques. 
  252.  
  253.  
  254. ΓòÉΓòÉΓòÉ 1.1.7. Regions ΓòÉΓòÉΓòÉ
  255.  
  256. Regions are rectangular graphics objects in an application's device space that 
  257. can be used to clip output, draw one or more discrete filled rectangles, or 
  258. draw a filled polygon consisting of intersecting rectangles.  Regions also are 
  259. used to repaint the client area of a window or part of an object in a picture. 
  260.  
  261. Regions are device-dependent and are defined in device coordinates.  Each 
  262. region is created for a device that is currently associated with a presentation 
  263. space.  The system implements regions as part of a device context. 
  264.  
  265. See Regions for more information on how to use regions in PM applications. 
  266.  
  267.  
  268. ΓòÉΓòÉΓòÉ 1.1.8. Retained Graphics ΓòÉΓòÉΓòÉ
  269.  
  270. There are two types of graphics output in the OS/2 operating system: retained 
  271. and nonretained. Retained graphics is a presentation space model in which an 
  272. entire graphics picture is stored for subsequent display and editing. 
  273.  
  274. An application draws nonretained graphics output using a graphics function. 
  275. The output appears immediately on the output device, such as a window.  If part 
  276. of the picture is erased or has to be repeated, the application must issue the 
  277. same function as many times as necessary; this is the primary drawback of 
  278. nonretained graphics. 
  279.  
  280. Retained graphics provide many advantages such as convenience, flexibility, 
  281. editing capability, more powerful and useful graphics, and better organization. 
  282. A possible disadvantage of retained graphics is the additional memory required 
  283. to store the data. 
  284.  
  285. PM applications store graphics in segments. Primarily, a graphics segment is a 
  286. means of grouping and storing graphics primitives and their attributes. 
  287. Although usually graphics segments are related in some way, they do not have to 
  288. be. 
  289.  
  290. See Creating and Drawing Retained Graphics for detailed information on how to 
  291. create and replay retained graphics.  See Editing Retained Graphics and 
  292. Graphics Segments for information on how to edit retained graphics and graphics 
  293. segments. 
  294.  
  295.  
  296. ΓòÉΓòÉΓòÉ 1.1.9. Correlation ΓòÉΓòÉΓòÉ
  297.  
  298. Correlation is the process of determining which primitives or primitive group 
  299. in a picture are at a given position on the display.  Correlation, most 
  300. commonly, is used in graphics applications; for instance, to identify a 
  301. primitive or primitive group selected by the user.  It should be noted, 
  302. however, that correlation also can be used in non-graphic applications; for 
  303. example, if your application models the operation of a calculator and allows a 
  304. user to select numbers for mathematical operations. 
  305.  
  306. See Correlation for low-level information about the correlation process. 
  307.  
  308.  
  309. ΓòÉΓòÉΓòÉ 1.1.10. Clipping and Boundary Determination ΓòÉΓòÉΓòÉ
  310.  
  311. Clipping is a process by which all output outside the defined clip boundary of 
  312. a picture is discarded (clipped), and only the parts inside the clip boundary 
  313. (clipping area) are displayed. 
  314.  
  315. Most often, clipping boundaries are defined by the application.  The PM 
  316. interface performs some clipping automatically when, for example, the 
  317. application's graphic output is clipped to fit a client area (user work area) 
  318. or the device output area for a hard-copy device. 
  319.  
  320. Boundary determination is an operation to compute the size of the smallest 
  321. rectangle that encloses a graphics object on the screen, for the purpose of 
  322. updating only the affected parts of the screen when that graphics object is 
  323. moved or changed. 
  324.  
  325. See Clipping and Boundary Determination for comprehensive information about 
  326. clipping and boundary determination for PM applications. 
  327.  
  328.  
  329. ΓòÉΓòÉΓòÉ 1.1.11. Coordinate Spaces and Transformation Operations and Functions ΓòÉΓòÉΓòÉ
  330.  
  331. Transformations (also called transforms) enable an application to control the 
  332. size and orientation of graphic output on any output device.  The GPI transform 
  333. functions provide for scaling, translation, rotation, and shear in both 
  334. graphics pictures and text.  Almost all of these GPI functions draw their 
  335. output in a conceptual area called a world coordinate space. 
  336.  
  337. The following table describes the five kinds of coordinate spaces used in GPI 
  338. transformations: 
  339.  
  340. Types of Coordinate Spaces 
  341.  
  342. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  343. ΓöéName                    ΓöéDescription                         Γöé
  344. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  345. ΓöéWorld coordinate space  ΓöéA space where an application        Γöé
  346. Γöé                        Γöéspecifies its coordinates for       Γöé
  347. Γöé                        Γöédrawing.                            Γöé
  348. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  349. ΓöéModel space             ΓöéA conceptual space in which a       Γöé
  350. Γöé                        Γöépicture is constructed by the outputΓöé
  351. Γöé                        Γöéof the model transform matrix.      Γöé
  352. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  353. ΓöéDefault page coordinate ΓöéA space representing a picture      Γöé
  354. Γöéspace                   Γöédefined in page coordinates without Γöé
  355. Γöé                        Γöéany scaling or scrolling.           Γöé
  356. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  357. ΓöéPage coordinate space   ΓöéA conceptual space in which a       Γöé
  358. Γöé                        Γöépicture is constructed by the outputΓöé
  359. Γöé                        Γöéof the default viewing transform    Γöé
  360. Γöé                        Γöématrix.                             Γöé
  361. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  362. ΓöéDevice coordinate space ΓöéThe coordinate space of a device.   Γöé
  363. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  364.  
  365. See Coordinate Spaces and Transformations for information on all the available 
  366. transforms and functions for GPI graphics transformations. 
  367.  
  368.  
  369. ΓòÉΓòÉΓòÉ 1.1.12. Print Job Submission and Manipulation ΓòÉΓòÉΓòÉ
  370.  
  371. Printing is the process of producing hardcopy output. An application can submit 
  372. the job using the spooler, which will direct the job to the appropriate 
  373. printer. Alternatively, an application can submit the job directly to the 
  374. printer. Direct submission can halt all user input to an application until 
  375. printing is complete. 
  376.  
  377. If you choose to use the spooler, you can manipulate the job while it is in a 
  378. spool queue. A common example of manipulation is increasing the number of 
  379. copies to be printed or deleting the job entirely. 
  380.  
  381. See Print Job Submission and Manipulation for more information on how to print 
  382. jobs or manipulate them once inside a queue. 
  383.  
  384.  
  385. ΓòÉΓòÉΓòÉ 1.1.13. Program Execution ΓòÉΓòÉΓòÉ
  386.  
  387. Graphics programming is influenced by the underlying execution of the operating 
  388. system.  While the OS/2 2.0 Programming Guide, Volume I, will familiarize you 
  389. with the concepts of operating system execution, following are some of the 
  390. concepts that you will be concerned with when programming for the GPI: 
  391.  
  392. A session is one or more processes with its own virtual console.  A virtual 
  393. console is a virtual screen-either a character-based full screen or a PM 
  394. window-and buffers for keyboard and mouse input. 
  395.  
  396. A process is the application's code, data, and other resources-such as file 
  397. handles, semaphores, pipes, queues, and so forth-in memory.  The operating 
  398. system considers every application it loads to be a process. 
  399.  
  400. A thread is a dispatchable unit of execution that consists of a set of 
  401. instructions, related CPU register values, and a stack.  Every process has at 
  402. least one thread and can have many threads running at the same time.  The 
  403. application runs when the operating system turns over control to a thread in 
  404. the process.  A thread is the basic unit of execution scheduling. 
  405.  
  406. Graphics output can be slow, so it is wise to perform lengthy drawing 
  407. operations on an asynchronous thread.  As a result, the main thread is free to 
  408. process its message queue and remain responsive to user input.  User input goes 
  409. to only the main thread, so good communication between the main thread and the 
  410. drawing thread is very important if you are to achieve rapid response to user 
  411. requests. 
  412.  
  413. For example, if a user changes or deletes graphics, the main thread must be 
  414. able to interrupt the processing of the asychronous thread to pass on the 
  415. revised instructions.  The main thread issues GpiSetStopDraw, with the value 
  416. SDW_ON-this suspends all drawing to the graphics presentation space named in 
  417. GpiSetStopDraw and establishes the stop draw condition. 
  418.  
  419. Drawing to other presentation spaces in the same process and in different 
  420. processes is unaffected by this stop-draw condition.  But no drawing can begin 
  421. from another thread to the named presentation space while the stop-draw 
  422. condition is in effect.  Any drawing operations to the same presentation space 
  423. that are in progress on other threads of the same process when you issue this 
  424. function are terminated with a warning.  When the main thread receives an 
  425. acknowledgment from the drawing thread, it can clear the suspension by issuing 
  426. GpiSetStopDraw with the value SDW_OFF. 
  427.  
  428.  
  429. ΓòÉΓòÉΓòÉ 1.2. Summary ΓòÉΓòÉΓòÉ
  430.  
  431. Following is a summary of some of the GPI's frequently-used functions. 
  432.  
  433. GPI Functions 
  434.  
  435. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  436. ΓöéAttribute Functions           Γöé                              Γöé
  437. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  438. ΓöéGpiMove                       ΓöéMoves the current position to Γöé
  439. Γöé                              Γöéthe specified point.          Γöé
  440. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  441. ΓöéGpiQueryAttrs                 ΓöéReturns current attributes forΓöé
  442. Γöé                              Γöéthe specified primitive type. Γöé
  443. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  444. ΓöéGpiQueryCharSet               ΓöéReturns the character-set     Γöé
  445. Γöé                              Γöélocal identifier (ICID) as setΓöé
  446. Γöé                              Γöéby GpiSetCharSet.             Γöé
  447. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  448. ΓöéGpiQueryCurrentPosition       ΓöéReturns the value of current  Γöé
  449. Γöé                              Γöéposition.                     Γöé
  450. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  451. ΓöéGpiQueryLineType              ΓöéReturns the current cosmetic  Γöé
  452. Γöé                              Γöéline-type attribute as set by Γöé
  453. Γöé                              ΓöéGpiSetLineType.               Γöé
  454. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  455. ΓöéGpiQueryLineWidth             ΓöéReturns the current value of  Γöé
  456. Γöé                              Γöéthe cosmetic line-width       Γöé
  457. Γöé                              Γöéattribute as set by           Γöé
  458. Γöé                              ΓöéGpiSetLineWidth.              Γöé
  459. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  460. ΓöéGpiQueryMix                   ΓöéReturns the current value of  Γöé
  461. Γöé                              Γöéthe (character) foreground    Γöé
  462. Γöé                              Γöécolor-mixing mode as set by   Γöé
  463. Γöé                              ΓöéGpiSetMix.                    Γöé
  464. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  465. ΓöéGpiQueryPatternSet            ΓöéReturns the current value of  Γöé
  466. Γöé                              Γöéthe pattern-set identifier as Γöé
  467. Γöé                              Γöéset by GpiSetPatternSet.      Γöé
  468. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  469. ΓöéGpiSetArcParams               ΓöéSets the current arc          Γöé
  470. Γöé                              Γöéparameters.                   Γöé
  471. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  472. ΓöéGpiSetAttrs                   ΓöéSets the attributes for the   Γöé
  473. Γöé                              Γöéspecified primitive type.     Γöé
  474. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  475. ΓöéGpiSetCharBox                 ΓöéSets the current character-boxΓöé
  476. Γöé                              Γöéattribute to the specified    Γöé
  477. Γöé                              Γöévalue.                        Γöé
  478. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  479. ΓöéGpiSetCurrentPosition         ΓöéSets the current position to  Γöé
  480. Γöé                              Γöéthe specified point.          Γöé
  481. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  482. ΓöéGpiSetLineType                ΓöéSets the current cosmetic     Γöé
  483. Γöé                              Γöéline-type attribute.          Γöé
  484. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  485. ΓöéGpiSetLineWidth               ΓöéSets the current cosmetic     Γöé
  486. Γöé                              Γöéline-width attribute.         Γöé
  487. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  488. ΓöéGpiSetMix                     ΓöéSets the current background   Γöé
  489. Γöé                              Γöémix attribute for each        Γöé
  490. Γöé                              Γöéindividual primitive type.    Γöé
  491. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  492. ΓöéGpiSetPattern                 ΓöéSets the current value of the Γöé
  493. Γöé                              Γöépattern-symbol attribute.     Γöé
  494. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  495. ΓöéBit Map Functions             Γöé                              Γöé
  496. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  497. ΓöéGpiCreateBitmap               ΓöéCreates a bit map and returns Γöé
  498. Γöé                              Γöéthe bit-map handle.           Γöé
  499. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  500. ΓöéGpiDeleteBitmap               ΓöéDeletes a bit map.            Γöé
  501. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  502. ΓöéGpiQueryBitmapBits            ΓöéTransfer data from a bit map  Γöé
  503. Γöé                              Γöéto application storage.       Γöé
  504. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  505. ΓöéGpiQueryBitmapHandle          ΓöéReturns the handle of the bit Γöé
  506. Γöé                              Γöémap currently tagged with the Γöé
  507. Γöé                              Γöéspecified local identifier.   Γöé
  508. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  509. ΓöéGpiQueryBitmapParameters      ΓöéReturns information about a   Γöé
  510. Γöé                              Γöébit map identified by the     Γöé
  511. Γöé                              Γöébit-map handle.               Γöé
  512. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  513. ΓöéGpiQueryDeviceBitmapFormats   ΓöéReturns the formats of bit    Γöé
  514. Γöé                              Γöémaps supported internally by  Γöé
  515. Γöé                              Γöéthe device driver.            Γöé
  516. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  517. ΓöéGpiSetBitmap                  ΓöéSets a bit map as the         Γöé
  518. Γöé                              Γöécurrently selected bit map in Γöé
  519. Γöé                              Γöéa memory device context.      Γöé
  520. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  521. ΓöéGpiSetBitmapid                ΓöéTags a bit map with a local   Γöé
  522. Γöé                              Γöéidentifier so that it can be  Γöé
  523. Γöé                              Γöéused as a pattern set         Γöé
  524. Γöé                              Γöécontaining a single member.   Γöé
  525. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  526. ΓöéDevice Functions              Γöé                              Γöé
  527. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  528. ΓöéDevCloseDC                    ΓöéCloses a device context.      Γöé
  529. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  530. ΓöéDevEscape                     ΓöéEnables applications to accessΓöé
  531. Γöé                              Γöéfacilities of a device not    Γöé
  532. Γöé                              Γöéotherwise available through   Γöé
  533. Γöé                              Γöéthe API.                      Γöé
  534. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  535. ΓöéDevOpenDC                     ΓöéCreates a device context.     Γöé
  536. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  537. ΓöéDevPostDeviceModes            ΓöéReturns and, optionally, sets Γöé
  538. Γöé                              Γöéjob properties.               Γöé
  539. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  540. ΓöéDevQueryCaps                  ΓöéQueries the device            Γöé
  541. Γöé                              Γöécharacteristics.              Γöé
  542. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  543. ΓöéDevQueryDeviceNames           ΓöéQueries the presentation      Γöé
  544. Γöé                              Γöédriver to return the names,   Γöé
  545. Γöé                              Γöédescriptions, and data types  Γöé
  546. Γöé                              Γöéof the devices it support.    Γöé
  547. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  548. ΓöéDevQueryHardcopyCaps          ΓöéQueries the hard-copy         Γöé
  549. Γöé                              Γöécapabilities of a device.     Γöé
  550. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  551. ΓöéDrawing Functions             Γöé                              Γöé
  552. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  553. ΓöéGpiBeginArea                  ΓöéBegins the construction of an Γöé
  554. Γöé                              Γöéarea.                         Γöé
  555. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  556. ΓöéGpiBeginPath                  ΓöéSpecifies the start of a path.Γöé
  557. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  558. ΓöéGpiBitBlt                     ΓöéCopies a rectangle of bit-map Γöé
  559. Γöé                              Γöéimage data.                   Γöé
  560. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  561. ΓöéGpiCharString                 ΓöéDraws a character string      Γöé
  562. Γöé                              Γöéstarting at the current       Γöé
  563. Γöé                              Γöéposition.                     Γöé
  564. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  565. ΓöéGpiEndArea                    ΓöéEnds construction of a shaded Γöé
  566. Γöé                              Γöéarea.                         Γöé
  567. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  568. ΓöéGpiEndPath                    ΓöéEnds the specification of a   Γöé
  569. Γöé                              Γöépath started by GpiBeginPath. Γöé
  570. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  571. ΓöéGpiErase                      ΓöéClears the output display of  Γöé
  572. Γöé                              Γöéthe device context associated Γöé
  573. Γöé                              Γöéwith the specified            Γöé
  574. Γöé                              Γöépresentation space to the     Γöé
  575. Γöé                              Γöéreset color.                  Γöé
  576. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  577. ΓöéGpiIntersectClipRectangle     ΓöéSets the new clip region to   Γöé
  578. Γöé                              Γöéthe intersection of the       Γöé
  579. Γöé                              Γöécurrent clip region and the   Γöé
  580. Γöé                              Γöéspecified rectangle.          Γöé
  581. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  582. ΓöéGpiLine                       ΓöéDraws a straight line from theΓöé
  583. Γöé                              Γöécurrent position to the       Γöé
  584. Γöé                              Γöéspecified end point.          Γöé
  585. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  586. ΓöéGpiPaintRegion                ΓöéPaints a region into a        Γöé
  587. Γöé                              Γöépresentation space using the  Γöé
  588. Γöé                              Γöécurrent pattern attributes.   Γöé
  589. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  590. ΓöéGpiPolyLine                   ΓöéDraws a series of straight    Γöé
  591. Γöé                              Γöélines starting at the current Γöé
  592. Γöé                              Γöéposition and connecting the   Γöé
  593. Γöé                              Γöépoints specified.             Γöé
  594. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  595. ΓöéGpiPolySpline                 ΓöéCreates a succession of BezierΓöé
  596. Γöé                              Γöésplines.                      Γöé
  597. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  598. ΓöéGpiQueryCharStringPos         ΓöéProcesses a string as if it isΓöé
  599. Γöé                              Γöébeing drawn under the current Γöé
  600. Γöé                              Γöécharacter attributes using    Γöé
  601. Γöé                              ΓöéGpiCharStringPos, and returns Γöé
  602. Γöé                              Γöéthe positions in the string atΓöé
  603. Γöé                              Γöéwhich each character would be Γöé
  604. Γöé                              Γöédrawn.                        Γöé
  605. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  606. ΓöéGpiQueryClipBox               ΓöéReturns the dimensions of the Γöé
  607. Γöé                              Γöétightest rectangle that       Γöé
  608. Γöé                              Γöécompletely encloses the       Γöé
  609. Γöé                              Γöéintersection of all the       Γöé
  610. Γöé                              Γöéclipping definitions.         Γöé
  611. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  612. ΓöéGpiQueryPel                   ΓöéReturns the color of a pel at Γöé
  613. Γöé                              Γöéa position specified in world Γöé
  614. Γöé                              Γöécoordinates.                  Γöé
  615. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  616. ΓöéGpiRectVisible                ΓöéDetermines whether any part ofΓöé
  617. Γöé                              Γöéa rectangle lies within the   Γöé
  618. Γöé                              Γöéclipping region of the device Γöé
  619. Γöé                              Γöéassociated with the specified Γöé
  620. Γöé                              Γöépresentation space.           Γöé
  621. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  622. ΓöéGpiRestorePS                  ΓöéRestores the state of the     Γöé
  623. Γöé                              Γöépresentation space to the one Γöé
  624. Γöé                              Γöéthat exists when the          Γöé
  625. Γöé                              Γöécorresponding GpiSavePS is    Γöé
  626. Γöé                              Γöéissued.                       Γöé
  627. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  628. ΓöéGpiSavePS                     ΓöéSaves information about the   Γöé
  629. Γöé                              Γöépresentation space on a LIFO  Γöé
  630. Γöé                              Γöéstack.                        Γöé
  631. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  632. ΓöéGpiSetClipRegion              ΓöéDefines the region to be used Γöé
  633. Γöé                              Γöéfor clipping when any drawing Γöé
  634. Γöé                              Γöétakes place through the       Γöé
  635. Γöé                              Γöéspecified presentation space. Γöé
  636. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  637. ΓöéGpiSetPel                     ΓöéSets a pel at a position      Γöé
  638. Γöé                              Γöéspecified in world coordinatesΓöé
  639. Γöé                              Γöéusing the current (line) colorΓöé
  640. Γöé                              Γöéand mix.                      Γöé
  641. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  642. ΓöéGpiWCBitBlt                   ΓöéCopies a rectangle of bit-map Γöé
  643. Γöé                              Γöéimage data.                   Γöé
  644. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  645. ΓöéFont Functions                Γöé                              Γöé
  646. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  647. ΓöéGpiCreateLogFont              ΓöéProvides the logical          Γöé
  648. Γöé                              Γöédefinition of a font.         Γöé
  649. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  650. ΓöéGpiDeleteSetId                ΓöéDeletes a logical font or     Γöé
  651. Γöé                              Γöébit-map tag.                  Γöé
  652. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  653. ΓöéGpiLoadFonts                  ΓöéLoads one or more fonts from  Γöé
  654. Γöé                              Γöéthe specified resource file.  Γöé
  655. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  656. ΓöéGpiQueryFontMetrics           ΓöéReturns a record providing    Γöé
  657. Γöé                              Γöédetails of the font metrics   Γöé
  658. Γöé                              Γöéfor the logical font that is  Γöé
  659. Γöé                              Γöécurrently selected.           Γöé
  660. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  661. ΓöéGpiQueryFonts                 ΓöéReturns a record providing    Γöé
  662. Γöé                              Γöédetails of the fonts that     Γöé
  663. Γöé                              Γöématch the specified           Γöé
  664. Γöé                              ΓöépszFacename.                  Γöé
  665. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  666. ΓöéGpiQueryNumberSetIds          ΓöéReturns the number of local   Γöé
  667. Γöé                              Γöéidentifiers currently in use, Γöé
  668. Γöé                              Γöéreferring to fonts or bit     Γöé
  669. Γöé                              Γöémaps.                         Γöé
  670. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  671. ΓöéGpiQueryWidthTable            ΓöéReturns width table           Γöé
  672. Γöé                              Γöéinformation for the logical   Γöé
  673. Γöé                              Γöéfont identified by the value  Γöé
  674. Γöé                              Γöéof the character-set          Γöé
  675. Γöé                              Γöéattribute.                    Γöé
  676. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  677. ΓöéGpiSetCP                      ΓöéSets the default graphics codeΓöé
  678. Γöé                              Γöépage.                         Γöé
  679. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  680. ΓöéGpiUnloadFonts                ΓöéUnloads any fonts previously  Γöé
  681. Γöé                              Γöéloaded from the resource file Γöé
  682. Γöé                              Γöéby GpiLoadFonts.              Γöé
  683. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  684. ΓöéPresentation Space Functions  Γöé                              Γöé
  685. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  686. ΓöéGpiCreatePS                   ΓöéCreates a presentation space. Γöé
  687. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  688. ΓöéGpiDestroyPS                  ΓöéDeletes a presentation space. Γöé
  689. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  690. ΓöéGpiQueryDevice                ΓöéReturns the handle of the     Γöé
  691. Γöé                              Γöécurrently associated device   Γöé
  692. Γöé                              Γöécontext.                      Γöé
  693. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  694. ΓöéGpiResetPS                    ΓöéResets the presentation space.Γöé
  695. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  696. ΓöéGpiSetPS                      ΓöéSets the presentation space   Γöé
  697. Γöé                              Γöésize, unit, and format.       Γöé
  698. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  699. ΓöéRegion Functions              Γöé                              Γöé
  700. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  701. ΓöéGpiCombineRegion              ΓöéCombines two regions.         Γöé
  702. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  703. ΓöéGpiCreateRegion               ΓöéCreates a region for a        Γöé
  704. Γöé                              Γöéparticular class of device    Γöé
  705. Γöé                              Γöéusing a series of rectangles. Γöé
  706. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  707. ΓöéGpiQueryRegionBox             ΓöéReturns the dimensions of the Γöé
  708. Γöé                              Γöésmallest rectangle able to    Γöé
  709. Γöé                              Γöébound the region.             Γöé
  710. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  711. ΓöéGpiSetRegion                  ΓöéChanges a region to be the    Γöé
  712. Γöé                              Γöélogical OR of a set of        Γöé
  713. Γöé                              Γöérectangles.                   Γöé
  714. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  715. ΓöéTransform Functions           Γöé                              Γöé
  716. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  717. ΓöéGpiConvert                    ΓöéConverts an array of          Γöé
  718. Γöé                              Γöécoordinate pairs from one     Γöé
  719. Γöé                              Γöécoordinate space to another.  Γöé
  720. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  721. ΓöéGpiQueryModelTransformMatrix  ΓöéReturns the current model     Γöé
  722. Γöé                              Γöétransform.                    Γöé
  723. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  724. ΓöéGpiSetModelTransformMatrix    ΓöéSets the model transform      Γöé
  725. Γöé                              Γöématrix for subsequent         Γöé
  726. Γöé                              Γöéprimitives.                   Γöé
  727. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  728. ΓöéGpiSetPageViewport            ΓöéSets the page viewport within Γöé
  729. Γöé                              Γöédevice space.                 Γöé
  730. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  731.  
  732.  
  733. ΓòÉΓòÉΓòÉ 2. Presentation Spaces and Device Contexts ΓòÉΓòÉΓòÉ
  734.  
  735. A presentation space is a data structure maintained by the operating system in 
  736. which information relevant to the graphic output is stored.  The information is 
  737. related to both the subsequent drawings (such as colors or line styles) and the 
  738. presentation space resources (such as color tables or fonts). 
  739.  
  740. The first task in a graphics application is to define a presentation space, 
  741. because so many of the GPI functions must operate within them.  A presentation 
  742. space is required for each output device currently in use by your application, 
  743. including each separate window on the display screen.  In almost all cases, the 
  744. presentation space is set up to be device-independent, because the requirements 
  745. of each possible output device are so different. 
  746.  
  747. Note:  In some cases, it is possible to disassociate a presentation space from 
  748.        one device and associate it with another, thereby allowing the 
  749.        presentation space to be shared. 
  750.  
  751. To facilitate the device independence of the PM programming interface, all 
  752. device-specific information is held in a device context.  A device context is a 
  753. data structure that identifies a particular instance of an output device and 
  754. contains all the device-specific information, such as the logical name of the 
  755. device and the presentation driver name.  Each separate instance of an output 
  756. device that you intend to use must be described in a device context.  For 
  757. example, if a single application uses more than one window, each of those 
  758. windows must have its own window device context. 
  759.  
  760. The applicable device context, then, must be associated with the presentation 
  761. space in order to send  graphics data to that output device.  See Associating 
  762. Presentation Spaces with Device Contexts for details about how to create these 
  763. associations. 
  764.  
  765. This chapter describes presentation spaces and device contexts. The following 
  766. topics are related to the information in this chapter: 
  767.  
  768. o Graphics primitives 
  769. o Coordinate spaces 
  770. o Transformations 
  771. o Graphics segments. 
  772.  
  773.  
  774. ΓòÉΓòÉΓòÉ 2.1. About Presentation Spaces ΓòÉΓòÉΓòÉ
  775.  
  776. There are three types of presentation spaces: 
  777.  
  778. o Standard Micro 
  779. o Cached Micro 
  780. o Normal. 
  781.  
  782.  
  783. ΓòÉΓòÉΓòÉ 2.1.1. Micro Presentation Spaces ΓòÉΓòÉΓòÉ
  784.  
  785. You need a micro presentation space if your application creates a separate 
  786. presentation space for each output device instance and if its output is a 
  787. simple drawing. 
  788.  
  789. Although run time memory requirements vary according to the graphics function 
  790. an application uses, a typical micro presentation space graphical application 
  791. uses 315KB of GPI, engine, and display memory resource (code and data).  A 
  792. micro presentation space cannot be reassociated with a different device. 
  793.  
  794.  
  795. ΓòÉΓòÉΓòÉ 2.1.1.1. Standard Micro Presentation Space ΓòÉΓòÉΓòÉ
  796.  
  797. Use a standard micro presentation space for drawing on any type of output 
  798. device, provided the presentation space is not in retain mode or retain and 
  799. draw mode. 
  800.  
  801. There are two different functions you can use to access a standard micro 
  802. presentation space. The following table lists both functions and their 
  803. considerations. 
  804.  
  805. Functions that Create Standard Micro Presentation Spaces 
  806.  
  807. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  808. ΓöéFunction Name  ΓöéUsage                         ΓöéClosing        Γöé
  809. Γöé               Γöé                              ΓöéFunction       Γöé
  810. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  811. ΓöéGpiCreatePS    ΓöéAccepts an anchor handle, a   ΓöéGpiDestroyPS   Γöé
  812. Γöé               Γöédevice-context handle, and a  Γöédestroys a     Γöé
  813. Γöé               Γöépresentation space size as    Γöépresentation   Γöé
  814. Γöé               Γöéparameters. Creates both      Γöéspace and      Γöé
  815. Γöé               Γöénormal presentation spaces andΓöéreleases all   Γöé
  816. Γöé               Γöémicro presentation spaces.    Γöéresources ownedΓöé
  817. Γöé               Γöé                              Γöéby the         Γöé
  818. Γöé               Γöé                              Γöépresentation   Γöé
  819. Γöé               Γöé                              Γöéspace.         Γöé
  820. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  821. ΓöéWinGetScreenPS ΓöéThe presentation space        ΓöéWinReleasePS   Γöé
  822. Γöé               Γöérepresents the entire display Γöé               Γöé
  823. Γöé               Γöéscreen. Warning:  Exercise    Γöé               Γöé
  824. Γöé               Γöécaution when using this       Γöé               Γöé
  825. Γöé               Γöéfunction as the graphic outputΓöé               Γöé
  826. Γöé               Γöécan overlap individual        Γöé               Γöé
  827. Γöé               Γöéwindows.                      Γöé               Γöé
  828. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  829.  
  830.  
  831. ΓòÉΓòÉΓòÉ 2.1.1.2. Cached Micro Presentation Space ΓòÉΓòÉΓòÉ
  832.  
  833. The window manager maintains a cache of micro presentation spaces for windows 
  834. on a display screen.  The cache is provided for applications that use a large 
  835. number of windows, and where each window requires a temporary presentation 
  836. space-device context pair for a short sequence of output operations.  These 
  837. presentation spaces belong to the system rather than to your application, and 
  838. are allocated only on a temporary basis. 
  839.  
  840. Cached micro presentation spaces are provided by the window system rather than 
  841. by the GPI; their use is synchronized with other window activities.  For 
  842. example, you need not associate a cached micro presentation space with the 
  843. display screen; the window manager does this for you. 
  844.  
  845. Cached micro presentation spaces offer the best system performance because, 
  846. unlike normal presentation spaces and standard micro presentation spaces, they 
  847. are not permanently allocated to an application. The PM programming interface 
  848. is a model interface, however, cached micro presentation spaces can be 
  849. cumbersome to use because all the attributes must be initialized continually. 
  850.  
  851. Use a cached micro presentation space to send output only to a window on the 
  852. display device. There are three different functions you can use to access a 
  853. cached micro presentation space, each with its own considerations. These 
  854. functions are listed in the following table. 
  855.  
  856. Functions that Obtain Cached Micro Presentation Spaces 
  857.  
  858. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  859. ΓöéFunction Name  ΓöéUsage                         ΓöéClosing        Γöé
  860. Γöé               Γöé                              ΓöéFunction       Γöé
  861. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  862. ΓöéWinBeginPaint  ΓöéAccepts a NULL presentation   ΓöéWinEndPaint    Γöé
  863. Γöé               Γöéspace handle for a cached     Γöéautomatically  Γöé
  864. Γöé               Γöémicro presentation space.  TheΓöéreleases the   Γöé
  865. Γöé               Γöépresentation space created by Γöépresentation   Γöé
  866. Γöé               Γöéthis function is already      Γöéspace, no      Γöé
  867. Γöé               Γöépreassociated with the window Γöématter what    Γöé
  868. Γöé               Γöédevice context, making this   Γöétype.          Γöé
  869. Γöé               Γöéthe easiest function to use.  Γöé               Γöé
  870. Γöé               ΓöéUsually this type of creation Γöé               Γöé
  871. Γöé               Γöéis in response to a WM_PAINT  Γöé               Γöé
  872. Γöé               Γöémessage.                      Γöé               Γöé
  873. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  874. ΓöéWinGetScreenPS ΓöéThe presentation space        ΓöéWinReleasePS   Γöé
  875. Γöé               Γöérepresents the entire display Γöé               Γöé
  876. Γöé               Γöéscreen.                       Γöé               Γöé
  877. Γöé               ΓöéWarning:  Exercise caution    Γöé               Γöé
  878. Γöé               Γöéwhen using this function as   Γöé               Γöé
  879. Γöé               Γöéthe graphic output can overlapΓöé               Γöé
  880. Γöé               Γöéindividual windows.           Γöé               Γöé
  881. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  882. ΓöéWinGetPS       ΓöéThe presentation space can    ΓöéWinReleasePS   Γöé
  883. Γöé               Γöérepresent the entire desktop, Γöé               Γöé
  884. Γöé               Γöéor any other window.          Γöé               Γöé
  885. Γöé               ΓöéThe presentation space can be Γöé               Γöé
  886. Γöé               Γöéused to process any message,  Γöé               Γöé
  887. Γöé               Γöébut it must be returned to theΓöé               Γöé
  888. Γöé               Γöécache when message processing Γöé               Γöé
  889. Γöé               Γöéis complete.                  Γöé               Γöé
  890. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  891.  
  892. In general, use a cached micro presentation space to process a single paint 
  893. message when no presentation space information needs to be remembered between 
  894. messages.  The presentation space must be both obtained and released during the 
  895. processing of that message.  All application information stored in a cached 
  896. micro presentation space is lost as soon as it is released to the cache. 
  897.  
  898. You must provide a window handle on input to WinBeginPaint and WinGetPS.  The 
  899. resulting presentation space is defined specifically for that window, and 
  900. cannot be reassociated. 
  901.  
  902. The cached micro presentation space always is: 
  903.  
  904. o Defined in pels-although you can change the units using GpiSetPS 
  905. o Formatted GPIF_LONG 
  906. o Given a suitable size by the system. 
  907.  
  908. When you finish using a cached micro presentation space, you do not have to 
  909. disassociate it from the window device context because WinReleasePS or 
  910. WinEndPaint performs the disassociation.  This makes the cached micro 
  911. presentation space available for use in other windows.  The presentation space 
  912. itself cannot be deleted. 
  913.  
  914. Cached micro presentation spaces are used serially.  The next time you need a 
  915. cached presentation space, access a new 1 using the appropriate function.  Each 
  916. time you get a cached micro presentation space, graphics attributes are reset 
  917. to their default values. 
  918.  
  919.  
  920. ΓòÉΓòÉΓòÉ 2.1.2. Normal Presentation Spaces ΓòÉΓòÉΓòÉ
  921.  
  922. You must use a normal presentation space if you require your application to use 
  923. the same presentation space to send output to multiple devices (a display 
  924. screen and printer, for example), or if it uses the segment and 
  925. retained-drawing functions to generate complex drawings. 
  926.  
  927. There is only one function you can use to create a normal presentation space: 
  928.  
  929. Functions that Create Normal Presentation Spaces 
  930.  
  931. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  932. ΓöéFunction Name  ΓöéUsage                         ΓöéClosing        Γöé
  933. Γöé               Γöé                              ΓöéFunction       Γöé
  934. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  935. ΓöéGpiCreatePS    ΓöéAccepts an anchor handle, a   ΓöéGpiDestroyPS   Γöé
  936. Γöé               Γöédevice-context handle, and a  Γöédestroys a     Γöé
  937. Γöé               Γöépresentation space size as    Γöépresentation   Γöé
  938. Γöé               Γöéparameters. Creates both      Γöéspace and      Γöé
  939. Γöé               Γöénormal presentation spaces andΓöéreleases       Γöé
  940. Γöé               Γöémicro presentation spaces.    Γöé               Γöé
  941. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  942.  
  943. If a normal presentation space is used, or if metafiling is carried out, more 
  944. run time memory is used than if a micro presentation spaces was used.  A normal 
  945. presentation space requires 114KB more than a micro presentation space. 
  946.  
  947.  
  948. ΓòÉΓòÉΓòÉ 2.1.3. Modal Graphic Systems ΓòÉΓòÉΓòÉ
  949.  
  950. The graphic output sent to the presentation space is created by graphic 
  951. primitives, such as straight or curved lines. How those primitives appear 
  952. depends in part on the mode of the presentation space. 
  953.  
  954. In modal systems, certain information that modifies a graphic primitive is 
  955. established before you issue the instruction to draw the primitive. For 
  956. example, The following figure is an example of a red, solid line being drawn 
  957. from (4,3) to (9,7).  With PM's modal interface, the only value you need to 
  958. supply to the GpiLine function is the end point (9,7). 
  959.  
  960. Line Drawn with the GpiLine Function. 
  961.  
  962. The line is drawn automatically with the current color, red, in the current 
  963. line type, solid, and starting from the current position, (4,3).  There are 
  964. separate functions for specifying the current color, line type, and position. 
  965.  
  966. In nonmodal graphics systems, you supply information relevant to an instruction 
  967. when you issue that instruction.  For example, you could issue a line-drawing 
  968. instruction in which you would specify that the line is to be green, dotted, 
  969. and drawn from point a to point b.  Those values or attributes are bound to a 
  970. particular drawing instruction, and affect no other.  If you are going to 
  971. continue the line from point b to point c, you must again specify "green", 
  972. "dotted", "point b", and finally, "point c". 
  973.  
  974. For the PM programming interface, the default values for the graphics 
  975. primitives (or current values if the defaults have been modified) are stored in 
  976. the presentation space along with the current position.  While at first it 
  977. might seem like many functions are necessary to perform 1 step, that is, to 
  978. draw the line, a modal graphics system actually saves resources.  After you 
  979. perform the first line draw, chances are that if you draw a second or third 
  980. line, the line attributes are not likely to change, that is, the mode of the 
  981. presentation space remains the same.  Thus, the constant repetition of 
  982. attributes in a nonmodal graphics system actually uses more resources if the 
  983. desired output requires more than 1 or 2 graphic functions. 
  984.  
  985. It is possible to define graphics, and store their definitions, without sending 
  986. them to a screen or a printer.  In these situations, the concept of attribute 
  987. currentness becomes relevant.  The color of a line on a screen, for example, is 
  988. the color that was current when you defined the line.  This is not always the 
  989. color that is current when the line is drawn. 
  990.  
  991.  
  992. ΓòÉΓòÉΓòÉ 2.1.4. Current Position ΓòÉΓòÉΓòÉ
  993.  
  994. The current position is the world-coordinate space position at which the next 
  995. drawing request begins; it is part of the data stored in the presentation 
  996. space.  When you create or obtain a presentation space, the current position is 
  997. set to the origin (0,0).  The current position also is reset to (0,0) whenever 
  998. a presentation space is associated with a different device context. 
  999.  
  1000. Most drawing requests update the current position.  If you draw a line from the 
  1001. origin to (3,5), for example, the current position is updated to (3,5).  The 
  1002. current position also can be updated explicitly by GpiSetCurrentPosition or 
  1003. GpiMove.  If you do not want the first drawing in a presentation space to start 
  1004. at (0,0), call GpiSetCurrentPosition first. 
  1005.  
  1006.  
  1007. ΓòÉΓòÉΓòÉ 2.1.5. Primitive Attributes ΓòÉΓòÉΓòÉ
  1008.  
  1009. The graphics primitives and the functions that draw them are discussed in Line 
  1010. and Arc Primitives through Fonts. The primitive's function allows the 
  1011. attributes of the primitive to be set for all subsequent issuance of that 
  1012. primitive.  The attributes are stored in data structures called bundles.  There 
  1013. are functions that allow you to set the attributes of the primitives before the 
  1014. drawing of any primitive is performed.  GpiSetAttrs allows you to not only 
  1015. specify the primitive for which the attributes are going to be set, but also, 
  1016. the settings for the specific attributes. GpiQueryAttrs returns the current 
  1017. values of specified attributes for specified primitives. 
  1018.  
  1019. Two other functions, GpiSetAttrMode and GpiQueryAttrMode, enable you to define 
  1020. or query the attribute mode settings, AM_PRESERVE and AM_NOPRESERVE.  The 
  1021. AM_PRESERVE setting preserves the value of an attribute any time that attribute 
  1022. is changed.  The previous value can be recovered easily if, for example, you 
  1023. need 6 dotted lines, 1 solid line, then 6 more dotted lines.  The AM_NOPRESERVE 
  1024. setting discards the previous value of an attribute once the value is changed. 
  1025. The values of the attributes are presentation space resources. 
  1026.  
  1027.  
  1028. ΓòÉΓòÉΓòÉ 2.2. Using Presentation Spaces ΓòÉΓòÉΓòÉ
  1029.  
  1030. You can use presentation-space functions to: 
  1031.  
  1032. o Create a normal, micro, or cached micro presentation space 
  1033. o Delete, save, or restore a presentation space 
  1034. o Define or determine the presentation space attributes. 
  1035.  
  1036.  
  1037. ΓòÉΓòÉΓòÉ 2.2.1. Obtaining and Creating a Presentation Space ΓòÉΓòÉΓòÉ
  1038.  
  1039. Refer to the OS/2 2.0 Programming Guide, Volume II  for details and sample code 
  1040. on how to obtain and create presentation spaces. 
  1041.  
  1042.  
  1043. ΓòÉΓòÉΓòÉ 2.2.2. Deleting a Presentation Space ΓòÉΓòÉΓòÉ
  1044.  
  1045. A presentation space consumes a considerable amount of memory; you should 
  1046. delete it when your application no longer requires it.  Delete either a normal 
  1047. or micro presentation space with GpiDestroyPS. 
  1048.  
  1049. When you finish using a cached micro presentation space that you accessed with 
  1050. WinGetPS, release it with WinReleasePS.  You need not delete a presentation 
  1051. space that you accessed with WinBeginPaint.  PM does this for you when you call 
  1052. WinEndPaint. 
  1053.  
  1054.  
  1055. ΓòÉΓòÉΓòÉ 2.2.3. Saving and Restoring a Presentation Space ΓòÉΓòÉΓòÉ
  1056.  
  1057. You can save certain attributes and resources of a presentation space, modify 
  1058. its fields, draw in the modified presentation space, then restore it with 
  1059. GpiSavePS and GpiRestorePS.  When you call GpiSavePS, the graphics engine 
  1060. copies the following items from the current presentation space onto a special 
  1061. stack: 
  1062.  
  1063. o Primitive attributes 
  1064. o Transformation matrixes 
  1065. o Viewing limit 
  1066. o Clip path 
  1067. o Clip region 
  1068. o Current position 
  1069. o Loaded logical color table 
  1070. o Loaded logical font. 
  1071.  
  1072. You can push the contents of a presentation space on the stack as many times as 
  1073. is necessary.  GpiRestorePS pops the contents of a presentation space off the 
  1074. stack. 
  1075.  
  1076.  
  1077. ΓòÉΓòÉΓòÉ 2.2.4. Presentation Spaces Review ΓòÉΓòÉΓòÉ
  1078.  
  1079. The following table summarizes the features and restrictions of each type of 
  1080. presentation space. 
  1081.  
  1082. Presentation Space Features and Restrictions 
  1083.  
  1084. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1085. ΓöéFeature/Restriction ΓöéNormal       ΓöéStandard     ΓöéCached Micro  Γöé
  1086. Γöé                    Γöé             ΓöéMicro        Γöé              Γöé
  1087. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1088. ΓöéDevice types        ΓöéAny device   ΓöéAny device   ΓöéVideo-display Γöé
  1089. Γöésupported           Γöé             Γöé             Γöéwindow only   Γöé
  1090. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1091. ΓöéNumber of supported ΓöéMultiple     ΓöéOne          ΓöéOne           Γöé
  1092. Γöédevices             Γöé             Γöé             Γöé              Γöé
  1093. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1094. ΓöéAssociation         ΓöéAssociate andΓöéAssociate at ΓöéN/A.          Γöé
  1095. Γöé                    Γöédisassociate Γöécreation;    Γöé              Γöé
  1096. Γöé                    Γöéas required. Γöécannot       Γöé              Γöé
  1097. Γöé                    Γöé             Γöédisassociate.Γöé              Γöé
  1098. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1099. ΓöéRetained graphics   ΓöéYes          ΓöéNo           ΓöéNo            Γöé
  1100. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1101. ΓöéAvailable GPI       ΓöéAll functionsΓöéAll except   ΓöéAll except    Γöé
  1102. Γöéfunctions           Γöé             Γöésegment      Γöésegment       Γöé
  1103. Γöé                    Γöé             Γöéfunctions    Γöéfunctions     Γöé
  1104. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1105. ΓöéMemory              ΓöéHighest      ΓöéMedium memoryΓöéQuickest      Γöé
  1106. Γöéconsiderations      Γöémemory usage Γöéusage        Γöéallocation    Γöé
  1107. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1108.  
  1109.  
  1110. ΓòÉΓòÉΓòÉ 2.3. About Device Contexts ΓòÉΓòÉΓòÉ
  1111.  
  1112. Device contexts link presentation spaces to devices by converting 
  1113. device-independent presentation space information into device-dependent 
  1114. information.  This conversion occurs in the presentation driver, a low-level 
  1115. program that is transparent to the application.  A presentation driver is a 
  1116. device-driver code that converts the application commands into output commands 
  1117. specific for each output device. 
  1118.  
  1119. After creating a device context, it must be associated with a presentation 
  1120. space before the drawing (or primitives) can be printed or displayed.  When a 
  1121. presentation space and a device context are associated with each other, any 
  1122. output you direct to the presentation space is directed automatically at the 
  1123. device context and displayed on the physical device. For example, before you 
  1124. can draw a picture in a display window, the picture's graphics presentation 
  1125. space must be associated with the window's device context. 
  1126.  
  1127. Device contexts also give applications access to important device information 
  1128. such as screen dimensions or printer capabilities. 
  1129.  
  1130. As with presentation spaces, there are three types of device contexts: 
  1131.  
  1132. o Cached 
  1133. o Window 
  1134. o Normal. 
  1135.  
  1136.  
  1137. ΓòÉΓòÉΓòÉ 2.3.1. Cached Device Contexts ΓòÉΓòÉΓòÉ
  1138.  
  1139. A cached device context is 1 that already is associated with a cached 
  1140. presentation space when that space is obtained from the cache. 
  1141.  
  1142.  
  1143. ΓòÉΓòÉΓòÉ 2.3.2. Window Device Contexts ΓòÉΓòÉΓòÉ
  1144.  
  1145. Window device contexts are a special type, in that they are the only device 
  1146. contexts obtained with WinOpenWindowDC.  As their name implies, the output 
  1147. device they represent is a display window.  WinOpenWindowDC accepts a window 
  1148. handle as input, and returns the window device context handle.  The window 
  1149. device context handle can then be associated with a standard micro presentation 
  1150. space or a normal presentation space. 
  1151.  
  1152. The window device context is closed automatically when its associated window is 
  1153. deleted. 
  1154.  
  1155.  
  1156. ΓòÉΓòÉΓòÉ 2.3.3. Normal Device Contexts ΓòÉΓòÉΓòÉ
  1157.  
  1158. A normal device context (also called a standard or noncached device context) 
  1159. links a presentation space with any nonwindow output device.  Use DevOpenDC to 
  1160. obtain a device context handle to 1 of 6 normal device contexts listed in the 
  1161. following table. Each of the 6 normal device contexts must be closed by 
  1162. DevCloseDC before your application is closed. 
  1163.  
  1164. Normal Device Contexts 
  1165.  
  1166. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1167. ΓöéDC Type             ΓöéPurpose             ΓöéUsage               Γöé
  1168. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1169. ΓöéQueued              ΓöéLinks a presentationΓöéApplications use    Γöé
  1170. Γöé                    Γöéspace with a printerΓöéqueued device       Γöé
  1171. Γöé                    Γöéor plotter shared byΓöécontexts to offload Γöé
  1172. Γöé                    Γöémultiple            Γöéprinting control    Γöé
  1173. Γöé                    Γöéapplications sendingΓöéfrom the            Γöé
  1174. Γöé                    Γöéspooled print jobs  Γöéapplication.        Γöé
  1175. Γöé                    Γöéto the print queue. Γöé                    Γöé
  1176. Γöé                    ΓöéQueued device       Γöé                    Γöé
  1177. Γöé                    Γöécontexts store printΓöé                    Γöé
  1178. Γöé                    Γöéjobs by using a     Γöé                    Γöé
  1179. Γöé                    Γöéprogram called printΓöé                    Γöé
  1180. Γöé                    Γöéspooler, which keepsΓöé                    Γöé
  1181. Γöé                    Γöétrack of the order  Γöé                    Γöé
  1182. Γöé                    Γöéin which the jobs   Γöé                    Γöé
  1183. Γöé                    Γöéarrive at the       Γöé                    Γöé
  1184. Γöé                    Γöéprinter and in whichΓöé                    Γöé
  1185. Γöé                    Γöéthey are printed.   Γöé                    Γöé
  1186. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1187. ΓöéDirect              ΓöéLinks a presentationΓöéApplications        Γöé
  1188. Γöé                    Γöéspace with a printerΓöénormally do not use Γöé
  1189. Γöé                    Γöéor plotter, directlyΓöédirect device       Γöé
  1190. Γöé                    Γöébypassing the       Γöécontexts, unless    Γöé
  1191. Γöé                    Γöéspooler and print   Γöéthey are avoiding   Γöé
  1192. Γöé                    Γöéqueue.  A direct    Γöéthe queue (for      Γöé
  1193. Γöé                    Γöédevice context is   Γöésecurity reasons) orΓöé
  1194. Γöé                    Γöéused by the spooler Γöégoing directly to a Γöé
  1195. Γöé                    Γöéto process jobs as  Γöédedicated machine.  Γöé
  1196. Γöé                    Γöéthey are removed    Γöé                    Γöé
  1197. Γöé                    Γöéfrom the print      Γöé                    Γöé
  1198. Γöé                    Γöéqueue.              Γöé                    Γöé
  1199. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1200. ΓöéInformation         ΓöéLinks a presentationΓöéAn application can  Γöé
  1201. Γöé                    Γöéspace with a printerΓöéuse an information  Γöé
  1202. Γöé                    Γöéor plotter, directlyΓöédevice context with Γöé
  1203. Γöé                    Γöéenabling device     Γöélower memory        Γöé
  1204. Γöé                    Γöéinformation to be   Γöéoverhead, rather    Γöé
  1205. Γöé                    Γöéqueried, but        Γöéthan use a direct   Γöé
  1206. Γöé                    Γöéproducing no output Γöédevice context,     Γöé
  1207. Γöé                    Γöéon the device.      Γöéwhich could provide Γöé
  1208. Γöé                    Γöé                    Γöéthe same            Γöé
  1209. Γöé                    Γöé                    Γöéinformation.        Γöé
  1210. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1211. ΓöéMemory              ΓöéLinks a presentationΓöéApplications use    Γöé
  1212. Γöé                    Γöéspace with a bit    Γöémemory device       Γöé
  1213. Γöé                    Γöémap.                Γöécontexts for drawingΓöé
  1214. Γöé                    Γöé                    Γöéto the bit map and  Γöé
  1215. Γöé                    Γöé                    Γöéusing it as a sourceΓöé
  1216. Γöé                    Γöé                    Γöéor target of BitBlt Γöé
  1217. Γöé                    Γöé                    Γöéoperations.         Γöé
  1218. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1219. ΓöéMetafile            ΓöéA special device    ΓöéOnly applications   Γöé
  1220. Γöé                    Γöécontext that enablesΓöéthat use metafiles  Γöé
  1221. Γöé                    Γöéa picture output to Γöéuse metafile device Γöé
  1222. Γöé                    Γöéits associated      Γöécontexts.           Γöé
  1223. Γöé                    Γöépresentation space  Γöé                    Γöé
  1224. Γöé                    Γöéto be recorded in a Γöé                    Γöé
  1225. Γöé                    Γöémetafile for        Γöé                    Γöé
  1226. Γöé                    Γöéinterchange for     Γöé                    Γöé
  1227. Γöé                    Γöéfuture use.         Γöé                    Γöé
  1228. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1229. ΓöéMetafile_NoQuery    ΓöéFunctionally        ΓöéIf attributes of theΓöé
  1230. Γöé                    Γöéidentical to        Γöépresentation space  Γöé
  1231. Γöé                    Γöémetafile; however,  Γöéare not to be       Γöé
  1232. Γöé                    Γöéquerying of         Γöéqueried, this deviceΓöé
  1233. Γöé                    Γöépresentation space  Γöécontext offers      Γöé
  1234. Γöé                    Γöéattributes is not   Γöéimproved performanceΓöé
  1235. Γöé                    Γöéallowed.            Γöéover metafile.      Γöé
  1236. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1237.  
  1238.  
  1239. ΓòÉΓòÉΓòÉ 2.4. Using Device Contexts ΓòÉΓòÉΓòÉ
  1240.  
  1241. In addition to associating or disassociating presentation spaces with device 
  1242. contexts, you can use device context functions to: 
  1243.  
  1244. o Obtain or create a device context 
  1245. o Associate a device context with a presentation space 
  1246. o Close a device context 
  1247. o Retrieve information about a device's capabilities. 
  1248.  
  1249. See Associating a Presentation Space for details on associating and 
  1250. disassociating device contexts and presentation spaces. 
  1251.  
  1252.  
  1253. ΓòÉΓòÉΓòÉ 2.4.1. Creating a Device Context ΓòÉΓòÉΓòÉ
  1254.  
  1255. You can create a normal device context by calling DevOpenDC.  This function 
  1256. requires that you specify 1 of the 5 normal types.  It also requires that you 
  1257. pass certain device-initialization data, including a logical address, the 
  1258. device-driver name, device-driver data, a description of the device type, and 
  1259. information about the queue (if the device is a queued device).  The 
  1260. device-initialization data is passed in a DEVOPENSTRUC structure. 
  1261.  
  1262. The following figure is an example of this structure. 
  1263.  
  1264.     typedef struct _DEVOPENSTRUC {   /* dop                          */
  1265.         PSZ      pszLogAddress       /* Logical-device address       */
  1266.         PSZ      pszDriverName       /* Device-driver name           */
  1267.         PDRIVDATA  pdriv             /* Pointer to extra driver data */
  1268.         PSZ      pszDataType         /* Type of queued data          */
  1269.         PSZ      pszComment          /* Optional spooler info        */
  1270.         PSZ      pszQueueProcName    /* Queue-processor name         */
  1271.         PSZ      pszQueueProcParams  /* Queue-processor arguments    */
  1272.         PSZ      pszSpoolerParams    /* Spooler arguments            */
  1273.         PSZ      pszNetworkParams    /* Network arguments            */
  1274.     } DEVOPENSTRUC;
  1275.  
  1276. DEVOPENSTRUC Structure 
  1277.  
  1278. The last four fields in this structure apply only to queued devices. 
  1279.  
  1280. The following figure shows how to create a nondisplay device context for a 
  1281. printer. 
  1282.  
  1283.  
  1284.     HDC hdcPrinter;                     /* Handle of printer device context    */
  1285.     HAB hab;                            /* Anchor-block handle                 */
  1286.     DEVOPENSTRUC dop;                   /* Device information                  */
  1287.  
  1288.     dop.pszLogAddress = "lpt1";         /* Logical-device address              */
  1289.     dop.pszDriverName = "EPSON";        /* Device-driver name                  */
  1290.     dop.pdriv = (PDRIVDATA) NULL;       /* Pointer to driver data              */
  1291.     dop.pszDataType = "PM_Q_STD";       /* Standard queued data                */
  1292.  
  1293.     hdcPrinter = DevOpenDC(hab,
  1294.                            OD_DIRECT,   /* Direct device type                  */
  1295.                            "*",         /* No data in OS2.INI                  */
  1296.                            4,           /* Use first 4 fields in dop structure */
  1297.                            (PDEVOPENDATA) &dop,
  1298.                            (HDC) NULL);
  1299.  
  1300. Creating a Printer Device Context 
  1301.  
  1302. The following figure is an example of how to create a standard device context 
  1303. for a metafile. 
  1304.  
  1305.  
  1306.     HDC hdcMeta;                                 /* Handles of metafile       */
  1307.                                                  /*    and window DCs         */
  1308.     HAB hab;                                     /* Anchor-block handle       */
  1309.     DEVOPENSTRUC dop;                            /* Device information        */
  1310.  
  1311.     dop.pszLogAddress = NULL;                    /* Logical-device address    */
  1312.     dop.pszDriverName = "DISPLAY";               /* Device-driver name        */
  1313.  
  1314.     hdcMeta = DevOpenDC(hab,
  1315.                         OD_METAFILE,             /* Metafile DC               */
  1316.                         "*",                     /* No data in OS2.INI        */
  1317.                         2,                       /* Use first 2 fields in dop */
  1318.                         (PDEVOPENDATA) &dop,     /* Structure for system info */
  1319.                         NULL)                    /* Compatible with screen    */
  1320.  
  1321. Creating a Metafile Device Context 
  1322.  
  1323.  
  1324. ΓòÉΓòÉΓòÉ 2.4.2. Associating Presentation Spaces with Device Contexts ΓòÉΓòÉΓòÉ
  1325.  
  1326. Drawing graphic objects requires a presentation space and a device context to 
  1327. direct output to a specific instance of an output device, such as a display 
  1328. window or a printer. This association enables the device context to identify 
  1329. the output device for that presentation space. Further, the device context 
  1330. identifies the particular instance of the output device, such as a printer or 
  1331. display window. 
  1332.  
  1333. A presentation space can be associated with only one device context at a time; 
  1334. the reverse is also true:  a device context can be associated with only one 
  1335. presentation space at a time. 
  1336.  
  1337. The following figure shows how a presentation space is associated with a window 
  1338. device context. It is then disassociated from the window device context and 
  1339. associated with a printer device context. It cannot be associated with both 
  1340. device contexts simultaneously. 
  1341.  
  1342.     WM_Create:
  1343.          hdcScreen = WinOpenWindowsDC (hwnd);
  1344.          phs = GpiCreatePS (...GPIA.Assoc);
  1345.           .
  1346.           .
  1347.           .
  1348.  
  1349.     WM_COMMAD:
  1350.  
  1351.       Case IDM_File PRINT:                       /* Device selection        */
  1352.          hdcPrinter = DevOpenDC (...);
  1353.          GpiAssociate (hps, NULL);               /* Disconnect from screen  */
  1354.          GpiAssociate (hps, hdcPrinter);         /* Connect to printer      */
  1355.           .
  1356.           .                                      /* Output                  */
  1357.           .
  1358.          GpiAssociate (hps, NULL);               /* Disconnect from print   */
  1359.          GpiAssociate (hps, hdcScreen);          /* Reconnect to screen     */
  1360.           .
  1361.           .
  1362.           .
  1363.  
  1364.     WM_PAINT:
  1365.          WinBeginPaint (hwnd, hps, NULL);
  1366.           .
  1367.           .                                      /* Output                  */
  1368.           .
  1369.  
  1370.  
  1371. Associating, Disassociating, and Reassociating a Presentation Space 
  1372.  
  1373. The following figure shows how to open a window device context and associate it 
  1374. with a normal presentation space. 
  1375.  
  1376.     HDC hdcWin;            /* Window device-context handle     */
  1377.     HPS hpsWin;            /* Normal-presentation-space handle */
  1378.     HWND hwndClient;       /* Client-window handle             */
  1379.     HAB hab;               /* Anchor-block handle              */
  1380.     SIZEL sizlPage;        /* Presentation page                */
  1381.  
  1382.     hdcWin = WinOpenWindowDC(hwndClient);
  1383.     hpsWin = GpiCreatePS(hab, hdcWin, &sizlPage,
  1384.                          PU_LOENGLISH | GPIA_ASSOC);
  1385.  
  1386.  
  1387. Associating a Cached Device Context with a Normal Presentation Space 
  1388.  
  1389. Note:  This type of code is used when the device context is defined before the 
  1390.        presentation space. 
  1391.  
  1392. WinOpenWindowDC can be called only once for a particular window and returns an 
  1393. error if called a second time. WinQueryWindowDC can be used to obtain a window 
  1394. device context previously allocated using WinOpenWindowDC. The following figure 
  1395. shows how to create a presentation space with page units of 0.01 inch 
  1396. (PU_LOENGLISH) and associate it with a printer device context. As input to 
  1397. GpiCreatePS, you supply the height and width of the presentation page. 
  1398.  
  1399.  
  1400.     HAB hab;          /* Anchor-block handle         */
  1401.     HPS hpsPrinter;   /* Presentation-space handle   */
  1402.     HDC hdcPrinter;   /* Device-context handle       */
  1403.     SIZEL sizlPage;   /* Page structure              */
  1404.     .
  1405.     .
  1406.     .
  1407.     hpsPrinter = GpiCreatePS(hab, hdcPrinter, &sizlPage,
  1408.        PU_LOENGLISH | GPIA_ASSOC);
  1409.  
  1410.  
  1411. Creating a Normal Presentation Space 
  1412.  
  1413.  
  1414. ΓòÉΓòÉΓòÉ 2.4.3. Closing a Device Context ΓòÉΓòÉΓòÉ
  1415.  
  1416. To close a device context that your application opened with DevOpenDC, call 
  1417. DevCloseDC.  However, you should not try to close a device context that you 
  1418. opened with WinOpenWindowDC. The operating system does automatically when the 
  1419. associated window is deleted. 
  1420.  
  1421.  
  1422. ΓòÉΓòÉΓòÉ 2.4.4. Determining Device Capabilities ΓòÉΓòÉΓòÉ
  1423.  
  1424. Once you have created a device context for a particular output device, you can 
  1425. determine the capabilities of that device by calling DevQueryCaps. This 
  1426. function retrieves the following information: 
  1427.  
  1428. o Device technology (whether the device is a raster or vector device) 
  1429. o Maximized window dimensions (if the device is a video display) 
  1430. o Page dimensions (if the device is a printer or plotter) 
  1431. o Character-box dimensions 
  1432. o Marker-box dimensions 
  1433. o Pel resolution 
  1434. o Color capabilities 
  1435. o Mix-mode capabilities. 
  1436.  
  1437. You can use this information, for example, to select fonts, set up the 
  1438. presentation page, or create a new logical color table. 
  1439.  
  1440.  
  1441. ΓòÉΓòÉΓòÉ 2.5. Summary ΓòÉΓòÉΓòÉ
  1442.  
  1443. The following table summarizes the presentation spaces and device contexts 
  1444. functions. 
  1445.  
  1446. Presentation Space and Device Context Functions 
  1447.  
  1448. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1449. ΓöéFunction Name           ΓöéDescription                         Γöé
  1450. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1451. ΓöéDevCloseDC              ΓöéCloses a device context that was    Γöé
  1452. Γöé                        Γöéopened by DevOpenDC.                Γöé
  1453. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1454. ΓöéDevOpenDC               ΓöéCreates a nondisplay device context.Γöé
  1455. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1456. ΓöéDevQueryCaps            ΓöéDetermines the capabilities of an   Γöé
  1457. Γöé                        Γöéoutput device.                      Γöé
  1458. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1459. ΓöéDevQueryHardcopyCaps    ΓöéDetermines the form (or paper size) Γöé
  1460. Γöé                        Γöéand related information of printers Γöé
  1461. Γöé                        Γöéand plotters.                       Γöé
  1462. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1463. ΓöéGpiAssociate            ΓöéAssociates the current presentation Γöé
  1464. Γöé                        Γöéspace with a device context.        Γöé
  1465. Γöé                        ΓöéDisassociates the current           Γöé
  1466. Γöé                        Γöépresentation space by passing a nullΓöé
  1467. Γöé                        Γöédevice context.                     Γöé
  1468. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1469. ΓöéGpiCreatePS             ΓöéCreates the specified type of       Γöé
  1470. Γöé                        Γöépresentation space.                 Γöé
  1471. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1472. ΓöéGpiDestroyPS            ΓöéDeletes a normal presentation space Γöé
  1473. Γöé                        Γöéor standard micro presentation spaceΓöé
  1474. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1475. ΓöéGpiMove                 ΓöéExplicitly sets the current         Γöé
  1476. Γöé                        Γöéposition.                           Γöé
  1477. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1478. ΓöéGpiQueryPS              ΓöéDetermines the size, units, and     Γöé
  1479. Γöé                        Γöéother options of a presentation     Γöé
  1480. Γöé                        Γöéspace.                              Γöé
  1481. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1482. ΓöéGpiResetPS              ΓöéResets the presentation space.      Γöé
  1483. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1484. ΓöéGpiRestorePS            ΓöéPops the contents of a saved        Γöé
  1485. Γöé                        Γöépresentation space off a stack.     Γöé
  1486. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1487. ΓöéGpiSavePS               ΓöéSaves items from the current        Γöé
  1488. Γöé                        Γöépresentation space onto an          Γöé
  1489. Γöé                        Γöéaccessible stack.                   Γöé
  1490. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1491. ΓöéGpiSetCurrentPosition   ΓöéExplicitly updates the current      Γöé
  1492. Γöé                        Γöéposition.                           Γöé
  1493. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1494. ΓöéGpiSetPS                ΓöéSets the presentation page size,    Γöé
  1495. Γöé                        Γöéunits, and format.                  Γöé
  1496. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1497. ΓöéWinBeginPaint           ΓöéAllocates a cached micro            Γöé
  1498. Γöé                        Γöépresentation space for WM_PAINT     Γöé
  1499. Γöé                        Γöéprocessing (if an existing          Γöé
  1500. Γöé                        Γöépresentation space is not being     Γöé
  1501. Γöé                        Γöéused) and establishes the update    Γöé
  1502. Γöé                        Γöéregion for the paint.               Γöé
  1503. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1504. ΓöéWinEndPaint             ΓöéReturns any cached micro            Γöé
  1505. Γöé                        Γöépresentation space to the cache, andΓöé
  1506. Γöé                        Γöésignals completion of the WM_PAINT  Γöé
  1507. Γöé                        Γöéprocessing.                         Γöé
  1508. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1509. ΓöéWinGetPS                ΓöéAllocates a cached micro            Γöé
  1510. Γöé                        Γöépresentation space from the cache.  Γöé
  1511. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1512. ΓöéWinGetScreenPS          ΓöéAllocates a cached micro            Γöé
  1513. Γöé                        Γöépresentation space from the cache   Γöé
  1514. Γöé                        Γöéfor the entire display screen.      Γöé
  1515. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1516. ΓöéWinOpenWindowDC         ΓöéCreates a device context for a      Γöé
  1517. Γöé                        Γöédisplay window.                     Γöé
  1518. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1519. ΓöéWinQuerySysValue        ΓöéCopies the size of the client area  Γöé
  1520. Γöé                        Γöéof the desktop window to the        Γöé
  1521. Γöé                        Γöépresentation page.                  Γöé
  1522. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1523. ΓöéWinQueryWindowDC        ΓöéDetermines the device context for a Γöé
  1524. Γöé                        Γöédisplay window when WinOpenWindowDC Γöé
  1525. Γöé                        Γöéhas been called previously.         Γöé
  1526. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1527. ΓöéWinReleasePS            ΓöéReturns a cached micro presentation Γöé
  1528. Γöé                        Γöéspace to the cache.                 Γöé
  1529. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1530.  
  1531. The following table summarizes the data structures used by the presentation 
  1532. space and device context functions. 
  1533.  
  1534. Presentation Space and Device Context Structures 
  1535.  
  1536. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1537. ΓöéStructure Name          ΓöéDescription                         Γöé
  1538. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1539. ΓöéDEVOPENSTRUC            ΓöéContains device-initializing data   Γöé
  1540. Γöé                        Γöéfor non-display device contexts.    Γöé
  1541. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1542. ΓöéSIZEL                   ΓöéSpecifies the dimensions of the     Γöé
  1543. Γöé                        Γöépresentation space's presentation   Γöé
  1544. Γöé                        Γöépage.                               Γöé
  1545. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1546.  
  1547.  
  1548. ΓòÉΓòÉΓòÉ 3. Line and Arc Primitives ΓòÉΓòÉΓòÉ
  1549.  
  1550. Line and arc primitives are graphics building blocks for creating pictures that 
  1551. consist of objects such as polygons, circles, fillets, ellipses, and other 
  1552. geometric figures. 
  1553.  
  1554. The following topics are related to the information in this chapter: 
  1555.  
  1556. o Presentation spaces 
  1557. o Device contexts 
  1558. o Color and mix attributes 
  1559. o Area primitives. 
  1560.  
  1561.  
  1562. ΓòÉΓòÉΓòÉ 3.1. About Line and Arc Primitives ΓòÉΓòÉΓòÉ
  1563.  
  1564. Simple drawing applications use line and arc primitives as drawing tools; they 
  1565. are useful, for example, in spreadsheet applications for constructing pie 
  1566. charts, bar charts, and graphs, as shown in the following figure. 
  1567.  
  1568. Sample Pie Chart Created with Line and Arc Primitives 
  1569.  
  1570. Following are more illustrations that were drawn using line and arc primitives. 
  1571.  
  1572. Sample Bar Graph Created with Line and Arc Primitives 
  1573.  
  1574. Computer-aided-design (CAD) applications combine line and arc primitives to 
  1575. draw such complex pictures as schematic diagrams for electrical wiring, 
  1576. blueprints for building sites, and cross-sectional views of machinery. 
  1577.  
  1578. Sample Blueprint Created with Line and Arc Primitives 
  1579.  
  1580. Line and arc primitives are actually two families of primitives that contain 
  1581. many variations of straight lines and curved lines, respectively.  They are 
  1582. presented together in this chapter because all the variations are governed by 
  1583. the attributes found in the data structure LINEBUNDLE. 
  1584.  
  1585. An application draws the line and arc primitives by first issuing GpiMove or 
  1586. GpiSetCurrentPosition, either of which sets the current position to a specified 
  1587. starting point.  GpiMove ignores the AM_PRESERVE mode; whereas 
  1588. GpiSetCurrentPosition saves the current position if the AM_PRESERVE mode is 
  1589. set.  The more sophisticated function, GpiPolyLineDisjoint, contains its own 
  1590. starting point and does not need to be preceded by GpiMove or 
  1591. GpiSetCurrentPosition. 
  1592.  
  1593. Prior to calling a line or arc function, the current position can be determined 
  1594. with GpiQueryCurrentPosition. 
  1595.  
  1596.  
  1597. ΓòÉΓòÉΓòÉ 3.1.1. Attributes of Line and Arc Primitives ΓòÉΓòÉΓòÉ
  1598.  
  1599. The attributes of the line and arc primitives contained in LINEBUNDLE are: 
  1600.  
  1601. o Line width 
  1602. o Geometric width 
  1603. o Line type 
  1604. o Line end 
  1605. o Line join 
  1606. o Line color 
  1607. o Line mix. 
  1608.  
  1609. The line end and line join attributes apply only to lines drawn in a primitive 
  1610. called a path. These attributes and paths themselves are explained in Paths. 
  1611.  
  1612. When an application creates a presentation space, the line and arc attributes 
  1613. are set to the default values shown in the following table. 
  1614.  
  1615. Line Attribute Default Values 
  1616.  
  1617. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1618. ΓöéAttribute      ΓöéDefault Value ΓöéFunction that Redefines        Γöé
  1619. Γöé               Γöé              ΓöéAttribute                      Γöé
  1620. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1621. ΓöéWidth          Γöé1.0           ΓöéGpiSetLineWidth                Γöé
  1622. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1623. ΓöéGeometric widthΓöéNone          ΓöéGpiSetLineWidthGeom            Γöé
  1624. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1625. ΓöéType           ΓöéLINETYPE_SOLIDΓöéGpiSetLineType                 Γöé
  1626. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1627. ΓöéColor          ΓöéCLR_NEUTRAL   ΓöéGpiSetAttrs (LBB_COLOR)        Γöé
  1628. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1629. ΓöéMix attribute  ΓöéFM_OVERPAINT  ΓöéGpiSetAttrs (LBB_MIX_MODE)     Γöé
  1630. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1631.  
  1632.  
  1633. ΓòÉΓòÉΓòÉ 3.1.2. Line Width and Geometric Width ΓòÉΓòÉΓòÉ
  1634.  
  1635. The operating system defines two types of lines:  cosmetic and geometric, 
  1636. representing two separate concepts. 
  1637.  
  1638. Cosmetic lines represent the mathematical ideal of a line being an entity with 
  1639. only one dimension-length.  When cosmetic lines are drawn, they usually are 
  1640. only one pel wide. 
  1641.  
  1642. The line width attribute provides a visual method of distinguishing different 
  1643. types of lines. For example, on a map, roads might be drawn thicker than 
  1644. railroad tracks. The line width attribute defines a multiplier to be applied to 
  1645. the normal (or default) line width. Your application can determine the cosmetic 
  1646. line width by calling GpiQueryLineWidth. 
  1647.  
  1648. There are certain devices that do not define the thickness of cosmetic lines in 
  1649. terms of a number of pels.  The PM interface interprets the specified width for 
  1650. these devices as shown in the following table: 
  1651.  
  1652. Line-Width Attributes as Interpreted by PM 
  1653.  
  1654. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1655. ΓöéIdentifer               ΓöéDescription                         Γöé
  1656. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1657. ΓöéLINEWIDTH_DEFAULT       ΓöéThe default width for the device.   Γöé
  1658. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1659. ΓöéLINEWIDTH_NORMAL        ΓöéThe line width equivalent to a      Γöé
  1660. Γöé                        Γöémultiplier of 1.  Identical to      Γöé
  1661. Γöé                        ΓöéLINEWIDTH_DEFAULT unless changed    Γöé
  1662. Γöé                        Γöéwith GpiSetDefAttrs.                Γöé
  1663. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1664. ΓöéLINEWIDTH_THICK         ΓöéThe line width equivalent to a      Γöé
  1665. Γöé                        Γöémultiplier greater than 1.          Γöé
  1666. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1667.  
  1668. Your application can set the cosmetic line width with either a multiplier or an 
  1669. identifier value using GpiSetLineWidth.  Since the line represents a widthless 
  1670. ideal, the actual drawn width is a fixed value.  The line width remains 
  1671. unchanged when you increase the size of, or zoom in on, a graphics object.  The 
  1672. cosmetic line width is not subject to transformations. 
  1673.  
  1674. In contrast, geometric lines represent an area whose thickness is equal to the 
  1675. specified line width.  Geometric lines are subject to changes in scale through 
  1676. transformations, in the same manner as geometric figures. 
  1677.  
  1678. The width of a geometric line does not have a default value.  Width is treated 
  1679. as a line attribute for programming convenience, but it actually is a geometric 
  1680. property.  A line width is set with GpiSetLineWidthGeom; if a width is already 
  1681. specified, that width can be determined with GpiQueryLineWidthGeom. 
  1682.  
  1683. To use geometric line width, the lines are assembled into a path. When you use 
  1684. a path to define wide lines, you can specify the following: 
  1685.  
  1686. o Geometric width for the lines, using the geometric line width attribute, 
  1687. o Style of the line ends, using the line end attribute 
  1688. o Style of the junctions of the lines, using the line join attribute. 
  1689.  
  1690. These three attributes apply only to geometric lines drawn using paths. 
  1691.  
  1692.  
  1693. ΓòÉΓòÉΓòÉ 3.1.3. Line Types ΓòÉΓòÉΓòÉ
  1694.  
  1695. Line type, also called line style, defines the way a line or arc is drawn:  as 
  1696. a solid line, a series of dashes, a series of dots, or a combination of dashes 
  1697. and dots. 
  1698.  
  1699. The line type for all subsequent line primitives is selected using 
  1700. GpiSetLineType.  If you want to change the line type to LINETYPE_DOT, for 
  1701. example, any line or arc primitive subsequently drawn is drawn as a dotted 
  1702. line. The following table illustrates the nine standard line types provided by 
  1703. PM. 
  1704.  
  1705. Note:  You cannot define other line types for PM applications. 
  1706.  
  1707. Standard Line Types 
  1708.  
  1709. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1710. ΓöéType                    ΓöéIdentifer               ΓöéLong Value  Γöé
  1711. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1712. ΓöéDotted line             ΓöéLINETYPE_DOT            Γöé1L          Γöé
  1713. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1714. ΓöéShort-dashed line       ΓöéLINETYPE_SHORTDASH      Γöé2L          Γöé
  1715. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1716. ΓöéDash-dot line           ΓöéLINETYPE_DASHDOT        Γöé3L          Γöé
  1717. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1718. ΓöéDouble-dotted line      ΓöéLINETYPE_DOUBLEDOT      Γöé4L          Γöé
  1719. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1720. ΓöéLong-dashed line        ΓöéLINETYPE_LONGDASH       Γöé5L          Γöé
  1721. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1722. ΓöéDash-double-dot line    ΓöéLINETYPE_DASHDOUBLEDOT  Γöé6L          Γöé
  1723. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1724. ΓöéSolid line              ΓöéLINETYPE_SOLID          Γöé7L          Γöé
  1725. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1726. ΓöéInvisible line          ΓöéLINETYPE_INVISIBLE      Γöé8L          Γöé
  1727. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1728. ΓöéAlternate pels on       ΓöéLINETYPE_ALTERNATE      Γöé9L          Γöé
  1729. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1730.  
  1731. The default line type (LINETYPE_DEFAULT) is identical to the LINETYPE_SOLID 
  1732. type, and has a long value of 0L.  The error line type (LINETYPE_ERROR) has a 
  1733. long value of -1L. The following figure illustrates the nine line types. Your 
  1734. application can determine the current line type using GpiQueryLineType. 
  1735.  
  1736. The Nine Line Types 
  1737.  
  1738.  
  1739. ΓòÉΓòÉΓòÉ 3.1.4. Line Color and Mix Attributes ΓòÉΓòÉΓòÉ
  1740.  
  1741. The color attribute defines the color used to draw a primitive or an object. 
  1742. The mix attribute determines how the color of a primitive or an object is 
  1743. combined with the color of the drawing surface, or any other objects on the 
  1744. surface. Both attributes also are described in Color and Mix Attributes. 
  1745.  
  1746. The line color defines the color used to draw the output from any of the 
  1747. operating system's line functions. When a presentation space is created, the 
  1748. line color initial default is black. Unlike certain other primitives, the line 
  1749. and arc primitives do not have a background color. The current color of the 
  1750. drawing surface automatically plays a greater role in the appearance of line 
  1751. and arc primitives than in those primitives that do have a background color. 
  1752. Specifically, when an application draws a dotted or dashed line, the color that 
  1753. appears between the dots or dashes is the current drawing-surface color, as 
  1754. shown in the following figure. 
  1755.  
  1756. Line and Arc Primitives 
  1757.  
  1758. Line and arc primitives have only a color attribute for the actual line. The 
  1759. mix attribute controls the combination of line color with drawing surface 
  1760. color. 
  1761.  
  1762. When a presentation space is created, the line mix attribute initial default is 
  1763. FM_OVERPAINT. The overpaint mix attribute specifies that the line color is not 
  1764. modified by the color of the drawing surface. If the line mix attribute is 
  1765. changed, the line color is mixed with colors that are already on the drawing 
  1766. surface. 
  1767.  
  1768. To specify a new color or mix attribute issue GpiSetAttrs. This function 
  1769. accepts as input the type of primitive, for example PRIM_LINE, a list of 
  1770. attributes that are to be changed, a list of attributes that are to be set to 
  1771. their default values, and the values for the attributes that are to be changed. 
  1772. GpiSetAttrs is useful for specify colors and mix attributes just for a specific 
  1773. data structure, for example the LINEBUNDLE structure. GpiSetAttrs also provides 
  1774. some protection against invalid colors as described in Presentation Manager 
  1775. Programming Reference. 
  1776.  
  1777. To determine the current line color and mix attribute issue GpiQueryAttrs. This 
  1778. function accepts as input the primitive type and the attributes in question. It 
  1779. returns as output an array of values for the specifically queried attributes. 
  1780.  
  1781. To reset the default line color and mix attribute, just as with any other 
  1782. attribute specified in the LINEBUNDLE data structure, issue GpiSetDefAttrs. 
  1783. This function accepts as input the type of primitive, for example PRIM_LINE, 
  1784. the attributes to be changed, and the values that will become the new default 
  1785. values. The changing of default values is important when working with segments, 
  1786. described in Creating and Drawing Retained Graphics and Editing Retained 
  1787. Graphics and Graphics Segments. Changing the default values during a series of 
  1788. drawing functions is not recommended. 
  1789.  
  1790. The line color and mix attribute also can be specified with GpiSetColor and 
  1791. GpiSetMix, respectively. However, those two functions have the disadvantage of 
  1792. specifying the color and mix attribute for all primitive xxxBUNDLE data 
  1793. structures that have a component for foreground color and foreground mix 
  1794. attribute. The queries, GpiQueryColor and GpiQueryMix, determine the color and 
  1795. mix attribute as specified by GpiSetColor and GpiSetMix. If the line color or 
  1796. mix attribute is specified individually, the aforementioned queries can return 
  1797. a value inconsistent with the current line color or mix attribute. 
  1798.  
  1799.  
  1800. ΓòÉΓòÉΓòÉ 3.1.5. Line Primitive Family ΓòÉΓòÉΓòÉ
  1801.  
  1802. The following table describes the three variants of the basic line primitive 
  1803. and the functions that draw them. 
  1804.  
  1805. Functions that Draw Straight Lines 
  1806.  
  1807. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  1808. ΓöéVariants    ΓöéFunction                ΓöéDescription                       Γöé
  1809. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1810. ΓöéLines       ΓöéGpiLine                 ΓöéDraws a single line from the      Γöé
  1811. Γöé            Γöé                        Γöécurrent position to a specified   Γöé
  1812. Γöé            Γöé                        Γöépoint.                            Γöé
  1813. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1814. ΓöéPolylines   ΓöéGpiPolyLine             ΓöéDraws a series of connected lines,Γöé
  1815. Γöé            Γöé                        Γöéfrom the current position through Γöé
  1816. Γöé            Γöé                        Γöésuccessive points.                Γöé
  1817. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1818. Γöé(series of  ΓöéGpiPolyLineDisjoint     ΓöéDraws a series of unconnected     Γöé
  1819. Γöélines)      Γöé                        Γöélines.                            Γöé
  1820. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  1821. ΓöéBoxes       ΓöéGpiBox                  ΓöéDraws a rectangular box with one  Γöé
  1822. Γöé            Γöé                        Γöécorner at the current position.   Γöé
  1823. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  1824.  
  1825. When the operating system draws a line, it includes the pels at the starting 
  1826. and ending points of the line.  The algorithm used to draw the rest of the line 
  1827. depends on the device driver.  For example, a driver for a raster device might 
  1828. use a modified Bresenham algorithm to draw a line; but a driver for a vector 
  1829. device, such as a plotter, simply would connect the starting and ending points 
  1830. of the line.  In all cases, the result is a line primitive that looks the same 
  1831. from device to device. 
  1832.  
  1833.  
  1834. ΓòÉΓòÉΓòÉ 3.1.5.1. Lines ΓòÉΓòÉΓòÉ
  1835.  
  1836. GpiLine draws a line from the current position to a specified end point, as 
  1837. shown in the following figure. After drawing the line, the current position is 
  1838. at the end point specified by GpiLine. 
  1839.  
  1840. GpiLine 
  1841.  
  1842. The current position is (4,3), and the specified end point of GpiLine is (9,7). 
  1843. When the line has been drawn, (9,7) becomes the current position. 
  1844.  
  1845. To draw a single point, you can issue GpiLine, with an end point identical to 
  1846. the current position, as shown in the following figure. The current position 
  1847. can be determined using GpiQueryCurrentPosition. 
  1848.  
  1849. GpiLine Used to Draw a Single Point 
  1850.  
  1851.  
  1852. ΓòÉΓòÉΓòÉ 3.1.5.2. Polylines ΓòÉΓòÉΓòÉ
  1853.  
  1854. GpiPolyLine draws a sequence of connected lines, starting at the current 
  1855. position and passing through a series of specified coordinate positions as 
  1856. shown in the following figure. After drawing the series of lines, the current 
  1857. position is at the end point of the last line specified by GpiPolyLine. 
  1858.  
  1859. If you are drawing a graph that has five connected lines, you can issue 
  1860. GpiPolyLine once rather than GpiLine five times.  GpiPolyLine accepts as input 
  1861. a number of points and an array of point coordinates. 
  1862.  
  1863. GpiPolyLine 
  1864.  
  1865. The starting position is (2,2), and the polyline is drawn through (4,4), (6,4), 
  1866. (8,6), and (10,3).  The new current position is (10,3). 
  1867.  
  1868. GpiPolyLineDisjoint is a new function that eliminates having to use a series of 
  1869. GpiMove and GpiLine functions to draw multiple lines that are not connected. 
  1870. GpiPolyLineDisjoint accepts as input an even number, the number of points, and 
  1871. an array of point coordinates.  The first point in a point-pair is the starting 
  1872. point; the second, the end point of that line segment.  Upon completion, the 
  1873. end point of the final line becomes the current position. The following figure 
  1874. shows the results of a GpiPolyLineDisjoint call. 
  1875.  
  1876. GpiPolylineDisjoint 
  1877.  
  1878. A graph with discontinuities. 
  1879.  
  1880.  
  1881. ΓòÉΓòÉΓòÉ 3.1.5.3. Boxes ΓòÉΓòÉΓòÉ
  1882.  
  1883. At its simplest, GpiBox draws a rectangular box with one corner at the current 
  1884. position and the diagonally-opposite corner at a position that you specify. 
  1885. The sides of the box are parallel to the x- and y-axes.  Like GpiPolyLine, 
  1886. GpiBox lets you draw a number of connected lines using a single function rather 
  1887. than four separate GpiLine functions.  The current position is unchanged by 
  1888. GpiBox. 
  1889.  
  1890. Note:  The start and end position of any closed shape are always the same; 
  1891.        therefore, the current position is unchanged after drawing a closed 
  1892.        figure. 
  1893.  
  1894. The GpiBox primitive is shown in the following figure. 
  1895.  
  1896. The Box 
  1897.  
  1898. The current position is (3,2) and the corner position is at (8,6).  When the 
  1899. box has been drawn, the current position remains at (3,2). 
  1900.  
  1901. In addition to the corner position, GpiBox accepts as input an option for 
  1902. rounded corners and for filled interior.  The PM programming interface rounds 
  1903. the corners of a box by drawing an elliptical section in place of the square 
  1904. corner.  Two long values, IHRound and IVRound, represent the horizontal and 
  1905. vertical length of the full axis of the ellipse used to round each corner.  If 
  1906. the two values are equal, a quarter-circle is used for the rounding.  If the 
  1907. two values are 0, no rounding is performed. The following figure shows an 
  1908. example of rounding corners using a quarter-circle. 
  1909.  
  1910. Quarter-Circle Box-Corner Rounding 
  1911.  
  1912. The current position is (20,20).  GpiBox is issued with a corner position of 
  1913. (65,60) and an identical vertical and horizontal rounding value of 26. 
  1914.  
  1915. The following figure shows the complete result. The intermediate steps are not 
  1916. visible to the user of your application. 
  1917.  
  1918. Box with Rounded Corners 
  1919.  
  1920. All four corners are rounded with identical values. 
  1921.  
  1922. Since GpiBox can be used to define a closed figure, it also accepts as input a 
  1923. long value signifying a filled interior.  The long value, IControl can be any 
  1924. of the following: 
  1925.  
  1926. Value               Description 
  1927.  
  1928. DRO_OUTLINE         Draw the box only. 
  1929.  
  1930. DRO_FILL            Fill the box interior only. 
  1931.  
  1932. DRO_OUTLINEFILL     Draw the box and fill its interior. 
  1933.  
  1934. The pattern that fills the interior and other drawing options are controlled by 
  1935. the data structure AREABUNDLE.  Areas are described in Area and Polygon 
  1936. Primitives. GpiFullArc is the only other line and arc primitive that can be 
  1937. used to define a closed figure. 
  1938.  
  1939.  
  1940. ΓòÉΓòÉΓòÉ 3.1.6. Attributes of Arc Primitives ΓòÉΓòÉΓòÉ
  1941.  
  1942. The arc primitive shares width, type, and color and mix attributes with line 
  1943. primitives.  For example, if you issue GpiSetLineType to change the line type 
  1944. to LINETYPE_DASHDOT, all subsequent arcs are drawn with a dash-dot line.  In 
  1945. addition to the line attributes defined in the LINEBUNDLE data structure, arc 
  1946. primitives in the simple-arc family are influenced by the values in the 
  1947. ARCPARAMS data structure.  Arc primitives in the multiple-arc family have a 
  1948. different method of construction and are not influenced by ARCPARAMS. 
  1949.  
  1950. In terms of geometrical pictures, the simple arcs contain full or partial: 
  1951.  
  1952. Circles        Closed curves whose center is equidistant from every point on 
  1953.                the curve. 
  1954.  
  1955. Ellipses       Closed curves defined by two fixed points such that the sum of 
  1956.                the distances from any point on the curve to the two fixed 
  1957.                points is constant. 
  1958.  
  1959. Multiple arcs contain: 
  1960.  
  1961. Fillets        Curves that are tangential to the two lines defined by three 
  1962.                control points. 
  1963.  
  1964. Splines        Curves that, given four control points, are tangent to the first 
  1965.                and last of three intersecting lines. 
  1966.  
  1967. There are three simple arc operations that begin with a unit circle that lies 
  1968. at the origin of world coordinate space.  This unit circle defines the current 
  1969. arc on which subsequent full, partial, and 3-point arcs are based.  Your 
  1970. application can define the following attributes of the current arc with 
  1971. GpiSetArcParams: 
  1972.  
  1973. o Shape 
  1974. o Orientation 
  1975. o Size 
  1976. o Drawing direction. 
  1977.  
  1978. GpiSetArcParams accepts as input a ARCPARAMS data structure that has four 
  1979. parameters (p, q, r, and s). Of the four: 
  1980.  
  1981. o p scales in the x-direction 
  1982. o q scales in the y-direction 
  1983. o r and s are shear components 
  1984.  
  1985. The mathematical origins of the parameters are illustrated in the following 
  1986. figure. 
  1987.  
  1988. The ARCPARAMS Values in World Coordinates 
  1989.  
  1990. The values were derived from the major and minor axis of an ellipse. 
  1991.  
  1992. An application can determine the current arc parameters with GpiQueryArcParams, 
  1993. which copies the current arc parameters to their corresponding fields in the 
  1994. supplied ARCPARAMS structure.  The application can set the arc parameters with 
  1995. GpiSetArcParams.  This function accepts as input a copy of the ARCPARAMS 
  1996. structure that contains the new arc parameters.  The default values of p, q, r, 
  1997. and s, unless changed by GpiSetDefArcParams, define a unit circle: 
  1998.  
  1999. o p and q are 1 
  2000. o r and s are 0. 
  2001.  
  2002. The arc parameters define a transformation that is applied to each point on the 
  2003. perimeter of the unit circle.  For any point (x,y) on the perimeter of the unit 
  2004. circle, there exists a new point (x',y'), as determined by the following two 
  2005. linear equations: 
  2006.  
  2007. x' = p x x + r x y
  2008. y' = s x x + q x y
  2009.  
  2010. These parameters form a 2-by-2 matrix, 
  2011.  
  2012.  
  2013. Γöî      ΓöÉ
  2014. Γöé p  r Γöé
  2015. Γöé s  q Γöé
  2016. Γöö      Γöÿ
  2017.  
  2018. that scales and shears simple arcs. 
  2019.  
  2020. Note:  This transformation matrix is not related to the general transformation 
  2021.        functions that move objects through coordinate spaces.  It is a special 
  2022.        purpose matrix that transforms the shape and size of the imaginary unit 
  2023.        circle.  The transformed unit circle, also called the current arc, is 
  2024.        then used to define the shape and size of the simple arc functions in 
  2025.        world coordinates. 
  2026.  
  2027. After an arc has been described in world coordinates, it can be transformed 
  2028. with the transformation functions, just as any other primitive can. 
  2029.  
  2030. For detailed information about transformations and their use, see Coordinate 
  2031. Spaces and Transformations. 
  2032.  
  2033. A transformation is orthogonal when: 
  2034.  
  2035. (p x r) + (s x q) = 0
  2036.  
  2037. If orthogonal, the line from the origin (0,0) to the point (p,s) is either: 
  2038.  
  2039. o The radius of a circle 
  2040. o Half the major or minor axis of an ellipse; 
  2041.  
  2042. and, the line from the origin to the point (r,q) is either: 
  2043.  
  2044. o The radius of a circle 
  2045. o Half the minor or major axis of an ellipse. 
  2046.  
  2047. An orthogonal transformation does not guarantee that the shape of an object as 
  2048. defined by an application will be the same as the shape of the object on the 
  2049. output device.  For example, if the page units in the application are PU_PELS, 
  2050. and the pels on the device are rectangular (but not square), calling GpiFullArc 
  2051. produces an ellipse-not a circle- even when the arc parameters are set to their 
  2052. default values. 
  2053.  
  2054. The product of the 2-by-2 matrix multiplication influences the direction of any 
  2055. arc based on the current arc, except a 3-point arc. The following table 
  2056. illustrates this directional influence. 
  2057.  
  2058. Direction of the Arc 
  2059.  
  2060. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2061. ΓöéIf...                         ΓöéGpiFullArc and                Γöé
  2062. Γöé                              ΓöéGpiPartialArc...              Γöé
  2063. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2064. Γöé(p x q) is greater than (r x  ΓöéDraw the ellipse              Γöé
  2065. Γöés)                            Γöécounterclockwise.             Γöé
  2066. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2067. Γöé(p x q) is less than (r x s)  ΓöéDraw the ellipse clockwise.   Γöé
  2068. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2069. Γöé(p x q) equals (r x s)        ΓöéDraw a straight line rather   Γöé
  2070. Γöé                              Γöéthan an ellipse.              Γöé
  2071. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2072.  
  2073.  
  2074. ΓòÉΓòÉΓòÉ 3.1.7. Simple-Arc Primitive Family ΓòÉΓòÉΓòÉ
  2075.  
  2076. The following table describes the three variants of a simple-arc primitive and 
  2077. the functions that draw them. All are defined, to some extent, by the current 
  2078. arc parameters. As with line primitives, an application draws simple-arcs by 
  2079. first issuing GpiMove or GpiSetCurrentPosition to set the current position. 
  2080.  
  2081. Functions that Draw Simple Arcs 
  2082.  
  2083. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2084. ΓöéVariants    ΓöéFunction      ΓöéDescription                       Γöé
  2085. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2086. ΓöéFull arcs   ΓöéGpiFullArc    ΓöéDraws a circle or an ellipse.     Γöé
  2087. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2088. ΓöéPartial arcsΓöéGpiPartialArc ΓöéDraws a straight line followed by Γöé
  2089. Γöé            Γöé              Γöéa section of a circle or ellipse. Γöé
  2090. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2091. Γöé3-point arcsΓöéGpiPointArc   ΓöéDraws an arc through three points.Γöé
  2092. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2093.  
  2094.  
  2095. ΓòÉΓòÉΓòÉ 3.1.7.1. Full Arcs ΓòÉΓòÉΓòÉ
  2096.  
  2097. GpiFullArc draws a complete circle or ellipse with its center at the current 
  2098. position.  The current position remains unchanged.  Whether GpiFullArc draws a 
  2099. circle or an ellipse depends on the current arc parameters.  When the current 
  2100. arc is a circle, GpiFullArc draws a circle; when it is an ellipse, GpiFullArc 
  2101. draws an ellipse. 
  2102.  
  2103.  
  2104. ΓòÉΓòÉΓòÉ 3.1.7.1.1. Defining an Ellipse ΓòÉΓòÉΓòÉ
  2105.  
  2106.  
  2107. To define an ellipse as the current arc, issue GpiSetArcParams on which the 
  2108. values (p,s) and (r,q) are the world coordinates of the end points of the major 
  2109. and minor axes of the ellipse.  For example, current arc parameters of (18,0) 
  2110. and (0,10) define an ellipse with a major axis of 36 coordinate units and a 
  2111. minor axis of 20 coordinate units. The resultant ellipse is shown in the 
  2112. following figure. 
  2113.  
  2114. The Ellipse 
  2115.  
  2116. For maximum accuracy, create the axes of an ellipse so that they are at 
  2117. right-angles to each other.  You can check this by ensuring that the following 
  2118. equation is always true: 
  2119.  
  2120. p x r + s x q = 0 
  2121.  
  2122. So, to check the above example: 
  2123.  
  2124. 0 x 18 + 10 x 0 = 0 
  2125.  
  2126. You also can define a tilted ellipse as the current arc. None of the current 
  2127. arc parameters for a tilted ellipse will be 0, though you should still ensure 
  2128. that the axes of the ellipse are at right-angles to each other. The following 
  2129. figure shows a tilted ellipse defined with current arc parameters of (8,6) and 
  2130. (-3,4). 
  2131.  
  2132. Tilted Ellipse 
  2133.  
  2134.  
  2135. ΓòÉΓòÉΓòÉ 3.1.7.1.2. Defining a Circle ΓòÉΓòÉΓòÉ
  2136.  
  2137.  
  2138. To define a circle as the current arc, (r,q) and (p,s) can be any such value 
  2139. that they lie on a circle.  For example, if (r,q) and (p,s) are set to (-4, 3) 
  2140. (3,4), the current arc is a circle with a radius of 5 coordinate units.  For 
  2141. simplicity, a circle can be defined by specifying current arc parameters where 
  2142. p is the radius of the circle, and p = q, r = 0, and s = 0. For example, to 
  2143. define a circle centered on the origin and with a radius of 10 world-coordinate 
  2144. units, issue GpiSetArcParams with the values (0,10) (10,0). 
  2145.  
  2146. The default values of the current arc parameters are (0,1) (1,0), which define 
  2147. a circle with a radius of one world-coordinate unit (a unit circle). 
  2148.  
  2149.  
  2150. ΓòÉΓòÉΓòÉ 3.1.7.1.3. GpiFullArc Input Parameters ΓòÉΓòÉΓòÉ
  2151.  
  2152.  
  2153. GpiFullArc accepts as input a multiplier value, so that the size of the full 
  2154. arc is increased or decreased in relation to the current arc.  For example, if 
  2155. the current arc parameters define an ellipse whose major axis is 20 coordinate 
  2156. units and whose minor axis is 8 coordinate units, a multiplier of 2 in 
  2157. GpiFullArc creates an ellipse whose major axis is 40 coordinate units and whose 
  2158. minor axis is 16 coordinate units. 
  2159.  
  2160. Because the arc parameters are integers when a fraction is required, for 
  2161. example when rotating an ellipse, greater precision can be obtained by scaling 
  2162. up the required arc parameter values as much as possible, then using a 
  2163. multiplier smaller than 1 to scale the ellipse back down to the required size. 
  2164.  
  2165. With the default arc parameters defining a circle of 1 world coordinate unit, 
  2166. you can draw a circle of any size by allowing the arc parameters to default, 
  2167. then specifying the radius of the circle with the GpiFullArc multiplier.  For 
  2168. example, to draw a circle with a radius of 12 coordinate units, issue 
  2169. GpiFullArc with a multiplier of 12 and allow the GpiSetArcParams to default. 
  2170. Since GpiFullArc, like GpiBox, can be used to define a closed figure, it also 
  2171. accepts as input a long value signifying a filled interior.  The long value, 
  2172. IControl can be: 
  2173.  
  2174. Value               Description 
  2175.  
  2176. DRO_OUTLINE         Draw the arc only. 
  2177.  
  2178. DRO_FILL            Fill the arc interior only. 
  2179.  
  2180. DRO_OUTLINEFILL     Draw the arc and fill its interior. 
  2181.  
  2182. The pattern that fills the interior and other drawing options are controlled by 
  2183. the data structure AREABUNDLE.  See Area and Polygon Primitives for detailed 
  2184. information on using areas. 
  2185.  
  2186. The Full Arc 
  2187.  
  2188. (a) is a tilted ellipse that is defined by the current arc parameters.  (b) is 
  2189. drawn using GpiFullArc with: 
  2190.  
  2191. o A multiplier value that reduces the size of the arc relative to the current 
  2192.   arc 
  2193. o An IControl value filling the interior with the current area-fill pattern, 
  2194.   but not drawing the arc's outline. 
  2195.  
  2196.  
  2197. ΓòÉΓòÉΓòÉ 3.1.7.2. Partial Arcs ΓòÉΓòÉΓòÉ
  2198.  
  2199. A partial arc is a section of a full arc defined by the current arc parameters. 
  2200. To draw a partial arc, use GpiPartialArc, which draws two separate figures. 
  2201. The first figure is a straight line from the current position to the starting 
  2202. point of a partial arc, and the second figure is the partial arc itself.  When 
  2203. the arc has been drawn, the new current position is at the end point of the 
  2204. partial arc. 
  2205.  
  2206. GpiPartialArc accepts as input the center of the current full arc, of which the 
  2207. partial arc is a part, specified in world coordinates. You also can specify a 
  2208. multiplier value to increase or decrease the size of the partial arc in 
  2209. relation to the current full arc. 
  2210.  
  2211. You also must specify two positive fixed values: a start angle and a sweep 
  2212. angle.  If the current full arc is a circle, the start angle is measured 
  2213. counterclockwise from the x-axis of the circle.  The intersection of the start 
  2214. angle with the full arc, adjusted by the multiplier value, defines the starting 
  2215. point of the partial arc. 
  2216.  
  2217. The sweep angle continues the counterclockwise measurement, beginning where the 
  2218. start angle left off.  The intersection of the sweep angle with the full arc, 
  2219. adjusted by the multiplier value, defines the partial arc. 
  2220.  
  2221. If the current arc is not a circle, the start and sweep angle are skewed to the 
  2222. same degree that the ellipse is a skewed circle. The following figure shows how 
  2223. the partial arc is constructed. 
  2224.  
  2225. The Partial Arc 
  2226.  
  2227. A is the start angle; B, the sweep angle.  C is the center point; D, the 
  2228. current position.  Arc.EF is the partial arc.  F is the new current position. 
  2229.  
  2230. The inner circle in the previous figure is the arc defined by the current arc 
  2231. parameters.  A multiplier has been specified with GpiPartialArc, so the partial 
  2232. arc is based on the full arc described by the outer circle.  Point C is the 
  2233. center point specified on GpiPartialArc.  Angle A is the start angle, and angle 
  2234. B is the sweep angle.  GpiPartialArc therefore, draws a line from the current 
  2235. position (point D) to the start of the partial arc (point E). It also draws arc 
  2236. EF. Point F is the new current position.  The arc is drawn counterclockwise 
  2237. because the current arc parameters define a counterclockwise circle.  You can 
  2238. join points F and D with GpiLine.  This line is drawn automatically if you 
  2239. define the partial arc within a GpiBeginArea and GpiEndArea bracket. 
  2240.  
  2241.  
  2242. ΓòÉΓòÉΓòÉ 3.1.7.3. 3-Point Arcs ΓòÉΓòÉΓòÉ
  2243.  
  2244. GpiPointArc draws an arc from the current position through an intermediate 
  2245. point to an end point.  When the arc is drawn, the current position is at the 
  2246. end point of the arc.  You specify both the intermediate point and the end 
  2247. point, and these values determine both the size of the arc and the direction in 
  2248. which it is drawn.  The shape and the orientation of a 3-point arc are 
  2249. determined by the current arc parameters. The following figure shows how a 
  2250. 3-point arc is constructed. 
  2251.  
  2252. If the current arc parameters define an ellipse, that ellipse is scaled up or 
  2253. down to fit the 3 points of the arc. 
  2254.  
  2255. When you want the 3 points of the arc to be points on a circle, allow the 
  2256. current arc parameters to default so they define a unit circle.  You do not 
  2257. need to use the values p and q to specify the radius of the circle, because the 
  2258. radius is determined by the relative positions of the 3 points of the arc. 
  2259.  
  2260.  
  2261. ΓòÉΓòÉΓòÉ 3.1.8. Multiple-Arc Primitive Family ΓòÉΓòÉΓòÉ
  2262.  
  2263. The following table describes the three variants of the simple-arc primitive 
  2264. and the functions that draw them. As with line primitives, an application draws 
  2265. simple arcs by first issuing GpiMove or GpiSetCurrentPosition to set the 
  2266. current position.  The multiple arcs are the most sophisticated of the arc 
  2267. primitives and their construction does not depend on the current arc 
  2268. parameters. 
  2269.  
  2270. Functions that Draw Multiple-Arcs 
  2271.  
  2272. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2273. ΓöéVariants    ΓöéFunction                ΓöéDescription                       Γöé
  2274. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2275. ΓöéFillets     ΓöéGpiPolyFillet           ΓöéDraws one or more fillets.        Γöé
  2276. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2277. Γöé            ΓöéGpiPolyFilletSharp      ΓöéDraws one or more fillets with    Γöé
  2278. Γöé            Γöé                        Γöévarying degrees of sharpness.     Γöé
  2279. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2280. ΓöéSplines     ΓöéGpiPolySpline           ΓöéDraws one or more splines.        Γöé
  2281. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2282.  
  2283.  
  2284. ΓòÉΓòÉΓòÉ 3.1.8.1. Fillets ΓòÉΓòÉΓòÉ
  2285.  
  2286. GpiPolyFillet constructs a fillet (a curved line) made up of one or more arcs, 
  2287. each of which touches a different straight line.  You specify the end points of 
  2288. these straight lines with GpiPolyFillet.  The lines are not drawn but are used 
  2289. to construct the curve. 
  2290.  
  2291. The fillet starts at the current position and finishes at the end point of the 
  2292. last line. On the way from the start point to the end point, the fillet is 
  2293. tangential to all intermediate lines at their midpoints.  When the fillet is 
  2294. drawn, the current position is at the end point of the last construction line. 
  2295. The following figure is an example of how a fillet is constructed. 
  2296.  
  2297. The Fillet 
  2298.  
  2299. The fillet starts at (2,6) and ends at (5,1).  The fillet is tangential to the 
  2300. midpoints of the lines from (2,8) to (6,9), from (6,9) to (9,5), and from (9,5) 
  2301. to (5,3). 
  2302.  
  2303. When you supply only two points, the construction lines of the fillet are drawn 
  2304. from the current position to the first point, and from the first point to the 
  2305. second point.  The fillet is drawn from the current position to the second 
  2306. point, and is tangential to the construction lines at those same points. 
  2307.  
  2308. GpiPolyFilletSharp creates a fillet on a series of connected construction 
  2309. lines.  The first fillet in the series is built using two construction lines: 
  2310. one drawn from the current position to point 1 (the control point), and one 
  2311. drawn from point 1 to point 2 (the end point).  The fillet is drawn from the 
  2312. current position to the end point, and is tangential to the two construction 
  2313. lines at those points. 
  2314.  
  2315. GpiPolyFilletSharp also accepts as input a sharpness value. Sharpness is a 
  2316. measure of the distance between the fillet and the control point, and is 
  2317. calculated as shown in the following figure. 
  2318.  
  2319. Fillet with Sharpness Specified 
  2320.  
  2321. Point A is the current position, point B is the control point, and point C is 
  2322. the end point.  W is the midpoint of the notional line AC.  D is the point at 
  2323. which the fillet crosses the notional line WB. 
  2324.  
  2325. The sharpness of the fillet is the value WD / DB.  The line WD is 10 coordinate 
  2326. units, and the line DB is 5 coordinate units; therefore the sharpness value is 
  2327. 2. The sharpness value defines the type of arc, as shown in the following 
  2328. table. 
  2329.  
  2330. Fillet Sharpness Values 
  2331.  
  2332. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2333. ΓöéA sharpness value of...       ΓöéDefines...                    Γöé
  2334. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2335. ΓöéGreater than 1.0              ΓöéA hyperbola                   Γöé
  2336. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2337. ΓöéEqual to 1.0                  ΓöéA parabola                    Γöé
  2338. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2339. ΓöéLess than 1.0                 ΓöéAn ellipse                    Γöé
  2340. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2341.  
  2342. Subsequent fillets start from the end point of the previous fillet, and are 
  2343. constructed using the next two lines in the sequence in exactly the same way. 
  2344. Thus, for each fillet you define one control point, one end point, and one 
  2345. sharpness value.  Upon completion, the current position is at the end point of 
  2346. the final construction line in the sequence. 
  2347.  
  2348. There might be discontinuity of gradient between multiple fillets drawn with 
  2349. GpiPolyFilletSharp.  To avoid this, ensure that points B and C of one fillet 
  2350. are on the same construction line as points A and B of the next fillet in the 
  2351. sequence. This concept is illustrated in connection with the spline primitive 
  2352. in the figure that follows the next figure. Discontinuity of gradient between 
  2353. fillets does not occur when the fillets are drawn with GpiPolyFillet. 
  2354.  
  2355.  
  2356. ΓòÉΓòÉΓòÉ 3.1.8.2. Splines ΓòÉΓòÉΓòÉ
  2357.  
  2358. GpiPolySpline creates a succession of one or more Bezier splines.  The spline 
  2359. also is a curve, but its construction method is different from that of the 
  2360. fillet.  As input to this function, you supply three construction points for 
  2361. each spline.  The first spline starts from the current position and ends at the 
  2362. third specified point.  The two intermediate points are control points for the 
  2363. curve.  Subsequent splines start at the end point of the previous spline, have 
  2364. two intermediary control points, and end at the third control point. The 
  2365. following figure shows the construction method for the spline. 
  2366.  
  2367. The Spline 
  2368.  
  2369. Points (1) and (2) are the control points of the spline, and point (3) is the 
  2370. end point. 
  2371.  
  2372. To avoid discontinuity of gradient between the end of one spline and the start 
  2373. of the next, ensure that the last two construction points of the first spline 
  2374. and the first two construction points of the second spline are positioned along 
  2375. a single construction line. This concept is shown in the following figure. 
  2376.  
  2377. Spline with No Discontinuity of Gradient 
  2378.  
  2379.  The last two points of the first spline (points 2 and 3) are positioned along 
  2380. the same construction line as the first two points (current position and point 
  2381. 1) of the second spline. 
  2382.  
  2383.  
  2384. ΓòÉΓòÉΓòÉ 3.2. Using Line and Arc Primitives ΓòÉΓòÉΓòÉ
  2385.  
  2386. This section explains how to: 
  2387.  
  2388. o Draw a straight line 
  2389. o Create a "rubber-banding" effect with straight lines or arcs 
  2390. o Draw a circle, ellipse, fillet, or spline. 
  2391.  
  2392.  
  2393. ΓòÉΓòÉΓòÉ 3.2.1. Drawing a Straight Line ΓòÉΓòÉΓòÉ
  2394.  
  2395. To draw a straight line, set the current position with GpiMove or 
  2396. GpiSetCurrentPosition.  Set the end point of the line by filling in a POINTL 
  2397. structure, then draw the line with GpiLine. The following figure shows how to 
  2398. draw a straight line in a PM application. 
  2399.  
  2400.  
  2401. #include <os2.h>
  2402.  
  2403.     BOOL DrawLine(HPS hps, LONG xStart, LONG yStart, LONG xEnd, LONG yEnd){
  2404.         POINTL ptl;                       /* Point structure              */
  2405.  
  2406.         ptl.x = xStart;                   /* Loads starting x-coordinate  */
  2407.         ptl.y = yStart;                   /* Loads starting y-coordinate  */
  2408.         GpiMove(hps, &ptl);               /* Sets current position        */
  2409.         ptl.x = xEnd;                     /* Loads ending x-coordinate    */
  2410.         ptl.y = yEnd;                     /* Loads ending y-coordinate    */
  2411.         if (GpiLine(hps, &ptl) == GPI_OK){
  2412.             return TRUE;                  /* Draw Line.                   */
  2413.         } /* if */
  2414.         else return FALSE;
  2415.     } /* DrawLine */
  2416.  
  2417.  
  2418. Drawing a Straight Line 
  2419.  
  2420. The second argument of GpiMove is the address of a POINTL structure that 
  2421. contains coordinates of the line's starting point.  The second argument of 
  2422. GpiLine is the address of another POINTL structure that contains the 
  2423. coordinates of the last point on the line. 
  2424.  
  2425.  
  2426. ΓòÉΓòÉΓòÉ 3.2.2. Creating a Rubber-Banding Effect with a Straight Line ΓòÉΓòÉΓòÉ
  2427.  
  2428. When lines are drawn with a rubber-banding effect, two things happen: the 
  2429. original line (if one exists) is erased; and a new line is drawn in its place. 
  2430. This process typically takes place each time the mouse is dragged and continues 
  2431. until the mouse button is released.  The quickest way to erase the original 
  2432. line (having ensured that it was drawn using mix attribute FM_XOR) is to redraw 
  2433. it using mix attribute FM_XOR. The following figure shows how to create this 
  2434. effect. 
  2435.  
  2436. #define INCL_WININPUT
  2437. #define INCL_GPITRANSFORMS
  2438. #define INCL_GPIPRIMITIVES
  2439. #include <os2.h>
  2440.     HPS hps;                            /* Presentation-space handle  */
  2441.     LONG curr_color;
  2442.  
  2443. MRESULT EXPENTRY wpGeneric(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2){
  2444.     static POINTL ptlStart;             /* Starting point of line     */
  2445.     static POINTL ptlNew;               /* Ending point of line       */
  2446.     static POINTL ptlPrev;              /* Previous end point of line */
  2447.     static BOOL fDraw;                  /* Line-drawing flag          */
  2448.  
  2449.     switch (msg) {
  2450.         case WM_BUTTON1DOWN:            /* User begins drawing        */
  2451.            GpiSetColor(hps, CLR_GREEN);
  2452.            ptlStart.x = (LONG) (LOUSHORT(mp1));
  2453.            ptlStart.y = (LONG) (HIUSHORT(mp1));
  2454.            GpiConvert(hps, CVTC_DEVICE, CVTC_WORLD, 1L,
  2455.                     &ptlStart);
  2456.            ptlPrev.x = ptlStart.x;
  2457.            ptlPrev.y = ptlStart.y;
  2458.            GpiMove(hps, &ptlStart);
  2459.            fDraw = TRUE;
  2460.            return ((MRESULT) TRUE);
  2461.  
  2462.         case WM_MOUSEMOVE:              /* User draws line             */
  2463.             if (fDraw) {
  2464.                 ptlNew.x = (LONG) (LOUSHORT(mp1));
  2465.                 ptlNew.y = (LONG) (HIUSHORT(mp1));
  2466.                 GpiConvert(hps, CVTC_DEVICE, CVTC_WORLD, 1L,  &ptlNew);
  2467.                 curr_color = GpiQueryColor(hps);
  2468.                 GpiSetMix(hps, FM_XOR);
  2469.                 if ((ptlStart.x != ptlPrev.x)
  2470.                 || (ptlStart.y != ptlPrev.y)) {
  2471.                     GpiMove(hps, &ptlStart);
  2472.                     GpiLine(hps, &ptlPrev);
  2473.                 } /* if */
  2474.                 if ((ptlStart.x != ptlNew.x)
  2475.                 || (ptlStart.y != ptlNew.y)) {
  2476.                     GpiMove(hps, &ptlStart);
  2477.                     GpiLine(hps, &ptlNew);
  2478.                     ptlPrev.x = ptlNew.x;
  2479.                     ptlPrev.y = ptlNew.y;
  2480.                 } /* if */
  2481.                 GpiSetMix(hps, FM_OVERPAINT);
  2482.             } /* if */
  2483.             return ((MRESULT) TRUE);
  2484.  
  2485.          case WM_BUTTON1UP:              /* User stops drawing          */
  2486.             fDraw = FALSE;
  2487.             return ((MRESULT) TRUE);
  2488.     } /* switch */
  2489. } /* wpGeneric */
  2490.  
  2491.  
  2492. Rubber-Banding a Straight Line 
  2493.  
  2494.  
  2495. ΓòÉΓòÉΓòÉ 3.2.3. Drawing a Circle ΓòÉΓòÉΓòÉ
  2496.  
  2497. When drawing a circle, all the transformations between the world, model, page, 
  2498. and device spaces must maintain square units. This means that your application 
  2499. should select metric, English, or arbitrary page units instead of pels.  On 
  2500. most devices, pels are rectangular, but not necessarily square.  This also 
  2501. means that the Sx and Sy scaling factors should be equal.  If the 
  2502. transformations maintain square units and the arc parameters are set to their 
  2503. default values, GpiFullArc produces a circle. 
  2504.  
  2505. In the example shown in the following figure, if the page units are 
  2506. PU_LOENGLISH and the default transformations are set, a circle with a radius of 
  2507. 1/2 inch is drawn. 
  2508.  
  2509.  
  2510. #define INCL_GPIPRIMITIVES
  2511. #include <os2.h>
  2512.     HPS hps;                                  /* Presentation-space handle      */
  2513.  
  2514. MRESULT EXPENTRY wpClient (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2){
  2515.     ARCPARAMS arcp;                           /* Structure for arc parameters   */
  2516.     POINTL ptlPos;                            /* Structure for current position */
  2517.     FIXED fxMult;                             /* Multiplier for circle          */
  2518.  
  2519.     arcp.lP = 1;
  2520.     arcp.lQ = 1;
  2521.     arcp.lR = 0;
  2522.     arcp.lS = 0;
  2523.     GpiSetArcParams(hps, &arcp);               /* Sets parameters to default    */
  2524.     ptlPos.x = 100;                            /* Loads x-coordinate            */
  2525.     ptlPos.y = 100;                            /* Loads y-coordinate            */
  2526.     GpiMove(hps, &ptlPos);                     /* Sets current position         */
  2527.     fxMult = MAKEFIXED(50, 0);                 /* Sets multiplier               */
  2528.     GpiFullArc(hps, DRO_OUTLINE, fxMult);      /* Draws circle                  */
  2529. } /* wpClient */
  2530.  
  2531.  
  2532. Drawing a Circle 
  2533.  
  2534. The second argument to GpiFullArc, DRO_OUTLINE, specifies that the operating 
  2535. system should draw only the outline of the circle-rather than filling the 
  2536. interior with the current fill pattern.  The third argument, fxMult, specifies 
  2537. that the operating system should multiply the size of the circle by 50 units. 
  2538. Because the page units are PU_LOENGLISH and the default transformations are 
  2539. set, 50 units is equivalent to 1/2 inch. 
  2540.  
  2541.  
  2542. ΓòÉΓòÉΓòÉ 3.2.4. Drawing an Ellipse ΓòÉΓòÉΓòÉ
  2543.  
  2544. If you set the world, model, page, and device transformations so that they 
  2545. maintain square units, you can use the arc parameters to transform the shape of 
  2546. the unit circle to an ellipse, and draw this with GpiFullArc.  The example in 
  2547. the following figure alters the arc parameter, p, by doubling its value, making 
  2548. the ellipse twice as wide horizontally as it is vertically. 
  2549.  
  2550. In the example shown in the following figure, if the page units are 
  2551. PU_LOENGLISH and the default transformations are set, an ellipse with a 2-inch 
  2552. major axis (parallel to the x-axis) and a 1-inch minor axis (parallel to the 
  2553. y-axis) is drawn. 
  2554.  
  2555.  
  2556. #define INCL_GPIPRIMITIVES
  2557. #include <os2.h>
  2558.     HPS hps;                              /* Presentation-space handle      */
  2559.  
  2560. MRESULT EXPENTRY wpClient (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2){
  2561.     POINTL ptlPos;                        /* Structure for current position */
  2562.     FIXED fxMult;                         /* Multiplier for ellipse         */
  2563.     ARCPARAMS arcp;                       /* Structure for arc parameters   */
  2564.  
  2565.     arcp.lP = 2;
  2566.     arcp.lQ = 1;
  2567.     arcp.lR = 0;
  2568.     arcp.lS = 0;
  2569.     GpiSetArcParams(hps, &arcp);           /* Sets parameters to default */
  2570.     ptlPos.x = 200;                        /* Loads x-coordinate         */
  2571.     ptlPos.y = 100;                        /* Loads y-coordinate         */
  2572.     GpiMove(hps, &ptlPos);                 /* Sets current position      */
  2573.     fxMult = MAKEFIXED(50, 0);             /* Sets multiplier            */
  2574.     GpiFullArc(hps, DRO_OUTLINE, fxMult);  /* Draws circle               */
  2575. } /* wpClient */
  2576.  
  2577.  
  2578. Drawing an Ellipse 
  2579.  
  2580. Because the arc-parameter fields, lP and lQ, are set to 2 and 1, the operating 
  2581. system creates an ellipse with a major axis that is twice as long as the minor 
  2582. axis. 
  2583.  
  2584.  
  2585. ΓòÉΓòÉΓòÉ 3.2.5. Drawing a Pie Slice ΓòÉΓòÉΓòÉ
  2586.  
  2587. The following steps describe how to use GpiPartialArc to draw a closed shape 
  2588. bounded by a chord and an arc: 
  2589.  
  2590.  1. Set the current line type to LINETYPE_INVISIBLE with GpiSetLineType. 
  2591.  
  2592.  2. Issue GpiPartialArc with the start angle equal to angle B, and the sweep 
  2593.     angle equal to 0.  This effectively moves the current position to a point 
  2594.     on the current arc, and thereby defines one end of the chord. 
  2595.  
  2596.  3. Select a visible line type with GpiSetLineType. 
  2597.  
  2598.  4. Issue GpiPartialArc, with the start angle equal to angle A, and the sweep 
  2599.     angle equal to angle B - angle A.  Angle B must be greater than angle A. 
  2600.     The center point is the same on both GpiPartialArc calls. 
  2601.  
  2602. To fill this partial arc with the current area-fill pattern, you can bracket 
  2603. the GpiPartialArc call of step 4 with the GpiBeginArea and GpiEndArea 
  2604. functions.  You should not issue GpiBeginArea before step 2. 
  2605.  
  2606. The effect of this sequence is shown in the following figure. 
  2607.  
  2608. Closed Figure Bounded by Chord and Arc 
  2609.  
  2610. The circle in the following figure is defined by the current arc parameters. 
  2611. Point F is the current position, and point C is the center of the arc as 
  2612. specified with the first GpiPartialArc call.  The first GpiPartialArc call-with 
  2613. the line type set to LINETYPE_INVISIBLE-moves the current position to point D. 
  2614. The second GpiPartialArc call-with the line type set to LINETYPE_SOLID- draws 
  2615. the chord from the current position (point D) to the start point of the arc 
  2616. (point E), and draws arc ED. The partial arc has been defined within an area 
  2617. and has been filled with the current area-fill pattern. 
  2618.  
  2619. The following figure shows how to draw a "pie slice" like the one drawn in the 
  2620. previous figure. 
  2621.  
  2622.  
  2623. #define INCL_GPIPRIMITIVES
  2624. #include <os2.h>
  2625.  
  2626. void Figure_516(){
  2627.    HPS hps;
  2628.    POINTL ptlCenter = {2L, 2L};       /*  Coordinates of the center point  */
  2629.    FIXED fxAngleA = 20L;              /*  Angle A in degrees               */
  2630.    FIXED fxAngleB = 130L;             /*  Angle B in degrees               */
  2631.  
  2632.    GpiSetLineType(hps, LINETYPE_INVISIBLE);
  2633.                     /*  Set position to start drawing the arc at angle B.  */
  2634.    GpiPartialArc(hps, &ptlCenter, MAKEFIXED(1, 0), fxAngleB, 0L);
  2635.    GpiSetLineType(hps, LINETYPE_ID);
  2636.    GpiBeginArea(hps, BA_BOUNDARY | BA_ALTERNATE);      /*  Fill the area   */
  2637.    GpiPartialArc(hps, &ptlCenter, MAKEFIXED(1, 0), fxAngleA, fxAngleB-fxAngleA);
  2638.    GpiEndArea(hps);                                    /* Cancel area-fill */
  2639. }
  2640.  
  2641.  
  2642. Drawing a Pie Slice 
  2643.  
  2644.  
  2645. ΓòÉΓòÉΓòÉ 3.2.6. Drawing a Fillet ΓòÉΓòÉΓòÉ
  2646.  
  2647.  A fillet is tangential to two lines.  The curve of the fillet is always 
  2648. tangential to a line drawn between its start and control points and a line 
  2649. drawn between its end and control points. 
  2650.  
  2651. The following figure shows an example of how to draw a single curve, using the 
  2652. current position and two control points. 
  2653.  
  2654.  
  2655. #include <os2.h>
  2656.     HPS hps;                                 /* Presentation-space handle    */
  2657.  
  2658. MRESULT EXPENTRY wpClient(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2){
  2659.     POINTL aptl[2];                /* Structure for control points           */
  2660.  
  2661.         aptl[0].x = 50;            /* Loads x-coord. of first control point  */
  2662.         aptl[0].y = 50;            /* Loads y-coord. of first control point  */
  2663.         GpiMove(hps, aptl);                  /* Sets current position        */
  2664.         aptl[0].x = 75;            /* Loads x-coord. of second control point */
  2665.         aptl[0].y = 75;            /* Loads y-coord. of second control point */
  2666.         aptl[1].x = 100;           /* Loads x-coord. of third control point  */
  2667.         aptl[1].y = 50;            /* Loads y-coord. of third control point  */
  2668.         GpiPolyFillet(hps, 2, aptl); /* Draws fillet                         */
  2669. } /* wpClient */
  2670.  
  2671.  
  2672. Drawing a Fillet 
  2673.  
  2674. When you draw a sharp fillet, the sharpness value controls the shape of the 
  2675. curve, as shown in a previous table. 
  2676.  
  2677. The following figure shows an example of using a sharpness value of 3, which 
  2678. creates a hyperbolic curve. 
  2679.  
  2680.  
  2681. #include <os2.h>
  2682.     HPS hps;                        /* Presentation-space handle             */
  2683.  
  2684. MRESULT EXPENTRY wpClient(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2){
  2685.         POINTL aptl[2];            /* Structure for control points           */
  2686.         FIXED fxSharpness;         /* Sharpness value                        */
  2687.  
  2688.         aptl[0].x = 50;            /* Loads x-coord. of first control point  */
  2689.         aptl[0].y = 50;            /* Loads y-coord. of first control point  */
  2690.         GpiMove(hps, aptl);        /* Sets current position                  */
  2691.         aptl[0].x = 75;            /* Loads x-coord. of second control point */
  2692.         aptl[0].y = 75;            /* Loads y-coord. of second control point */
  2693.         aptl[1].x = 100;           /* Loads x-coord. of third control point  */
  2694.         aptl[1].y = 50;            /* Loads y-coord. of third control point  */
  2695.         fxSharpness = MAKEFIXED(3, 0);   /* Sets sharpness value             */
  2696.         GpiPolyFilletSharp(hps,    /* Draws fillet                           */
  2697.             2L, aptl, &fxSharpness);
  2698. } /* wpClient */
  2699.  
  2700.  
  2701. Drawing a Hyperbolic Curve 
  2702.  
  2703.  
  2704. ΓòÉΓòÉΓòÉ 3.2.7. Drawing a Spline ΓòÉΓòÉΓòÉ
  2705.  
  2706. When you use GpiPolySpline to draw a spline, each curve is tangential to the 
  2707. first and last of three connected lines. The following figure shows how to draw 
  2708. a spline. 
  2709.  
  2710.  
  2711. #include <os2.h>
  2712.     HPS hps;                        /* Presentation-space handle              */
  2713.  
  2714. MRESULT EXPENTRY wpClient(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2){
  2715.         POINTL aptl[3];             /* Structure for control points           */
  2716.  
  2717.         aptl[0].x = 50;             /* Loads x-coord. of first control point  */
  2718.         aptl[0].y = 100;            /* Loads y-coord. of first control point  */
  2719.         GpiMove(hps, aptl);         /* Sets current position                  */
  2720.         aptl[0].x = 75;             /* Loads x-coord. of second control point */
  2721.         aptl[0].y = 200;            /* Loads y-coord. of second control point */
  2722.         aptl[1].x = 100;            /* Loads x-coord. of third control point  */
  2723.         aptl[1].y = 0;              /* Loads y-coord. of third control point  */
  2724.         aptl[2].x = 125;            /* Loads x-coord. of fourth control point */
  2725.         aptl[2].y = 100;            /* Loads y-coord. of fourth control point */
  2726.         GpiPolySpline(hps, 3L, aptl);   /* Draws spline                       */
  2727. } /* wpClient */
  2728.  
  2729.  
  2730. Drawing a Spline 
  2731.  
  2732.  
  2733. ΓòÉΓòÉΓòÉ 3.3. Summary ΓòÉΓòÉΓòÉ
  2734.  
  2735. The following table summarizes the line and arc primitive functions. 
  2736.  
  2737. Line and Arc Primitive Functions 
  2738.  
  2739. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2740. ΓöéFunction Name           ΓöéDescription                         Γöé
  2741. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2742. ΓöéGpiBox                  ΓöéStarting at the current position,   Γöé
  2743. Γöé                        Γöédraws a rectangular or rounded      Γöé
  2744. Γöé                        Γöécorner box that, optionally, can be Γöé
  2745. Γöé                        Γöéfilled.                             Γöé
  2746. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2747. ΓöéGpiFullArc              ΓöéDraws an ellipse or a circle that,  Γöé
  2748. Γöé                        Γöéoptionally, can be filled.          Γöé
  2749. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2750. ΓöéGpiLine                 ΓöéDraws a straight line from the      Γöé
  2751. Γöé                        Γöécurrent position.                   Γöé
  2752. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2753. ΓöéGpiMove                 ΓöéSets the current position.          Γöé
  2754. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2755. ΓöéGpiPartialArc           ΓöéDraws a straight line, followed by aΓöé
  2756. Γöé                        Γöésection of a circle or ellipse.     Γöé
  2757. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2758. ΓöéGpiPointArc             ΓöéDraws an arc through 3 points.      Γöé
  2759. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2760. ΓöéGpiPolyFillet           ΓöéDraws 1 or more fillets.            Γöé
  2761. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2762. ΓöéGpiPolyFilletSharp      ΓöéDraws 1 or more fillets with varyingΓöé
  2763. Γöé                        Γöédegrees of sharpness.               Γöé
  2764. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2765. ΓöéGpiPolyLine             ΓöéDraws straight lines from the       Γöé
  2766. Γöé                        Γöécurrent position to connect a seriesΓöé
  2767. Γöé                        Γöéof vertices.                        Γöé
  2768. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2769. ΓöéGpiPolySpline           ΓöéDraws 1 or more Bezier splines.     Γöé
  2770. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2771. ΓöéGpiQueryArcParams       ΓöéDetermines the current arc          Γöé
  2772. Γöé                        Γöéparameters.                         Γöé
  2773. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2774. ΓöéGpiQueryAttrs           ΓöéCopies the current line attributes  Γöé
  2775. Γöé                        Γöéto a LINEBUNDLE structure.          Γöé
  2776. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2777. ΓöéGpiQueryCurrentPosition ΓöéDetermines the x- and y-coordinates Γöé
  2778. Γöé                        Γöéof the current position.            Γöé
  2779. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2780. ΓöéGpiQueryLineType        ΓöéDetermines the current line type.   Γöé
  2781. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2782. ΓöéGpiQueryLineWidth       ΓöéDetermines the current line width.  Γöé
  2783. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2784. ΓöéGpiSetArcParams         ΓöéDefines the current arc parameters. Γöé
  2785. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2786. ΓöéGpiSetAttrs             ΓöéDefines the current line attributes.Γöé
  2787. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2788. ΓöéGpiSetColor             ΓöéDefines the current line color.     Γöé
  2789. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2790. ΓöéGpiSetCurrentPosition   ΓöéDefines the current position and canΓöé
  2791. Γöé                        Γöéretain the previous current         Γöé
  2792. Γöé                        Γöéposition.                           Γöé
  2793. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2794. ΓöéGpiSetLineType          ΓöéDefines the current line style.     Γöé
  2795. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2796. ΓöéGpiSetLineWidth         ΓöéDefines the current line width.     Γöé
  2797. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2798. ΓöéGpiSetMix               ΓöéDefines the current line mix        Γöé
  2799. Γöé                        Γöéattribute.                          Γöé
  2800. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2801.  
  2802. The following table summarizes the data structures used by the line and arc 
  2803. primitive functions. 
  2804.  
  2805. Line and Arc Primitive Structures 
  2806.  
  2807. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2808. ΓöéStructure               ΓöéDescription                         Γöé
  2809. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2810. ΓöéARCPARAMS               ΓöéContains the current arc parameters.Γöé
  2811. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2812. ΓöéLINEBUNDLE              ΓöéContains the current line           Γöé
  2813. Γöé                        Γöéparameters.                         Γöé
  2814. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2815.  
  2816.  
  2817. ΓòÉΓòÉΓòÉ 4. Marker Primitives ΓòÉΓòÉΓòÉ
  2818.  
  2819. Marker primitives are graphics objects-such as stars, dots, or crosses-that are 
  2820. used, for example, to indicate the plotted points on a line graph. The 
  2821. following topics are related to the information in this chapter: 
  2822.  
  2823. o Presentation spaces 
  2824. o Line and arc primitives 
  2825. o Color and mix attributes 
  2826. o Fonts. 
  2827.  
  2828.  
  2829. ΓòÉΓòÉΓòÉ 4.1. About Marker Primitives ΓòÉΓòÉΓòÉ
  2830.  
  2831. Marker primitives always are drawn centered over a point. In a designated 
  2832. presentation space, the GpiMarker function draws a single marker primitive of 
  2833. the current marker symbol, with its center at a specified position. This 
  2834. position becomes the new current position when the marker is drawn. 
  2835.  
  2836. Another marker function, GpiPolyMarker, draws multiple marker primitives in the 
  2837. designated presentation space. Each marker primitive is centered over a 
  2838. position specified in an input array to GpiPolyMarker. All marker primitives 
  2839. drawn by a single call to GpiPolyMarker use the same (current) marker symbol. 
  2840. When a series of marker primitives is drawn, the current position is the center 
  2841. point of the last marker in the series. The following figure shows the use of 
  2842. marker primitives in a line graph. 
  2843.  
  2844. Marker Primitives 
  2845.  
  2846. This example shows a sequence of diamond-shaped marker primitives drawn on a 
  2847. line graph at (1,2), (3,4), (4,3), (7,5), (8,4), (9,8), (10,6), and (11,6). The 
  2848. new current position is at (11,6). The marker portion of this example could 
  2849. have been drawn with a single issuance of GpiPolyMarker or with 8 separate 
  2850. GpiMarker calls. 
  2851.  
  2852.  
  2853. ΓòÉΓòÉΓòÉ 4.1.1. Attributes of Marker Primitives ΓòÉΓòÉΓòÉ
  2854.  
  2855. Marker primitive attributes are contained in a data structure called 
  2856. MARKERBUNDLE. Following is a list of these attributes: 
  2857.  
  2858. o Marker symbol 
  2859. o Marker box 
  2860. o Marker set 
  2861. o Foreground color 
  2862. o Background color 
  2863. o Foreground mix attribute 
  2864. o Background mix attribute. 
  2865.  
  2866. When an application creates a presentation space, the marker attributes are set 
  2867. to the default values shown in the following table. 
  2868.  
  2869. Marker Attribute Default Values 
  2870.  
  2871. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2872. ΓöéAttribute       ΓöéDefault Value     ΓöéFunction that Redefines   Γöé
  2873. Γöé                Γöé                  ΓöéAttribute                 Γöé
  2874. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2875. ΓöéMarker symbol   ΓöéCross             ΓöéGpiSetMarker              Γöé
  2876. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2877. ΓöéMarker box      ΓöéDevice dependent; ΓöéGpiSetMarkerBox           Γöé
  2878. Γöé                Γöéequal to the size Γöé                          Γöé
  2879. Γöé                Γöéof one character  Γöé                          Γöé
  2880. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2881. ΓöéMarker set      ΓöéLCID_DEFAULT      ΓöéGpiSetMarkerSet           Γöé
  2882. Γöé                Γöé                  ΓöéNote:  If this default is Γöé
  2883. Γöé                Γöé                  Γöéchanged, the base marker  Γöé
  2884. Γöé                Γöé                  Γöéset cannot be reselected  Γöé
  2885. Γöé                Γöé                  Γöéwith GpiSetMarkerSet.     Γöé
  2886. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2887. ΓöéForeground colorΓöéBlack             ΓöéGpiSetAttrs (MBB_COLOR)   Γöé
  2888. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2889. ΓöéBackground colorΓöéClear             ΓöéGpiSetAttrs               Γöé
  2890. Γöé                Γöé                  Γöé(MBB_BACK_COLOR)          Γöé
  2891. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2892. ΓöéForeground mix  ΓöéOverpaint         ΓöéGpiSetAttrs (MBB_MIX_MODE)Γöé
  2893. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2894. ΓöéBackground mix  ΓöéLeave alone       ΓöéGpiSetAttrs               Γöé
  2895. Γöé                Γöé                  Γöé(MBB_BACK_MIX_MODE)       Γöé
  2896. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2897.  
  2898.  
  2899. ΓòÉΓòÉΓòÉ 4.1.2. Marker Symbols ΓòÉΓòÉΓòÉ
  2900.  
  2901. The current marker symbol is selected from the current marker set using 
  2902. GpiSetMarker. The marker symbol selected for the specified presentation space 
  2903. is used for all subsequent GpiMarker and GpiPolyMarker calls until a new symbol 
  2904. is selected. 
  2905.  
  2906. The following table describes the marker symbols provided by the PM programming 
  2907. interface in a base marker set. These symbols are not necessarily available 
  2908. from other marker sets. 
  2909.  
  2910. The Base Marker Set 
  2911.  
  2912. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  2913. ΓöéSymbol            ΓöéIdentifier                      ΓöéLong ValueΓöé
  2914. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2915. ΓöéCross             ΓöéMARKSYM_CROSS                   Γöé1L        Γöé
  2916. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2917. ΓöéPlus sign         ΓöéMARKSYM_PLUS                    Γöé2L        Γöé
  2918. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2919. ΓöéDiamond           ΓöéMARKSYM_DIAMOND                 Γöé3L        Γöé
  2920. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2921. ΓöéSquare            ΓöéMARKSYM_SQUARE                  Γöé4L        Γöé
  2922. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2923. ΓöéSix-point star    ΓöéMARKSYM_SIXPOINTSTAR            Γöé5L        Γöé
  2924. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2925. ΓöéEight-point star  ΓöéMARKSYM_EIGHTPOINTSTAR          Γöé6L        Γöé
  2926. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2927. ΓöéSolid diamond     ΓöéMARKSYM_SOLIDDIAMOND            Γöé7L        Γöé
  2928. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2929. ΓöéSolid square      ΓöéMARKSYM_SOLIDSQUARE             Γöé8L        Γöé
  2930. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2931. ΓöéDot               ΓöéMARKSYM_DOT                     Γöé9L        Γöé
  2932. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2933. ΓöéSmall circle      ΓöéMARKSYM_SMALLCIRCLE             Γöé10L       Γöé
  2934. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  2935. ΓöéBlank, (Often     ΓöéMARKSYM_BLANK                   Γöé64L       Γöé
  2936. Γöécalled the        Γöé                                Γöé          Γöé
  2937. Γöéinvisible marker) Γöé                                Γöé          Γöé
  2938. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  2939. The default marker symbol (MARKSYM_DEFAULT) is identical to the MARKSYM_CROSS 
  2940. symbol and has a long value of 0L. The error marker symbol (MARKSYN_ERROR) has 
  2941. a long value of -1L. 
  2942.  
  2943. The following figure shows the visible marker symbols from the base marker set. 
  2944. Your application can determine the marker set with GpiQueryMarkerSet. 
  2945.  
  2946. The Base Marker Set 
  2947.  
  2948.  
  2949. ΓòÉΓòÉΓòÉ 4.1.3. Marker Box ΓòÉΓòÉΓòÉ
  2950.  
  2951. The marker box is a rectangular boundary that defines the horizontal and 
  2952. vertical space occupied by the marker symbol. The marker box is used to center 
  2953. the current marker symbol. 
  2954.  
  2955. If the current marker set contains vector marker primitives (characters 
  2956. outlined by using line and arc functions), changing the size of the marker box 
  2957. changes the size of the marker primitives also. When you change the size of the 
  2958. marker box, a vector marker symbol is scaled up or down automatically to fit 
  2959. the box. Image marker primitives, however, cannot be scaled. If the current 
  2960. marker set contains image characters, the marker box dimensions are fixed, 
  2961. because you cannot alter the size of image markers. 
  2962.  
  2963. You can use GpiSetMarkerBox to change the size of the marker box for a 
  2964. particular presentation space. Set the value of the appropriate PSIZEF 
  2965. structure to the required size. The new size is expressed in world coordinates 
  2966. and should not contain any fractional values. 
  2967.  
  2968. The default size of the marker box can be determined using DevQueryCaps. The 
  2969. values, CAPS_MARKER_WIDTH and CAPS_MARKER_HEIGHT, depend on the currently 
  2970. associated device and the presentation page. Marker box values set with 
  2971. GpiSetMarkerBox can be determined using GpiQueryMarkerBox. 
  2972.  
  2973. GpiSetAttrs also can be used to change the size of the marker box; 
  2974. GpiSetDefAttrs can be used to change the default size of the marker box. 
  2975.  
  2976.  
  2977. ΓòÉΓòÉΓòÉ 4.1.4. Marker Set ΓòÉΓòÉΓòÉ
  2978.  
  2979. When you create a presentation space, the current marker set, along with other 
  2980. marker attributes, are set to default. The current marker symbol (the cross 
  2981. described earlier) is specified from the supplied marker set. The supplied set 
  2982. of marker primitives contains only image, or raster, marker primitives. 
  2983.  
  2984. The marker primitives in the default marker set are drawn by setting the color 
  2985. of the pels in the marker box. Within the marker box, the color of the set pels 
  2986. defines the foreground color. The default foreground color is neutral- black on 
  2987. the display screen and on printers. 
  2988.  
  2989. The color of the pels that are not set defines the background color. The 
  2990. default background color is the background color on the device-white on the 
  2991. display screen, and the loaded paper color on printers. The default background 
  2992. mix is LEAVE_ALONE, or transparent, which means the background color is 
  2993. irrelevant. 
  2994.  
  2995. If the default set is changed using GpiSetDefAttrs, its markers are not 
  2996. accessible. The markers from the default set can be recovered by calling 
  2997. GpiSetDefAttrs and specifying the value LCID_DEFAULT, (0). 
  2998.  
  2999. Customizing Marker Sets 
  3000. If the current marker set does not contain a symbol that suits your 
  3001. application, you can load a new marker set and select a marker symbol from that 
  3002. set. The only way to see the current marker set is to display it on the screen 
  3003. or view a hardcopy of the symbols. You load a new marker set for a specified 
  3004. presentation space by creating a logical font. Then, you select the font as a 
  3005. marker set by specifying the logical font identifer (lcid) as an input 
  3006. parameter to GpiSetMarkerSet. lcids and their values are described in Selecting 
  3007. the New Current Font. After selecting the marker set, call GpiSetMarker to 
  3008. select a marker from the set. You can set both values simultaneously, with 
  3009. GpiSetAttrs. 
  3010.  
  3011. You can use any font's character set as a marker set and any character within 
  3012. that marker set as a marker. To determine the value that identifies the current 
  3013. marker set, call GpiQueryMarkerSet. To determine the value that identifies the 
  3014. current marker character, call GpiQueryMarker. You can retrieve both values 
  3015. simultaneously with GpiQueryAttrs. You also can create image marker symbols 
  3016. using the Font Editor. 
  3017.  
  3018.  
  3019. ΓòÉΓòÉΓòÉ 4.1.5. Marker Color and Mix Attributes ΓòÉΓòÉΓòÉ
  3020.  
  3021. The color attribute defines the color used to draw a primitive or an object. 
  3022. The mix attribute determines how the color of a primitive or an object is 
  3023. combined with the color of the drawing surface, or any other objects on the 
  3024. surface. Both attributes also are described in Color and Mix Attributes. 
  3025.  
  3026. The marker color defines the color used to draw the output from any of the OS/2 
  3027. operating system marker functions. When a presentation space is created, the 
  3028. marker color initial default is black. Markers are one of the primitives that 
  3029. have a foreground and background color, as shown in the following figure. 
  3030.  
  3031. For image markers, the colors are determined by the setting of pels. For vector 
  3032. markers, the foreground consists of the arcs and lines that define the marker. 
  3033. The background color appears between the foreground lines. The marker can be 
  3034. solid, or filled, in which case the background color does not appear between 
  3035. the foreground lines. 
  3036.  
  3037. Marker Primitives 
  3038.  
  3039. Marker primitives have both a color and background color attribute. The mix 
  3040. attribute controls the combination of marker color with drawing-surface color, 
  3041. while the background mix attribute controls the combination of the marker box 
  3042. color with the drawing-surface color. 
  3043.  
  3044. When a presentation space is created, the marker mix attribute initial default 
  3045. is FM_OVERPAINT. The overpaint mix attribute specifies that the marker color is 
  3046. not to be modified by the color of the drawing surface. If the marker mix 
  3047. attribute is changed, the marker color is mixed with colors that are already on 
  3048. the drawing surface. 
  3049.  
  3050. The marker background color initial default is CLR_BACKGROUND. Usually this is 
  3051. defined by the application to the same color as the drawing surface. The marker 
  3052. background mix attribute initial default is BM_LEAVEALONE. The leave-alone mix 
  3053. background attribute specifies that the marker background color is not drawn. 
  3054. The box that effectively surrounds the marker appears only if the marker 
  3055. background mix attribute is changed. 
  3056.  
  3057. To specify a new color or mix attribute call GpiSetAttrs. This function accepts 
  3058. as input the type of primitive, for example PRIM_MARKER, a list of attributes 
  3059. that are to be changed, a list of attributes that are to be set to their 
  3060. default values, and the values for the attributes that are to be changed. 
  3061. GpiSetAttrs is useful to specify colors and mix attributes just for a specific 
  3062. data structure, for example the MARKERBUNDLE. GpiSetAttrs also provides some 
  3063. protection against invalid colors as described in Presentation Manager 
  3064. Programming Reference. 
  3065.  
  3066. To determine the current marker color and mix attribute call GpiQueryAttrs. 
  3067. This function accepts as input the primitive type and the attributes in 
  3068. question. It returns as output an array of values for the specifically queried 
  3069. attributes. 
  3070.  
  3071. To reset the default marker color and mix attribute, just as with any other 
  3072. attribute specified in the MARKERBUNDLE data structure, call GpiSetDefAttrs. 
  3073. This function accepts as input the type of primitive, for example PRIM_MARKER, 
  3074. the attributes to be changed, and the values that will become the new default 
  3075. values. The changing of default values is important when working with segments, 
  3076. described in Creating and Drawing Retained Graphics and Editing Retained 
  3077. Graphics and Graphics Segments. Changing the default values during a series of 
  3078. drawing functions is not recommended. 
  3079.  
  3080. The marker color and mix attribute also can be specified with: 
  3081.  
  3082. o GpiSetColor 
  3083. o GpiSetMix 
  3084. o GpiSetBackColor 
  3085. o GpiSetBackMix. 
  3086.  
  3087. However, these functions have the disadvantage of specifying the foreground and 
  3088. background color or mix attribute for all primitive xxxBUNDLE data structures 
  3089. that have the respective component. 
  3090.  
  3091. There are four querys that determine the color and mix attribute as specified 
  3092. by GpiSetxxx functions: 
  3093.  
  3094. o GpiQueryColor 
  3095. o GpiQueryMix 
  3096. o GpiQueryBackColor 
  3097. o GpiQueryBackMix. 
  3098.  
  3099. If the marker color, marker background color, mix attribute, or background mix 
  3100. attribute were specified individually, the aforementioned queries can return a 
  3101. value inconsistent with the current marker attribute. 
  3102.  
  3103.  
  3104. ΓòÉΓòÉΓòÉ 4.2. Using Marker Primitives ΓòÉΓòÉΓòÉ
  3105.  
  3106. You can use marker functions to: 
  3107.  
  3108. o Draw a single marker or a series of markers 
  3109.  
  3110. o Set or determine (query) any combination of the marker bundle attributes 
  3111.   including: 
  3112.  
  3113.    - Determining the lcid for the current marker set 
  3114.    - Selecting a character set as the new marker set 
  3115.    - Determining the value that identifies the current marker 
  3116.    - Selecting a character as the new marker 
  3117.    - Setting or changing the size of the marker box 
  3118.    - Setting or changing the color of a marker. 
  3119.  
  3120.  
  3121. ΓòÉΓòÉΓòÉ 4.2.1. Drawing Marker Primitives ΓòÉΓòÉΓòÉ
  3122.  
  3123. You can draw either a single marker or a series of markers using the current 
  3124. marker symbol. To draw a single marker, set the fields in a POINTL structure to 
  3125. correspond to the desired position in world coordinates. Then call GpiMarker, 
  3126. passing it the address of the POINTL structure as the second argument. 
  3127.  
  3128. To draw a series of markers, set the fields in an array of POINTL structures to 
  3129. correspond to the desired positions in world coordinates. Then call 
  3130. GpiPolyMarker, passing it the number of points in the array as the second 
  3131. argument and the name of the array as the third argument. 
  3132.  
  3133. The following figure shows how to draw a graph with GpiPolyLine and 
  3134. GpiPolyMarker. 
  3135.  
  3136.  
  3137. #include <os2.h>
  3138. void fncMARK01(void){
  3139.     HPS hps;                                  /* Presentation-space handle */
  3140.     POINTL aptl[6];                           /* Array of points           */
  3141.  
  3142.     aptl[0].x = 10; aptl[0].y = 15;           /* Assigns points            */
  3143.     aptl[1].x = 150; aptl[1].y = 30;
  3144.     aptl[2].x = 200; aptl[2].y = 32;
  3145.     aptl[3].x = 250; aptl[3].y = 70;
  3146.     aptl[4].x = 360; aptl[4].y = 120;
  3147.     aptl[5].x = 380; aptl[5].y = 98;
  3148.     GpiPolyMarker(hps, sizeof(aptl) / sizeof(POINTL),aptl);
  3149.                                               /* Plots points              */
  3150.     GpiMove(hps, aptl);                       /* Sets current position     */
  3151.     GpiPolyLine(hps, sizeof(aptl) / sizeof(POINTL),aptl);
  3152.                                               /* Draws lines               */
  3153. } /* fncMARK01 */
  3154.  
  3155.  
  3156. Drawing a Graph 
  3157.  
  3158.  
  3159. ΓòÉΓòÉΓòÉ 4.2.2. Selecting a New Marker ΓòÉΓòÉΓòÉ
  3160.  
  3161. The following figure shows how to check whether the default marker primitive 
  3162. from the default marker set is being used currently; and if so, how to replace 
  3163. the cross with the six-pointed star. 
  3164.  
  3165. #define INCL_GPIPRIMITIVES
  3166. #include <os2.h>
  3167. void fncMARK02(void){
  3168.     HPS hps;
  3169.  
  3170.     if ((GpiQueryMarker(hps) == MARKSYM_DEFAULT) &&
  3171.         (GpiQueryMarkerSet(hps) == LCID_DEFAULT))
  3172.     GpiSetMarker(hps, MARKSYM_SIXPOINTSTAR);
  3173.  
  3174.  
  3175. Selecting a New Marker 
  3176.  
  3177.  
  3178. ΓòÉΓòÉΓòÉ 4.2.3. Selecting a New Marker Set ΓòÉΓòÉΓòÉ
  3179.  
  3180. The followiing figure is an example of how to load a Helvetica** vector font, 
  3181. select it as the new marker set, and select the uppercase A as the new marker 
  3182. primitive. 
  3183.  
  3184.  
  3185. #define INCL_GPILCIDS
  3186. #define INCL_GPIPRIMITIVES
  3187. #include <os2.h>
  3188. void fncMARK03(void){
  3189.     LONG cHelvFonts, cFonts, lcid, i, j;
  3190.     HPS hps;
  3191.     FATTRS fattrs;
  3192.     FONTMETRICS afm[80];
  3193.     MARKERBUNDLE mbnd;
  3194.  
  3195.     cHelvFonts = GpiQueryFonts(hps, QF_PUBLIC, "Helv",
  3196.    &cFonts, sizeof(FONTMETRICS), (PFONTMETRICS) NULL);
  3197.                                  /* Queries the number of Helvetica fonts.      */
  3198.  
  3199.     GpiQueryFonts(hps, QF_PUBLIC, "Helv", &cHelvFonts,
  3200.        sizeof(FONTMETRICS), afm);
  3201.                                  /* Loads the array of FONTMETRICS structures.  */
  3202.  
  3203.     for (i = 0; !(afm[i].fsDefn & FM_DEFN_OUTLINE)
  3204.                                    && i < cHelvFonts; i++);
  3205.                                  /* Finds outline font                          */
  3206.  
  3207.     fattrs.usRecordLength = sizeof(FATTRS);
  3208.     fattrs.fsSelection = 0;
  3209.     fattrs.lMatch = afm[i].lMatch;         /* Uses Helvetica outline font       */
  3210.     for (j = 0; j <= sizeof(afm[i].szFacename); j++)
  3211.     fattrs.szFacename[j] = afm[i].szFacename[j];
  3212.     fattrs.idRegistry = 0;
  3213.     fattrs.usCodePage = 850;     /* Uses international code page                */
  3214.     fattrs.lMaxBaselineExt = 0;
  3215.     fattrs.lAveCharWidth = 0;
  3216.     fattrs.fsType = 0;
  3217.     fattrs.fsFontUse = FATTR_FONTUSE_TRANSFORMABLE;
  3218.  
  3219.     GpiCreateLogFont(hps, (PSTR8) NULL, lcid, &fattrs);
  3220.     mbnd.usSet = lcid;           /* Uses font as marker set                     */
  3221.     mbnd.usSymbol = 'A';         /* Uses capital A as primitive                 */
  3222.     GpiSetAttrs(hps, PRIM_MARKER, MBB_SYMBOL | MBB_SET, 0, &mbnd);
  3223. } /* fncMARK03 */
  3224.  
  3225.  
  3226. Selecting a New Marker Set 
  3227.  
  3228.  
  3229. ΓòÉΓòÉΓòÉ 4.2.4. Changing the Marker Color ΓòÉΓòÉΓòÉ
  3230.  
  3231. The following figure shows how to set the marker foreground color to green. 
  3232.  
  3233.  
  3234. #define INCL_GPIPRIMITIVES
  3235. #include <os2.h>
  3236. void fncMARK04(void){
  3237.     HPS hps;
  3238.     MARKERBUNDLE mbnd;
  3239.  
  3240.     mbnd.lColor = CLR_GREEN;
  3241.     GpiSetAttrs(hps, PRIM_MARKER, MBB_COLOR, 0L, &mbnd);
  3242. } /* fncMARK04 */
  3243.  
  3244.  
  3245. Changing the Marker Color 
  3246.  
  3247.  
  3248. ΓòÉΓòÉΓòÉ 4.3. Summary ΓòÉΓòÉΓòÉ
  3249.  
  3250. The following table summarizes the marker primitive functions. 
  3251.  
  3252. Marker Functions 
  3253.  
  3254. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3255. ΓöéFunction Name           ΓöéDescription                         Γöé
  3256. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3257. ΓöéGpiMarker               ΓöéDraws the current marker primitive  Γöé
  3258. Γöé                        Γöéat a specified position.            Γöé
  3259. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3260. ΓöéGpiPolyMarker           ΓöéDraws a series of the current markerΓöé
  3261. Γöé                        Γöéprimitive at a specified position.  Γöé
  3262. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3263. ΓöéGpiQueryAttrs           ΓöéDetermines the current marker bundleΓöé
  3264. Γöé                        Γöéattributes.                         Γöé
  3265. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3266. ΓöéGpiQueryMarker          ΓöéDetermines the current marker symbolΓöé
  3267. Γöé                        Γöéattribute.                          Γöé
  3268. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3269. ΓöéGpiQueryMarkerBox       ΓöéDetermines the size of the current  Γöé
  3270. Γöé                        Γöémarker box.                         Γöé
  3271. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3272. ΓöéGpiQueryMarkerSet       ΓöéDetermines the value of the current Γöé
  3273. Γöé                        Γöémarker set attribute.               Γöé
  3274. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3275. ΓöéGpiSetAttrs             ΓöéSets the marker bundle attributes.  Γöé
  3276. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3277. ΓöéGpiSetMarker            ΓöéSets the attribute of the marker    Γöé
  3278. Γöé                        Γöésymbol.                             Γöé
  3279. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3280. ΓöéGpiSetMarkerBox         ΓöéSets the dimensions of the marker   Γöé
  3281. Γöé                        Γöébox. (This function influences      Γöé
  3282. Γöé                        Γöévector markers only. The width and  Γöé
  3283. Γöé                        Γöéheight of raster marker primitives  Γöé
  3284. Γöé                        Γöéare fixed.)                         Γöé
  3285. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3286. ΓöéGpiSetMarkerSet         ΓöéSets the attribute of the marker    Γöé
  3287. Γöé                        Γöéset.                                Γöé
  3288. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3289. The following table summarizes the data structures used by the marker primitive 
  3290. functions. 
  3291.  
  3292. Marker Structures 
  3293.  
  3294. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3295. ΓöéStructure Name          ΓöéDescription                         Γöé
  3296. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3297. ΓöéPOINTL                  ΓöéA structure specifying the values ofΓöé
  3298. Γöé                        Γöéa single pair of x- and y-          Γöé
  3299. Γöé                        Γöécoordinates.                        Γöé
  3300. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3301. ΓöéPSIZEF                  ΓöéA structure specifying the size of  Γöé
  3302. Γöé                        Γöéthe marker box.                     Γöé
  3303. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3304. ΓöéMARKERBUNDLE            ΓöéA structure of marker primitive     Γöé
  3305. Γöé                        Γöéattributes.                         Γöé
  3306. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3307.  
  3308.  
  3309. ΓòÉΓòÉΓòÉ 5. Area and Polygon Primitives ΓòÉΓòÉΓòÉ
  3310.  
  3311. An area is one or more closed figures that can be drawn filled, outlined, or 
  3312. filled and outlined.  If an area includes more than one figure, those figures 
  3313. can be separate or intersecting. 
  3314.  
  3315. A polygon, too, is one or more closed figures that can be drawn filled, 
  3316. outlined, or filled and outlined.  Polygons, unlike areas, are limited to 
  3317. figures with straight edges.  Polygons also can be separate or intersecting. 
  3318.  
  3319. The following topics are related to the information in this chapter: 
  3320.  
  3321. o Presentation spaces 
  3322. o Line and arc primitives 
  3323. o Color and mix attributes 
  3324. o Fonts 
  3325. o Bit maps 
  3326. o Paths. 
  3327.  
  3328.  
  3329. ΓòÉΓòÉΓòÉ 5.1. About Area Primitives ΓòÉΓòÉΓòÉ
  3330.  
  3331. Applications can create, outline, and fill areas and can create custom-fill 
  3332. patterns from bit maps or font symbols.  Some graphics functions are not valid 
  3333. within an area definition.  For example, you cannot include marker, image, or 
  3334. character-string primitives in an area definition. The following figure is an 
  3335. example of an area. 
  3336.  
  3337. An Area 
  3338.  
  3339. This area comprises two hexagons, one completely enclosed by the other. The 
  3340. area is filled with the current area-fill pattern. 
  3341.  
  3342.  
  3343. ΓòÉΓòÉΓòÉ 5.1.1. Attributes of Area Primitives ΓòÉΓòÉΓòÉ
  3344.  
  3345. The attributes of the area primitive are contained in a data structure called 
  3346. AREABUNDLE.  These attributes are: 
  3347.  
  3348. o Pattern symbol 
  3349. o Pattern reference point 
  3350. o Pattern set 
  3351. o Foreground color 
  3352. o Background color 
  3353. o Foreground mix attribute 
  3354. o Background mix mode. 
  3355.  
  3356. When an application creates a presentation space, the area attributes are set 
  3357. to the default values shown in the following table. 
  3358.  
  3359. Area Attribute Default Values 
  3360.  
  3361. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3362. ΓöéAttribute         ΓöéDefault     ΓöéFunction that Redefines       Γöé
  3363. Γöé                  ΓöéValue       ΓöéAttribute                     Γöé
  3364. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3365. ΓöéPattern symbol    Γöésolid       ΓöéGpiSetPattern                 Γöé
  3366. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3367. ΓöéPattern reference Γöé(0,0)       ΓöéGpiSetPatternRefPoint         Γöé
  3368. Γöépoint             Γöé            Γöé                              Γöé
  3369. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3370. ΓöéPattern set       ΓöéLCID_DEFAULTΓöéGpiSetPatternSet              Γöé
  3371. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3372. ΓöéForeground color  ΓöéBlack       ΓöéGpiSetAttrs (ABB_COLOR)       Γöé
  3373. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3374. ΓöéBackground color  ΓöéClear       ΓöéGpiSetAttrs (ABB_BACK_COLOR)  Γöé
  3375. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3376. ΓöéForeground mix    ΓöéOverpaint   ΓöéGpiSetAttrs (ABB_MIX_MODE)    Γöé
  3377. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3378. ΓöéBackground mix    ΓöéLeave alone ΓöéGpiSetAttrs                   Γöé
  3379. Γöé                  Γöé            Γöé(ABB_BACK_MIX_MODE)           Γöé
  3380. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3381.  
  3382. Note:  If the default (LCID_DEFAULT) for pattern set is changed, the base 
  3383. pattern set cannot be reselected with GpiSetPatternSet. 
  3384.  
  3385.  
  3386. ΓòÉΓòÉΓòÉ 5.1.2. Pattern Symbol Attribute ΓòÉΓòÉΓòÉ
  3387.  
  3388. The current pattern symbol, also called the symbol point code, is selected from 
  3389. the current pattern set with GpiSetPattern.  The pattern symbol selected for 
  3390. the specified presentation space is used as the subsequent fill pattern until a 
  3391. new symbol is selected. Applications must not call GpiSetPattern while in an 
  3392. area or a path.  If the current pattern set specifies a bit map, this attribute 
  3393. is ignored. 
  3394.  
  3395. The following table describes the pattern symbols provided by the PM 
  3396. programming interface in a base pattern set.  These symbols are not necessarily 
  3397. available from other pattern sets. 
  3398.  
  3399. The Base Pattern Set 
  3400.  
  3401. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  3402. ΓöéSymbol                                    ΓöéIdentifier            ΓöéLong Γöé
  3403. Γöé                                          Γöé                      ΓöéValueΓöé
  3404. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3405. ΓöéSolid shading decreasing in dots per inch ΓöéPATSYM_DENSE1 through Γöé1L - Γöé
  3406. Γöé                                          ΓöéPATSYM_DENSE8         Γöé8L   Γöé
  3407. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3408. ΓöéVertical lines                            ΓöéPATSYM_VERT           Γöé9L   Γöé
  3409. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3410. ΓöéHorizontal lines                          ΓöéPATSYM_HORIZ          Γöé10L  Γöé
  3411. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3412. ΓöéLines bottom left to top right            ΓöéPATSYM_DIAG1          Γöé11L  Γöé
  3413. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3414. ΓöéLines bottom left to middle right         ΓöéPATSYM_DIAG2          Γöé12L  Γöé
  3415. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3416. ΓöéLines top left to bottom right            ΓöéPATSYM_DIAG3          Γöé13L  Γöé
  3417. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3418. ΓöéLines top left to middle right            ΓöéPATSYM_DIAG4          Γöé14L  Γöé
  3419. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3420. ΓöéNo shading                                ΓöéPATSYM_NOSHADE        Γöé15L  Γöé
  3421. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3422. ΓöéSolid shading                             ΓöéPATSYM_SOLID          Γöé16L  Γöé
  3423. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3424. ΓöéAlternate pels                            ΓöéPATSYM_HALFTONE       Γöé17L  Γöé
  3425. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3426. ΓöéCartesian grid                            ΓöéPATSYM_HATCH          Γöé18L  Γöé
  3427. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3428. ΓöéDiagonal crosshatch                       ΓöéPATSYM_DIAGHATCH      Γöé19L  Γöé
  3429. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  3430. ΓöéBlank (often called the clear pattern)    ΓöéPATSYM_BLANK          Γöé64L  Γöé
  3431. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  3432.  
  3433. The default pattern symbol (PATSYM_DEFAULT) is identical to the PATSYM_SOLID 
  3434. symbol, and has a long value of 0L.  The error pattern symbol (PATSYN_ERROR) 
  3435. has a long value of -1L. 
  3436.  
  3437. The following figure shows the patterns from the base pattern symbol set. 
  3438. Applications can determine the the current pattern set by issuing 
  3439. GpiQueryPattern. 
  3440.  
  3441. The Base Pattern Symbol set. 
  3442.  
  3443.  
  3444. ΓòÉΓòÉΓòÉ 5.1.3. Pattern Reference Point Attribute ΓòÉΓòÉΓòÉ
  3445.  
  3446. The pattern reference point is the point from which the area's fill-pattern 
  3447. spreads horizontally and vertically.  The lower-left corner of the pattern is 
  3448. aligned on this point.  The pattern reference point has a default value of 
  3449. (0,0), and is expressed in world coordinates.  Applications can determine the 
  3450. pattern reference point with GpiQueryPatternRefPoint.  Applications can specify 
  3451. the pattern reference point with GpiSetPatternRefPoint; however, this should 
  3452. not be done inside an area.  The pattern reference point does not have to be 
  3453. within the boundary of the area. The following figure shows an area that was 
  3454. filled using the default pattern reference point. 
  3455.  
  3456. The Pattern Reference Point 
  3457.  
  3458. The pattern of diagonal lines is aligned with the pattern reference point 
  3459. (0,0).  When the picture is displayed or printed, only the hexagon will be 
  3460. filled. 
  3461.  
  3462. Use of the default reference point causes the diagonal lines of the pattern to 
  3463. intersect the area boundary at specific points.  If you change the reference 
  3464. point to (0,4), for example, the pattern shifts upward, and the points of 
  3465. intersection with the area boundary are different.  Although the reference 
  3466. point is outside the area, when an application displays or prints the picture, 
  3467. only the area is filled. 
  3468.  
  3469.  
  3470. ΓòÉΓòÉΓòÉ 5.1.4. Pattern Set Attribute ΓòÉΓòÉΓòÉ
  3471.  
  3472. When you create a presentation space, the current pattern set and other area 
  3473. attributes are set to the default.  The current pattern-a black solid, as 
  3474. described earlier- is specified from the supplied pattern set.  (The supplied 
  3475. set of pattern symbols contains image or raster patterns only.)  An area 
  3476. primitive is filled by repeating this pattern vertically and horizontally 
  3477. within the area boundary. 
  3478.  
  3479.  
  3480. ΓòÉΓòÉΓòÉ 5.1.4.1. Default Pattern Set ΓòÉΓòÉΓòÉ
  3481.  
  3482. The standard pattern set contains patterns of solid shading with decreasing 
  3483. intensity, and patterns of vertical, horizontal, and diagonal lines. If the 
  3484. default pattern set is changed with GpiSetDefAttrs, its patterns are not 
  3485. accessible.  The patterns from the default set can be recovered by specifying 
  3486. GpiSetDefAttrs with the value LCID_DEFAULT, (0). 
  3487.  
  3488.  
  3489. ΓòÉΓòÉΓòÉ 5.1.4.2. Customizing Pattern Sets ΓòÉΓòÉΓòÉ
  3490.  
  3491. An application can create custom patterns by using bit maps or characters and 
  3492. symbols from an image font.  When designing custom patterns, consider that the 
  3493. operating system uses only the first 8 bits in the first 8 rows, starting with 
  3494. the lower-left corner of the bit map.  The cell size of an image font used as a 
  3495. fill pattern might be too large to include the complete character or symbol. 
  3496.  
  3497. An application can change the appearance of a fill pattern by changing its 
  3498. alignment in an area primitive with GpiSetPatternRefPoint. When the default 
  3499. reference point is set, the operating system aligns the lower-left corner of 
  3500. the fill pattern with the point (0,0) in the application's world space and 
  3501. begins filling the area. If an application adjusts the pattern reference point 
  3502. to (3,2), The operating system aligns the lower-left corner of the fill pattern 
  3503. with the point (3,2) in the application's world space and begins filling the 
  3504. area. By moving the reference point from (0,0) to (3,2), the fill pattern 
  3505. appears shifted up 2 pels and to the right 3 pels. 
  3506.  
  3507.  
  3508. ΓòÉΓòÉΓòÉ 5.1.4.2.1. Custom Fill Patterns from a Bit Map ΓòÉΓòÉΓòÉ
  3509.  
  3510. To create a custom pattern from a hard-coded bit map, an application must use 
  3511. the following steps: 
  3512.  
  3513.  1. Create or load a bit map to obtain a bit-map handle, for example, use 
  3514.     GpiLoadBitmap. 
  3515.  
  3516.  2. Call GpiSetBitmapId (ID) to tag the bit map with a local identifier (lcid) 
  3517.     from 1 to 254. 
  3518.  
  3519.  3. Call GpiSetPatternSet (ID) or GpiSetAttrs (ABB_SET) to set the current fill 
  3520.     pattern. 
  3521.  
  3522. The application can now draw the area. 
  3523.  
  3524.  
  3525. ΓòÉΓòÉΓòÉ 5.1.4.2.2. Custom Fill Patterns from a Font Symbol ΓòÉΓòÉΓòÉ
  3526.  
  3527. To create a custom pattern from a character or a symbol in a font: 
  3528.  
  3529.  1. Create a logical image font and assign it an ID, for example use 
  3530.     GpiCreateLogFont. 
  3531.  
  3532.  2. Call GpiSetPatternSet (ID) or GpiSetAttrs (ABB_SET), passing it the local 
  3533.     identifier for the font. 
  3534.  
  3535.  3. Call GpiSetPattern, passing the value of the code point for a character or 
  3536.     symbol in the font. 
  3537.  
  3538. The application can now draw the area. 
  3539.  
  3540.  
  3541. ΓòÉΓòÉΓòÉ 5.1.5. Area Colors and Mix Attributes ΓòÉΓòÉΓòÉ
  3542.  
  3543. The color attribute defines the color used to draw a primitive or an object. 
  3544. The mix attribute determines how the color of a primitive or an object is 
  3545. combined with the color of the drawing surface, or any other objects on the 
  3546. surface. Both attributes also are described in Color and Mix Attributes. 
  3547.  
  3548. The area color defines the color used to fill the output from any of the OS/2 
  3549. operating system area functions, when necessary. The area primitive is the only 
  3550. primitive in which the color can be changed during the drawing of the area; 
  3551. therefore, this attribute, more than the other area attributes, depends on the 
  3552. current value as described in Attribute Currentness. 
  3553.  
  3554. When a presentation space is created, the area color initial default is black. 
  3555. The pattern symbol initial default, explained previously, is solid. Areas are 
  3556. one of the primitives that have a foreground and background color, as shown in 
  3557. the following figure; however, the appearance of the area also depends on the 
  3558. pattern symbol. 
  3559.  
  3560. Area Primitives 
  3561.  
  3562. Area primitives have both a color and background color attribute. The 
  3563. background color does not appear if the pattern symbol is solid, and the 
  3564. background color is undefined if the pattern symbol is a customized, 
  3565. multi-colored bit map. 
  3566.  
  3567. When a presentation space is created, the area mix attribute initial default is 
  3568. FM_OVERPAINT. The overpaint mix attribute specifies that the area color is not 
  3569. to be modified by the color of the drawing surface. If the area mix attribute 
  3570. is changed, the area color is mixed with colors that are already on the drawing 
  3571. surface. 
  3572.  
  3573. When the pattern symbol is solid, the color that fills the area, if necessary, 
  3574. is the current area foreground color. If the pattern symbol is changed to be a 
  3575. pattern of vertical lines, for example, the color of those lines is the current 
  3576. area foreground color. Inside of the area bracket, there can be other colors if 
  3577. these colors are the current color for primitives such as lines or arcs, that 
  3578. are drawn within the area bracket. These colors are not specifically defined or 
  3579. influenced by the area foreground color. 
  3580.  
  3581. The area background color initial default is CLR_BACKGROUND. Usually this is 
  3582. defined by the application to the same color as the drawing surface. If the 
  3583. pattern symbol is solid, the area background color does not appear. If the 
  3584. pattern symbol is changed to be a pattern of vertical lines, for example, the 
  3585. color in between those lines is the current area background color. 
  3586.  
  3587. The area background mix attribute initial default is BM_LEAVEALONE. The 
  3588. leave-alone background mix attribute specifies that the area background color 
  3589. is not drawn. This means that for a nonsolid pattern symbol, the 
  3590. drawing-surface color or the color of an object, not created by the area 
  3591. bracket, but on the drawing surface, shows through the nonsolid pattern. The 
  3592. area background color, for nonsolid pattern symbols, appears only if the 
  3593. background mix attribute is changed to overpaint, BM_OVERPAINT. 
  3594.  
  3595. If you have customized the pattern symbol with a bit map, the color definitions 
  3596. of the area primitive change. The foreground color corresponds to the color of 
  3597. the pels that are specified ON in the fill-pattern bit map. The background 
  3598. color corresponds to the color of the pels that are specified OFF in the 
  3599. fill-pattern bit map. The foreground and background mix attribute do not 
  3600. change. 
  3601.  
  3602. Note:  Background color and mix attribute only apply to monochrome (2-color) 
  3603.        fill patterns. The bit set to 0 is defined as the background and the bit 
  3604.        set to 1 is defined as the foreground. 
  3605.  
  3606. A multi-colored bit map is unaffected by the background color and mix 
  3607. attributes. 
  3608.  
  3609. To specify a new color or mix attribute call GpiSetAttrs. This function accepts 
  3610. as input the type of primitive, for example PRIM_AREA, a list of attributes 
  3611. that are to be changed, a list of attributes that are to be set to their 
  3612. default values, and the values for the attributes that are to be changed. 
  3613. GpiSetAttrs is useful to specify colors and mix attributes just for a specific 
  3614. data structure, for example the AREABUNDLE. GpiSetAttrs also provides some 
  3615. protection against invalid colors as described in Presentation Manager 
  3616. Programming Reference. 
  3617.  
  3618. To determine the current area color and mix attribute, call GpiQueryAttrs. This 
  3619. function accepts as input the primitive type and the attributes in question. It 
  3620. returns as output an array of values for the specifically queried attributes. 
  3621.  
  3622. To reset the default area color and mix attribute, just as with any other 
  3623. attribute specified in the AREABUNDLE data structure, call GpiSetDefAttrs. This 
  3624. function accepts as input the type of primitive, for example PRIM_AREA, the 
  3625. attributes to be changed, and the values that will become the new default 
  3626. values. The changing of default values is important when working with segments, 
  3627. described in Creating and Drawing Retained Graphics and Editing Retained 
  3628. Graphics and Graphics Segments. Changing the default values during a series of 
  3629. drawing functions is not recommended. 
  3630.  
  3631. The area color and mix attribute also can be specified with: 
  3632.  
  3633. o GpiSetColor 
  3634. o GpiSetMix 
  3635. o GpiSetBackColor 
  3636. o GpiSetBackMix. 
  3637.  
  3638. However, these functions have the disadvantage of specifying the foreground and 
  3639. background color or mix attribute for all primitive xxxBUNDLE data structures 
  3640. that have the respective component. 
  3641.  
  3642. There are four queries that determine the color and mix attribute as specified 
  3643. by GpiSetxxx functions: 
  3644.  
  3645. o GpiQueryColor 
  3646. o GpiQueryMix 
  3647. o GpiQueryBackColor 
  3648. o GpiQueryBackMix. 
  3649.  
  3650. If the area color, area background color, mix attribute, or background mix 
  3651. attribute were specified individually, the aforementioned queries can return a 
  3652. value inconsistent with the current area attribute. 
  3653.  
  3654.  
  3655. ΓòÉΓòÉΓòÉ 5.1.6. Area Brackets ΓòÉΓòÉΓòÉ
  3656.  
  3657. Areas also are referred to as area brackets, because the functions that create 
  3658. and define the area always are "bracketed" by the two functions, GpiBeginArea 
  3659. and GpiEndArea.  Only one area is defined between these two functions. 
  3660. However, within the area, there can be any number of adjacent, intersecting, or 
  3661. completely separate area primitives. 
  3662.  
  3663. GpiBeginArea signals the start of a group of primitives that define the 
  3664. boundary of the area.  The current position is not changed by GpiBeginArea, 
  3665. although it is updated by any drawing instructions that follow. 
  3666.  
  3667. If you call GpiSetCurrentPosition or GpiMove within an area definition, the 
  3668. current figure is closed automatically, and a new figure is started at the 
  3669. current position by the next line or curve.  A figure in the area, whose start 
  3670. and end points are not the same, is closed by drawing a straight line from the 
  3671. current position to the start position of the figure. 
  3672.  
  3673. GpiEndArea signals the end of an area definition and tells the operating system 
  3674. to draw the area.  If an application does not close a figure before issuing 
  3675. GpiEndArea, the figure is closed automatically by drawing a straight line from 
  3676. the end point of the last line or curve to the start point of the current 
  3677. figure.  The current position is always updated to the end point of the last 
  3678. line drawn. 
  3679.  
  3680. The functional sequence to draw the area in the following figure could be: 
  3681.  
  3682.  
  3683. #include <os2.h>
  3684. void fncAREA01(void){
  3685.  
  3686. #if 0
  3687.  
  3688. GpiBeginArea                /* Starts the area bracket          */
  3689.  
  3690. GpiSetCurrentPosition       /* Set the start point of the       */
  3691.                             /* outer hexagon.                   */
  3692. GpiPolyLine                 /* Draw the outer hexagon.          */
  3693. GpiSetCurrentPosition       /* Set the start point of the inner */
  3694.                             /*  hexagon.                        */
  3695. GpiPolyLine                 /* Draw the inner hexagon.          */
  3696.  
  3697. GpiEndArea                  /* End the area definition.         */
  3698.  
  3699. #endif
  3700.  
  3701. }
  3702.  
  3703.  
  3704. Defining an Area Primitive 
  3705.  
  3706. An area bracket contains the functions that define an area. Only one area can 
  3707. be defined between "bracket" functions. 
  3708.  
  3709. Following the beginning of an area bracket, an application can define the shape 
  3710. and location of the area in world space by using the following line and arc 
  3711. functions: 
  3712.  
  3713. o GpiBox 
  3714. o GpiFullArc 
  3715. o GpiLine 
  3716. o GpiPartialArc 
  3717. o GpiPointArc 
  3718. o GpiPolyFillet 
  3719. o GpiPolyFilletSharp 
  3720. o GpiPolyLine 
  3721. o GpiPolySpline 
  3722.  
  3723. Note:  If an application calls either GpiBox or GpiFullArc inside an area, it 
  3724.        must use the DRO_OUTLINE option. 
  3725.  
  3726. In addition to the drawing functions, an application also can use the following 
  3727. specification functions inside an area bracket: 
  3728.  
  3729. o GpiBeginElement 
  3730. o GpiCallSegmentMatrix 
  3731. o GpiComment 
  3732. o GpiElement 
  3733. o GpiEndArea 
  3734. o GpiEndElement 
  3735. o GpiGetData 
  3736. o GpiLabel 
  3737. o GpiMove 
  3738. o GpiOffsetElementPointer 
  3739. o GpiPop 
  3740. o GpiPutData 
  3741. o GpiSetArcParams 
  3742. o GpiSetAttrMode 
  3743. o GpiSetAttrs 
  3744. o GpiSetColor 
  3745. o GpiSetCurrentPosition 
  3746. o GpiSetEditMode 
  3747. o GpiSetElementPointer 
  3748. o GpiSetElementPointerAtLabel 
  3749. o GpiSetLineEnd 
  3750. o GpiSetLineJoin 
  3751. o GpiSetLineType 
  3752. o GpiSetLineWidth 
  3753. o GpiSetMix 
  3754. o GpiSetModelTransformMatrix 
  3755. o GpiSetSegmentTransformMatrix 
  3756.  
  3757. An application also can use the following query functions inside an area 
  3758. bracket: 
  3759.  
  3760. o GpiQueryArcParams 
  3761. o GpiQueryAttrMode 
  3762. o GpiQueryAttrs 
  3763. o GpiQueryBackColor 
  3764. o GpiQueryBackMix 
  3765. o GpiQueryBoundaryData 
  3766. o GpiQueryCharAngle 
  3767. o GpiQueryCharBox 
  3768. o GpiQueryCharDirection 
  3769. o GpiQueryCharMode 
  3770. o GpiQueryCharSet 
  3771. o GpiQueryCharShear 
  3772. o GpiQueryCharStringPos 
  3773. o GpiQueryCharStringPosAt 
  3774. o GpiQueryClipBox 
  3775. o GpiQueryClipRegion 
  3776. o GpiQueryColor 
  3777. o GpiQueryColorData 
  3778. o GpiQueryColorIndex 
  3779. o GpiQueryCp 
  3780. o GpiQueryCurrentPosition 
  3781. o GpiQueryDefaultViewMatrix 
  3782. o GpiQueryDefCharBox 
  3783. o GpiQueryDevice 
  3784. o GpiQueryDeviceBitmapFormats 
  3785. o GpiQueryEditMode 
  3786. o GpiQueryFontFileDescriptions 
  3787. o GpiQueryFontMetrics 
  3788. o GpiQueryFonts 
  3789. o GpiQueryGraphicsField 
  3790. o GpiQueryInitialSegmentAttrs 
  3791. o GpiQueryKerningPairs 
  3792. o GpiQueryLineEnd 
  3793. o GpiQueryLineJoin 
  3794. o GpiQueryLineType 
  3795. o GpiQueryLineWidth 
  3796. o GpiQueryLineWidthGeom 
  3797. o GpiQueryLogColorTable 
  3798. o GpiQueryMarker 
  3799. o GpiQueryMarkerBox 
  3800. o GpiQueryMarkerSet 
  3801. o GpiQueryMix 
  3802. o GpiQueryModelTransformMatrix 
  3803. o GpiQueryNearestColor 
  3804. o GpiQueryNumberSetIds 
  3805. o GpiQueryPageViewport 
  3806. o GpiQueryPattern 
  3807. o GpiQueryPatternRefPoint 
  3808. o GpiQueryPatternSet 
  3809. o GpiQueryPel 
  3810. o GpiQueryPickAperturePosition 
  3811. o GpiQueryPickApertureSize 
  3812. o GpiQueryRealColors 
  3813. o GpiQueryRegionBox 
  3814. o GpiQueryRegionRects 
  3815. o GpiQueryRGBColor 
  3816. o GpiQuerySegmentAttrs 
  3817. o GpiQuerySegmentNames 
  3818. o GpiQuerySegmentPriority 
  3819. o GpiQuerySegmentTransformMatrix 
  3820. o GpiQuerySetIds 
  3821. o GpiQueryStopDraw 
  3822. o GpiQueryTag 
  3823. o GpiQueryViewingLimits 
  3824. o GpiQueryViewingTransformMatrix 
  3825. o GpiQueryWidth 
  3826.  
  3827.  
  3828. ΓòÉΓòÉΓòÉ 5.1.7. Area Bracket Attributes ΓòÉΓòÉΓòÉ
  3829.  
  3830. In addition to the attributes controlled by the AREABUNDLE data structure, 
  3831. there are two attributes that can be specified for each individual area 
  3832. bracket: 
  3833.  
  3834. o Area boundary 
  3835. o Area construction. 
  3836. These bracket attributes affect how the area primitives inside the bracket are 
  3837. drawn. 
  3838.  
  3839. The concept of attribute currentness, first described in Line and Arc 
  3840. Primitives, is especially important to areas and paths that contain multiple 
  3841. figures. 
  3842.  
  3843.  
  3844. ΓòÉΓòÉΓòÉ 5.1.8. Area Boundaries ΓòÉΓòÉΓòÉ
  3845.  
  3846. An application specifies the area boundary when it calls GpiBeginArea.  There 
  3847. are two options: 
  3848.  
  3849. o BA_BOUNDARY (the default) 
  3850. o BA_NOBOUNDARY. 
  3851.  
  3852. The BA_BOUNDARY value tells the programming interface to draw all outlines of 
  3853. the area primitives within the area bracket, using a line that conforms to the 
  3854. current LINEBUNDLE attributes.  If the line attributes have not been changed, 
  3855. the default outline color is black on most displays and printers, and the 
  3856. default line style is solid.  An application can change the line color and line 
  3857. styles within the area bracket.  The interior of the area primitive is filled 
  3858. with the current pattern. 
  3859.  
  3860. To prevent the interface from outlining an area, an application can use the 
  3861. BA_NOBOUNDARY flag when issuing GpiBeginArea.  Only the interior fill pattern 
  3862. is visible.  This value most often is used when an area contains many 
  3863. overlapping figures, and the interior lines are not desired. 
  3864.  
  3865. You could think of this option in terms similar to the outline and fill options 
  3866. discussed with boxes and full arcs in Line and Arc Primitives.  The BA_BOUNDARY 
  3867. value corresponds to DRO_OUTLINEFILL; and BA_NOBOUNDARY, to DRO_FILL.  There is 
  3868. no distinct boundary value that corresponds to DRO_OUTLINE, the simple outline. 
  3869. To simulate this effect, OR the BA_NOBOUNDARY value with the appropriate area 
  3870. construction value when issuing GpiBeginArea. 
  3871.  
  3872.  
  3873. ΓòÉΓòÉΓòÉ 5.1.9. Area Construction ΓòÉΓòÉΓòÉ
  3874.  
  3875. An application specifies the area construction when it calls GpiBeginArea. 
  3876. There are two options: 
  3877.  
  3878. o BA_ALTERNATE  (the default) 
  3879. o BA_WINDING. 
  3880. Construction modes also are called area-fill modes; they provide different ways 
  3881. of determining whether a given point is included in the filled area.  Normally, 
  3882. the construction mode you use is a matter of personal preference. 
  3883.  
  3884.  
  3885. ΓòÉΓòÉΓòÉ 5.1.9.1. Alternate Mode ΓòÉΓòÉΓòÉ
  3886.  
  3887. In alternate mode, the following occurs: 
  3888.  
  3889. o A point is included in the filled area if you have to cross an odd number of 
  3890.   lines in the area when drawing a line from that point to infinity. 
  3891.  
  3892. o A point is not included in the filled area if you have to cross an even 
  3893.   number of lines in the area when drawing a line from that point to infinity. 
  3894. In the example in the following figure, the inner hexagon is not shaded, 
  3895. because to draw a line from any point in the hexagon to infinity, you must 
  3896. cross two boundary lines.  The remainder of the area is shaded, because to move 
  3897. outside the area, you need to cross only one boundary line. 
  3898.  
  3899. Calculating Filled Areas Constructed in Alternate Mode 
  3900.  
  3901.  
  3902. ΓòÉΓòÉΓòÉ 5.1.9.2. Winding Mode ΓòÉΓòÉΓòÉ
  3903.  
  3904. In winding mode, the direction in which the boundary lines in the area are 
  3905. drawn determines whether a given point is included in the filled area.  The 
  3906. direction of a line depends on both the graphics functions used to draw it and 
  3907. the world coordinates that define it.  For example, if the current position of 
  3908. a presentation space is (c,c), and GpiBox is called with the 
  3909. diagonally-opposite corner of the box specified as (d,d), GpiBox always draws 
  3910. the box in the following order: 
  3911.  
  3912.  1. (xc.,yc.) to 
  3913.  2. (xd.,yc.) to 
  3914.  3. (xd.,yd.) to 
  3915.  4. (xc.,yd.) and returning to 
  3916.  5. (xc.,yc.). 
  3917.  
  3918. As illustrated in the following figure, in some cases the box is drawn in a 
  3919. counterclockwise direction. When either xd. is less than xc., or yd. is less 
  3920. than yc., but not both, a box is drawn clockwise. 
  3921.  
  3922. The Box 
  3923.  
  3924. The current position is (3,2) and the specified corner is at (8,6).  The box is 
  3925. drawn from (3,2) to (8,2) to (8,6) to (3,8) to (3,2). 
  3926.  
  3927. For the polyline primitive, the direction in which a line is drawn depends on 
  3928. the relative values of the end points of each line, so you can choose whether 
  3929. to draw in a clockwise or counterclockwise direction. 
  3930.  
  3931. To determine if a given point is included in the filled area, count the number 
  3932. of lines to be crossed to move from that point to infinity.  For each boundary 
  3933. line drawn in one direction, add one to the tally.  For each line drawn in the 
  3934. opposite direction, subtract one from the tally.  A point is within the area if 
  3935. the result is nonzero. 
  3936.  
  3937. If two figures-for example, the hexagons in the following figure- are drawn in 
  3938. different directions, the tally for the inner hexagon is 0 and the area will 
  3939. look exactly as it does in alternate mode. 
  3940.  
  3941. Area Constructed in Different Directions in Winding Mode 
  3942.  
  3943. If the two hexagons are drawn in the same direction, the result is 2, and the 
  3944. inner hexagon is shaded as shown in the following figure. 
  3945.  
  3946. Area Constructed in the Same Direction in Winding Mode 
  3947.  
  3948. The boundary lines of the area in the previous figure have been drawn and are 
  3949. visible through the area-fill pattern. The boundary lines of an area primitive 
  3950. do not have to be drawn; but if they are, they are drawn according to the 
  3951. current line attributes. 
  3952.  
  3953. To vary the appearance of different parts of the boundary line, you can change 
  3954. the current line attributes during area definition. 
  3955.  
  3956. The boundary lines of an area are considered a part of the area's interior. 
  3957. Therefore, when you draw an area without boundary lines (BA_NOBOUNDARY), the 
  3958. area-fill pattern extends to include the boundaries of the area, and the area 
  3959. is the same size it would be if the boundary lines had been drawn. 
  3960.  
  3961.  
  3962. ΓòÉΓòÉΓòÉ 5.1.10. Attribute Currentness ΓòÉΓòÉΓòÉ
  3963.  
  3964. Graphics functions that change attributes are valid within the area bracket. 
  3965. There are misconceptions, however, about which attributes are used when the 
  3966. figures are displayed in a window or drawn to the printer. 
  3967.  
  3968. Review the following functional sequence: 
  3969.  
  3970. Function       Effect 
  3971.  
  3972. GpiColor       Sets color to red. 
  3973.  
  3974. GpiBeginArea   Opens area bracket. 
  3975.  
  3976. GpiLine        Draws a straight line. 
  3977.  
  3978. GpiColor       Sets color to green. 
  3979.  
  3980. GpiPolyLine    Draws two additional lines to form a triangle. 
  3981.  
  3982. GpiEndArea     Ends the area bracket and displays a picture. 
  3983.  
  3984. If you are displaying on a color monitor, the image appears as follows: 
  3985.  
  3986. The triangle has one red line, drawn with GpiLine, and two green lines, drawn 
  3987. with GpiPolyLine.  The interior of the triangle, if drawn, is red.  Red is the 
  3988. color that was current when the area was defined and, therefore, is the current 
  3989. color for the area interior.  In terms of the interior area, green is only the 
  3990. color that was current when the function that initiates drawing was called. 
  3991.  
  3992. If the application immediately opened a new area bracket, the interior of that 
  3993. bracket, if drawn, would be green. The color attribute for the second 
  3994. AREABUNDLE, is not "inherited" from the last AREABUNDLE drawn. 
  3995.  
  3996.  
  3997. ΓòÉΓòÉΓòÉ 5.2. About Polygon Primitives ΓòÉΓòÉΓòÉ
  3998.  
  3999. Area brackets have the flexibility to draw any combination of curved or 
  4000. straight lines and combine the results into a closed figure.  An advantage that 
  4001. polygons sometimes have over area brackets, however, is that they require fewer 
  4002. time-consuming calculations to provide that kind of flexibility. 
  4003.  
  4004. The operating system provides a function that enables you to draw multiple 
  4005. straight-line closed areas outside of an area bracket; and like 
  4006. bracket-generated areas, they can be adjacent, intersecting, or completely 
  4007. separate. 
  4008.  
  4009. The function is GpiPolygons, and the set of objects it draws are called polygon 
  4010. primitives. A polygon primitive is any set of polygons with specified vertices 
  4011. that can be filled or filled and outlined. This function accepts as input the 
  4012. desired number of polygons, the POLYGON data structure for each polygon, and a 
  4013. boundary and construction option similar to those of the GpiBeginArea function. 
  4014.  
  4015. The purpose of GpiPolygons is to enable you to specify an area in such a way as 
  4016. to pass all of the area boundaries at once.  This improves performance 
  4017. significantly because the operating system cannot process the accumulated 
  4018. primitives inside an area bracket until it reaches the GpiEndArea function. 
  4019. GpiPolygons is not valid inside an area bracket because the figures it defines 
  4020. are areas already. 
  4021.  
  4022. Although GpiPolygons is limited to straight line figures, it retains a great 
  4023. deal of flexibility.  The polygon data structure (POLYGON) contains the number 
  4024. of vertices; and the vertices, themselves, are in world coordinates. The 
  4025. collection of POLYGON structures accepted in a single GpiPolygons function is 
  4026. not limited to one type of polygon. 
  4027.  
  4028. The drawing of the first polygon begins at the current position. For all 
  4029. subsequent polygons, all vertices must be explicitly defined. If the individual 
  4030. polygons are not completely defined, they are closed with a straight line drawn 
  4031. from the last defined vertex to the first. 
  4032.  
  4033. After the application has defined the polygons, they may be transformed and 
  4034. manipulated just as other primitives are. 
  4035.  
  4036.  
  4037. ΓòÉΓòÉΓòÉ 5.2.1. Polygon Boundaries ΓòÉΓòÉΓòÉ
  4038.  
  4039. Applications have two options when specifying the polygon boundary: 
  4040.  
  4041. o POLYGON_BOUNDARY (the default) 
  4042. o POLYGON_NOBOUNDARY. 
  4043.  
  4044. The POLYGON_BOUNDARY value tells the PM programming interface to draw all 
  4045. outlines of the polygon primitives using a line that conforms to the current 
  4046. LINEBUNDLE attributes. If the line attributes have not been changed, the 
  4047. default outline color is black on most display devices and printers, and the 
  4048. default line style is solid. As the attributes cannot be changed within the 
  4049. context of GpiPolygons, all polygons are drawn with the same line. The interior 
  4050. of the polygons are filled with the pattern that conforms to the current 
  4051. AREABUNDLE attributes. 
  4052.  
  4053. To prevent PM from outlining an area, an application can use the 
  4054. POLYGON_NOBOUNDARY flag when issuing GpiPolygons. Only the interior fill 
  4055. pattern is visible. This value is used most often when there are many 
  4056. overlapping polygons, and the interior lines are not desired. 
  4057.  
  4058. You might think of this option in terms similar to the outline and fill options 
  4059. discussed with boxes and full arcs in Line and Arc Primitives. The 
  4060. POLYGON_BOUNDARY value corresponds to the DRO_OUTLINEFILL value; and 
  4061. POLYGON_NOBOUNDARY, to the DRO_FILL. There is no distinct boundary value that 
  4062. corresponds to DRO_OUTLINE, the simple outline. 
  4063.  
  4064. To simulate this effect, OR the POLYGON_NOBOUNDARY value with the appropriate 
  4065. polygon construction value, described below, when issuing GpiPolygons. 
  4066.  
  4067.  
  4068. ΓòÉΓòÉΓòÉ 5.2.2. Polygon Construction ΓòÉΓòÉΓòÉ
  4069.  
  4070. An application specifies the area construction when it calls GpiBeginArea. 
  4071. There are two options: 
  4072.  
  4073. o POLYGON_ALTERNATE (the default) 
  4074. o POLYGON_WINDING. 
  4075.  
  4076. As with area construction, in alternate mode: 
  4077.  
  4078. o A point is included in the filled polygon if you have to cross an odd number 
  4079.   of lines in the set of polygons when drawing a line from that point to 
  4080.   infinity. 
  4081.  
  4082. o A point is not included in the filled polygon if you have to cross an even 
  4083.   number of lines in the set of polygons when drawing a line from that point to 
  4084.   infinity. 
  4085.  
  4086. Also as with area construction, in winding mode, the direction in which the 
  4087. boundary lines of the polygons are drawn determines whether a given point is 
  4088. included in the filled polygon. Since the individual polygons drawn with 
  4089. GpiPolygons are generated by independent structures, the direction in which a 
  4090. polygon is drawn depends only on the vertices of that polygon. 
  4091.  
  4092. To determine if a given point is included in the filled polygon, count the 
  4093. number of lines to be crossed to move from that point to infinity. For each 
  4094. boundary line drawn in one direction add one to the tally. For each line drawn 
  4095. in the opposite direction, subtract one from the tally. A point is within the 
  4096. polygon if the result is nonzero. 
  4097.  
  4098.  
  4099. ΓòÉΓòÉΓòÉ 5.2.3. Polygon Overlap ΓòÉΓòÉΓòÉ
  4100.  
  4101. An application specifies which pels are drawn when it calls GpiPolygons. There 
  4102. are two options: 
  4103.  
  4104. o POLYGON_INCL (the default) 
  4105. o POLYGON_EXCL. 
  4106.  
  4107. When the overlap value is POLYGON_INCL, the bottom right is included in the 
  4108. polygon. The value POLYGON_EXCL, the exclusive value, indicates that the bottom 
  4109. right is excluded from the polygon. This value acts in conjunction with the mix 
  4110. attribute in determining the appearance of a polygon, which is especially 
  4111. important for a group of overlapping or adjacent polygons. 
  4112.  
  4113. For example, GpiPolygons specifies a number of polygons. Two of the polygons 
  4114. share the vertex pair (6,7) and (9,7). When the polygons are drawn, if the 
  4115. overlap value was POLYGON_INCL, there are two distinct lines to be drawn from 
  4116. (6,7) to (9,7). A mix attribute other than FM_OVERPAINT could cause undesirable 
  4117. results as the line and drawing-surface colors mix. 
  4118.  
  4119. As with the polygon boundary and construction values, the overlap value can be 
  4120. ORed when issuing GpiPolygons to create a specific effect. 
  4121.  
  4122.  
  4123. ΓòÉΓòÉΓòÉ 5.3. Using Area and Polygon Primitives ΓòÉΓòÉΓòÉ
  4124.  
  4125. You can use area functions to: 
  4126.  
  4127. o Draw one or more closed figures 
  4128. o Create a custom fill pattern from a bit map 
  4129. o Create a custom fill pattern from a font character. 
  4130.  
  4131.  
  4132. ΓòÉΓòÉΓòÉ 5.3.1. Drawing a Single, Closed Figure ΓòÉΓòÉΓòÉ
  4133.  
  4134. The following figure shows an example of how to use area functions to draw a 
  4135. single closed figure that is filled with a vertical pattern using the alternate 
  4136. mode. The closed figure in this example is a 5-pointed star. 
  4137.  
  4138. #define INCL_GPI
  4139. #include <os2.h>
  4140. void fncAREA02(void){
  4141.    POINTL aptl[5];               /* Structure for current position */
  4142.    HPS hps;
  4143.  
  4144.     /* Initialize the array of points for the 5-pointed star.       */
  4145.     aptl[0].x = 400; aptl[0].y = 195;
  4146.     aptl[1].x = 40;  aptl[1].y = 320;
  4147.     aptl[2].x = 260; aptl[2].y = 10;
  4148.     aptl[3].x = 260; aptl[3].y = 390;
  4149.     aptl[4].x = 37;  aptl[4].y = 82;
  4150.  
  4151.     GpiSetPattern(hps, PATSYM_VERT);/* Set pattern outside bracket */
  4152.  
  4153.     /* Draw the star. */
  4154.     GpiBeginArea(hps, BA_ALTERNATE);
  4155.     GpiMove(hps, &aptl[4]);         /* First and last point of star */
  4156.     GpiPolyLine(hps, 5L, aptl);
  4157.     GpiEndArea(hps);
  4158. } /* fncAREA02 */
  4159.  
  4160.  
  4161. Drawing a Closed Figure 
  4162.  
  4163.  
  4164. ΓòÉΓòÉΓòÉ 5.3.2. Drawing Multiple, Intersecting, Closed Figures ΓòÉΓòÉΓòÉ
  4165.  
  4166. The following figure is an example of how to use area functions to draw two 
  4167. intersecting boxes, filled, using the winding mode. 
  4168.  
  4169. #define INCL_GPI
  4170. #include <os2.h>
  4171. void fncAREA03(void){
  4172.     POINTL ptl;            /* Structure for current position */
  4173.     HPS    hps;
  4174.  
  4175.     GpiBeginArea(hps, BA_WINDING);
  4176.     ptl.x = 100;
  4177.     ptl.y = 50;
  4178.     GpiMove(hps, &ptl);
  4179.     ptl.x = 300;
  4180.     ptl.y = 250;
  4181.     GpiBox(hps, DRO_OUTLINE, &ptl, 0, 0);
  4182.     ptl.x = 180;
  4183.     ptl.y = 120;
  4184.     GpiMove(hps, &ptl);
  4185.     ptl.x = 380;
  4186.     ptl.y = 320;
  4187.     GpiBox(hps, DRO_OUTLINE, &ptl, 0, 0);
  4188.     GpiEndArea(hps);
  4189. } /* fncAREA03 */
  4190.  
  4191.  
  4192. Drawing Multiple Intersecting Closed Figures 
  4193.  
  4194.  
  4195. ΓòÉΓòÉΓòÉ 5.3.3. Creating a Custom Fill Pattern from a Bit Map ΓòÉΓòÉΓòÉ
  4196.  
  4197. The following figure is an example of how to create a custom fill pattern by 
  4198. using a hard-coded bit map. In this example, the bit map creates a pattern of 
  4199. arrows. 
  4200.  
  4201. #define INCL_DOS
  4202. #define INCL_GPI
  4203. #define INCL_WIN
  4204. #include <os2.h>
  4205.    LONG lcidCustom;                  /* Bit map tag                           */
  4206.    HPS  hps;
  4207.  
  4208.    VOID CreatePattern(VOID);
  4209.  
  4210.    VOID MyFunction(VOID){
  4211.        CreatePattern();
  4212.        GpiSetPatternSet(hps, lcidCustom);
  4213.         .
  4214.         .
  4215.         .
  4216.    } /* func */
  4217.  
  4218.    VOID CreatePattern(VOID){
  4219.         HBITMAP hbm;               /* Bit map handle                          */
  4220.         BITMAPINFOHEADER2 bmp2;    /* Structure for bit map information       */
  4221.         PBITMAPINFO2 pbmi2;        /* Pointer to structure for bit map data   */
  4222.         PRGB2 prgb2;               /* Structure for color data                */
  4223.         ULONG cbBitmapInfo, cColors;
  4224.  
  4225.         BYTE abPattern[] = { 0xFF, 0xFF, 0xE7, 0xFF,
  4226.                              0xE7, 0xFF, 0xC3, 0xFF,
  4227.                              0xC3, 0xFF, 0x81, 0xFF,
  4228.                              0x81, 0xFF, 0xE7, 0xFF,
  4229.                              0xE7, 0xFF, 0xE7, 0xFF,
  4230.                              0xE7, 0xFF, 0xE7, 0xFF,
  4231.                              0xE7, 0xFF, 0xE7, 0xFF,
  4232.                              0xE7, 0xFF, 0xFF, 0xFF
  4233.    };
  4234.  
  4235.  
  4236.         lcidCustom = 1;            /* Bit map tag                             */
  4237.  
  4238.         bmp2.cbFix = (ULONG) sizeof(BITMAPINFOHEADER2);
  4239.         bmp2.cx = 8;               /* Bit map is 8 pels wide                  */
  4240.         bmp2.cy = 8;               /* Bit map is 8 pels high                  */
  4241.         bmp2.cPlanes = 1;          /* One bit plane                           */
  4242.         bmp2.cBitCount = 1;        /* One bit per pel                         */
  4243.  
  4244.         /* Use default values for the remainder of the structure.             */
  4245.  
  4246.         bmp2.ulCompression = 0;
  4247.         bmp2.cbImage = 0;
  4248.         bmp2.cxResolution = 0;
  4249.         bmp2.cyResolution = 0;
  4250.         bmp2.cclrUsed = 0;
  4251.         bmp2.cclrImportant = 0;
  4252.         bmp2.usUnits = 0;
  4253.         bmp2.usReserved = 0;
  4254.         bmp2.usRecording = 0;
  4255.         bmp2.usRendering = 0;
  4256.         bmp2.cSize1 = 0;
  4257.         bmp2.cSize2 = 0;
  4258.         bmp2.ulColorEncoding = 0;
  4259.         bmp2.ulIdentifier = 0;
  4260.  
  4261.         cColors = 1 << (bmp2.cBitCount * bmp2.cPlanes);
  4262.  
  4263.         cbBitmapInfo = sizeof(BITMAPINFO2) + (sizeof(RGB2) * cColors);
  4264.  
  4265.         DosAllocMem((PVOID)&pbmi2, cbBitmapInfo,
  4266.                     PAG_COMMIT | PAG_READ | PAG_WRITE);
  4267.  
  4268.         pbmi2->cbFix = bmp2.cbFix;
  4269.         pbmi2->cx = bmp2.cx;
  4270.         pbmi2->cy = bmp2.cy;
  4271.         pbmi2->cPlanes = bmp2.cPlanes;
  4272.         pbmi2->cBitCount = bmp2.cBitCount;
  4273.  
  4274.         /* Use default values for the remainder of the structure.             */
  4275.  
  4276.         pbmi2->ulCompression = 0;
  4277.         pbmi2->cbImage = 0;
  4278.         pbmi2->cxResolution = 0;
  4279.         pbmi2->cyResolution = 0;
  4280.         pbmi2->cclrUsed = 0;
  4281.         pbmi2->cclrImportant = 0;
  4282.         pbmi2->usUnits = 0;
  4283.         pbmi2->usReserved = 0;
  4284.         pbmi2->usRecording = 0;
  4285.         pbmi2->usRendering = 0;
  4286.         pbmi2->cSize1 = 0;
  4287.         pbmi2->cSize2 = 0;
  4288.         pbmi2->ulColorEncoding = 0;
  4289.         pbmi2->ulIdentifier = 0;
  4290.  
  4291.         prgb2 = (PRGB2) (pbmi2 + 1);  /* Set address to follow bmp2           */
  4292.  
  4293.         /* Set bit map colors to black and white.                             */
  4294.         prgb2[0].bBlue = 0;                               /* Color[0] = black */
  4295.         prgb2[0].bGreen = 0;                              /* Color[0] = black */
  4296.         prgb2[0].bRed = 0;                                /* Color[0] = black */
  4297.         prgb2[0].fcOptions = 0;
  4298.         prgb2[1].bBlue = 255;                             /* Color[1] = white */
  4299.         prgb2[1].bGreen = 255;                            /* Color[1] = white */
  4300.         prgb2[1].bRed = 255;                              /* Color[1] = white */
  4301.         prgb2[1].fcOptions = 0;
  4302.  
  4303.         /* Create a bit map and retrieve its handle.                          */
  4304.         hbm = GpiCreateBitmap(hps,
  4305.             &bmp2,
  4306.             CBM_INIT,
  4307.             (PBYTE) abPattern,                            /* Array of bits    */
  4308.             pbmi2);
  4309.  
  4310.         /* Tag the bit map just created with a custom identifier (lcid).      */
  4311.         GpiSetBitmapId(hps, hbm, lcidCustom);
  4312.    } /* CreatePattern */
  4313.  
  4314.  
  4315. Creating a Custom Fill Pattern from a Bit Map 
  4316.  
  4317.  
  4318. ΓòÉΓòÉΓòÉ 5.3.4. Creating a Custom Fill Pattern from a Font Character ΓòÉΓòÉΓòÉ
  4319.  
  4320. The following figure is an example of how to create a custom fill pattern by 
  4321. using a character from a font. The fill pattern can be only an 8-by-8 bit map; 
  4322. as a result, not all of the character is used. 
  4323.  
  4324. #define INCL_GPI
  4325. #define INCL_WIN
  4326. #include <os2.h>
  4327.    HPS hps;                      /* Presentation-space handle */
  4328.    LONG lcidCustom;              /* Font identifier           */
  4329.    FONTMETRICS afm[80];
  4330.    FATTRS fat;
  4331.  
  4332.    VOID LoadFont(VOID);
  4333.  
  4334.    void fncAREA05(void){
  4335.  
  4336. figseg fit=11.
  4337.         LoadFont();
  4338. GpiSetPatternSet(hps, lcidCustom);
  4339. GpiSetPattern(hps, 'o');         /* Use lowercase 'o' as fill */
  4340.     .
  4341.     .
  4342.     .
  4343.    } /* fncAREA05 */
  4344.  
  4345.    VOID LoadFont(VOID){
  4346.       LONG cFonts = 0;
  4347.       LONG cPublicFonts, i;
  4348.  
  4349.       lcidCustom = 1;
  4350.  
  4351. /* Determine the number of loaded public fonts.               */
  4352. cPublicFonts = GpiQueryFonts(hps, QF_PUBLIC, NULL, (PLONG) &cFonts,
  4353.     (LONG) (sizeof(FONTMETRICS)), NULL);
  4354.  
  4355. /* Load the metrics for all public fonts into afm.            */
  4356. GpiQueryFonts(hps, QF_PUBLIC, NULL, (PLONG) &cPublicFonts,
  4357.     (LONG) (sizeof(FONTMETRICS)), afm);
  4358.  
  4359. /* Get the first image font with a point size larger than 8.  */
  4360. for (i = 0; ((afm[i].fsDefn & FM_DEFN_OUTLINE) ||
  4361.      afm[i].lEmHeight <= 8) && i < cPublicFonts; i++);
  4362.  
  4363. /* Load the FATTRS structure with the required metrics.       */
  4364. fat.usRecordLength = sizeof(fat);
  4365. fat.fsSelection = 0;
  4366. fat.lMatch = afm[i].lMatch;
  4367. StringCopy(fat.szFacename, afm[i].szFacename);
  4368. fat.idRegistry = 0;
  4369. fat.usCodePage = 0;
  4370. fat.lMaxBaselineExt = 0;
  4371. fat.lAveCharWidth = 0;
  4372. fat.fsType = 0;
  4373. fat.fsFontUse = 0;
  4374.  
  4375. /* Select this font and assign it a custom lcid.              */
  4376. GpiCreateLogFont(hps, NULL, lcidCustom, &fat);
  4377. GpiSetCharSet(hps, lcidCustom);
  4378. } /* LoadFont */
  4379.  
  4380. Creating a Custom Fill Pattern from a Font Character 
  4381.  
  4382.  
  4383. ΓòÉΓòÉΓòÉ 5.4. Summary ΓòÉΓòÉΓòÉ
  4384.  
  4385. The following table summarizes the area and polygon primitive functions. 
  4386.  
  4387. Area-Primitive Functions 
  4388.  
  4389. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4390. ΓöéFunction Name           ΓöéDescription                         Γöé
  4391. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4392. ΓöéGpiBeginArea            ΓöéStarts the area bracket and sets theΓöé
  4393. Γöé                        Γöéoutline option and fill mode.       Γöé
  4394. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4395. ΓöéGpiEndArea              ΓöéEnds the area bracket and draws the Γöé
  4396. Γöé                        Γöéarea.                               Γöé
  4397. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4398. ΓöéGpiPolygons             ΓöéDraws a series of closed,           Γöé
  4399. Γöé                        Γöéstraight-line figures.              Γöé
  4400. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4401. ΓöéGpiQueryPattern         ΓöéDetermines the current bit map fill Γöé
  4402. Γöé                        Γöépattern.                            Γöé
  4403. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4404. ΓöéGpiQueryPatternRefPoint ΓöéDetermines the fill-pattern         Γöé
  4405. Γöé                        Γöéreference point in world            Γöé
  4406. Γöé                        Γöécoordinates.                        Γöé
  4407. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4408. ΓöéGpiQueryPatternSet      ΓöéDetermines the local identifier of aΓöé
  4409. Γöé                        Γöébit map or font.                    Γöé
  4410. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4411. ΓöéGpiSetPattern           ΓöéDefines the fill pattern from the   Γöé
  4412. Γöé                        Γöésupplied patterns or from a code    Γöé
  4413. Γöé                        Γöépoint for a character or symbol in aΓöé
  4414. Γöé                        Γöéfont.                               Γöé
  4415. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4416. ΓöéGpiSetPatternRefPoint   ΓöéDefines the fill-pattern reference  Γöé
  4417. Γöé                        Γöépoint in world coordinates.         Γöé
  4418. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4419. ΓöéGpiSetPatternSet        ΓöéDefines the fill-pattern attribute  Γöé
  4420. Γöé                        Γöéto a local identifier of a bit map  Γöé
  4421. Γöé                        Γöéor font.                            Γöé
  4422. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4423. The following table summarizes the data structures used by the area and polygon 
  4424. primitive functions. 
  4425.  
  4426. Area-Primitive Structure 
  4427.  
  4428. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4429. ΓöéStructure Name          ΓöéDescription                         Γöé
  4430. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4431. ΓöéAREABUNDLE              ΓöéA structure of area primitive       Γöé
  4432. Γöé                        Γöéattributes.                         Γöé
  4433. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4434. ΓöéLINEBUNDLE              ΓöéA structure of line primitive       Γöé
  4435. Γöé                        Γöéattributes, which controls the      Γöé
  4436. Γöé                        Γöéoutline of the area primitives.     Γöé
  4437. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4438. ΓöéPOINTL                  ΓöéA structure specifying the values a Γöé
  4439. Γöé                        Γöésingle pair of x- and y-coordinates.Γöé
  4440. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4441. ΓöéPOLYGON                 ΓöéA structure that describes a        Γöé
  4442. Γöé                        Γöéstraight line polygon. It contains aΓöé
  4443. Γöé                        Γöécount of the vertices, and an array Γöé
  4444. Γöé                        Γöéof POINTL structures to describe theΓöé
  4445. Γöé                        Γöécoordinates of each vertex.         Γöé
  4446. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4447.  
  4448.  
  4449. ΓòÉΓòÉΓòÉ 6. Character String Primitives ΓòÉΓòÉΓòÉ
  4450.  
  4451. Character string primitives are printed or displayed text limited to a length 
  4452. of 256 characters by the PM programming interface. 
  4453.  
  4454. The following topics are related to the information in this chapter: 
  4455.  
  4456. o Presentation spaces 
  4457. o Device contexts 
  4458. o Color and mix attributes 
  4459. o Fonts 
  4460. o Coordinate spaces 
  4461. o Transformations. 
  4462.  
  4463.  
  4464. ΓòÉΓòÉΓòÉ 6.1. About Character String Primitives ΓòÉΓòÉΓòÉ
  4465.  
  4466. A PM application must make certain choices about fonts in preparation for text 
  4467. display or printing. Often these choices are driven by selections from a user. 
  4468. After the selections are made, as discussed in Fonts, the application can make 
  4469. additional decisions about the appearance of the individual characters within 
  4470. the font by setting attributes in the CHARBUNDLE data structure. CHARBUNDLE is 
  4471. the lowest of three levels of data structures that define the appearance of 
  4472. displayed or printed text. The other two, FONTMETRICS and FATTRS, are described 
  4473. in Fonts. 
  4474.  
  4475. A font family-for instance, Helvetica** or Courier-is a collection of fonts. 
  4476. Fonts within the same family share certain attributes such as stroke width and 
  4477. serif characteristics. However, the individual fonts differ from each other in 
  4478. the following ways: 
  4479.  
  4480. o Height 
  4481. o Line weight 
  4482. o Appearance. 
  4483.  
  4484. Stroke width refers to the width of lines used to draw characters and symbols 
  4485. from a font. A serif is a short crossline drawn at the ends of the main strokes 
  4486. that form a character or symbol. Height refers to the point size of a font. A 
  4487. common example of line weight is boldface. A common example of appearance is 
  4488. italic. 
  4489.  
  4490. The most important factor that affects the CHARBUNDLE attributes is whether the 
  4491. current font is an image or an outline font. The following figure shows an 
  4492. example of the difference. 
  4493.  
  4494. Image and Outline Fonts 
  4495.  
  4496. Outline fonts are composed of characters drawn with straight and curved lines. 
  4497. Image fonts, also called bit map fonts, are composed of pels arranged in 
  4498. certain shapes. 
  4499.  
  4500.  
  4501. ΓòÉΓòÉΓòÉ 6.1.1. Attributes of Character String Primitives ΓòÉΓòÉΓòÉ
  4502.  
  4503. Attributes of the character string primitives contained in CHARBUNDLE are as 
  4504. follows: 
  4505.  
  4506. o Character set 
  4507. o Character mode 
  4508. o Character cell 
  4509. o Character angle 
  4510. o Character shear 
  4511. o Character direction 
  4512. o Character text alignment 
  4513. o Character extra 
  4514. o Character break extra 
  4515. o Foreground color 
  4516. o Background color 
  4517. o Foreground mix 
  4518. o Background mix. 
  4519.  
  4520. When an application creates a presentation space, the character string 
  4521. attributes are set to the default values shown in the following table. 
  4522.  
  4523. Character String Attribute Default Values 
  4524.  
  4525. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4526. ΓöéAttribute   ΓöéDefault Value           ΓöéFunction that Redefines Attribute Γöé
  4527. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4528. ΓöéSet         ΓöéLCID_DEFAULT            ΓöéGpiSetCharSet                     Γöé
  4529. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4530. ΓöéMode        ΓöéCM_MODE1                ΓöéGpiSetCharMode                    Γöé
  4531. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4532. ΓöéCell        ΓöéOutline font - Defined  ΓöéGpiSetCharBox                     Γöé
  4533. Γöé            Γöéby device               Γöé                                  Γöé
  4534. Γöé            ΓöéImage font - Defined by Γöé                                  Γöé
  4535. Γöé            Γöéfont                    Γöé                                  Γöé
  4536. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4537. ΓöéAngle       Γöé(1,0)                   ΓöéGpiSetCharAngle                   Γöé
  4538. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4539. ΓöéShear       Γöé(0,1)                   ΓöéGpiSetCharShear                   Γöé
  4540. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4541. ΓöéDirection   ΓöéLeft to right           ΓöéGpiSetCharDirection               Γöé
  4542. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4543. ΓöéText        ΓöéLeft                    ΓöéGpiSetTextAlignment               Γöé
  4544. Γöéalignment   Γöé                        Γöé                                  Γöé
  4545. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4546. ΓöéExtra       Γöé0                       ΓöéGpiSetCharExtra                   Γöé
  4547. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4548. ΓöéBreak extra Γöé0                       ΓöéGpiSetCharBreakExtra              Γöé
  4549. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4550. ΓöéForeground  ΓöéBlack                   ΓöéGpiSetAttrs (CBB_COLOR)           Γöé
  4551. Γöécolor       Γöé                        Γöé                                  Γöé
  4552. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4553. ΓöéBackground  ΓöéClear                   ΓöéGpiSetAttrs (CBB_BACK_COLOR)      Γöé
  4554. Γöécolor       Γöé                        Γöé                                  Γöé
  4555. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4556. ΓöéForeground  ΓöéOverpaint               ΓöéGpiSetAttrs (CBB_MIX_MODE)        Γöé
  4557. Γöémix         Γöé                        Γöé                                  Γöé
  4558. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4559. ΓöéBackground  ΓöéLeave alone             ΓöéGpiSetAttrs (CBB_BACK_MIX_MODE)   Γöé
  4560. Γöémix         Γöé                        Γöé                                  Γöé
  4561. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4562.  
  4563. Current character attributes take effect when you send graphics characters to 
  4564. an output device; they have no effect at the time you define a logical font. 
  4565.  
  4566.  
  4567. ΓòÉΓòÉΓòÉ 6.1.2. Character Set ΓòÉΓòÉΓòÉ
  4568.  
  4569. Character set defines the local identifier, lcid, of the current font. The font 
  4570. lcid is set using GpiSetCharSet. GpiCreateLogFont, described in Fonts, 
  4571. associates the font with an lcid. 
  4572.  
  4573. The value of the current lcid is determined using GpiQueryCharSet. 
  4574.  
  4575.  
  4576. ΓòÉΓòÉΓòÉ 6.1.3. Character Mode ΓòÉΓòÉΓòÉ
  4577.  
  4578. Every presentation space has a current character mode, which determines the 
  4579. extent to which a font can be affected by the attributes defined in CHARBUNDLE. 
  4580. The mode affects compatibility issues that are invisible to both the user and 
  4581. the programmer. The following table describes the character modes and their 
  4582. influences on the current font. 
  4583.  
  4584. An application selects a character mode using GpiSetCharMode. When a mode is 
  4585. selected, it applies to any font (including the system font) used while the 
  4586. mode is current. The character mode takes effect when you draw character 
  4587. strings; it has no effect at the time you define a logical font. 
  4588.  
  4589. Character Mode Effects on Character Attributes 
  4590.  
  4591. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4592. ΓöéCharacter ΓöéIf Image Font...            ΓöéIf Outline Font...    Γöé
  4593. ΓöéMode      Γöé                            Γöé                      Γöé
  4594. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4595. ΓöéCM_MODE1  ΓöéIgnores all current         ΓöéAffected by all       Γöé
  4596. Γöé          Γöécharacter attributes, exceptΓöécurrent character     Γöé
  4597. Γöé          Γöécharacter direction.        Γöéattributes.           Γöé
  4598. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4599. ΓöéCM_MODE2  ΓöéUses the character shear,   ΓöéAffected by all       Γöé
  4600. Γöé          Γöébox, angle, and direction   Γöécurrent character     Γöé
  4601. Γöé          Γöéattributes to position the  Γöéattributes.           Γöé
  4602. Γöé          Γöécharacter cell, but the     Γöé                      Γöé
  4603. Γöé          Γöécharacters themselves are   Γöé                      Γöé
  4604. Γöé          Γöénot sheared, rotated,       Γöé                      Γöé
  4605. Γöé          Γöéscaled, or reversed.        Γöé                      Γöé
  4606. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4607. ΓöéCM_MODE3  ΓöéRaises an error if you try  ΓöéAffected by all       Γöé
  4608. Γöé          Γöéto draw a character string. Γöécurrent character     Γöé
  4609. Γöé          ΓöéNote:  Any font used when   Γöéattributes.           Γöé
  4610. Γöé          Γöéthe current character mode  Γöé                      Γöé
  4611. Γöé          Γöéis CM_MODE3 must be an      Γöé                      Γöé
  4612. Γöé          Γöéoutline font.               Γöé                      Γöé
  4613. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4614.  
  4615. The default character mode (CM_DEFAULT) is identical to CM_MODE1. 
  4616.  
  4617.  
  4618. ΓòÉΓòÉΓòÉ 6.1.4. Character Cell ΓòÉΓòÉΓòÉ
  4619.  
  4620. A character cell is an imaginary rectangular boundary that defines the 
  4621. horizontal and vertical space occupied by a single character from an outline 
  4622. character set. 
  4623.  
  4624. The PM programming interface calculates character cell width and height from 
  4625. the point size. The width value for the character cell is the nominal width of 
  4626. the lowercase characters in the character set. In a monospace font, the width 
  4627. of all character cells is identical. In a proportional font, the width of the 
  4628. character cells depends on the character. 
  4629.  
  4630. In an image font, the height of the character cell is the number of pels in the 
  4631. font. In an outline font, the height of the character cell is the point size of 
  4632. the font. 
  4633.  
  4634. The characters in a character string are positioned one character per cell. The 
  4635. spacing between adjacent characters in a string is affected by the character 
  4636. cell attribute, except for image characters in CM_MODE1. 
  4637.  
  4638. Cell width determines the spacing of consecutive characters along the baseline, 
  4639. as illustrated in the following figure. 
  4640.  
  4641. Character Cell Measurements 
  4642.  
  4643. Current cell size is specified using GpiSetCharBox. As input, this function 
  4644. accepts the desired height and width of the character cell in world 
  4645. coordinates. These values are related to certain dimensions in the FONTMETRICS 
  4646. structure that controls font attributes. Heights or widths of 0 are valid input 
  4647. and cause the outline character to be drawn as a point or straight line. 
  4648. Heights or widths of negative values cause certain special effects, for 
  4649. example, reversed lettering. 
  4650.  
  4651. The character cell value affects both the size and position of characters drawn 
  4652. from an outline font, regardless of the current character mode. Each character 
  4653. is scaled up or down to fit the cell size, as shown in the following figure. 
  4654.  
  4655. Effect of the Character Cell on an Outline Font 
  4656.  
  4657. The character cell value is ignored if the current font is an image font and 
  4658. the current character mode is CM_MODE1, as shown in the following figure. 
  4659.  
  4660. Note:  It is essential to code the character cell correctly, even if you 
  4661.        anticipate using image fonts. In case of a font match failure, an 
  4662.        outline font can be substituted for a image font. 
  4663.  
  4664. Effect of the Character Cell on an Image Font in CM_MODE1 
  4665.  
  4666. Although the character cell has been both increased and decreased, the 
  4667. character string is unaltered. 
  4668.  
  4669. The character cell value controls the positioning of image-font characters when 
  4670. the current character mode is CM_MODE2; but it cannot cause the characters to 
  4671. be scaled to fit the cell. This effect is shown in the following figure. 
  4672.  
  4673. Effect of the Character Cell on an Image Font in CM_MODE2 
  4674.  
  4675. If you increase the character cell size for an image font in CM_MODE2, the 
  4676. characters are more widely spaced, but their size is not changed. If you 
  4677. decrease character cell size, the space between the characters is reduced, and 
  4678. because the characters themselves cannot be scaled, they can overlap. 
  4679.  
  4680.  
  4681. ΓòÉΓòÉΓòÉ 6.1.4.1. Default Character Cell ΓòÉΓòÉΓòÉ
  4682.  
  4683. The default character-cell size is a device-dependent value. You do not need to 
  4684. know this value unless you want to switch back to the initial default value 
  4685. after having specified another value. It is recommended that you save initial 
  4686. default values using GpiSavePS. 
  4687.  
  4688. The default character cell, like other default attributes, can be set using 
  4689. GpiSetDefAttrs (CBB_BOX). If necessary, you can query the current default value 
  4690. using GpiQueryDefAttrs. 
  4691.  
  4692.  
  4693. ΓòÉΓòÉΓòÉ 6.1.4.2. Coding a Character Cell ΓòÉΓòÉΓòÉ
  4694.  
  4695. The dimensions that an application passes to GpiSetCharBox and that 
  4696. GpiQueryCharBox returns are fixed-point values. A fixed value is a 32-bit value 
  4697. whose high-order 16 bits contain the integral part of the floating-point number 
  4698. and whose low-order 16 bits contain the fractional part. The fractional part is 
  4699. the numerator of a fraction whose denominator is fixed at 65536. The MAKEFIXED 
  4700. macro provides a method for producing fixed values. If, for example, one of the 
  4701. character cell dimensions were 7.635 world units, an application could obtain 
  4702. the corresponding fixed value by using the MAKEFIXED macro, passing 7 as the 
  4703. first argument and 41615 as the second. 
  4704.  
  4705. The purpose of the character cell is to assist other font metrics, described in 
  4706. Fonts, to define text lines. For example, if you planned to have an average 
  4707. text line of 60 characters, dividing your output width by 60 would provide your 
  4708. character cell width. 
  4709.  
  4710. DevQueryCaps can be used to provide information about suitable character cell 
  4711. values. DevQueryCaps returns two sets of values that can influence the 
  4712. character cell: 
  4713.  
  4714. o Default cell values 
  4715.  
  4716.    - CAPS_GRAPHICS_CHAR_WIDTH 
  4717.    - CAPS_GRAPHICS_CHAR_HEIGHT. 
  4718.  
  4719. o Device resolution 
  4720.  
  4721.    - CAPS_HORIZONTAL_FONT_RES 
  4722.    - CAPS_VERTICAL_FONT_RES. 
  4723.  
  4724. The default cell values return the size of the default character cell in pels. 
  4725. Convert the device resolution into character cell values by multiplying it by 
  4726. the desired point size, then dividing by 72 (72.2818). 
  4727.  
  4728.  
  4729. ΓòÉΓòÉΓòÉ 6.1.5. Character Angle ΓòÉΓòÉΓòÉ
  4730.  
  4731. The character angle is defined by the x-axis and a vector drawn through the 
  4732. origin to a specified point in a Cartesian coordinate system. Neither (0,0) nor 
  4733. the specified point need have any relation to the current position. The 
  4734. operating system then aligns the baseline with this vector. 
  4735.  
  4736. An application can retrieve the point that defines the character angle vector 
  4737. using GpiQueryCharAngle. An application can set the character angle using 
  4738. GpiSetCharAngle. This function accepts as input the x- and y-coordinates of a 
  4739. point that defines the new vector. When you specify an angle, it becomes the 
  4740. current setting. To reset the character angle vector to its default value 
  4741. (parallel to the x-axis), call GpiSetCharAngle with both x and y equal to 0. 
  4742.  
  4743. The effects of the current character angle vary depending on the current 
  4744. character mode and the current font type. When the current font is an outline 
  4745. font, the current character angle determines the angle of both the whole string 
  4746. and the individual characters in the string, regardless of the current 
  4747. character mode. The baseline of each character cell is drawn parallel to the 
  4748. new baseline, as shown in the following figure. 
  4749.  
  4750. Effect of the Character Angle on an Outline Font 
  4751.  
  4752. The character string is drawn parallel to the vector drawn from the origin to 
  4753. (10,7). The baseline of each of the character cells also is drawn parallel to 
  4754. this vector. 
  4755.  
  4756. The character angle value is ignored if the current font is an image font and 
  4757. the current character mode is CM_MODE1, as shown in the following figure. 
  4758.  
  4759. Effect of the Character Angle on an Image Font in CM_MODE1 
  4760.  
  4761. The angle of the character string is unaltered by GpiSetCharAngle. 
  4762.  
  4763. When the current font is an image font and the current character mode is 
  4764. CM_MODE2, the current character angle determines the angle of the whole string 
  4765. but does not affect the individual characters in the string. The character 
  4766. reference point, which is the point at which the character baseline intersects 
  4767. the left edge of the character cell, is placed on a line parallel to the new 
  4768. baseline. The baseline of each character cell remains parallel to the x-axis, 
  4769. as shown in the following figure. 
  4770.  
  4771. Effect of the Character Angle on an Image Font in CM_MODE2 
  4772.  
  4773. The character string is drawn parallel to the vector from (0,0) to (10,7). 
  4774.  
  4775. Each of the characters in the string in the previous figure is drawn with the 
  4776. vertical sides of its character cell parallel to the y-axis, and with the 
  4777. horizontal sides of its character box parallel to the x-axis. 
  4778.  
  4779.  
  4780. ΓòÉΓòÉΓòÉ 6.1.6. Character Shear ΓòÉΓòÉΓòÉ
  4781.  
  4782. Character shear is the angle defined by the x-axis and a vector drawn through 
  4783. the origin to a specified point in a Cartesian coordinate system. Neither (0,0) 
  4784. nor the specified point need have any relation to the current position. The 
  4785. operating system then aligns the vertical sides of the character cell. If the 
  4786. font is an outline font, the operating system also aligns the vertical strokes 
  4787. of the characters with the vector, regardless of the current character mode, as 
  4788. shown in the following figure. 
  4789.  
  4790. An application can retrieve the point that defines the character shear vector 
  4791. using GpiQueryCharShear. An application can set the character shear using 
  4792. GpiSetCharShear, which accepts as input the x- and y-coordinates of a point 
  4793. that defines the new vector in a POINTL structure. 
  4794.  
  4795. The shear of a character is the angle formed by the vertical lines of the 
  4796. character cell, and it can affect both the positioning and shape of characters 
  4797. in the character string. By default, the vertical lines of a character cell are 
  4798. parallel to the y-axis of the presentation page. As input to GpiCharShear, 
  4799. supply the coordinates of the end point of a vector drawn from the origin 
  4800. (0,0). The effects of the current character shear value vary, depending on the 
  4801. current character mode and font type. 
  4802.  
  4803. Effect of Character Shear on an Outline Font 
  4804.  
  4805. The character cell is drawn with its vertical lines parallel to the vector from 
  4806. the origin to (5,6). The character is sheared to the same degree. 
  4807.  
  4808. The character-shear value is ignored if the current font is an image font and 
  4809. the current character mode is CM_MODE1, as shown in the following figure. 
  4810.  
  4811. Effect of Character Shear on an Image Font in CM_MODE1 
  4812.  
  4813. The character string is unaffected by the character-shear value. 
  4814.  
  4815. The character-shear value affects the positioning of the characters from an 
  4816. image font in CM_MODE2 only if character direction is CHDIRN_TOPBOTTOM or 
  4817. CHDIRN_BOTTOMTOP. That is, characters drawn vertically do not appear in a 
  4818. vertical line for nonzero shear angle from the vertical. The characters 
  4819. themselves cannot be sheared, as shown in the following figure. 
  4820.  
  4821. Effect of Character Shear on an Image Font in CM_MODE2 
  4822.  
  4823. The character cell is sheared; and it controls the positioning of the 
  4824. characters, but the characters themselves are unchanged. 
  4825.  
  4826. If the x- and y-coordinate values you specify in GpiSetCharShear are both 
  4827. positive and negative, the characters slant from lower left to upper right. If 
  4828. you supply one negative and one positive value, the characters slant from upper 
  4829. left to lower right, as illustrated in the following figure. 
  4830.  
  4831. Effect of X- and Y-Values on Character Shear 
  4832.  
  4833. Character shear, like other attributes, has a default value that can be changed 
  4834. using GpiSetDefAttrs (CBB_SHEAR). To reset the character shear to its default 
  4835. effect of drawing the vertical lines of the character cell parallel to the 
  4836. y-axis, supply a coordinate value of (0,1) on GpiSetCharShear. 
  4837.  
  4838.  
  4839. ΓòÉΓòÉΓòÉ 6.1.7. Character Direction ΓòÉΓòÉΓòÉ
  4840.  
  4841. Character direction is the direction in which the characters in a string are 
  4842. drawn in relation to the baseline. By default, the characters are drawn from 
  4843. left to right. An application can change the direction using 
  4844. GpiSetCharDirection. GpiSetCharDirection accepts as input 1 of the 4 values 
  4845. illustrated in the following figure. The value CHDIRN_DEFAULT is identical to 
  4846. CHDIRN_LEFTRIGHT. 
  4847.  
  4848.  
  4849. ΓöîΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÉ            ΓöîΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÉ
  4850. Γöé A Γöé B Γöé C Γöé            Γöé C Γöé B Γöé A Γöé
  4851. ΓööΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ            ΓööΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÿ
  4852.                                   
  4853. start       end          end         start
  4854.  
  4855. CHDIRN_LEFTRIGHT         CHDIRN_RIGHTLEFT
  4856.  
  4857.  
  4858. start                    end
  4859.                           
  4860. ΓöîΓöÇΓöÇΓöÇΓöÉ                    ΓöîΓöÇΓöÇΓöÇΓöÉ
  4861. Γöé A Γöé                    Γöé C Γöé
  4862. Γö£ΓöÇΓöÇΓöÇΓöñ                    Γö£ΓöÇΓöÇΓöÇΓöñ
  4863. Γöé B Γöé                    Γöé B Γöé
  4864. Γö£ΓöÇΓöÇΓöÇΓöñ                    Γö£ΓöÇΓöÇΓöÇΓöñ
  4865. Γöé C Γöé                    Γöé A Γöé
  4866. ΓööΓöÇΓöÇΓöÇΓöÿ                    ΓööΓöÇΓöÇΓöÇΓöÿ
  4867.                           
  4868. end                      start
  4869.  
  4870. CHDIRN_TOPBOTTOM         CHDIRN_BOTTOMTOP
  4871.  
  4872.  
  4873. Effect of Character Direction on an Image Font or Outline Font 
  4874.  
  4875. An application can determine the current character direction using 
  4876. GpiQueryCharDirection. 
  4877.  
  4878.  
  4879. ΓòÉΓòÉΓòÉ 6.1.8. Character Text Alignment ΓòÉΓòÉΓòÉ
  4880.  
  4881. Character text alignment is the attribute that describes how the character 
  4882. strings are drawn with respect to the boundary of the output, either the 
  4883. current position or the starting position of the string, if a 
  4884. GpiCharStringxxxAt function draws the string. The alignment is set using 
  4885. GpiSetTextAlignment, which accepts as input a long value for horizontal and 
  4886. vertical alignment. 
  4887.  
  4888. The acceptable values for GpiSetTextAlignment depend on the direction of the 
  4889. current coordinate system, as follows: 
  4890.  
  4891. Value          Corresponds to the direction of... 
  4892.  
  4893. Left           The lowest x-coordinate value 
  4894.  
  4895. Right          The highest x-coordinate value 
  4896.  
  4897. Top            The highest y-coordinate value 
  4898.  
  4899. Bottom         The lowest y-coordinate value 
  4900.  
  4901. Internally, the PM programming interface determines a reference point within a 
  4902. character string that is to be positioned over the starting point specified for 
  4903. the string. 
  4904.  
  4905. If an application draws the string with either GpiCharString or 
  4906. GpiCharStringPos, the starting point specified for the string is the current 
  4907. position. If the application draws the string with either GpiCharStringAt or 
  4908. GpiCharStringPosAt, the starting point specified for the string is accepted as 
  4909. input by the function. 
  4910.  
  4911.  
  4912. ΓòÉΓòÉΓòÉ 6.1.8.1. Horizontal Alignment of a Character String ΓòÉΓòÉΓòÉ
  4913.  
  4914. When a horizontal character string does not fill the width of the output area, 
  4915. it can be positioned in 1 of the 3 ways shown in the following figure. All of 
  4916. these options can be set directly with the lHorizontal option of 
  4917. GpiSetTextAlignment. 
  4918.  
  4919. Horizontal Positioning of Text Strings 
  4920.  
  4921. Text justification requires an application to perform both queries and 
  4922. coordinate calculations. The following flags are used to specify types of 
  4923. horizontal alignment: 
  4924.  
  4925. Horizontal Alignment Values 
  4926.  
  4927. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4928. ΓöéIdentifier              ΓöéAlignment                           Γöé
  4929. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4930. ΓöéTA_LEFT                 ΓöéOn the left edge of the leftmost    Γöé
  4931. Γöé                        Γöécharacter in the string             Γöé
  4932. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4933. ΓöéTA_RIGHT                ΓöéOn the right edge of the rightmost  Γöé
  4934. Γöé                        Γöécharacter in the string             Γöé
  4935. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4936. ΓöéTA_CENTER               ΓöéOn the arithmetic mean of the       Γöé
  4937. Γöé                        Γöéleftmost and rightmost characters inΓöé
  4938. Γöé                        Γöéthe string                          Γöé
  4939. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4940.  
  4941. The Presentation Manager Programming Reference describes two sets of default 
  4942. values for the lHorizontal option.  They are provided for compatibility and map 
  4943. into the horizontal alignment values described above. 
  4944.  
  4945. GpiQueryGraphicsField, GpiQueryPageViewport, and GpiQueryViewingLimit all 
  4946. provide methods of determining the width of the output area so your application 
  4947. can specify coordinates properly for the current position. 
  4948.  
  4949.  
  4950. ΓòÉΓòÉΓòÉ 6.1.8.2. Vertical Alignment of a Character String ΓòÉΓòÉΓòÉ
  4951.  
  4952. When a character string is to be displayed vertically, it can be positioned in 
  4953. 1 of the 4 ways illustrated in the following figure. The vertical options all 
  4954. can be set directly using the lVertical option of GpiSetTextAlignment. 
  4955.  
  4956. Vertical Positioning of Text Strings 
  4957.  
  4958. The following flags are used to specify types of vertical alignment: 
  4959.  
  4960. Vertical Alignment Values 
  4961.  
  4962. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  4963. ΓöéIdentifier              ΓöéAlignment                           Γöé
  4964. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4965. ΓöéTA_TOP                  ΓöéOn the top edge of the topmost      Γöé
  4966. Γöé                        Γöécharacter in the string             Γöé
  4967. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4968. ΓöéTA_HALF                 ΓöéOn the arithmetic mean of the       Γöé
  4969. Γöé                        Γöétopmost and bottommost characters inΓöé
  4970. Γöé                        Γöéthe string                          Γöé
  4971. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4972. ΓöéTA_BASE                 ΓöéOn the baseline of the bottommost   Γöé
  4973. Γöé                        Γöécharacter in the string             Γöé
  4974. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  4975. ΓöéTA_BOTTOM               ΓöéOn the bottom edge of the bottommostΓöé
  4976. Γöé                        Γöécharacter in the string             Γöé
  4977. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  4978.  
  4979. The Presentation Manager Programming Reference also describes 2 sets of default 
  4980. values for the lVertical option.  They are provided for compatibility and map 
  4981. into the vertical alignment values described above. 
  4982.  
  4983.  
  4984. ΓòÉΓòÉΓòÉ 6.1.9. Character Extra and Break Extra ΓòÉΓòÉΓòÉ
  4985.  
  4986. Certain output devices permit you to specify extra space between character 
  4987. cells by using the character extra attribute. Sometimes the space between words 
  4988. also can be expanded by increasing the size of the break character, usually 
  4989. defined as the space character, by using the break extra attribute. If this 
  4990. adjustment to either attribute is permitted, the result will be in addition to 
  4991. the sizing effects caused by the following parameters: 
  4992.  
  4993. o Font kerning 
  4994. o Font proportional spacing 
  4995. o Width vectors. 
  4996.  
  4997. The break values you can specify create different effects, as follows: 
  4998.  
  4999. Break Values and Their Effects 
  5000.  
  5001. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5002. ΓöéValue                   ΓöéEffect                              Γöé
  5003. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5004. ΓöéPositive                ΓöéForces characters apart.            Γöé
  5005. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5006. Γöé0                       ΓöéResumes the default spacing created Γöé
  5007. Γöé                        Γöéby other parameters.                Γöé
  5008. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5009. ΓöéNegative                ΓöéForces characters together, even    Γöé
  5010. Γöé                        Γöéoverlapped characters.              Γöé
  5011. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5012.  
  5013. These effects are illustrated in the following figure. 
  5014.  
  5015. The Cumulative Effect of Break Values 
  5016.  
  5017. The above are fixed integer values specified in world coordinates. Both the 
  5018. character extra and break extra attributes have initial default values of 0, 
  5019. which can be changed using GpiSetDefAttrs (CBB_EXTRA) and (CBB_BREAK_EXTRA). 
  5020. These values can be changed using GpiSetCharExtra or GpiSetCharBreakExtra, 
  5021. respectively; and the values can be queried using GpiQueryCharExtra and 
  5022. GpiQueryCharBreakExtra. 
  5023.  
  5024.  
  5025. ΓòÉΓòÉΓòÉ 6.1.10. Character Color and Mix ΓòÉΓòÉΓòÉ
  5026.  
  5027. The color attribute defines the color used to draw a primitive or an object. 
  5028. The mix attribute determines how the color of a primitive or an object is 
  5029. combined with the color of the drawing surface or any other objects on the 
  5030. surface. Both of these attributes are described in detail in Color and Mix 
  5031. Attributes. 
  5032.  
  5033. The character-string color defines the color used to draw the output from any 
  5034. of the draw-character-string functions. When a presentation space is created, 
  5035. the character-string color default is black. Character strings are one of the 
  5036. primitives that have both a foreground and a background color, as shown in the 
  5037. following figure. 
  5038.  
  5039. For image characters, colors are determined by setting pels. For outline 
  5040. characters, the foreground consists of arcs and lines that define the 
  5041. character; the background color appears between the foreground lines. The 
  5042. character can be solid or filled, in which cases the background color does not 
  5043. appear between the foreground lines. 
  5044.  
  5045. Character string primitives have a color attribute for both the actual 
  5046. character and its character cell, which surrounds the character. The 
  5047. character-cell color is the background color. 
  5048.  
  5049. The foreground mix attribute controls the combination of character-string color 
  5050. and drawing-surface color, while the background mix attribute controls the 
  5051. combination of the character-cell color and the drawing-surface color, as 
  5052. illustrated in the following figure. 
  5053.  
  5054. Character String Primitives 
  5055.  
  5056. When a presentation space is created, the character string mix attribute 
  5057. default is FM_OVERPAINT. The overpaint mix attribute specifies that the 
  5058. character-string color is not to be modified by the color of the drawing 
  5059. surface. If the character string mix attribute is changed, the character-string 
  5060. color is mixed with colors that are already on the drawing surface. 
  5061.  
  5062. The character string background color default is CLR_BACKGROUND, usually 
  5063. defined by the application as the same color as the drawing surface. The 
  5064. character string background mix attribute default is BM_LEAVEALONE. The 
  5065. leave-alone background mix attribute specifies that the character string 
  5066. background color not be drawn. The cell that surrounds the character string 
  5067. appears only if the background character-string color and mix attributes are 
  5068. changed. 
  5069.  
  5070. Use GpiSetAttrs to specify a new color or mix attribute. As input, this 
  5071. function accepts the following: 
  5072.  
  5073. o Type of primitive, for example, PRIM_CHAR 
  5074. o List of attributes to be changed 
  5075. o List of attributes to be set to their default values 
  5076. o Values for the attributes to be changed. 
  5077.  
  5078. GpiSetAttrs also is useful to specify color and mix attributes for a specific 
  5079. data structure, for example, CHARBUNDLE. GpiSetAttrs provides some protection 
  5080. against invalid colors, as described in the Presentation Manager Programming 
  5081. Reference. 
  5082.  
  5083. To determine the current character-string color and mix attributes, call 
  5084. GpiQueryAttrs, which accepts as input the primitive type and the attributes in 
  5085. question. GpiQueryAttrs returns an array of values for the queried attributes. 
  5086.  
  5087. To reset the default character-string color and mix attributes, as with all 
  5088. attributes specified in CHARBUNDLE, call GpiSetDefAttrs, which accepts as input 
  5089. the type of primitive, attributes to be changed, and values that will become 
  5090. the new default values. Changing default values is especially important when 
  5091. working with segments, described in Creating and Drawing Retained Graphics and 
  5092. Editing Retained Graphics and Graphics Segments. Changing the default values 
  5093. during a series of drawing functions is not recommended. 
  5094.  
  5095. The character color and mix attributes also can be specified using the 
  5096. following functions: 
  5097.  
  5098. o GpiSetColor 
  5099. o GpiSetMix 
  5100. o GpiSetBackColor 
  5101. o GpiSetBackMix. 
  5102.  
  5103. If the character color, character background color, mix, or background mix 
  5104. attributes are specified individually, the following queries can return a value 
  5105. inconsistent with the current character attributes: 
  5106.  
  5107. o GpiQueryColor 
  5108. o GpiQueryMix 
  5109. o GpiQueryBackColor 
  5110. o GpiQueryBackMix. 
  5111.  
  5112.  
  5113. ΓòÉΓòÉΓòÉ 6.2. Using Character String Primitives ΓòÉΓòÉΓòÉ
  5114.  
  5115. You can use the character string primitive functions to perform the following 
  5116. tasks: 
  5117.  
  5118. o Draw a string of characters using the selected font. 
  5119.  
  5120. o Modify the string by using one or more of the following operations: 
  5121.  
  5122.    Scaling 
  5123.    Shearing 
  5124.    Rotating 
  5125.    Transforming 
  5126.    Changing the angle of the baseline. 
  5127.  
  5128. o Aligning Text. 
  5129.  
  5130.  
  5131. ΓòÉΓòÉΓòÉ 6.2.1. Drawing Text ΓòÉΓòÉΓòÉ
  5132.  
  5133. The following figure shows how to select a Helvetica outline font, set the size 
  5134. of the character box, change the foreground color to red, set the character 
  5135. angle, and move the cursor to a specified location. Then, GpiCharString is used 
  5136. to write a string of characters with the specified size, color, angle, and 
  5137. location. 
  5138.  
  5139. #define INCL_GPIPRIMITIVES
  5140. #define INCL_GPILCIDS
  5141. #include <os2.h>
  5142. void fncFONT09(void){
  5143.  
  5144.     POINTL ptl = { 100, 50 };
  5145.     GRADIENTL grad = { 4, 1 };
  5146.     SIZEF sizfx;
  5147.     FATTRS fat;
  5148.     CHARBUNDLE cbnd;
  5149.     FONTMETRICS afm[80];
  5150.     HPS hps;
  5151.     HDC hdc;
  5152.     LONG cHelvFonts, i;
  5153.     LONG cFonts = 0;
  5154.     LONG lcid = 1;
  5155.     LONG devRes[2];               /* Horizontal, vertical font resolutions */
  5156.  
  5157.     cHelvFonts = GpiQueryFonts(hps, QF_PUBLIC, "Helv",
  5158.         &cFonts, sizeof(FONTMETRICS), NULL);
  5159.  
  5160.     GpiQueryFonts(hps, QF_PUBLIC, "Helv", &cHelvFonts,
  5161.         sizeof(FONTMETRICS), afm);
  5162.                                   /* Find an outline Helvetica font.       */
  5163.  
  5164.     for (i = 0; (!(afm[i].fsDefn & FM_DEFN_OUTLINE)) &&
  5165.                i < cHelvFonts; i++)    ;
  5166.  
  5167.     fat.usRecordLength = sizeof(FATTRS);
  5168.     fat.fsSelection = 0;
  5169.     fat.lMatch = afm[i].lMatch;
  5170.     StringCopy(fat.szFacename, afm[i].szFacename);
  5171.     fat.idRegistry = 0;
  5172.     fat.usCodePage = 0;
  5173.     fat.lMaxBaselineExt = 0;
  5174.     fat.lAveCharWidth = 0;
  5175.     fat.fsType = 0;
  5176.     fat.fsFontUse = FATTR_FONTUSE_OUTLINE;
  5177.  
  5178.     GpiCreateLogFont(hps, (PSTR8) NULL, lcid, &fat);
  5179.     GpiSetCharSet(hps, lcid);
  5180.  
  5181.     DevQueryCaps(hdc, CAPS_HORIZONTAL_FONT_RES, 2L, devRes);
  5182.     sizfx.cx = MAKEFIXED((afm[i].sNominalPointSize * devRes[0])/ 720, 0);
  5183.     sizfx.cy = MAKEFIXED((afm[i].sNominalPointSize * devRes[1])/ 720, 0);
  5184.     GpiSetCharBox(hps, &sizfx);
  5185.  
  5186.     cbnd.lColor = CLR_RED;
  5187.     GpiSetAttrs(hps, PRIM_CHAR, CBB_COLOR, NULLHANDLE, &cbnd);
  5188.     GpiSetCharAngle(hps, &grad);
  5189.     GpiMove(hps, &ptl);
  5190.     GpiCharString(hps, 11, "Vector Text");
  5191. } /* fncFONT09 */
  5192.  
  5193.  
  5194. Drawing Text 
  5195.  
  5196. Certain parameters in the above example are explained in Fonts. 
  5197.  
  5198.  
  5199. ΓòÉΓòÉΓòÉ 6.2.2. Formatting Text ΓòÉΓòÉΓòÉ
  5200.  
  5201. Graphics text, like all other graphics objects, has to be positioned correctly 
  5202. in the output area, which usually consists of one of the following: 
  5203.  
  5204. o Entire client area of a PM window 
  5205. o Part of a PM window 
  5206. o Addressable area of a printer. 
  5207.  
  5208. Unlike other graphics objects, however, text is governed by well-established 
  5209. readability and usability rules. These rules apply generally to text output, 
  5210. whatever its method of production.  Following are some recommendations: 
  5211.  
  5212. o Lines of text from fonts with large point sizes must be more widely spaced 
  5213.   for maximum readability. 
  5214.  
  5215. o The longer the line of text, the greater the space between lines must be to 
  5216.   ensure that the lines do not appear to merge. 
  5217.  
  5218. o Very small text must be split into multiple columns rather than continued 
  5219.   across the page. 
  5220.  
  5221. Some of these considerations are taken care of by the font designer. The PM 
  5222. programming interface enables you to control both the horizontal and vertical 
  5223. positioning of text. 
  5224.  
  5225.  
  5226. ΓòÉΓòÉΓòÉ 6.2.3. Positioning Text in World Coordinates ΓòÉΓòÉΓòÉ
  5227.  
  5228. When considering text alignment, take the versatility of the coordinate systems 
  5229. into account. The following definitions depend on the current coordinate 
  5230. system: 
  5231.  
  5232. World Coordinate Values 
  5233.  
  5234. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5235. ΓöéValue          ΓöéCorresponds to the direction of...           Γöé
  5236. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5237. ΓöéLeft           ΓöéThe lowest x-coordinate value                Γöé
  5238. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5239. ΓöéRight          ΓöéThe highest x-coordinate value               Γöé
  5240. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5241. ΓöéTop            ΓöéThe highest y-coordinate value               Γöé
  5242. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5243. ΓöéBottom         ΓöéThe lowest y-coordinate value                Γöé
  5244. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5245.  
  5246. To position a character string horizontally, you must know the width of the 
  5247. output area and the length of the character string. The PM programming 
  5248. interface provides three different functions for determining the width of the 
  5249. output: 
  5250.  
  5251. Functions for Determining Width of Character String Primitives 
  5252.  
  5253. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5254. ΓöéFunction Name           ΓöéDescription                         Γöé
  5255. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5256. ΓöéGpiQueryGraphicsField   ΓöéReturns the bottom-left and         Γöé
  5257. Γöé                        Γöétop-right corners of the graphics   Γöé
  5258. Γöé                        Γöéfield in presentation page units.   Γöé
  5259. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5260. ΓöéGpiQueryViewingLimits   ΓöéReturns the viewing limit.          Γöé
  5261. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5262. ΓöéGpiQueryPageViewport    ΓöéReturns the page viewport in device Γöé
  5263. Γöé                        Γöéunits.                              Γöé
  5264. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5265.  
  5266. All three functions are described in the Presentation Manager Programming 
  5267. Reference. 
  5268.  
  5269. The GpiConvert function changes coordinates into world coordinates. To 
  5270. calculate the width of the output area, subtract its left from its right. For 
  5271. example, if the left is 30, and right is 600, the width of the output area is 
  5272. 570 world coordinates. 
  5273.  
  5274. The PM programming interface provides three different functions for determining 
  5275. the length of the character string primitive: 
  5276.  
  5277. o GpiQueryTextBox 
  5278. o GpiQueryCharStringPos 
  5279. o GpiQueryCharStringPosAt. 
  5280.  
  5281. GPiQueryTextBox returns the relative coordinates of a parallelogram that 
  5282. surrounds the character string. By subtracting the x-coordinate of 
  5283. TXTBOX_BOTTOMRIGHT from the x-coordinate of TXTBOX_BOTTOMLEFT, an application 
  5284. can determine the length of the string. 
  5285.  
  5286. GpiQueryCharStringPos returns an array of points, in which the world coordinate 
  5287. position of each character in the string is recorded. The last value in the 
  5288. array becomes the new current position if the string is drawn using 
  5289. GpiCharStringPos. By subtracting this position from the current position 
  5290. (obtained using GpiQueryCurrentPosition) the length of the string can be 
  5291. determined. 
  5292.  
  5293. GpiQueryCharStringPosAt also returns an array of points, in which the world 
  5294. coordinate position of each character in the string is recorded. The last value 
  5295. of the array becomes the new current position if the string is drawn using 
  5296. GpiCharStringPosAt. This function accepts a specified starting position for the 
  5297. character string. By specifying a starting position of (0,0) for example, an 
  5298. application can determine the length of the string without subtraction. 
  5299.  
  5300. The current position actually is not updated by either GpiQueryCharStringPos or 
  5301. GpiQueryCharStringPosAt. All three functions are described also in the 
  5302. Presentation Manager Programming Reference. 
  5303.  
  5304. When a character string does not fill the width of the output area, it can be 
  5305. positioned in 1 of the four ways illustrated in the following figure. 
  5306.  
  5307. Horizontal Positioning of Text Strings 
  5308.  
  5309. To left-align the text, set the x-coordinate of the current position to the 
  5310. left of the output area before drawing the character string. 
  5311. GpiSetCurrentPosition must be used to set the current position if your 
  5312. application draws the string using either GpiCharString or GpiCharStringPos. 
  5313. Both GpiCharStringAt and GpiCharStringPosAt accept a starting position as 
  5314. input. 
  5315.  
  5316. To right-align the text, subtract the length of the character string from the 
  5317. width of the output area, then add the difference to the x-coordinate of the 
  5318. current position before drawing the character string. If the output area is 570 
  5319. world coordinates wide, for example, and the character string is 436 world 
  5320. coordinates long, add 134 to the x-coordinate of the current position before 
  5321. drawing the text. 
  5322.  
  5323. To center the text, subtract the length of the character string from the width 
  5324. of the output area, then divide the difference by 2 before adding it to the 
  5325. x-coordinate of the current position. If the difference is 134, for example, 
  5326. you add 67 to the x-coordinate of the current position. 
  5327.  
  5328. To justify the text, so that the text string fills the width of the output 
  5329. area, distribute the surplus space throughout the character string.  For 
  5330. example, you could add the extra space to the break characters only, or you 
  5331. could share it equally among all characters in the string. Text justification 
  5332. requires the individual positioning each character in the string using either 
  5333. of the following calls: 
  5334.  
  5335. o GpiCharStringPos-draws at the current position and permits you to position 
  5336.   every character after the first. 
  5337.  
  5338. o GpiCharStringPosAt-permits you to position every character, including the 
  5339.   first. 
  5340.  
  5341. Both functions enable you to specify a different character increment for each 
  5342. character in the string. Distance is measured from the character reference 
  5343. point of one character to the character reference point of the next character. 
  5344. The values you specify apply only to the character string supplied at input; 
  5345. they do not become current attribute values. 
  5346.  
  5347. If you are formatting a block of text, the string might be wider than the 
  5348. output area, or longer than 256 characters. In either case, your application 
  5349. must separate the string into smaller groups of characters so that it fits 
  5350. either criteria. A good starting point is to determine the number of characters 
  5351. planned for each line. Dividing the output width by the character cell width 
  5352. can provide a first estimate as to where to separate a character string. An 
  5353. application can use this estimate to work through the string looking for 
  5354. spaces. Each time you find a space, compare the length of the string (up to the 
  5355. space) with the width of the output area. When the string is longer than the 
  5356. output area, work back to the previous space and display or print that part of 
  5357. the string. You can format the entire block of text for the output area in this 
  5358. way. 
  5359.  
  5360. When you are formatting a block instead of a single line of text, an 
  5361. application must specify the vertical placement of each line. If you are using 
  5362. an image font, you have the assurance that each character is the same height. 
  5363. However, you do not have that assurance with an outline font, nor that the text 
  5364. block is written in the same font. Therefore, when calculating the separation 
  5365. of lines, avoid using complex combinations of font metrics values. Instead, it 
  5366. is recommended that you multiply the desired point size, or em-height metric, 
  5367. of the text by 1.2. 
  5368.  
  5369.  
  5370. ΓòÉΓòÉΓòÉ 6.3. Summary ΓòÉΓòÉΓòÉ
  5371.  
  5372. The following table summarizes the character string primitive functions. 
  5373.  
  5374. Character String Primitive Functions 
  5375.  
  5376. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5377. ΓöéFunction Name           ΓöéDescription                         Γöé
  5378. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5379. ΓöéGpiCharString           ΓöéDraws a character string using the  Γöé
  5380. Γöé                        Γöécurrent font from the current       Γöé
  5381. Γöé                        Γöéposition.                           Γöé
  5382. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5383. ΓöéGpiCharStringAt         ΓöéDraws a character string using the  Γöé
  5384. Γöé                        Γöécurrent font from a specified       Γöé
  5385. Γöé                        Γöéposition.                           Γöé
  5386. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5387. ΓöéGpiCharStringPos        ΓöéDraws a character string using the  Γöé
  5388. Γöé                        Γöécurrent font with the first         Γöé
  5389. Γöé                        Γöécharacter at the current position,  Γöé
  5390. Γöé                        Γöéthen allows positioning of every    Γöé
  5391. Γöé                        Γöéfollowing character.                Γöé
  5392. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5393. ΓöéGpiCharStringPosAt      ΓöéDraws a character string in the     Γöé
  5394. Γöé                        Γöécurrent font and allows positioning Γöé
  5395. Γöé                        Γöéfor the first and every following   Γöé
  5396. Γöé                        Γöécharacter.                          Γöé
  5397. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5398. ΓöéGpiQueryCharAngle       ΓöéDetermines the current character    Γöé
  5399. Γöé                        Γöéangle attribute.                    Γöé
  5400. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5401. ΓöéGpiQueryCharBox         ΓöéDetermines the current character boxΓöé
  5402. Γöé                        Γöéattribute.                          Γöé
  5403. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5404. ΓöéGpiQueryCharBreakExtra  ΓöéDetermines the current character    Γöé
  5405. Γöé                        Γöébreak extra attribute.              Γöé
  5406. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5407. ΓöéGpiQueryCharDirection   ΓöéDetermines the current character    Γöé
  5408. Γöé                        Γöédirection attribute.                Γöé
  5409. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5410. ΓöéGpiQueryCharExtra       ΓöéDetermines the current character    Γöé
  5411. Γöé                        Γöéextra attribute.                    Γöé
  5412. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5413. ΓöéGpiQueryCharMode        ΓöéDetermines the current mode         Γöé
  5414. Γöé                        Γöéattribute.                          Γöé
  5415. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5416. ΓöéGpiQueryCharSet         ΓöéDetermines the current character setΓöé
  5417. Γöé                        Γöéattribute.                          Γöé
  5418. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5419. ΓöéGpiQueryCharShear       ΓöéDetermines the current character    Γöé
  5420. Γöé                        Γöéshear attribute.                    Γöé
  5421. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5422. ΓöéGpiQueryCharStringPos   ΓöéDetermines the position of each     Γöé
  5423. Γöé                        Γöécharacter for an equivalent         Γöé
  5424. Γöé                        ΓöéGpiCharStringPos function without   Γöé
  5425. Γöé                        Γöéactually drawing any characters.    Γöé
  5426. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5427. ΓöéGpiQueryCharStringPosAt ΓöéDetermines the position at which    Γöé
  5428. Γöé                        Γöéeach character will appear if an    Γöé
  5429. Γöé                        Γöéequivalent GpiCharStringPosAt       Γöé
  5430. Γöé                        Γöéfunction is used.                   Γöé
  5431. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5432. ΓöéGpiQueryDefCharBox      ΓöéDetermines the size of the default  Γöé
  5433. Γöé                        Γöécharacter box.                      Γöé
  5434. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5435. ΓöéGpiQueryTextBox         ΓöéDetermines the coordinates of the   Γöé
  5436. Γöé                        Γöécorners of a text box for an        Γöé
  5437. Γöé                        Γöéequivalent GpiCharStringPos functionΓöé
  5438. Γöé                        Γöéwithout actually drawing any        Γöé
  5439. Γöé                        Γöécharacters.                         Γöé
  5440. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5441. ΓöéGpiSetCharAngle         ΓöéSets the current character angle    Γöé
  5442. Γöé                        Γöéattribute.                          Γöé
  5443. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5444. ΓöéGpiSetCharBox           ΓöéSets the current character box      Γöé
  5445. Γöé                        Γöéattribute.                          Γöé
  5446. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5447. ΓöéGpiSetCharBreakExtra    ΓöéSets the current character break    Γöé
  5448. Γöé                        Γöéextra attribute.                    Γöé
  5449. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5450. ΓöéGpiSetCharDirection     ΓöéSets the current character directionΓöé
  5451. Γöé                        Γöéattribute.                          Γöé
  5452. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5453. ΓöéGpiSetCharExtra         ΓöéSets the current character extra    Γöé
  5454. Γöé                        Γöéattribute.                          Γöé
  5455. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5456. ΓöéGpiSetCharMode          ΓöéSets the current character mode     Γöé
  5457. Γöé                        Γöéattribute.                          Γöé
  5458. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5459. ΓöéGpiSetCharSet           ΓöéSets the current character set      Γöé
  5460. Γöé                        Γöéattribute.                          Γöé
  5461. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5462. ΓöéGpiSetCharShear         ΓöéSets the current character shear    Γöé
  5463. Γöé                        Γöéattribute.                          Γöé
  5464. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5465.  
  5466. The following table summarizes the data structures used by the character string 
  5467. primitive functions. 
  5468.  
  5469. Character String Primitive Structures 
  5470.  
  5471. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5472. ΓöéStructure Name          ΓöéDescription                         Γöé
  5473. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5474. ΓöéCHARBUNDLE              ΓöéContains the character attributes.  Γöé
  5475. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5476. ΓöéFATTRS                  ΓöéContains the attributes of the font Γöé
  5477. Γöé                        Γöéspecified using GpiCreateLogFont.   Γöé
  5478. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5479. ΓöéFONTMETRICS             ΓöéContains all the font metrics       Γöé
  5480. Γöé                        Γöéreturned by the system to describe aΓöé
  5481. Γöé                        Γöéparticular font.                    Γöé
  5482. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5483. ΓöéPOINTL                  ΓöéSpecifies the values of a single    Γöé
  5484. Γöé                        Γöépair of x- and y-coordinates.       Γöé
  5485. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5486.  
  5487.  
  5488. ΓòÉΓòÉΓòÉ 7. Color and Mix Attributes ΓòÉΓòÉΓòÉ
  5489.  
  5490. This chapter describes color and mix attributes and their use in OS/2 
  5491. applications. The following topics are related to the information in this 
  5492. chapter: 
  5493.  
  5494. o Presentation spaces 
  5495. o Device contexts 
  5496. o Line and arc primitives 
  5497. o Marker primitives 
  5498. o Area primitives 
  5499. o Character string primitives 
  5500. o Bit maps and images primitives. 
  5501.  
  5502.  
  5503. ΓòÉΓòÉΓòÉ 7.1. About Color and Mix Attributes ΓòÉΓòÉΓòÉ
  5504.  
  5505. Color and mix are 2 attributes of graphics primitives. They can be specified by 
  5506. an application in a number of ways; and are specified in the xxxBUNDLE data 
  5507. structure associated with the 5 graphics primitives and in bit maps. Bit maps 
  5508. and some of the primitives have both foreground and background color 
  5509. attributes. For example, a character string primitive has a foreground color 
  5510. attribute that specifies the color of the character and a background color 
  5511. attribute that specifies the color of the character cell surrounding the 
  5512. character. 
  5513.  
  5514. The mix attribute controls how each primitive is combined with the existing 
  5515. drawing. Among other things, it affects the color that results when primitives 
  5516. of different colors overlap. Primitives with foreground and background color 
  5517. attributes also have foreground and background mix attributes. 
  5518.  
  5519.  
  5520. ΓòÉΓòÉΓòÉ 7.2. Color Implementation ΓòÉΓòÉΓòÉ
  5521.  
  5522. Understanding how colors are implemented can assist in understanding how the 
  5523. color and mix attributes work. 
  5524.  
  5525. The pel is the smallest element of the display screen that can be addressed. 
  5526. For monochrome displays, pels are either turned off or turned on. For color 
  5527. displays, each pel contains a red, green, and blue section, each of which is 
  5528. called a phosphor. 
  5529.  
  5530. The display has color guns of red, blue, and green light that illuminate the 
  5531. phosphors in a single pel. By switching these color guns on and off in 
  5532. different combinations, 8 standard colors can be produced. By varying the 
  5533. intensities of the color guns, additional colors can be produced. The following 
  5534. table shows the 8 standard colors that can be generated from the 3 color guns. 
  5535.  
  5536. Eight Standard Colors 
  5537.  
  5538. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5539. ΓöéPel appears... ΓöéRed            ΓöéGreen          ΓöéBlue           Γöé
  5540. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5541. ΓöéRed            ΓöéON             ΓöéOFF            ΓöéOFF            Γöé
  5542. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5543. ΓöéGreen          ΓöéOFF            ΓöéON             ΓöéOFF            Γöé
  5544. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5545. ΓöéBlue           ΓöéOFF            ΓöéOFF            ΓöéON             Γöé
  5546. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5547. ΓöéWhite          ΓöéON             ΓöéON             ΓöéON             Γöé
  5548. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5549. ΓöéBlack          ΓöéOFF            ΓöéOFF            ΓöéOFF            Γöé
  5550. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5551. ΓöéCyan           ΓöéOFF            ΓöéON             ΓöéON             Γöé
  5552. Γöé(Turquoise)    Γöé               Γöé               Γöé               Γöé
  5553. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5554. ΓöéPink           ΓöéON             ΓöéOFF            ΓöéON             Γöé
  5555. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5556. ΓöéYellow         ΓöéON             ΓöéON             ΓöéOFF            Γöé
  5557. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5558.  
  5559. Each pel is described internally by a number of bits of storage. In a 
  5560. monochrome display, only 1 bit per pel is required, and that bit is either on 
  5561. or off. In an 8-color system, 3 bits per pel are necessary. Each of those 3 
  5562. bits records the on or off setting of 1 color gun. 
  5563.  
  5564. To be able to control the intensity of a color and obtain more than 8 colors, 
  5565. more than 3 bits per pel are needed. For example, 6 bits per pel provide 32 
  5566. different combinations. 
  5567.  
  5568. The wider the range of available colors, the more bits per pel required for 
  5569. each color. This storage issue is resolved by keeping a wide choice of colors 
  5570. but restricting the number of colors available at any given time. Applications 
  5571. define the colors that they want to use in a logical color table. Selecting a 
  5572. color defined in the logical color table produces the nearest available color 
  5573. in the hardware palette. 
  5574.  
  5575.  
  5576. ΓòÉΓòÉΓòÉ 7.2.1. RGB Color Encoding ΓòÉΓòÉΓòÉ
  5577.  
  5578. The red, green, and blue (RGB) components of a color are stored in either an 
  5579. RGB or RGB2 data structure, or as a long integer (32-bit) value. The color 
  5580. fields in the RGB2 structure and in the long integer follow the same rules. 
  5581.  
  5582. If stored as a long integer, the RGB value has the first 8 bits reserved for a 
  5583. flag value and the remaining 24 bits reserved for color intensity. The flag 
  5584. byte must be set to 0. Each of the last 3 bytes specifies a color intensity, in 
  5585. the range 0 through 255, for a single primary color. 
  5586.  
  5587. If a byte contains 0, the corresponding primary color is not present. As the 
  5588. value in the byte increases, the intensity of the primary color increases. For 
  5589. example, if the byte contains 128, the primary color is pale; if the byte 
  5590. contains 255, the primary color is as intense as the device permits. 
  5591.  
  5592. The RGB value is determined by the following equation: 
  5593.  
  5594.     RGB Value = (R * 65536) + (G * 256) + B
  5595.  
  5596.     Where:
  5597.         R is the red intensity
  5598.         G is the green intensity
  5599.         B is the blue intensity
  5600.  
  5601. If all 3 bytes are set to 0, the resulting color is black; if they all are set 
  5602. to 255, the resulting color is white. The RGB value associated with each of the 
  5603. standard 8 colors is in the following table. 
  5604.  
  5605. RGB Values 
  5606.  
  5607. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5608. ΓöéColor               ΓöéRGB value           Γöé
  5609. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5610. ΓöéBlack               Γöé0x00000000          Γöé
  5611. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5612. ΓöéRed                 Γöé0x00FF0000          Γöé
  5613. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5614. ΓöéGreen               Γöé0x0000FF00          Γöé
  5615. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5616. ΓöéBlue                Γöé0x000000FF          Γöé
  5617. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5618. ΓöéPink                Γöé0x00FF00FF          Γöé
  5619. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5620. ΓöéCyan                Γöé0x0000FFFF          Γöé
  5621. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5622. ΓöéYellow              Γöé0x00FFFF00          Γöé
  5623. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5624. ΓöéWhite               Γöé0x00FFFFFF          Γöé
  5625. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5626.  
  5627.  
  5628. ΓòÉΓòÉΓòÉ 7.2.2. Color Tables ΓòÉΓòÉΓòÉ
  5629.  
  5630. A color table is an array of RGB values. There are 2 kinds of color tables: 
  5631. logical and physical. The logical color table is a list of colors specific to a 
  5632. presentation space. An application typically uses a logical color table to 
  5633. define colors specific to that application. 
  5634.  
  5635. The physical color table specifies colors the device can generate currently. 
  5636. These device colors are shared by every application on the system. Because some 
  5637. display adapters cannot generate every possible device color at the same time, 
  5638. the physical color table can be a subset of the full range of possible device 
  5639. colors. The operating system maps the RGB values specified in the logical color 
  5640. table to device colors in the physical color table. 
  5641.  
  5642.  
  5643. ΓòÉΓòÉΓòÉ 7.2.3. Logical Color Table ΓòÉΓòÉΓòÉ
  5644.  
  5645. A logical color table contains a variable number of entries, each of which 
  5646. describes a different RGB (Red, Green, Blue) combination that produces a color. 
  5647. The principle of the color table is illustrated in the following figure. 
  5648.  
  5649. Logical Color Table 
  5650.  
  5651. This simplified example demonstrates that to produce yellow on the computer 
  5652. screen, red and green are mixed in equal intensities, and no blue is used at 
  5653. all. In this example, yellow is addressed in the color table by index 21. 
  5654. Notice that this is not the same index number used in the default logical color 
  5655. table, which indicates that this color table has been changed by the 
  5656. application. 
  5657.  
  5658. A logical color table is stored in a presentation space and is specific to that 
  5659. presentation space. A logical color table enables applications to specify 
  5660. colors as indexes rather than explicit RGB values. 
  5661.  
  5662. The colors displayed are likely to vary from 1 output device to another so the 
  5663. definitions in the color table can be fine-tuned to get the best results. Any 
  5664. color can be made more or less intense by altering its definition in the 
  5665. logical color table. 
  5666.  
  5667.  
  5668. ΓòÉΓòÉΓòÉ 7.2.3.1. Default Logical Color Table ΓòÉΓòÉΓòÉ
  5669.  
  5670. The PM programming interface provides a default logical color table, which 
  5671. defines the colors and the indexes that retrieve them, as shown in the 
  5672. following table. 
  5673.  
  5674. Default Logical Color Table 
  5675.  
  5676. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5677. ΓöéColor Index     ΓöéIndeΓöéEffect                                  Γöé
  5678. Γöé                ΓöéNumbΓöé                                        Γöé
  5679. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5680. ΓöéCLR_FALSE       Γöé-5  ΓöéAll bits are set to 0.                  Γöé
  5681. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5682. ΓöéCLR_TRUE        Γöé-4  ΓöéAll bits are set to 1.                  Γöé
  5683. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5684. ΓöéCLR_DEFAULT     Γöé-3  ΓöéDefault value                           Γöé
  5685. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5686. ΓöéCLR_WHITE       Γöé-2  ΓöéWhite                                   Γöé
  5687. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5688. ΓöéCLR_BLACK       Γöé-1  ΓöéBlack                                   Γöé
  5689. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5690. ΓöéCLR_BACKGROUND  Γöé0   ΓöéNatural background color for the device Γöé
  5691. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5692. ΓöéCLR_BLUE        Γöé1   ΓöéBlue                                    Γöé
  5693. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5694. ΓöéCLR_RED         Γöé2   ΓöéRed                                     Γöé
  5695. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5696. ΓöéCLR_PINK        Γöé3   ΓöéPink                                    Γöé
  5697. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5698. ΓöéCLR_GREEN       Γöé4   ΓöéGreen                                   Γöé
  5699. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5700. ΓöéCLR_CYAN        Γöé5   ΓöéCyan                                    Γöé
  5701. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5702. ΓöéCLR_YELLOW      Γöé6   ΓöéYellow                                  Γöé
  5703. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5704. ΓöéCLR_NEUTRAL     Γöé7   ΓöéNeutral - The contrasting color to      Γöé
  5705. Γöé                Γöé    ΓöéCLR_BACKGROUND                          Γöé
  5706. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5707. ΓöéCLR_DARKGRAY    Γöé8   ΓöéDark gray                               Γöé
  5708. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5709. ΓöéCLR_DARKBLUE    Γöé9   ΓöéDark blue                               Γöé
  5710. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5711. ΓöéCLR_DARKRED     Γöé10  ΓöéDark red                                Γöé
  5712. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5713. ΓöéCLR_DARKPINK    Γöé11  ΓöéDark pink                               Γöé
  5714. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5715. ΓöéCLR_DARKGREEN   Γöé12  ΓöéDark green                              Γöé
  5716. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5717. ΓöéCLR_DARKCYAN    Γöé13  ΓöéDark cyan                               Γöé
  5718. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5719. ΓöéCLR_BROWN       Γöé14  ΓöéBrown                                   Γöé
  5720. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5721. ΓöéCLR_PALEGRAY    Γöé15  ΓöéPale gray                               Γöé
  5722. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5723.  
  5724. Note:  Entries after CLR_PALEGRAY have device-dependent defaults. 
  5725.  
  5726. PM maps the color index name to the index number (shown in the second column of 
  5727. the previous table), then uses that number to address the appropriate color. 
  5728.  
  5729.  
  5730. ΓòÉΓòÉΓòÉ 7.2.3.2. Device-Independent Color Indexing ΓòÉΓòÉΓòÉ
  5731.  
  5732. Three of the index names provide a level of device independence in choosing 
  5733. colors:  CLR_DEFAULT, CLR_BACKGROUND, and CLR_NEUTRAL. These indexes enable an 
  5734. application to select colors according to their purpose, and thus build device 
  5735. independence into your applications. The purpose of a color does not vary from 
  5736. 1 device to another, although the actual color used to implement that purpose 
  5737. might. The following table describes these indexes and the purpose of each: 
  5738.  
  5739. Device Independent Color Indexes 
  5740.  
  5741. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  5742. ΓöéIndex                         ΓöéPurpose                       Γöé
  5743. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5744. ΓöéCLR_BACKGROUND                ΓöéThe natural background color  Γöé
  5745. Γöé                              Γöéfor the device. This is the   Γöé
  5746. Γöé                              Γöécolor of the paper on a       Γöé
  5747. Γöé                              Γöéprinter, and the window       Γöé
  5748. Γöé                              Γöébackground color (white, by   Γöé
  5749. Γöé                              Γöédefault) on a display.        Γöé
  5750. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5751. ΓöéCLR_NEUTRAL                   ΓöéThe contrast color to         Γöé
  5752. Γöé                              ΓöéCLR_BACKGROUND. This is       Γöé
  5753. Γöé                              Γöéusually black on a printer,   Γöé
  5754. Γöé                              Γöéand the default window text   Γöé
  5755. Γöé                              Γöécolor (black, by default) on aΓöé
  5756. Γöé                              Γöédisplay.                      Γöé
  5757. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  5758. ΓöéCLR_DEFAULT                   ΓöéUnless redefined, this has theΓöé
  5759. Γöé                              Γöésame effect as CLR_NEUTRAL.   Γöé
  5760. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  5761.  
  5762. The colors produced by CLR_DEFAULT, CLR_BACKGROUND, and CLR_NEUTRAL in the 
  5763. default logical color table depend on the output device. For example, 
  5764. CLR_NEUTRAL could produce black on a device with a white background or white on 
  5765. a device with a black background. 
  5766.  
  5767.  
  5768. ΓòÉΓòÉΓòÉ 7.2.4. Defining a Logical Color Table ΓòÉΓòÉΓòÉ
  5769.  
  5770. To change the values in the default logical color table (that is, to load a new 
  5771. logical color table), use GpiCreateLogColorTable. Using this function, an 
  5772. application can do the following: 
  5773.  
  5774. o Replace part or all of the default color table. 
  5775. o Add color definitions to the default color table. 
  5776. o Reset the logical color table to its default values. 
  5777.  
  5778. There are 2 methods of making changes: 
  5779.  
  5780.  1. To add to a table or change some of its  contents, rather than replace the 
  5781.     table completely, supply an array of color indexes and their associated RGB 
  5782.     values. 
  5783.  
  5784.  2. To load a consecutive sequence of index values, supply only an array of RGB 
  5785.     values without index values. 
  5786.  
  5787.  
  5788. ΓòÉΓòÉΓòÉ 7.2.4.1. Color Tables in Index Mode ΓòÉΓòÉΓòÉ
  5789.  
  5790. The default logical color table is defined as an array of color indexes and 
  5791. their associated RGB values. A table in this format is in index mode. 
  5792.  
  5793. To alter a logical color table in index mode, specify either LCOLF_INDRGB or 
  5794. LCOLF_CONSECRGB as the format value in GpiCreateLogColorTable. If an 
  5795. application uses the color index names to address the contents of a loaded 
  5796. color table in index mode, the color identified by the associated index number 
  5797. is retrieved. For example, CLR_NEUTRAL produces the color addressed by index 
  5798. number 7. If CLR_NEUTRAL must be blue, the application must define the color 
  5799. table so that index number 7 addresses the RGB definition of the appropriate 
  5800. shade of blue. 
  5801.  
  5802. If an application uses the format LCOLF_INDRGB when calling 
  5803. GpiCreateLogColorTable, the application supplies an array of index and RGB 
  5804. pairs to update the table. These values do not have to be consecutive. An 
  5805. application can change the contents of an existing table and add entries to the 
  5806. end of the table. 
  5807.  
  5808. If an application calls GpiCreateLogColorTable using the LCOLF_CONSECRGB 
  5809. format, the application supplies an array of RGB values and a starting index. 
  5810. When using this format, the RGB values must be consecutive; you cannot use a 
  5811. single call to GpiCreateLogColorTable to redefine CLR_BLUE and CLR_PINK without 
  5812. also specifying an RGB value for CLR_RED. As with LCOLF_INDRGB, this format can 
  5813. be used to change the contents of the existing table and to add entries to the 
  5814. end of the table. 
  5815.  
  5816. When an application calls GpiSetAttrs to put a value into the color field of a 
  5817. graphics primitive attribute structure, the value is an index into the logical 
  5818. color table. When the operating system draws the primitive, it uses this index 
  5819. to determine the RGB value specified in the logical color table by the 
  5820. application; then it searches the physical color table for the color closest to 
  5821. this RGB value. The operating system then draws the primitive, using the color 
  5822. from the physical color table. How closely the drawn colors match the colors in 
  5823. the logical color table depends on the device colors in the physical color 
  5824. table. 
  5825.  
  5826.  
  5827. ΓòÉΓòÉΓòÉ 7.2.4.2. Color Tables in RGB Mode ΓòÉΓòÉΓòÉ
  5828.  
  5829. The color values specified with GpiSetAttrs and GpiSetColor also can be 
  5830. specified directly as RGB values rather than as indexes. To enable this, the 
  5831. logical color table must be switched into RGB mode by calling 
  5832. GpiCreateLogColorTable, specifying a format of LCOLF_RGB. (No color array is 
  5833. passed.) 
  5834.  
  5835. If the color table is in RGB mode, it can be switched back to index mode and 
  5836. reset to its original default values by specifying either LCOLF_INGRGB or 
  5837. LCOLF_CONSECRGB in GpiCreateLogColorTable. 
  5838.  
  5839.  
  5840. ΓòÉΓòÉΓòÉ 7.2.5. Querying the Available Colors ΓòÉΓòÉΓòÉ
  5841.  
  5842. Several query functions are provided for applications to get information about 
  5843. the current logical and physical color tables before defining a logical color 
  5844. table. 
  5845.  
  5846. Applications use GpiQueryColorData to determine whether the default logical 
  5847. color table is in effect. If it is not, the following information about the 
  5848. loaded logical color table is returned: 
  5849.  
  5850. o Format of the current logical color table 
  5851.  
  5852. o Smallest and largest color indexes (if the table is in index mode) supported 
  5853.   in this color table. The smallest color index is always 0, and the largest 
  5854.   color index is never less than 15, because deleting entries from the default 
  5855.   logical color table is not permitted. 
  5856.  
  5857. GpiQueryRealColors returns the RGB values of each of the distinct colors 
  5858. defined in the physical color table of the current device. It also can return 
  5859. the index in the current logical color table that references each of the colors 
  5860. in the physical table. 
  5861.  
  5862. To determine the available colors nearest to a specified color on a particular 
  5863. device, call GpiQueryNearestColor, which accepts as input the RGB value of the 
  5864. desired color. The function returns the RGB value of the nearest available 
  5865. color in the physical color table of the associated device. 
  5866.  
  5867. Applications can use GpiQueryRGBColor to determine the RGB value of a 
  5868. particular color. GpiQueryRGBColor accepts as input the index to the logical 
  5869. color table entry of the color in question. Output from this function is the 
  5870. RGB value that the index would reference in the physical color table. If a 
  5871. logical color table is loaded in RGB mode, GpiQueryRGBColor returns the same 
  5872. results as GpiQueryNearestColor. 
  5873.  
  5874. Conversely, to determine the index value that references a given RGB color (or 
  5875. the closest match to that color) in the physical color table, an application 
  5876. uses GpiQueryColorIndex. The application can determine which colors are in the 
  5877. current logical color table by calling GpiQueryLogColorTable. To determine 
  5878. which colors are in the physical color table, call GpiQueryRealColors. 
  5879.  
  5880.  
  5881. ΓòÉΓòÉΓòÉ 7.2.6. Physical Color Table ΓòÉΓòÉΓòÉ
  5882.  
  5883. Each output device has its own physical color table, which is organized like a 
  5884. logical color table. The physical color table contains the RGB color 
  5885. definitions of the distinct colors that the device can produce, while a logical 
  5886. color table contains the definitions of the colors as chosen by an application. 
  5887. When an application draws on an output device, the PM programming interface 
  5888. maps the index value that addresses the current color in the logical color 
  5889. table to the index that retrieves the closest match for the current color in 
  5890. the physical color table. 
  5891.  
  5892. Because this substitution occurs when the graphics are drawn, the presentation 
  5893. space can be associated with a number of different device contexts without 
  5894. invalidating the logical color definitions. For example, an application can 
  5895. create a picture on the screen using a wide range of colors, then direct that 
  5896. drawing to an 8-pen vector plotter. The drawing is reproduced without having to 
  5897. be re-created. Although the picture, as drawn by the plotter, does not have the 
  5898. variety of colors displayed on the screen, the substitution process selects the 
  5899. nearest match for each color on the screen from the 8 available colors on the 
  5900. plotter. 
  5901.  
  5902.  
  5903. ΓòÉΓòÉΓòÉ 7.2.7. Palette Manager ΓòÉΓòÉΓòÉ
  5904.  
  5905. Applications can use GpiCreatePalette to change the physical color palette by 
  5906. creating a new palette. This function is used if the application has specific 
  5907. color needs and must ensure that the color is part of the physical color 
  5908. palette. GpiCreatePalette also enables an application to prevent dithering of 
  5909. the 16 default colors by setting the flag parameter to LCOL_PURECOLOR (for 
  5910. information on dithering, see Dithering). If the full 256 colors in the palette 
  5911. are needed, the application can set the flag to LCOL_OVERRIDE_DEFAULT_COLORS. 
  5912. It is recommended that the Palette Manager functions be used only when really 
  5913. necessary because the operating system cannot guarantee consistent colors in 
  5914. other windows and the ability to change the physical palette is device 
  5915. dependent. 
  5916.  
  5917. After the palette is created, an application can set or change any of the 
  5918. values in the palette by calling GpiSetPaletteEntries. To delete the palette, 
  5919. applications use GpiDeletePalette, passing the handle of the palette to be 
  5920. deleted. (The handle is returned by GpiCreatePalette when the palette is 
  5921. created.) 
  5922.  
  5923. GpiQueryPalette enables applications to determine the palette currently 
  5924. selected for a given presentation space. A palette can be used by more than 1 
  5925. presentation space at the same time. The operating system maintains a count of 
  5926. the number of presentation spaces using a specific palette. Complete 
  5927. information on the current palette can be accessed by GpiQueryPaletteInfo. 
  5928.  
  5929. Palettes also can be shared by using a palette handle. 
  5930.  
  5931. When coding an application, color table functions and color palette functions 
  5932. must not be mixed. The application can call DevQueryCaps to determine whether 
  5933. the hardware supports palettes, then call the appropriate functions. 
  5934.  
  5935.  
  5936. ΓòÉΓòÉΓòÉ 7.2.7.1. Realizing a Color Palette ΓòÉΓòÉΓòÉ
  5937.  
  5938. WinRealizePalette maps the colors requested by the application into the color 
  5939. palette for the system. When the application's window is activated, the palette 
  5940. changes are transferred, or realized, into the physical palette for the system. 
  5941.  
  5942. When a palette is realized, there might not be enough empty palette entries to 
  5943. accommodate the additional palette changes (a maximum of 256 entries). For 
  5944. example, it is possible that some of the colors changed in the physical palette 
  5945. are being used by another application. In this situation, a WM_REALIZEPALETTE 
  5946. message is posted to all the applications running on the desktop. 
  5947.  
  5948. On receiving the WM_REALIZEPALETTE message, applications using Palette Manager 
  5949. functions must repaint their screens. The original application colors are 
  5950. mapped to the closest matching color in the new palette. Applications that do 
  5951. not use Palette Manager functions normally perform default processing within 
  5952. their applications causing a repaint of their windows with the closest match 
  5953. from the palette. If there are no changes, just additions, to the physical 
  5954. palette, no message is sent. 
  5955.  
  5956. Note:  The Palette Manager maps a window's colors to the closest available 
  5957.        value in the palette when the physical palette has to be changed, but 
  5958.        this does not guarantee that the color will be a close match to the 
  5959.        original color used. 
  5960.  
  5961. As the focus changes from window to window, the physical palette changes 
  5962. according to the activated window. Notification messages are sent as necessary 
  5963. to other applications. 
  5964.  
  5965. If the physical color values in the palette have to change to accommodate the 
  5966. number of palette entries passed from the application when a palette is 
  5967. realized, the number of altered entries in the physical palette is returned by 
  5968. WinRealizePalette. 
  5969.  
  5970. Color palette realization is available only to systems that have a minimum of 
  5971. 256 colors. 
  5972.  
  5973.  
  5974. ΓòÉΓòÉΓòÉ 7.2.8. Color Attribute ΓòÉΓòÉΓòÉ
  5975.  
  5976. The PM graphic interface uses a variety of colors. These colors are referred to 
  5977. as the system colors, and they are defined in the system color table, which is 
  5978. separate from an application's logical color table. To find out the RGB values 
  5979. of the system colors, call WinQuerySysColor. 
  5980.  
  5981. The colors of graphic primitives are specified separately from the system 
  5982. colors. Every primitive has a foreground color; some also have a background 
  5983. color. 
  5984.  
  5985.  
  5986. ΓòÉΓòÉΓòÉ 7.2.8.1. Primitive Foreground ΓòÉΓòÉΓòÉ
  5987.  
  5988. The foreground of a primitive is the primitive itself. For example, the 
  5989. foreground of a full arc primitive is the full arc, as shown in the following 
  5990. figure. 
  5991.  
  5992. Foreground of a Primitive 
  5993.  
  5994. The full arc primitive is drawn in a different color from the window 
  5995. background. 
  5996.  
  5997. By default, the foreground color of all primitives is the color addressed by 
  5998. the index CLR_DEFAULT. In the default color table, this produces black on a 
  5999. graphics display. If the application replaces the default logical color table, 
  6000. CLR_DEFAULT produces the color addressed by index number 7 (CLR_NEUTRAL). 
  6001.  
  6002.  
  6003. ΓòÉΓòÉΓòÉ 7.2.8.2. Primitive Background ΓòÉΓòÉΓòÉ
  6004.  
  6005. The following primitives have a background: 
  6006.  
  6007. o Areas 
  6008. o Character strings 
  6009. o Images 
  6010. o Markers. 
  6011.  
  6012. The background of any character or marker primitive, whether the primitive is 
  6013. from an image or an outline font, is the entire character or marker box. First 
  6014. the background is drawn, then the foreground is drawn on top of it. Similarly, 
  6015. the background of an area primitive is the entire area to be filled. The 
  6016. background of an image primitive, however, is that part of the primitive in 
  6017. which the pels are not set. The following figure shows the background of a 
  6018. primitive. 
  6019.  
  6020. Background of a Primitive 
  6021.  
  6022. The background of this character-string primitive is the entire character box. 
  6023.  
  6024. The index to the default background color is CLR_BACKGROUND, which provides a 
  6025. background color appropriate for the device. On a printer, CLR_BACKGROUND is 
  6026. the color of the paper. On a display screen, CLR_BACKGROUND is the default 
  6027. window background color. 
  6028.  
  6029.  
  6030. ΓòÉΓòÉΓòÉ 7.2.8.3. Changing the Foreground and Background Colors of Primitives ΓòÉΓòÉΓòÉ
  6031.  
  6032. To change the current foreground color, use GpiSetColor; as input, the 
  6033. application supplies either the index to the required color in the current 
  6034. logical color table or the RGB value of the color, depending on the mode of the 
  6035. table. Color indexes higher than those supplied in the default color table must 
  6036. be loaded explicitly before they can be used. 
  6037.  
  6038. It is possible to specify one of the system colors (for example, 
  6039. SYSCLR_ACTIVEBORDER) as the current foreground (or background) color of a 
  6040. primitive. The color appears as defined in the system color table, and the 
  6041. logical color table is not used. 
  6042.  
  6043. The specified color becomes the current color, and the foreground of any 
  6044. primitive drawn subsequently is drawn in that color. The current foreground 
  6045. color for a particular primitive type is set by calling GpiSetAttrs. For 
  6046. example, if an application sets the current foreground color to CLR_RED by 
  6047. calling GpiSetColor, and sets the current foreground color for marker 
  6048. primitives to CLR_CYAN by calling GpiSetAttrs, all subsequent markers are cyan, 
  6049. and all other primitives are red. 
  6050.  
  6051. To change the current primitive background color, call GpiSetBackColor. To 
  6052. ensure that this color is different from the background color of the output 
  6053. area (so that the entire primitive background is visible), the current window 
  6054. background color must not be the same as the current primitive background 
  6055. color. Also, select an appropriate background mix attribute. 
  6056.  
  6057. GpiQueryBackColor returns the current background color setting for a character 
  6058. primitive; to learn the current foreground color setting, use GpiQueryColor. 
  6059. GpiQueryAttrs can be used to determine the current foreground and background 
  6060. color values for a single primitive type. 
  6061.  
  6062.  
  6063. ΓòÉΓòÉΓòÉ 7.2.9. Color Output and Mix Attributes ΓòÉΓòÉΓòÉ
  6064.  
  6065. A mix attribute is a bitwise operation on the color indexes in a device's 
  6066. logical color table. Mix attributes enable colors to be specified in relation 
  6067. to other colors. When an application draws a graphics primitive, the operating 
  6068. system uses a mix attribute to determine the color that appears on the output 
  6069. device. 
  6070.  
  6071. For example, instead of specifying that a line should be black and, therefore, 
  6072. invisible if the background also is black, an application can use a mix 
  6073. attribute of FM_XOR to specify that the line always should be drawn the inverse 
  6074. of the background color. 
  6075.  
  6076. Suppose an application has set the lColor field in the LINEBUNDLE structure to 
  6077. CLR_RED and the usMixMode field in the same structure to FM_OR. The current 
  6078. color of the drawing surface is CLR_GREEN. To determine the color of a line, 
  6079. the operating system performs a bitwise OR operation on the indexes of these 
  6080. colors, as follows: 
  6081.  
  6082.           0010  (the default index for red)
  6083.           0100  (the default index for green)
  6084.          ------
  6085.           0110  (result of bitwise OR)
  6086.  
  6087. In this case, the result is 6-the index for yellow. This means that even though 
  6088. the application specified CLR_RED in the LINEBUNDLE structure, a yellow line 
  6089. appears when the application calls any of the functions that draw a line 
  6090. primitive. 
  6091.  
  6092.  
  6093. ΓòÉΓòÉΓòÉ 7.2.10. Mix Attribute ΓòÉΓòÉΓòÉ
  6094.  
  6095. The mix attribute determines how each primitive an application draws is 
  6096. combined with any existing drawing. In color applications, the mix attribute 
  6097. determines the color that results when one primitive is drawn on top of 
  6098. another. There are two forms of the mix attribute:  foreground mix and 
  6099. background mix. 
  6100.  
  6101. The foreground mix attribute governs how the foreground of a primitive is 
  6102. combined with the existing drawing, and it applies to all primitive types. The 
  6103. background mix attribute governs how the background of a primitive is combined 
  6104. with the existing drawing, and it is applicable only to those primitives that 
  6105. have a background. Primitives that can be affected by the background mix 
  6106. attribute are areas, character strings, images, and markers. The primitive 
  6107. attribute data structures contain fields for both foreground and background 
  6108. color and mix attributes. 
  6109.  
  6110. There are 17 foreground mix attributes. For each mix attribute, the indexes of 
  6111. the foreground and current drawing-surface colors are combined by using 1 of 
  6112. the bitwise operators. The available foreground mix settings are listed in the 
  6113. following table. 
  6114.  
  6115. Foreground Mix Attributes 
  6116.  
  6117. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6118. ΓöéMix Attribute  ΓöéEffect         ΓöéDescription                   Γöé
  6119. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6120. ΓöéFM_DEFAULT     ΓöéDefault        ΓöéDefault foreground mix        Γöé
  6121. Γöé               Γöé               Γöéattribute (overpaint).        Γöé
  6122. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6123. ΓöéFM_OR          ΓöéOR             ΓöéIndex value of the final colorΓöé
  6124. Γöé               Γöé               Γöéis determined by a bitwise OR Γöé
  6125. Γöé               Γöé               Γöéoperation on the index of the Γöé
  6126. Γöé               Γöé               Γöéforeground color and the indexΓöé
  6127. Γöé               Γöé               Γöéof the color of the drawing   Γöé
  6128. Γöé               Γöé               Γöésurface.                      Γöé
  6129. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6130. ΓöéFM_OVERPAINT   ΓöéOverpaint      ΓöéIndex value of the final colorΓöé
  6131. Γöé               Γöé               Γöéis that of the foreground     Γöé
  6132. Γöé               Γöé               Γöécolor. This is the default    Γöé
  6133. Γöé               Γöé               Γöéforeground mix attribute.     Γöé
  6134. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6135. ΓöéFM_XOR         ΓöéExclusive-OR   ΓöéIndex value of the final colorΓöé
  6136. Γöé               Γöé(XOR)          Γöéis determined by a bitwise XORΓöé
  6137. Γöé               Γöé               Γöéoperation on the index of the Γöé
  6138. Γöé               Γöé               Γöéforeground color and the indexΓöé
  6139. Γöé               Γöé               Γöéof the color of the drawing   Γöé
  6140. Γöé               Γöé               Γöésurface.                      Γöé
  6141. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6142. ΓöéFM_LEAVEALONE  ΓöéLeave-alone    ΓöéIndex value of the final colorΓöé
  6143. Γöé               Γöé(Invisible)    Γöéis that of the index of the   Γöé
  6144. Γöé               Γöé               Γöécolor of the drawing surface. Γöé
  6145. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6146. ΓöéFM_AND         ΓöéAND            ΓöéIndex value of the final colorΓöé
  6147. Γöé               Γöé               Γöéis determined by a bitwise ANDΓöé
  6148. Γöé               Γöé               Γöéoperation on the index of the Γöé
  6149. Γöé               Γöé               Γöéforeground color and the indexΓöé
  6150. Γöé               Γöé               Γöéof the color of the drawing   Γöé
  6151. Γöé               Γöé               Γöésurface.                      Γöé
  6152. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6153. ΓöéFM_SUBTRACT    Γöé(Inverse       ΓöéIndex value of the final colorΓöé
  6154. Γöé               ΓöéSource) AND    Γöéis determined by inverting theΓöé
  6155. Γöé               ΓöéDestination    Γöéindex of the foreground color Γöé
  6156. Γöé               Γöé               Γöéand performing a bitwise AND  Γöé
  6157. Γöé               Γöé               Γöéoperation on this value and   Γöé
  6158. Γöé               Γöé               Γöéthe index of the color of the Γöé
  6159. Γöé               Γöé               Γöédrawing surface.              Γöé
  6160. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6161. ΓöéFM_MASKSRCNOT  ΓöéSource AND     ΓöéIndex value of the final colorΓöé
  6162. Γöé               Γöé(Inverse       Γöéis determined by inverting theΓöé
  6163. Γöé               ΓöéDestination)   Γöéindex value of the            Γöé
  6164. Γöé               Γöé               Γöédrawing-surface color and     Γöé
  6165. Γöé               Γöé               Γöéperforming a bitwise AND      Γöé
  6166. Γöé               Γöé               Γöéoperation on this value and   Γöé
  6167. Γöé               Γöé               Γöéthe index value of the        Γöé
  6168. Γöé               Γöé               Γöéforeground color.             Γöé
  6169. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6170. ΓöéFM_ZERO        ΓöéAll zeros      ΓöéRGB value of the final color'sΓöé
  6171. Γöé               Γöé               Γöéis always 0x00000000.         Γöé
  6172. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6173. ΓöéFM_NOTMERGESRC ΓöéInverse (SourceΓöéIndex value of the final colorΓöé
  6174. Γöé               ΓöéOR Destination)Γöéis always the inverse of the  Γöé
  6175. Γöé               Γöé               ΓöéFM_OR result.                 Γöé
  6176. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6177. ΓöéFM_NOTXORSRC   ΓöéInverse (SourceΓöéIndex value of the final colorΓöé
  6178. Γöé               ΓöéXOR            Γöéis always the inverse of the  Γöé
  6179. Γöé               ΓöéDestination)   ΓöéFM_XOR result.                Γöé
  6180. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6181. ΓöéFM_INVERT      ΓöéInverse        ΓöéIndex value of the final colorΓöé
  6182. Γöé               Γöé(Destination)  Γöéis always the inverse of the  Γöé
  6183. Γöé               Γöé               Γöéindex of the color of the     Γöé
  6184. Γöé               Γöé               Γöédrawing surface.              Γöé
  6185. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6186. ΓöéFM_MERGESRCNOT ΓöéSource OR      ΓöéIndex value of the final colorΓöé
  6187. Γöé               Γöé(Inverse       Γöéis determined by performing a Γöé
  6188. Γöé               ΓöéDestination)   Γöébitwise OR operation on the   Γöé
  6189. Γöé               Γöé               Γöéindex of the foreground color Γöé
  6190. Γöé               Γöé               Γöéand the inverse of the index  Γöé
  6191. Γöé               Γöé               Γöéof the color of the drawing   Γöé
  6192. Γöé               Γöé               Γöésurface.                      Γöé
  6193. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6194. ΓöéFM_NOTCOPYSRC  ΓöéInverse        ΓöéIndex value of the final colorΓöé
  6195. Γöé               Γöé(Source)       Γöéis the inverse of the index ofΓöé
  6196. Γöé               Γöé               Γöéthe foreground color.         Γöé
  6197. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6198. ΓöéFM_MERGENOTSRC Γöé(Inverse       ΓöéIndex value of the final colorΓöé
  6199. Γöé               ΓöéSource) OR     Γöéis determined by performing a Γöé
  6200. Γöé               ΓöéDestination    Γöébitwise AND operation on the  Γöé
  6201. Γöé               Γöé               Γöéindex of the drawing surface'sΓöé
  6202. Γöé               Γöé               Γöécolor and the inverse of the  Γöé
  6203. Γöé               Γöé               Γöéindex of the foreground color.Γöé
  6204. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6205. ΓöéFM_NOTMASKSRC  ΓöéInverse (SourceΓöéIndex value of the final colorΓöé
  6206. Γöé               ΓöéAND            Γöéis the inverse of the FM_AND  Γöé
  6207. Γöé               ΓöéDestination)   Γöéresult.                       Γöé
  6208. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6209. ΓöéFM_ONE         ΓöéAll 1's.       ΓöéRGB value of the final color  Γöé
  6210. Γöé               Γöé               Γöéis always 0x00FFFFFF.         Γöé
  6211. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6212.  
  6213. There are four background mix attributes. For each mix attribute, the index 
  6214. value for the background color and the current drawing-surface color (in the 
  6215. device's physical color table) are combined using one of the bitwise operators. 
  6216.  
  6217. The RGB values are those from the physical color table. When the result of the 
  6218. mix attribute's bitwise operation defines a color different from that of both 
  6219. the drawing surface and the drawing attribute, the resulting index accesses an 
  6220. RGB color in the physical table. The color, therefore, is unpredictable unless 
  6221. the logical color table has been realized (using the Palette Manager). 
  6222.  
  6223. The first five of the foreground mix attributes also are available as 
  6224. background mix attributes. The background mix attributes are listed in the 
  6225. following table. 
  6226.  
  6227. Background Mix Attributes 
  6228.  
  6229. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6230. ΓöéMix Attribute  ΓöéEffect         ΓöéDescription                   Γöé
  6231. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6232. ΓöéBM_DEFAULT     ΓöéDefault        ΓöéDefault background mix        Γöé
  6233. Γöé               Γöé               Γöéattribute (Leave-alone).      Γöé
  6234. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6235. ΓöéBM_OR          ΓöéOR             ΓöéIndex value of the final colorΓöé
  6236. Γöé               Γöé               Γöéis determined by a bitwise OR Γöé
  6237. Γöé               Γöé               Γöéoperation on the index of the Γöé
  6238. Γöé               Γöé               Γöébackground color and the indexΓöé
  6239. Γöé               Γöé               Γöéof the color of the drawing   Γöé
  6240. Γöé               Γöé               Γöésurface.                      Γöé
  6241. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6242. ΓöéBM_OVERPAINT   ΓöéOverpaint      ΓöéIndex value of the final colorΓöé
  6243. Γöé               Γöé               Γöéis that of the background     Γöé
  6244. Γöé               Γöé               Γöécolor.                        Γöé
  6245. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6246. ΓöéBM_XOR         ΓöéExclusive-OR   ΓöéIndex value of the final colorΓöé
  6247. Γöé               Γöé(XOR)          Γöéis determined by a bitwise XORΓöé
  6248. Γöé               Γöé               Γöéoperation on the index of the Γöé
  6249. Γöé               Γöé               Γöébackground color and the indexΓöé
  6250. Γöé               Γöé               Γöéof the color of the drawing   Γöé
  6251. Γöé               Γöé               Γöésurface.                      Γöé
  6252. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6253. ΓöéBM_LEAVEALONE  ΓöéLeave-alone    ΓöéIndex value of the final colorΓöé
  6254. Γöé               Γöé(Invisible)    Γöéis that of the drawing-surfaceΓöé
  6255. Γöé               Γöé               Γöécolor.                        Γöé
  6256. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6257.  
  6258. The most frequently used foreground mix attributes are FM_OVERPAINT, which is 
  6259. the default value, FM_OR, and FM_XOR. The most frequently used background mix 
  6260. attributes are BM_LEAVEALONE, which is the default value, and BM_OVERPAINT. 
  6261.  
  6262.  
  6263. ΓòÉΓòÉΓòÉ 7.2.10.1. Overpaint Mix Attribute ΓòÉΓòÉΓòÉ
  6264.  
  6265. When using FM_OVERPAINT, the foreground of the primitive replaces any existing 
  6266. drawing in the same area of the presentation page. If the existing drawing is 
  6267. yellow, for example, and the new drawing is red, the drawing is red at the 
  6268. points of overlap. (This is the default foreground mix attribute.) Because 1 
  6269. color is replacing another and no color mixing is being performed, the effects 
  6270. of the overpaint mix attribute are entirely predictable, as shown in the 
  6271. following figure. 
  6272.  
  6273. Overpaint Foreground Mix Attribute 
  6274.  
  6275. The circle is drawn on top of the square. At the points of overlap, the output 
  6276. is the color of the circle. 
  6277.  
  6278. When using BM_OVERPAINT, the primitive background replaces the existing 
  6279. drawing, as shown in the following figure. 
  6280.  
  6281. Overpaint Background Mix Attribute 
  6282.  
  6283. Using BM_OVERPAINT, the background of the primitive is apparent only if it is 
  6284. drawn in a different color from the output-area background. Notice that, in 
  6285. this example, the foreground mix attribute is FM_OVERPAINT. 
  6286.  
  6287.  
  6288. ΓòÉΓòÉΓòÉ 7.2.10.2. OR Mix Attribute ΓòÉΓòÉΓòÉ
  6289.  
  6290. When using FM_OR, the foreground of the new primitive is merged with the 
  6291. existing drawing at the points of overlap. This is effected by ORing the 
  6292. indexes of the overlapping colors to produce a third color. The resulting color 
  6293. is unpredictable if the logical color table has not been realized (using the 
  6294. Palette Manager). The OR mix attribute is useful for making the common points 
  6295. of 2 graphics distinct from the points belonging to 1 of the graphics only, as 
  6296. shown in the following figure. 
  6297.  
  6298. OR Mix Attribute 
  6299.  
  6300. The circle is drawn on top of the square. At the points of overlap, indexes are 
  6301. OR'd to produce a new index referencing a new RGB color in the physical color 
  6302. table. 
  6303.  
  6304. When using the BM_OR attribute, the background of the primitive is merged with 
  6305. the existing drawing according to the same rules that apply to the FM_OR 
  6306. attribute. 
  6307.  
  6308.  
  6309. ΓòÉΓòÉΓòÉ 7.2.10.3. Exclusive-OR (XOR) Mix Attribute ΓòÉΓòÉΓòÉ
  6310.  
  6311. The FM_XOR attribute enables objects to be drawn in such a way that they can be 
  6312. removed easily by simply drawing them a second time using the FM_XOR attribute. 
  6313. The FM_XOR attribute is available on display devices only and is useful for 
  6314. graphics animation when an application must move an individual graphic and 
  6315. completely restore the graphics that it originally overlapped. Typically, an 
  6316. application would do the following: 
  6317.  
  6318.  1. Draw the graphics object using the FM_XOR attribute. 
  6319.  
  6320.  2. Calculate the object's next position. 
  6321.  
  6322.  3. Draw the object again in its current position, still using the FM_XOR 
  6323.     attribute. This effectively erases it from its current position without 
  6324.     destroying the graphics with which it overlaps. 
  6325.  
  6326.  4. Draw the object in its new position using the FM_XOR mix attribute. 
  6327.  
  6328. For retained graphics, this sequence can be automated to some extent by 
  6329. defining specific graphics segments as dynamic. Dynamic graphics always are 
  6330. drawn using the FM_XOR attribute, regardless of the current mix attributes. 
  6331.  
  6332. The effects of the FM_XOR attribute are shown in the following figure. 
  6333.  
  6334. Exclusive-OR (XOR) Mix Attribute 
  6335.  
  6336. The circle is drawn on top of the square. At the points of overlap, graphics 
  6337. are not drawn if the 2 overlapping figures are an identical color. 
  6338.  
  6339. When using the BM_XOR attribute, the background of the primitive is merged with 
  6340. the existing picture according to the same rules that apply to the FM_XOR 
  6341. attribute. 
  6342.  
  6343.  
  6344. ΓòÉΓòÉΓòÉ 7.2.10.4. Leave-Alone Mix Attribute ΓòÉΓòÉΓòÉ
  6345.  
  6346. The leave-alone mix attribute most often is used as a background mix attribute. 
  6347. When using the FM_LEAVEALONE attribute, the foreground of the primitive is not 
  6348. drawn. When using the BM_LEAVEALONE attribute, the background of the primitive 
  6349. is not drawn, as shown in the following figure. 
  6350.  
  6351. Leave-Alone Background Mix Attribute 
  6352.  
  6353. This is the background mix attribute that most often is used for character 
  6354. strings and marker primitives. It is generally used with a foreground mix value 
  6355. of FM_OVERPAINT. 
  6356.  
  6357.  
  6358. ΓòÉΓòÉΓòÉ 7.2.10.5. Specifying Foreground and Background Mix Attributes ΓòÉΓòÉΓòÉ
  6359.  
  6360. Specify the current foreground mix value for all primitives using GpiSetMix. To 
  6361. learn the current foreground mix setting, use GpiQueryMix, which returns the 
  6362. current foreground mix setting for a character string primitive. GpiQueryAttrs 
  6363. can be used to determine the current foreground and background mix values for a 
  6364. single primitive type. 
  6365.  
  6366. To specify a background mix value for all primitives, use GpiSetBackMix. 
  6367. GpiQueryBackMix returns the current background mix value for a character-string 
  6368. primitive. To specify the current foreground and background mix values for a 
  6369. single primitive type, call GpiSetAttrs. 
  6370.  
  6371. Note:  Not all devices support all of the background and foreground mix 
  6372.        attributes described. When a device does not support the mix attribute 
  6373.        chosen by an application, the default mix attribute is used; no error 
  6374.        condition is raised. DevQueryCaps can be used to determine whether a mix 
  6375.        attribute is supported on a specific device. 
  6376.  
  6377.  
  6378. ΓòÉΓòÉΓòÉ 7.2.11. Color on Advanced Display Devices ΓòÉΓòÉΓòÉ
  6379.  
  6380. Some devices can display simultaneously a fixed number of colors (typically 
  6381. 156), chosen from a much larger number of colors (often more than 256000). An 
  6382. application can use the Palette Manager functions to take advantage of the 
  6383. extra capabilities of these devices. These functions enable an application to 
  6384. change the colors in a device's physical color table and the displayed colors 
  6385. rapidly without explicitly redrawing the screen. 
  6386.  
  6387. An application can use the CAPS_ADDITIONAL_GRAPHICS option of DevQueryCaps to 
  6388. determine whether the display device supports palette functions. 
  6389.  
  6390.  
  6391. ΓòÉΓòÉΓòÉ 7.2.12. Dithering ΓòÉΓòÉΓòÉ
  6392.  
  6393. If an application requests a color not available in the physical color table, 
  6394. the operating system can approximate the color by a process called dithering. 
  6395. For example, if the physical color table does not contain a light green color 
  6396. but does contain a yellow and a green, the operating system can create what 
  6397. appears to be light green by mixing yellow pels and green pels. Dithering is a 
  6398. variation on the way red, green, and blue color guns illuminate the phosphors 
  6399. in a single pel to produce a color that is not pure red, green, or blue (for 
  6400. example, yellow). 
  6401.  
  6402. The dithering process takes advantage of the way the human eye interprets 
  6403. color. If every other pel is set to one color, and all the intermediate pels to 
  6404. a different color, together they produce the effect of a third color at normal 
  6405. viewing distances. 
  6406.  
  6407. The checkerboard effect is just one of the ways in which dithering can be 
  6408. implemented. Dithering works only when producing a solid mass of color, such as 
  6409. an area fill pattern. It does not have the desired effect on line primitives. 
  6410.  
  6411. Dithering is especially important on monochrome devices. By combining various 
  6412. combinations of black pels with white pels, the operating system can create 
  6413. numerous shades of gray. 
  6414.  
  6415. To use only the pure colors defined in the physical color table, that is, to 
  6416. prevent color dithering, set LCOL_PURECOLOR in GpiCreateLogColorTable. When 
  6417. LCOL_PURECOLOR is set, the nearest available color to the 1 selected is used. 
  6418.  
  6419.  
  6420. ΓòÉΓòÉΓòÉ 7.2.13. Considerations When Using Monochrome Displays ΓòÉΓòÉΓòÉ
  6421.  
  6422. When a graphic primitive that is drawn in color is displayed on a monochrome 
  6423. display, the operating system maps the colors that the application uses to the 
  6424. colors supported by the monochrome display. 
  6425.  
  6426.  
  6427. ΓòÉΓòÉΓòÉ 7.2.13.1. Drawing Color Graphics on Monochrome Devices ΓòÉΓòÉΓòÉ
  6428.  
  6429. When mapping color graphics to a monochrome device (screen, printer, or bit 
  6430. map), the monochrome device has a reset color and a contrast color. The reset 
  6431. color is the color GpiErase clears to and is either black or white. If the 
  6432. reset color is black, the contrast color is white; and if the reset color is 
  6433. white, the contrast color is black. 
  6434.  
  6435. To determine whether the reset color is to be black or white, the color 
  6436. retrieved by the index CLR_BACKGROUND from the current logical color table is 
  6437. examined. If a logical color table has not been loaded, CLR_BACKGROUND is 
  6438. either the paper color on a printer or SYSCLR_WINDOW on a display. If a logical 
  6439. color table has been loaded, CLR_BACKGROUND is the color addressed by color 
  6440. index 0 on any device. 
  6441.  
  6442. If the color retrieved by CLR_BACKGROUND is either white or black, that color 
  6443. becomes the reset color. For example, if an application is drawing to a screen, 
  6444. has not loaded a color table, and the system colors have not been altered, the 
  6445. background color is white, because SYSCLR_WINDOW produces a white background by 
  6446. default. In this instance, the contrast color is black. 
  6447.  
  6448. If the color retrieved by CLR_BACKGROUND is neither white nor black, the color 
  6449. translates to whichever of black and white it is nearest to. As a rule, dark 
  6450. colors produce a black background, and pale colors produce a white background. 
  6451. For example, if an application is using a loaded color table, or if the color 
  6452. retrieved by SYSCLR_WINDOW has been altered (either interactively or by 
  6453. WinSetSysColors), CLR_BACKGROUND could be dark gray. In this instance, the 
  6454. reset color would be black, and the contrast color would be white. 
  6455.  
  6456. When the reset color has been established, the PM programming interface applies 
  6457. the following rules when mapping color graphics to a monochrome device: 
  6458.  
  6459. o Any color graphics drawn in CLR_BACKGROUND, and any graphics defined in the 
  6460.   actual reset color (which is either black or white), are drawn in the reset 
  6461.   color. Any other graphics are drawn in the contrast color. 
  6462.  
  6463. o The index CLR_WHITE produces white, and the index CLR_BLACK produces black, 
  6464.   regardless of whether the reset color is black or white. 
  6465.  
  6466. o If no color table is loaded and CLR_DEFAULT or CLR_NEUTRAL are used as the 
  6467.   foreground color, they produce the contrast color. If they are used as the 
  6468.   background color, they produce the reset color. 
  6469.  
  6470. o If an application calls GpiQueryNearestColor for a monochrome device, one of 
  6471.   the following occurs: 
  6472.  
  6473.    - If the color supplied on input is the reset color, the reset color is 
  6474.      returned. 
  6475.    - If the color supplied on input is not the reset color, the contrast color 
  6476.      is returned. 
  6477.  
  6478.  
  6479. ΓòÉΓòÉΓòÉ 7.2.13.2. Drawing Color Area Fill Patterns on Monochrome Devices ΓòÉΓòÉΓòÉ
  6480.  
  6481. An area primitive is drawn according to the current foreground and background 
  6482. mix attributes and in the current area foreground and area background colors. 
  6483.  
  6484. When an application draws a monochrome pattern on a color device, the bits of 
  6485. the pattern set to 1 translate to the current area foreground color, and the 0 
  6486. bits translate to the current area background color. When the application draws 
  6487. a color pattern on a monochrome device, and if the current pattern is anything 
  6488. other than PATSYM_DEFAULT or PATSYM_SOLID from the default pattern set, the 
  6489. color closest to white is translated into 1 bits. For example, if a pattern of 
  6490. diagonal lines is being drawn in which the foreground color is red and the 
  6491. background color is cyan, the cyan is translated to white (1 bits) because cyan 
  6492. is closer than red is to white. Red, therefore is translated to black (0 bits). 
  6493. The effect of translating this color pattern to a monochrome surface is 
  6494. summarized as follows: 
  6495.  
  6496. Pattern      As 1s and     Color       Monochrome
  6497.                 0s        Surface       Surface
  6498.  
  6499. \   \        10001000     RcccRccc     01110111
  6500.  \   \       01000100     cRcccRcc     10111011
  6501.   \   \      00100010     ccRcccRc     11011101
  6502.    \   \     00010001     cccRcccR     11101110
  6503. \   \        10001000     RcccRccc     01110111
  6504.  \   \       01000100     cRcccRcc     10111011
  6505.   \   \      00100010     ccRcccRc     11011101
  6506.    \   \     00010001     cccRcccR     11101110
  6507.  
  6508. The original pattern of 1's and 0's is used, however, when deciding which part 
  6509. of the pattern is the background and which part is the foreground. Thus, if the 
  6510. background mix attribute is BM_LEAVEALONE, the following occurs: 
  6511.  
  6512. Pattern      As 1s and     Color      Monochrome
  6513.                 0s        Surface      Surface
  6514.  
  6515. \   \        10001000     R...R...     0...0...
  6516.  \   \       01000100     .R...R..     .0...0..
  6517.   \   \      00100010     ..R...R.     ..0...0.
  6518.    \   \     00010001     ...R...R     ...0...0
  6519. \   \        10001000     R...R...     0...0...
  6520.  \   \       01000100     .R...R..     .0...0..
  6521.   \   \      00100010     ..R...R.     ..0...0.
  6522.    \   \     00010001     ...R...R     ...0...0
  6523.  
  6524. The 1 bits on the monochrome surface still are interpreted as the background of 
  6525. the primitive and are not drawn when the BM_LEAVEALONE attribute is specified. 
  6526.  
  6527. When a bit map is used as an area fill pattern, any bit drawn in the current 
  6528. area background color is set to 0, and all other bits are set to 1 on a 
  6529. monochrome surface. Thus, if the current area background color is blue, all 
  6530. blue bits in the bit map are set to 0, and all other bits are set to 1. The 0 
  6531. bits constitute the background of the primitive. 
  6532.  
  6533. If the pattern is solid (PATSYM_DEFAULT or PATSYM_SOLID in the supplied pattern 
  6534. set), the following occurs: 
  6535.  
  6536. o If color dithering is switched off, and the application is drawing a color 
  6537.   pattern to a color surface, the color nearest the color specified is used. 
  6538.  
  6539. o If color dithering is switched on, and the application is drawing a color 
  6540.   pattern to a color surface, a combination of colors can be used to achieve 
  6541.   the effect of the requested color. For example, if the application chooses 
  6542.   pink on a surface where pink is not available, a combination of red and white 
  6543.   pels can be used to achieve the effect of the color. 
  6544.  
  6545. o If color dithering is switched on, and the application is drawing a color 
  6546.   pattern to a monochrome surface, sufficient pels are set to suggest the 
  6547.   intensity of the requested color. 
  6548.  
  6549. Dithering can be enabled and disabled using LCOL_PURECOLOR in 
  6550. GpiCreateLogColorTable. 
  6551.  
  6552.  
  6553. ΓòÉΓòÉΓòÉ 7.3. Using Color and Mix Attributes ΓòÉΓòÉΓòÉ
  6554.  
  6555. The color- and mix-attribute functions can be used to perform the following 
  6556. tasks: 
  6557.  
  6558. o Create a logical color table. 
  6559.  
  6560. o Determine the format and the starting and ending index values of the current 
  6561.   logical color table. 
  6562.  
  6563. o Determine the index value for an entry in the logical color table that is the 
  6564.   closest match to an RGB value. 
  6565.  
  6566. o Determine the RGB value associated with a particular entry in the logical 
  6567.   color table. 
  6568.  
  6569. o Determine and set the current foreground and background colors. 
  6570.  
  6571. o Determine and set the current foreground and background mix attributes. 
  6572.  
  6573.  
  6574. ΓòÉΓòÉΓòÉ 7.3.1. Creating a Logical Color Table ΓòÉΓòÉΓòÉ
  6575.  
  6576. To create a logical color table, the application creates an array of RGB values 
  6577. that replace the existing logical color table, then calls 
  6578. GpiCreateLogColorTable, using the LCOL_RESET and LCOLF_CONSECRGB flags. The 
  6579. following figure demonstrates this process. 
  6580.  
  6581. #define INCL_GPILOGCOLORTABLE
  6582. #include <os2.h>
  6583.  
  6584. void fncCOLR01(void){
  6585.     HPS hps;
  6586.     LONG alTable[] = {
  6587.         0xFFFFFF,        /* White */
  6588.         0xFF88FF,
  6589.         0xFF8800,
  6590.         0xFF8888,
  6591.         0xFF0088,
  6592.         0x880088,
  6593.         0x008888,
  6594.         0x00FF88,
  6595.         0x00F800,
  6596.         0x008800,
  6597.         0x000088,
  6598.         0x0000F8,
  6599.         0x0800F8,
  6600.         0x888888,
  6601.         0x080808,
  6602.         0x000000 };      /* Black */
  6603.  
  6604.     GpiCreateLogColorTable(hps,
  6605.        LCOL_RESET,                      /* Start with the default      */
  6606.        LCOLF_CONSECRGB,                 /* Consecutive RGB values      */
  6607.        0,                               /* Starting index in table     */
  6608.        sizeof(alTable) / sizeof(LONG),  /* Number of elements in table */
  6609.        alTable);
  6610. } /* fncCOLR01 */
  6611.  
  6612.  
  6613. Creating a Logical Color Table 
  6614.  
  6615.  
  6616. ΓòÉΓòÉΓòÉ 7.3.2. Determining the Color-Table Format and Index Values ΓòÉΓòÉΓòÉ
  6617.  
  6618. To determine the format and the starting and ending index values of the current 
  6619. logical color table, applications call GpiQueryColorData. The following figure 
  6620. is an example of using GpiQueryColorData to determine whether the default 
  6621. logical color table is loaded. If so, the code fragment loads a new table. 
  6622.  
  6623. #define INCL_GPILOGCOLORTABLE
  6624. #include <os2.h>
  6625.  
  6626. void fncCOLR02(void){
  6627.     HPS hps;
  6628.     LONG        aClrData[3];
  6629.     LONG alTable[16];
  6630.  
  6631.     GpiQueryColorData(hps, 3, aClrData);
  6632.  
  6633.     if (aClrData[QCD_LCT_FORMAT] == LCOLF_DEFAULT)
  6634.         GpiCreateLogColorTable(hps,
  6635.            LCOL_RESET,                      /* Start with the default      */
  6636.            LCOLF_CONSECRGB,                 /* Consecutive RGB values      */
  6637.            0,                               /* Starting index in table     */
  6638.            sizeof(alTable) / sizeof(LONG),  /* Number of elements in table */
  6639.            alTable);
  6640. } /* fncCOLR02 */
  6641.  
  6642.  
  6643. Determining Color-Table Format and Index Values 
  6644.  
  6645.  
  6646. ΓòÉΓòÉΓòÉ 7.3.3. Determining the Index Value of an RGB Value ΓòÉΓòÉΓòÉ
  6647.  
  6648. Applications call GpiQueryColorIndex to find the closest match in a logical 
  6649. color table to an RGB value. This function finds the closest match for this RGB 
  6650. value in the physical color table, then finds the color in the logical color 
  6651. table closest to the color in the physical color table. The function returns 
  6652. the index value of that entry in the logical color table. The followiing figure 
  6653. is an example of how to determine which index value in the logical color table 
  6654. matches the RGB value for pink (0x00FF00FF), then uses that index entry to set 
  6655. the foreground color to pink for each of the primitive attributes. 
  6656.  
  6657. #define INCL_GPILOGCOLORTABLE
  6658. #include <os2.h>
  6659.  
  6660. void fncCOLR03(void){
  6661.     LONG lIndex;                             /* Logical-color-table index */
  6662.     HPS hps;
  6663.  
  6664.     lIndex = GpiQueryColorIndex(hps, LCOLOPT_REALIZED, 0x00FF00FF);
  6665.  
  6666.     if ((lIndex >= 0) && (lIndex <= 15))     /* Check for valid index     */
  6667.         GpiSetColor(hps, lIndex);
  6668. } /* fncCOLR03 */
  6669.  
  6670.  
  6671. Determining the Index Value of an RGB Value 
  6672.  
  6673.  
  6674. ΓòÉΓòÉΓòÉ 7.3.4. Setting the Primitive Color Attributes ΓòÉΓòÉΓòÉ
  6675.  
  6676. To set the color attributes for 1 type of graphics primitive, an application 
  6677. uses GpiSetAttrs. To set the color attributes for each type of primitive in a 
  6678. presentation space, use GpiSetColor and GpiSetBackColor. The following figure 
  6679. shows how to use GpiSetAttrs to set the color attribute of line primitives to 
  6680. dark gray. 
  6681.  
  6682. #define INCL_GPIPRIMITIVES
  6683. #include <os2.h>
  6684.  
  6685. void fncCOLR04(void){
  6686.     LINEBUNDLE lbnd;     /* Line-primitive attribute structure */
  6687.     HPS hps;
  6688.  
  6689.     lbnd.lColor = CLR_DARKGRAY;
  6690.  
  6691.     GpiSetAttrs(hps, PRIM_LINE, LBB_COLOR, 0, &lbnd);
  6692. } /* fncCOLR04 */
  6693.  
  6694.  
  6695. Setting Primitive Color Attributes 
  6696.  
  6697. The following figure is an example of how to use GpiSetColor to set the 
  6698. foreground color attribute to dark gray in all of the primitives. 
  6699.  
  6700. #include <os2.h>
  6701.  
  6702. void fncCOLR05(void){
  6703.     HPS hps;
  6704.  
  6705.     GpiSetColor(hps, CLR_DARKGRAY);
  6706. } /* fncCOLR05 */
  6707.  
  6708.  
  6709. Setting Foreground Color Attributes 
  6710.  
  6711.  
  6712. ΓòÉΓòÉΓòÉ 7.3.5. Creating a Palette ΓòÉΓòÉΓòÉ
  6713.  
  6714. To create a palette, an application must first call DevQueryCaps with the 
  6715. CAPS_ADDITIONAL_GRAPHICS option to determine whether the device supports 
  6716. palette functions. Next the application creates an array of RGB values or an 
  6717. array of RGB2 structures, then calls GpiCreatePalette. Next the applications 
  6718. calls GpiSelectPalette to select the palette for the presentation space, and 
  6719. calls WinRealizePalette to map the RGB values to device colors for subsequent 
  6720. drawing. When the application is finished drawing, it calls GpiSelectPalette to 
  6721. disassociate the presentation space and the palette; then it deletes the 
  6722. palette by calling GpiDeletePalette. 
  6723.  
  6724. The following figure demonstrates these steps. 
  6725.  
  6726. #define INCL_GPILOGCOLORTABLE
  6727. #define INCL_GPIBITMAPS
  6728. #include <os2.h>
  6729. void fncCOLR06(void){
  6730.     COLOR clrCurrent;
  6731.     HPAL hpal;
  6732.     HDC hdc;
  6733.     HPS hps;
  6734.     HAB hab;
  6735.     HWND hwnd;
  6736.     POINTL aptl[2], ptl;
  6737.     LONG cSimulColors, lPalSupport;
  6738.     SHORT j;
  6739.     RGB2 *prgb2ColorData;
  6740.  
  6741.     /* Determine how many colors the device can display at once.              */
  6742.     DevQueryCaps(hdc, CAPS_COLORS, 1, &cSimulColors);
  6743.  
  6744.     /* Determine if the device supports Palette Manager functions.            */
  6745.     DevQueryCaps(hdc, CAPS_ADDITIONAL_GRAPHICS, 1, &lPalSupport);
  6746.  
  6747.     /* Allocate space for the array of RGB2 structures.                       */
  6748.     DosAllocMem((PPVOID)&prgb2ColorData, cSimulColors * sizeof(RGB2), fALLOC);
  6749.  
  6750.     /* Fill the array of RGB2 structures with as many different               */
  6751.     /*    shades of blue as the device will support.                          */
  6752.  
  6753.     clrCurrent = 0x000000FF;
  6754.     for (j = 0; j < cSimulColors; j++) {
  6755.         prgb2ColorData[j].bRed = 0;
  6756.         prgb2ColorData[j].bGreen = 0;
  6757.         prgb2ColorData[j].bBlue = clrCurrent;
  6758.         prgb2ColorData[j].fcOptions = 0;
  6759.         clrCurrent = clrCurrent > 0 ? --clrCurrent : 0x000000FF;
  6760.     }
  6761.  
  6762.     if (lPalSupport & CAPS_PALETTE_MANAGER) {
  6763.         hpal = GpiCreatePalette(hab,       /* Create palette                  */
  6764.                0L,
  6765.                LCOLF_CONSECRGB,            /* Format of color table entries   */
  6766.                cSimulColors,               /* Number of entries in table      */
  6767.                (PULONG) prgb2ColorData);   /* Pointer to color table          */
  6768.     }
  6769.  
  6770.     GpiSelectPalette(hps, hpal);
  6771.     WinRealizePalette(hwnd, hps);
  6772.     GpiSelectPalette(hps, NULLHANDLE);     /* Restore default physical colors */
  6773.     GpiDeletePalette(hpal);                /* Delete palette                  */
  6774. } /* fncCOLR06 */
  6775.  
  6776.  
  6777. Creating a Palette 
  6778.  
  6779.  
  6780. ΓòÉΓòÉΓòÉ 7.4. Summary ΓòÉΓòÉΓòÉ
  6781.  
  6782. The following table summarizes the color and mix attribute functions. 
  6783.  
  6784. Color and Mix Attribute Functions 
  6785.  
  6786. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6787. ΓöéFunction Name           ΓöéDescription                         Γöé
  6788. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6789. ΓöéGpiAnimatePalette       ΓöéChanges the color values of         Γöé
  6790. Γöé                        Γöéanimating indexes in a palette.     Γöé
  6791. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6792. ΓöéGpiCreateLogColorTable  ΓöéLoads a new logical color table.    Γöé
  6793. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6794. ΓöéGpiCreatePalette        ΓöéCreates and initializes a color     Γöé
  6795. Γöé                        Γöépalette.                            Γöé
  6796. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6797. ΓöéGpiDeletePalette        ΓöéDeletes a color palette.            Γöé
  6798. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6799. ΓöéGpiQueryBackColor       ΓöéDetermines the current background   Γöé
  6800. Γöé                        Γöécolor from the character string     Γöé
  6801. Γöé                        Γöébundle attributes.                  Γöé
  6802. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6803. ΓöéGpiQueryBackMix         ΓöéDetermines the current background   Γöé
  6804. Γöé                        Γöémix attribute from the character    Γöé
  6805. Γöé                        Γöéstring bundle attributes.           Γöé
  6806. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6807. ΓöéGpiQueryColor           ΓöéDetermines the current foreground   Γöé
  6808. Γöé                        Γöécolor from the character string     Γöé
  6809. Γöé                        Γöébundle attributes.                  Γöé
  6810. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6811. ΓöéGpiQueryColorData       ΓöéDetermines information about the    Γöé
  6812. Γöé                        Γöécurrent logical color table.        Γöé
  6813. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6814. ΓöéGpiQueryColorIndex      ΓöéDetermines the index value for the  Γöé
  6815. Γöé                        Γöélogical color table entry closest toΓöé
  6816. Γöé                        Γöéa specified RGB value.              Γöé
  6817. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6818. ΓöéGpiQueryLogColorTable   ΓöéDetermines the current logical colorΓöé
  6819. Γöé                        Γöétable contents.                     Γöé
  6820. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6821. ΓöéGpiQueryMix             ΓöéDetermines the current foreground   Γöé
  6822. Γöé                        Γöémix attribute from the character    Γöé
  6823. Γöé                        Γöéstring bundle attributes.           Γöé
  6824. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6825. ΓöéGpiQueryNearestColor    ΓöéDetermines the RGB value available  Γöé
  6826. Γöé                        Γöéon an output device, closest to a   Γöé
  6827. Γöé                        Γöédesired RGB value.                  Γöé
  6828. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6829. ΓöéGpiQueryPalette         ΓöéDetermines the palette currently    Γöé
  6830. Γöé                        Γöéselected in a presentation space.   Γöé
  6831. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6832. ΓöéGpiQueryPaletteInfo     ΓöéDetermines the RGB, the index       Γöé
  6833. Γöé                        Γöévalues, or both, for the currently  Γöé
  6834. Γöé                        Γöéloaded colors.                      Γöé
  6835. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6836. ΓöéGpiQueryRealColors      ΓöéDetermines the RGB values for actualΓöé
  6837. Γöé                        Γöécolors in the device color table.   Γöé
  6838. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6839. ΓöéGpiQueryRGBColor        ΓöéDetermines the RGB value paired withΓöé
  6840. Γöé                        Γöéa logical color table index.        Γöé
  6841. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6842. ΓöéGpiRealizeColorTable    ΓöéMaps the logical color table into   Γöé
  6843. Γöé                        Γöéthe physical color table.           Γöé
  6844. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6845. ΓöéGpiSelectPalette        ΓöéSelects a new palette for the       Γöé
  6846. Γöé                        Γöépresentation space.                 Γöé
  6847. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6848. ΓöéGpiSetBackColor         ΓöéSets the background color for       Γöé
  6849. Γöé                        Γöécharacter strings, markers, areas,  Γöé
  6850. Γöé                        Γöéimages, and bit maps.               Γöé
  6851. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6852. ΓöéGpiSetBackMix           ΓöéSets the background mix attribute   Γöé
  6853. Γöé                        Γöéfor character strings, markers,     Γöé
  6854. Γöé                        Γöéareas, images, and bit maps.        Γöé
  6855. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6856. ΓöéGpiSetColor             ΓöéSets the foreground color for arcs, Γöé
  6857. Γöé                        Γöélines, character strings, markers,  Γöé
  6858. Γöé                        Γöéareas, images, and bit maps.        Γöé
  6859. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6860. ΓöéGpiSetMix               ΓöéSets the foreground mix attribute   Γöé
  6861. Γöé                        Γöéfor arcs, lines, character strings, Γöé
  6862. Γöé                        Γöémarkers, areas, images, and bit     Γöé
  6863. Γöé                        Γöémaps.                               Γöé
  6864. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6865. ΓöéGpiSetPaletteEntries    ΓöéChanges entries in a logical        Γöé
  6866. Γöé                        Γöépalette.                            Γöé
  6867. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6868. ΓöéGpiUnrealizeColorTable  ΓöéDisassociates the mapped logical    Γöé
  6869. Γöé                        Γöécolor table from the physical color Γöé
  6870. Γöé                        Γöétable.                              Γöé
  6871. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6872.  
  6873. The following table summarizes the data structures used by the color and mix 
  6874. attribute functions. 
  6875.  
  6876. Color and Mix Attribute Structures 
  6877.  
  6878. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  6879. ΓöéStructure Name          ΓöéDescription                         Γöé
  6880. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6881. ΓöéAREABUNDLE              ΓöéArea primitive attributes.          Γöé
  6882. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6883. ΓöéCHARBUNDLE              ΓöéCharacter primitive attributes.     Γöé
  6884. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6885. ΓöéIMAGEBUNDLE             ΓöéImage primitive attributes.         Γöé
  6886. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6887. ΓöéLINEBUNDLE              ΓöéLine primitive attributes.          Γöé
  6888. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6889. ΓöéMARKERBUNDLE            ΓöéMarker primitive attributes.        Γöé
  6890. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6891. ΓöéRGB                     ΓöéRed, green and byte color values.   Γöé
  6892. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  6893. ΓöéRGB2                    ΓöéSame as RGB with the addition of an Γöé
  6894. Γöé                        Γöéoption-flag.                        Γöé
  6895. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  6896.  
  6897.  
  6898. ΓòÉΓòÉΓòÉ 8. Bit Maps ΓòÉΓòÉΓòÉ
  6899.  
  6900. Raster output devices, such as display screens, are made up of a number of 
  6901. picture elements, called pixels or pels. By setting the color of the pels, you 
  6902. can create an image on the screen. The screen image can be represented 
  6903. internally by a graphics object called a bit map.  The bit map contains a 
  6904. number of bits that describe the appearance of each pel on the screen. 
  6905.  
  6906. This chapter describes bit maps, their creation, uses, and functions. The 
  6907. following topics are related to the information in this chapter: 
  6908.  
  6909. o Presentation spaces and device contexts 
  6910. o Coordinate spaces 
  6911. o Color and mix modes 
  6912. o Area primitives 
  6913. o Paths. 
  6914.  
  6915.  
  6916. ΓòÉΓòÉΓòÉ 8.1. About Bit Maps ΓòÉΓòÉΓòÉ
  6917.  
  6918. Applications can use bit maps to: 
  6919.  
  6920. o Store and display scanned images, icons, and symbols 
  6921. o Create fill patterns for area primitives and paths. 
  6922.  
  6923. An application can display a bit-map image on any raster output device.  A 
  6924. raster is a rectangular matrix of pels on a video display or dot matrix 
  6925. printer.  A raster output device displays an image by setting pels in its 
  6926. matrix to colors specified in a corresponding bit map.  An image created in 
  6927. this way is called a "bit-map image".  Bit maps cannot be sent to vector output 
  6928. devices such as plotters. 
  6929.  
  6930. A bit map is drawn to an output device row-by-row. Each horizontal line of pels 
  6931. is known as a scan line. 
  6932.  
  6933. There is a 1-to-1 correspondence between the number of rows of pels in a 
  6934. bit-map image and the rows of bits in a bit map.  The first pel in a bit-map 
  6935. image is in the lower-left corner, and the last pel is in the upper-right 
  6936. corner.  The pels are in left-to-right order inside each row of the image. The 
  6937. following figure shows this relationship between bit map and image. 
  6938.  
  6939. Bits and Pels in a Bit-Map Image 
  6940.  
  6941. When an application creates a bit map by calling GpiCreateBitmap, it specifies 
  6942. the bit-map width and height in terms of pels in the bit-map image.  The width 
  6943. is the number of pels within a row; the height is the number of rows.  The 
  6944. application must store these dimensions in the BITMAPINFO2 and 
  6945. BITMAPINFOHEADER2 structures and pass their addresses to GpiCreateBitmap. 
  6946.  
  6947.  
  6948. ΓòÉΓòÉΓòÉ 8.1.1. System Implementation ΓòÉΓòÉΓòÉ
  6949.  
  6950. Bit maps are most useful when rapid and frequent movement is required, such as 
  6951. with icons and pointers. They are especially useful for restoring the contents 
  6952. of a window-for example, when an overlying window is removed. If you save the 
  6953. contents of a window in a bit map, you can restore the window contents simply 
  6954. by redisplaying the bit map when the window needs to be redrawn. 
  6955.  
  6956. Using bit maps is also an effective method of erasing some of the screen 
  6957. contents.  For example, you can save the image of the screen in a bit map at 
  6958. any time while drawing on the screen.  If you continue drawing after saving the 
  6959. screen image, you can "erase" any drawing done since you saved the screen image 
  6960. by redisplaying the bit map. 
  6961.  
  6962. Bit maps are not, however, the recommended way to store graphics that are going 
  6963. to be changed.  Most changes to the bit-map contents mean that you have to 
  6964. re-create the bit map. 
  6965.  
  6966. Bit-map images are device-dependent.  Their appearance is affected by the shape 
  6967. of the device's pels and the device's color capabilities.  For example, if the 
  6968. pels on one display measure 0.05 mm by 0.1 mm, but 0.1 mm by 0.3 mm on a second 
  6969. display, a circular bit-map pie chart drawn on the first display appears 
  6970. elliptical on the second. The following figure shows how a bit map appears on 
  6971. two types of displays. 
  6972.  
  6973. Bit Map Shown on Two Types of Displays 
  6974.  
  6975. Bit maps, particularly color bit maps, can also occupy large amounts of memory. 
  6976. The actual amount of memory occupied by a bit map is determined by both the 
  6977. size of the bit map and the number of bits used to describe each pel. 
  6978.  
  6979.  
  6980. ΓòÉΓòÉΓòÉ 8.1.2. Bit Map Functions ΓòÉΓòÉΓòÉ
  6981.  
  6982. OS/2 2.0 provides a set of functions that allow you to: 
  6983.  
  6984. o Create bit maps 
  6985. o Create and load custom bit maps 
  6986. o Store color information on a bit map 
  6987. o Draw bit maps 
  6988. o Transfer bit maps 
  6989. o Change the size of a bit map 
  6990. o Specify the mix values for a bit map 
  6991. o Convert between monochrome and color data 
  6992. o Manipulate single pels 
  6993. o Copy images from a display into a bit map 
  6994. o Save a bit map 
  6995. o Delete a bit map 
  6996. o Make a bit map available to other processes. 
  6997.  
  6998.  
  6999. ΓòÉΓòÉΓòÉ 8.1.2.1. Creating a Bit Map ΓòÉΓòÉΓòÉ
  7000.  
  7001. A bit map can be created by an application, or by using the PM Icon Editor. 
  7002.  
  7003.  
  7004. ΓòÉΓòÉΓòÉ 8.1.2.1.1. By an Application ΓòÉΓòÉΓòÉ
  7005.  
  7006. To enable an application to create a bit map: 
  7007.  
  7008.  1. Create a memory device context. 
  7009.  
  7010.     A memory device context enables an application to treat a bit map in memory 
  7011.     as though it were a device.  For example, an application can copy color 
  7012.     information from another bit map, or copy pels on the display, into a bit 
  7013.     map associated with a memory device context. 
  7014.  
  7015.     To create the memory device context, call DevOpenDC with: 
  7016.  
  7017.    o A device type of OD_MEMORY (second argument) 
  7018.  
  7019.    o A handle to a compatible device context (such as the device context of a 
  7020.      device with which the bit map is to be compatible). 
  7021.  
  7022.      Note:  The device device-context handle ideally should be the handle of 
  7023.             the actual device to which you will be directing the bit map; 
  7024.             otherwise, it will be necessary to change ownership to the 
  7025.             appropriate device driver before the BitBlt operation (which copies 
  7026.             the bit map from one presentation space to one associated with a 
  7027.             screen device context).  As a consequence, the image may appear 
  7028.             distorted. 
  7029.  
  7030.     If you omit the handle of the compatible device context by specifying NULL, 
  7031.     screen compatibility is assumed. 
  7032.  
  7033.  2. Create a graphics presentation space and associate it with the memory 
  7034.     device context. 
  7035.  
  7036.     The operating system requires this association before the application can 
  7037.     perform many of the bit map operations.  The handle of this graphics 
  7038.     presentation space is required as input to subsequent bit-map-creation and 
  7039.     manipulation functions. 
  7040.  
  7041.  3. Create the bit map. 
  7042.  
  7043.     When an application creates a bit map, the handle of the presentation space 
  7044.     that you have associated with the memory device context causes the bit map 
  7045.     to be created in a format that is compatible with the memory device 
  7046.     context. 
  7047.  
  7048.     The application also passes two structures: the bit-map information header 
  7049.     and the bit-map information table. These structures contain a great deal of 
  7050.     information about the bit map. 
  7051.  
  7052.     To create the bit map, call GpiCreateBitmap with: 
  7053.  
  7054.    o The handle of the presentation space (first argument) 
  7055.    o The bit-map information header, BITMAPINFOHEADER2 (second argument). 
  7056.  
  7057.     The bit-map information header data structure is defined in the header 
  7058.     files in the OS/2 2.0 Toolkit. The bit-map information table contains 
  7059.     similar information, with the addition of the RGB2 array structure. 
  7060.  
  7061.     GpiCreateBitmap returns a handle to the bit map, which is used to identify 
  7062.     the bit map. 
  7063.  
  7064.     To determine which bit-map formats are supported on a particular device, 
  7065.     call GpiQueryDeviceBitmapFormats. This returns every format supported on a 
  7066.     named device.  The data is returned as an array of bit-map plane and 
  7067.     bit-count pairs.  The first pair of values in the array is the one most 
  7068.     suitable for the device. 
  7069.  
  7070.     You can think of the bit map at this stage as a rectangular area of memory 
  7071.     containing random data.  You can initialize the bit map at this stage by 
  7072.     providing GpiCreateBitmap with the address in application storage of some 
  7073.     initialization data and by setting the CBM_INIT option.  This is a useful 
  7074.     function if, for example, your application always starts by displaying the 
  7075.     same image. 
  7076.  
  7077.  4. Select the bit map. 
  7078.  
  7079.     Before selecting the bit map, you can disassociate the presentation space 
  7080.     from the original memory device context and associate it with a different 
  7081.     memory device context.  However, the bit-map format must be convertible to 
  7082.     a format that is supported by the new device. If you have selected one of 
  7083.     the four standard bit-map formats, this compatibility is guaranteed and the 
  7084.     conversion is automatic. 
  7085.  
  7086.     Note:  When a presentation space is associated with a memory device 
  7087.            context, a bit map must be selected into the device context before 
  7088.            you can draw in the presentation space. 
  7089.  
  7090.     To select the bit map, call GpiSetBitmap with: 
  7091.  
  7092.    o The presentation-space handle (first parameter) 
  7093.    o The bit map-handle (second parameter). 
  7094.  
  7095. The following figure shows the sequence of events when you create and display a 
  7096. bit map. 
  7097.  
  7098. Creating and Displaying Bit Maps 
  7099.  
  7100. The application: 
  7101.  
  7102.  1. Calls DevOpenDC to create the memory device context. 
  7103.  
  7104.  2. Creates a graphics presentation space.  This is associated with the memory 
  7105.     device context. 
  7106.  
  7107.  3. Calls GpiCreateBitmap to define a bit map. 
  7108.  
  7109.  4. Calls GpiSetBitmap to designate the bit map as the one currently selected 
  7110.     in the memory device context. 
  7111.  
  7112.  5. Calls drawing instructions to the Presentation Space to draw to the bit 
  7113.     map. 
  7114.  
  7115.     Note:  If the bit map is initialized when it is created, this step does not 
  7116.            normally exist.  Alternately, this step can be a GpiSetBitmapBits 
  7117.            call. 
  7118.  
  7119.  6. Calls GpiBitBlt to copy the bit map from Presentation Space 1 to 
  7120.     Presentation Space 2 (associated with a screen device context). The bit map 
  7121.     is transferred directly to the screen. 
  7122.  
  7123.  
  7124. ΓòÉΓòÉΓòÉ 8.1.2.1.2. Using the Icon Editor ΓòÉΓòÉΓòÉ
  7125.  
  7126. Using the Icon Editor, you can create monochrome or color bit maps that have a 
  7127. static appearance.  This means that the bit maps can be created in advance and 
  7128. then used without change while the application is running. 
  7129.  
  7130. When you use the Icon Editor to create a bit map, the bit map is saved in a 
  7131. resource file that can be loaded whenever it is needed. To load a bit-map file, 
  7132. call GpiLoadBitmap, with the identifier of the resource file that contains the 
  7133. bit map, as the second parameter.  If you allow this value to default, the 
  7134. application's .EXE file is assumed to contain the bit map. 
  7135.  
  7136. GpiLoadBitmap lets you specify the x- and y-dimensions (in pels) of the bit 
  7137. map.  The loaded bit map is stretched or compressed accordingly. If you supply 
  7138. a 0 value for one of these dimensions, the bit map is sized in the other 
  7139. dimension only, which is likely to cause distortion of the image.  If the bit 
  7140. map is to be produced in its original size, specify 0 for both its width and 
  7141. its height. 
  7142.  
  7143. Output from the call to this function is the bit-map handle.  To display the 
  7144. loaded bit map on the screen, follow the sequence of steps described in 
  7145. Creating a Bit Map, omitting steps 3 (defining the bit map) and 5 (issuing 
  7146. drawing instructions to the presentation space). 
  7147.  
  7148. A bit map created by the Icon Editor is saved in a device-independent format. 
  7149. This format generates an array of bit maps with formats (bits per pel) matching 
  7150. each of the supported display devices. 
  7151.  
  7152.  
  7153. ΓòÉΓòÉΓòÉ 8.1.2.2. Creating and Loading a Custom Bit Map ΓòÉΓòÉΓòÉ
  7154.  
  7155. An application can create a custom bit map by setting the bits in an array and 
  7156. passing the array to GpiCreateBitmap, or by running the Icon Editor and loading 
  7157. the bit map with GpiLoadBitmap. 
  7158.  
  7159. To create a custom bit map with an array, an application: 
  7160.  
  7161.  1. Defines an array of bytes that will set pels in an image to the appropriate 
  7162.     colors.  This array of bytes typically represents the output of a scanned 
  7163.     image. 
  7164.  
  7165.  2. Sets the fields in the BITMAPINFOHEADER2 structure to their appropriate 
  7166.     values. 
  7167.  
  7168.  3. Sets the fields in the BITMAPINFO2 structure to their appropriate values. 
  7169.  
  7170.  4. Calls GpiCreateBitmap, passes it the addresses of the structures and the 
  7171.     array of bytes that the application has already defined, and sets the 
  7172.     flOptions parameter to CBM_INIT. 
  7173.  
  7174. If the application is to use this bit map as a fill pattern, it assigns the bit 
  7175. map a local identifier by calling GpiSetBitmapId. 
  7176.  
  7177. To load a custom bit map that was created with the Icon Editor: 
  7178.  
  7179.  1. Copy the bit map file to the directory in which you compile your 
  7180.     application. 
  7181.  
  7182.  2. Create a BITMAP entry in your application's resource file, assigning a 
  7183.     unique integer identifier to the bit map. 
  7184.  
  7185.  3. Call GpiLoadBitmap, passing it the identifier that you assigned to the bit 
  7186.     map in the resource file. 
  7187.  
  7188. An application can use GpiLoadBitmap to load any bit map from a file that 
  7189. conforms to any of the standard OS/2 bit-map formats or to a device-specific 
  7190. format supported by the device concerned. This means that an application can 
  7191. load a bit map created by another application, if that application created the 
  7192. correct bit-map header and stored the bit-map bits correctly. 
  7193.  
  7194.  
  7195. ΓòÉΓòÉΓòÉ 8.1.2.3. Storing Color Information in a Bit Map ΓòÉΓòÉΓòÉ
  7196.  
  7197. Graphics systems use one of two formats for storing color information in bit 
  7198. maps.  The first format uses a single plane and a multiple bit count. The 
  7199. second format uses multiple color planes. 
  7200.  
  7201.  
  7202. ΓòÉΓòÉΓòÉ 8.1.2.3.1. Color Planes ΓòÉΓòÉΓòÉ
  7203.  
  7204. Bit maps are arranged in one or more color planes.  A color plane is an array 
  7205. of bit-map bits that contains color information. 
  7206.  
  7207. The bit maps in each of the previous illustrations use the single bit-map plane 
  7208. format, which is the standard format for bit maps in OS/2 applications.  In 
  7209. this format, a specified number of adjacent bit-map bits contains indexes to 
  7210. either a special color table of RGB values or actual RGB2 structures.  Whether 
  7211. the application maps bits into an RGB or RGB2 structure depends on the bit-map 
  7212. format.  All of the color information resides in a single plane. 
  7213.  
  7214. The second color format uses more than one color plane. A common multiplane 
  7215. bit-map format is the 3-plane format, in which one plane corresponds to the red 
  7216. pels, another to the green pels, and a third to the blue pels.  Multiplane 
  7217. bit-map formats are rare in PM applications.  Most bit maps are stored 
  7218. externally in a single-plane format, although the device driver (such as VGA) 
  7219. may internally convert them to the multiplane format. 
  7220.  
  7221. The single-plane format can be converted internally to any multiplane format 
  7222. used by a device.  You also can use a nonstandard number of bits to describe 
  7223. each pel, if supported by your output device. If you write your own 
  7224. presentation driver, it must be able to convert the standard bit-map formats to 
  7225. its own internal format. 
  7226.  
  7227. An application can determine which color-plane format a device supports by 
  7228. calling GpiQueryDeviceBitmapFormats. 
  7229.  
  7230.  
  7231. ΓòÉΓòÉΓòÉ 8.1.2.3.2. Standard Bit-Map Formats ΓòÉΓòÉΓòÉ
  7232.  
  7233. On a monochrome device, you need only 1 bit to describe a single pel, and that 
  7234. bit is switched on or off.  Color devices require more bits.  For example, an 
  7235. 8-color picture requires 3 bits to describe a single pel, because each 
  7236. component of the RGB mix (red, green, blue) that gives a pel its color must be 
  7237. described. 
  7238.  
  7239. A bit count is a value that specifies how many adjacent bit-map bits correspond 
  7240. to each pel in a bit-map image.  There are four standard bit-map formats, each 
  7241. with a different bit count.  The formats are shown in the following table. 
  7242.  
  7243. Standard Bit-Map Formats 
  7244.  
  7245. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7246. ΓöéFormat              ΓöéBits per pel        ΓöéSize of 640 x 480   Γöé
  7247. Γöé                    Γöé                    Γöéimage in bytes      Γöé
  7248. Γöé                    Γöé                    Γöé(uncompressed)      Γöé
  7249. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7250. ΓöéMonochrome          Γöé1                   Γöé38 400              Γöé
  7251. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7252. Γöé16 color            Γöé4                   Γöé153 600             Γöé
  7253. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7254. Γöé256 color           Γöé8                   Γöé307 200             Γöé
  7255. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7256. Γöé16.7 million color  Γöé24                  Γöé921 600             Γöé
  7257. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7258.  
  7259. Note:  The bits are stored consecutively in the bit-map plane. If you have 4 
  7260. bits for each pel, the 4 bits for pel 1 are followed by the 4 bits for pel 2, 
  7261. and so on.  The bits that describe pel 1 are stored beginning in the 
  7262. most-significant bits of the first byte.  The data for each scan line is packed 
  7263. together, and the bottom scan line appears first in memory with the leftmost 
  7264. pel first.  Each scan line, however, is padded at the end so that each line 
  7265. begins on a ULONG (32-bit) boundary. 
  7266.  
  7267. If the device supports a bit count of 1 bit per pel, the color table contains 2 
  7268. entries.  A device that supports a bit count of n bits per pel, has a 
  7269. corresponding color table with 2n entries. However, a bit count of 24 bits per 
  7270. pel indicates that there is no color table, because each pel is a direct RGB 
  7271. value. 
  7272.  
  7273. The following figure shows a bit map using a bit count of 4 bits per pel and an 
  7274. associated color table: 
  7275.  
  7276. A Bit Map and Its Associated Color Table 
  7277.  
  7278. If a device uses a bit count of 1, 4, or 8 bits per pel, the bit-map bits 
  7279. contain index values for a bit-map color table.  If the device supports a bit 
  7280. count of 24 bits per pel, the bit-map bits contain the bRed, bGreen, and bBlue 
  7281. fields of RGB2 structures.  No color table is associated with a bit map on a 
  7282. device that supports a format of 24 bits per pel-such a device can support over 
  7283. 16 million colors. Instead of using a color table, the BITMAPINFO2 structure 
  7284. consists of only the header, and the red, green, and blue color values are 
  7285. provided directly by the bit-map data. 
  7286.  
  7287. An application can determine the bit-count format that a device supports by 
  7288. calling GpiQueryDeviceBitmapFormats. 
  7289.  
  7290.  
  7291. ΓòÉΓòÉΓòÉ 8.1.2.4. Drawing Bit Maps ΓòÉΓòÉΓòÉ
  7292.  
  7293. An application can draw bit-map images on a raster printer or display screen, 
  7294. or into metafiles associated with a raster device. Any GPI drawing requests 
  7295. (including those that produce graphics text), issued to a presentation space 
  7296. associated with a memory DC containing a selected bit map, cause the bit map to 
  7297. receive raster images of your drawings. The following table describes the bit 
  7298. map drawing functions: 
  7299.  
  7300. Bit-Map Drawing Functions 
  7301.  
  7302. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7303. ΓöéFunction            ΓöéInput               ΓöéOutput              Γöé
  7304. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7305. ΓöéWinDrawBitmap       ΓöéThe handle of a bit ΓöéA bit-map image on aΓöé
  7306. Γöé                    Γöémap.                Γöéraster display.     Γöé
  7307. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7308. ΓöéGpiImage            ΓöéA buffer containing ΓöéA special monochromeΓöé
  7309. Γöé                    Γöébit map image data. Γöébit-map image on a  Γöé
  7310. Γöé                    Γöé                    Γöéraster display or   Γöé
  7311. Γöé                    Γöé                    Γöéprinter.            Γöé
  7312. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7313. ΓöéGpiDrawBits         ΓöéA buffer containing ΓöéA bit-map image on aΓöé
  7314. Γöé                    Γöébit map image data. Γöéraster display or   Γöé
  7315. Γöé                    Γöé                    Γöéprinter.            Γöé
  7316. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7317. ΓöéGpiBitBlt           ΓöéThe handle of a     ΓöéA bit-map image on aΓöé
  7318. Γöé                    Γöépresentation space  Γöéraster display or   Γöé
  7319. Γöé                    Γöécontaining a bit    Γöéprinter, or a       Γöé
  7320. Γöé                    Γöémap.                Γöébit-map image into aΓöé
  7321. Γöé                    Γöé                    Γöémetafile (albeit in Γöé
  7322. Γöé                    Γöé                    Γöéan escape order).   Γöé
  7323. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7324. ΓöéGpiWCBitBlt         ΓöéThe handle of a bit ΓöéA bit-map image on aΓöé
  7325. Γöé                    Γöémap.                Γöéraster display or   Γöé
  7326. Γöé                    Γöé                    Γöéprinter, or a       Γöé
  7327. Γöé                    Γöé                    Γöébit-map image into aΓöé
  7328. Γöé                    Γöé                    Γöémetafile.           Γöé
  7329. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7330.  
  7331.  
  7332. ΓòÉΓòÉΓòÉ 8.1.2.4.1. WinDrawBitmap ΓòÉΓòÉΓòÉ
  7333.  
  7334. WinDrawBitmap draws a bit-map image by copying it into a window linked to a 
  7335. target presentation space.  A call to this function is valid only in draw mode 
  7336. (DM_DRAW), and only for a screen device context. This function does not require 
  7337. an application to select a bit map into a presentation space before the 
  7338. application draws the corresponding image.  An application can use 
  7339. WinDrawBitmap to scale bit maps by specifying DBM_STRETCH as the last argument, 
  7340. and the address of a RECTL structure as the fourth argument.  The coordinates 
  7341. in this structure are always device coordinates. 
  7342.  
  7343. WinDrawBitmap draws both color and monochrome bit maps.  Color bit maps require 
  7344. no color conversion.  Monochrome bit maps can be drawn in any two colors which 
  7345. can be explicitly specified as parameters to the call or taken from the image 
  7346. bundle.  These parameters will be color table indexes or RGB values, depending 
  7347. on the color table mode of the target presentation space.  The current image 
  7348. bundle mix modes are used and, for certain mix values, will affect color. 
  7349.  
  7350. You can call WinDrawBitmap in retain mode, but the bit-map image will only be 
  7351. drawn and not recorded in the segments. 
  7352.  
  7353. Note:  An application can determine the current colors and their corresponding 
  7354.        mix modes by calling GpiQueryAttrs. The application can set them by 
  7355.        calling GpiSetAttrs. 
  7356.  
  7357. An inverted bit map is a bit map in which the colors have been inverted; white 
  7358. becomes black and black becomes white.  An application can draw inverted bit 
  7359. maps by calling WinDrawBitmap and passing it DBM_INVERT as the last argument. 
  7360. An application can draw halftone bit maps by calling WinDrawBitmap and passing 
  7361. it DBM_HALFTONE as the last argument.  Before drawing the bit map, clear the 
  7362. presentation space to CLR_BACKGROUND using GpiErase. 
  7363.  
  7364.  
  7365. ΓòÉΓòÉΓòÉ 8.1.2.4.2. GpiImage ΓòÉΓòÉΓòÉ
  7366.  
  7367. GpiImage draws a nonstandard, monochrome (two-color) bit map called an image 
  7368. primitive.  The bit-map bits in an image are stored in the opposite order from 
  7369. the bits in a standard bit map-the first bit in the bit map corresponds to the 
  7370. pel in the upper-left corner of the bit-map image, and the last bit in the bit 
  7371. map corresponds to the pel in the lower-right corner of the bit-map image. The 
  7372. following figure shows the correspondence between the bits in an image 
  7373. primitive and the pels in the drawing produced by GpiImage. 
  7374.  
  7375. Image-Primitive Bits and Pels 
  7376.  
  7377. A call to GpiImage also is valid only in draw mode (DM_DRAW), but can provide 
  7378. output to a screen or printer.  An application cannot scale bit-map images by 
  7379. using GpiImage. 
  7380.  
  7381.  
  7382. ΓòÉΓòÉΓòÉ 8.1.2.5. Transferring Bit Maps ΓòÉΓòÉΓòÉ
  7383.  
  7384. The three remaining bit-map drawing functions operate in very similar ways. 
  7385. GpiDrawBits copies a bit-map image from application memory to a device or a 
  7386. device context; GpiBitBlt directs bit maps to devices other than the screen; 
  7387. GpiWCBitBlt enables you to retain the bit-map data in the segment store of the 
  7388. target presentation space. 
  7389.  
  7390. The similarities are discussed first.  Their differences are discussed in the 
  7391. sections that follow. 
  7392.  
  7393. An application should use GpiDrawBits, GpiBitBlt, or GpiWCBitBlt to draw bit 
  7394. maps that use a color table or RGB2 structures color formats of 1, 4, 8, or 24 
  7395. bits per pel. 
  7396.  
  7397. An application can draw inverted bit maps for any of these three functions by 
  7398. calling the function and passing ROP_NOTSRCCOPY as the raster operation. 
  7399.  
  7400.  
  7401. ΓòÉΓòÉΓòÉ 8.1.2.5.1. GpiDrawBits ΓòÉΓòÉΓòÉ
  7402.  
  7403. GpiDrawBits copies bit map image data from storage into a bit map that has been 
  7404. selected into a device context associated with a presentation space.  It can 
  7405. also copy bit-map image data to a device. An application can use this function 
  7406. to draw a bit map without first selecting the bit map into a presentation 
  7407. space. 
  7408.  
  7409. This function is valid in all draw modes.  Set the draw mode to DM_RETAIN or 
  7410. DM_DRAWANDRETAIN to create retained segments; otherwise, the default mode, 
  7411. DM_DRAW, is selected. 
  7412.  
  7413.  
  7414. ΓòÉΓòÉΓòÉ 8.1.2.5.2. GpiBitBlt ΓòÉΓòÉΓòÉ
  7415.  
  7416. GpiBitBlt requires an application to use device coordinates for the dimensions 
  7417. of the source and target rectangles.  GpiBitBlt allows you to direct bit maps 
  7418. to devices other than the screen.  It is independent of the drawing mode, but 
  7419. it operates as if in draw mode. 
  7420.  
  7421. At its simplest, GpiBitBlt copies a whole bit map, unaltered, from a device or 
  7422. bit map source to a device or bit map target. At its most powerful, GpiBitBlt 
  7423. can take a part of or a whole bit map, and alter both its size and appearance 
  7424. in the process of copying it to another device context. A bit map can be 
  7425. copied: 
  7426.  
  7427. o From one memory device context to another memory device context 
  7428.  
  7429. o From a memory device context to the device context of an output device 
  7430.   (screen window or printer) that supports raster operations 
  7431.  
  7432. o From the device context of an output device to a memory device context 
  7433.  
  7434. o From the device context of an output device to another device context of the 
  7435.   same output device.  In both cases, the screen device can be a PM window. 
  7436.  
  7437. A memory device context (whether it is the source or the target of the 
  7438. GpiBitBlt operation) must have a bit map selected when GpiBitBlt is called. 
  7439.  
  7440. GpiBitBlt has a number of input parameters, two of which are the handles of two 
  7441. presentation spaces:  the source presentation space and the target presentation 
  7442. space.  Both of these presentation spaces must be associated with an 
  7443. appropriate device context. Unless the associated device is a banded printer, a 
  7444. single presentation space can be both source and target.  This allows you to 
  7445. copy a bit map within a single PM window, or to update the bit map. The source 
  7446. and target rectangles are specified in device coordinates in GpiBitBlt. 
  7447. GpiBitBlt, consequently, is very device-dependent, and should be avoided when 
  7448. creating data for interchange. 
  7449.  
  7450.  
  7451. ΓòÉΓòÉΓòÉ 8.1.2.5.3. GpiWCBitBlt ΓòÉΓòÉΓòÉ
  7452.  
  7453. GpiWCBitBlt enables you to retain the bit-map data in the segment store of the 
  7454. target presentation space.  It is a valid in all three drawing modes: 
  7455.  
  7456. o DM_DRAW-display, printer, or into metafile 
  7457. o DM_RETAIN-into metafile or segment 
  7458. o DM_DRAWANDRETAIN-display, printer, then into associated segment or metafile. 
  7459.  
  7460. Most of the bit-map drawing operations occur in an application's device space; 
  7461. GpiWCBitBlt, however, lets an application draw in its world space, but requires 
  7462. that you use device coordinates for the source rectangle, and world coordinates 
  7463. for the target rectangle. 
  7464.  
  7465. An application can use GpiWCBitBlt to draw a bit map with consistent dimensions 
  7466. on devices with different aspect ratios. The aspect ratio is the ratio of a 
  7467. pel's width to its height. 
  7468.  
  7469. When creating data for interchange, use GpiWCBitBlt. GpiWCBitBlt provides the 
  7470. same function as GpiBitBlt, with the following exceptions: 
  7471.  
  7472. o The target rectangle is specified in world coordinates, and all four 
  7473.   coordinates (the two source-rectangle coordinates and the two 
  7474.   target-rectangle coordinates) must be specified. 
  7475.  
  7476. o The source handle must be a bit-map handle. It must not be the handle of a 
  7477.   source presentation space. The bit map identified by the source handle must 
  7478.   not be selected into a memory device context when you call GpiWCBitBlt. 
  7479.  
  7480. o GpiWCBitBlt conforms to the current drawing mode in the target presentation 
  7481.   space.  If the drawing mode is retain or draw-and-retain, the bit map is 
  7482.   retained in segment store. 
  7483.  
  7484.  
  7485. ΓòÉΓòÉΓòÉ 8.1.2.6. Changing the Size of the Bit Map ΓòÉΓòÉΓòÉ
  7486.  
  7487. You can specify the sizes of the rectangular bit blocks in both the source and 
  7488. the target presentation spaces.  To do this, provide an array of up to four 
  7489. device-coordinate positions as input to the call.  The first two positions 
  7490. define the lower-left and upper-right corners of the target rectangle;  the 
  7491. second two define the same two corners of the source rectangle. 
  7492.  
  7493. If you want the two rectangles to be of equal size, do not specify the device 
  7494. coordinates of the upper-right corner of the source rectangle. The correct 
  7495. amount of data is automatically transferred to fill the target rectangle. The 
  7496. following figure shows the points count for bit-block transfers. 
  7497.  
  7498. Points Count for Bit-Block Transfers 
  7499.  
  7500. Equal-size rectangles can be built much faster than rectangles that need 
  7501. stretching or compressing.  Compression options (flOptions) are ignored if the 
  7502. rectangles are to be of equal size. 
  7503.  
  7504. If the rectangles are not to be of equal size, you must specify all four 
  7505. coordinate points.  The bit-map data is stretched, if the target rectangle is 
  7506. larger than the source rectangle, or compressed, if the target rectangle is 
  7507. smaller, to fit the target rectangle. The bit map is stretched by duplicating 
  7508. rows and columns of data, an action that might cause distortion of the image. 
  7509. If the data is to be compressed, you can specify one of three compression 
  7510. options as shown in the following table. 
  7511.  
  7512. Bit-map Data Compression Rules 
  7513.  
  7514. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7515. ΓöéOption              ΓöéCompression Rules                       Γöé
  7516. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7517. ΓöéBBO_OR              ΓöéCompresses the bit map data as          Γöé
  7518. Γöé                    Γöénecessary, using a logical OR operation Γöé
  7519. Γöé                    Γöéon the eliminated rows and columns. ThisΓöé
  7520. Γöé                    Γöéis useful for preserving the foreground Γöé
  7521. Γöé                    Γöéwhen foreground pels are "1" and the    Γöé
  7522. Γöé                    Γöébackground pels are "0".                Γöé
  7523. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7524. ΓöéBBO_AND             ΓöéCompresses the bit map data as          Γöé
  7525. Γöé                    Γöénecessary, using a logical AND operationΓöé
  7526. Γöé                    Γöéon the eliminated rows and columns.     Γöé
  7527. Γöé                    ΓöéThis is useful for preserving the       Γöé
  7528. Γöé                    Γöéforeground when foreground pels are "0" Γöé
  7529. Γöé                    Γöéand the background pels are "1".        Γöé
  7530. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7531. ΓöéBBO_IGNORE          ΓöéCompresses the bit map data as          Γöé
  7532. Γöé                    Γöénecessary, but ignores any eliminated   Γöé
  7533. Γöé                    Γöérows or columns. This is most useful forΓöé
  7534. Γöé                    Γöécolor bit maps, where the results of    Γöé
  7535. Γöé                    Γöécombining pels of different colors are  Γöé
  7536. Γöé                    Γöéunpredictable.                          Γöé
  7537. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7538.  
  7539.  
  7540. ΓòÉΓòÉΓòÉ 8.1.2.7. Specifying Mix Values ΓòÉΓòÉΓòÉ
  7541.  
  7542. When you draw a graphics primitive into a presentation space, it is affected by 
  7543. the current foreground-mix value, and possibly by the current background-mix 
  7544. value, in that presentation space. However, when you copy a bit map into a 
  7545. target presentation space, the current foreground- and background-mix values in 
  7546. the target presentation space are ignored.  Instead, you specify a mix-mode 
  7547. value, also known as the raster-operation (ROP) value.  This value determines: 
  7548.  
  7549. o How the bit map is affected by any data that might already be in the target 
  7550.   presentation space 
  7551.  
  7552. o The color of each pel in the bit map. 
  7553.  
  7554. Each pel in the bit map of the target presentation space has, potentially, 
  7555. three color settings: 
  7556.  
  7557. o The setting of that pel in the source rectangle 
  7558.  
  7559. o The initial setting of that pel in the target rectangle 
  7560.  
  7561. o The setting of that pel in the current area-fill pattern in the target 
  7562.   presentation space. 
  7563.  
  7564. The (boolean) values of each of these settings can be combined using boolean 
  7565. operations to produce the final value of each pel in the target presentation 
  7566. space.  For a color target, the target must be regarded as consisting of 
  7567. multiple one-bit per pel planes, with the mixing applied to each plane 
  7568. separately to produce the final color index into the physical color table. 
  7569. Because the final color index is an index into the physical palette, the 
  7570. results of any color mixing are therefore unpredictable.  For example, if you 
  7571. ORed together two numeric index values, the color indexed by the result is 
  7572. unlikely to have any direct relation to the colors indexed by the two values 
  7573. you ORed together.  It depends on the order of the colors in the physical 
  7574. table. 
  7575.  
  7576. As input to the functions, you supply an actual mix value. The ROP mix value 
  7577. required to achieve any given result can be determined from the following 
  7578. table. The final value of each bit in every pel depends on the values of the 
  7579. corresponding bits in the pattern (P), source (S), and the original target 
  7580. value (T initial).  Each row of the table shows one of the eight possible 
  7581. combinations of these values.  For each combination, mark the desired final 
  7582. target value in the last column. The eight bits in this column then show the 
  7583. value of the least significant byte of the ROP value required to achieve this 
  7584. mixing function.  For example, if the required mixing function is to copy the 
  7585. source to the target, then the Target (final) column will be the same as the S 
  7586. column, and the ROP value will have the binary value 11001100, or the 
  7587. hexadecimal value 00CC. 
  7588.  
  7589. Possible Settings for the Index Bits 
  7590.  
  7591. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7592. ΓöéPatternΓöéSource ΓöéTarget (initial)Γöé              ΓöéTarget (final)  Γöé
  7593. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7594. Γöé0      Γöé0      Γöé0               Γöé              ΓöéIndex bit 0     Γöé
  7595. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7596. Γöé0      Γöé0      Γöé1               Γöé              ΓöéIndex bit 1     Γöé
  7597. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7598. Γöé0      Γöé1      Γöé0               Γöé              ΓöéIndex bit 2     Γöé
  7599. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7600. Γöé0      Γöé1      Γöé1               Γöé              ΓöéIndex bit 3     Γöé
  7601. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7602. Γöé1      Γöé0      Γöé0               Γöé              ΓöéIndex bit 4     Γöé
  7603. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7604. Γöé1      Γöé0      Γöé1               Γöé              ΓöéIndex bit 5     Γöé
  7605. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7606. Γöé1      Γöé1      Γöé0               Γöé              ΓöéIndex bit 6     Γöé
  7607. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7608. Γöé1      Γöé1      Γöé1               Γöé              ΓöéIndex bit 7     Γöé
  7609. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7610.  
  7611. If you want the pattern to have no effect on the target rectangle, the four 
  7612. low-order bits of the index must be the same as the four high-order bits. 
  7613.  
  7614. A monochrome bit map consists only of Source settings of 1s and 0s, where a 1 
  7615. or 0 represents each pel.  It also has a two entry color table with index 0 
  7616. specifying what color a 0 pel represents and index 1 representing what color a 
  7617. 1 pel represents.  In a monochrome bit map, this color table is not used during 
  7618. BitBlt operations (but is used when drawing to the bit map and moving the bit 
  7619. map between devices). The preceding table defines how any combination of 
  7620. pattern, source and target original (1 and 0) values define the target final (1 
  7621. or 0) value.  A color bit map has an index (in the case of 4 bits, 0-15) for 
  7622. each pel which, serves as index into the bit map color table (16 entries for 4 
  7623. bits per pel) to define the color of each pel. Unlike monochrome bit maps, this 
  7624. table is used during BitBlt operations (instead of target image bundle 
  7625. attributes) to provide the color of the target output. 
  7626.  
  7627. The following table represents a selection of the most commonly used mixes with 
  7628. predefined symbolic names (but there are many other possible mixes). 
  7629.  
  7630. Mix Value Names 
  7631.  
  7632. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  7633. ΓöéMix Name          ΓöéEffect                                    Γöé
  7634. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7635. ΓöéROP_SRCCOPY       ΓöéSource                                    Γöé
  7636. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7637. ΓöéROP_SRCPAINT      ΓöéSource OR Target                          Γöé
  7638. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7639. ΓöéROP_SRCAND        ΓöéSource AND Target                         Γöé
  7640. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7641. ΓöéROP_SRCINVERT     ΓöéSource XOR Target                         Γöé
  7642. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7643. ΓöéROP_SRCERASE      ΓöéSource AND NOT (Target)                   Γöé
  7644. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7645. ΓöéROP_NOTSRCCOPY    ΓöéNOT (Source)                              Γöé
  7646. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7647. ΓöéROP_NOTSRCERASE   ΓöéNOT (Source) AND NOT (Target)             Γöé
  7648. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7649. ΓöéROP_MERGECOPY     ΓöéSource AND Pattern                        Γöé
  7650. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7651. ΓöéROP_MERGEPAINT    ΓöéNOT (Source) OR Target                    Γöé
  7652. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7653. ΓöéROP_PATCOPY       ΓöéPattern                                   Γöé
  7654. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7655. ΓöéROP_PATPAINT      ΓöéNOT (Source) OR Pattern OR Target         Γöé
  7656. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7657. ΓöéROP_PATINVERT     ΓöéTarget XOR Pattern                        Γöé
  7658. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7659. ΓöéROP_DSTINVERT     ΓöéNOT (Target)                              Γöé
  7660. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7661. ΓöéROP_ZERO          Γöé0                                         Γöé
  7662. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7663. ΓöéROP_ONE           Γöé1                                         Γöé
  7664. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  7665. ΓöéROP_GRAY          ΓöéGray pattern background                   Γöé
  7666. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  7667.  
  7668. ROP_SRCCOPY is the most often used value.  It simply copies the bit map to the 
  7669. target presentation space without performing any color mixing. Because most of 
  7670. the remaining mixes involve some degree of color mixing, they result in an 
  7671. image that is quite different from the original. 
  7672.  
  7673.  
  7674. ΓòÉΓòÉΓòÉ 8.1.2.8. Converting between Monochrome and Color Data Bit Maps ΓòÉΓòÉΓòÉ
  7675.  
  7676. It is possible to copy a monochrome bit map to a color bit map or device, and 
  7677. to copy a color bit map to a monochrome bit map or device.  PM handles these 
  7678. conversions automatically according to the following rules: 
  7679.  
  7680. o If you are copying a monochrome bit map to a color bit map or to a color or 
  7681.   monochrome device surface, a Source setting of 1 adopts the current 
  7682.   image-foreground color of the target presentation space, and a Source setting 
  7683.   of 0 adopts the current image-background color of the target presentation 
  7684.   space.  For example, if the image foreground color is blue and the image 
  7685.   background color is yellow in the target presentation space, a monochrome bit 
  7686.   map is converted to a blue foreground on a yellow background. 
  7687.  
  7688. o If you are copying from a monochrome pattern to a color bit map or device, a 
  7689.   Source setting of 1 adopts the current area-foreground color of the target 
  7690.   device and a Source setting of 0 adopts the current area-background color of 
  7691.   the target device.  Note that if image bundle attributes do not exist for the 
  7692.   source bit map, as is the case when using GpiWCBitBlt (which uses a bit map 
  7693.   handle as the source), then zero source pixels adopt the image background 
  7694.   color and nonzero source pixels adopt the image-foreground color of the 
  7695.   presentation space. 
  7696.  
  7697. o If you are copying a color bit map to a monochrome bit map or device, those 
  7698.   pels that have the same color as the current image-background color in the 
  7699.   source presentation space adopt the image background color of the target 
  7700.   presentation space. For example, if the current image-background color in the 
  7701.   source presentation space is blue, all blue pels in the bit map take on the 
  7702.   color of the current image background in the target presentation space. 
  7703.  
  7704.   All other pels in the color bit map adopt the current image-foreground color 
  7705.   of the target presentation space. 
  7706.  
  7707.  
  7708. ΓòÉΓòÉΓòÉ 8.1.2.9. Manipulating Single Pels ΓòÉΓòÉΓòÉ
  7709.  
  7710. You can manipulate single pels in a bit map by using the GpiSetPel and 
  7711. GpiQueryPel functions. GpiSetPel sets the pel at the specified point (in world 
  7712. coordinates) to the current line color.  This function is independent of the 
  7713. current drawing mode, and its effect is immediate.  It is, however, a 
  7714. device-dependent function.  The CAPS_RASTER_CAPS option of the DevQueryCaps 
  7715. function indicates if GpiSetPel is supported on the current device. 
  7716.  
  7717.  
  7718. ΓòÉΓòÉΓòÉ 8.1.2.10. Copying Images from a Display into a Bit Map ΓòÉΓòÉΓòÉ
  7719.  
  7720. An application can copy an image from a raster display screen to a bit map by 
  7721. calling GpiBitBlt or GpiWCBitBlt.  Before copying the bit map, the application 
  7722. must call DevOpenDC to create a memory device context.  This device context 
  7723. allows an application to treat a bit map in memory as though it were a 
  7724. device-the application can copy color information from pels on the display to 
  7725. the bit map. 
  7726.  
  7727. Once an application creates a memory device context, associates it with a 
  7728. presentation space, and selects a bit map into the presentation space, the 
  7729. application can use the presentation-space handle as the first argument to 
  7730. GpiBitBlt or GpiWCBitBlt.  If the application will be drawing the image on 
  7731. devices with different aspect ratios, the application should use GpiWCBitBlt to 
  7732. preserve the original dimensions of the bit map. 
  7733.  
  7734.  
  7735. ΓòÉΓòÉΓòÉ 8.1.2.11. Saving a Bit Map ΓòÉΓòÉΓòÉ
  7736.  
  7737. You have two ways to save a bit map that has been created by an application: 
  7738.  
  7739. o Store the bit map in a metafile, by calling GpiWCBitBlt. 
  7740.  
  7741.   Metafiles are covered in detail later. 
  7742.  
  7743. o Use the OS/2 operating system file-handling functions, in conjunction with 
  7744.   GpiQueryBitmapBits and GpiSetBitmapBits. 
  7745.  
  7746.   An application can save a bit map in a file by calling GpiQueryBitmapBits, 
  7747.   DosOpen, DosWrite, and DosClose. 
  7748.  
  7749. GpiQueryBitmapBits copies bit-map data from a memory device context (that has a 
  7750. standard-format bit map selected into it) to a buffer. The bit map you copy can 
  7751. be newly created or have been loaded from a resource file. 
  7752.  
  7753. You must supply the address in application storage of a bit-map information 
  7754. table. The bit-map information table has the same structure as the bit map 
  7755. information header, except for an additional entry, the colors field. As input 
  7756. to GpiQueryBitmapBits, you supply a bit-count value and a plane value.  These 
  7757. must both be standard bit-map format values, so the plane value is always 1, 
  7758. and the bit-count value is 1, 4, 8, or 24. If any conversion of the bit-map 
  7759. data is necessary, it is done automatically.  You also must provide the address 
  7760. of the application storage into which the bit-map data is to be loaded.  You 
  7761. probably will need to find out how large the bit map is before you can do this. 
  7762. The GpiQueryBitmapParameters function returns the width, height, plane count, 
  7763. and bit count of a named bit map. 
  7764.  
  7765. You also must supply the size of the fixed portion of the header (as well as 
  7766. bit count, and so on).  Nonstandard formats supported by the device that owns 
  7767. the bit map will also be valid for GpiQueryBitmapBits. 
  7768.  
  7769. You must ensure that you allocate sufficient storage at the end of the bit map 
  7770. information table for the returned color table which, if the number of planes 
  7771. is 1, will have 2n entries, where n is the number of bits per pel. 
  7772.  
  7773. On return from GpiQueryBitmapBits, the system supplies the width, height, and 
  7774. bit-map color table in the bit-map information table. You can retrieve a part 
  7775. of a bit map by specifying the number of the scan line from which the transfer 
  7776. is to start, and the number of scan lines you want. 
  7777.  
  7778. When you have copied a bit map into application storage, you can save the bit 
  7779. map externally, and reload it later, by using OS/2 file-handling functions. 
  7780. After the application creates a file by calling DosOpen, it can call DosWrite 
  7781. to copy the buffer containing the bit-map bits into the file.  The application 
  7782. then closes the file by calling DosClose. 
  7783.  
  7784. If an application needs to use a bit map it has stored on disk, it can copy the 
  7785. file's contents into a buffer by calling DosRead, and then copy information 
  7786. about the image to the bit map by calling GpiSetBitmapBits.  The application 
  7787. must select the bit map into a memory device context before it sets the bits. 
  7788. As with GpiQueryBitmapBits, you can transfer a part of the bit map rather than 
  7789. the whole.  GpiSetBitmapBits can be used to transfer standard-format bit maps 
  7790. only, and only to a bit map selected into a memory device context. If 
  7791. necessary, bit-map data is automatically converted from one standard format to 
  7792. another. Nonstandard formats supported by the device owning the bit map will 
  7793. also be valid for GpiSetBitmapBits. 
  7794.  
  7795. If an application creates bit maps another application might use, it should 
  7796. create them by using the standard OS/2 operating system bit-map file format. 
  7797.  
  7798.  
  7799. ΓòÉΓòÉΓòÉ 8.1.2.12. Deleting a Bit Map ΓòÉΓòÉΓòÉ
  7800.  
  7801. It is good practice always to delete a bit map from memory when you have 
  7802. finished using it.  To delete a bit map, use GpiDeleteBitmap. If you have 
  7803. loaded a bit map from a resource file, GpiDeleteBitmap deletes only its memory 
  7804. version.  If the bit map has not been deleted when the owning process ends, it 
  7805. is deleted automatically by the system. 
  7806.  
  7807.  
  7808. ΓòÉΓòÉΓòÉ 8.1.2.13. Making Bit Maps Available to Other Processes ΓòÉΓòÉΓòÉ
  7809.  
  7810. When an application creates a bit map or loads one from a resource file, it can 
  7811. make the bit map available to other processes by placing the bit-map handle in 
  7812. the clipboard. 
  7813.  
  7814.  
  7815. ΓòÉΓòÉΓòÉ 8.2. Using Bit Maps ΓòÉΓòÉΓòÉ
  7816.  
  7817. An application can use bit-map functions to: 
  7818.  
  7819. o Copy an image from a raster device (such as a display screen) to a bit map 
  7820. o Copy an image from a raster device (such as a display screen) to the same 
  7821.   device 
  7822. o Copy an image from a bit map to a raster device 
  7823. o Copy an image from a bit map to another bit map 
  7824. o Copy an image from application memory to a bit map 
  7825. o Copy an image from application memory to a raster device 
  7826. o Scale bit-map images 
  7827. o Create custom fill patterns for area primitives and paths 
  7828. o Load a bit map created with the Icon Editor 
  7829. o Draw bit-map images 
  7830. o Store bit maps in a metafile or application memory. 
  7831.  
  7832.  
  7833. ΓòÉΓòÉΓòÉ 8.2.1. Copying an Image from a Display Screen to a Bit Map ΓòÉΓòÉΓòÉ
  7834.  
  7835. To copy an image from a display screen to a bit map: 
  7836.  
  7837.  1. Associate the memory device context with a presentation space. 
  7838.  
  7839.  2. Create a bit map. 
  7840.  
  7841.  3. Select the bit map into the memory device context by calling GpiSetBitmap. 
  7842.  
  7843.  4. Determine the location (in device coordinates) of the image. 
  7844.  
  7845.  5. Call GpiBitBlt and copy the image to the bit map. 
  7846.  
  7847. The following figure demonstrates these steps. 
  7848.  
  7849.  
  7850.     HDC hdcMem;
  7851.     PSZ pszData[4] = { "Display", NULL, NULL, NULL };
  7852.     HPS hpsMem, hps;
  7853.     HAB hab;
  7854.     SIZEL sizlPage = {0, 0};
  7855.     BITMAPINFOHEADER2 bmp;
  7856.     PBITMAPINFO2 pbmi;
  7857.     HBITMAP hbm;
  7858.     SHORT sWidth = 128, sHeight = 128;
  7859.     POINTL aptl[3];
  7860.     LONG alData[2];
  7861.  
  7862.     /*
  7863.      * Create the memory device context and presentation space so they
  7864.      * are compatible with the screen device context and presentation space.
  7865.      */
  7866.  
  7867.     hdcMem = DevOpenDC(hab, OD_MEMORY, "*", 4,
  7868.         (PDEVOPENDATA) pszData, NULLHANDLE);
  7869.  
  7870.     hpsMem = GpiCreatePS(hab, hdcMem, &sizlPage,
  7871.         PU_PELS | GPIA_ASSOC | GPIT_MICRO);
  7872.  
  7873.     /* Determine the device's plane/bit-count format. */
  7874.  
  7875.     GpiQueryDeviceBitmapFormats(hpsMem, 2, alData);
  7876.  
  7877.     /*
  7878.      * Load the BITMAPINFOHEADER2 and BITMAPINFO2 structures. The sWidth and
  7879.      * sHeight fields specify the width and height of the destination
  7880.      * rectangle.
  7881.      */
  7882.  
  7883.     bmp.cbFix = (ULONG) sizeof(BITMAPINFOHEADER2);
  7884.     bmp.cx = sWidth;
  7885.     bmp.cy = sHeight;
  7886.     bmp.cPlanes = alData[0];
  7887.     bmp.cBitCount = alData[1];
  7888.     bmp.ulCompression = BCA_UNCOMP;
  7889.     bmp.cbImage = (((sWidth *
  7890.         (1 << bmp.cPlanes) * (1 << bmp.cBitCount)) + 31) / 32) * sHeight;
  7891.     bmp.cxResolution = 70;
  7892.     bmp.cyResolution = 70;
  7893.     bmp.cclrUsed = 2;
  7894.     bmp.cclrImportant = 0;
  7895.     bmp.usUnits = BRU_METRIC;
  7896.     bmp.usReserved = 0;
  7897.     bmp.usRecording = BRA_BOTTOMUP;
  7898.     bmp.usRendering = BRH_NOTHALFTONED;
  7899.     bmp.cSize1 = 0;
  7900.     bmp.cSize2 = 0;
  7901.     bmp.ulColorEncoding = BCE_RGB;
  7902.     bmp.ulIdentifier = 0;
  7903.  
  7904.  
  7905.     DosAllocMem((PPVOID)&pbmi, sizeof(BITMAPINFO2) +
  7906.         (sizeof(RGB2) * (1 << bmp.cPlanes) * (1 << bmp.cBitCount)),
  7907.         PAG_COMMIT | PAG_READ | PAG_WRITE);
  7908.  
  7909.     pbmi->cbFix = bmp.cbFix;
  7910.     pbmi->cx = bmp.cx;
  7911.     pbmi->cy = bmp.cy;
  7912.     pbmi->cPlanes = bmp.cPlanes;
  7913.     pbmi->cBitCount = bmp.cBitCount;
  7914.     pbmi->ulCompression = BCA_UNCOMP;
  7915.     pbmi->cbImage = ((sWidth+31)/32) * sHeight;
  7916.     pbmi->cxResolution = 70;
  7917.     pbmi->cyResolution = 70;
  7918.     pbmi->cclrUsed = 2;
  7919.     pbmi->cclrImportant = 0;
  7920.     pbmi->usUnits = BRU_METRIC;
  7921.     pbmi->usReserved = 0;
  7922.     pbmi->usRecording = BRA_BOTTOMUP;
  7923.     pbmi->usRendering = BRH_NOTHALFTONED;
  7924.     pbmi->cSize1 = 0;
  7925.     pbmi->cSize2 = 0;
  7926.     pbmi->ulColorEncoding = BCE_RGB;
  7927.     pbmi->ulIdentifier = 0;
  7928.  
  7929.     /* Create a bit map that is compatible with the display.            */
  7930.  
  7931.     hbm = GpiCreateBitmap(hpsMem, &bmp, FALSE, NULL, pbmi);
  7932.  
  7933.     /* Associate the bit map and the memory presentation space.         */
  7934.  
  7935.     GpiSetBitmap(hpsMem, hbm);
  7936.  
  7937.     /* Copy the screen to the bit map.                                  */
  7938.  
  7939.     aptl[0].x = 0;       /* Lower-left corner of destination rectangle  */
  7940.     aptl[0].y = 0;       /* Lower-left corner of destination rectangle  */
  7941.     aptl[1].x = sWidth;  /* Upper-right corner of destination rectangle */
  7942.     aptl[1].y = sHeight; /* Upper-right corner of destination rectangle */
  7943.     aptl[2].x = 0;       /* Lower-left corner of source rectangle       */
  7944.     aptl[2].y = 0;       /* Lower-left corner of source rectangle       */
  7945.  
  7946.     hps = WinGetScreenPS(HWND_DESKTOP);
  7947.  
  7948.     GpiBitBlt(hpsMem, hps,
  7949.         sizeof(aptl) / sizeof(POINTL), /* Number of points in aptl      */
  7950.         aptl, ROP_SRCCOPY, BBO_IGNORE);
  7951.  
  7952.     WinReleasePS(hps);
  7953.  
  7954.  
  7955. Copying a Display-Screen Image to a Bit Map 
  7956.  
  7957.  
  7958. ΓòÉΓòÉΓòÉ 8.2.2. Scaling and Drawing a Bit-Map Image ΓòÉΓòÉΓòÉ
  7959.  
  7960. You can scale a bit map by calling GpiBitBlt or GpiWCBitBlt and altering the 
  7961. dimensions of the target rectangle. The following figure shows how to shrink 
  7962. the screen copied in the first example to half its original size, and then 
  7963. redraw it by calling GpiBitBlt. 
  7964.  
  7965.     POINTL aptl[3];
  7966.     HPS hpsMem, hps;
  7967.     HWND hwnd;
  7968.     SHORT sWidth = 128, sHeight = 128;
  7969.     /* Target-rectangle dimensions (in device coordinates)              */
  7970.     aptl[0].x = 0;
  7971.     aptl[0].y = 0;
  7972.     aptl[1].x = sWidth / 2;
  7973.     aptl[1].y = sHeight / 2;
  7974.  
  7975.     /* Source-rectangle dimensions (in device coordinates)              */
  7976.     aptl[2].x = 0;
  7977.     aptl[2].y = 0;
  7978.     aptl[3].x = sWidth;
  7979.     aptl[3].y = sHeight;
  7980.  
  7981.     hps = WinGetPS(hwnd);
  7982.  
  7983.     GpiBitBlt(hps, hpsMem,
  7984.         sizeof(aptl) / sizeof(POINTL),      /* Number of points in aptl */
  7985.         aptl, ROP_SRCCOPY, BBO_IGNORE);
  7986.  
  7987.     WinReleasePS(hps);
  7988.  
  7989. Scaling and Drawing a Bit-Map Image 
  7990.  
  7991.  
  7992. ΓòÉΓòÉΓòÉ 8.2.3. Creating a Custom Fill Pattern ΓòÉΓòÉΓòÉ
  7993.  
  7994. To create a custom fill pattern that the operating system will use to fill area 
  7995. primitives and paths: 
  7996.  
  7997.  1. Set an array of bits for a bit map that measures 8-bits-by-8-bits (remember 
  7998.     that the operating system pads the bit-map bits on a ULONG (32-bit) 
  7999.     boundary). 
  8000.  
  8001.  2. Create a bit map in a screen presentation space by calling GpiCreateBitmap 
  8002.     and passing it the address of the array of bits from Step 1. 
  8003.  
  8004.  3. Assign a local identifier (lcid) to the bit map by calling GpiSetBitmapId. 
  8005.  
  8006.  4. Set the attribute of the pattern set in the AREABUNDLE structure by calling 
  8007.     GpiSetPattern. 
  8008.  
  8009. The following figure shows how to create the pattern. 
  8010.  
  8011.     /* Define an array of bytes;  this array creates a grid pattern. */
  8012.  
  8013.     BYTE abPattern5[] = {
  8014.         0xFF, 0xFF, 0x00, 0x00,
  8015.         0x80, 0x00, 0x00, 0x00,
  8016.         0x80, 0x00, 0x00, 0x00,
  8017.         0x80, 0x00, 0x00, 0x00,
  8018.         0x80, 0x00, 0x00, 0x00,
  8019.         0x80, 0x00, 0x00, 0x00,
  8020.         0x80, 0x00, 0x00, 0x00,
  8021.         0x80, 0x00, 0x00, 0x00,
  8022.         0x80, 0x00, 0x00, 0x00,
  8023.         0x80, 0x00, 0x00, 0x00,
  8024.         0x80, 0x00, 0x00, 0x00,
  8025.         0x80, 0x00, 0x00, 0x00,
  8026.         0x80, 0x00, 0x00, 0x00,
  8027.         0x80, 0x00, 0x00, 0x00,
  8028.         0x80, 0x00, 0x00, 0x00,
  8029.         0x80, 0x00, 0x00, 0x00 };
  8030.  
  8031.         LONG lcidCustom = 1;
  8032.     HPS hps;
  8033.     PBITMAPINFO2 pbmi;
  8034.     BITMAPINFOHEADER2 bmp;
  8035.     HBITMAP hbm;
  8036.     PRGB2 prgb2;
  8037.  
  8038.     /* Create the bit map, passing the address of the array of bytes. */
  8039.     hbm = GpiCreateBitmap(hps, &bmp, CBM_INIT, (PBYTE) abPattern5, pbmi);
  8040.  
  8041.     /* Assign a local identifier to the bit map.                      */
  8042.     GpiSetBitmapId(hps, hbm, lcidCustom);
  8043.  
  8044.     /* Set the pattern-set attribute in the AREABUNDLE structure.     */
  8045.     GpiSetPatternSet(hps, lcidCustom);
  8046.  
  8047.  
  8048. Creating a Custom Fill Pattern 
  8049.  
  8050.  
  8051. ΓòÉΓòÉΓòÉ 8.2.4. Loading a Bit Map from a File ΓòÉΓòÉΓòÉ
  8052.  
  8053. You can load a bit map from a file if the format of the file corresponds to the 
  8054. standard OS/2 operating system bit-map file format. (Any bit map that you 
  8055. create with the Icon Editor is automatically stored in this format.)  To load a 
  8056. bit map: 
  8057.  
  8058.  1. Copy the bit-map file to the directory that contains your application's 
  8059.     resource file and source code. 
  8060.  
  8061.  2. Create an entry in your application's resource file, assigning a unique 
  8062.     integer identifier to the bit map. 
  8063.  
  8064.  3. Call GpiLoadBitmap in your application's source code, passing it the 
  8065.     integer identifier that you assigned to the bit map in your application's 
  8066.     resource file. 
  8067.  
  8068. You can actually include your bit map in the application's .EXE file or in a 
  8069. separate resource file.  If the bit map is included in a separate resource 
  8070. file, you must specify both the resource ID and the ID of the bit map within 
  8071. the resource file on GpiLoadBitmap.  If bit map is to be included in the 
  8072. application's .EXE file, the resource ID is specified as NULL and only the ID 
  8073. of the bit map is required by GpiLoadBitmap. 
  8074.  
  8075. Following is an example of code from an application's resource file that 
  8076. assigns the integer value, 200, to a bit-map file called CUSTOM.BMP. 
  8077.  
  8078.     BITMAP  200 CUSTOM.BMP
  8079.  
  8080. The following figure is an example of code from the application that shows how 
  8081. to retrieve a bit-map handle by calling GpiLoadBitmap, use the handle to tag 
  8082. the bit map by calling GpiSetBitmapId, and then use the local identifier 
  8083. supplied by GpiSetBitmapId to set the bit map as the current fill pattern, 
  8084. using GpiSetPatternSet. 
  8085.  
  8086.     HPS hps;
  8087.     HBITMAP hbm;
  8088.     LONG lcidCustom = 1;
  8089.     POINTL ptl;
  8090.  
  8091.     hbm = GpiLoadBitmap(hps,  /* Presentation-space handle        */
  8092.         NULLHANDLE,           /* Resource in application's module */
  8093.         IDB_PATTERN,          /* Bit-map ID                       */
  8094.         16,                   /* Bit-map width                    */
  8095.         16);                  /* Bit-map height                   */
  8096.  
  8097.     /* Assign a local identifier to the bit map.                  */
  8098.     GpiSetBitmapId(hps, hbm, lcidCustom);
  8099.  
  8100.     /* Set the pattern-set attribute in the AREABUNDLE structure. */
  8101.     GpiSetPatternSet(hps, lcidCustom);
  8102.  
  8103.     ptl.x = 100;
  8104.     ptl.y = 100;
  8105.     GpiMove(hps, &ptl);
  8106.     ptl.x = 200;
  8107.     ptl.y = 200;
  8108.     GpiBox(hps, DRO_OUTLINEFILL, &ptl, 0, 0);
  8109.  
  8110. Loading a Bit Map from a File 
  8111.  
  8112.  
  8113. ΓòÉΓòÉΓòÉ 8.2.5. Storing a Bit Map in a Metafile ΓòÉΓòÉΓòÉ
  8114.  
  8115. You can draw bit maps in a metafile or segment by calling GpiWCBitBlt. The 
  8116. operating system converts this function to a drawing order.  The 
  8117. target-rectangle dimensions that you pass to GpiWCBitBlt are in world 
  8118. coordinates, not device coordinates. The following figure shows how to draw a 
  8119. bit map in a metafile, and then play the metafile. 
  8120.  
  8121.     DEVOPENSTRUC dop;
  8122.     HDC hdcMeta;
  8123.     HPS hps, hpsMeta;
  8124.     SIZEL sizlPage;
  8125.     HMF hmf;
  8126.     HBITMAP hbm;
  8127.     HAB hab;
  8128.     HWND hwnd;
  8129.     POINTL aptl[4];
  8130.  
  8131.     dop.pszLogAddress = NULL;
  8132.     dop.pszDriverName = "DISPLAY";
  8133.     dop.pdriv = NULL;
  8134.     dop.pszDataType = NULL;
  8135.  
  8136.     hdcMeta = DevOpenDC(hab, OD_METAFILE, "*", 4L,
  8137.                   (PDEVOPENDATA) &dop, NULLHANDLE);
  8138.     hpsMeta = GpiCreatePS(hab, hdcMeta, &sizlPage, PU_PELS | GPIA_ASSOC);
  8139.  
  8140.     hbm = GpiLoadBitmap(hpsMeta, NULLHANDLE, IDB_PATTERN, 16L, 16L);
  8141.  
  8142.     aptl[0].x = aptl[0].y = 0;  /* Lower-left corner target rectangle        */
  8143.     aptl[1].x = 150;            /* X coordinate upper-right target rectangle */
  8144.     aptl[1].y = 300;            /* Y coordinate upper-right target rectangle */
  8145.     aptl[2].x = aptl[2].y = 0;  /* Lower-left corner source rectangle        */
  8146.     aptl[3].x = aptl[3].y = 16; /* Upper-right corner source rectangle       */
  8147.  
  8148.     GpiWCBitBlt(hpsMeta, hbm, 4L, aptl, ROP_SRCCOPY, BBO_IGNORE);
  8149.  
  8150.     GpiAssociate(hpsMeta, NULLHANDLE);
  8151.     hmf = DevCloseDC(hdcMeta);
  8152.  
  8153.     hps = WinGetPS(hwnd);
  8154.  
  8155.     GpiPlayMetaFile(hps, hmf, 0L, NULL, NULL, 0L, NULL);
  8156.  
  8157.     WinReleasePS(hps);
  8158.  
  8159. Storing a Bit Map in a Metafile 
  8160.  
  8161. You can also store a bit map in a metafile by calling GpiBitBlt.  In this case, 
  8162. however, the bit map will be stored inside an escape order. 
  8163.  
  8164.  
  8165. ΓòÉΓòÉΓòÉ 8.3. Summary ΓòÉΓòÉΓòÉ
  8166.  
  8167. The following table summarizes bit-map object functions. 
  8168.  
  8169. Bit-Map Functions 
  8170.  
  8171. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8172. ΓöéFunction Name               ΓöéDescription                     Γöé
  8173. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8174. ΓöéGpiCreateBitmap             ΓöéCreates a bit map that is       Γöé
  8175. Γöé                            Γöécompatible with a device        Γöé
  8176. Γöé                            Γöéassociated with a presentation  Γöé
  8177. Γöé                            Γöéspace.                          Γöé
  8178. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8179. ΓöéGpiDrawBits                 ΓöéCopies bit-map image data from  Γöé
  8180. Γöé                            Γöéstorage to a bit map that has   Γöé
  8181. Γöé                            Γöébeen selected into a device     Γöé
  8182. Γöé                            Γöécontext.                        Γöé
  8183. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8184. ΓöéGpiImage                    ΓöéDraws an image primitive.       Γöé
  8185. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8186. ΓöéGpiLoadBitmap               ΓöéLoads a bit map from a resource Γöé
  8187. Γöé                            Γöéfile or application EXE file.   Γöé
  8188. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8189. ΓöéGpiQueryBitmapBits          ΓöéTransfers data from a bit map toΓöé
  8190. Γöé                            Γöéapplication storage.            Γöé
  8191. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8192. ΓöéGpiQueryBitmapDimension     ΓöéDetermines the width and height Γöé
  8193. Γöé                            Γöéof a bit map, in units of 0.1   Γöé
  8194. Γöé                            Γöémm.                             Γöé
  8195. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8196. ΓöéGpiQueryBitmapHandle        ΓöéDetermines the handle of a bit  Γöé
  8197. Γöé                            Γöémap with a specific local ID.   Γöé
  8198. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8199. ΓöéGpiQueryBitmapInfoHeader    ΓöéDetermines information about a  Γöé
  8200. Γöé                            Γöéparticular bit map, then        Γöé
  8201. Γöé                            Γöétransfers the information to theΓöé
  8202. Γöé                            ΓöéBITMAPINFOHEADER structure.     Γöé
  8203. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8204. ΓöéGpiQueryBitmapParameters    ΓöéDetermines information about a  Γöé
  8205. Γöé                            Γöéparticular bit map, then        Γöé
  8206. Γöé                            Γöétransfers the information to theΓöé
  8207. Γöé                            ΓöéBITMAPINFOHEADER structure. Use Γöé
  8208. Γöé                            ΓöéGpiQueryBitmapInfoHeader        Γöé
  8209. Γöé                            Γöéwhenever possible.              Γöé
  8210. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8211. ΓöéGpiQueryDeviceBitmapFormats ΓöéDetermines the device bit map   Γöé
  8212. Γöé                            Γöéformats (number of planes and   Γöé
  8213. Γöé                            Γöénumber of bits per pel)         Γöé
  8214. Γöé                            Γöésupported by the device, with   Γöé
  8215. Γöé                            Γöéthe format that most closely    Γöé
  8216. Γöé                            Γöématches the device returned     Γöé
  8217. Γöé                            Γöéfirst.                          Γöé
  8218. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8219. ΓöéGpiQueryPel                 ΓöéDetermines the color index or   Γöé
  8220. Γöé                            ΓöéRGB value for a specific pel,   Γöé
  8221. Γöé                            Γöéwhose location is specified in  Γöé
  8222. Γöé                            Γöéworld coordinates.              Γöé
  8223. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8224. ΓöéGpiSetBitmap                ΓöéSelects a bit map into a memory Γöé
  8225. Γöé                            Γöédevice context.                 Γöé
  8226. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8227. ΓöéGpiSetBitmapBits            ΓöéTransfers standard-format bit   Γöé
  8228. Γöé                            Γöémaps from a buffer into a bit   Γöé
  8229. Γöé                            Γöémap, associated with a memory   Γöé
  8230. Γöé                            Γöédevice context.                 Γöé
  8231. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8232. ΓöéGpiSetBitmapDimension       ΓöéDefines the height and width of Γöé
  8233. Γöé                            Γöéa bit map, in units of 0.1 mm.  Γöé
  8234. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8235. ΓöéGpiSetBitmapID              ΓöéAssigns a local identifier to a Γöé
  8236. Γöé                            Γöébit map.                        Γöé
  8237. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8238. ΓöéGpiSetPel                   ΓöéDraws a pel using the current   Γöé
  8239. Γöé                            Γöéline bundle color and mix       Γöé
  8240. Γöé                            Γöéattributes at a specified       Γöé
  8241. Γöé                            Γöéposition in world coordinates.  Γöé
  8242. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8243. ΓöéWinDrawBitmap               ΓöéDraws a bit map in a display    Γöé
  8244. Γöé                            Γöéwindow.                         Γöé
  8245. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8246.  
  8247. The following table summarizes the data structures used by the bit-map object 
  8248. functions. 
  8249.  
  8250. Bit-Map Structures 
  8251.  
  8252. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8253. ΓöéStructure Name    ΓöéDescription                               Γöé
  8254. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8255. ΓöéBITMAPINFO2       ΓöéContains 20 fields that specify the       Γöé
  8256. Γöé                  Γöéattributes of the bit map, such as the    Γöé
  8257. Γöé                  Γöébit-map width, height, number of color    Γöé
  8258. Γöé                  Γöéplanes, bit count, RGB array structure,   Γöé
  8259. Γöé                  Γöéinformation header size, and so on.       Γöé
  8260. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8261. ΓöéBITMAPINFOHEADER2 ΓöéContains 19 fields that specify the       Γöé
  8262. Γöé                  Γöébit-map header information, such as the   Γöé
  8263. Γöé                  Γöébit map width, height, number of color    Γöé
  8264. Γöé                  Γöéplanes, bit count, information header     Γöé
  8265. Γöé                  Γöésize, and so on.                          Γöé
  8266. Γöé                  ΓöéThis record contains the same fields as   Γöé
  8267. Γöé                  ΓöéBITMAPINFO2, with the exception of the    Γöé
  8268. Γöé                  Γöélast field, argbColorY1.                  Γöé
  8269. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8270. ΓöéRGB2              ΓöéA 4-byte structure containing 1 byte blue,Γöé
  8271. Γöé                  Γöégreen, and red color component values.    Γöé
  8272. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8273.  
  8274.  
  8275. ΓòÉΓòÉΓòÉ 9. Fonts ΓòÉΓòÉΓòÉ
  8276.  
  8277. In typography, a font is a collection of characters that share a common height, 
  8278. line weight, and appearance. In presentation manager, fonts are an lcid 
  8279. identified resource, like bit maps, and are used in conjunction with the 
  8280. character string primitive data structures to define the appearance of 
  8281. displayed and printed text. The primary role of the PM programming interface 
  8282. with regard to fonts is to evaluate whether a particular font is appropriate 
  8283. for a given situation. 
  8284.  
  8285. The following topics are related to the information in this chapter: 
  8286.  
  8287. o Presentation spaces 
  8288. o Device contexts 
  8289. o Character string primitives 
  8290. o Coordinate spaces 
  8291. o Transformations 
  8292. o Color and mix attributes. 
  8293.  
  8294.  
  8295. ΓòÉΓòÉΓòÉ 9.1. About Fonts ΓòÉΓòÉΓòÉ
  8296.  
  8297. Font height is specified in printer's points, referred to in this volume as 
  8298. just points. A point equals approximately 1/72 of an inch. The line weight and 
  8299. appearance of a font are specified by the categories listed in the following 
  8300. table. 
  8301.  
  8302. Examples of Line Weight and Font Appearance Categories 
  8303.  
  8304. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8305. ΓöéAttribute   ΓöéCategory    ΓöéDescription                         Γöé
  8306. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8307. ΓöéLine Weight ΓöéNormal      ΓöéCharacters drawn with a normal line Γöé
  8308. Γöé            Γöé            Γöéweight.                             Γöé
  8309. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8310. Γöé            ΓöéBold        ΓöéCharacters drawn with a heavier lineΓöé
  8311. Γöé            Γöé            Γöéweight.                             Γöé
  8312. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8313. ΓöéAppearance  ΓöéCondensed   ΓöéCharacters drawn with half the      Γöé
  8314. Γöé            Γöé            Γöéaverage character width.            Γöé
  8315. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8316. Γöé            ΓöéExpanded    ΓöéCharacters drawn with twice the     Γöé
  8317. Γöé            Γöé            Γöéaverage character width.            Γöé
  8318. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8319. Γöé            ΓöéItalic      ΓöéCharacters drawn with a normal line Γöé
  8320. Γöé            Γöé            Γöéweight and sloped to the right.     Γöé
  8321. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8322.  
  8323. A font family is a collection of fonts that share common design characteristics 
  8324. such as stroke width and serif.  Stroke width refers to the width of lines used 
  8325. to draw the characters and symbols of a font. A serif is a short cross-line 
  8326. drawn at the ends of the main strokes forming a character or symbol. 
  8327.  
  8328. Text output is drawn with the characters and symbols of a font. The operating 
  8329. system stores fonts either in memory or on devices. Applications can access 
  8330. fonts through a device context associated with the current presentation space. 
  8331. When an application creates a presentation space, using GpiCreatePS or 
  8332. WinGetPS, the operating system assigns the presentation space a default font 
  8333. from one of the available fonts. An application can retrieve information about 
  8334. the default font using GpiQueryFontMetrics. 
  8335.  
  8336.  
  8337. ΓòÉΓòÉΓòÉ 9.1.1. Image Font and Outline Font Implementation ΓòÉΓòÉΓòÉ
  8338.  
  8339. The operating system can define and implement the characters of a font as 
  8340. either images or outlines. 
  8341.  
  8342. Each of the characters in an image font (sometimes called a raster font) is 
  8343. created by alternating the ON and OFF settings of pels to produce the image. 
  8344. The image characters are stored as a bit map; sometimes image fonts are even 
  8345. referred to as bit-map fonts. 
  8346.  
  8347. The characters in an image font must be drawn in a fixed size-you cannot rotate 
  8348. or scale them, for example-but usually they are of good quality; they are 
  8349. displayed faster than outline characters; and frequently, they look better at 
  8350. low resolutions. 
  8351.  
  8352. The characters in an outline font, on the other hand, are drawn using a 
  8353. sequence of lines and arcs; then the characters are filled if so requested. The 
  8354. outline characters are stored as a collection of line, fillet, and spline 
  8355. functions. Outline fonts are transformable because the outline characters can 
  8356. be scaled, rotated, and sheared. Outline fonts can be implemented as vectors, 
  8357. drawn by a series of small, straight lines; if that is the case, they can be 
  8358. referred to correctly as vector fonts.  Vector fonts can be drawn much faster 
  8359. than fonts requiring the inclusion of actual curves and arcs. 
  8360.  
  8361. A major advantage of outline fonts is their device independence; unlike image 
  8362. fonts, whose appearance depends on the device's pel definition. 
  8363.  
  8364. The following figure is an example of a character in both an image font and an 
  8365. outline font. 
  8366.  
  8367. Image and Outline Characters 
  8368.  
  8369. The image character is produced by manipulating pels. The outline character is 
  8370. produced by drawing a sequence of lines and arcs.  (The resultant shape of an 
  8371. outline character can be filled if desired.) 
  8372.  
  8373. Note:  Most of the functions and data structures described in this chapter 
  8374.        relate only to outline fonts. 
  8375.  
  8376.  
  8377. ΓòÉΓòÉΓòÉ 9.1.2. PM-Supplied Fonts ΓòÉΓòÉΓòÉ
  8378.  
  8379. The PM programming interface provides a number of both image and outline 
  8380. typographic-quality character fonts. On some devices, image fonts in small font 
  8381. sizes have a better appearance than their outline-font equivalents. 
  8382.  
  8383. Type size is measured in points. There are approximately 72 points to an inch, 
  8384. so each character in a 24-point font, for example, is 1/3-inch high. Each 
  8385. incremental unit of a presentation page in PU_TWIPS format is 1/20 of a 
  8386. printer's point (1/1440 inch). 
  8387.  
  8388. The following image fonts are available on all OS/2-supported display adapters: 
  8389.  
  8390. Available Image Fonts 
  8391.  
  8392. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8393. ΓöéFont Family Name        ΓöéPoint Sizes Available               Γöé
  8394. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8395. ΓöéTms Rmn                 Γöé8, 10, 12, 14, 18, 24               Γöé
  8396. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8397. ΓöéHelv                    Γöé8, 10, 12, 14, 18, 24               Γöé
  8398. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8399. ΓöéCourier (monospace)     Γöé8, 10, 12                           Γöé
  8400. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8401. ΓöéSystem Monospace        Γöé10                                  Γöé
  8402. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8403.  
  8404. In addition, a default system font is used in window components such as title 
  8405. bars and menus; it is a proportionally spaced Swiss font. 
  8406.  
  8407. The outline fonts provided by the PM programming interface are Adobe** Type 1. 
  8408. The appearance and performance characteristics of these fonts are more flexible 
  8409. than for image fonts. 
  8410.  
  8411. The following table lists the outline fonts available with the operating system 
  8412. and their equivalent fonts from earlier versions of OS/2. 
  8413.  
  8414. Available Outline Fonts 
  8415.  
  8416. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8417. ΓöéOutline Font      ΓöéOS/2 2.0 Fonts Available    ΓöéEquivalent    Γöé
  8418. ΓöéFamily Name       Γöé                            ΓöéName          Γöé
  8419. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8420. ΓöéTimes New Roman** ΓöéTimes New Roman             ΓöéTms Rmn       Γöé
  8421. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8422. Γöé                  ΓöéTimes New Roman Bold        ΓöéTms Rmn Bold  Γöé
  8423. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8424. Γöé                  ΓöéTimes New Roman Bold Italic ΓöéTms Rmn Bold  Γöé
  8425. Γöé                  Γöé                            ΓöéItalic        Γöé
  8426. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8427. Γöé                  ΓöéTimes New Roman Italic      ΓöéTms Rmn ItalicΓöé
  8428. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8429. ΓöéHelvetica**       ΓöéHelvetica                   ΓöéHelv          Γöé
  8430. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8431. Γöé                  ΓöéHelvetica Bold              ΓöéHelv Bold     Γöé
  8432. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8433. Γöé                  ΓöéHelvetica Bold Italic       ΓöéHelv Bold     Γöé
  8434. Γöé                  Γöé                            ΓöéItalic        Γöé
  8435. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8436. Γöé                  ΓöéHelvetica Italic.           ΓöéHelv Italic   Γöé
  8437. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8438. ΓöéCourier           ΓöéCourier                     ΓöéCourier       Γöé
  8439. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8440. Γöé                  ΓöéCourier Bold                ΓöéCourier Bold  Γöé
  8441. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8442. Γöé                  ΓöéCourier Bold Italic         ΓöéCourier Bold  Γöé
  8443. Γöé                  Γöé                            ΓöéItalic        Γöé
  8444. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8445. Γöé                  ΓöéCourier Italic              ΓöéCourier ItalicΓöé
  8446. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8447. ΓöéSymbol            ΓöéSymbol                      ΓöéNone          Γöé
  8448. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8449.  
  8450. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8451. ΓöéThe outline font names provided with earlier versions of OS/2 Γöé
  8452. Γöéare still supported, but the corresponding new fonts are      Γöé
  8453. Γöéobtained when the previous font names are selected.           Γöé
  8454. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8455.  
  8456.  
  8457. ΓòÉΓòÉΓòÉ 9.1.3. Availability of Additional Fonts ΓòÉΓòÉΓòÉ
  8458.  
  8459. Over 600 Adobe Type 1 fonts are available from font vendors, and user systems 
  8460. could have a large number of these installed. Applications must be capable of 
  8461. functioning properly with whatever font the user selects. 
  8462.  
  8463. An application can examine the font metrics to see what a font looks like or 
  8464. display different font characters from which the user can choose.  When dealing 
  8465. with an interactive or user-driven application, the recommended method of 
  8466. choosing a font is to call WinFontDlg, which displays an example of the font in 
  8467. a dialog box. 
  8468.  
  8469. Additional Adobe Type 1 fonts can be used just like other outline fonts. 
  8470. Notice, however, that some of those fonts are more stylized, that is, the fonts 
  8471. have a greater variation in the widths of different characters within the same 
  8472. font, which is provided by kerning. Kerning is described and illustrated in 
  8473. Kerning. 
  8474.  
  8475. Adobe Type 1 fonts, provided with and for a particular application, can be 
  8476. loaded with GpiLoadFonts, provided that the following rules are observed: 
  8477.  
  8478. o The .AFM file of the font must be specified as the font file. 
  8479. o The .PFB file must be in the same directory as the .AFM file. 
  8480.  
  8481.  
  8482. ΓòÉΓòÉΓòÉ 9.1.4. Font Data Structures and Attributes ΓòÉΓòÉΓòÉ
  8483.  
  8484. The attributes of fonts are contained in the FONTMETRICS data structure. The 
  8485. appearance of the actual text is influenced also by the attributes of the 
  8486. individual characters, which can be found in the CHARBUNDLE data structure. The 
  8487. character string primitives are described in Character String Primitives. 
  8488.  
  8489. An application can determine whether to use a particular font by examining its 
  8490. font metrics, which are the measurements that define the features of that font. 
  8491. The measurements are decided on by a font designer, whose most important 
  8492. criteria might be ensuring that the font is pleasing to the eye. 
  8493.  
  8494. Unlike the attributes of a character string primitive, the individual font 
  8495. metrics attributes cannot be changed using specific GPI functions. Your 
  8496. application can determine the values of the current logical font attributes by 
  8497. calling GpiQueryFontMetrics, which accepts as input the amount of data to be 
  8498. returned as well as a pointer to the data area. Unlike other GPI calls, 
  8499. GpiQueryFontMetrics does not return the size necessary for all font metrics 
  8500. data. Querying with a sizeof operator, instead of calling the query twice, 
  8501. returns the size data. 
  8502.  
  8503. The following table and text defines and explains the uses of the various font 
  8504. metric attributes. 
  8505.  
  8506. Font Metric Attributes 
  8507.  
  8508. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  8509. ΓöéAttribute                     ΓöéDescription                   Γöé
  8510. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8511. ΓöéFace name                     ΓöéThe full typeface name of a   Γöé
  8512. Γöé                              Γöéfont, such as Courier Bold    Γöé
  8513. Γöé                              ΓöéItalic.                       Γöé
  8514. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8515. ΓöéFamily name                   ΓöéA broader equivalent of the   Γöé
  8516. Γöé                              Γöéface name (e.g.Courier).      Γöé
  8517. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8518. ΓöéCode page                     ΓöéThe mapping between a set of  Γöé
  8519. Γöé                              Γöécodepoints and a set of       Γöé
  8520. Γöé                              Γöégraphic characters.           Γöé
  8521. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8522. ΓöéCharacter cell                ΓöéControls the height and width Γöé
  8523. Γöé                              Γöéof outline font characters.   Γöé
  8524. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8525. ΓöéCharacter cell ascent         ΓöéDistance between the baseline Γöé
  8526. Γöé                              Γöéto the top of the character   Γöé
  8527. Γöé                              Γöécell.                         Γöé
  8528. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8529. ΓöéCharacter cell descent        ΓöéDistance between the baseline Γöé
  8530. Γöé                              Γöéand the bottom of the         Γöé
  8531. Γöé                              Γöécharacter cell.               Γöé
  8532. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8533. ΓöéMaximum baseline extent       ΓöéMaximum vertical extent of    Γöé
  8534. Γöé                              Γöéfont characters in world      Γöé
  8535. Γöé                              Γöécoordinates.                  Γöé
  8536. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8537. ΓöéMaximum ascender              ΓöéMaximum distance a font       Γöé
  8538. Γöé                              Γöécharacter ascends above the   Γöé
  8539. Γöé                              Γöébaseline.                     Γöé
  8540. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8541. ΓöéMaximum descender             ΓöéMaximum distance a font       Γöé
  8542. Γöé                              Γöécharter descends below the    Γöé
  8543. Γöé                              Γöébaseline.                     Γöé
  8544. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8545. ΓöéInternal leading              ΓöéVertical distance equal to theΓöé
  8546. Γöé                              Γöédifference between the maximumΓöé
  8547. Γöé                              Γöébaseline extent and the em    Γöé
  8548. Γöé                              Γöéheight.                       Γöé
  8549. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8550. ΓöéEm height                     ΓöéEquivalent to the character   Γöé
  8551. Γöé                              Γöécell height.                  Γöé
  8552. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8553. ΓöéEm width                      ΓöéEquivalent to the character   Γöé
  8554. Γöé                              Γöécell width.                   Γöé
  8555. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8556. ΓöéX height                      ΓöéHeight above the baseline of  Γöé
  8557. Γöé                              Γöéany lowercase character.      Γöé
  8558. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8559. ΓöéLowercase ascent              ΓöéMaximum distance of a         Γöé
  8560. Γöé                              Γöélowercase character above the Γöé
  8561. Γöé                              Γöébaseline.                     Γöé
  8562. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8563. ΓöéLowercase descent             ΓöéMaximum distance of a         Γöé
  8564. Γöé                              Γöélowercase character below the Γöé
  8565. Γöé                              Γöébaseline.                     Γöé
  8566. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8567. ΓöéExternal leading              ΓöéMaximum vertical font spacing Γöé
  8568. Γöé                              Γöéthat can be added without     Γöé
  8569. Γöé                              Γöéadversely affecting the       Γöé
  8570. Γöé                              Γöéappearance of the text.       Γöé
  8571. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8572. ΓöéAverage character width       ΓöéAverage width of font         Γöé
  8573. Γöé                              Γöécharacters in world           Γöé
  8574. Γöé                              Γöécoordinates                   Γöé
  8575. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8576. ΓöéCharacter slope               ΓöéInitial slope of a character  Γöé
  8577. Γöé                              Γöéwith respect to a vertical    Γöé
  8578. Γöé                              Γöéline.                         Γöé
  8579. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8580. ΓöéInline direction              ΓöéCharacter angle measured with Γöé
  8581. Γöé                              Γöérespect to a horizontal line. Γöé
  8582. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8583. ΓöéWeight class                  ΓöéSpecifies the thickness of    Γöé
  8584. Γöé                              Γöéeach stroke of a font         Γöé
  8585. Γöé                              Γöécharacter.                    Γöé
  8586. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  8587. ΓöéFirst, last, default, and     ΓöéSee Glyphs, Code Pages, and   Γöé
  8588. Γöébreak characters              ΓöéCode Points.                  Γöé
  8589. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  8590.  
  8591. The face name attribute is the typeface name by which a particular font design 
  8592. is known. Two examples are Times New Roman Bold and Times New Roman Italic. 
  8593. Roman is the family name of these fonts. You always should provide a face name 
  8594. because most outline fonts are known by it. 
  8595.  
  8596. The code page to be associated with the font is identified by this metric. Some 
  8597. fonts are specific to a particular code page and should be used with only that 
  8598. code page. Other fonts are universal and can be used with any supported code 
  8599. page.  Code pages are described in Glyphs, Code Pages, and Code Points. 
  8600.  
  8601. Every character in a font is drawn within a rectangular region called a 
  8602. character cell. The character-cell height is the distance from the bottom of 
  8603. the character cell to its top. The width of the character cell is the distance 
  8604. from one side to the other. 
  8605.  
  8606. An imaginary horizontal line, called a baseline, is drawn through the lower 
  8607. portion of the character cell. The operating system uses the baseline to 
  8608. position characters. All uppercase and most lowercase letters in a given font 
  8609. rest approximately on the baseline. Some lowercase letters, such as g and y, 
  8610. descend below the baseline. 
  8611.  
  8612. The distance from the baseline to the top of the character cell is the 
  8613. character-cell ascent. Similarly, the character-cell descent is the distance 
  8614. from the baseline to the bottom of the character cell. 
  8615.  
  8616. The following figure illustrates characters drawn along a baseline inside their 
  8617. character cells. Various font metrics also are illustrated. 
  8618.  
  8619. Some Font Metrics 
  8620.  
  8621. The maximum baseline extent is the sum of the maximum ascender and the maximum 
  8622. descender values. The internal leading is the space allowed for diacritics 
  8623. above capital letters. When an application draws a string of text, the 
  8624. operating system positions the leftmost point of the baseline over a 
  8625. predetermined point for each character in the string. 
  8626.  
  8627. A font's Em height is a measure of its visual height. This measurement was 
  8628. given its name because, historically, the height of an uppercase letter M 
  8629. usually was equal to the average height of all uppercase characters in the 
  8630. font. However, this is no longer the case. 
  8631.  
  8632. The value of Em height represents the font point size in world coordinates and 
  8633. is the same as the character cell height. For an outline font, this can be set 
  8634. by the character cell height attribute. The value of Em Width is the equivalent 
  8635. horizontal dimension and is the same as the character cell width. For an 
  8636. outline font this also can be set by the character cell width attribute. These 
  8637. are, in fact, the dimensions of the em square (a typographic term) and, like 
  8638. point size, cannot be defined in terms of any measurable characteristic of a 
  8639. visible character of the font. 
  8640.  
  8641. The average distance from the baseline to the top of any lowercase character is 
  8642. called a font's x height. This measurement was given its name because the 
  8643. height of a lowercase x usually is equal to the average height of all lowercase 
  8644. characters in the font. 
  8645.  
  8646. The maximum ascender is the height of the tallest character in a font. The 
  8647. maximum descender is the depth (below the baseline) of the lowest character in 
  8648. a font. 
  8649.  
  8650. The lowercase ascent is the height of the tallest lowercase character in a 
  8651. font. The lowercase descent is the depth (below the baseline) of the lowest 
  8652. lowercase character in a font. 
  8653.  
  8654. Many fonts reserve part of the space in the top of each character cell for 
  8655. accent marks. This reserved space is called internal leading. Some fonts 
  8656. require a certain amount of space to be left between rows of text. This space, 
  8657. called external leading, is not included in the character-cell height or ascent 
  8658. measurements. The external leading is the recommended space to leave between 
  8659. rows of text to preserve its pleasing appearance. 
  8660.  
  8661. The average character width is stored in the lAveCharWidth field in the 
  8662. FONTMETRICS structure. The average character width is a measure of character 
  8663. width based on the normal frequency of lowercase letter usage in the English 
  8664. language. You can use this value to approximate the average width of a 
  8665. character in string length calculations. 
  8666.  
  8667. The maximum baseline extent for a font is the sum of the maximum ascender and 
  8668. the maximum descender. Maximum baseline extent is not equal to cell height for 
  8669. outline fonts, but is for image fonts. 
  8670.  
  8671. The character slope is an angle measured clockwise with respect to a typical 
  8672. vertical line. The slope of a normal font is 0; the slope of an italic font is 
  8673. other than 0. The character slope in the FONTMETRICS data structure can be 
  8674. thought of as the initial slope, since the slope can be changed in the 
  8675. CHARBUNDLE data structure. 
  8676.  
  8677. The inline direction is an angle measured clockwise with respect to a 
  8678. horizontal line. The inline direction for a Swiss, Helvetica, or Roman font is 
  8679. normally 0-exactly horizontal. The inline direction for a Hebrew font is 
  8680. normally 180, because Hebrew text is oriented right to left. 
  8681.  
  8682. The character-rotation angle is an angle measured counterclockwise with respect 
  8683. to a horizontal line. The baselines of characters are aligned with the vector 
  8684. drawn at the angle of rotation. 
  8685.  
  8686. The weight class specifies the thickness of each stroke that forms part of each 
  8687. character in a font. 
  8688.  
  8689. The first, last, default, and break character all are associated with glyphs 
  8690. for UGL fonts and code pages and are described in Glyphs, Code Pages, and Code 
  8691. Points. 
  8692.  
  8693. A superscript is a character drawn immediately above and to the right of a 
  8694. normal character in a string of text. Superscripts are identified by a width 
  8695. and height and by vertical and horizontal offsets. 
  8696.  
  8697. A subscript is a character drawn immediately below and to the right of a normal 
  8698. character in a string of text. Subscripts are identified by a width and height 
  8699. and by vertical and horizontal offsets. 
  8700.  
  8701. Kerning pairs are described in Kerning. 
  8702.  
  8703.  
  8704. ΓòÉΓòÉΓòÉ 9.1.5. Glyphs, Code Pages, and Code Points ΓòÉΓòÉΓòÉ
  8705.  
  8706. The image or picture that you associate with each character or symbol in a font 
  8707. is called a glyph. The mapping between a set of glyphs and their code points is 
  8708. called a code page. 
  8709.  
  8710. For a single byte character set (SBCS), each code page contains up to 256 code 
  8711. points. Normally these are 8-bit integers in the range 0 through 255, with 1 
  8712. code point identifying 1 glyph in that code page. The code pages can be either 
  8713. ASCII or EBCDIC. Because a code point repeats on a new code page, you need both 
  8714. the code page and code point to uniquely identify a glyph. 
  8715.  
  8716. There usually is 1 code page per font; however, double byte character sets 
  8717. (DBCS) are sometimes used for Asian languages with large character sets. Fonts 
  8718. are a set of glyph definitions and a default code page mapping. The same set of 
  8719. font glyph definitions is remapped for different code pages. 
  8720.  
  8721. Each font contains 4 special glyph points: 
  8722.  
  8723. o First glyph 
  8724. o Last glyph 
  8725. o Default glyph 
  8726. o Break glyph. 
  8727.  
  8728. First and last glyph points are of more interest to the font designers than 
  8729. application programmers because they apply to the set of font glyph definitions 
  8730. rather than a particular code page. The last character is the maximum code 
  8731. point of the font that has a glyph associated with it and may be bigger than 
  8732. 256. 
  8733.  
  8734. The default glyph appears in text when an application specifies a glyph point 
  8735. that does not exist in the font. 
  8736.  
  8737. The break glyph usually is the space character and often has the same code 
  8738. point as the default character. 
  8739.  
  8740. Actually a font can have more or less than 256 definitions, but any particular 
  8741. code page may have less than 256 but no more. There may be a translation 
  8742. between the code point in the code page and the code point (between the first 
  8743. and last glyphs) that references the glyph in the font. 
  8744.  
  8745. The operating system assigns unique identifiers to each of its code pages. 
  8746. Common code pages are 437-the United States code page, and 850-the multilingual 
  8747. code page. The default code page is 850. 
  8748.  
  8749. An application can determine the current code page by calling GpiQueryCp, or it 
  8750. can assign a new code page using GpiSetCp. If you default the code page in the 
  8751. FATTRS structure when calling GpiCreateLogFont, you get the current code page 
  8752. as specified by GpiSetCp (or returned by GpiQueryCp). You can specify any one 
  8753. of the code page identifiers returned to you from the WinQueryCpList function. 
  8754.  
  8755. When using a font other than the system font, you specify the required code 
  8756. page in the FATTRS structure of GpiCreateLogFont. You can determine the code 
  8757. page for that font (if it is the current logical font) by using 
  8758. GpiQueryFontMetrics. The available code pages are described in the Presentation 
  8759. Manager Programming Reference. 
  8760.  
  8761.  
  8762. ΓòÉΓòÉΓòÉ 9.1.6. Proportional and Monospace Fonts ΓòÉΓòÉΓòÉ
  8763.  
  8764. When text is drawn, the operating system aligns each character by positioning 
  8765. its character cell next to that of the previous character. 
  8766.  
  8767. A monospace font provides the same amount of space for each character, whatever 
  8768. its shape. These fonts also are called fixed fonts. Courier and System 
  8769. Monospaced are monospace fonts. Monospace fonts, in fact, are essential for 
  8770. some purposes, for example program listings, where vertical alignment is 
  8771. important. 
  8772.  
  8773. A proportionally-spaced font is one in which some characters are allotted less 
  8774. space than others, so that each character occupies the proportion of space that 
  8775. is correct for its shape. For example, a lowercase letter l does not need the 
  8776. same space as a lowercase letter m. Many graphics fonts supplied by the PM 
  8777. programming interface, including the system font, support proportional spacing. 
  8778.  
  8779. The font metrics value maxcharinc specifies the width of the widest character 
  8780. in the font, and the value avecharwidth specifies an average width of the 
  8781. characters in the font. 
  8782.  
  8783. You can retrieve information about the widths of the characters in the current 
  8784. font by calling GpiQueryWidthTable. You provide the code point of the first 
  8785. character you are interested in and the number of characters for which you want 
  8786. width-table information. Refer to the Presentation Manager Programming 
  8787. Reference for information on how character-width information is computed. 
  8788.  
  8789.  
  8790. ΓòÉΓòÉΓòÉ 9.1.7. Kerning ΓòÉΓòÉΓòÉ
  8791.  
  8792. Kerning, like proportional spacing, is a type of letter spacing. In a kerned 
  8793. font, some characters are allowed to overhang others and, therefore, occupy an 
  8794. area that is less than each character's increment for that font. Usually this 
  8795. feature is restricted to pairs of characters whose appearance might benefit 
  8796. from greater proximity. The 5 character pairs that most commonly benefit from 
  8797. kerning are Yo, We, To Tr, and Ta. 
  8798.  
  8799. Kerning is not available in the system-provided image fonts. The Helvetica and 
  8800. Times New Roman outline fonts provided with the system do include kerning 
  8801. information. You can specify kerning as a requirement on the GpiCreateLogFont. 
  8802. Selecting a kerned font lets a kerning take place whenever it is defined. 
  8803.  
  8804. The a-space is the area of the character cell before the character; the b-space 
  8805. is the area of the character cell occupied by the character; and the c-space is 
  8806. the area of the character cell after the character. The a-space and c-space are 
  8807. shown in the following figure. 
  8808.  
  8809. a-Space, b-Space, and c-Space 
  8810.  
  8811. The best way to implement kerning is to use a kerning-pair table. The kerning 
  8812. table will exist only for certain pairs of characters for which adjustments are 
  8813. desirable. 
  8814.  
  8815. Each of the entries in a kerning-pair table contains the code points of a pair 
  8816. of kerned characters and an adjustment that should be applied to the character 
  8817. width of the first character of the pair. A negative value means that the space 
  8818. is decreased, and a positive value means it is increased, whenever the 2 
  8819. characters in a kerning pair are produced together. A kerning-pair table might 
  8820. be provided with a purchased font. If so, it will be recorded in the font 
  8821. header. 
  8822.  
  8823. If kerning is specified on a character-pair basis (that is, if the font has a 
  8824. kerning-pair table), the font has a specific number of kerned pairs. 
  8825. GpiQueryKerningPairs returns kerning-pair information from the current logical 
  8826. font. For each pair of kerned characters, you are given the characters 
  8827. themselves and an adjustment in world coordinates that must be applied to the 
  8828. character width of the first character of the pair. 
  8829.  
  8830. When you specify negative a- and c-space values, the values affect any 
  8831. character paired with the kerned character. Because this form of kerning cannot 
  8832. be applied selectively, you have to choose the kerned characters carefully. For 
  8833. example, an italic letter f ( ╨» ) is a good candidate for this sort of kerning, 
  8834. because it can overhang most of the characters that precede and follow it. 
  8835.  
  8836. An application can adjust the amount of space between all characters in a font 
  8837. with GpiSetCharExtra. Any extra space is added to font kerning values. An 
  8838. application also can adjust the width of a font's break character (space)  with 
  8839. GpiSetCharBreakExtra. These functions are described in Character String 
  8840. Primitives. 
  8841.  
  8842. Kerning is not available on all devices. On devices that support kerning, 
  8843. kerning is enabled by default. When kerning is not supported on a device, 
  8844. kerning support is switched off by default. When kerning support is switched 
  8845. off, the kerning information supplied with a font is ignored. To determine 
  8846. whether a device supports kerning, use DevQueryCaps. 
  8847.  
  8848. The kerning information can be implemented by your application when a character 
  8849. string primitive is written to an output device; this is called rendering the 
  8850. text. The functions GpiCharStringPos and GpiCharStringPosAt, both described in 
  8851. Character String Primitives, permit specification of the starting position for 
  8852. each character. The entire character string can be searched for character pairs 
  8853. that also are kerning pairs for the kerning information to be applied. 
  8854.  
  8855.  
  8856. ΓòÉΓòÉΓòÉ 9.1.8. FATTRS Data Structure ΓòÉΓòÉΓòÉ
  8857.  
  8858. The FATTRS structure is used to identify the characteristics of a requested 
  8859. font. Certain attributes of a font that govern many individual character string 
  8860. primitives are contained in FATTRS, as follows: 
  8861.  
  8862. o Record length 
  8863. o Selection indicators 
  8864. o Match value 
  8865. o Face name 
  8866. o Registry identifier 
  8867. o Code page 
  8868. o Maximum baseline extent 
  8869. o Average character width 
  8870. o Type indicator 
  8871. o Font use indicator. 
  8872.  
  8873.  
  8874. ΓòÉΓòÉΓòÉ 9.1.8.1. Record Length ΓòÉΓòÉΓòÉ
  8875.  
  8876. Record length determines the length of the FATTRS structure. An application 
  8877. normally specifies this with the sizeof operator. 
  8878.  
  8879.  
  8880. ΓòÉΓòÉΓòÉ 9.1.8.2. Selection Indicators ΓòÉΓòÉΓòÉ
  8881.  
  8882. There are 5 selection indicators: 
  8883.  
  8884. Indicator                   If set ON, selects... 
  8885.  
  8886. FATTR_SEL_ITALIC            A font with an italic appearance. This is intended 
  8887.                             for use with an image font and results in a 
  8888.                             simulation of an italic font. 
  8889.  
  8890. FATTR_SEL_BOLD              A boldface version of the font. This is intended 
  8891.                             for use with an image font and results in a 
  8892.                             simulation of a boldface font. 
  8893.  
  8894. FATTR_SEL_OUTLINE           Hollow characters when using an outline font. This 
  8895.                             only can be used with outline fonts. 
  8896.  
  8897.                             This indicator is less important than the others 
  8898.                             because improved performance is now available (from 
  8899.                             Adobe Type Manager) on filled outline fonts than 
  8900.                             was originally available when this option 
  8901.                             (FATTR_SEL_OUTLINE) was introduced. 
  8902.  
  8903. FATTR_SEL_STRIKEOUT         A font in which the characters are struck through. 
  8904.                             This option also might be selected on the character 
  8905.                             string primitive. 
  8906.  
  8907. FATTR_SEL_UNDERSCORE        A font in which the characters are underscored. 
  8908.                             This option also might be selected on the character 
  8909.                             string primitive. 
  8910.  
  8911. Any combination of these indicators can be set. When set, they cause a 
  8912. simulation of the selected feature. For example, if you require a bold, 
  8913. italicized version of a PM image font, PM simulates that feature because bold, 
  8914. italic image fonts are not supplied. 
  8915.  
  8916.  
  8917. ΓòÉΓòÉΓòÉ 9.1.8.3. Match Value ΓòÉΓòÉΓòÉ
  8918.  
  8919. The match value is a number that identifies a physical font; it is allocated to 
  8920. the font when the font is loaded. If the match value is less than 0, the font 
  8921. is a device font; and, if the match value is greater than 0, the font is a 
  8922. generic font. 
  8923.  
  8924. A device font is exclusive to the device with which it is associated, and its 
  8925. match number is guaranteed to be unique only within the device driver. If an 
  8926. application prints on a different printer, the application cannot guarantee 
  8927. that the font will be identical just by specifying the match value. A generic 
  8928. font is available on more than one device. The PM-supplied fonts, for example, 
  8929. are generic fonts. Printer fonts always are device fonts, but you also can and 
  8930. should use generic fonts with printers. 
  8931.  
  8932. You can choose whether or not to use the match value to specify the font when 
  8933. calling GpiCreateLogFont. Specifying the match value is easier but less 
  8934. flexible than the alternative, which is to specify the font name and outline 
  8935. characteristics. For an image font, the alternative is to specify the maximum 
  8936. baseline extent and average character width of the required font. 
  8937.  
  8938.  
  8939. ΓòÉΓòÉΓòÉ 9.1.8.4. Face Name ΓòÉΓòÉΓòÉ
  8940.  
  8941. The face name value in the FATTRS data structure is identical to the face name 
  8942. of the FONTMETRICS data structure when describing a specific font. 
  8943.  
  8944.  
  8945. ΓòÉΓòÉΓòÉ 9.1.8.5. Registry Identifier ΓòÉΓòÉΓòÉ
  8946.  
  8947. The registry identifier is a unique number by which the font is registered with 
  8948. IBM. The registry identifier of a particular font can be retrieved by calling 
  8949. GpiQueryFonts. If you do not have a registry number, set this value to 0. 
  8950.  
  8951.  
  8952. ΓòÉΓòÉΓòÉ 9.1.8.6. Code Page ΓòÉΓòÉΓòÉ
  8953.  
  8954. The code page is the identifier of the code page to be associated with the 
  8955. font. You can default the code page in GpiCreateLogFont by specifying 0. Like 
  8956. the face name, the code page in the FATTRS data structure is identical to the 
  8957. code page in the FONTMETRICS data structure when describing a specific font. 
  8958.  
  8959.  
  8960. ΓòÉΓòÉΓòÉ 9.1.8.7. Maximum Baseline Extent ΓòÉΓòÉΓòÉ
  8961.  
  8962. The maximum baseline extent is the vertical space occupied by characters in the 
  8963. font. If you are setting the font-use indicator FATTR_FONTUSE_OUTLINE, 
  8964. described on page Font-Use Indicators, you should set the maximum baseline 
  8965. extent to 0. Outline fonts take an equivalent value from the character cell 
  8966. attribute that is current when text is written to an output device. 
  8967.  
  8968. The maximum baseline extent value is required to select an image font and must 
  8969. be specified in world coordinates. For image fonts, this is the vertical height 
  8970. in world coordinates of character images in the font. This field must be 
  8971. specified when requesting an image font with GpiCreateLogFont. 
  8972.  
  8973. The maximum baseline extent measurement is shown in a previous figure. The 
  8974. maximum baseline extent in the FATTRS data structure is used for programming, 
  8975. unlike the maximum baseline extent in the FONTMETRICS data structure, which is 
  8976. only measurement as recommended by the font's designer. 
  8977.  
  8978.  
  8979. ΓòÉΓòÉΓòÉ 9.1.8.8. Average Character Width ΓòÉΓòÉΓòÉ
  8980.  
  8981. The average character width of a font is the average character increment in 
  8982. world coordinates. The character increment is the sum of the a-space, b-space, 
  8983. and c-space of a character, which is shown in the previous figure. If you are 
  8984. setting the font-use indicator FATTR_FONTUSE_OUTLINE, you can set the average 
  8985. character width to 0 because the outline fonts take an equivalent value from 
  8986. the character cell attribute that is current when text is written to an output 
  8987. device. 
  8988.  
  8989. This field should be specified when requesting an image font using 
  8990. GpiCreateLogFont; it must be specified in world coordinates. 
  8991.  
  8992.  
  8993. ΓòÉΓòÉΓòÉ 9.1.8.9. Type Indicator ΓòÉΓòÉΓòÉ
  8994.  
  8995. PM provides a type indicator to allow the further specification of font most 
  8996. appropriate to your application. The type indicators found in the FATTR data 
  8997. structure are not interchangeable with the type indicators in the FONTMETRICS 
  8998. data structure. 
  8999.  
  9000. The most commonly used type indicator, FATTR_TYPE_KERNING, causes kerning to 
  9001. take effect for those fonts that contain kerning-pair information. 
  9002. FATTR_TYPE_KERNING is supported only for PostScript** devices. 
  9003.  
  9004. There are three other type indicators provided: 
  9005.  
  9006. Indicator                   When... 
  9007. FATTR_TYPE_ANTIALIASED      An anti-aliased font is required 
  9008. FATTR_TYPE_MBCS             A mixed single- or double-byte code page is 
  9009.                             required 
  9010. FATTR_TYPE_DBCS             A double-byte code page is required. 
  9011.  
  9012. Refer to the Presentation Manager Programming Reference for details about these 
  9013. type indicators. 
  9014.  
  9015.  
  9016. ΓòÉΓòÉΓòÉ 9.1.8.10. Font-Use Indicators ΓòÉΓòÉΓòÉ
  9017.  
  9018. The font-use indicators tell the PM programming interface what you intend to do 
  9019. with the font, and determine whether you get an image font or an outline font. 
  9020. There are three font-use indicators: 
  9021.  
  9022. Indicator                   If set ON... 
  9023.  
  9024. FATTR_FONTUSE_OUTLINE       Forces selection of an outline font. This value 
  9025.                             must be set if you intend to use graphics 
  9026.                             characters in a path definition. 
  9027.  
  9028. FATTR_FONTUSE_TRANSFORMABLE Allows the scaling, rotating, or shearing of font 
  9029.                             characters. Set this value ON if the current 
  9030.                             character mode is CM_MODE3. 
  9031.  
  9032. FATTR_FONTUSE_NOMIX         Allows the PM programming interface to ignore 
  9033.                             current mix-mode values. Set this value ON if the 
  9034.                             graphics text is not going to be written over or 
  9035.                             underneath other graphics, because it improves the 
  9036.                             performance of text drawing. 
  9037.  
  9038. FATTR_FONTUSE_TRANSFORMABLE and FATTR_FONTUSE_OUTLINE normally are both 
  9039. specified to select an outline font. Specify neither if you want to select an 
  9040. image font. 
  9041.  
  9042.  
  9043. ΓòÉΓòÉΓòÉ 9.1.9. Public and Private Fonts ΓòÉΓòÉΓòÉ
  9044.  
  9045. The fonts supplied by PM are loaded automatically when the system is started 
  9046. and are available to any application at any time. They are said to be public 
  9047. fonts. Any font that you define locally has to be loaded before you can use it. 
  9048. If you load a locally defined font using the Install option of the Workplace 
  9049. Font Palette, that font is available to any application in the system, and, 
  9050. therefore is a public font. Some devices provide their own fonts. All device 
  9051. fonts are public fonts. 
  9052.  
  9053. Any font loaded using GpiLoadFonts from within an application is a private 
  9054. font. A private font is available only to the application that loads it. The 
  9055. file in which you store a locally created font definition can contain more than 
  9056. one font definition. GpiLoadFonts loads a named font file and, therefore, loads 
  9057. all fonts defined in that file. GpiQueryFontFileDescriptions provides the 
  9058. family name and the face name of each font in a locally defined font file; use 
  9059. this function to determine if a particular file contains the font you want to 
  9060. use before you load it. 
  9061.  
  9062. To unload a previously loaded private font file, call GpiUnloadFonts. You 
  9063. cannot unload public fonts with this function. 
  9064.  
  9065. You cannot use private fonts in a document that you want to print using the 
  9066. spooler. If you want to print the document from a printer server, using the 
  9067. PM_Q_STD format, all the fonts used in the document must be installed as public 
  9068. fonts on the server. 
  9069.  
  9070. You can use either public or private fonts if you specify the data format 
  9071. PM_Q_RAW or if you want to print without the spooler. 
  9072.  
  9073.  
  9074. ΓòÉΓòÉΓòÉ 9.1.10. Drawing a Character String Primitive ΓòÉΓòÉΓòÉ
  9075.  
  9076. To draw a string of one or more graphics characters from the current font, call 
  9077. GpiCharString. The string starts at the current position and, when it has been 
  9078. drawn, the new current position is the point at which the next character would 
  9079. be, had there been one. 
  9080.  
  9081. To draw the string starting at a position other than the current position, call 
  9082. GpiCharStringAt. This is equivalent to calling GpiSetCurrentPosition or 
  9083. GpiMove, followed by GpiCharString. You supply the text of the character string 
  9084. as a parameter to the appropriate GPI function. 
  9085.  
  9086. Note:  You also can call WinDrawText, which draws text to the screen a line at 
  9087.        a time. WinDrawText differs from the GpiCharStringxxx functions in that 
  9088.        WinDrawText ignores the DM_RETAIN drawing mode and can only be used to 
  9089.        draw to a window device context. 
  9090.  
  9091. The following figure shows some examples of a character string primitive. 
  9092.  
  9093. The Character String Primitive 
  9094.  
  9095. This example shows the string Presentation Manager drawn from different logical 
  9096. fonts. 
  9097.  
  9098.  
  9099. ΓòÉΓòÉΓòÉ 9.1.11. Font Files and Dynamic-Link Libraries ΓòÉΓòÉΓòÉ
  9100.  
  9101. You can use the Font Editor to alter and customize image-font files. Files 
  9102. created with Font Editor have a .FNT extension. After you create a custom font, 
  9103. put it into a dynamic-link library (DLL) that the application can load. Once 
  9104. the application loads this library, it can use any of the custom fonts the 
  9105. library contains. 
  9106.  
  9107. DLLs that contain fonts are unique; they contain data segments and empty (or 
  9108. useless) code segments. They are unique because they contain no executable 
  9109. code, unlike normal DLLs. Also you are able to install the font file as a 
  9110. public font if desired; GpiLoadFonts will make it available only as a private 
  9111. font. The operating system naming convention for a DLL that contains font 
  9112. information end with a .FON extension. 
  9113.  
  9114. To create a DLL, you must use an assembler, a linker, and the operating system 
  9115. Resource Compiler. For this example, assume that your custom font file is named 
  9116. NEWFONT.FNT. 
  9117.  
  9118. After creating your custom font file, you need to create a special assembler 
  9119. language file with your editor. Call this file MYFONT.ASM, for example. The 
  9120. following figure shows an example of the source code for this file. 
  9121.  
  9122.  
  9123.    code segment word      ;Makes dummy code segment aligned on word boundary
  9124.    db "empty_segment"     ;Initializes a string in dummy segment
  9125.    code ends              ;Dummy segment ends here
  9126.    end                    ;Terminates source file
  9127.  
  9128. Creating a Custom Font 
  9129.  
  9130. After you have created MYFONT.ASM, assemble it by using the following command: 
  9131.  
  9132.     masm myfont
  9133.  
  9134. After assembling the MYFONT.ASM file, create a module-definition file. Call 
  9135. this file MYFONT.DEF, for example. It should contain the statements in the 
  9136. following figure. 
  9137.  
  9138.  
  9139.     LIBRARY myfont
  9140.     SEGMENTS CODE MOVEABLE
  9141.  
  9142. Module Definition File for Custom Font File 
  9143.  
  9144. The first statement tells the linker that you are creating a library with the 
  9145. module name, MYFONT. The second statement tells the linker that the segments in 
  9146. this library are movable code segments. 
  9147.  
  9148. After creating MYFONT.DEF, start the linker with the command in the following 
  9149. figure. 
  9150.  
  9151.     link myfont,,,,myfont.def
  9152.  
  9153. Linking a Custom Font File 
  9154.  
  9155. This command creates an empty executable file called MYFONT.EXE. 
  9156.  
  9157. After creating the empty executable file, which is the template for a DLL, 
  9158. create a resource file and call it MYFONT.RC. For example, if your font file is 
  9159. called NEWFONT.FNT, you would place the statement in the following figure in 
  9160. MYFONT.RC. 
  9161.  
  9162.     FONT    200     NEWFONT.FNT
  9163.  
  9164. Resource for Custom Font File 
  9165.  
  9166. This statement assigns the identifier, 200, to the font resource NEWFONT.FNT. 
  9167.  
  9168. Finally, use the Resource Compiler to add the font file (NEWFONT.FNT) to the 
  9169. empty DLL as in the following figure. 
  9170.  
  9171.     rc  myfont.rc
  9172.  
  9173. Creating the Resource File for a Custom Font File 
  9174.  
  9175. The executable file, MYFONT.EXE, now contains your custom fonts. After you have 
  9176. renamed this file, MYFONT.FON, you can load the fonts into your application 
  9177. using GpiLoadFonts and pass it a pointer to the path and library name as the 
  9178. second argument-for example, c:\os2\dll\myfont.fon. 
  9179.  
  9180.  
  9181. ΓòÉΓòÉΓòÉ 9.2. Using Fonts ΓòÉΓòÉΓòÉ
  9182.  
  9183. You can use the font functions to: 
  9184.  
  9185. o Determine the characteristics of available fonts 
  9186. o Select a font for text output 
  9187. o Delete or unload a font when finished 
  9188. o Create a font 
  9189. o Create marker sets and pattern sets 
  9190. o Use a bit map as a fill pattern 
  9191. o Use a clip path as a fill pattern. 
  9192.  
  9193.  
  9194. ΓòÉΓòÉΓòÉ 9.2.1. Selecting a Font ΓòÉΓòÉΓòÉ
  9195.  
  9196. Every presentation space has a current font, and graphics characters must be 
  9197. drawn in that font. By default, the current font is the system font. Before an 
  9198. application can use any font other than the system font, it has to identify the 
  9199. other font as the new current font. 
  9200.  
  9201. There are 2 distinct ways to identify the other font: 
  9202.  
  9203. o Call GpiQueryFonts to request information about the available physical fonts, 
  9204.   and then explicitly select one of those fonts by supplying its identifier as 
  9205.   input to GpiCreateLogFont. 
  9206.  
  9207.   This process has 11 steps and is described in Explicit Font Selection. This 
  9208.   method of selecting a font is most useful for selecting image fonts. 
  9209.  
  9210.   If you must have an image font, you are urged to use this "explicit 
  9211.   selection"method, because you need to specify a maximum baseline extent and 
  9212.   an average character width in the FATTRS structure. These values can be 
  9213.   determined only by calling GpiQueryFonts. If you specify values that are not 
  9214.   valid, you are likely to be given an outline font. 
  9215.  
  9216. o Use GpiCreateLogFont to specify the features you require in a font, and 
  9217.   permit the PM programming interface to make an appropriate font available to 
  9218.   you. 
  9219.  
  9220.   This process has 2 steps and is detailed in Closest-Matching Font Selection. 
  9221.  
  9222.  
  9223. ΓòÉΓòÉΓòÉ 9.2.1.1. Explicit Font Selection ΓòÉΓòÉΓòÉ
  9224.  
  9225. An application can select either a public or a private font with 
  9226. GpiCreateLogFont.  A public font is available to all applications. A private 
  9227. font is loaded by an application for its exclusive use. 
  9228.  
  9229. Use the PM Control Panel to load a public font. Four DLLs contain the Times 
  9230. Roman, Helvetica, Courier, and System Monospaced image fonts. The names of 
  9231. these libraries are: 
  9232.  
  9233. o TIMES.FON 
  9234. o HELV.FON 
  9235. o COURIER.FON 
  9236. o SYSMONO.FON. 
  9237.  
  9238. Unlike most DLLs, font libraries typically use the file name extension .FON. If 
  9239. the user loads all four libraries, a total of 76 public fonts are available. 
  9240. An application can use both outline and image formats of these fonts. 
  9241. Characters in the image format are available in sizes ranging from 8 to 24 
  9242. points.  Characters in the outline format can be any size. 
  9243.  
  9244. Call GpiLoadFont to load a private font.  Pass the function the path and name 
  9245. of the DLL that contains the font.  After the application loads the DLL of 
  9246. fonts, it can determine the characteristics of the fonts in that library by 
  9247. calling GpiQueryFonts. 
  9248.  
  9249. To select a public font from all of the available public fonts, do the 
  9250. following: 
  9251.  
  9252.  1. Call GpiQueryFonts, passing the QF_PUBLIC flag, a NULL pointer to the 
  9253.     font's face name, and a count of 0 to determine the number of available 
  9254.     public fonts, as shown in the following figure. 
  9255.  
  9256.         #define INCL_GPILCIDS
  9257.         #include <os2.h>
  9258.         void fncFONT06(void){
  9259.  
  9260.             FONTMETRICS fm, afm[80];
  9261.             LONG cFonts = 0, cPublicFonts;
  9262.             HPS hps;
  9263.  
  9264.             cPublicFonts = GpiQueryFonts(hps,      /* Queries all public fonts */
  9265.             QF_PUBLIC,
  9266.             (PSZ) NULL,
  9267.             &cFonts,
  9268.             sizeof(fm),
  9269.             (PFONTMETRICS) NULL);
  9270.         } /* fncFONT06 */
  9271.  
  9272.     Determining the Number of Public Fonts Loaded 
  9273.  
  9274.     Note:  To load and use a private font, follow the same procedure, but 
  9275.            specify QF_PRIVATE, instead of QF_PUBLIC, in the calls to 
  9276.            GpiQueryFonts. 
  9277.  
  9278.  2. Copy the value returned by GpiQueryFonts into a LONG integer variable. 
  9279.  
  9280.  3. Allocate memory for the FONTMETRICS data structures. 
  9281.  
  9282.  4. Call GpiQueryFonts again, passing the QF_PUBLIC flag, a NULL pointer to the 
  9283.     font's face name, the count returned by the previous call, and the address 
  9284.     of an array of FONTMETRICS structures. 
  9285.  
  9286.     GpiQueryFonts returns the font metrics of every font available the array of 
  9287.     FONTMETRICS structures.  The font metrics define in detail the physical 
  9288.     characteristics of a font and are described in the Presentation Manager 
  9289.     Programming Reference. 
  9290.  
  9291.     Because the font metrics are so detailed, the amount of information 
  9292.     returned to you from GpiQueryFonts can be extensive.  You can restrict the 
  9293.     amount of information returned by this function by: 
  9294.  
  9295.    o Specifying an absolute number of fonts about which you require information 
  9296.    o Asking for information about fonts of a specific face name only 
  9297.    o Limiting the length of the font-metrics buffer. 
  9298.  
  9299.     If you request information for more fonts than are available on the system, 
  9300.     GpiQueryFonts returns all the information about the available fonts and a 
  9301.     value indicating how many fonts it has returned. 
  9302.  
  9303.     If you request information for fewer fonts than are available on the system 
  9304.     (that match the specified face name, and so forth), GpiQueryFonts returns a 
  9305.     value indicating the number of fonts that it was unable to return. 
  9306.  
  9307.     The following figure is an example of this technique of selecting a font. 
  9308.  
  9309.         #define INCL_GPILCIDS
  9310.         #include <os2.h>
  9311.  
  9312.         PFONTMETRICS fncFONT07 (HPS hps, PLONG pcPublicFonts) {
  9313.            PFONTMETRICS afm = NULL;
  9314.            LONG         fonts = 1000;
  9315.  
  9316.            *pcPublicFonts = GpiQueryFonts(hps,
  9317.                                           QF_PUBLIC,
  9318.                                           (PSZ) NULL,
  9319.                                           &fonts,
  9320.                                           sizeof(*afm),
  9321.                                           (PFONTMETRICS) NULL);
  9322.  
  9323.            if (!DosAllocMem(&afm,
  9324.                             sizeof(*afm)*(*pcPublicFonts),
  9325.                             PAG_COMMIT | PAGWRITE )) {
  9326.                GpiQueryFonts(hps,
  9327.                             QF_PUBLIC,
  9328.                             (PSZ) NULL,
  9329.                             pcPublicFonts,
  9330.                             sizeof(*afm),
  9331.                             afm);
  9332.            } /* endif */
  9333.            return afm;
  9334.         }
  9335.  
  9336.     Selecting a Font 
  9337.  
  9338.  5. Examine the array of FONTMETRICS structures. 
  9339.  
  9340.     a. For an outline font, examine the face name and other attributes of the 
  9341.        font your application requires. 
  9342.  
  9343.     b. For an image font, examine the device resolution fields. These fields 
  9344.        are the ones that determine if a particular font and its metrics match 
  9345.        the device with which you wish to use it. 
  9346.  
  9347.     Note:  If your application is interactive, organize the face names and 
  9348.            other information relevant to those fonts (such as point sizes) in a 
  9349.            menu. When the operator has selected a font, supply the relevant 
  9350.            information from the font metrics of that font in the FATTRS 
  9351.            structure of GpiCreateLogFont. 
  9352.  
  9353.  6. After determining which font to use, your application must fill in the 
  9354.     fields of the FATTRS structure.  Some of the data for these fields will be 
  9355.     copied (explicitly) from the FONTMETRICS structure. Then call 
  9356.     GpiCreateLogFont. 
  9357.  
  9358.     If you do not supply a face name, the default font is used.  If you supply 
  9359.     a face name, and the presentation driver cannot find a matching font, a 
  9360.     default font is selected. 
  9361.  
  9362.     The FATTRS structure describes a logical font. An application can have up 
  9363.     to 254 logical fonts defined at any one time in a single presentation 
  9364.     space. 
  9365.  
  9366.     Note:  A logical font is a list of font attributes, whereas a physical font 
  9367.            is the bit-map or vector information that the system uses to draw 
  9368.            characters. 
  9369.  
  9370.  7. The fonts supplied by the PM programming interface, the fonts you load 
  9371.     using the Control Panel, and any fonts you load with GpiLoadFonts are all 
  9372.     physical fonts. 
  9373.  
  9374.     Copying the entries in the FATTRS structure ensures that, if a particular 
  9375.     font is unavailable, an attempt is made to find the most suitable 
  9376.     substitute.  Without the FATTRS information, PM is less likely to locate a 
  9377.     suitable font. 
  9378.  
  9379.  8. Initialize a local identifier (lcid) for the new font. 
  9380.  
  9381.  9. Call GpiCreateLogFont and pass as input parameters: 
  9382.  
  9383.    o The lcid for the font 
  9384.  
  9385.    o The address of an 8-character array containing the name you want to give 
  9386.      to the logical font, (or, if you do not want to specify a name, the value 
  9387.      NULL) 
  9388.  
  9389.    o The address of the FATTRS structure. 
  9390.  
  9391. 10. Examine the return value from GpiCreateLogFont. The value will be 2 if the 
  9392.     function is successful; 1, if the default font was used. 
  9393.  
  9394. 11. Pass the lcid to GpiSetCharSet, assigning the font to your application's 
  9395.     presentation space. Then the application can use it for text output. (This 
  9396.     step identifies a logical font as the current font.) 
  9397.  
  9398. The following figure shows how to select an image font at least 14 device 
  9399. coordinate units high. 
  9400.  
  9401. #define INCL_GPILCIDS
  9402. #include <os2.h>
  9403.  
  9404. LONG fncFONT08(HPS hps, LONG lcid, LONG xres, LONG yres) {
  9405.    FATTRS       fat;
  9406.    PFONTMETRICS afm;
  9407.    LONG         cFonts;
  9408.    LONG         i;
  9409.    LONG         rc = 0;
  9410.  
  9411.    afm = fncFONT07(hps, &cfonts);
  9412.    if (amf) {
  9413.       for (i=0; 1<cfonts; i++) {
  9414.          if (!(afm[i].fsDefn & FM_DEFN_OUTLINE)
  9415.             afm[i].sXDeviceRes == xres &&
  9416.             afm[i].sYDeviceRes == yres &&
  9417.             afm[i].lMaxBaselineExt >= 14)  {
  9418.            fat.usRecordLength = sizeof(fat);
  9419.            fat.fsSelection = 0;
  9420.            fat.lMatch = 0;
  9421.            strcpy(fat.szFacename, afm[i].szFacename);
  9422.            fat.idRegistry = afm[i].idRegistry;
  9423.            fat.usCodePage = 0;
  9424.            fat.lMaxBaselineExt = afm[i].lMaxBaselineExt;
  9425.            fat.lAveCharWidth = afm[i].lAveCharWidth;
  9426.            fat.fsType = 0;
  9427.            fat.fsFontUse = 0;
  9428.  
  9429.            rc = GpiCreateLogFont(hps, (PSTR8) NULL, lcid, &fat);
  9430.            if (rc) {
  9431.               GpiSetCharSet(hps, lcid);
  9432.            } /* endif */
  9433.         } /* endfor */
  9434.  
  9435.      } /* endif */
  9436.  
  9437.      return rc;
  9438. }
  9439.  
  9440. Selecting an Image Font 
  9441.  
  9442. GpiQueryFonts returns device coordinates for image fonts. For outline fonts, it 
  9443. returns notional coordinates. Notional coordinates are the coordinate in which 
  9444. the font was defined.  Usually outline fonts are defined over a 1000-by-1000 
  9445. matrix, with the unit of the matrix a 1/1000 of the em height. 
  9446.  
  9447.  
  9448. ΓòÉΓòÉΓòÉ 9.2.1.2. Reassociating the Presentation Space ΓòÉΓòÉΓòÉ
  9449.  
  9450. The match value of any device font is guaranteed to be unique only for the 
  9451. current device. If you associate the presentation space with a different device 
  9452. context, any logical fonts that also are device fonts are no longer available. 
  9453. On the new device, the match number could identify a different device font 
  9454. (which may not be suitable) or no font at all. Therefore, you should redefine a 
  9455. logical font and select it as the current font if you reassociate the 
  9456. presentation space when the current font is a device font. Otherwise, the 
  9457. default font is used. 
  9458.  
  9459. If you do not intend to use the font on the new device, however, you need not 
  9460. redefine it. You will be able to continue using the font if you reassociate the 
  9461. presentation space with the original device context. 
  9462.  
  9463. Any generic fonts can continue to be used after the presentation space is 
  9464. reassociated if they are suitable for the new device. An image font, for 
  9465. example, can be used only on devices that are all-points addressable. 
  9466.  
  9467.  
  9468. ΓòÉΓòÉΓòÉ 9.2.1.3. Font Resolution ΓòÉΓòÉΓòÉ
  9469.  
  9470. Device fonts, particularly printer fonts, usually are designed for a specific 
  9471. resolution, namely the resolution of the device on which they are to be used. 
  9472. By contrast, generic outline fonts are not device-specific. Generic image fonts 
  9473. are designed for a particular resolution value and, therefore, are really 
  9474. applicable only to devices with a matching resolution value. 
  9475.  
  9476. The horizontal and vertical font resolution values for the device are returned 
  9477. by DevQueryCaps. The desired horizontal and vertical device resolution values 
  9478. in the font metrics of the font concerned are returned by GpiQueryFonts. 
  9479. Compare these the device and the desired resolution values only for an image 
  9480. font. If they are identical then this image font is designed for use with this 
  9481. device (for example, the point size in the font metrics will be accurate for 
  9482. this device). To select a font, do the following: 
  9483.  
  9484.  1. Query the available fonts using GpiQueryFonts. 
  9485.  
  9486.  2. If you want an outline font, search the metrics of fonts returned by 
  9487.     GpiQueryFonts for a font that is an outline font and that has the required 
  9488.     face name. 
  9489.  
  9490.  3. If you want an image font, search the metrics of the fonts returned by 
  9491.     GpiQueryFonts for a font that is an image font and that has the following: 
  9492.  
  9493.    o Required face name 
  9494.    o Required point size 
  9495.    o Horizontal device resolution font metric that matches the horizontal 
  9496.      resolution for the device 
  9497.    o Vertical device resolution font metric that matches the vertical 
  9498.      resolution for the device. 
  9499.  
  9500.  4. As an alternative to the above for an image font, search the metrics of the 
  9501.     fonts returned by GpiQueryFonts for a font that is an image font and that 
  9502.     has the following: 
  9503.  
  9504.    o Required face name 
  9505.    o Required em height in world coordinates. 
  9506.  
  9507. Before you define a logical font, determine the resolution of the current 
  9508. device by using DevQueryCaps with the CAPS_VERTICAL_FONT_RES and 
  9509. CAPS_HORIZONTAL_FONT_RES parameters. 
  9510.  
  9511. Compare the values returned from this function with the xDeviceRes and 
  9512. yDeviceRes values in the font metrics of the available fonts. These 2 values 
  9513. contain the resolution of the device for which the font was designed. All 
  9514. measurements are in pels per inch. By comparing the font resolution with the 
  9515. device resolution, you can identify the image font best suited to the current 
  9516. device. 
  9517.  
  9518.  
  9519. ΓòÉΓòÉΓòÉ 9.2.1.4. Closest-Matching Font Selection ΓòÉΓòÉΓòÉ
  9520.  
  9521. The alternative to selecting a specific font is to set the match value to 0. 
  9522. To have the PM programming interface select the closest-matching font 
  9523. available, do the following: 
  9524.  
  9525.  1. Define a logical font with GpiCreateLogFont. This function establishes a 
  9526.     link between the calling application and an appropriate physical font. 
  9527.     GpiCreateLogFont accepts a number of options as input, including the font 
  9528.     attributes, which describe the physical features and capabilities of the 
  9529.     font. 
  9530.  
  9531.  2. Complete the FATTRS structure of GpiCreateLogFont. The FATTRS structure 
  9532.     describes a logical font, which the system uses to find the closest 
  9533.     matching physical font.  Depending on whether you are selecting a font 
  9534.     using a match number, fill in the FATTRS structure, observing the rules 
  9535.     listed in the following table. 
  9536.  
  9537.     Filling in the FATTRS Structure 
  9538.  
  9539.         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9540.         ΓöéIf using a match number       ΓöéIf not using a match number   Γöé
  9541.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9542.         ΓöéSet the match number to the   ΓöéSet the match number to zero. Γöé
  9543.         Γöérequired FONTMETRICS value.   Γöé                              Γöé
  9544.         ΓöéThe FONTMETRICS value is the  ΓöéIf your font is an image font:Γöé
  9545.         Γöévalue in the FONTMETRICS      Γöé                              Γöé
  9546.         Γöéstructure for the required    ΓöéSet the maximum baseline      Γöé
  9547.         Γöéfont returned by              Γöéextent to the required        Γöé
  9548.         ΓöéGpiQueryFonts.                ΓöéFONTMETRICS value.            Γöé
  9549.         Γöé                              Γöé                              Γöé
  9550.         ΓöéSet the maximum baseline      ΓöéSet the average character     Γöé
  9551.         Γöéextent to zero.               Γöéwidth to the required         Γöé
  9552.         Γöé                              ΓöéFONTMETRICS value.            Γöé
  9553.         ΓöéSet the average character     Γöé                              Γöé
  9554.         Γöéwidth to zero.                Γöé                              Γöé
  9555.         Γöé                              Γöé                              Γöé
  9556.         ΓöéNote:  A negative lMatch is   Γöé                              Γöé
  9557.         Γöéonly unique for a device. A   Γöé                              Γöé
  9558.         Γöépositive lMatch is only uniqueΓöé                              Γöé
  9559.         Γöéon a particular system at a   Γöé                              Γöé
  9560.         Γöéparticular time.              Γöé                              Γöé
  9561.         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9562.  
  9563.     Also observe the rules concerning the font-use indicator that are listed in 
  9564.     the following table. 
  9565.  
  9566.     Font-Use Indicator Considerations 
  9567.  
  9568.         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9569.         ΓöéIf you have not set the       ΓöéIf you have set the           Γöé
  9570.         ΓöéFATTR_FONTUSE_OUTLINE         ΓöéFATTR_FONTUSE_OUTLINE         Γöé
  9571.         Γöéindicator:                    Γöéindicator:                    Γöé
  9572.         Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9573.         ΓöéPM looks for an image font    ΓöéPM looks for a suitable       Γöé
  9574.         Γöéthat has the required         Γöéoutline font whose selection  Γöé
  9575.         Γöéselection indicators and whoseΓöéindicators match those you    Γöé
  9576.         Γöémaximum baseline extent and   Γöéhave specified.               Γöé
  9577.         Γöéaverage character width match Γöé                              Γöé
  9578.         Γöéthose you have specified.     ΓöéIf no suitable outline font isΓöé
  9579.         Γöé                              Γöéfound, the default font is    Γöé
  9580.         ΓöéIf no suitable image font is  Γöéused. No attempt is made to   Γöé
  9581.         Γöéfound, PM looks for an outlineΓöésubstitute an image font.     Γöé
  9582.         Γöéfont with the required face   Γöé                              Γöé
  9583.         Γöéname and selection indicators.Γöé                              Γöé
  9584.         Γöé                              Γöé                              Γöé
  9585.         ΓöéIf no suitable outline font isΓöé                              Γöé
  9586.         Γöéfound, the default font is    Γöé                              Γöé
  9587.         Γöémade available to you.        Γöé                              Γöé
  9588.         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9589.  
  9590. Outline fonts are affected by the current character attributes (for example, 
  9591. character box, shear, and angle).  Because an outline font might be made 
  9592. available to you, even when you requested an image font, call 
  9593. GpiQueryFontMetrics to determine whether the font is an image font or an 
  9594. outline font.  GpiQueryFontMetrics returns the metrics of the current logical 
  9595. font in world coordinates. 
  9596.  
  9597. The settings of the definition indicator, field defn in the font metrics, tell 
  9598. you whether the font is either an image or outline font, or a device or generic 
  9599. font. If the font is an outline font, specify values for the character 
  9600. attributes before using the font.  Outline fonts are unaffected by the maximum 
  9601. baseline extent and average character width values specified in 
  9602. GpiCreateLogFont. 
  9603.  
  9604. If the default font provided is an image font, and you also have specified 
  9605. FATTR_FONTUSE_TRANSFORMABLE, any attempt to draw graphics characters in 
  9606. CM_MODE3 raises an error condition. This is an exception to the general rule 
  9607. that a FATTR_FONTUSE_TRANSFORMABLE font must be used in CM_MODE3 only. 
  9608.  
  9609.  
  9610. ΓòÉΓòÉΓòÉ 9.2.2. Selecting the New Current Font ΓòÉΓòÉΓòÉ
  9611.  
  9612. In addition to completing the FATTRS structure, you must supply as input to 
  9613. GpiCreateLogFont a unique lcid for the font.  The identifier is a number in the 
  9614. range of 1 through 254. Because you can have more than one logical font 
  9615. definition in a presentation space, you must select the current font by 
  9616. supplying the font's lcid as input to GpiSetCharSet. 
  9617.  
  9618. You do not have to call GpiSetCharSet to use the default font. When you want to 
  9619. reset the current font to its default value, however, call GpiSetCharSet with 
  9620. the value LCID_DEFAULT. The current font, like other modal attributes, reverts 
  9621. automatically to its default value when specific GPI functions are called. 
  9622.  
  9623.  
  9624. ΓòÉΓòÉΓòÉ 9.2.3. Deleting Logical Fonts and Unloading Physical Fonts ΓòÉΓòÉΓòÉ
  9625.  
  9626. A logical font can be used only by the application that defines it. The logical 
  9627. font definition is stored in the presentation space and is saved on the LIFO 
  9628. stack with its lcid when GpiSavePS is called. Unlike a physical font 
  9629. definition, a logical font definition is temporary and is lost when the 
  9630. presentation space is deleted. 
  9631.  
  9632. To specifically delete a logical font, call GpiDeleteSetId, which deletes the 
  9633. logical font, and makes its lcid available for reuse. Sometimes this is 
  9634. necessary because there are only 255 lcids available. The logical font must not 
  9635. be the current font when you call GpiDeleteSetId. 
  9636.  
  9637. Logical fonts are deleted to release the lcid and free memory. Unload private 
  9638. fonts using GpiUnloadFonts to free memory and to make them no longer available. 
  9639. Uninstall public fonts using the Control Panel to free memory and to make them 
  9640. no longer available. 
  9641.  
  9642. You must end the association between physical and logical fonts before calling 
  9643. GpiUnloadFonts. 
  9644.  
  9645. If you call GpiUnloadFonts to unload a private font file, you must end the 
  9646. association between the physical fonts in that file and the logical fonts 
  9647. defined by the application. Do the following: 
  9648.  
  9649. o Call GpiSetCharSet to select a current font (such as the default font) that 
  9650.   is not linked to the physical fonts you are unloading 
  9651.  
  9652. o Call GpiDeleteSetId to delete each logical font that refers to any of the 
  9653.   physical fonts in the font resource-file. If you fail to do this, an error is 
  9654.   returned to your application from GpiUnloadFonts. 
  9655.  
  9656.  
  9657. ΓòÉΓòÉΓòÉ 9.2.4. Creating Fonts ΓòÉΓòÉΓòÉ
  9658.  
  9659. You cannot edit the definitions of any of the PM-provided fonts, although you 
  9660. can create and edit image-font files using the Font Editor. A font file 
  9661. contains a header, that describes the font in general terms and a section 
  9662. containing bit maps of the characters themselves. The font definition is stored 
  9663. in a resource file. A full description of the font-file format is provided in 
  9664. the Presentation Manager Programming Reference. 
  9665.  
  9666.  
  9667. ΓòÉΓòÉΓòÉ 9.2.5. Creating Marker Sets and Pattern Sets ΓòÉΓòÉΓòÉ
  9668.  
  9669. Like character sets, marker sets and pattern sets are defined in fonts. For 
  9670. both marker sets and pattern sets, there are system-provided defaults. You also 
  9671. can create your own image markers or patterns, but not outline markers or 
  9672. patterns, using the Font Editor. The font definition containing the image or 
  9673. pattern can be loaded either as a public font (using the Install selection from 
  9674. the Control Panel) or as a private font (using GpiLoadFonts). The current 
  9675. character mode has no effect on marker sets and pattern sets. Any character 
  9676. from a font can be used as a marker or as an area-fill pattern. 
  9677.  
  9678. Before you can use a locally defined marker set or pattern set, you must call 
  9679. GpiCreateLogFont to define a logical font and to give it an lcid, just as you 
  9680. would for a character font. Most of the values you can specify with 
  9681. GpiCreateLogFont are not applicable to marker sets and pattern sets. 
  9682. Furthermore, in the instance of marker sets and pattern sets, you usually know 
  9683. that you want to use a particular font. 
  9684.  
  9685. To select a locally defined marker set or pattern set: 
  9686.  
  9687.  1. Call GpiQueryFonts to obtain a match value for the font. 
  9688.  
  9689.  2. Call GpiCreateLogFont, specifying the face name, match value, and lcid for 
  9690.     the font. 
  9691.  
  9692.  3. Select the logical font as the current marker set or pattern set by calling 
  9693.     GpiSetMarkerSet or GpiSetPatternSet, as appropriate. 
  9694.  
  9695. To revert to using the default pattern or marker sets, call GpiSetPatternSet or 
  9696. GpiSetMarkerSet with the value LCID_DEFAULT. 
  9697.  
  9698.  
  9699. ΓòÉΓòÉΓòÉ 9.2.6. Using Bit Maps as Area-Fill Patterns ΓòÉΓòÉΓòÉ
  9700.  
  9701. An alternative to using the Font Editor to create your own pattern sets is to 
  9702. use a bit map as an area-fill pattern. You must call GpiSetBitmapId to give the 
  9703. bit map an lcid, and then call GpiSetPatternSet, specifying the lcid of the bit 
  9704. map. The bit map becomes a pattern set containing one pattern, and the current 
  9705. pattern-symbol attribute is ignored. GpiQueryBitmapHandle returns the handle of 
  9706. the bit map currently known by the lcid that you supply as input. 
  9707.  
  9708. PM cannot distinguish among the lcids associated with a particular presentation 
  9709. space. Any lcid can identify a character set, marker set, pattern set, or bit 
  9710. map (that is being used as an area-fill pattern). For example, if you call 
  9711. GpiQueryNumberSetIds to determine how many lcids are currently assigned in the 
  9712. presentation space, the number returned to you includes all logical fonts 
  9713. defined for this presentation space. You also can use GpiDeleteSetId to remove 
  9714. lcids associated with the non-font entities. If you call this function to 
  9715. delete a bit map that is being used as an area-fill pattern, the bit map itself 
  9716. is not deleted; however, it is disassociated from its lcid, and the lcid can be 
  9717. reused. 
  9718.  
  9719.  
  9720. ΓòÉΓòÉΓòÉ 9.2.7. Using Paths with Fill Patterns ΓòÉΓòÉΓòÉ
  9721.  
  9722. Using paths lets you fill a character string with a complicated or nonrepeating 
  9723. pattern. The following sequence is recommended: 
  9724.  
  9725. o Select the required outline font, and set the required character attributes. 
  9726. o Create a path by calling GpiBeginPath, GpiCharString, and GpiEndPath. 
  9727. o Set the required pattern symbol and other AREABUNDLE pattern attributes. 
  9728. o Fill the path using GpiFillPath. 
  9729.  
  9730. The following figure provides an example of using paths with fill patterns to 
  9731. create characters. 
  9732.  
  9733. Using Clip Paths to Create Characters 
  9734.  
  9735.  
  9736. ΓòÉΓòÉΓòÉ 9.3. Summary ΓòÉΓòÉΓòÉ
  9737.  
  9738. The following table summarizes the font functions. 
  9739.  
  9740. Font Functions 
  9741.  
  9742. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9743. ΓöéFunction Names          ΓöéDescription                         Γöé
  9744. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9745. ΓöéGpiCharString           ΓöéDraws a character graphics string   Γöé
  9746. Γöé                        Γöéfrom the current font from the      Γöé
  9747. Γöé                        Γöécurrent position.                   Γöé
  9748. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9749. ΓöéGpiCharStringAt         ΓöéDraws a character graphics string   Γöé
  9750. Γöé                        Γöéfrom the current font from a        Γöé
  9751. Γöé                        Γöéspecified position.                 Γöé
  9752. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9753. ΓöéGpiCharStringPos        ΓöéDraws a character string with the   Γöé
  9754. Γöé                        Γöéfirst character at the current      Γöé
  9755. Γöé                        Γöéposition and permits positioning of Γöé
  9756. Γöé                        Γöéevery following character.          Γöé
  9757. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9758. ΓöéGpiCharStringPosAt      ΓöéDraws a character string and permitsΓöé
  9759. Γöé                        Γöépositioning for the first and every Γöé
  9760. Γöé                        Γöéfollowing character.                Γöé
  9761. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9762. ΓöéGpiCreateLogFont        ΓöéDefines a logical font with         Γöé
  9763. Γöé                        Γöéspecified font attributes.          Γöé
  9764. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9765. ΓöéGpiDeleteSetId          ΓöéDeletes a logical font.             Γöé
  9766. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9767. ΓöéGpiLoadFonts            ΓöéLoads a dynamic-link library        Γöé
  9768. Γöé                        Γöécontaining font resources and makes Γöé
  9769. Γöé                        Γöéthese available as private fonts.   Γöé
  9770. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9771. ΓöéGpiQueryCharBreakExtra  ΓöéDetermines the current character    Γöé
  9772. Γöé                        Γöébreak extra attribute.              Γöé
  9773. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9774. ΓöéGpiQueryCharExtra       ΓöéDetermines the current character    Γöé
  9775. Γöé                        Γöéextra attribute.                    Γöé
  9776. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9777. ΓöéGpiQueryCharSet         ΓöéDetermines the current character setΓöé
  9778. Γöé                        Γöéattribute.                          Γöé
  9779. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9780. ΓöéGpiQueryCharStringPos   ΓöéDetermines the position of each     Γöé
  9781. Γöé                        Γöécharacter for an equivalent         Γöé
  9782. Γöé                        ΓöéGpiCharStringPos without actually   Γöé
  9783. Γöé                        Γöédrawing any characters.             Γöé
  9784. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9785. ΓöéGpiQueryCharStringPosAt ΓöéDetermines the position at which    Γöé
  9786. Γöé                        Γöéeach character for an equivalent    Γöé
  9787. Γöé                        ΓöéGpiCharStringPosAt without actually Γöé
  9788. Γöé                        Γöédrawing any characters.             Γöé
  9789. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9790. ΓöéGpiQueryCp              ΓöéDetermines the current code page.   Γöé
  9791. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9792. ΓöéGpiQueryFaceString      ΓöéGenerates a compound face name for aΓöé
  9793. Γöé                        Γöéfont.                               Γöé
  9794. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9795. ΓöéGpiQueryFontAction      ΓöéDetermines if available fonts have  Γöé
  9796. Γöé                        Γöébeen affected since the last time   Γöé
  9797. Γöé                        Γöéthe function was called.            Γöé
  9798. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9799. ΓöéGpiQueryFontFileDescriptΓöéDetermines the family name and face Γöé
  9800. Γöé                        Γöéname of each font in the locally    Γöé
  9801. Γöé                        Γöédefined font file.                  Γöé
  9802. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9803. ΓöéGpiQueryFontMetrics     ΓöéDetermines the metric values of the Γöé
  9804. Γöé                        Γöécurrent font.                       Γöé
  9805. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9806. ΓöéGpiQueryFonts           ΓöéDetermines the font metrics of everyΓöé
  9807. Γöé                        Γöéfont available with a specified faceΓöé
  9808. Γöé                        Γöéname.                               Γöé
  9809. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9810. ΓöéGpiQueryKerningPairs    ΓöéDetermines kerning-pair information Γöé
  9811. Γöé                        Γöéfrom the current logical font.      Γöé
  9812. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9813. ΓöéGpiQueryLogicalFont     ΓöéDetermines the font attributes      Γöé
  9814. Γöé                        Γöé(FATTRS) of the specified or currentΓöé
  9815. Γöé                        Γöélogical font.                       Γöé
  9816. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9817. ΓöéGpiQueryNumberSetIds    ΓöéDetermines the number of lcids that Γöé
  9818. Γöé                        Γöéare currently assigned in the       Γöé
  9819. Γöé                        Γöépresentation space.                 Γöé
  9820. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9821. ΓöéGpiQuerySetIds          ΓöéDetermines the lcids currently      Γöé
  9822. Γöé                        Γöéassigned to logical fonts in the    Γöé
  9823. Γöé                        Γöéspecified presentation space.       Γöé
  9824. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9825. ΓöéGpiQueryTextBox         ΓöéDetermines the coordinates of the   Γöé
  9826. Γöé                        Γöécorners of a text box for an        Γöé
  9827. Γöé                        Γöéequivalent GpiCharStringPos without Γöé
  9828. Γöé                        Γöéactually drawing any characters.    Γöé
  9829. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9830. ΓöéGpiQueryWidthTable      ΓöéDetermines the width of all         Γöé
  9831. Γöé                        Γöécharacters in the current font.     Γöé
  9832. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9833. ΓöéGpiSetCharBreakExtra    ΓöéSets the current character break    Γöé
  9834. Γöé                        Γöéextra attribute.                    Γöé
  9835. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9836. ΓöéGpiSetCharExtra         ΓöéSets the current character extra    Γöé
  9837. Γöé                        Γöéattribute.                          Γöé
  9838. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9839. ΓöéGpiSetCharSet           ΓöéSets the current character set      Γöé
  9840. Γöé                        Γöéattribute.                          Γöé
  9841. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9842. ΓöéGpiSetCp                ΓöéAssigns a new code page.            Γöé
  9843. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9844. ΓöéGpiUnloadFonts          ΓöéUnloads a font file (private fonts).Γöé
  9845. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9846.  
  9847. The following table summarizes the data structures used by the font functions. 
  9848.  
  9849. Font Structures 
  9850.  
  9851. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9852. ΓöéStructure               ΓöéDescription                         Γöé
  9853. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9854. ΓöéCHARBUNDLE              ΓöéContains the character attributes.  Γöé
  9855. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9856. ΓöéFATTRS                  ΓöéContains the font attributes of the Γöé
  9857. Γöé                        Γöéspecified font named in             Γöé
  9858. Γöé                        ΓöéGpiCreateLogFont.                   Γöé
  9859. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9860. ΓöéFONTMETRICS             ΓöéContains all the font metrics       Γöé
  9861. Γöé                        Γöéreturned by the system to describe aΓöé
  9862. Γöé                        Γöéparticular font.                    Γöé
  9863. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9864.  
  9865.  
  9866. ΓòÉΓòÉΓòÉ 10. Paths ΓòÉΓòÉΓòÉ
  9867.  
  9868. A path is a graphics object composed of one or more figures drawn with graphic 
  9869. primitives.  A path can be used for defining a filled area, a complex clipping 
  9870. shape, an outline, and for drawing geometric wide lines. 
  9871.  
  9872. The following topics are related to the information in this chapter: 
  9873.  
  9874. o Presentation spaces 
  9875. o Device contexts 
  9876. o Line and arc primitives 
  9877. o Area primitives 
  9878. o Color and mix attributes 
  9879. o Regions 
  9880. o Clipping. 
  9881.  
  9882.  
  9883. ΓòÉΓòÉΓòÉ 10.1. About Paths ΓòÉΓòÉΓòÉ
  9884.  
  9885. Paths provide several useful drawing techniques including: 
  9886.  
  9887. o An alternate means of generating filled or outlined irregular figures and 
  9888.   nonrectangular shapes. 
  9889.  
  9890. o An efficient means of producing hollow text in an outline font. 
  9891.  
  9892. o The only means of clipping (restricting the area of interest of a picture) to 
  9893.   circular, elliptical, or other nonrectangular figures. 
  9894.  
  9895. o The only means of drawing lines with a thickness that can be transformed. 
  9896. These techniques are respectively illustrated in the following figure. 
  9897.  
  9898. Drawing Techniques Achieved with Paths 
  9899.  
  9900. A path is similar to an area, but there are fundamental differences between the 
  9901. two. The following table describes their similarities and contrasts. 
  9902.  
  9903. Comparison of Paths and Areas 
  9904.  
  9905. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9906. ΓöéPaths                         ΓöéAreas                         Γöé
  9907. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9908. ΓöéFunctions that define a path  ΓöéFunctions that define an area Γöé
  9909. Γöéare bracketed by GpiBeginPath Γöéare bracketed by GpiBeginArea Γöé
  9910. Γöéand GpiEndPath.               Γöéand GpiEndArea.               Γöé
  9911. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9912. ΓöéPaths are defined in world    ΓöéAreas are defined in world    Γöé
  9913. Γöécoordinates.                  Γöécoordinates.                  Γöé
  9914. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9915. ΓöéPaths can be modified before  ΓöéAreas are displayed           Γöé
  9916. Γöébeing displayed or used for   Γöéimmediately on completion.    Γöé
  9917. Γöéclipping.                     Γöé                              Γöé
  9918. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9919. ΓöéPaths can be used by          ΓöéAreas cannot be used as       Γöé
  9920. Γöéapplications to perform       Γöéclipping regions.             Γöé
  9921. Γöéclipping.                     Γöé                              Γöé
  9922. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9923. ΓöéPaths can be converted into   ΓöéAreas cannot be converted intoΓöé
  9924. Γöégraphics objects called       Γöéregions.                      Γöé
  9925. Γöéregions.                      Γöé                              Γöé
  9926. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9927. ΓöéSix operations can be         ΓöéOnly two operations can be    Γöé
  9928. Γöéperformed on paths, each      Γöéperformed on areas (specified Γöé
  9929. Γöérequiring a separate function:Γöéwith options when creating theΓöé
  9930. Γöé                              Γöéarea):                        Γöé
  9931. ΓöéOutline                       Γöé                              Γöé
  9932. ΓöéFill                          ΓöéOutline                       Γöé
  9933. ΓöéModify                        ΓöéFill                          Γöé
  9934. ΓöéStroke                        Γöé                              Γöé
  9935. ΓöéConvert to clip path          Γöé                              Γöé
  9936. ΓöéConvert to region             Γöé                              Γöé
  9937. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9938.  
  9939.  
  9940. ΓòÉΓòÉΓòÉ 10.1.1. Path Attributes ΓòÉΓòÉΓòÉ
  9941.  
  9942. Paths do not have a separate xxxBUNDLE data structure associated with them; 
  9943. their attributes are defined by LINEBUNDLE and AREABUNDLE.  As described in 
  9944. Attributes of Line and Arc Primitives however, there are certain line 
  9945. attributes that apply only to geometric lines, or lines created with some path 
  9946. operations. Depending on the purpose of a path, only certain path attributes 
  9947. are in effect. These and the other path attributes are described in this 
  9948. chapter. 
  9949.  
  9950. When an application creates a presentation space, the path attributes are set 
  9951. to the default values shown in the following table. 
  9952.  
  9953. Path Attribute Default Values 
  9954.  
  9955. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  9956. ΓöéAttribute       ΓöéDefault Value   ΓöéFunction that Redefines     Γöé
  9957. Γöé                Γöé                ΓöéAttribute                   Γöé
  9958. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9959. ΓöéGeometric width ΓöéNone            ΓöéGpiSetLineWidthGeom         Γöé
  9960. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9961. ΓöéEnd             ΓöéLINEEND_FLAT    ΓöéGpiSetLineEnd               Γöé
  9962. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9963. ΓöéJoin            ΓöéLINEJOIN_BEVEL  ΓöéGpiSetLineJoin              Γöé
  9964. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9965. ΓöéWidth           Γöé1.0             ΓöéGpiSetLineWidth             Γöé
  9966. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9967. ΓöéType            ΓöéLINETYPE_SOLID  ΓöéGpiSetLineType              Γöé
  9968. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9969. ΓöéColor           ΓöéCLR_NEUTRAL     ΓöéGpiSetAttrs (LBB_COLOR)     Γöé
  9970. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9971. ΓöéMix mode        ΓöéFM_OVERPAINT    ΓöéGpiSetAttrs (LBB_MIX_MODE)  Γöé
  9972. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9973. ΓöéPattern symbol  ΓöéSolid           ΓöéGpiSetPattern               Γöé
  9974. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9975. ΓöéPattern set     ΓöéLCID_DEFAULT    ΓöéGpiSetPatternSet            Γöé
  9976. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9977. ΓöéReference point Γöé(0,0)           ΓöéGpiSetPatternRefPoint       Γöé
  9978. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9979. ΓöéForeground colorΓöéCLR_NEUTRAL     ΓöéGpiSetAttrs (ABB_COLOR)     Γöé
  9980. Γöé                Γöé(black on most  Γöé                            Γöé
  9981. Γöé                Γöédevices)        Γöé                            Γöé
  9982. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9983. ΓöéBackground colorΓöéCLR_BACKGROUND  ΓöéGpiSetAttrs (ABB_BACK_COLOR)Γöé
  9984. Γöé                Γöé(white on most  Γöé                            Γöé
  9985. Γöé                Γöédevices)        Γöé                            Γöé
  9986. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9987. ΓöéForeground mix  ΓöéFM_OVERPAINT    ΓöéGpiSetAttrs (ABB_MIX_MODE)  Γöé
  9988. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  9989. ΓöéBackground mix  ΓöéBM_LEAVEALONE   ΓöéGpiSetAttrs                 Γöé
  9990. Γöé                Γöé                Γöé(ABB_BACK_MIX_MODE)         Γöé
  9991. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  9992.  
  9993. Note:  Geometric width, End, and Join take effect only when a path is converted 
  9994.        to a geometric wide line using GpiStrokePath or GpiModifyPath. 
  9995.  
  9996. Width, Type, Color, and Mix mode take effect only when a path is outlined using 
  9997. GpiOutlinePath. 
  9998.  
  9999. Pattern symbol, Pattern set, and Reference point take effect only when a path 
  10000. is filled using GpiFillPath or GpiStrokePath. 
  10001.  
  10002.  
  10003. ΓòÉΓòÉΓòÉ 10.1.2. Line Width and Geometric Width for Paths ΓòÉΓòÉΓòÉ
  10004.  
  10005. Cosmetic lines represent the mathematical ideal of a 1-dimensional line; the 
  10006. width attribute associated with them is provided only for ease of drawing these 
  10007. lines larger than 1 pel. 
  10008.  
  10009. In contrast, geometric line width is not an attribute; it is a geometric 
  10010. property. To set the width of a geometric line, an application can use 
  10011. GpiSetLineWidthGeom. This geometric width takes effect only when a path is 
  10012. converted to a geometric wide line using GpiStrokePath or GpiModifyPath. 
  10013.  
  10014. If a geometric line is drawn before the geometric width is specified, the drawn 
  10015. line is defined by the cosmetic line width-usually 1-which results in the 
  10016. thinnest possible line for the currently associated device. A geometric line 
  10017. width has no default in the same way that the sides of a box, drawn with 
  10018. GpiBox, have no length until specified by the function. 
  10019.  
  10020. The value specified with GpiSetLineWidthGeom is the thickness of the line in 
  10021. world coordinates, and it is subject to scaling by the current transformations 
  10022. in effect at the time GpiModifyPath or GpiStrokePath is issued. For example, if 
  10023. you apply a transform with a scaling factor of 0.5, for an object whose current 
  10024. geometric line width is 4 world coordinates, the width of the displayed line 
  10025. will be halved. 
  10026.  
  10027. In the floor plan shown in the following figure, the outer walls were drawn 
  10028. using geometric lines.  All of the other objects were drawn using normal lines. 
  10029.  
  10030. Geometric Lines and Normal Lines 
  10031.  
  10032. Your application can determine the current geometric width by issuing 
  10033. GpiQueryLineWidthGeom. 
  10034.  
  10035.  
  10036. ΓòÉΓòÉΓòÉ 10.1.3. Line End ΓòÉΓòÉΓòÉ
  10037.  
  10038. The line end attribute specifies the shape of the unattached end of a geometric 
  10039. line. Lines whose shapes are partially defined by a geometric width have to be 
  10040. closed, unlike cosmetic lines that simply end. An application can draw 
  10041. geometric lines with square, flat, or round ends. 
  10042.  
  10043. Note:  The end attribute takes effect only when a path is converted to a 
  10044.        geometric width line using GpiStrokePath or GpiModifyPath. 
  10045.  
  10046. Set the current geometric line end attribute with GpiSetLineEnd. The attribute 
  10047. applies to all subsequent unattached lines within the path bracket. The 
  10048. following table describes the three standard line ends provided by the PM 
  10049. programming interface; you cannot define your own end types. 
  10050.  
  10051. Standard Geometric Line End Types 
  10052.  
  10053. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10054. ΓöéType                            ΓöéIdentifier      ΓöéLong Value  Γöé
  10055. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10056. ΓöéFlat, flush with line end       ΓöéLINEEND_FLAT    Γöé1L          Γöé
  10057. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10058. ΓöéRound, past line end            ΓöéLINEEND_ROUND   Γöé2L          Γöé
  10059. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10060. ΓöéFlat, but extends past line end ΓöéLINEEND_SQUARE  Γöé3L          Γöé
  10061. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10062.  
  10063. The default line end type (LINEEND_DEFAULT) is identical to the LINEEND_FLAT 
  10064. type, and has a long value of 0L. The error linetype (LINEEND_ERROR) has a long 
  10065. value of -1L. 
  10066.  
  10067. The following figure illustrates these three types of line ends. Your 
  10068. application can determine the current geometric line end by issuing 
  10069. GpiQueryLineEnd. 
  10070.  
  10071. Closing Unattached Geometric Lines 
  10072.  
  10073. A square line end extends the line by a distance that is half the width of the 
  10074. line.  For example, if the line is 6 coordinate units wide, a square line end 
  10075. extends it by 3 coordinate units. 
  10076.  
  10077. A round line end is constructed by drawing a circle whose radius is half the 
  10078. width of the line. 
  10079.  
  10080.  
  10081. ΓòÉΓòÉΓòÉ 10.1.4. Line Join ΓòÉΓòÉΓòÉ
  10082.  
  10083. The line join attribute specifies the shape formed by two intersecting 
  10084. geometric lines. Where one wide line joins another, the nature of the join must 
  10085. be defined. An application can select a beveled, rounded, or mitred line-join 
  10086. style. 
  10087.  
  10088. Note:  The join attribute takes effect only when a path is converted to a 
  10089.        geometric wide line using GpiStrokePath or GpiModifyPath. 
  10090.  
  10091. Set the current geometric line-join attribute with GpiSetLineJoin. The 
  10092. attribute applies to all subsequent intersection of lines within the path 
  10093. bracket. The following table describes the three standard line joins provided 
  10094. by the PM programming interface. You cannot define your own join types. 
  10095.  
  10096. Standard Geometric Line Join Types 
  10097.  
  10098. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10099. ΓöéType                            ΓöéIdentifier      ΓöéLong Value  Γöé
  10100. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10101. ΓöéDiagonal corner                 ΓöéLINEJOIN_BEVEL  Γöé1L          Γöé
  10102. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10103. ΓöéRounded corner                  ΓöéLINEJOIN_ROUND  Γöé2L          Γöé
  10104. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10105. Γöé90┬░ angled corner               ΓöéLINEJOIN_MITRE  Γöé3L          Γöé
  10106. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10107.  
  10108. The default join type (LINEJOIN_DEFAULT) is identical to the LINEJOIN_BEVEL 
  10109. type, and has a long value of 0L. The error linetype (LINEJOIN_ERROR) has a 
  10110. long value of -1L. The following figure illustrates these three types of line 
  10111. joins. Your application can determine the current geometric line join using 
  10112. GpiQueryLineJoin. 
  10113.  
  10114. Joining Wide Lines 
  10115.  
  10116.  
  10117. ΓòÉΓòÉΓòÉ 10.1.5. Cosmetic Line Attributes for Paths ΓòÉΓòÉΓòÉ
  10118.  
  10119. When a path is drawn as a cosmetic line with GpiOutlinePath, the following 
  10120. attributes are defined by the LINEBUNDLE data structure: 
  10121.  
  10122. o Line width 
  10123. o Line type 
  10124. o Line color 
  10125. o Line mix. 
  10126.  
  10127. These attributes are described in Attributes of Line and Arc Primitives. 
  10128.  
  10129. These attributes follow the current definitions and appear just as line 
  10130. primitives do. Since the line primitive has only a foreground color and mix 
  10131. attribute, the current color of the drawing surface affects the appearance of 
  10132. these paths more than it does the appearance of paths that define geometric 
  10133. lines. Those paths follow the area attributes and are affected by background 
  10134. color and background mix attributes as well. 
  10135.  
  10136.  
  10137. ΓòÉΓòÉΓòÉ 10.1.6. Area Attributes for Paths ΓòÉΓòÉΓòÉ
  10138.  
  10139. When a path is drawn as a geometric line with GpiStrokePath or GpiModifyPath, 
  10140. the following attributes are defined by the AREABUNDLE data structure: 
  10141.  
  10142. o Pattern symbol 
  10143. o Pattern set 
  10144. o Pattern reference point 
  10145. o Area foreground color 
  10146. o Area background color 
  10147. o Area foreground mix 
  10148. o Area background mix. 
  10149.  
  10150. These attributes are discussed in Attributes of Area Primitives. 
  10151.  
  10152. Area attributes follow the current definitions and appear just as area 
  10153. primitives do.  The operating system uses the pattern symbol to fill the 
  10154. interior of the path that defines the geometric line.  Any alterations to the 
  10155. fill pattern or reference point affect the appearance of a geometric line just 
  10156. as it does an area. 
  10157.  
  10158.  
  10159. ΓòÉΓòÉΓòÉ 10.1.7. Path Color and Mix Attributes ΓòÉΓòÉΓòÉ
  10160.  
  10161. The color attribute defines the color used to draw a primitive or an object. 
  10162. The mix attribute determines how the color of a primitive or an object is 
  10163. combined with the color of the drawing surface, or any other objects on the 
  10164. surface. Both attributes also are described in Color and Mix Attributes. Unlike 
  10165. the color and mix attributes for primitives, and certain other objects, the 
  10166. path color is defined by different attributes in different situations as 
  10167. illustrated in the following figure. 
  10168.  
  10169. Path Objects 
  10170.  
  10171. Path colors are determined by the area color, area background color, area mix, 
  10172. and area background mix attributes if the path is stroked into a wide line. The 
  10173. cosmetic line path color is determined by the line color and mix attributes. 
  10174.  
  10175. The line color defines the color used to draw the output from any of the OS/2 
  10176. operating system line functions issued within the path. The line colors can 
  10177. change within the path bracket, just as they can within area brackets. The 
  10178. interaction of the line with the drawing-surface color is controlled by the 
  10179. line mix attribute, which also can vary within the path bracket. 
  10180.  
  10181. After the path is closed, the path can be stroked into a geometric (or wide) 
  10182. line. Depending on the construction options, described in Path Fill, the 
  10183. geometric line can be filled. The appearance of the pattern symbol used to fill 
  10184. the path depends on the area attributes. The definitions of the area color and 
  10185. background color depend on the pattern symbol as described in Area Colors and 
  10186. Mix Attributes. 
  10187.  
  10188. To specify a new color or mix attribute refer to the instructions in Line Color 
  10189. and Mix Attributes for lines, or in Area Colors and Mix Attributes for areas. 
  10190.  
  10191.  
  10192. ΓòÉΓòÉΓòÉ 10.1.8. Path Brackets ΓòÉΓòÉΓòÉ
  10193.  
  10194. The functions that create and define the path always are bracketed by the 
  10195. GpiBeginPath and GpiEndPath functions. Only one path can be defined between 
  10196. these two functions. However, within the path, there can be any number of 
  10197. figures. 
  10198.  
  10199. GpiBeginPath signals the start of a path definition. Each path you define 
  10200. becomes the current path and replaces any existing path in the presentation 
  10201. space. The current position is not changed by GpiBeginPath, although it is 
  10202. updated by any drawing instructions that follow. 
  10203.  
  10204. GpiBeginPath accepts as input only a path identifier of 1; this identifier is 
  10205. used by the functions performing path operations to identify the path. 
  10206.  
  10207. Due to the number of different operations that can be performed on paths, the 
  10208. path definition can contain both open and closed figures.  If a figure does not 
  10209. start and end at the same coordinate point, it is classified as an open figure. 
  10210. Unlike an area bracket, if you issue GpiSetCurrentPosition or GpiMove within a 
  10211. path definition, the current figure is not automatically closed.  Other 
  10212. functions that merely separate figures within a path definition are listed in 
  10213. the Presentation Manager Programming Reference. 
  10214.  
  10215. The PM programming interface provides a method of closing figures within a 
  10216. path.  The function GpiCloseFigure (valid only in path brackets) closes a 
  10217. figure in the path, whose start and end points are not the same, by drawing a 
  10218. straight line from the current position to the start position of the figure. 
  10219. Use GpiCloseFigure if you want the line join attribute to be applied between 
  10220. the start and end point of a figure.  Do not use it if you want the line end 
  10221. attributes to be employed as the start and end points for a geometric wide 
  10222. line. 
  10223.  
  10224. If the path definition contains full arc or box primitives, however, you must 
  10225. not close them using GpiCloseFigure.  GpiBox and GpiFullArc generate completely 
  10226. closed figures and must not be used within another figure definition. 
  10227.  
  10228. To signal the end of the current path definition, issue GpiEndPath. The path 
  10229. definition is constructed in the currently associated presentation space. The 
  10230. current position always is updated to the end point of the last line drawn. 
  10231.  
  10232. The functions that generate a path are enclosed in a path bracket. Applications 
  10233. can use the functions in the following list within a path bracket. 
  10234.  
  10235. o GpiBeginElement 
  10236. o GpiBox 
  10237. o GpiCallSegmentMatrix 
  10238. o GpiCharString 
  10239. o GpiCharStringAt 
  10240. o GpiCharStringPos 
  10241. o GpiCharStringPosAt 
  10242. o GpiCloseFigure 
  10243. o GpiComment 
  10244. o GpiCreateLogFont 
  10245. o GpiDeleteSetId 
  10246. o GpiElement 
  10247. o GpiEndElement 
  10248. o GpiEndPath 
  10249. o GpiFullArc 
  10250. o GpiGetData 
  10251. o GpiLabel 
  10252. o GpiLine 
  10253. o GpiMarker 
  10254. o GpiMove 
  10255. o GpiOffsetElementPointer 
  10256. o GpiPartialArc 
  10257. o GpiPointArc 
  10258. o GpiPolyFillet 
  10259. o GpiPolyFilletSharp 
  10260. o GpiPolyLine 
  10261. o GpiPolyMarker 
  10262. o GpiPolySpline 
  10263. o GpiPop 
  10264. o GpiPutData 
  10265. o GpiQueryArcParams 
  10266. o GpiQueryAttrMode 
  10267. o GpiQueryCurrentPosition 
  10268. o GpiSetArcParams 
  10269. o GpiSetAttrMode 
  10270. o GpiSetAttrs 
  10271. o GpiSetCharAngle 
  10272. o GpiSetCharBox 
  10273. o GpiSetCharDirection 
  10274. o GpiSetCharMode 
  10275. o GpiSetCharSet 
  10276. o GpiSetCharShear 
  10277. o GpiSetColor 
  10278. o GpiSetCp 
  10279. o GpiSetCurrentPosition 
  10280. o GpiSetEditMode 
  10281. o GpiSetLineEnd 
  10282. o GpiSetLineJoin 
  10283. o GpiSetLineType 
  10284. o GpiSetLineWidth 
  10285. o GpiSetMarker 
  10286. o GpiSetMarkerBox 
  10287. o GpiSetMarkerSet 
  10288. o GpiSetMix 
  10289. o GpiSetModelTransformMatrix 
  10290.  
  10291. Warning: Some GPI functions cannot be issued while an open path definition 
  10292. exists. In particular, you cannot include image or area primitives in a path 
  10293. definition. 
  10294.  
  10295.  
  10296. ΓòÉΓòÉΓòÉ 10.1.9. Path Operations ΓòÉΓòÉΓòÉ
  10297.  
  10298. The operations performed on a path determine which of the path attributes 
  10299. become applicable. Unlike specifying area brackets, the variety of operations 
  10300. also calls for separate functions instead of specifying options with 
  10301. GpiBeginPath. Specifically, the following six operations can be performed on a 
  10302. path: 
  10303.  
  10304. o Outline 
  10305. o Fill 
  10306. o Modify 
  10307. o Stroke 
  10308. o Convert to clip path 
  10309. o Convert to region. 
  10310.  
  10311. There are other graphics operations provided by the PM programming interface, 
  10312. for example, transformations; however, they can apply to entities other than 
  10313. paths. 
  10314.  
  10315. Upon completion, the GpiFillPath, GpiOutlinePath, GpiStrokePath, and 
  10316. GpiPathToRegion functions delete the current path definition. This path is not 
  10317. available for any subsequent operations. 
  10318.  
  10319. GpiModifyPath does not delete the current path definition. An application can 
  10320. modify a path before issuing one of the aforementioned functions. 
  10321.  
  10322. The first time your application issues GpiSetClipPath, the current path 
  10323. definition is converted into the current clip path. GpiSetClipPath deletes the 
  10324. path definition upon completion but not the clip path definition. 
  10325.  
  10326. A path definition can be stored in a graphics segment; and, if that segment is 
  10327. retained, the path can be re-created as required. Segments are discussed in 
  10328. Creating and Drawing Retained Graphics. 
  10329.  
  10330.  
  10331. ΓòÉΓòÉΓòÉ 10.1.10. Path Outline ΓòÉΓòÉΓòÉ
  10332.  
  10333. To draw the outline of the current path, issue GpiOutlinePath. This function 
  10334. accepts a path identifier (which must be 1) as input. GpiOutlinePath does not 
  10335. create a geometric line; therefore, the cosmetic line attributes are used. 
  10336.  
  10337. GpiOutlinePath normally has the same effect as though the lines and arcs used 
  10338. to create the path were drawn without actually being part of the path. Any open 
  10339. figures within the path are not closed automatically. If the path contains 
  10340. character strings that use an outline font, the characters are not filled. 
  10341.  
  10342. The following functional sequence is recommended for drawing outline text or 
  10343. outline figures: 
  10344.  
  10345. Functional Sequence for Drawing Outline Text and Figures 
  10346.  
  10347. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10348. ΓöéFunction Name           ΓöéEffect                              Γöé
  10349. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10350. ΓöéGpiBeginPath            ΓöéStarts the path definition.         Γöé
  10351. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10352. ΓöéGpiMove                 ΓöéMoves to the starting point of the  Γöé
  10353. Γöé                        Γöéfirst figure.                       Γöé
  10354. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10355. ΓöéGpiCharString,GpiFullArcΓöéUses an outline font to specify textΓöé
  10356. Γöé                        Γöéor define the lines in a figure.    Γöé
  10357. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10358. ΓöéGpiEndPath              ΓöéEnds the path.                      Γöé
  10359. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10360. ΓöéGpiOutlinePath          ΓöéDraws the text or figure outlines.  Γöé
  10361. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10362.  
  10363. If you are drawing a complex path, consisting of several character strings that 
  10364. use an outline font, it can take quite some time to produce.  If you want to 
  10365. create a only rough draft, you might find it quicker to draw an outline instead 
  10366. of the filled path. This improves performance and might be acceptable for small 
  10367. characters. When they are small enough, hollow characters can look like filled 
  10368. characters. 
  10369.  
  10370. You can create hollow characters in either of two ways: 
  10371.  
  10372. o Outside a path, issue GpiCreateLogFont. 
  10373.  
  10374.   This enables you to define an outline font that uses hollow characters. 
  10375.  
  10376. o Inside a path, draw the characters, then display the path with 
  10377.   GpiOutlinePath. 
  10378.  
  10379.   Only the character outlines contribute to the path definition even if the 
  10380.   font is not hollow.  (This might cause ambiguous results.) 
  10381.  
  10382. Using outlined paths to create character outlines also can be used to define a 
  10383. clip path in the shape of a letter or word. 
  10384.  
  10385.  
  10386. ΓòÉΓòÉΓòÉ 10.1.11. Path Fill ΓòÉΓòÉΓòÉ
  10387.  
  10388. To draw the current path and fill its interior using the current pattern 
  10389. symbol, issue GpiFillPath.  The path is deleted after the interior is filled. 
  10390. The boundary lines are considered part of the path interior and are drawn with 
  10391. this function.  Any open figures in the path definition are closed 
  10392. automatically by GpiFillPath. 
  10393.  
  10394. This function accepts the path identifier (which must be 1) as input, and 
  10395. either of two construction options: 
  10396.  
  10397. o FPATH_ALTERNATE (the default) 
  10398. o FPATH_WINDING (must be selected if the path has been modified). 
  10399.  
  10400. Paths, like area primitives, can be filled in alternate mode or winding mode. 
  10401. If the path consists of multiple, intersecting figures, the path-fill mode 
  10402. affects the final appearance of the path. 
  10403.  
  10404. The following figure shows two identical paths that were filled, each using one 
  10405. of the two modes. Each path consists of a triangle drawn within a rectangle. 
  10406. The path on the left was filled using the alternate mode.  The path on the 
  10407. right was filled using the winding mode. 
  10408.  
  10409. Alternate and Winding Fill Modes 
  10410.  
  10411.  
  10412. ΓòÉΓòÉΓòÉ 10.1.11.1. Paths in Alternate Mode ΓòÉΓòÉΓòÉ
  10413.  
  10414. For paths drawn in alternate mode (as with area primitives), the following is 
  10415. true: 
  10416.  
  10417. o If you have to cross an odd number of boundaries in the path when drawing an 
  10418.   imaginary line parallel to the x-axis, a point is included in the filled path 
  10419.   from that point to positive infinity. 
  10420.  
  10421. o If you have to cross an even number of boundaries in the path when drawing an 
  10422.   imaginary line parallel to the x-axis, a point is not included in the filled 
  10423.   path from that point to positive infinity. 
  10424.  
  10425. The following figure shows how the operating system determines the filled 
  10426. portion for the path shown in the previous figure. The path outside the 
  10427. triangle, but inside the rectangle, is filled, because the imaginary lines 
  10428. drawn from those points in the positive x-direction intersect the path 
  10429. boundaries an odd number of times. 
  10430.  
  10431. Calculating Filled Paths Constructed in Alternate Mode 
  10432.  
  10433. Parts of the path with odd tallys are filled; parts with even tallys are not 
  10434. filled. 
  10435.  
  10436.  
  10437. ΓòÉΓòÉΓòÉ 10.1.11.2. Paths in Winding Mode ΓòÉΓòÉΓòÉ
  10438.  
  10439. For paths drawn in winding mode (also like area primitives), the direction the 
  10440. boundaries in the path are drawn in determines whether a given point is 
  10441. included in the filled path.  The drawn direction of a boundary line depends on 
  10442. both the graphics functions used to draw it and the world coordinates that 
  10443. define it. 
  10444.  
  10445. For box primitives, for example, if the specified diagonal corner is to the 
  10446. right, to the top, or both, of the current position, the box is drawn 
  10447. counterclockwise.  If the specified diagonal corner is to the left, to the 
  10448. bottom, but not both, the box is drawn clockwise. 
  10449.  
  10450. For a polyline primitive, the direction of the boundary depends on the relative 
  10451. values of the start and end points of each line.  For a polygon primitive, the 
  10452. direction of the boundary depends on the relative values of the specified 
  10453. vertices. 
  10454.  
  10455. To determine whether a given point is included in the filled path, count the 
  10456. number of boundary lines to be crossed to move from that point to infinity. 
  10457. For each boundary line drawn in one direction add one to the tally.  For each 
  10458. boundary line drawn in the opposite direction, subtract one from the tally.  A 
  10459. point is within the area if the result is nonzero.  As with the alternate mode, 
  10460. the imaginary determining line is drawn in the positive x-direction from the 
  10461. point in question toward infinity. 
  10462.  
  10463. The following figure shows how the operating system determines the filled 
  10464. portion for the path shown in the figure before the previous one. Assume that 
  10465. both the rectangle and triangle were drawn in the same direction, whether 
  10466. clockwise or counterclockwise is immaterial.  Both figures are filled, because 
  10467. the number of times the imaginary lines drawn from those points in the positive 
  10468. x-direction intersect the path boundaries is continuously summed.  There is 
  10469. never a subtraction of a boundary tally to reduce the total to 0. 
  10470.  
  10471. Paths Constructed in the Same Direction in Winding Mode 
  10472.  
  10473. Parts of the path with nonzero tallys are filled; parts with zero tallys are 
  10474. not filled. 
  10475.  
  10476. If two figures, for example in the following figure, are drawn in different 
  10477. directions, the tally for the inner triangle is 0 and the area looks exactly as 
  10478. it does in alternate mode. 
  10479.  
  10480. Paths Constructed in Different Directions in Winding Mode 
  10481.  
  10482. Parts of the path with nonzero tallys are filled; parts with zero tallys are 
  10483. not filled. 
  10484.  
  10485.  
  10486. ΓòÉΓòÉΓòÉ 10.1.12. Path Modification ΓòÉΓòÉΓòÉ
  10487.  
  10488. To convert the current path to one that describes the envelope of a geometric 
  10489. wide line, issue GpiModifyPath.  The current geometric line attributes are then 
  10490. applied to the figures within the path. The line end, line join, and geometric 
  10491. line width attributes all must be set before modify-path or stroke-path 
  10492. operations begin, because it is during those times that the attributes are 
  10493. applied. Cosmetic line attributes of width and type have no effect on geometric 
  10494. lines. 
  10495.  
  10496. GpiModifyPath accepts the path identifier (which must be 1) and the 
  10497. modification option MPATH_STROKE as input. 
  10498.  
  10499. Subsequently, the modified path can be filled to display the geometric wide 
  10500. line, but only in winding mode.  Alternatively, the modified path can be 
  10501. converted into a clip path, but again, only in winding mode. 
  10502.  
  10503. Open figures within the path are not closed automatically. Figures not 
  10504. explicitly closed with GpiCloseFigure are drawn with line ends rather than line 
  10505. joins at their start and end points.  If the figures within the path overlap, 
  10506. the geometric width envelope compensates so that the overlap portion is not 
  10507. drawn blank in XOR or exclusive-OR mode. 
  10508.  
  10509. Now the geometric lines can be scaled. 
  10510.  
  10511. Note:  The current transforms are applied to the primitives inside a path 
  10512.        bracket when the path is defined.  This binds the path definition in 
  10513.        device coordinates at that time. The path is unaffected by subsequent 
  10514.        transformations, except for those (such as scaling) that affect the 
  10515.        width of geometric (wide) lines.  Since the geometric line width 
  10516.        attribute is not applied until the path is converted into a wide line by 
  10517.        GpiModifyPath or GpiStrokePath, the width of geometric lines is 
  10518.        unaffected by earlier transformations directed at the path definition. 
  10519.  
  10520. After creating a path bracket, geometric wide lines can be constructed by 
  10521. either: 
  10522.  
  10523. o Stroking the path (GpiStrokePath) 
  10524. o Modifying the path (GpiModifyPath), then filling the path (GpiFillPath). 
  10525.  
  10526. GpiStrokePath is slightly more efficient, but GpiModifyPath and GpiFillPath 
  10527. offer more flexibility (by way of the fill options). After drawing the lines no 
  10528. alterations can be made. 
  10529.  
  10530.  
  10531. ΓòÉΓòÉΓòÉ 10.1.13. Path-Stroking ΓòÉΓòÉΓòÉ
  10532.  
  10533. To modify and fill the current path in a single operation, issue GpiStrokePath. 
  10534. Then the path is drawn immediately to the output device, with the current 
  10535. geometric line attributes applied to the figures within the path.  Certain 
  10536. device drivers can use this function to optimize storage. 
  10537.  
  10538. GpiStrokePath automatically fills the path in winding mode with the current 
  10539. area pattern symbol. When GpiStrokePath is complete, the path definition is 
  10540. deleted from the device context. 
  10541.  
  10542. GpiStrokePath is subject to the same constraints as functions that perform 
  10543. simple line modification: 
  10544.  
  10545. o The line end, line join, and geometric line width attributes all must be set 
  10546.   before stroke operations. 
  10547. o Cosmetic line attributes of width and type have no effect. 
  10548. o Any open figures within the path are not closed automatically. 
  10549. o If figures are not explicitly closed with GpiCloseFigure, they are drawn with 
  10550.   line ends rather than line joins at their start and end points. 
  10551. o If the figures within the path overlap, the geometric width envelope 
  10552.   compensates so that the overlap portion is not drawn blank when drawn in XOR 
  10553.   (exclusive-OR) mode. 
  10554.  
  10555. This function accepts as input both the path identifier (which must be 1) and 
  10556. the stroke option (which must be 0L). 
  10557.  
  10558. When the operating system strokes a path, it draws a geometric line of 
  10559. specified width along the original figure that defined the path; then, fills 
  10560. the wide line.  If the original figure is not a closed shape, the operating 
  10561. system does not automatically close it before filling the path. The following 
  10562. figure shows the effects of GpiStrokePath on a box originally defined with 
  10563. normal (cosmetic) lines. 
  10564.  
  10565. Defining Lines with a Geometric Width 
  10566.  
  10567. The broken line is the figure defined within the path. The solid lines show the 
  10568. path after it has been converted. Each line has a geometric width of n 
  10569. coordinate units, and the line joins have been defined as beveled. 
  10570.  
  10571. After setting these attributes, the application can draw the line with 
  10572. GpiStrokePath. After the lines are drawn, an application can scale stroked 
  10573. paths with a scaling transformation. 
  10574.  
  10575. As an alternative to the GpiStrokePath, you can convert the path using 
  10576. GpiModifyPath, which does not draw the path on the current output device. To 
  10577. draw a modified path, issue GpiFillPath, which draws the path and fills it with 
  10578. the current area-fill pattern in winding mode. A modified path cannot be filled 
  10579. in alternate mode. 
  10580.  
  10581. On some devices, it might be that the GpiStrokePath method works better than 
  10582. GpiModifyPath, followed by GpiFillPath. 
  10583.  
  10584.  
  10585. ΓòÉΓòÉΓòÉ 10.1.14. Path Conversion to Clip Path ΓòÉΓòÉΓòÉ
  10586.  
  10587. Clipping is the process an application uses to limit graphics output to a 
  10588. specific area (called the clipping area) of the display or page.  Clipping is 
  10589. described further in Clipping and Boundary Determination. 
  10590.  
  10591. There are several clipping functions provided by the PM programming interface; 
  10592. however, if your application requires an irregular complex shape for a clipping 
  10593. area, it must define the shape with a path. To convert the path into a clipping 
  10594. boundary, issue GpiSetClipPath. The clip path, as defined by this operation, 
  10595. becomes the current clip path for all subsequent drawing. 
  10596.  
  10597. This function accepts a path identifier and one of two construction options as 
  10598. input: 
  10599.  
  10600. o SCP_ALTERNATE (default) 
  10601. o SCP_WINDING (must be selected if the path has been modified). 
  10602.  
  10603. Unlike the path operations described previously, GpiSetClipPath accepts two 
  10604. different path identifiers: 
  10605.  
  10606. o 1 
  10607. o 0 (default). 
  10608.  
  10609. The default path identifier of 0, called SCP_RESET, resets the clip path to 
  10610. infinity, which displays the picture without clipping.  If this value is 
  10611. selected, the current clip path definition is discarded instead of stored. 
  10612.  
  10613. A path identifier of 1 is called SCP_AND.  For GpiSetClipPath, a path 
  10614. identifier of 1 causes the clip path to be redefined as the mathematical 
  10615. intersection of the stored clip path and the current path definition.  For all 
  10616. other path operations, an identifier of 1 specifies the current path as the 
  10617. recipient of the operation.  The only method of specifying the clip path as the 
  10618. current path, after GpiSetClipPath has been issued, is to issue GpiSetClipPath 
  10619. again:  the first issuance with a path identifier of 0; the second, with a path 
  10620. identifier of 1.  The path identifiers and the construction mode can be ORed 
  10621. together for certain effects. 
  10622.  
  10623. Any open figures within a path are closed automatically.  The boundaries of the 
  10624. path are considered part of the interior, so any point on the boundary is not 
  10625. clipped. The following figure shows the result of clipping text with a 
  10626. triangular clip path. 
  10627.  
  10628. Triangular Clip Path 
  10629.  
  10630.  
  10631. ΓòÉΓòÉΓòÉ 10.1.15. Path Conversion to Region ΓòÉΓòÉΓòÉ
  10632.  
  10633. To convert the current path to a region, issue GpiPathToRegion. Then, the new 
  10634. region can be modified using any of the region functions that allow the 
  10635. creation of irregular shaped regions.  For detailed information about regions, 
  10636. see Regions. 
  10637.  
  10638. Any open figures in the path definition are closed automatically by 
  10639. GpiPathToRegion. Upon conversion, the current path definition is discarded just 
  10640. like it is when being converted to a clip path. When GpiPathToRegion is 
  10641. complete, the path definition is deleted automatically. 
  10642.  
  10643. This function accepts the path identifier (which must be 1) and one of two 
  10644. construction options as input: 
  10645.  
  10646. o FPATH_ALTERNATE (default) 
  10647. o FPATH_WINDING (must be selected if the path has been modified). 
  10648.  
  10649.  
  10650. ΓòÉΓòÉΓòÉ 10.2. Using Paths ΓòÉΓòÉΓòÉ
  10651.  
  10652. You can use path functions to: 
  10653.  
  10654. o Draw geometric lines and filled polygons 
  10655. o Draw outline text 
  10656. o Create a triangular clip path. 
  10657.  
  10658.  
  10659. ΓòÉΓòÉΓòÉ 10.2.1. Drawing a Geometric (Wide) Line ΓòÉΓòÉΓòÉ
  10660.  
  10661. The following figure is an example of how to draw a straight line, 10 units 
  10662. wide with rounded ends. 
  10663.  
  10664. #define INCL_GPIPRIMITIVES
  10665. #include <os2.h>
  10666. void fncPATH01(void){
  10667.     POINTL ptl;
  10668.     HPS hps;
  10669.  
  10670.     GpiSetLineWidthGeom(hps, 10L);       /* Sets line width to ten              */
  10671.     GpiSetLineEnd(hps, LINEEND_ROUND);   /* Sets line end to round              */
  10672.     GpiBeginPath(hps, 1L);               /* Begins path                         */
  10673.     ptl.x = 7;
  10674.     ptl.y = 15;
  10675.     GpiMove(hps, &ptl);                  /* Sets current position               */
  10676.     ptl.x = 450;
  10677.     ptl.y = 15;
  10678.     GpiLine(hps, &ptl);                  /* Draws line                          */
  10679.     GpiEndPath(hps);                     /* Ends path                           */
  10680.     GpiStrokePath(hps, 1L, 0L);          /* Draws geometric line                */
  10681. } /* fncPATH01 */
  10682.  
  10683.  
  10684. Drawing a Wide Line 
  10685.  
  10686.  
  10687. ΓòÉΓòÉΓòÉ 10.2.2. Drawing Filled Polygons ΓòÉΓòÉΓòÉ
  10688.  
  10689. The following figure is an example of how to draw an empty triangle within a 
  10690. solid rectangle. 
  10691.  
  10692. #define INCL_GPIPATHS
  10693. #include <os2.h>
  10694. void fncPATH02(void){
  10695.     HPS hps;
  10696.     POINTL aptl1[4] = {       /*  Array of points for triangle   */
  10697.         50,  50,
  10698.         100, 100,
  10699.         150, 50,
  10700.         50,  50  };
  10701.  
  10702.     POINTL aptl2[5] = {       /* Array of points for rectangle   */
  10703.  25,  25,
  10704.  25, 200,
  10705. 200, 200,
  10706. 200,  25,
  10707.  25,  25 };
  10708.  
  10709.     GpiBeginPath(hps, 1L);                 /* Begins path                  */
  10710.     GpiMove(hps, aptl1);                   /* Sets current position        */
  10711.     GpiPolyLine(hps, 4L, aptl1);           /* Plots points for triangle    */
  10712.     GpiMove(hps, aptl2);                   /* Sets current position        */
  10713.     GpiPolyLine(hps, 5L, aptl2);           /* Plots points for rectangle   */
  10714.     GpiEndPath(hps);                       /* Ends path                    */
  10715.     GpiFillPath(hps, 1L, FPATH_ALTERNATE); /* Draws triangle and rectangle */
  10716. } /* fncPATH02 */
  10717.  
  10718.  
  10719. Drawing Filled Polygons 
  10720.  
  10721.  
  10722. ΓòÉΓòÉΓòÉ 10.2.3. Drawing Outline Text ΓòÉΓòÉΓòÉ
  10723.  
  10724. The following figure shows an example of how to draw text from an outline font 
  10725. with GpiOutlinePath. 
  10726.  
  10727. #define INCL_GPIPRIMITIVES
  10728. #include <os2.h>
  10729. void fncPATH03(void){
  10730.     LONG lcid = 1;                            /* Identifier for font           */
  10731.     FATTRS fattrs;                            /* Structure for font attributes */
  10732.     SIZEF sizfx;                              /* Structure for character box   */
  10733.     POINTL ptl;                               /* Structure for starting point  */
  10734.     HPS hpsWin;
  10735.  
  10736.     fattrs.usRecordLength = sizeof(FATTRS);
  10737.     fattrs.fsSelection = FATTR_SEL_OUTLINE;   /* Specifies outline font        */
  10738.     fattrs.lMatch = 0;                        /* System determines font        */
  10739.     fattrs.szFacename[0] = 0;
  10740.     fattrs.idRegistry = 0;
  10741.     fattrs.usCodePage = 0;
  10742.     fattrs.lMaxBaselineExt = 0;
  10743.     fattrs.lAveCharWidth = 0;
  10744.     fattrs.fsType = 0;
  10745.     fattrs.fsFontUse = FATTR_FONTUSE_OUTLINE; /* Specifies outline font        */
  10746.  
  10747.     GpiCreateLogFont(hpsWin,(PSTR8) NULL, lcid, &fattrs);
  10748.     GpiSetCharSet(hpsWin, lcid);              /* Sets logical font             */
  10749.  
  10750.     sizfx.cx = MAKEFIXED(30, 0);              /* Width of character box        */
  10751.     sizfx.cy = MAKEFIXED(30, 0);              /* Height of character box       */
  10752.     GpiSetCharBox(hpsWin, &sizfx)             /* Sets size of character box    */
  10753.  
  10754.     GpiBeginPath(hpsWin, 1L);                 /* Begins path                   */
  10755.     ptl.x = 100;
  10756.     ptl.y = 200;
  10757.     GpiMove(hpsWin, &ptl);                    /* Sets current position         */
  10758.     GpiCharString(hpsWin, 7L, "Outline");     /* Establishes char. string      */
  10759.     GpiEndPath(hpsWin);                       /* Ends path                     */
  10760.     GpiOutlinePath(hpsWin, 1L, 0L);           /* Draws character string        */
  10761. } /* fncPATH03 */
  10762.  
  10763.  
  10764. Drawing Outline Text 
  10765.  
  10766.  
  10767. ΓòÉΓòÉΓòÉ 10.2.4. Creating a Triangular Clip Path ΓòÉΓòÉΓòÉ
  10768.  
  10769. The following figure shows an example of how to create a triangular clip path; 
  10770. then, write text into it. 
  10771.  
  10772. #define INCL_GPIPATHS
  10773. #include <os2.h>
  10774. void fncPATH04(void){
  10775.     POINTL ptlStart;
  10776.     HPS hps;
  10777.     LONG i;
  10778.  
  10779.     POINTL aptl[4] = {             /* Array of points for triangle     */
  10780.            35,  45,
  10781.           100, 100,
  10782.           200,  45,
  10783.            35,  45 };
  10784.  
  10785.     GpiBeginPath(hps, 1L);         /* Begins path bracket              */
  10786.     GpiMove(hps, aptl);            /* Sets current position            */
  10787.     GpiPolyLine(hps, 4L, aptl);    /* Plots points for triangle        */
  10788.     GpiEndPath(hps)                /* Ends path bracket                */
  10789.  
  10790.     GpiSetClipPath(hps, 1L, SCP_ALTERNATE | SCP_AND);
  10791.  
  10792.     /* Write a block of text.                                          */
  10793.  
  10794.     ptlStart.x = 50;
  10795.     for (i = 50L; i < 110L; i += 10L) {
  10796.         ptlStart.y = i;
  10797.         GpiCharStringAt(hps, &ptlStart, 18L, "String of text!");
  10798.     } /* for */
  10799. } /* fncPATH04 */
  10800.  
  10801. Creating a Triangular Clip Path 
  10802.  
  10803.  
  10804. ΓòÉΓòÉΓòÉ 10.3. Summary ΓòÉΓòÉΓòÉ
  10805.  
  10806. The following table summarizes the path object functions. 
  10807.  
  10808. Path Functions 
  10809.  
  10810. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10811. ΓöéFunction Name           ΓöéDescription                         Γöé
  10812. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10813. ΓöéGpiBeginPath            ΓöéBegins a path definition.           Γöé
  10814. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10815. ΓöéGpiCloseFigure          ΓöéDraws a line within the path        Γöé
  10816. Γöé                        Γöédefinition from the current positionΓöé
  10817. Γöé                        Γöéto the starting position of the     Γöé
  10818. Γöé                        Γöéfigure.                             Γöé
  10819. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10820. ΓöéGpiEndPath              ΓöéTerminates a path.                  Γöé
  10821. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10822. ΓöéGpiFillPath             ΓöéDraws the path, fills it with the   Γöé
  10823. Γöé                        Γöécurrent AREABUNDLE attributes, then Γöé
  10824. Γöé                        Γöédeletes the path. The fill can be inΓöé
  10825. Γöé                        Γöéeither winding or alternate mode.   Γöé
  10826. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10827. ΓöéGpiModifyPath           ΓöéModifies a path to describe the     Γöé
  10828. Γöé                        Γöéenvelope of a geometric wide line byΓöé
  10829. Γöé                        Γöéapplying line end, line join, and   Γöé
  10830. Γöé                        Γöégeometric line width attributes.    Γöé
  10831. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10832. ΓöéGpiOutlinePath          ΓöéDraws only the borders of a path.   Γöé
  10833. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10834. ΓöéGpiPathToRegion         ΓöéConverts a path to a region.        Γöé
  10835. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10836. ΓöéGpiSetClipPath          ΓöéConverts the created path into a    Γöé
  10837. Γöé                        Γöéclip path. The original path is     Γöé
  10838. Γöé                        Γöédeleted.                            Γöé
  10839. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10840. ΓöéGpiSetLineEnd           ΓöéDefines the line end attribute.     Γöé
  10841. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10842. ΓöéGpiSetLineJoin          ΓöéDefines the line join attribute.    Γöé
  10843. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10844. ΓöéGpiSetLineWidthGeom     ΓöéDefines the geometric line width    Γöé
  10845. Γöé                        Γöéattribute.                          Γöé
  10846. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10847. ΓöéGpiStrokePath           ΓöéConverts a path to the envelope of aΓöé
  10848. Γöé                        Γöégeometric wide line using the line  Γöé
  10849. Γöé                        Γöéend, line join and geometric line   Γöé
  10850. Γöé                        Γöéwidth attributes fills the path     Γöé
  10851. Γöé                        Γöéusing area bundle attributes and    Γöé
  10852. Γöé                        Γöéthen deletes the path.              Γöé
  10853. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10854.  
  10855. The following table summarizes the data structures used by the path object 
  10856. functions. 
  10857.  
  10858. Path Structures 
  10859.  
  10860. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  10861. ΓöéStructure Name          ΓöéDescription                         Γöé
  10862. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10863. ΓöéAREABUNDLE              ΓöéData structure of area primitive    Γöé
  10864. Γöé                        Γöéattributes.                         Γöé
  10865. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  10866. ΓöéLINEBUNDLE              ΓöéData structure of line primitive    Γöé
  10867. Γöé                        Γöéattributes.                         Γöé
  10868. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  10869.  
  10870.  
  10871. ΓòÉΓòÉΓòÉ 11. Regions ΓòÉΓòÉΓòÉ
  10872.  
  10873. A region is a graphics object usually composed of one or more rectangles. 
  10874. Converted to clip regions, they are used mainly to define a clipping boundary, 
  10875. in device coordinates, for multiple intersecting rectangles.  Clip regions 
  10876. provide the required clipping in an update region during WM_PAINT processing 
  10877. when it is necessary to repaint part of a window. Regions also can be used for 
  10878. area fill. 
  10879.  
  10880. The following topics are related to the information in this chapter: 
  10881.  
  10882. o Presentation spaces 
  10883. o Device contexts 
  10884. o Area primitives 
  10885. o Color and mix modes 
  10886. o Coordinate spaces 
  10887. o Transformations 
  10888. o Clipping. 
  10889.  
  10890.  
  10891. ΓòÉΓòÉΓòÉ 11.1. About Regions ΓòÉΓòÉΓòÉ
  10892.  
  10893. A region consists of one or more overlapping or separate rectangles in an 
  10894. application's device space. The sides of the rectangles are parallel to the x- 
  10895. and y-axes in the device coordinate space. An irregular, nonrectangular path 
  10896. can be converted into a region, as explained in Paths.  However, unless 
  10897. otherwise specified, the assumption of this chapter is that a region is 
  10898. rectangular. 
  10899.  
  10900. If a region consists of intersecting rectangles, the intersecting sides are 
  10901. always perpendicular. If the rectangles have no common elements, the region is 
  10902. defined as separate rectangles. 
  10903.  
  10904. Unlike areas and paths, which are defined in world coordinates, regions are 
  10905. device-dependent and, so, are defined in device coordinates.  The device 
  10906. coordinates are inclusive (inside the rectangle) at the bottom and left 
  10907. coordinate boundaries, and exclusive (outside the rectangle and clipped) at the 
  10908. top and right boundaries. 
  10909.  
  10910. Each region is created for the device that currently is associated with a 
  10911. presentation space.  Also, after creation, regions are available for various 
  10912. operations; a region handle identifies the region for subsequent operations. 
  10913.  
  10914. The following figure shows a region that consists of two intersecting 
  10915. rectangles.  An application defined the region by passing an array, containing 
  10916. the coordinates for the two rectangles, to the GpiCreateRegion function.  The 
  10917. application then drew the region with GpiPaintRegion. 
  10918.  
  10919. Defining a Region 
  10920.  
  10921. This region comprises two overlapping rectangles. 
  10922.  
  10923.  
  10924. ΓòÉΓòÉΓòÉ 11.1.1. System Implementation ΓòÉΓòÉΓòÉ
  10925.  
  10926. Regions are device-dependent objects and, therefore, are associated with a 
  10927. particular device.  For this reason, when an application specifies a 
  10928. presentation space as input to one of the region functions, that presentation 
  10929. space must be associated with a device context. The associated device context 
  10930. serves to identify the device. Because a region is specific to the device for 
  10931. which it was created, a region should not be created for one device and then 
  10932. used for another. 
  10933.  
  10934. If the device is a printer, a metafile can be used to store region functions as 
  10935. escapes, and the resulting metafile can be displayed on any device.  The 
  10936. appearance of the result of any region function is affected by differences in 
  10937. the pel:aspect ratio and device resolution on different printers. 
  10938.  
  10939. Most of the region-oriented functions use the RECTL structure to define the 
  10940. device-space coordinates of the rectangle. When an application creates a 
  10941. rectangle in a device space and passes its coordinates to a region function, 
  10942. the operating system excludes the top and rightmost edges of the rectangle. 
  10943. This means that an application must add 1 to the values in the xRight and yTop 
  10944. fields of the RECTL structure to obtain the desired dimensions. For example, if 
  10945. an application requires a region that measures 100-by-100 device units, with a 
  10946. lower-left corner at (10,10), xRight and yTop should be set to 111 instead of 
  10947. 110. 
  10948.  
  10949.  
  10950. ΓòÉΓòÉΓòÉ 11.1.2. Region Attributes ΓòÉΓòÉΓòÉ
  10951.  
  10952. Regions do not have a distinct xxxBUNDLE data structure associated with them. 
  10953. Unlike primitives or even paths, the purpose of regions is to provide a 
  10954. definition for an operation-not visual output. However, there are two functions 
  10955. that present the region as a visible entity. 
  10956.  
  10957. GpiPaintRegion paints a region in the presentation space. This function accepts 
  10958. only the region handle as input. GpiPaintRegion does not cause graphics orders 
  10959. to be added to the current segment. Therefore, in retain or draw-and-retain 
  10960. modes, you are advised to use paths or areas rather than regions to ensure the 
  10961. desired effect. 
  10962.  
  10963. GpiFrameRegion draws a frame around a region by tracing the inner perimeter 
  10964. with a rectangle of a specified size. This function accepts the region handle 
  10965. and the desired frame thickness as input. 
  10966.  
  10967. A region's visible output is controlled by the following AREABUNDLE attributes: 
  10968.  
  10969. o Pattern symbol 
  10970. o Pattern set 
  10971. o Pattern reference point 
  10972. o Area foreground color 
  10973. o Area background color 
  10974. o Area foreground mix. 
  10975.  
  10976. These attributes follow the current definitions and appear just as area 
  10977. primitives do.  The operating system uses the pattern symbol to fill the 
  10978. interior of the region. Any alterations to the fill pattern or reference point 
  10979. affects the appearance of a region, just as it does in an area. 
  10980.  
  10981. Because neither the painted region nor the region frame have boundary lines, no 
  10982. LINEBUNDLE attributes influence the appearance of a region resulting from the 
  10983. GpiPaintRegion or GpiFrameRegion functions. 
  10984.  
  10985.  
  10986. ΓòÉΓòÉΓòÉ 11.1.3. Region Creation ΓòÉΓòÉΓòÉ
  10987.  
  10988. Areas and paths are created and defined within a bracket; regions are defined 
  10989. by a single function, GpiCreateRegion. As input to GpiCreateRegion, supply the 
  10990. total number of, and the coordinates for, each rectangle that contributes to 
  10991. the region. The following applies to region coordinates: 
  10992.  
  10993. o They define the bottom left and top right coordinates of each rectangle that 
  10994.   makes up the region. 
  10995.  
  10996. o They must be in the range -32768 through +32767. 
  10997.  
  10998. o They always are device coordinates, because regions always are created and 
  10999.   drawn in an application's device space. 
  11000.  
  11001. The output from GpiCreateRegion is the region handle, which identifies the 
  11002. region for subsequent operations. Because each region can be distinctly 
  11003. identified, the region functions allow applications to work with more than one 
  11004. region at a time. 
  11005.  
  11006. For example, an application can combine two regions with GpiCombineRegion or 
  11007. compare two regions with GpiEqualRegion. GpiQueryRegionRects retrieves the 
  11008. coordinates of the rectangles that make up a region, enabling an application to 
  11009. create a copy of that region. To create the copy, you supply, as input to a new 
  11010. GpiCreateRegion function, the exact rectangles returned from 
  11011. GpiQueryRegionRects. 
  11012.  
  11013.  
  11014. ΓòÉΓòÉΓòÉ 11.1.4. Region Operations ΓòÉΓòÉΓòÉ
  11015.  
  11016. The following operations can be performed on a region: 
  11017.  
  11018. o Creating Regions 
  11019. o Drawing Regions 
  11020. o Moving Regions 
  11021. o Determining Region Characteristics 
  11022. o Converting a Path to a Region 
  11023. o Converting a Region to a Clip Region 
  11024. o Deleting Regions. 
  11025.  
  11026.  
  11027. ΓòÉΓòÉΓòÉ 11.1.4.1. Creating Regions ΓòÉΓòÉΓòÉ
  11028.  
  11029. To create a rectangular region, call GpiCreateRegion. This function accepts, as 
  11030. input, the number of rectangles to be ORed into a single region and the 
  11031. coordinates of those rectangles. If the number of rectangles is 0, an empty 
  11032. region is created. 
  11033.  
  11034. To create a new region from regions that already exist, call GpiCombineRegion. 
  11035. This function accepts, as input, a region handle for the target region, a 
  11036. region handle for each of the two source regions, and an options flag that 
  11037. specifies the way the two source regions are combined. 
  11038.  
  11039. Note:  The destination region can be either of the two source regions; in which 
  11040.        case, that region is replaced by the new region. 
  11041.  
  11042. The rectangles are differentiated by one region's being distinctly "the first 
  11043. source rectangle" and the other region labeled "the second source rectangle". 
  11044. The order of the source rectangles affects the way GpiCombineRegion combines 
  11045. them. You can use GpiCombineRegion an indefinite number of times to form 
  11046. complex polygons; however, the function is limited to combining only two 
  11047. regions each time it is called.  The two source regions must be created for the 
  11048. same type of device. 
  11049.  
  11050. Following are the five ways in which two regions can be combined: 
  11051.  
  11052. Option         Result 
  11053.  
  11054. CRGN_OR        Union of the two source regions. 
  11055.  
  11056. CRGN_XOR       Symmetric difference of the two source regions. 
  11057.  
  11058. CRGN_COPY      Source region 1 only; source region 2 is ignored. 
  11059.  
  11060. CRGN_AND       Intersection of the two source regions. 
  11061.  
  11062. CRGN_DIFF      Source region 1 minus source region 2. 
  11063.  
  11064. The effects of these different combining operations on overlapping regions are 
  11065. shown in the following figure. Their effects on separate regions are shown in 
  11066. the figure after the following figure. 
  11067.  
  11068. Combining Overlapping Regions 
  11069.  
  11070. The source regions are two overlapping rectangles. The regions that result from 
  11071. the various combine operations are shown as shaded areas. 
  11072.  
  11073. Output from GpiCombineRegion tells you whether the resulting region is a NULL 
  11074. region, rectangular region, or complex region. A complex region is any region 
  11075. defined by two or more rectangles. 
  11076.  
  11077. To change the definition of a region while keeping the same region handle, call 
  11078. GpiSetRegion. This function accepts, as input, the number and dimensions of the 
  11079. rectangles that now define the region, just as GpiCreateRegion does. However, 
  11080. GpiSetRegion also accepts the handle of the region to be updated. 
  11081. GpiSetRegion, like GpiCreateRegion, takes a region definition to be the union 
  11082. of a sequence of rectangles (that are effectively ORed together).  In the case 
  11083. of GpiCreateRegion, a new region is created and its handle returned. In the 
  11084. case of GpiSetRegion, the previous definition is discarded and replaced by the 
  11085. new definition that is associated with the existing region handle. 
  11086.  
  11087. Combining Disjoint Regions 
  11088.  
  11089. The two source regions do not overlap. The regions that result from the various 
  11090. combine operations are shown as shaded areas. The result from a CRGN_AND 
  11091. combining of separate regions is a NULL region. 
  11092.  
  11093.  
  11094. ΓòÉΓòÉΓòÉ 11.1.4.2. Moving a Region ΓòÉΓòÉΓòÉ
  11095.  
  11096. To move a region, call GpiOffsetRegion. This function accepts, as input, the 
  11097. region handle and an offset value that is added to every coordinate point of 
  11098. the region. 
  11099.  
  11100. GpiOffsetRegion moves a region by a specific number of device coordinates. By 
  11101. specifying positive or negative x- and y-values an application can move a 
  11102. region in any direction, relative to its current position. 
  11103.  
  11104.  
  11105. ΓòÉΓòÉΓòÉ 11.1.4.3. Determining Region Characteristics ΓòÉΓòÉΓòÉ
  11106.  
  11107. Regions are used in many operations. There are several functions that determine 
  11108. the characteristics of regions because these characteristics influence the 
  11109. outcome of the operation being performed. 
  11110.  
  11111. To determine whether two regions are identical, call GpiEqualRegion. This 
  11112. function accepts, as input, the two region handles. Regions are identical if 
  11113. the only difference between them is an empty region. For example, a rectangular 
  11114. region whose lower-left corner is at 10,10 is not identical to a region whose 
  11115. lower-left corner is at 50,50, even if the regions have exactly the same 
  11116. dimensions. The two regions also must be of the same device class to be 
  11117. considered identical. 
  11118.  
  11119. To determine the rectangles that compose a region, call GpiQueryRegionRects, 
  11120. which retrieves the coordinates of a series of rectangles that, when  ORed 
  11121. together, define the shape of the regions. 
  11122.  
  11123. Note:  The individual regions returned may differ in size and number from those 
  11124.        originally used to specify the region 
  11125.  
  11126. GpiQueryRegionRects accepts, as input, the region handle and the maximum number 
  11127. of rectangles that can be returned. The division of the region into multiple 
  11128. rectangles is handled automatically by the PM programming interface. 
  11129.  
  11130. It is not necessary for an application to retrieve all the rectangles in a 
  11131. single function. Your application can call GpiQueryRegionRects any number of 
  11132. times.  Therefore, the application must specify the maximum number of 
  11133. rectangles and the rectangle number to start from in each function. 
  11134.  
  11135. No assumptions can be made about the number and coordinates of rectangles 
  11136. returned except that they will define the specified region precisely. The 
  11137. purpose of specifying the number of rectangles in the query is to ensure that 
  11138. the system does not return more coordinates than can fit in the RECTL array. 
  11139.  
  11140. To determine whether a point is inside the borders of a region, call 
  11141. GpiPtInRegion. This function is especially useful in applications that must 
  11142. determine whether the mouse pointer is over a region. The particular point must 
  11143. be expressed in device coordinates. 
  11144.  
  11145. To determine whether any part of a specified rectangle lies within a region, 
  11146. call GpiRectInRegion. This function accepts, as input, the region handle and 
  11147. the rectangle as specified in device coordinates. 
  11148.  
  11149. To determine the coordinates of the smallest rectangle that encloses a region, 
  11150. call GpiQueryRegionBox. This function accepts the region handle as input. The 
  11151. output from this function tells you whether the bounding region is rectangular, 
  11152. NULL, or complex. 
  11153.  
  11154.  
  11155. ΓòÉΓòÉΓòÉ 11.1.4.4. Converting a Region to a Clip Region ΓòÉΓòÉΓòÉ
  11156.  
  11157. Clipping is the process an application uses to limit graphics output to a 
  11158. specific area (called the clipping area) of the display or page. Clipping is 
  11159. discussed in Clipping and Boundary Determination. 
  11160.  
  11161. There are several clipping functions provided by the PM programming interface. 
  11162. However, if your application requires a clipping boundary in device 
  11163. coordinates, it must define the boundary with a region. To convert the region 
  11164. into a clipping boundary, call GpiSetClipRegion. The clip region, as defined by 
  11165. this operation, becomes the current clip region of all subsequent drawing 
  11166. operations. 
  11167.  
  11168. GpiSetClipRegion accepts, as input, the region handle. A NULL region handle 
  11169. sets the clip region to infinity, effectively performing no clipping. 
  11170.  
  11171. Unlike clip paths, the region that is no longer the current clip region is not 
  11172. deleted. It retains the effects of any changes made to it while it was a clip 
  11173. region; and it can be used with the other region functions, including being 
  11174. reselected as the clip region with GpiSetClipRegion. 
  11175.  
  11176. You do not have to deselect the current clip region before selecting another. 
  11177. Each selected clip region automatically replaces the one before it. If there is 
  11178. an existing clip region when you call GpiSetClipRegion, it reverts to a normal 
  11179. region, and its handle is returned. 
  11180.  
  11181. Note:  Clip regions and clip paths share the same low-level implementation. Use 
  11182.        paths when you want to define your shape in world coordinates using 
  11183.        drawing primitives, and regions when you want to define it in device 
  11184.        coordinates (or world coordinates) using rectangles. Regions are 
  11185.        generally faster to define. 
  11186.  
  11187. When you have selected the current clip region, none of the region functions 
  11188. described thus far can be used for that region. The following functions can be 
  11189. used with the current clip region: 
  11190.  
  11191. o GpiQueryClipBox 
  11192. o GpiIntersectClipRectangle 
  11193. o GpiExcludeClipRectangle 
  11194. o GpiOffsetClipRegion 
  11195. o GpiPtVisible 
  11196. o GpiRectVisible. 
  11197.  
  11198. These functions are described in Clipping and Boundary Determination. All of 
  11199. these functions work in world coordinates, rather than device coordinates, and 
  11200. therefore, are subject to current transformations. 
  11201.  
  11202. GpiPtVisible and GpiRectVisible do not apply exclusively to clip regions. 
  11203.  
  11204. When the screen contents are altered (for example, when a window is sized), you 
  11205. have to be able to repair the part of the screen image affected by the change. 
  11206. The following figure illustrates the necessary region. dup. 
  11207.  
  11208. Repairing the Screen with Clip Regions 
  11209.  
  11210. To improve performance of the drawing operation, you can restrict the redrawing 
  11211. and repair work to the affected parts of the screen. 
  11212.  
  11213. Use WinQueryUpdateRegion to determine whether graphics objects are totally 
  11214. outside the update region and need not be drawn at all. Graphics objects that 
  11215. are within, or are partly outside, the update region should be drawn, and the 
  11216. system will perform the required clipping automatically. 
  11217.  
  11218. Define a clipping region using the dimensions of the update region.  Then call 
  11219. an appropriate GPI drawing request, such as GpiDrawChain, to redraw the screen 
  11220. contents. Any drawing that would occur outside the clip region is discarded 
  11221. according to the standard clipping rules. Only those graphics within the clip 
  11222. region are redrawn. 
  11223.  
  11224.  
  11225. ΓòÉΓòÉΓòÉ 11.1.4.5. Deleting a Region ΓòÉΓòÉΓòÉ
  11226.  
  11227. To delete a region, call GpiDestroyRegion. This function accepts, as input, the 
  11228. region handle. If the region is the current clip region, it cannot be deleted. 
  11229. To delete a current clip region, first call GpiSetClipRegion and specify a NULL 
  11230. region handle.  The region is no longer the current clip region and can be 
  11231. deleted. 
  11232.  
  11233.  
  11234. ΓòÉΓòÉΓòÉ 11.2. Using Regions ΓòÉΓòÉΓòÉ
  11235.  
  11236. You can use the region functions to: 
  11237.  
  11238. o Create or delete a region 
  11239. o Combine regions 
  11240. o Compare regions 
  11241. o Move a region 
  11242. o Paint and frame a region 
  11243. o Locate a point with respect to a region 
  11244. o Determine the coordinates of region rectangles. 
  11245.  
  11246.  
  11247. ΓòÉΓòÉΓòÉ 11.2.1. Creating and Deleting a Region ΓòÉΓòÉΓòÉ
  11248.  
  11249. To create a region: 
  11250.  
  11251.  1. Create an array of RECTL structures containing the dimensions of the 
  11252.     rectangles that will compose the region. 
  11253.  
  11254.  2. Call GpiCreateRegion to create the region. (This function returns a handle 
  11255.     that identifies the region.) 
  11256.  
  11257. To delete a region, pass the handle returned by the GpiCreateRegion function to 
  11258. GpiDestroyRegion. 
  11259.  
  11260. The following figure shows how to create and delete a region. 
  11261.  
  11262. #include <os2.h>
  11263. void fncREGN01(void){
  11264.     HPS  hps;                            /* Presentation-space handle    */
  11265.     HRGN hrgn;                           /* Region handle                */
  11266.     RECTL arcl[] = {
  11267.          25,  50,                        /* Rectangle 1                  */
  11268.          75, 100,
  11269.          50,  75,                        /* Rectangle 2                  */
  11270.         100, 150,
  11271.          75, 125,                        /* Rectangle 3                  */
  11272.         200, 175,
  11273.         150,  75,                        /* Rectangle 4                  */
  11274.         250, 150 };
  11275.  
  11276.     hrgn = GpiCreateRegion(hps,        /* Creates region                 */
  11277.         sizeof(arcl) / sizeof (RECTL), /* Number of rectangles in region */
  11278.         arcl);                         /* Array of rectangle structures  */
  11279.         .
  11280.         . /* Work with the region here.                                  */
  11281.         .
  11282.     GpiDestroyRegion(hps, hrgn);   /* Destroys region identified by hrgn */
  11283. } /* fncREGN01 */
  11284.  
  11285.  
  11286. Creating and Deleting a Region 
  11287.  
  11288.  
  11289. ΓòÉΓòÉΓòÉ 11.2.2. Combining Regions ΓòÉΓòÉΓòÉ
  11290.  
  11291. To combine two regions: 
  11292.  
  11293.  1. Create a region that the operating system can use as the destination region 
  11294.     when it combines the source regions. 
  11295.  2. Determine which of the 5 combining methods to use. 
  11296.  3. Call GpiCombineRegion. 
  11297.  
  11298. The following figure shows how to combine 2 regions by using the OR operation: 
  11299.  
  11300. #define INCL_GPIREGIONS
  11301. #include <os2.h>
  11302. void fncREGN02(void){
  11303.     HPS  hps;
  11304.     HRGN hrgn1, hrgn2, hrgn3;          /* Region handles                    */
  11305.     RECTL rcl1, rcl2;
  11306.  
  11307.     rcl1.xLeft = 50; rcl1.yBottom = 100;
  11308.     rcl1.xRight = 200; rcl1.yTop = 175;
  11309.     hrgn1 = GpiCreateRegion(hps, 1L, &rcl1);        /* First source region  */
  11310.  
  11311.     rcl2.xLeft = 125; rcl2.yBottom = 150;
  11312.     rcl2.xRight = 225; rcl2.yTop = 200;
  11313.     hrgn2 = GpiCreateRegion(hps, 1L, &rcl2);        /* Second source region */
  11314.  
  11315.     hrgn3 = GpiCreateRegion(hps, 0L, (PRECTL) NULL); /* Destination region  */
  11316.  
  11317.     /* Combine the regions. */
  11318.     GpiCombineRegion(hps, hrgn3, hrgn1, hrgn2, CRGN_OR);
  11319. } /* fncREGN02 */
  11320.  
  11321.  
  11322. Combining Regions 
  11323.  
  11324.  
  11325. ΓòÉΓòÉΓòÉ 11.2.3. Comparing Regions ΓòÉΓòÉΓòÉ
  11326.  
  11327. GpiEqualRegion determines whether two regions are identical. The following 
  11328. figure shows how to compare regions. 
  11329.  
  11330. #define INCL_GPIREGIONS
  11331. #include <os2.h>
  11332. void fncREGN03(void){
  11333.     HPS hps;                    /* Presentation-space handle         */
  11334.     HRGN hrgn1, hrgn2;          /* Region handles                    */
  11335.     LONG lEqual;                /* Return value for GpiEqualRegion   */
  11336.     RECTL rcl1, rcl2;           /* Structures for region coordinates */
  11337.  
  11338.     rcl1.xLeft = 50; rcl1.yBottom = 100;
  11339.     rcl1.xRight = 200; rcl1.yTop = 175;
  11340.     hrgn1 = GpiCreateRegion(hps, 1, &rcl1);    /* Creates first region  */
  11341.  
  11342.     rcl2.xLeft = 125; rcl2.yBottom = 150;
  11343.     rcl2.xRight = 225; rcl2.yTop = 200;
  11344.     hrgn2 = GpiCreateRegion(hps, 1, &rcl2);    /* Creates second region */
  11345.  
  11346.     lEqual = GpiEqualRegion(hps, hrgn1, hrgn2); /* Compares regions     */
  11347.     if (lEqual == EQRGN_EQUAL)
  11348.     {
  11349.         .
  11350.         .   /* Regions are equal.     */
  11351.         .
  11352.     }
  11353.     else if (lEqual == EQRGN_NOTEQUAL)
  11354.     {
  11355.         .
  11356.         .   /* Regions are not equal. */
  11357.         .
  11358.     }
  11359.     else if (lEqual == EQRGN_ERROR)
  11360.     {
  11361.         .
  11362.         .   /* An error occurred.     */
  11363.         .
  11364.     }
  11365. } /* fncREGN03 */
  11366.  
  11367.  
  11368. Comparing Regions 
  11369.  
  11370.  
  11371. ΓòÉΓòÉΓòÉ 11.2.4. Offsetting a Region ΓòÉΓòÉΓòÉ
  11372.  
  11373. GpiOffsetRegion moves a region, by a specified offset, from its current 
  11374. position (in world space). This function must be called with the address of a 
  11375. POINTL structure that contains an x and a y translation factor. The following 
  11376. figure shows how to offset a region. 
  11377.  
  11378. } /* fncREGN04 */
  11379.     POINTL ptlNewPos;             /* Structure for offset value  */
  11380.  
  11381.     ptlNewPos.x = 200;            /* Sets x offset               */
  11382.     ptlNewPos.y = 10;             /* Sets y offset               */
  11383.  
  11384.     GpiOffsetRegion(hps, hrgn, &ptlNewPos);    /* Offsets region */
  11385.  
  11386.  
  11387. Offsetting a Region 
  11388.  
  11389.  
  11390. ΓòÉΓòÉΓòÉ 11.2.5. Painting a Region ΓòÉΓòÉΓòÉ
  11391.  
  11392. GpiPaintRegion fills a region with the current fill pattern, using the colors 
  11393. and mix mode that appear in the current AREABUNDLE structure.  GpiFrameRegion 
  11394. draws a frame around a region by tracing the perimeter of the region with a 
  11395. rectangle of a specified size. The following figure shows how to change the 
  11396. fill-pattern color to green, paint a region, and draw a frame around the 
  11397. region. 
  11398.  
  11399.     SIZEL sizl;                        /* Structure for size of frame */
  11400.     HPS  hps;                          /* Presentation-space handle   */
  11401.     HRGN hrgn;                         /* Region handle               */
  11402.  
  11403.     GpiSetColor(hps, CLR_DARKPINK);
  11404.     GpiPaintRegion(hps, hrgn);         /* Paint region dark pink      */
  11405.     GpiSetColor(hps, CLR_BLACK);
  11406.     sizl.cx = 5;
  11407.     sizl.cy = 5;
  11408.     GpiFrameRegion(hps, hrgn, &sizl);   /* 5-by-5 black frame         */
  11409.  
  11410.  
  11411. Painting a Region 
  11412.  
  11413.  
  11414. ΓòÉΓòÉΓòÉ 11.2.6. Locating a Point with Respect to a Region ΓòÉΓòÉΓòÉ
  11415.  
  11416. To determine whether the mouse pointer lies within a region: 
  11417.  
  11418.  1. Retrieve the mouse-pointer coordinates and store them in a POINTL 
  11419.     structure. 
  11420.  
  11421.  2. Call GpiPtInRegion, passing it a handle that identifies the appropriate 
  11422.     region and the address of the POINTL structure from Step 1. 
  11423.  
  11424.  3. Examine the value that GpiPtInRegion returns to determine whether the point 
  11425.     lies within the region. 
  11426.  
  11427. The following figure shows how to locate the mouse pointer with respect to a 
  11428. region. 
  11429.  
  11430. #define INCL_GPIREGIONS
  11431. #include <os2.h>
  11432. void fncREGN04(void){
  11433.     POINTL ptlCurPos;      /* Mouse coordinates              */
  11434.     HPS hps;               /* Presentation-space handle      */
  11435.     HRGN hrgn;             /* Region handle                  */
  11436.     LONG lPosition;        /* Return value for GpiPtInRegion */
  11437.  
  11438.     /* Determine mouse coordinates and store in ptlCurPos.   */
  11439.     lPosition = GpiPtInRegion(hps, hrgn, &ptlCurPos);
  11440.     if (lPosition == PRGN_INSIDE) {
  11441.         .
  11442.         . /* Point lies within region.  */
  11443.         .
  11444.     } /* if */
  11445.     else if (lPosition == PRGN_OUTSIDE) {
  11446.         .
  11447.         . /* Point lies outside region. */
  11448.         .
  11449.     } /* else-if */
  11450.  
  11451.  
  11452. Locating a Point in a Region 
  11453.  
  11454.  
  11455. ΓòÉΓòÉΓòÉ 11.2.7. Determining Coordinates of Rectangles in a Region ΓòÉΓòÉΓòÉ
  11456.  
  11457. If a region consists of more than one rectangle, you can call 
  11458. GpiQueryRegionRects to retrieve the coordinates of the lower-left and 
  11459. upper-right corners of each rectangle. 
  11460.  
  11461. If you use GpiQueryRegionRects to retrieve every rectangle requested to define 
  11462. a region, the function retrieves the coordinates of as many contiguous 
  11463. rectangles as required. GpiQueryRegionRects returns the coordinates of the 
  11464. rectangles that define a region to an array of RECTL structures, and returns 
  11465. the number of rectangles that were requested for the definition to the 
  11466. crcReturned field of the RGNRECT structure.  Your RECTL array may not be large 
  11467. enough to hold all of the rectangles.  Specify the maximum it can accept and 
  11468. request the remainder in subsequent functions if necessary. 
  11469.  
  11470. To determine the coordinates of the rectangles that form a region, follow these 
  11471. steps: 
  11472.  
  11473.  1. Create an array of RECTL structures that will receive the rectangle 
  11474.     coordinates.  More rectangles may be required to define the region than 
  11475.     were required to create it. 
  11476.  
  11477.  2. Fill in the ircStart, crc, and usDirection fields of the RGNRECT structure. 
  11478.     The crc field can specify more rectangles than will be returned by 
  11479.     GpiQueryRegionRects. 
  11480.  
  11481.  3. Call GpiQueryRegionRects to retrieve the coordinates. 
  11482.  
  11483. The following figure shows how to determine the number of rectangles that 
  11484. define a region, the coordinates of the rectangles in that region, and how to 
  11485. create a new region using those coordinates. 
  11486.  
  11487. #define INCL_GPIREGIONS
  11488. #include <os2.h>
  11489. void fncREGN05(void){
  11490.     RGNRECT rgnrc;               /* Structure for region rectangles       */
  11491.     RECTL arcl1[5];              /* Array for determining rectangle count */
  11492.     PRECTL parcl;                /* Array for rectangle coordinates       */
  11493.     ULONG cRects = 0;            /* Total number of rectangles in region  */
  11494.     HPS hps;
  11495.     HRGN hrgn3;
  11496.  
  11497.     rgnrc.ircStart = 1;          /* Rectangle to start with               */
  11498.     rgnrc.crc = 5;               /* Number of rectangles to query         */
  11499.     rgnrc.ulDirection = RECTDIR_LFRT_BOTTOP;      /* Direction to query   */
  11500.  
  11501.     /**********************************************************************/
  11502.     /*  Determine the total number of rectangles in the region by         */
  11503.     /*  repeatedly calling GpiQueryRegionRects with an array of 5 RECTL   */
  11504.     /*  structures. The loop terminates when the function retrieves less  */
  11505.     /*  than 5 rectangles.                                                */
  11506.     /**********************************************************************/
  11507.     do {
  11508.         GpiQueryRegionRects(hps, /* Handle of presentation space          */
  11509.             hrgn3,               /* Region to query                       */
  11510.             (PRECTL) NULL,       /* Gets all rectangles in region         */
  11511.             &rgnrc,              /* Structure with rectangle data         */
  11512.             arcl1);              /* Array of structures for coordinates   */
  11513.  
  11514.         cRects += rgnrc.crcReturned;
  11515.     } while (rgnrc.crcReturned == rgnrc.crc); /* While 5 rects retrieved  */
  11516.  
  11517.     //cRects = rgnrc.crcReturned + (rgnrc.ircStart - 1);
  11518.  
  11519.     rgnrc.ircStart = 0;                  /* Rectangle to start with       */
  11520.     rgnrc.crc = cRects;                  /* Number of rectangles to query */
  11521.  
  11522.     /* Allocate enough memory for all RECTL structures.                   */
  11523.     parcl = (PRECTL) malloc(cRects * sizeof(RECTL));
  11524.  
  11525.     /* Fill array with coordinates of all rectangles.                     */
  11526.     GpiQueryRegionRects(hps,     /* Handle of presentation space          */
  11527.         hrgn3,                   /* Region to query                       */
  11528.         (PRECTL) NULL,           /* Gets all rectangles in region         */
  11529.         &rgnrc,                  /* Structure with rectangle data         */
  11530.         parcl);                  /* Array of structures for coordinates   */
  11531. } /* fncREGN05 */
  11532.  
  11533.  
  11534. Determining Rectangle Coordinates in a Region 
  11535.  
  11536.  
  11537. ΓòÉΓòÉΓòÉ 11.3. Summary ΓòÉΓòÉΓòÉ
  11538.  
  11539. The following table summarizes the region object functions. 
  11540.  
  11541. Region Functions 
  11542.  
  11543. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11544. ΓöéFunction Name           ΓöéDescription                         Γöé
  11545. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11546. ΓöéGpiCombineRegion        ΓöéCombines 2 regions in any of 5 ways.Γöé
  11547. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11548. ΓöéGpiCreateRegion         ΓöéCreates a region from 1 or more     Γöé
  11549. Γöé                        Γöérectangles. If there are 2 or more  Γöé
  11550. Γöé                        Γöérectangles, they are combined with  Γöé
  11551. Γöé                        Γöéan OR operation.                    Γöé
  11552. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11553. ΓöéGpiDestroyRegion        ΓöéDeletes a region and frees the      Γöé
  11554. Γöé                        Γöémemory associated with it.          Γöé
  11555. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11556. ΓöéGpiEqualRegion          ΓöéDetermines whether 2 regions are    Γöé
  11557. Γöé                        Γöéequal.                              Γöé
  11558. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11559. ΓöéGpiFrameRegion          ΓöéDraws a frame around a region by    Γöé
  11560. Γöé                        Γöétracing the perimeter.              Γöé
  11561. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11562. ΓöéGpiOffsetRegion         ΓöéMoves a region, other than a clip   Γöé
  11563. Γöé                        Γöéregion, in any direction by the     Γöé
  11564. Γöé                        Γöéspecified amount.                   Γöé
  11565. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11566. ΓöéGpiPaintRegion          ΓöéFills a region, other than a clip   Γöé
  11567. Γöé                        Γöéregion, with the current fill       Γöé
  11568. Γöé                        Γöépattern.                            Γöé
  11569. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11570. ΓöéGpiPtInRegion           ΓöéDetermines if a point lies within a Γöé
  11571. Γöé                        Γöégiven region, other than a clip     Γöé
  11572. Γöé                        Γöéregion.                             Γöé
  11573. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11574. ΓöéGpiQueryRegionBox       ΓöéDetermines the dimensions of the    Γöé
  11575. Γöé                        Γöésmallest rectangle that surrounds   Γöé
  11576. Γöé                        Γöéthe entire region.                  Γöé
  11577. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11578. ΓöéGpiQueryRegionRects     ΓöéDetermines the coordinates of       Γöé
  11579. Γöé                        Γöéindividual rectangles that compose aΓöé
  11580. Γöé                        Γöéregion.                             Γöé
  11581. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11582. ΓöéGpiRectInRegion         ΓöéDetermines if all or part of a      Γöé
  11583. Γöé                        Γöérectangle lies within a region.     Γöé
  11584. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11585. ΓöéGpiSetRegion            ΓöéReplaces the definition of an       Γöé
  11586. Γöé                        Γöéexisting region with a new          Γöé
  11587. Γöé                        Γöédefinition described by one or more Γöé
  11588. Γöé                        Γöérectangles.                         Γöé
  11589. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11590.  
  11591. The following table summarizes the data structures used by the region object 
  11592. functions. 
  11593.  
  11594. Region Structures 
  11595.  
  11596. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11597. ΓöéStructure Name          ΓöéDescription                         Γöé
  11598. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11599. ΓöéRECTL                   ΓöéA structure specifying the values ofΓöé
  11600. Γöé                        Γöé2 (x,y) coordinate pairs defining   Γöé
  11601. Γöé                        Γöéthe bottom-left and top-right       Γöé
  11602. Γöé                        Γöécoordinates of a rectangle.         Γöé
  11603. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11604. ΓöéRGNRECT                 ΓöéA structure specifying a start      Γöé
  11605. Γöé                        Γöérectangle number, a count of the    Γöé
  11606. Γöé                        Γöémaximum number of rectangles to be  Γöé
  11607. Γöé                        Γöéreturned and a field to be updated  Γöé
  11608. Γöé                        Γöéwith the number of region rectanglesΓöé
  11609. Γöé                        Γöéreturned by GpiQueryRegionRects.    Γöé
  11610. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11611.  
  11612.  
  11613. ΓòÉΓòÉΓòÉ 12. Creating and Drawing Retained Graphics ΓòÉΓòÉΓòÉ
  11614.  
  11615. There are two types of graphics output in the OS/2 operating system:  retained 
  11616. and nonretained. This chapter describes creating and replaying retained 
  11617. graphics. 
  11618.  
  11619. The following topics are related to the information in this chapter: 
  11620.  
  11621. o Presentation spaces 
  11622. o Device contexts 
  11623. o Coordinate spaces and transformations 
  11624. o Editing graphic segments. 
  11625.  
  11626.  
  11627. ΓòÉΓòÉΓòÉ 12.1. About Creating and Drawing Retained Graphics ΓòÉΓòÉΓòÉ
  11628.  
  11629. An application draws by calling graphics functions. Applications store retained 
  11630. graphics in segments, which can be edited.  This means that the retained image 
  11631. can be modified without having to re-create the unmodified portion using 
  11632. multiple GPI functions. 
  11633.  
  11634. When using nonretained graphics, the output appears on the output device (for 
  11635. example, a window) immediately.  However, if part of the picture is erased or 
  11636. must be repeated, the application must call the same graphics function a 
  11637. second, or even a third time. 
  11638.  
  11639. There are many other advantages to using retained graphics, including: 
  11640.  
  11641. o Convenience-An application can draw retained graphics with a single function 
  11642.   that accesses the storage area containing all the individual functions 
  11643.   necessary for the object. 
  11644.  
  11645. o Flexibility-An application can redraw graphics retained in the segment store 
  11646.   to any number of device contexts. 
  11647.  
  11648. o Editing-An application can modify an object without having to call all the 
  11649.   functions necessary to re-create the picture.  Individual segments can be 
  11650.   moved, scaled, or rotated; then, redrawn. 
  11651.  
  11652.   Editing the graphics within a segment is described in Editing Retained 
  11653.   Graphics and Graphics Segments. 
  11654.  
  11655. o Power-An application can access the more powerful and useful graphics 
  11656.   functions only when graphics are stored in segments. 
  11657.  
  11658. o Organization-An application can use segments to store the components that 
  11659.   will be assembled into the final picture. 
  11660.  
  11661. Primarily, a graphics segment is a means of grouping and storing graphics 
  11662. primitives and their attributes. Although the graphics within a segment usually 
  11663. are related in some way, they do not have to be. A segment might contain a 
  11664. number of unrelated GPI functions that you want to keep and execute at specific 
  11665. times. 
  11666.  
  11667. Retained graphics do affect application performance, however, in that a normal 
  11668. presentation space requires 114KB of main memory more than a micro presentation 
  11669. space; and using the drawing mode DM_RETAIN adds an additional 46KB. 
  11670.  
  11671. Note: 
  11672.  
  11673. Your application can have up to 16K (16378) segments in the segment store of a 
  11674. single presentation space. The size of an individual segment is limited only by 
  11675. the amount of storage available to you. 
  11676.  
  11677. Do not confuse a graphic segment with a memory segment. 
  11678.  
  11679.  
  11680. ΓòÉΓòÉΓòÉ 12.1.1. Drawing Modes ΓòÉΓòÉΓòÉ
  11681.  
  11682. When you create a presentation space, the drawing mode is set to draw. Your 
  11683. application can change this mode using GpiSetDrawingMode. The two additional 
  11684. drawing modes provided by the PM programming interface are retain (DM_RETAIN) 
  11685. and draw-and-retain (DM_DRAWANDRETAIN). Your application can determine which 
  11686. drawing mode is set using GpiQueryDrawingMode. 
  11687.  
  11688. The drawing mode that you select becomes current for the presentation space, 
  11689. and it can be changed any number of times. Select the appropriate drawing mode 
  11690. before creating a segment. The drawing mode effects the segment type. 
  11691.  
  11692.  
  11693. ΓòÉΓòÉΓòÉ 12.1.1.1. Draw Mode ΓòÉΓòÉΓòÉ
  11694.  
  11695. In draw mode, graphics output is provided immediately to the currently 
  11696. associated device and is not retained in a segment store.  When the graphics 
  11697. have been drawn, they cannot be used again unless they are re-created. For 
  11698. example, when a window containing draw mode graphics is moved or sized, the 
  11699. graphics have to be re-created by the application. 
  11700.  
  11701. Draw mode graphics are suitable if an application is creating fairly simple 
  11702. graphics quickly or is maintaining its own graphics database.  In the latter 
  11703. case, there is nothing to gain by retaining graphics. 
  11704.  
  11705. A segment created when the drawing mode is DM_DRAW, is called a nonretained 
  11706. segment. While it might sound contradictory, nonretained segments have certain 
  11707. advantages that are described in Nonretained Graphic Segments. 
  11708.  
  11709.  
  11710. ΓòÉΓòÉΓòÉ 12.1.1.2. Retain Mode ΓòÉΓòÉΓòÉ
  11711.  
  11712. In retain mode, graphics are retained in the segment store only; they are not 
  11713. directed to the current device as they are created. 
  11714.  
  11715. In retain mode, the presentation space does not have to be associated with a 
  11716. device context when graphics are being defined. It is possible to define 
  11717. graphics and store their definitions without sending them to a display screen 
  11718. or printer. The concept of attribute currentness, however, is relevant only 
  11719. when you are drawing graphics to an output device. For example, the color, or 
  11720. other attribute, that is current when you define a primitive is the color in 
  11721. which the line is drawn. That color, or other attribute might not be the color 
  11722. that is current when you you actually draw the primitive. This is described in 
  11723. Attribute Currentness. 
  11724.  
  11725. Many of the GPI queries that return current attribute values are invalid in 
  11726. retain mode because current attribute values have no effect when graphics are 
  11727. not sent to an output device. 
  11728.  
  11729.  
  11730. ΓòÉΓòÉΓòÉ 12.1.1.3. Draw-and-Retain Mode ΓòÉΓòÉΓòÉ
  11731.  
  11732. In draw-and-retain mode, graphics are both drawn on the current device as they 
  11733. are created and stored for later use.  The GPI queries that return current 
  11734. attribute values are valid in draw-and-retain mode. 
  11735.  
  11736.  
  11737. ΓòÉΓòÉΓòÉ 12.1.2. Creating a Graphics Segment ΓòÉΓòÉΓòÉ
  11738.  
  11739. Your application signals the start of a graphics segment using GpiOpenSegment, 
  11740. which is valid only in a normal presentation space. The following figure is an 
  11741. example of 2 segments in a presentation space. 
  11742.  
  11743.  
  11744.                             Presentation Space
  11745.                           ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11746.                           Γöé                                     Γöé
  11747.                           Γöé   Graphics Segment 1                Γöé
  11748.                           Γöé   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ                    Γöé
  11749.                           Γöé   Γöé            Γöé                    Γöé
  11750. GpiOpenSegment (hps,1L);  Γöé   Γöé            Γöé                    Γöé
  11751. GpiSetXXX (hps,...);    ΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ     Γöé                    Γöé
  11752. GpiLine (hps,...);      ΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇ         Γöé                    Γöé
  11753. GpiCloseSegment (hps);    Γöé   Γöé            Γöé  Graphics Segment 2Γöé
  11754.                           Γöé   Γöé            Γöé  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    Γöé
  11755.                           Γöé   Γöé            Γöé  Γöé            Γöé    Γöé
  11756.                           Γöé   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ  Γöé            Γöé    Γöé
  11757.                           Γöé                   Γöé            Γöé    Γöé
  11758. GpiOpenSegment (hps,2L);  Γöé                   Γöé            Γöé    Γöé
  11759. GpiSetXXX (hps,...);    ΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇ      Γöé    Γöé
  11760. GpiLine (hps,...);      ΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇ         Γöé    Γöé
  11761. GpiCloseSegment (hps);    Γöé                   Γöé            Γöé    Γöé
  11762.                           Γöé                   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    Γöé
  11763.                           Γöé                                     Γöé
  11764.                           Γöé                                     Γöé
  11765.                           ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11766.  
  11767. Graphics Segments in a Presentation Space 
  11768.  
  11769. GpiOpenSegment accepts, as input, the presentation space handle and a long 
  11770. integer value, which names each segment. 
  11771.  
  11772. OS/2 applications identify segments with long integer values. If you want to 
  11773. refer to the segment individually in later graphics operations (for example, to 
  11774. edit the segment) the identifier you supply must be greater than 0 and unique 
  11775. within the presentation space. 
  11776.  
  11777. If you do not want to refer to the segment individually after it is created, 
  11778. you can give the segment an identifier of 0. You might do this when you are 
  11779. creating nonretained segments, for example.  Any number of segments can have 
  11780. the 0 identifier; they are referred to throughout this guide as zero segments. 
  11781.  
  11782. To determine which names already have been used in a presentation space, use 
  11783. GpiQuerySegmentNames. This function returns an array of segment names for all 
  11784. retained segments, excluding zero segments, within a specified name range. 
  11785.  
  11786. Segments do not have to be named in consecutive order (although it is 
  11787. recommended for organizational purposes) because the segment order can be 
  11788. changed using GpiSetSegmentPriority. 
  11789.  
  11790.  
  11791. ΓòÉΓòÉΓòÉ 12.1.3. Filling a Graphics Segment ΓòÉΓòÉΓòÉ
  11792.  
  11793. After a graphic segment is opened, the GPI functions that follow become a part 
  11794. of a retained segment and are executed every time the segment, itself, is 
  11795. drawn. 
  11796.  
  11797. The typical GPI functions that would be called are those that: 
  11798.  
  11799. o Create graphics primitives-such as lines or markers 
  11800. o Assign attributes to those primitives-such as color or line type. 
  11801.  
  11802. However, there are a few GPI functions that you cannot call while there is an 
  11803. open segment, for example a second GpiOpenSegment. These functions are 
  11804. identified in GPI Functions. 
  11805.  
  11806. A presentation space can contain many segments. Each time you open a new 
  11807. segment, many attributes reset themselves to default values. Therefore, the 
  11808. current position and attribute values that apply before you call GpiOpenSegment 
  11809. cannot be guaranteed to be in effect after you call the function. Beginning 
  11810. each segment with a number of attribute-setting requests and, possibly, with 
  11811. GpiSetCurrentPosition, is recommended. Your application also might take 
  11812. advantage of GpiSetDefAttrs, for example, to minimize the number of attributes 
  11813. that must dealt with upon opening a new segment. 
  11814.  
  11815.  
  11816. ΓòÉΓòÉΓòÉ 12.1.4. Closing a Graphics Segment ΓòÉΓòÉΓòÉ
  11817.  
  11818. When you have finished creating a graphics segment, close it using 
  11819. GpiCloseSegment. There can be only one open segment at a time in a single 
  11820. graphics presentation space, so you must close one segment before going on to 
  11821. the next. 
  11822.  
  11823. There is some degree of clean-up processing associated with using 
  11824. GpiCloseSegment, known as close-segment processing, that can make current 
  11825. attribute values unreliable. For more information about the effects of 
  11826. GpiOpenSegment and GpiCloseSegment on current attributes, see Graphics 
  11827. Attributes. 
  11828.  
  11829.  
  11830. ΓòÉΓòÉΓòÉ 12.1.5. Segment Attributes ΓòÉΓòÉΓòÉ
  11831.  
  11832. Each segment, whether retained or nonretained, has a number of characteristics, 
  11833. called attributes that you can set in accordance with your application's 
  11834. requirements. The attributes of a segment are quite different from those of a 
  11835. graphics primitive in that segment attributes have ON and OFF settings. There 
  11836. are 7 segment attributes; however, only 2 are described in this chapter: 
  11837. chained (ATTR_CHAINED) and fast-chained (ATTR_FASTCHAIN). 
  11838.  
  11839. When an application creates a segment in a presentation space, the operating 
  11840. system assigns initial attributes to it. By default, 5 of the attributes will 
  11841. be set ON and 2 will be set OFF. The chained and fast-chained attributes are 
  11842. set ON. Your application can alter these values using 
  11843. GpiSetInitialSegmentAttrs, or retrieve the values of the current initial 
  11844. attributes using GpiQueryInitialSegmentAttrs. 
  11845.  
  11846. The chain attribute tells the operating system to add each new segment in your 
  11847. application's presentation space to the segment chain. The fast-chained 
  11848. attribute tells the operating system to prevent the resetting of the primitive 
  11849. attributes to their default values before drawing the segment chain. 
  11850.  
  11851.  
  11852. ΓòÉΓòÉΓòÉ 12.1.5.1. Chained Attribute ΓòÉΓòÉΓòÉ
  11853.  
  11854. When you define a segment with the chained attribute switched ON, that segment 
  11855. becomes a part of the segment chain and is called a chained segment. The 
  11856. segment chain is composed of all chained segments defined in a single 
  11857. presentation space. The following figure illustrates the segment chain concept. 
  11858. Segments can be chained together so that they can be drawn as a group. By 
  11859. default, each new segment is chained to the previous segment. 
  11860.  
  11861. There can be only one segment chain at a time in a single presentation space, 
  11862. and all chained segments are chained to each other in the order in which you 
  11863. created them. Zero segments must have the chained attribute. 
  11864.  
  11865. Usually, a logical relationship exists between the segments in a segment chain, 
  11866. although this is not a requirement. The whole segment chain can be drawn using 
  11867. GpiDrawChain. Each segment in the chain is called a root segment. Root segments 
  11868. are affected by those GPI functions that act on the segment chain, but they 
  11869. also can be manipulated independently of the chain. 
  11870.  
  11871. Segments that are defined with the chained attribute switched OFF are called 
  11872. unchained segments. Your application can switch off the chain attribute using 
  11873. GpiSetInitialSegmentAttrs (hps, ATTR_CHAIN, ATTR_OFF). Unchained segments 
  11874. always are retained when they are created, regardless of the current 
  11875. drawing-mode parameter. An unchained segment must have a unique name. 
  11876.  
  11877. There are a number of reasons for defining a segment as unchained. For example, 
  11878. a particular segment might not belong to the picture that is defined by the 
  11879. segment chain. You also are likely to define as unchained any segment that 
  11880. belongs to the picture but that has no single, fixed place in the segment 
  11881. chain. A car wheel, for example, could be defined once but drawn four times in 
  11882. a picture of a car. It would have no single, fixed place in the segment chain, 
  11883. but would be included four times in the picture by being called from one or 
  11884. more root segments. 
  11885.  
  11886. A segment is called from another segment by including GpiCallSegmentMatrix in 
  11887. the calling segment. A segment and the segments it calls logically are one 
  11888. object. An important point about called segments is that they assume the 
  11889. primitive attribute settings of the calling segment. Of course, you can change 
  11890. the attribute settings within the called segment if the inherited values are 
  11891. inappropriate. 
  11892.  
  11893. A closed, unchained segment can be called from any other segment. Chained 
  11894. segments, however, cannot be called from other segments. 
  11895.  
  11896.  
  11897. ΓòÉΓòÉΓòÉ 12.1.5.2. Fast-Chained Attribute ΓòÉΓòÉΓòÉ
  11898.  
  11899. The fast-chained attribute applies only to chained segments. It prevents 
  11900. primitive attributes from being reset to their default values at the beginning 
  11901. of the segment, an aid to performance. There is unnecessary overhead in 
  11902. resetting attributes to their defaults if either of the following is true: 
  11903.  
  11904. o You are going to change the default values of the attributes at the start of 
  11905.   the segment. 
  11906.  
  11907. o You know that attributes have not been altered previously from their default 
  11908.   values. 
  11909.  
  11910. The fast-chained attribute is switched ON by default, and you should leave it 
  11911. on unless you specifically want attributes to be set to their default values. 
  11912. To turn off the fast-chained attribute, call GpiSetInitialSegmentAttrs (hps, 
  11913. ATTR_FASTCHAIN, ATTR_OFF). 
  11914.  
  11915.  
  11916. ΓòÉΓòÉΓòÉ 12.1.6. Actual Drawing Mode ΓòÉΓòÉΓòÉ
  11917.  
  11918. The drawing mode, as defined by GpiSetDrawingMode, works in conjunction with 
  11919. the segment status to produce the actual drawing mode. It is the actual drawing 
  11920. mode that determines whether graphics are: 
  11921.  
  11922. o Drawn directly to the output device 
  11923. o Retained in the segment store 
  11924. o Both drawn and retained. 
  11925.  
  11926. The actual drawing mode is summarized in the following table. 
  11927.  
  11928. The Current Drawing Mode 
  11929.  
  11930. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  11931. Γöé                 Γöé               ΓöéContext       Γöé              Γöé
  11932. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11933. ΓöéGpiSetDrawingModeΓöéChained SegmentΓöéUnchained     ΓöéOutside of anyΓöé
  11934. Γöéparameter        Γöé               ΓöéSegment       Γöésegment       Γöé
  11935. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11936. ΓöéDM_DRAWANDRETAIN Γöédraw-and-retainΓöéretain        Γöédraw          Γöé
  11937. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11938. ΓöéDM_RETAIN        Γöéretain         Γöéretain        Γöédraw          Γöé
  11939. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  11940. ΓöéDM_DRAW          Γöédraw           Γöéretain        Γöédraw          Γöé
  11941. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  11942.  
  11943. As you can see in the prceding tabke, graphics within chained segments always 
  11944. conform to the current drawing mode parameter. That is, they are drawn in 
  11945. DM_DRAW mode, retained in DM_RETAIN mode, and both drawn and retained in 
  11946. DM_DRAWANDRETAIN mode. 
  11947.  
  11948. Graphics in unchained segments always are retained, regardless of the current 
  11949. drawing-mode parameter. You cannot retain segments created when the current 
  11950. drawing-mode parameter is DM_DRAW, unless they are unchained segments. 
  11951.  
  11952. Similarly, graphics outside segments always are drawn without being retained. 
  11953. You cannot retain primitives outside segments, regardless of the current 
  11954. drawing mode. 
  11955.  
  11956. Note:  A micro presentation space has no segment store. Therefore, you cannot 
  11957.        create graphics segments in a micro presentation space, nor can you 
  11958.        change the drawing mode, which is always DM_DRAW. 
  11959.  
  11960.  
  11961. ΓòÉΓòÉΓòÉ 12.1.7. Drawing a Retained Graphic ΓòÉΓòÉΓòÉ
  11962.  
  11963. Your application can draw a complete segment chain with GpiDrawChain. The 
  11964. segments are drawn in the order in which they appear in the chain. For example, 
  11965. the segments in the following figure are drawn in the following order: 
  11966.  
  11967.  1. Root segment 1 
  11968.  2. Unchained segment A 
  11969.  3. Unchained segment B 
  11970.  4. Root segment 2 
  11971.  5. Unchained segment B 
  11972.  6. Root segment 3. 
  11973.  
  11974. Chained and Called Segments 
  11975.  
  11976. Segment A is called by root segment 1, and segment B is called by both segment 
  11977. A and root segment 2. Segment C calls segment D. Both C and D are unchained 
  11978. segments that are not called from the segment chain, and consequently, are not 
  11979. part of the segment chain. 
  11980.  
  11981. GpiSetSegmentPriority changes the position of a root segment (which must not be 
  11982. a zero segment) in the chain. As input to this function, you supply the name of 
  11983. the segment you want to reorder and the name of a reference segment. The 
  11984. reference segment is the segment that either will be immediately before, or 
  11985. immediately after, the reordered segment's new position in the chain. 
  11986.  
  11987. If the segment you are moving is to come after the reference segment in the 
  11988. chain, it is said to have a higher priority (HIGHER_PRI). If it is to come 
  11989. before the reference segment, it is said to have a lower priority (LOWER_PRI). 
  11990. The nearer a segment is to the end of the chain, the higher its priority. 
  11991.  
  11992. If you supply the name of an unchained segment as input to 
  11993. GpiSetSegmentPriority, the segment is added to the chain in the position you 
  11994. specify. To learn the position of a segment in the chain, use 
  11995. GpiQuerySegmentPriority. 
  11996.  
  11997. If your application called the following functions: 
  11998.  
  11999. GpiSetSegmentPriority (hps, C, 2, LOWER_PRI)
  12000. GpiSetSegmentPriority (hps, 3, 0, HIGHER_PRI)
  12001. GpiSetSegmentPriority (hps, B, 0, LOWER_PRI)
  12002.  
  12003. the segment chain in the previous figure would appear as in the following 
  12004. figure; and GpiDrawChain would draw the segments in the following order. 
  12005.  
  12006.  1. Root segment 3 
  12007.  2. Root segment 1 
  12008.  3. Unchained segment A 
  12009.  4. Unchained segment B 
  12010.  5. Segment C 
  12011.  6. Unchained segment D. 
  12012.  7. Root segment 2 
  12013.  8. Unchained segment B. 
  12014.  9. Segment B 
  12015.  
  12016.  
  12017. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12018. Γöé   Root   Γö£ΓöÇΓöÇΓöÇΓöÇΓöñ   Root   Γö£ΓöÇΓöÇΓöÇΓöÇΓöñ          Γö£ΓöÇΓöÇΓöÇΓöÇΓöñ   Root   Γö£ΓöÇΓöÇΓöÇΓöÇΓöñ          Γöé
  12019. ΓöéSegment 3 Γöé    ΓöéSegment 1 Γöé    ΓöéSegment C Γöé    ΓöéSegment 2 Γöé    ΓöéSegment B Γöé
  12020. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12021.                      Γöé               Γöé               Γöé
  12022.                      Γöé               Γöé               Γöé
  12023.                 ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12024.                 ΓöéUnchained Γöé    ΓöéUnchained Γöé    ΓöéUnchained Γöé
  12025.                 ΓöéSegment A Γöé    ΓöéSegment D Γöé    ΓöéSegment B Γöé
  12026.                 ΓööΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12027.                      Γöé
  12028.                      Γöé
  12029.                 ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12030.                 ΓöéUnchained Γöé
  12031.                 ΓöéSegment B Γöé
  12032.                 ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12033.  
  12034. Chained and Called Segments Reordered Using GpiSetSegmentPriority 
  12035.  
  12036.  
  12037. ΓòÉΓòÉΓòÉ 12.1.7.1. Segment Priority ΓòÉΓòÉΓòÉ
  12038.  
  12039. The priority of a segment, in conjunction with the current foreground and 
  12040. background mix attributes, affects how the picture is presented to the user. 
  12041. The segment with the highest priority is drawn last, and appears on top of the 
  12042. previously drawn primitives. Picture components in segments with low priorities 
  12043. risk being drawn over and never seen by the user. The mix attributes affect the 
  12044. graphics functions within each segment. 
  12045.  
  12046.  
  12047. ΓòÉΓòÉΓòÉ 12.1.7.2. GpiDrawSegment ΓòÉΓòÉΓòÉ
  12048.  
  12049. In the figure before the previous figure, Unchained Segment C and its called 
  12050. segment Unchained Segment D are not part of the segment chain and, therefore, 
  12051. are not drawn by GpiDrawChain. Both segments can be drawn using GpiDrawSegment 
  12052. (hps, C). 
  12053.  
  12054. The function GpiDrawSegment accepts as input any segment name greater than 
  12055. zero. GpiDrawSegment can draw individual segments both inside and outside the 
  12056. segment chain. Any segment that is called from the GpiDrawSegment-named segment 
  12057. also is drawn. 
  12058.  
  12059.  
  12060. ΓòÉΓòÉΓòÉ 12.1.7.3. GpiDrawFrom ΓòÉΓòÉΓòÉ
  12061.  
  12062. You can draw a smaller portion of the entire segment chain (but a larger 
  12063. portion than a single segment) using GpiDrawFrom. GpiDrawFrom accepts, as 
  12064. input, a presentation space handle and 2 nonzero segment names, the first of 
  12065. which must be part of the segment chain. GpiDrawFrom then draws the segments, 
  12066. starting with the first and ending with the last, including all chained and 
  12067. called segments. The order in which the segments are drawn is identical to that 
  12068. of the figure before the previous figure- a root segment, its first-to-last 
  12069. called segments, then the next root segment. 
  12070.  
  12071. If the second named segment does not appear between the first segment and the 
  12072. end of the chain, the drawing begins with the first and continues through the 
  12073. end of the chain, including all chained and called segments, again with the 
  12074. drawing order as described in the figure before the previous figure. 
  12075.  
  12076.  
  12077. ΓòÉΓòÉΓòÉ 12.1.8. Attribute Modes ΓòÉΓòÉΓòÉ
  12078.  
  12079. You can change primitive-attribute settings at any time; the new values you 
  12080. specify replace the existing values. For example, if the current foreground 
  12081. color is green and you change it to red, red replaces green as the foreground 
  12082. color attribute. 
  12083.  
  12084. When you set primitive attributes within a retained or nonretained segment, you 
  12085. can save the existing attribute values on a last-in-first-out (LIFO) stack, 
  12086. from where they can later be retrieved and made current again. You do this by 
  12087. selecting either of the 2 attribute modes: 
  12088.  
  12089. o AM_PRESERVE mode-Also known as push-and-set mode 
  12090. o AM_NOPRESERVE mode-Also known as set mode. 
  12091.  
  12092. In AM_NOPRESERVE mode, which is the default setting, existing attribute values 
  12093. are replaced by any new attribute values that you supply. In AM_PRESERVE mode, 
  12094. the existing attribute values are stored on a LIFO stack; then, the new values 
  12095. that you specify take effect. AM_PRESERVE mode also causes the current position 
  12096. to be saved if the position was specified using GpiSetCurrentPosition. If you 
  12097. use GpiMove to set the current position, the position is not saved, regardless 
  12098. of the attribute mode. Those attributes that are affected by the current 
  12099. attribute mode are listed in the Presentation Manager Programming Reference. 
  12100.  
  12101. To select a current attribute mode, use GpiSetAttrMode. The current attribute 
  12102. mode affects subsequent attribute-setting requests in the presentation space. 
  12103. Attribute modes are not applicable to micro presentation spaces, because 
  12104. graphics segments can be created only in normal presentation spaces. 
  12105.  
  12106. To retrieve an attribute value from the LIFO stack, use GpiPop, which pulls 
  12107. back the attribute that was stored most recently on the stack.  You can 
  12108. retrieve more than one attribute value by supplying a number as an input 
  12109. parameter of this function. For example, if you specify 4, GpiPop retrieves the 
  12110. 4 attributes that were most recently stored on the stack. If each of the values 
  12111. retrieved applies the same type of attribute to the same primitive (for 
  12112. example, if all four are line-type settings), the last one to be retrieved 
  12113. (and, therefore, the first one on the stack) becomes the current setting. 
  12114.  
  12115. If you save attribute values from any segment called from another segment, and 
  12116. do not retrieve the values using GpiPop, the values are restored automatically 
  12117. when the end of the segment is reached. If you save attribute values from any 
  12118. segment that is not called from another segment, and do not explicitly restore 
  12119. those values using GpiPop, they are lost at the end of the segment. 
  12120.  
  12121. The AM_PRESERVE mode is useful when you do not want attributes in calling 
  12122. segments to be overwritten by attributes specified in the called segments. This 
  12123. overwritting happens because a calling segment and the segments it calls are 
  12124. logically one object. Attribute changes within a called segment remain current 
  12125. upon return to the calling segment. If you set some attribute values at the 
  12126. start of a called segment, and the current attribute mode is AM_PRESERVE, the 
  12127. attribute values of the calling segment are stored on the LIFO stack. At the 
  12128. end of the called segment, the values on the stack are retrieved automatically 
  12129. so that the calling segment continues with its own attribute values. 
  12130.  
  12131.  
  12132. ΓòÉΓòÉΓòÉ 12.1.9. Reusing the Presentation Space ΓòÉΓòÉΓòÉ
  12133.  
  12134. A normal presentation space with segments retained in the segment store can be 
  12135. costly in terms of storage. Therefore, delete any presentation space that you 
  12136. no longer need, using GpiDestroyPS. If for example, your application is using a 
  12137. series of presentation spaces, each with a different format, the creation and 
  12138. deletion activity also can be costly. The PM programming interface provides the 
  12139. following functions that let you reuse or redefine an existing presentation 
  12140. space; so you can create a presentation space once, and use it any number of 
  12141. times. 
  12142.  
  12143. o GpiSavePS 
  12144. o GpiRestorePS 
  12145. o GpiResetPS 
  12146. o GpiSetPS. 
  12147.  
  12148.  
  12149. ΓòÉΓòÉΓòÉ 12.1.9.1. GpiSavePS ΓòÉΓòÉΓòÉ
  12150.  
  12151. GpiSavePS saves presentation space information (such as current primitive 
  12152. attributes and the current position) on a dedicated LIFO stack. The 
  12153. presentation space itself is unchanged; that is, it still exists, has the same 
  12154. presentation space handle, and the presentation page dimensions and format are 
  12155. the same. 
  12156.  
  12157. Output from GpiSavePS is a number that identifies the saved information on the 
  12158. LIFO stack. An output of 3, for example, tells you that this is the third lot 
  12159. of presentation space data on the stack. 
  12160.  
  12161.  
  12162. ΓòÉΓòÉΓòÉ 12.1.9.2. GpiRestorePS ΓòÉΓòÉΓòÉ
  12163.  
  12164. GpiRestorePS retrieves the saved information from the LIFO stack and reapplies 
  12165. it to the presentation space. Input to this function can be either the 
  12166. identifier returned to you from GpiSavePS or a relative value. A relative value 
  12167. of -1, for example, retrieves the information most recently stored on the 
  12168. stack. You do not have to restore the information that was most recently saved; 
  12169. however, any data that you skip over is discarded. 
  12170.  
  12171. A LIFO Stack with Four Items 
  12172.  
  12173. For example, if there are four items of data on the stack, as shown in the 
  12174. previous figure, and you request the restoration of item 2, items 3 and 4 are 
  12175. discarded. Item 1 is the only item remaining on the stack. 
  12176.  
  12177. You can restore item 2 by specifying either an absolute value of 2, or a 
  12178. relative value of -3. The relative value depends on the number of items 
  12179. currently in the stack.  The contents of the LIFO stack are purged whenever 
  12180. GpiAssociate is called. 
  12181.  
  12182.  
  12183. ΓòÉΓòÉΓòÉ 12.1.9.3. GpiResetPS ΓòÉΓòÉΓòÉ
  12184.  
  12185. When a presentation space is first created, it is in a neutral state. Current 
  12186. attributes are set to their initial default values; the current position is 
  12187. (0,0); the segment store contains no segments; and, there are no 
  12188. application-defined resources, such as logical color tables.  You can return an 
  12189. existing presentation space to this state using GpiResetPS.  GpiResetPS has 3 
  12190. levels of reset activity, each more powerful than the last. These are: 
  12191.  
  12192.  1. GRES_ATTRS, which is equivalent to the processing done by GpiCloseSegment. 
  12193.  
  12194.  2. GRES_SEGMENTS, which is equivalent to creating a new presentation space, 
  12195.     but without deleting any logical resources. All retained segments are 
  12196.     deleted from the segment store. 
  12197.  
  12198.  3. GRES_ALL, which is equivalent to creating a new presentation space. 
  12199.  
  12200. GpiResetPS does not alter the size or format of the presentation page. 
  12201.  
  12202.  
  12203. ΓòÉΓòÉΓòÉ 12.1.9.4. GpiSetPS ΓòÉΓòÉΓòÉ
  12204.  
  12205. GpiSetPS redefines the size and format of the presentation page. The processing 
  12206. performed when you call GpiSetPS is similar to that performed by GpiCreatePS, 
  12207. except that the presentation space already exists. The presentation space is 
  12208. returned to a neutral state (which is the equivalent of requesting GRES_ALL 
  12209. using GpiResetPS), and the presentation page is redefined. For example, you can 
  12210. change a presentation page defined in 0.01mm units to one defined in pels. 
  12211. Essentially, this lets you work with an new presentation space without having 
  12212. to delete one and create another. 
  12213.  
  12214. You also can use GpiSetPS to change the current mapping mode of a presentation 
  12215. space. To do this, use the PS_NORESET flag, which is the equivalent of 
  12216. requesting GRES_SEGMENTS using GpiResetPS. This feature is particularly useful 
  12217. if you are designing an application that deals with page layout and drafting, 
  12218. or if you want the screen size to correspond to the page size for the printed 
  12219. output. 
  12220.  
  12221.  
  12222. ΓòÉΓòÉΓòÉ 12.1.10. Nonretained Graphic Segments ΓòÉΓòÉΓòÉ
  12223.  
  12224. It is valid segment construction to create a segment bracket while the drawing 
  12225. mode is DM_DRAW. The GPI functions contained within the bracket are drawn 
  12226. immediately rather than being retained for future use; thus, this type of 
  12227. segment is called a nonretained segment. 
  12228.  
  12229. Because the usual reason for constructing segments is to take advantage of 
  12230. retained graphics, nonretained segments might appear as a contradiction in 
  12231. terms at first. However, there are four  particular advantages in their use: 
  12232.  
  12233. o If ATTR_FASTCHAIN is set to OFF, the GpiOpenSegment implicitly resets all 
  12234.   attributes to their defaults. 
  12235.  
  12236. o The GpiOpenSegment and GpiCloseSegment initialize and reset the viewing 
  12237.   transform matrix, just as they do for retained segments. 
  12238.  
  12239. o Nonretained segments can be recorded in a metafile, just as a retained 
  12240.   segment can. 
  12241.  
  12242. o A graphic in a nonretained segment, with a unique name, can be converted 
  12243.   easily to a retained graphic for future use. 
  12244.  
  12245.  
  12246. ΓòÉΓòÉΓòÉ 12.2. Using Segment Creating and Drawing Functions ΓòÉΓòÉΓòÉ
  12247.  
  12248. You can use retained-drawing and segment functions to: 
  12249.  
  12250. o Create a chained or called segment 
  12251. o Draw the picture associated with one or more segments. 
  12252.  
  12253.  
  12254. ΓòÉΓòÉΓòÉ 12.2.1. Creating a Chained Segment ΓòÉΓòÉΓòÉ
  12255.  
  12256. To create a chained segment, you must: 
  12257.  
  12258.  1. Set the drawing mode to DM_RETAIN. 
  12259.  
  12260.  2. Check to see if the chained attribute is one of the initial segment 
  12261.     attributes using GpiQueryInitialSegmentAttrs. 
  12262.  
  12263.  3. Set the chained attribute, if necessary, with GpiSetInitialSegmentAttrs. 
  12264.  
  12265.  4. Open the segment using GpiOpenSegment. 
  12266.  
  12267.  5. Perform the necessary drawing operations. 
  12268.  
  12269.  6. Close the segment using GpiCloseSegment. 
  12270.  
  12271. The following figure is an example of a segment containing a box primitive and 
  12272. calling another segment using GpiCallSegmentMatrix. 
  12273.  
  12274. #define INCL_GPISEGMENTS
  12275. #define INCL_GPITRANSFORMS
  12276. #include <os2.h>
  12277. void fncSEGS01(void){
  12278.     POINTL ptl;
  12279.     HPS hps;
  12280.     LONG idSegment    = 1;
  12281.     LONG idNonChained = 2;
  12282.     MATRIXLF matlfTransform = { MAKEFIXED(2,0), MAKEFIXED(0,0), 0,
  12283.                                 MAKEFIXED(0,0), MAKEFIXED(1,0), 0,
  12284.                                 0, 0, 1 };
  12285.  
  12286.     /************************************************************************/
  12287.     /* Turns chaining on. Adds the new segment to the segment chain.        */
  12288.     /* Segment idNonChained is called, whether chained or not.              */
  12289.     /************************************************************************/
  12290.  
  12291.     if (ATTR_OFF == GpiQueryInitialSegmentAttrs(hps, ATTR_CHAINED)
  12292.         GpiSetInitialSegmentAttrs(hps, ATTR_CHAINED, ATTR_ON);
  12293.     GpiOpenSegment(hps, idSegment);
  12294.     ptl.x = 150; ptl.y = 150;
  12295.     GpiMove(hps, &ptl);
  12296.     ptl.x = 225; ptl.y = 225;
  12297.     GpiBox(hps, DRO_FILL, &ptl, 0L, 0L);
  12298.     GpiCallSegmentMatrix(hps, idNonChained, 9L, &matlfTransform,
  12299.         TRANSFORM_REPLACE);
  12300.     GpiCloseSegment(hps);
  12301. } /* fncSEGS01 */
  12302.  
  12303.  
  12304. Creating a Chained Graphics Segment 
  12305.  
  12306.  
  12307. ΓòÉΓòÉΓòÉ 12.2.2. Creating a Called Segment ΓòÉΓòÉΓòÉ
  12308.  
  12309. To create a called segment, you must: 
  12310.  
  12311.  1. Set the drawing mode to DM_RETAIN. 
  12312.  
  12313.  2. Check to see whether the chained attribute is one of the initial segment 
  12314.     attributes using GpiQueryInitialSegmentAttrs. 
  12315.  
  12316.  3. Set the chained attribute, if necessary, with GpiSetInitialSegmentAttrs. 
  12317.  
  12318.  4. Open the segment using GpiOpenSegment. 
  12319.  
  12320.  5. Perform the necessary drawing operations. 
  12321.  
  12322.  6. Close the segment using GpiCloseSegment. 
  12323.  
  12324. The following figure shows an example of how to draw a box in a called segment. 
  12325.  
  12326. #define INCL_GPISEGMENTS
  12327. #define INCL_GPICONTROL
  12328. #include <os2.h>
  12329. void fncSEGS02(void){
  12330.     POINTL ptl;
  12331.     HPS hps;
  12332.     LONG idNonChained = 2;
  12333.  
  12334.     GpiSetDrawingMode(hps, DM_RETAIN);
  12335.  
  12336.     /* Creates a non-chained segment. */
  12337.  
  12338.     if (ATTR_ON == GpiQueryInitialSegmentAttrs(hps, ATTR_CHAINED))
  12339.         GpiSetInitialSegmentAttrs(hps, ATTR_CHAINED, ATTR_OFF);
  12340.     GpiOpenSegment(hps, idNonChained);
  12341.     ptl.x = 100;
  12342.     ptl.y = 100;
  12343.     GpiMove(hps, &ptl);
  12344.     ptl.x = 200;
  12345.     ptl.y = 200;
  12346.     GpiLine(hps, &ptl);
  12347.     GpiCloseSegment(hps);
  12348. } /* fncSEGS02 */
  12349.  
  12350.  
  12351. Creating a Called Graphics Segment 
  12352.  
  12353.  
  12354. ΓòÉΓòÉΓòÉ 12.2.3. Drawing a Segment Chain ΓòÉΓòÉΓòÉ
  12355.  
  12356. The following figure shows an example of how to draw a segment chain using the 
  12357. GpiDrawChain function. 
  12358.  
  12359. #define INCL_GPICONTROL
  12360. #include <os2.h>
  12361. void fncSEGS03(void){
  12362.     HPS hps;
  12363.  
  12364.     if (DM_DRAW != GpiQueryDrawingMode(hps))
  12365.         GpiSetDrawingMode(hps, DM_DRAW);
  12366.     GpiDrawChain(hps);
  12367. } /* fncSEGS03 */
  12368.  
  12369.  
  12370. Drawing a Segment Chain 
  12371.  
  12372.  
  12373. ΓòÉΓòÉΓòÉ 12.3. Summary ΓòÉΓòÉΓòÉ
  12374.  
  12375. The following table summarizes the functions used to create and draw retained 
  12376. graphics and segments. 
  12377.  
  12378. Retained Graphics and Segment Functions 
  12379.  
  12380. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12381. ΓöéFunction Name               ΓöéDescription                     Γöé
  12382. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12383. ΓöéGpiCallSegmentMatrix        ΓöéConcatenates the contents of an Γöé
  12384. Γöé                            Γöéunchained segment bracket onto  Γöé
  12385. Γöé                            Γöéanother chained or unchained    Γöé
  12386. Γöé                            Γöésegment bracket.                Γöé
  12387. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12388. ΓöéGpiCloseSegment             ΓöéDefines the end of a segment    Γöé
  12389. Γöé                            Γöébracket.                        Γöé
  12390. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12391. ΓöéGpiDrawChain                ΓöéDraws the subpictures stored in Γöé
  12392. Γöé                            Γöéa presentation space segment    Γöé
  12393. Γöé                            Γöéchain.                          Γöé
  12394. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12395. ΓöéGpiDrawFrom                 ΓöéDraws the subpictures from a    Γöé
  12396. Γöé                            Γöéspecified range of segments in  Γöé
  12397. Γöé                            Γöéthe segment chain.              Γöé
  12398. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12399. ΓöéGpiDrawSegment              ΓöéDraws a subpicture from a singleΓöé
  12400. Γöé                            Γöésegment.                        Γöé
  12401. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12402. ΓöéGpiOpenSegment              ΓöéDefines the beginning of a      Γöé
  12403. Γöé                            Γöésegment bracket.                Γöé
  12404. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12405. ΓöéGpiQueryInitialSegmentAttrs ΓöéRetrieves the setting of 1 of   Γöé
  12406. Γöé                            Γöéthe 7 initial segment           Γöé
  12407. Γöé                            Γöéattributes.                     Γöé
  12408. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12409. ΓöéGpiQuerySegmentAttrs        ΓöéRetrieves the setting of 1 of   Γöé
  12410. Γöé                            Γöéthe 7 segment attributes.       Γöé
  12411. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12412. ΓöéGpiQuerySegmentNames        ΓöéRetrieves a list of existing    Γöé
  12413. Γöé                            Γöésegment identifiers within a    Γöé
  12414. Γöé                            Γöéspecified range.                Γöé
  12415. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12416. ΓöéGpiQuerySegmentPriority     ΓöéReturns the identifier for a    Γöé
  12417. Γöé                            Γöésegment that precedes or followsΓöé
  12418. Γöé                            Γöéa segment in the segment chain. Γöé
  12419. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12420. ΓöéGpiSetDrawingMode           ΓöéSets the drawing mode in your   Γöé
  12421. Γöé                            Γöépresentation space to 1 of 3    Γöé
  12422. Γöé                            Γöépossible modes: draw, retain, orΓöé
  12423. Γöé                            Γöédraw-and-retain.                Γöé
  12424. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12425. ΓöéGpiSetInitialSegmentAttrs   ΓöéSets the default segment        Γöé
  12426. Γöé                            Γöéattributes.                     Γöé
  12427. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12428. ΓöéGpiSetSegmentAttrs          ΓöéSets 1 of the 7 segment         Γöé
  12429. Γöé                            Γöéattributes.                     Γöé
  12430. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12431. ΓöéGpiSetSegmentPriority       ΓöéAlters the order in which the   Γöé
  12432. Γöé                            Γöéoperating system draws and      Γöé
  12433. Γöé                            Γöédetects segments in the segment Γöé
  12434. Γöé                            Γöéchain.                          Γöé
  12435. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12436.  
  12437.  
  12438. ΓòÉΓòÉΓòÉ 13. Editing Retained Graphics and Graphics Segments ΓòÉΓòÉΓòÉ
  12439.  
  12440. This chapter describes editing retained graphics and graphics segments. The 
  12441. following topics are related to the information in this chapter: 
  12442.  
  12443. o Presentation spaces 
  12444. o Device contexts 
  12445. o Coordinate spaces 
  12446. o Transformations 
  12447. o Creating segments. 
  12448.  
  12449.  
  12450. ΓòÉΓòÉΓòÉ 13.1. About Editing Retained Graphics and Graphics Segments ΓòÉΓòÉΓòÉ
  12451.  
  12452. In the OS/2 operating system, applications store retained graphics in segments. 
  12453. One of the advantages of using graphics segments is that segments can be 
  12454. edited, which allows the retained image to be modified without having to 
  12455. re-create the unmodified portion with multiple GPI functions. 
  12456.  
  12457. Creating and Drawing Retained Graphics described how to create a segment, and 
  12458. store GPI functions within the segment bracket. To understand how to edit a 
  12459. segment, the underlying structure of a segment is described here in greater 
  12460. detail. 
  12461.  
  12462. The GPI functions are not inserted directly into a segment bracket. Instead, 
  12463. the operating system converts the GPI functions into graphics orders; then 
  12464. stores these orders in the GpiOpenSegment-GpiCloseSegment bracket. 
  12465.  
  12466. Generally, each of the GPI functions within the segment bracket generates one 
  12467. element of the segment. An element is the smallest portion of a segment that 
  12468. can be edited and is made up of one or more orders. A graphics order, also 
  12469. known as a drawing order, is the smallest, complete portion of a segment. The 
  12470. following figure illustrates the levels of graphic segment construction. 
  12471.  
  12472.  
  12473. GpiOpenSegment (...);    Graphic Segment
  12474.                         ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ              element
  12475. GpiLine (...);          Γöé line order            Γöé element 0   pointer
  12476.                         Γöé                       Γöé
  12477. GpiBeginElement (...);  Γöé begin element order   Γöé element 1
  12478.                         Γöé                       Γöé
  12479.    GpiBox (...);        Γöé       box order       Γöé
  12480.    GpiPolyline (...);   Γöé       polyline order  Γöé
  12481.                         Γöé                       Γöé
  12482. GpiCloseElement (...);  Γöé end element order     Γöé
  12483.                         Γöé                       Γöé
  12484. GpiLabel (...);         Γöé label order           Γöé element 2
  12485.                         Γöé                       Γöé
  12486. GpiSetColor (...);      Γöé set-color order       Γöé element 3
  12487.                         ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12488. GpiEndSegment (...);
  12489.  
  12490. Structure of a Graphics Segment 
  12491.  
  12492. Elements 0, 2, and 3 are each composed of a single order. Element 1 is composed 
  12493. of two orders bracketed by GpiBeginElement and GpiEndElement. 
  12494.  
  12495.  
  12496. ΓòÉΓòÉΓòÉ 13.1.1. Graphics Orders ΓòÉΓòÉΓòÉ
  12497.  
  12498. A graphics order is a low-level graphics command that corresponds to a 
  12499. primitive function or attribute. In addition to code and data requirements, 
  12500. each graphics order uses approximately 11 bytes of storage. An application that 
  12501. uses 2000 graphics drawing orders will use around 22KB of memory to store them. 
  12502. The following table describes the four sizes of graphics orders. 
  12503.  
  12504. Graphics Orders 
  12505.  
  12506. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12507. ΓöéGraphics Order Size     ΓöéContent                             Γöé
  12508. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12509. Γöé1 byte                  ΓöéA hexadecimal identifier            Γöé
  12510. Γöé                        Γöécorresponding to a drawing function Γöé
  12511. Γöé                        Γöéor attribute function. This         Γöé
  12512. Γöé                        Γöéidentifier is also known as the     Γöé
  12513. Γöé                        Γöéorder code.                         Γöé
  12514. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12515. Γöé2 byte                  ΓöéThe order code is in the first byte,Γöé
  12516. Γöé                        Γöéand data is in the second byte.     Γöé
  12517. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12518. ΓöéLong                    ΓöéThe order code is in the first byte.Γöé
  12519. Γöé                        Γöé                                    Γöé
  12520. Γöé                        ΓöéThe length value of the actual data,Γöé
  12521. Γöé                        Γöéin bytes, is in the second byte.    Γöé
  12522. Γöé                        Γöé                                    Γöé
  12523. Γöé                        ΓöéThe actual data (up to 255 bytes).  Γöé
  12524. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12525. ΓöéVery long               ΓöéA hexadecimal identifier            Γöé
  12526. Γöé(maximum length of 64KB)Γöéspecifically for extended orders, isΓöé
  12527. Γöé                        Γöéin the first byte.                  Γöé
  12528. Γöé                        Γöé                                    Γöé
  12529. Γöé                        ΓöéThe order code is in the second     Γöé
  12530. Γöé                        Γöébyte.                               Γöé
  12531. Γöé                        Γöé                                    Γöé
  12532. Γöé                        ΓöéA length value that specifies how   Γöé
  12533. Γöé                        Γöémany bytes are used by the          Γöé
  12534. Γöé                        Γöégraphics-order arguments, (high     Γöé
  12535. Γöé                        Γöéorder) is in the third byte.        Γöé
  12536. Γöé                        Γöé                                    Γöé
  12537. Γöé                        ΓöéA length value that specifies how   Γöé
  12538. Γöé                        Γöémany bytes are used by the          Γöé
  12539. Γöé                        Γöégraphics-order arguments, (low      Γöé
  12540. Γöé                        Γöéorder) is in the fourth byte.       Γöé
  12541. Γöé                        Γöé                                    Γöé
  12542. Γöé                        ΓöéThe actual data.                    Γöé
  12543. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12544.  
  12545. The following example shows a long graphics order that corresponds to the 
  12546. GpiLine function: 
  12547.  
  12548.     81 8 100 0 0 0 100 0 0 0
  12549.  
  12550. The first number, 81, is the hexadecimal identifier that corresponds to 
  12551. GpiLine. The second number, 8, is the length value that specifies how many 
  12552. bytes are used by the graphics-order arguments. The next 8 bytes contain the 
  12553. arguments for GpiLine. In this case, the arguments specify the line's end point 
  12554. at (100,100). 
  12555.  
  12556.  
  12557.  
  12558.                                Graphics
  12559.                                Segment
  12560.                                       Γöé
  12561. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ  ΓöîΓöÇΓöÇ  0x21  Γö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ order # ΓöÇΓöÇΓöÉ
  12562. Γöé                      Γöé  Γöé     0x08  Γö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ length    Γöé
  12563. Γöé ptl.x = 100L;        Γöé  Γöé     0x00  Γöé ΓöÇΓöÇΓöÇΓöÇΓöÉ               Γöé
  12564. Γöé ptl.y = 100L;        Γöé  Γöé     0x00  Γöé     Γö£ΓöÇΓöÇ      x      Γöé
  12565. Γöé GpiMove (hps, &ptl); Γö╝ΓöÇΓöÇΓöÿ     0x10  Γöé     Γöé               Γö£ΓöÇΓöÇ  element
  12566. Γöé ptl.x = 200L;        Γöé        0x00  Γöé ΓöÇΓöÇΓöÇΓöÇΓöÿ               Γöé
  12567. Γöé ptl.y = 400L;        Γöé        0x00  Γöé ΓöÇΓöÇΓöÇΓöÇΓöÉ               Γöé
  12568. Γöé GpiMove (hps, &ptl); Γö╝ΓöÇΓöÇΓöÉ     0x00  Γöé     Γö£ΓöÇΓöÇ      y      Γöé
  12569. Γöé                      Γöé  Γöé     0x20  Γöé     Γöé               Γöé
  12570. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ  Γöé     0x00  Γöé ΓöÇΓöÇΓöÇΓöÇΓöÿ             ΓöÇΓöÇΓöÿ
  12571.                           ΓööΓöÇΓöÇ  0x81  Γö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ order # ΓöÇΓöÇΓöÉ
  12572.                                 0x08  Γö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ length    Γöé
  12573.                                 0x00  Γöé ΓöÇΓöÇΓöÇΓöÇΓöÉ               Γöé
  12574.                                 0x00  Γöé     Γö£ΓöÇΓöÇ      x      Γöé
  12575.                                 0x30  Γöé     Γöé               Γö£ΓöÇΓöÇ  element
  12576.                                 0x00  Γöé ΓöÇΓöÇΓöÇΓöÇΓöÿ               Γöé
  12577.                                 0x00  Γöé ΓöÇΓöÇΓöÇΓöÇΓöÉ               Γöé
  12578.                                 0x00  Γöé     Γö£ΓöÇΓöÇ      y      Γöé
  12579.                                 0x40  Γöé     Γöé               Γöé
  12580.                                 0x00  Γöé ΓöÇΓöÇΓöÇΓöÇΓöÿ             ΓöÇΓöÇΓöÿ
  12581.                                       Γöé
  12582.  
  12583.  
  12584. Graphics Orders 
  12585.  
  12586. The encoding that appears in the Graphics Segments column is a hexadecimal 
  12587. version of the order, length, and parameter information. The GPIs and their 
  12588. corresponding graphics orders are listed in Presentation Manager Programming 
  12589. Reference. 
  12590.  
  12591. In most cases, graphics orders in a segment correspond to a subpicture, which 
  12592. is part of a complete, more complex picture. Your application would combine the 
  12593. individual segments to form the complete picture. 
  12594.  
  12595. Three drawing modes affect how the operating system stores graphics orders in 
  12596. segments. These modes are described in the following table. The default drawing 
  12597. mode is draw. To specify another as the current drawing mode, use 
  12598. GpiSetDrawingMode. 
  12599.  
  12600. The actual drawing mode is a combination of the drawing mode as set using 
  12601. GpiSetDrawingMode, and the segment status-chained, unchained, or outside of the 
  12602. segment. A previos table describes the actual drawing mode. The actual drawing 
  12603. mode does not effect the storing of orders in segments. 
  12604.  
  12605. Segment Graphics Drawing Modes 
  12606.  
  12607. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12608. ΓöéDrawing Mode      ΓöéGpiSetDrawingMode ΓöéWhen this mode is set...Γöé
  12609. Γöé                  ΓöéValue             Γöé                        Γöé
  12610. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12611. ΓöéDraw              ΓöéDM_DRAW           Γöéit is not possible to   Γöé
  12612. Γöé                  Γöé                  Γöéstore graphics orders inΓöé
  12613. Γöé                  Γöé                  Γöéa chained segment.      Γöé
  12614. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12615. ΓöéRetain            ΓöéDM_RETAIN         Γöéyour application can    Γöé
  12616. Γöé                  Γöé                  Γöéstore graphics orders inΓöé
  12617. Γöé                  Γöé                  Γöéchained and unchained   Γöé
  12618. Γöé                  Γöé                  Γöésegments.               Γöé
  12619. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12620. ΓöéDraw-and-retain   ΓöéDM_DRAWANDRETAIN  Γöéyour application can    Γöé
  12621. Γöé                  Γöé                  Γöéstore graphics orders inΓöé
  12622. Γöé                  Γöé                  Γöéchained and unchained   Γöé
  12623. Γöé                  Γöé                  Γöésegments.  In this mode,Γöé
  12624. Γöé                  Γöé                  Γöéoutput intended for a   Γöé
  12625. Γöé                  Γöé                  Γöéchained segment is both Γöé
  12626. Γöé                  Γöé                  Γöédrawn on the device and Γöé
  12627. Γöé                  Γöé                  Γöéstored in a segment.    Γöé
  12628. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12629.  
  12630.  
  12631. ΓòÉΓòÉΓòÉ 13.1.2. Graphics Elements ΓòÉΓòÉΓòÉ
  12632.  
  12633. Graphics elements are composed of either a single graphics order, or a series 
  12634. of graphic orders that are bracketed by an opening and closing element 
  12635. function. 
  12636.  
  12637. The purpose of this element bracket is to allow the addition of a single 
  12638. element, that comprises more than one graphics order, to a segment. This is 
  12639. most useful when you know that you will want to retrieve those orders at a 
  12640. later time, and manipulate them as a group rather than as individual functions. 
  12641.  
  12642. Note:  There is no reason for enclosing a single GPI function within a 
  12643.        GpiBeginElement-GpiEndElement bracket, although it is a valid 
  12644.        construction. 
  12645.  
  12646. Element brackets also are valid when drawing graphics directly to the output 
  12647. device, but again, they serve no purpose unless converted to a retained segment 
  12648. at a later time. 
  12649.  
  12650. Elements cannot be nested, so two elements cannot begin in succession without 
  12651. an intervening GpiEndElement request. Certain GPI functions cannot be called 
  12652. between GpiBeginElement and GpiEndElement. 
  12653.  
  12654. Element construction is valid only within segments. 
  12655.  
  12656.  
  12657. ΓòÉΓòÉΓòÉ 13.1.2.1. Adding Elements to a New Segment ΓòÉΓòÉΓòÉ
  12658.  
  12659. There are four ways of adding elements to a newly created segment: 
  12660.  
  12661. o Call one or more GPI functions. Each function generates one element of the 
  12662.   segment. This is the simplest way of supplying graphics data to a segment. 
  12663.  
  12664. o Call GpiBeginElement, and follow it with one or more GPI functions. Close the 
  12665.   element using GpiEndElement. All the GPI functions enclosed within the 
  12666.   bracket, and the GpiBeginElement, and GpiEndElement functions generate a 
  12667.   single element of the segment, and therefore occupy a single element-pointer 
  12668.   position. Subsequently, the graphics orders cannot be accessed individually 
  12669.   with the element pointer, although the orders can be accessed directly, for 
  12670.   example, using GpiGetData. 
  12671.  
  12672. o Call GpiElement. As input, you supply the graphics orders themselves, rather 
  12673.   than the GPI functions that generate them. No matter how much data you supply 
  12674.   on this request, it is considered a single element of the segment. 
  12675.  
  12676.   Multiple orders added to a segment in this way cannot be accessed 
  12677.   individually using the element pointer, but they can be accessed directly, 
  12678.   for example, using GpiGetData. 
  12679.  
  12680.   GpiElement cannot be included within a GpiBeginElement-GpiEndElement bracket. 
  12681.   The data passed by GpiElement must not include GpiBeginElement and 
  12682.   GpiEndElement. 
  12683.  
  12684. o Call GpiPutData. As with GpiElement, supply graphics orders as input. You can 
  12685.   even include GpiBeginElement and GpiEndElement orders in this data, and thus 
  12686.   add more than one element to the segment. GpiPutData is useful when there is 
  12687.   a large amount of data to add to a segment. 
  12688.  
  12689.   GpiPutData cannot be used if the segment editing mode is set to 
  12690.   SEGEM_REPLACE. When the segment editing mode is SEGEM_INSERT, the element 
  12691.   pointer must point to the last element in the current segment. 
  12692.  
  12693.   GpiPutData is most often used in conjunction with GpiGetData, which copies 
  12694.   data as a list of drawing orders from a segment to application storage. 
  12695.  
  12696.  
  12697. ΓòÉΓòÉΓòÉ 13.1.2.2. Element Types ΓòÉΓòÉΓòÉ
  12698.  
  12699. Each element that results from a single GPI function has an associated element 
  12700. type. 
  12701.  
  12702. The element type is generally the graphics-order code associated with the 
  12703. graphics order generated by the GPI function, and is supplied by the system. 
  12704. For example, GpiLine has the element type, OCODE_GCLINE, which identifies it as 
  12705. a line-drawing request. Your application can determine the current 
  12706. classification of an element using GpiQueryElementType. 
  12707.  
  12708. The specific element type for each of the GPI functions are documented in the 
  12709. Presentation Manager Programming Reference. These types are equivalent to the 
  12710. graphic order values. 
  12711.  
  12712. When using GpiElement or GpiBeginElement, you can simultaneously add several 
  12713. graphics orders to a segment. Those orders become one element of the segment. 
  12714. You can supply your own classification for these compound elements by supplying 
  12715. a value for the type parameter of GpiElement or GpiBeginElement in the range of 
  12716. 0x81000000 through 0XFFFFFFFF. 
  12717.  
  12718. For example, the orders passed by a single GpiElement function could change the 
  12719. line type to dotted, set the current color to blue, and draw a line. You could 
  12720. classify this element with a type value that identifies it as a blue dotted 
  12721. line. 
  12722.  
  12723. Note:  Element types are used only for classification. They are not used as 
  12724.        location markers or correlation tags. 
  12725.  
  12726.  
  12727. ΓòÉΓòÉΓòÉ 13.1.2.3. The Element Pointer ΓòÉΓòÉΓòÉ
  12728.  
  12729. Use the element pointer to change the contents of an existing segment.  When 
  12730. calling GpiOpenSegment, the element pointer is set to 0. The first element that 
  12731. you add to a newly created segment causes the pointer to be set to 1, and each 
  12732. subsequent element causes the pointer to be incremented by 1. When a segment is 
  12733. closed, the element pointer is always reset to 0. 
  12734.  
  12735. Your application can move the element pointer to a specified value using 
  12736. GpiSetElementPointer. For example, to address the sixth element in a segment, 
  12737. set the element pointer to 6. 
  12738.  
  12739. Your application also can move the element pointer by a specific number, rather 
  12740. than to a specific number, using GpiOffsetElementPointer. For example, if the 
  12741. element pointer currently addresses element 3, to move it to element 8, code an 
  12742. offset of 5 in GpiOffsetElementPointer. The pointer moves backward rather than 
  12743. forward through the segment. The offset value can be a positive or negative 
  12744. number. 
  12745.  
  12746. If the sum of the offset and the current pointer position is less than 0, the 
  12747. operating system sets the pointer so that it points to position 0. Position 0 
  12748. precedes the first element in the segment. If the sum of the offset and the 
  12749. current pointer position is greater than the number of elements in the segment, 
  12750. the operating system sets the pointer so that it points to the last element in 
  12751. the segment. 
  12752.  
  12753. You can determine the current location of the element pointer using 
  12754. GpiQueryElementPointer. To request the contents of a part of or all of the 
  12755. elements at the current pointer position, use GpiQueryElement. 
  12756.  
  12757.  
  12758. ΓòÉΓòÉΓòÉ 13.1.2.4. Labels ΓòÉΓòÉΓòÉ
  12759.  
  12760. You can include labels in a segment to make locating particular elements of the 
  12761. segment easier. If you label an element that is likely to be edited, you can 
  12762. access that element when necessary, regardless of whether the actual position 
  12763. of the label-element pair within the segment has changed. 
  12764.  
  12765. Warning: When editing segments, do not inadvertently insert elements between a 
  12766. label and the element that follows. Your application will no longer be able to 
  12767. use certain GPIs correctly. Their default locations and offsets will be 
  12768. invalid. 
  12769.  
  12770. A label is only a place-holder or reference point, and is itself an element of 
  12771. the segment. Labels are long integer values. To include a label in a segment, 
  12772. use GpiLabel. The following example includes the label 5 in the current 
  12773. segment, whose segment id is 4. 
  12774.  
  12775. GpiOpenSegment(hps, 4L);
  12776. GpiLabel(hps, 5L);
  12777.  .
  12778.  .
  12779.  .
  12780. Your application can set the element pointer to the label position using 
  12781. GpiSetElementPointerAtLabel, then increment the pointer position to the element 
  12782. itself using GpiOffsetElementPointer with an offset of 1. 
  12783.  
  12784. Note:  This example of GPI cannot work properly if your application has allowed 
  12785.        the insertion of elements between a label and the element that follows 
  12786.        it. 
  12787.  
  12788. Labels do not have to be unique. If you do not use unique labels, 
  12789. GpiSetElementPointerAtLabel positions the element pointer at the first 
  12790. occurrence of the label, starting from the current pointer position. If the 
  12791. label is not found between the current pointer position and the end of the 
  12792. segment, an error condition is raised. Using labels as a navigation aid might 
  12793. be quicker than scanning the segment for a particular element. 
  12794.  
  12795. If you do not use labels, you must locate an element before you can change it. 
  12796. To locate a specific element in a segment, you must repeatedly move the element 
  12797. pointer using GpiSetElementPointer, then read the contents of the element using 
  12798. GpiQueryElement. This can be quite a lengthy procedure depending upon the 
  12799. number of elements in the segment. 
  12800.  
  12801.  
  12802. ΓòÉΓòÉΓòÉ 13.1.3. Graphics Segments ΓòÉΓòÉΓòÉ
  12803.  
  12804. Segments are made up of elements, which are in turn made up of one or more 
  12805. graphic orders. The previous sections have discussed the properties and 
  12806. functions for orders and elements. The following sections discuss the 
  12807. attributes and functions that apply to segments as a whole. 
  12808.  
  12809. The segment attributes are encoded in a segment prior to the graphics orders 
  12810. that correspond to GPIs and attributes. 
  12811.  
  12812.  
  12813. ΓòÉΓòÉΓòÉ 13.1.3.1. Initial Segment Attributes ΓòÉΓòÉΓòÉ
  12814.  
  12815. Each segment has a number of characteristics, called attributes that you can 
  12816. set in accordance with your application's requirements. The attributes of a 
  12817. segment are quite different from those of a graphics primitive, in that segment 
  12818. attributes have ON and OFF settings. There are seven segment attributes, each 
  12819. described in the following table. 
  12820.  
  12821. Graphic Segment Attributes and Initial Settings 
  12822.  
  12823. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  12824. ΓöéAttribute         ΓöéValue               ΓöéIf set...     ΓöéDefault Γöé
  12825. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12826. ΓöéChained           ΓöéATTR_CHAINED        Γöéthe operating ΓöéON      Γöé
  12827. Γöé                  Γöé                    Γöésystem adds   Γöé        Γöé
  12828. Γöé                  Γöé                    Γöéeach new      Γöé        Γöé
  12829. Γöé                  Γöé                    Γöésegment in    Γöé        Γöé
  12830. Γöé                  Γöé                    Γöéyour          Γöé        Γöé
  12831. Γöé                  Γöé                    Γöéapplication's Γöé        Γöé
  12832. Γöé                  Γöé                    Γöépresentation  Γöé        Γöé
  12833. Γöé                  Γöé                    Γöéspace to the  Γöé        Γöé
  12834. Γöé                  Γöé                    Γöésegment chain.Γöé        Γöé
  12835. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12836. ΓöéFast chain        ΓöéATTR_FASTCHAIN      Γöéthe operating ΓöéON      Γöé
  12837. Γöé                  Γöé                    Γöésystem        Γöé        Γöé
  12838. Γöé                  Γöé                    Γöéprevents the  Γöé        Γöé
  12839. Γöé                  Γöé                    Γöéresetting of  Γöé        Γöé
  12840. Γöé                  Γöé                    Γöéprimitive     Γöé        Γöé
  12841. Γöé                  Γöé                    Γöéattributes to Γöé        Γöé
  12842. Γöé                  Γöé                    Γöétheir default Γöé        Γöé
  12843. Γöé                  Γöé                    Γöévalues before Γöé        Γöé
  12844. Γöé                  Γöé                    Γöédrawing the   Γöé        Γöé
  12845. Γöé                  Γöé                    Γöésegment chain.Γöé        Γöé
  12846. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12847. ΓöéDynamic           ΓöéATTR_DYNAMIC        Γöéthe operating ΓöéOFF     Γöé
  12848. Γöé                  Γöé                    Γöésystem draws  Γöé        Γöé
  12849. Γöé                  Γöé                    Γöésegment outputΓöé        Γöé
  12850. Γöé                  Γöé                    Γöéby using the  Γöé        Γöé
  12851. Γöé                  Γöé                    ΓöéXOR raster    Γöé        Γöé
  12852. Γöé                  Γöé                    Γöéoperation.    Γöé        Γöé
  12853. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12854. ΓöéDetectable        ΓöéATTR_DETECTABLE     Γöéyour          ΓöéOFF     Γöé
  12855. Γöé                  Γöé                    Γöéapplication   Γöé        Γöé
  12856. Γöé                  Γöé                    Γöécan perform   Γöé        Γöé
  12857. Γöé                  Γöé                    Γöécorrelation   Γöé        Γöé
  12858. Γöé                  Γöé                    Γöéoperations on Γöé        Γöé
  12859. Γöé                  Γöé                    Γöésegments      Γöé        Γöé
  12860. Γöé                  Γöé                    Γöécreated in    Γöé        Γöé
  12861. Γöé                  Γöé                    Γöéthis          Γöé        Γöé
  12862. Γöé                  Γöé                    Γöépresentation  Γöé        Γöé
  12863. Γöé                  Γöé                    Γöéspace.        Γöé        Γöé
  12864. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12865. ΓöéPropagate         ΓöéATTR_PROP_DETECTABLEΓöéthe detectableΓöéON      Γöé
  12866. Γöédetectable        Γöé                    Γöéattribute willΓöé        Γöé
  12867. Γöé                  Γöé                    Γöébe set in eachΓöé        Γöé
  12868. Γöé                  Γöé                    Γöésegment calledΓöé        Γöé
  12869. Γöé                  Γöé                    Γöéby a chained  Γöé        Γöé
  12870. Γöé                  Γöé                    Γöésegment.      Γöé        Γöé
  12871. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12872. ΓöéVisible           ΓöéATTR_VISIBLE        ΓöéGpiDrawChain, ΓöéON      Γöé
  12873. Γöé                  Γöé                    ΓöéGpiDrawFrom,  Γöé        Γöé
  12874. Γöé                  Γöé                    Γöéand           Γöé        Γöé
  12875. Γöé                  Γöé                    ΓöéGpiDrawSegmentΓöé        Γöé
  12876. Γöé                  Γöé                    Γöéwill generate Γöé        Γöé
  12877. Γöé                  Γöé                    Γöéoutput on a   Γöé        Γöé
  12878. Γöé                  Γöé                    Γöédevice.       Γöé        Γöé
  12879. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  12880. ΓöéPropagate visible ΓöéATTR_PROP_VISIBLE   ΓöéThe visible   ΓöéON      Γöé
  12881. Γöé                  Γöé                    Γöéattribute willΓöé        Γöé
  12882. Γöé                  Γöé                    Γöébe set in eachΓöé        Γöé
  12883. Γöé                  Γöé                    Γöésegment calledΓöé        Γöé
  12884. Γöé                  Γöé                    Γöéby a chained  Γöé        Γöé
  12885. Γöé                  Γöé                    Γöésegment.      Γöé        Γöé
  12886. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  12887.  
  12888. When an application creates a segment in a presentation space, the operating 
  12889. system assigns initial attributes to it. By default, five of the attributes 
  12890. will be set ON and two will be set OFF. Your application can override the 
  12891. defaults for all subsequently created segments within the presentation space 
  12892. using GpiSetInitialSegmentAttrs. 
  12893.  
  12894. Use GpiQueryInitialSegmentAttrs, to retrieve the values of the current initial 
  12895. attributes. 
  12896.  
  12897. Note:  The chained and fast-chained attributes are discussed in Chained 
  12898.        Attribute and Fast-Chained Attribute. 
  12899.  
  12900.  
  12901. ΓòÉΓòÉΓòÉ 13.1.3.2. The Dynamic Attribute ΓòÉΓòÉΓòÉ
  12902.  
  12903. Dynamic segments are graphics segments that can be moved from where they were 
  12904. drawn on the screen to a different coordinate position, or altered in some 
  12905. other way, without affecting the remaining part of the picture. The new 
  12906. position of a dynamic segment can be provided with an input device, such as a 
  12907. mouse, or it can be application-generated. 
  12908.  
  12909. The dynamic attribute is set to OFF by default. The setting is always inherited 
  12910. by called segments from the setting of their callers. Thus, if a calling 
  12911. segment is nondynamic, any segments called by it are also nondynamic, 
  12912. regardless of how they have been defined. If the calling segment is dynamic, 
  12913. all segments called by it are also dynamic. Any segment explicitly defined as 
  12914. dynamic must have a unique name, and it cannot be created when the current 
  12915. drawing-mode parameter is DM_DRAW or DM_DRAWANDRETAIN. Although no error 
  12916. condition is raised if you define an unchained segment as dynamic, it is not 
  12917. treated as dynamic unless the segment is called from a dynamic root segment. 
  12918.  
  12919. Graphics objects to be moved without disturbing the remaining contents of the 
  12920. display are drawn in exclusive-OR mode. Segments that you define as dynamic 
  12921. always are drawn in exclusive-OR mode, regardless of the current mix attribute 
  12922. settings and any GpiSetMix functions the segment itself might contain. 
  12923.  
  12924. For performance reasons, dynamic segments are to be grouped at the start of the 
  12925. picture chain. There are GPI functions that handle dynamic segments as a group, 
  12926. so it is more efficient if the entire segment chain does not have to be scanned 
  12927. to locate them. 
  12928.  
  12929. When the entire picture chain is drawn, however, dynamic segments are to be 
  12930. drawn after all other segments in the chain to ensure that the effects of 
  12931. drawing in exclusive-OR mode are not adversely affected by drawings in other 
  12932. mix modes. Also, you must ensure that no nondynamic drawing overlays the 
  12933. dynamic segments after they have been drawn. The PM programming interface 
  12934. ensures that dynamic segments are always drawn on top of other graphics. 
  12935.  
  12936.  
  12937. ΓòÉΓòÉΓòÉ 13.1.3.3. The Detectability Attribute ΓòÉΓòÉΓòÉ
  12938.  
  12939. The detectability attribute of a segment determines if that segment can be 
  12940. selected with an input device, such as a mouse. A segment with this attribute 
  12941. is said to be selectable. Selectable segments can be selected for correlation 
  12942. operations. The detectability attribute is set OFF by default. All detectable 
  12943. segments must have unique names. If you define a zero segment as detectable, it 
  12944. is created as nondetectable. 
  12945.  
  12946.  
  12947. ΓòÉΓòÉΓòÉ 13.1.3.4. The Propagate-Detectability Attribute ΓòÉΓòÉΓòÉ
  12948.  
  12949. This attribute controls whether the detectability attribute of a calling 
  12950. segment is inherited by any segments called from it. The 
  12951. propagate-detectability attribute is set ON by default. This value overrides 
  12952. the detectability setting of the called segment. For example, if you set the 
  12953. detectability attribute of a calling segment to OFF, all segments called from 
  12954. it are nondetectable, regardless of how they have been defined. 
  12955.  
  12956.  
  12957. ΓòÉΓòÉΓòÉ 13.1.3.5. The Visibility Attribute ΓòÉΓòÉΓòÉ
  12958.  
  12959. The visibility attribute controls whether a segment is to be visible on an 
  12960. output device. The contents of a segment that is not defined with the 
  12961. visibility attribute set ON are still executed whenever the segment is drawn. 
  12962. This can cause changes to the current position and to current attribute values, 
  12963. even though the primitives themselves are not visible on the output device. The 
  12964. visibility attribute is set ON by default. 
  12965.  
  12966.  
  12967. ΓòÉΓòÉΓòÉ 13.1.3.6. The Propagate-Visibility Attribute ΓòÉΓòÉΓòÉ
  12968.  
  12969. This attribute controls whether the visibility attribute of a calling segment 
  12970. is inherited by any segments called from it. The propagate-visibility attribute 
  12971. is set ON by default. This value overrides the visibility setting of the called 
  12972. segment. For example, if the visibility attribute of a calling segment is set 
  12973. to OFF, all segments called from it are invisible, regardless of how they have 
  12974. been defined. 
  12975.  
  12976.  
  12977. ΓòÉΓòÉΓòÉ 13.1.4. Changing the Attributes of a Segment ΓòÉΓòÉΓòÉ
  12978.  
  12979. After you create a segment, you might need to alter its attributes. For 
  12980. example, if you created a segment using the default attributes and you want to 
  12981. perform a correlation operation on the subpicture in that segment, you will 
  12982. need to set the detectable attribute using GpiSetSegmentAttrs. You can retrieve 
  12983. the values of the attributes for any segment using GpiQuerySegmentAttrs. 
  12984.  
  12985. You can change the default segment-attribute settings globally for a single 
  12986. presentation space using GpiSetInitialSegmentAttrs. The attribute setting that 
  12987. you specify in this function applies to all segments created subsequently in 
  12988. that presentation space, except that a nonretained segment can never have the 
  12989. dynamic attribute. For example, if you want all segments to be detectable, you 
  12990. can call this function to change the setting for all of them before you create 
  12991. them. GpiSetInitialSegmentAttrs cannot be used to change the attributes of 
  12992. existing segments. 
  12993.  
  12994. You also can change the attributes of any single retained segment, but not 
  12995. those created subsequently, using GpiSetSegmentAttrs. This is useful if, for 
  12996. example, you want most of the segments in a picture chain to be detectable. You 
  12997. can change the attribute setting to detectable for the entire chain, before 
  12998. creating it, using GpiSetInitialSegmentAttrs; then, change the attribute to 
  12999. nondetectable for each of the segment exceptions using GpiSetSegmentAttrs. You 
  13000. can also use GpiSetSegmentAttrs, for example, to make a visible segment 
  13001. invisible when an erase request is received from the operator, or to take a 
  13002. segment out of the chain by redefining it as unchained. If you change an 
  13003. unchained segment to chained, it is added to the end of the segment chain.  If 
  13004. you want the newly chained segment to be positioned elsewhere in the chain, use 
  13005. GpiSetSegmentPriority rather than GpiSetSegmentAttrs. 
  13006.  
  13007. Some of these segment attributes apply equally to primitives that are outside 
  13008. of segments, although their default settings cannot be changed. Primitives 
  13009. outside of segments are always detectable and visible. They cannot be dynamic, 
  13010. because the dynamic attribute applies only to retained graphics. The chained 
  13011. and fast-chaining attributes do not apply to primitives outside of segments. 
  13012.  
  13013.  
  13014. ΓòÉΓòÉΓòÉ 13.1.5. Editing a Segment ΓòÉΓòÉΓòÉ
  13015.  
  13016. The operating system provides segment editing functions for writing 
  13017. applications that allow users to edit segments or elements in a segment. For 
  13018. example, after performing a correlation operation using your application, a 
  13019. user might need to alter the elements that intersected the pick aperture. 
  13020. Correlation and the pick aperture are explained in Correlation. 
  13021.  
  13022. You can edit the contents of any retained segment that has a unique name. You 
  13023. also can edit the contents of a retained zero segment that has not yet been 
  13024. closed. Zero segments cannot be edited after they have been closed, because you 
  13025. cannot refer to a zero segment when it is no longer the current open segment. 
  13026.  
  13027. Before you can begin editing, you must set the current drawing-mode parameter 
  13028. to DM_RETAIN. You cannot edit a segment if the current drawing-mode parameter 
  13029. is DM_DRAWANDRETAIN or DM_DRAW. To begin editing, call GpiOpenSegment and 
  13030. specify the name of the segment you want to edit. When you are finished editing 
  13031. a segment, close it using GpiCloseSegment. 
  13032.  
  13033. The operating system has two edit modes: insert mode and replace mode. You can 
  13034. set the edit modes using GpiSetEditMode. You can determine which mode is 
  13035. currently set using GpiQueryEditMode. 
  13036.  
  13037. The current edit mode applies to all segments in the presentation space until 
  13038. you change it. The edit mode is not an attribute of a particular segment and 
  13039. can be changed at any time. The default edit mode, which is set when you create 
  13040. a presentation space, is insert mode. When you create a graphics segment, you 
  13041. are actually editing it in insert mode. 
  13042.  
  13043. If the edit mode is set to insert (SEGEM_INSERT) you can insert an element at 
  13044. the current location of the element pointer. The operating system shifts the 
  13045. element that was previously at that location into the next slot, and so on, 
  13046. until the last element is shifted into a new, final slot. The following figure 
  13047. shows a segment before and after a new element is inserted at position 0, the 
  13048. beginning of the segment. 
  13049.  
  13050.             Original Segment                         New Segment
  13051.                                 Element Pointer
  13052.             ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ     Γöé             Γöé      ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13053. Position 0  Γöé             ΓöéΓöÇΓöÇΓöÇΓöÇΓöÿ             ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöé             Γöé
  13054.             Γöé             Γöé                          Γöé             Γöé
  13055.             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13056. Position 1  Γöé  Element 1  ΓöéΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇΓöÉ      Γöé New element Γöé
  13057.             Γöé             Γöé                   Γöé      Γöé             Γöé
  13058.             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                   Γöé      Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13059. Position 2  Γöé  Element 2  ΓöéΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇΓöÉ ΓööΓöÇ ΓöÇ ΓöÇΓöé  Element 1  Γöé
  13060.             Γöé             Γöé                 Γöé        Γöé             Γöé
  13061.             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                 Γöé        Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13062. Position 3  Γöé  Element 3  ΓöéΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇΓöÉ ΓööΓöÇ ΓöÇ ΓöÇ ΓöÇΓöé  Element 2  Γöé
  13063.             Γöé             Γöé               Γöé          Γöé             Γöé
  13064.             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ               Γöé          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13065. Position 4  Γöé  Element 4  ΓöéΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇΓöÉ ΓööΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇΓöé  Element 3  Γöé
  13066.             Γöé             Γöé             Γöé            Γöé             Γöé
  13067.             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ             Γöé            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13068. Position 5  Γöé  Element 5  ΓöéΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇΓöÉ ΓööΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇΓöé  Element 4  Γöé
  13069.             Γöé             Γöé           Γöé              Γöé             Γöé
  13070.             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ           Γöé              Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13071. Position 6  Γöé  Element 6  ΓöéΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇΓöÉ ΓööΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇΓöé  Element 5  Γöé
  13072.             Γöé             Γöé         Γöé                Γöé             Γöé
  13073.             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ         Γöé                Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13074. Position 7  Γöé  Element 7  ΓöéΓöÇ ΓöÇ ΓöÇ ΓöÇΓöÉ ΓööΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇΓöé  Element 6  Γöé
  13075.             Γöé             Γöé       Γöé                  Γöé             Γöé
  13076.             ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ       Γöé                  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13077.                                   ΓööΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇ ΓöÇΓöé  Element 7  Γöé
  13078.                                                      Γöé             Γöé
  13079.                                                      ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13080.  
  13081. segments, inserting new elements 
  13082.  
  13083. The new element is inserted after the current element; then, the element 
  13084. pointer is set to the new element. 
  13085.  
  13086. If replace mode is set (SEGEM_REPLACE) you can replace the element at the 
  13087. current pointer location with a new element. The following figure shows a 
  13088. segment before and after the third element was replaced. 
  13089.  
  13090.  
  13091.            Original Segment                         New Segment
  13092.            ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ                          ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13093. Position 0 Γöé             Γöé                          Γöé             Γöé
  13094.            Γöé             Γöé                          Γöé             Γöé
  13095.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13096. Position 1 Γöé  Element 1  Γöé                          Γöé  Element 1  Γöé
  13097.            Γöé             Γöé                          Γöé             Γöé
  13098.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13099. Position 2 Γöé  Element 2  Γöé                          Γöé  Element 2  Γöé
  13100.            Γöé             Γöé     Element pointer      Γöé             Γöé
  13101.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ     Γöé             Γöé      Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13102. Position 3 Γöé  Element 3  ΓöéΓöÇΓöÇΓöÇΓöÇΓöÿ             ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöé  Element 3  Γöé
  13103.            Γöé             Γöé                          Γöé             Γöé
  13104.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13105. Position 4 Γöé  Element 4  Γöé                          Γöé  Element 4  Γöé
  13106.            Γöé             Γöé                          Γöé             Γöé
  13107.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13108. Position 5 Γöé  Element 5  Γöé                          Γöé  Element 5  Γöé
  13109.            Γöé             Γöé                          Γöé             Γöé
  13110.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13111. Position 6 Γöé  Element 6  Γöé                          Γöé  Element 6  Γöé
  13112.            Γöé             Γöé                          Γöé             Γöé
  13113.            Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ                          Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13114. Position 7 Γöé  Element 7  Γöé                          Γöé  Element 7  Γöé
  13115.            Γöé             Γöé                          Γöé             Γöé
  13116.            ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ                          ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13117.  
  13118. Replacing an Element with a New Element 
  13119.  
  13120. The new element overwrites the previous element; the element pointer does not 
  13121. change. 
  13122.  
  13123. Replacing elements is the recommended technique for redrawing identical 
  13124. primitives with different attributes, for example, color. 
  13125.  
  13126. You can insert or replace data in an existing segment using any of the 
  13127. functions described in Adding Elements to a New Segment. As mentioned 
  13128. previously, GpiPutData is valid only in insert mode; and, only when the element 
  13129. pointer is addressing the final element in the segment. That is, when you are 
  13130. editing, you can use GpiPutData only to add data to the end of a segment. 
  13131.  
  13132. A replace request is not valid when the element pointer is set to 0. If you 
  13133. call GpiOpenSegment to create a new segment without first ensuring that the 
  13134. current edit mode is insert, your first attempt to add an element to the 
  13135. segment might cause an error condition to be raised. 
  13136.  
  13137.  
  13138. ΓòÉΓòÉΓòÉ 13.1.5.1. Deleting a Graphics Element ΓòÉΓòÉΓòÉ
  13139.  
  13140. The PM programming interface has three different functions that allow you to 
  13141. delete elements within the currently opened segment. 
  13142.  
  13143. Function                 Description 
  13144.  
  13145. GpiDeleteElement         Deletes a single element at the current element 
  13146.                          pointer location. 
  13147.  
  13148. GpiDeleteElementRange    Deletes a range of elements in a segment. 
  13149.  
  13150. GpiDeleteElementsBetweenLabels Deletes a series of elements between two labels. 
  13151.  
  13152. When you remove an element from a segment, the element pointer addresses the 
  13153. element immediately before the one you deleted. As with other editing 
  13154. functions, the current drawing mode parameter must be DM_RETAIN when you are 
  13155. deleting elements. The current editing mode (insert or replace) has no effect 
  13156. on the delete functions. 
  13157.  
  13158.  
  13159. ΓòÉΓòÉΓòÉ 13.1.5.2. Deleting Graphics Segments ΓòÉΓòÉΓòÉ
  13160.  
  13161. When you have finished drawing the subpicture associated with a segment, you 
  13162. should delete the segment. The PM programming interface has two different 
  13163. functions that allow you to delete segments. 
  13164.  
  13165. Function                 Description 
  13166.  
  13167. GpiDeleteSegment         Deletes a retained segment 
  13168.  
  13169. GpiDeleteSegments        Deletes a range of retained segments. 
  13170.  
  13171. Your application can only delete segments that have unique names; because, you 
  13172. use the segment identifiers to identify the segment or range of segments for 
  13173. deletion. Retained zero segments cannot be deleted. They disappear only when 
  13174. their associated presentation space is deleted or reset. The presentation space 
  13175. can be reset either by GpiResetPS with the GRES_SEGMENTS flag or the GRES_ALL 
  13176. flag set, or by GpiSetPS. Resetting the presentation space is described in 
  13177. Reusing the Presentation Space. 
  13178.  
  13179. If GpiDeleteSement occurs within a segment bracket and the segment identified 
  13180. is the currently open segment, the operating system deletes the segment and 
  13181. ignores the remainder of the functions up to, and including, GpiCloseSegment. 
  13182. If GpiDeleteSegment occurs within a segment bracket and the identifier for a 
  13183. segment other than the currently open segment, the operating system deletes the 
  13184. segment, then continues processing the remaining functions in the segment 
  13185. bracket. If GpiDeleteSegment occurs outside of a segment and references a 
  13186. segment in the segment chain, the operating system removes the segment from the 
  13187. chain and links the two adjacent segments, if such segments exist. 
  13188.  
  13189. If the range of segments deleted by GpiDeleteSegments were in the segment 
  13190. chain, the operating system "repairs" the chain by linking the segments 
  13191. immediately preceding and following the deleted segments, if such segments 
  13192. exist. 
  13193.  
  13194.  
  13195. ΓòÉΓòÉΓòÉ 13.1.5.3. Copying a Single Graphics Element ΓòÉΓòÉΓòÉ
  13196.  
  13197. Your application can copy the graphics orders from a single element using the 
  13198. GpiQueryElement and GpiElement functions. GpiQueryElement copies the graphics 
  13199. orders (or part of the orders, depending on allocated size) from an element 
  13200. into an array of bytes. GpiQueryElement is not valid within an element bracket, 
  13201. nor if the drawing mode is other than DM_RETAIN. 
  13202.  
  13203. GpiElement copies the data from the array back into the current segment. The 
  13204. data may not contain any begin or end element orders. GpiElement is not valid 
  13205. within an element bracket. The element is retained if the drawing mode is 
  13206. DM_RETAIN; and drawn if the mode is either DM_DRAW, or DM_DRAWANDRETAIN. 
  13207.  
  13208.  
  13209. ΓòÉΓòÉΓòÉ 13.1.5.4. Copying Multiple Graphics Elements ΓòÉΓòÉΓòÉ
  13210.  
  13211. Your application can use GpiGetData and GpiPutData to: 
  13212.  
  13213. o Copy elements from one segment to another 
  13214.  
  13215. o Copy elements from one position in a segment to another position in the same 
  13216.   segment. 
  13217.  
  13218. GpiGetData copies a buffer of graphics orders from a named segment, into an 
  13219. area of application storage, whose byte size you specify on input. Only the 
  13220. named segment must not be open when you call this function. The named segment 
  13221. is also known as the source segment. 
  13222.  
  13223. The first time GpiGetData is called, data retrieval has to start at the 
  13224. beginning of the segment. This is done by declaring an element offset of 0. 
  13225.  
  13226. Output from GpiGetData depends on whether the area of application storage is 
  13227. large enough to hold the entire buffer of graphics orders. If so, the buffer is 
  13228. returned along with a count of the number of bytes of data returned to you from 
  13229. the segment. If not, the application storage is filled, and the count is set to 
  13230. the size of the application storage.  The offset of the element where 
  13231. GpiGetData stopped copying, and the count are returned. Your application can 
  13232. then determine if a subsequent GpiGetData needs to be called, by checking that 
  13233. the count is less than the size (length) of the application storage. 
  13234.  
  13235. On subsequent GpiGetData functions, the element offset can be 0, or it can be 
  13236. the offset value that was returned from the previous function. In this manner, 
  13237. if your application calls GpiGetData more than once to copy an entire segment, 
  13238. it can "pick up where it left off", rather than recopying the segment from the 
  13239. beginning each time. 
  13240.  
  13241. You can copy the data from the application storage to a new location in a 
  13242. segment using GpiPutData. This receiving segment is also known as the 
  13243. destination segment. The segment into which you are copying the data can be 
  13244. open when you call GpiPutData. 
  13245.  
  13246. If GpiGetData does not retrieve a complete segment, the data it does retrieve 
  13247. can be written out to the second segment using GpiPutData, even if the last 
  13248. order copied is incomplete. 
  13249.  
  13250. The current drawing mode determines whether the graphics orders are executed, 
  13251. stored in the segment, or both. When you call GpiPutData, the current edit mode 
  13252. must be SEGEM_INSERT and, if there is already data in the destination segment, 
  13253. the element pointer must address the last element of the segment. 
  13254.  
  13255. Because the PM programming interface does not support explicit renaming of 
  13256. segments, GpiGetData-GpiPutData is the method you use to rename a segment. That 
  13257. is, create a second segment with the desired name, copy the contents of the 
  13258. first segment to it, then delete the original segment. 
  13259.  
  13260.  
  13261. ΓòÉΓòÉΓòÉ 13.1.6. Drawing Retained Graphics ΓòÉΓòÉΓòÉ
  13262.  
  13263. Nonretained graphics segments and primitives outside of graphics segment are 
  13264. always drawn immediately to the current output device. Segments that have been 
  13265. retained in segment store, however, can be drawn any number of times to any 
  13266. number of device contexts. The PM programming interface has three different 
  13267. functions that allow you to draw segments: 
  13268.  
  13269. Function                 Description 
  13270.  
  13271. GpiDrawSegment           Draws a single segment in the chain. 
  13272.  
  13273. GpiDrawFrom              Draws a group of segments in the chain. 
  13274.  
  13275. GpiDrawChain             Draws the entire chain. 
  13276.  
  13277. GpiDrawSegment draws a single, named segment, which can be chained or 
  13278. unchained. You supply the segment name as input to this function. 
  13279. GpiDrawSegment can draw a dynamic segment in some circumstances. These are 
  13280. described in Drawing Dynamic Segments. 
  13281.  
  13282. GpiDrawFrom draws one or more root segments from the segment chain. You supply 
  13283. the names of two root segments as input. The drawing process starts at the 
  13284. first named segment and draws all chained and called segments, excluding 
  13285. dynamic segments, up to and including the second named segment. 
  13286.  
  13287. The order in which you specify the segment names is to reflect their relative 
  13288. positions in the segment chain. If the second-named segment appears in the 
  13289. segment chain before the first-named segment, no error is raised, but drawing 
  13290. starts from the first named segment and continues to the end of the chain. This 
  13291. also happens if the second segment is an unchained segment rather than a root 
  13292. segment. If the drawing control, DCTL_DYNAMIC is set, any dynamic segments 
  13293. already drawn on the display are removed before GpiDrawFrom begins to draw 
  13294. nondynamic segments; then, they are redrawn after GpiDrawFrom ends. 
  13295.  
  13296. GpiDrawChain draws all nondynamic chained segments in a named presentation 
  13297. space, as well as any unchained segments called by those chained segments. It 
  13298. does not draw dynamic segments. You supply only the presentation space handle 
  13299. as input to this function. If the drawing control, DCTL_DYNAMIC is set, any 
  13300. dynamic segments already drawn on the display are removed before GpiDrawFrom 
  13301. begins to draw nondynamic segments; then, they are redrawn after GpiDrawFrom 
  13302. completes. 
  13303.  
  13304. You can call any of these functions while a segment is open. The open segment 
  13305. is not modified by these functions, although any of them can result in the 
  13306. current attribute values and current position being modified. For more 
  13307. information about the attribute-resetting process, see Graphics Attributes. 
  13308.  
  13309. The current drawing mode determines whether the segments identified in the 
  13310. drawing functions are executed, stored in the segment, or both. The current 
  13311. drawing mode does not effect which segments are drawn, or the priority in which 
  13312. they are drawn for any of these three GPI drawing functions. 
  13313.  
  13314. If an error occurs during the drawing process, you can determine where the 
  13315. error occurred using GpiErrorSegmentData. This function returns information 
  13316. about the last error that occurred during a segment-drawing operation. It 
  13317. returns a pointer to the segment identifier and a pointer to one of three 
  13318. constants that indicate when the error occurred. 
  13319.  
  13320. Constant                 Error occurred... 
  13321.  
  13322. GPIE_SEGMENT             While drawing the segment. 
  13323.  
  13324. GPIE_ELEMENT             While calling GpiElement. 
  13325.  
  13326. GPIE_DATA                While calling GpiPutData. 
  13327.  
  13328.  
  13329. ΓòÉΓòÉΓòÉ 13.1.7. Drawing Dynamic Segments ΓòÉΓòÉΓòÉ
  13330.  
  13331. A dynamic segment is a chained segment that possesses special properties. 
  13332. Dynamic segments are those that can be moved or changed in some other way 
  13333. without disturbing the remaining parts of the picture. To draw dynamic segments 
  13334. on the display screen for the first time, use GpiDrawDynamics. GpiDrawDynamics 
  13335. draws every dynamic segment in the segment chain. 
  13336.  
  13337. When they have been drawn on the display, dynamic segments can be updated. For 
  13338. example, to move one or more dynamic segments to another part of the display 
  13339. screen, remove them from their current position using GpiRemoveDynamics. You 
  13340. can restrict the scope of this function by supplying the names of a start 
  13341. segment and a finish segment. The start segment and finish segment can be the 
  13342. same. Dynamic segments outside of this range are not removed from the display 
  13343. screen. 
  13344.  
  13345. If you intend to re-associate the presentation space, call GpiRemoveDynamics 
  13346. first; otherwise, GpiRemoveDynamics cannot remove the dynamic segments after 
  13347. the presentation space has been re-associated. The dynamic segments effectively 
  13348. cease to be dynamic. 
  13349.  
  13350. After removing the appropriate dynamic segments from the display screen, you 
  13351. can redraw them elsewhere, again using GpiDrawDynamics. If you specify a range 
  13352. of dynamic segments in GpiRemoveDynamics, the redrawing is restricted to that 
  13353. range. Note that, when dynamic segments have been drawn on the display screen, 
  13354. you must not edit their definitions in segment store. 
  13355.  
  13356. Dynamic segments are treated like nondynamic segments when you are directing 
  13357. output to a hardcopy device. GpiRemoveDynamics and GpiDrawDynamics raise an 
  13358. error condition if the current output device is not a display window. 
  13359.  
  13360.  
  13361. ΓòÉΓòÉΓòÉ 13.1.8. The Drawing Controls ΓòÉΓòÉΓòÉ
  13362.  
  13363. GpiErase clears the output display of the currently associated device to 
  13364. CLR_BACKGROUND, which is the normal background color for the device. If you are 
  13365. using the default color table, this value clears the window background to 
  13366. white. This is a once-only request and must be issued each time you want the 
  13367. display screen cleared before drawing a new picture. You can use this function 
  13368. for either a micro presentation space or a normal presentation space. 
  13369.  
  13370. To get this effect for more than one drawing request, you can use 
  13371. GpiSetDrawControl. This function establishes current values for five drawing 
  13372. controls, which remain in effect until they are reset. The following table 
  13373. describes the five drawing controls. 
  13374.  
  13375. Drawing Controls 
  13376.  
  13377. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13378. ΓöéControl                 ΓöéValue           ΓöéIf set, the         Γöé
  13379. Γöé                        Γöé                Γöéoperating system... Γöé
  13380. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13381. ΓöéBoundary data           ΓöéDCTL_BOUNDARY   Γöécomputes the        Γöé
  13382. Γöéaccumulation            Γöé                Γöédimensions of the   Γöé
  13383. Γöé                        Γöé                Γöésmallest rectangle  Γöé
  13384. Γöé                        Γöé                Γöéthat would          Γöé
  13385. Γöé                        Γöé                Γöécompletely surround Γöé
  13386. Γöé                        Γöé                Γöéthe retained-drawingΓöé
  13387. Γöé                        Γöé                Γöéoutput.             Γöé
  13388. Γöé                        Γöé                ΓöéThis control is     Γöé
  13389. Γöé                        Γöé                Γöédescribed in        Γöé
  13390. Γöé                        Γöé                ΓöéClipping and        Γöé
  13391. Γöé                        Γöé                ΓöéBoundary            Γöé
  13392. Γöé                        Γöé                ΓöéDetermination.      Γöé
  13393. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13394. ΓöéCorrelation             ΓöéDCTL_CORRELATE  Γöéperforms correlationΓöé
  13395. Γöé                        Γöé                Γöéoperations on any   Γöé
  13396. Γöé                        Γöé                Γöéprimitives or any   Γöé
  13397. Γöé                        Γöé                Γöéoutput associated   Γöé
  13398. Γöé                        Γöé                Γöéwith GpiPutData or  Γöé
  13399. Γöé                        Γöé                ΓöéGpiElement.         Γöé
  13400. Γöé                        Γöé                ΓöéThis control is     Γöé
  13401. Γöé                        Γöé                Γöédescribed in        Γöé
  13402. Γöé                        Γöé                ΓöéCorrelation.        Γöé
  13403. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13404. ΓöéDisplay control         ΓöéDCTL_DISPLAY    Γöédraws retained      Γöé
  13405. Γöé                        Γöé                Γöéoutput on the deviceΓöé
  13406. Γöé                        Γöé                Γöéidentified by the   Γöé
  13407. Γöé                        Γöé                Γöécurrent device      Γöé
  13408. Γöé                        Γöé                Γöécontext. If this    Γöé
  13409. Γöé                        Γöé                Γöécontrol is not set, Γöé
  13410. Γöé                        Γöé                Γöéno retained output  Γöé
  13411. Γöé                        Γöé                Γöéwill appear on the  Γöé
  13412. Γöé                        Γöé                Γöédevice.             Γöé
  13413. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13414. ΓöéDraw-dynamic-segments   ΓöéDCTL_DYNAMIC    Γöécalls               Γöé
  13415. Γöé                        Γöé                ΓöéGpiRemoveDynamics   Γöé
  13416. Γöé                        Γöé                Γöébefore drawing any  Γöé
  13417. Γöé                        Γöé                Γöéretained output and Γöé
  13418. Γöé                        Γöé                Γöéthen, after drawing Γöé
  13419. Γöé                        Γöé                Γöéthe retained output,Γöé
  13420. Γöé                        Γöé                Γöéit calls            Γöé
  13421. Γöé                        Γöé                ΓöéGpiDrawDynamics to  Γöé
  13422. Γöé                        Γöé                Γöédraw output stored  Γöé
  13423. Γöé                        Γöé                Γöéin dynamic segments.Γöé
  13424. Γöé                        Γöé                ΓöéThis automatically  Γöé
  13425. Γöé                        Γöé                Γöéremoves all dynamic Γöé
  13426. Γöé                        Γöé                Γöésegments from the   Γöé
  13427. Γöé                        Γöé                Γöédisplay screen      Γöé
  13428. Γöé                        Γöé                Γöébefore a            Γöé
  13429. Γöé                        Γöé                ΓöéGpiDrawxxxxx requestΓöé
  13430. Γöé                        Γöé                Γöéis issued, then     Γöé
  13431. Γöé                        Γöé                Γöélater redraws the   Γöé
  13432. Γöé                        Γöé                Γöésegments. This      Γöé
  13433. Γöé                        Γöé                Γöéensures that dynamicΓöé
  13434. Γöé                        Γöé                Γöésegments are always Γöé
  13435. Γöé                        Γöé                Γöédrawn on top of     Γöé
  13436. Γöé                        Γöé                Γöénondynamic segments Γöé
  13437. Γöé                        Γöé                Γöéand primitives.     Γöé
  13438. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13439. ΓöéErase-before-draw       ΓöéDCTL_ERASE      Γöécalls GpiErase      Γöé
  13440. Γöé                        Γöé                Γöébefore drawing any  Γöé
  13441. Γöé                        Γöé                Γöéretained output.    Γöé
  13442. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13443.  
  13444. GpiSetDrawControl can be called in either a micro or a normal presentation 
  13445. space, although not all of the controls are valid in a micro presentation 
  13446. space. For details, see the Presentation Manager Programming Reference. 
  13447. GpiDrawSegment can be used to draw a dynamic segment in some circumstances. Its 
  13448. effects are as follows: 
  13449.  
  13450. o If the named segment is both chained and dynamic, and the DCTL_DYNAMIC 
  13451.   drawing control is set, all dynamic segments in the chain, including the 
  13452.   named segment, are drawn as dynamic. 
  13453.  
  13454. o If the named segment is both chained and dynamic, and the DCTL_DYNAMIC 
  13455.   control is not set, the named segment is not drawn. 
  13456.  
  13457. o If the named segment is unchained and dynamic, it is drawn as a nondynamic 
  13458.   segment, regardless of the setting of the DCTL_DYNAMIC control. 
  13459.  
  13460. If you called GpiRemoveDynamics prior to calling GpiDrawDynamics and you 
  13461. specified a range of dynamic segments, the operating system draws only that 
  13462. range. If you set the DCTL_DYNAMIC control using GpiSetDrawControl, the 
  13463. operating system calls GpiRemoveDynamics before drawing the subpictures from 
  13464. the dynamic segments. 
  13465.  
  13466. The DCTL_DISPLAY control is the only control set to DCTL_ON by default. All 
  13467. other controls are set to DCTL_OFF when you create a presentation space. 
  13468.  
  13469.  
  13470. ΓòÉΓòÉΓòÉ 13.2. Using Segment Editing Functions ΓòÉΓòÉΓòÉ
  13471.  
  13472. You can use editing functions to: 
  13473.  
  13474. o Create a chained-dynamic segment 
  13475. o Delete a segment 
  13476. o Edit the contents of a segment. 
  13477.  
  13478. The following figure shows an example of how to edit the contents of a segment. 
  13479. In the example, three elements are inserted. The steps required for this task 
  13480. are as follows: 
  13481.  
  13482.  1. Set the segment edit mode to insert or replace using GpiSetEditMode. 
  13483.  
  13484.  2. Set the drawing mode to retain. 
  13485.  
  13486.  3. Open the segment using GpiOpenSegment, passing it the segment identifier 
  13487.     from a previous correlation operation. 
  13488.  
  13489.  4. Set the element pointer so that it points to the position at which you will 
  13490.     replace or insert an element using GpiSetElementPointer, 
  13491.     GpiSetElementPointerAtLabel, or GpiOffsetElementPointer. 
  13492.  
  13493.  5. Insert the new primitives using any of the Gpi primitive functions. 
  13494.  
  13495.  6. Delete any unnecessary primitives using GpiDeleteElement or 
  13496.     GpiDeleteElementRange. 
  13497.  
  13498.  7. Close the segment using GpiCloseSegment. 
  13499.  
  13500. The first element inserted contains the graphics order that sets the color to 
  13501. yellow; the second element moves the current position; and the third element 
  13502. draws an outlined box with rounded corners. After the three elements are 
  13503. inserted, the code deletes the element at position 5 in the segment (this 
  13504. element was previously at positions 1 and 2). 
  13505.  
  13506. #define INCL_GPISEGEDITING
  13507. #define INCL_GPICONTROL
  13508. #include <os2.h>
  13509. void fncESEG01(void){
  13510.     HPS hps;
  13511.     LONG idNonChained;
  13512.     POINTL ptl;
  13513.  
  13514.     GpiSetEditMode(hps, SEGEM_INSERT);
  13515.  
  13516.     GpiSetDrawingMode(hps, DM_RETAIN);
  13517.  
  13518.     GpiOpenSegment(hps, idNonChained);
  13519.  
  13520.     GpiSetElementPointer(hps, 0L);
  13521.  
  13522.     GpiSetColor(hps, CLR_YELLOW);
  13523.  
  13524.     ptl.x = 100; ptl.y = 100;
  13525.  
  13526.     GpiMove(hps, &ptl);
  13527.  
  13528.     ptl.x = 150; ptl.y = 150;
  13529.  
  13530.     GpiBox(hps, DRO_OUTLINE, &ptl, 40L, 40L);
  13531.  
  13532.     ptl.x = 30; ptl.y = 30;
  13533.  
  13534.     GpiMove(hps, &ptl);
  13535.  
  13536.     GpiSetElementPointer(hps, 5L);
  13537.  
  13538.     GpiDeleteElement(hps);
  13539.  
  13540.     GpiCloseSegment(hps);
  13541.  
  13542. } /* fncESEG01 */
  13543.  
  13544.  
  13545. Editing the Contents of a Graphics Segment 
  13546.  
  13547.  
  13548. ΓòÉΓòÉΓòÉ 13.3. Summary ΓòÉΓòÉΓòÉ
  13549.  
  13550. The following table summarizes the functions used to edit retained graphics and 
  13551. segments. 
  13552.  
  13553. Editing Graphics and Segment Functions 
  13554.  
  13555. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13556. ΓöéFunction Name                 ΓöéDescription                   Γöé
  13557. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13558. ΓöéGpiBeginElement               ΓöéDefines the beginning of an   Γöé
  13559. Γöé                              Γöéelement bracket.              Γöé
  13560. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13561. ΓöéGpiCloseSegment               ΓöéDefines the end of a segment  Γöé
  13562. Γöé                              Γöébracket.                      Γöé
  13563. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13564. ΓöéGpiDeleteElement              ΓöéDeletes the element at the    Γöé
  13565. Γöé                              Γöéelement pointer, then sets theΓöé
  13566. Γöé                              Γöéelement pointer to the        Γöé
  13567. Γöé                              Γöéprevious element.             Γöé
  13568. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13569. ΓöéGpiDeleteElementRange         ΓöéDeletes a specified range of  Γöé
  13570. Γöé                              Γöéelements from a segment.      Γöé
  13571. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13572. ΓöéGpiDeleteElementsBetweenLabelsΓöéDeletes all of the elements inΓöé
  13573. Γöé                              Γöéa segment that appear between Γöé
  13574. Γöé                              Γöétwo labels.                   Γöé
  13575. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13576. ΓöéGpiDeleteSegment              ΓöéDeletes a segment.            Γöé
  13577. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13578. ΓöéGpiDeleteSegments             ΓöéDeletes a specified range of  Γöé
  13579. Γöé                              Γöésegments.                     Γöé
  13580. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13581. ΓöéGpiDrawChain                  ΓöéDraws the subpictures stored  Γöé
  13582. Γöé                              Γöéin a presentation space's     Γöé
  13583. Γöé                              Γöésegment chain.                Γöé
  13584. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13585. ΓöéGpiDrawDynamics               ΓöéRedraws dynamic segments.     Γöé
  13586. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13587. ΓöéGpiDrawFrom                   ΓöéDraws the subpictures from a  Γöé
  13588. Γöé                              Γöéspecified range of segments inΓöé
  13589. Γöé                              Γöéthe segment chain.            Γöé
  13590. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13591. ΓöéGpiDrawSegment                ΓöéDraws a subpicture from a     Γöé
  13592. Γöé                              Γöésingle segment.               Γöé
  13593. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13594. ΓöéGpiErase                      ΓöéClears a window identified by Γöé
  13595. Γöé                              Γöéa screen device context and   Γöé
  13596. Γöé                              Γöépaints the window, using the  Γöé
  13597. Γöé                              Γöécolor identified by index 0 inΓöé
  13598. Γöé                              Γöéyour presentation space's     Γöé
  13599. Γöé                              Γöécolor table.                  Γöé
  13600. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13601. ΓöéGpiElement                    ΓöéCreates an element from       Γöé
  13602. Γöé                              Γöégraphics orders that you storeΓöé
  13603. Γöé                              Γöéin a buffer and pass to the   Γöé
  13604. Γöé                              Γöéfunction.                     Γöé
  13605. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13606. ΓöéGpiEndElement                 ΓöéDefines the end of an element Γöé
  13607. Γöé                              Γöébracket.                      Γöé
  13608. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13609. ΓöéGpiErrorSegmentData           ΓöéProvides information about theΓöé
  13610. Γöé                              Γöélast error that occurred      Γöé
  13611. Γöé                              Γöéduring a retained-drawing     Γöé
  13612. Γöé                              Γöéoperation.                    Γöé
  13613. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13614. ΓöéGpiGetData                    ΓöéCopies graphics orders from a Γöé
  13615. Γöé                              Γöésegment into a buffer.        Γöé
  13616. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13617. ΓöéGpiLabel                      ΓöéGenerates a special element   Γöé
  13618. Γöé                              Γöécalled a label.               Γöé
  13619. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13620. ΓöéGpiOffsetElementPointer       ΓöéMoves the element pointer in aΓöé
  13621. Γöé                              Γöésegment by a specified offset.Γöé
  13622. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13623. ΓöéGpiOpenSegment                ΓöéDefines the beginning of a    Γöé
  13624. Γöé                              Γöésegment bracket.              Γöé
  13625. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13626. ΓöéGpiPutData                    ΓöéCopies graphics orders from a Γöé
  13627. Γöé                              Γöébuffer into a segment.        Γöé
  13628. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13629. ΓöéGpiQueryDrawControl           ΓöéDetermines whether one of the Γöé
  13630. Γöé                              Γöéfive drawing controls is set. Γöé
  13631. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13632. ΓöéGpiQueryDrawingMode           ΓöéDetermines which of the three Γöé
  13633. Γöé                              Γöédrawing modes is set.         Γöé
  13634. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13635. ΓöéGpiQueryEditMode              ΓöéDetermines which of the two   Γöé
  13636. Γöé                              Γöésegment-editing modes is      Γöé
  13637. Γöé                              Γöécurrently set.                Γöé
  13638. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13639. ΓöéGpiQueryElement               ΓöéRetrieves the graphics orders Γöé
  13640. Γöé                              Γöéfrom the element at the       Γöé
  13641. Γöé                              Γöécurrent position of the       Γöé
  13642. Γöé                              Γöéelement pointer and copies theΓöé
  13643. Γöé                              Γöéorders into a buffer of bytes.Γöé
  13644. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13645. ΓöéGpiQueryElementPointer        ΓöéRetrieves the location of the Γöé
  13646. Γöé                              Γöéelement pointer.              Γöé
  13647. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13648. ΓöéGpiQueryElementType           ΓöéRetrieves the type of the     Γöé
  13649. Γöé                              Γöéelement at the current        Γöé
  13650. Γöé                              Γöélocation of the element       Γöé
  13651. Γöé                              Γöépointer.                      Γöé
  13652. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13653. ΓöéGpiQueryInitialSegmentAttrs   ΓöéRetrieves the setting of one  Γöé
  13654. Γöé                              Γöéof the seven initial segment  Γöé
  13655. Γöé                              Γöéattributes.                   Γöé
  13656. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13657. ΓöéGpiQuerySegmentAttrs          ΓöéRetrieves the setting of one  Γöé
  13658. Γöé                              Γöéof the seven segment          Γöé
  13659. Γöé                              Γöéattributes.                   Γöé
  13660. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13661. ΓöéGpiQuerySegmentNames          ΓöéRetrieves a list of existing  Γöé
  13662. Γöé                              Γöésegment identifiers within a  Γöé
  13663. Γöé                              Γöéspecified range.              Γöé
  13664. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13665. ΓöéGpiQuerySegmentPriority       ΓöéReturns the identifier for a  Γöé
  13666. Γöé                              Γöésegment that precedes or      Γöé
  13667. Γöé                              Γöéfollows a segment in the      Γöé
  13668. Γöé                              Γöésegment chain.                Γöé
  13669. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13670. ΓöéGpiQueryStopDraw              ΓöéDetermines whether the        Γöé
  13671. Γöé                              Γöéstop-draw condition is set.   Γöé
  13672. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13673. ΓöéGpiRemoveDynamics             ΓöéRemoves parts of a picture    Γöé
  13674. Γöé                              Γöéthat were drawn by dynamic    Γöé
  13675. Γöé                              Γöésegments in the segment chain.Γöé
  13676. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13677. ΓöéGpiSetDrawControl             ΓöéSets one of the five drawing  Γöé
  13678. Γöé                              Γöécontrols.                     Γöé
  13679. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13680. ΓöéGpiSetDrawingMode             ΓöéSets the drawing mode in your Γöé
  13681. Γöé                              Γöépresentation space to one of  Γöé
  13682. Γöé                              Γöéthree possible modes: draw,   Γöé
  13683. Γöé                              Γöéretain, or draw-and-retain.   Γöé
  13684. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13685. ΓöéGpiSetEditMode                ΓöéDefines which of the two      Γöé
  13686. Γöé                              Γöésegment-editing modes is      Γöé
  13687. Γöé                              Γöécurrently set.                Γöé
  13688. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13689. ΓöéGpiSetElementPointer          ΓöéSets the element pointer so   Γöé
  13690. Γöé                              Γöéthat it points at the nth     Γöé
  13691. Γöé                              Γöéelement in a segment.         Γöé
  13692. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13693. ΓöéGpiSetElementPointerAtLabel   ΓöéSets the element pointer to   Γöé
  13694. Γöé                              Γöéthe element identified by a   Γöé
  13695. Γöé                              Γöéparticular label.             Γöé
  13696. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13697. ΓöéGpiSetInitialSegmentAttrs     ΓöéSets the default segment      Γöé
  13698. Γöé                              Γöéattributes.                   Γöé
  13699. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13700. ΓöéGpiSetSegmentAttrs            ΓöéSets one of the seven segment Γöé
  13701. Γöé                              Γöéattributes.                   Γöé
  13702. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13703. ΓöéGpiSetSegmentPriority         ΓöéAlters the order in which the Γöé
  13704. Γöé                              Γöéoperating system draws and    Γöé
  13705. Γöé                              Γöédetects segments in the       Γöé
  13706. Γöé                              Γöésegment chain.                Γöé
  13707. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  13708. ΓöéGpiSetStopDraw                ΓöéSets the stop-draw condition. Γöé
  13709. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  13710.  
  13711.  
  13712. ΓòÉΓòÉΓòÉ 14. Correlation ΓòÉΓòÉΓòÉ
  13713.  
  13714. Correlation is the process of determining which primitives, if any, are 
  13715. contained in an area of interest.  The process for nonretained graphics is very 
  13716. different from the process for retained graphics. The following topics are 
  13717. related to the information in this chapter: 
  13718.  
  13719. o Presentation spaces 
  13720. o Coordinate spaces and transformations 
  13721. o Segments. 
  13722.  
  13723.  
  13724. ΓòÉΓòÉΓòÉ 14.1. About Correlation ΓòÉΓòÉΓòÉ
  13725.  
  13726. When you want to select an area of interest on the screen, you usually move the 
  13727. pointer to the applicable point and signal (by clicking a mouse, for example) 
  13728. that this is the object you want. This selection process most commonly is used 
  13729. for graphic applications. For example, your application could permit a user to 
  13730. select an object, then change its color.  Correlation, however, also can be 
  13731. used in nongraphic applications.  For example, your application models the 
  13732. operation of a calculator and permits a user to select numbers for mathematical 
  13733. operations. 
  13734.  
  13735. The area of interest is defined by the operating system as a small rectangle, 
  13736. centered on the (x,y) coordinate position, that has been sent to the 
  13737. application.  The virtual rectangle the application generates is known as the 
  13738. pick aperture. The following figure shows an example of a pick aperture. 
  13739.  
  13740. The Pick Aperture 
  13741.  
  13742. The process of determining what lies in the pick aperture differs between 
  13743. nonretained and retained graphics.  For nonretained graphics, the presentation 
  13744. space must be put in a state that supports correlation before the primitives 
  13745. are drawn; then, correlation is performed while the primitives are being drawn. 
  13746. For retained graphics, the segments that contain the graphics can be replayed, 
  13747. permitting correlation after the primitives are drawn. 
  13748.  
  13749. Note:  The necessity to correlate graphics usually can be predicted; therefore, 
  13750.        you can plan for it when designing applications. However, this does not 
  13751.        mean that you have to create retained (rather than nonretained) graphic 
  13752.        segments. The decision to retain graphics is dependent on several 
  13753.        considerations of which correlation is only one. 
  13754.  
  13755.  
  13756. ΓòÉΓòÉΓòÉ 14.1.1. Correlating Nonretained Graphics ΓòÉΓòÉΓòÉ
  13757.  
  13758. For the purposes of correlation, nonretained graphics are those graphics that 
  13759. are being correlated during the drawing process.  Nonretained graphics can 
  13760. exist in nonretained graphic segments or completely outside any segment 
  13761. structure. Primitives outside segments are detectable when the applicable draw 
  13762. control is set. 
  13763.  
  13764. Nonretained graphics, inside a segment bracket, can be created in either draw 
  13765. or draw-and-retain modes. If created in draw-and-retain mode, a segment, at 
  13766. first, is considered nonretained while the primitives in the segment are being 
  13767. drawn; then, it is considered retained. To be correlated, nonretained segments 
  13768. must have unique, nonzero identifiers, and must be defined as detectable. The 
  13769. primitives within these segments can be tagged just as primitives in retained 
  13770. segments are; however, the tags do not influence the correlation process for 
  13771. nonretained graphics. 
  13772.  
  13773. To get correlation data from the drawing of nonretained graphics, 3 steps must 
  13774. be performed- after creation of the presentation space but before drawing the 
  13775. primitives: 
  13776.  
  13777.  1. Call GpiSetDrawControl to switch on the correlation flag (DCTL_CORRELATE, 
  13778.     DCTL_ON). 
  13779.  
  13780.  2. Call GpiSetPickApertureSize, if necessary, to change the size of the pick 
  13781.     aperture. 
  13782.  
  13783.  3. Call GpiSetPickAperturePosition, if necessary, to explicitly position the 
  13784.     aperture.  As input to this function, you provide the coordinate position 
  13785.     on which the pick aperture is to be centered, using presentation page 
  13786.     coordinates. 
  13787.  
  13788. Correlation is performed for the following functions: 
  13789.  
  13790. o Individual primitive-drawing requests, for example, GpiBox 
  13791. o GpiPutData 
  13792. o GpiElement 
  13793. o GpiPlayMetaFile. 
  13794.  
  13795. Correlation is never performed for GpiErase. 
  13796.  
  13797. You detect correlation hits by examining the returned values from the GPI 
  13798. functions.  If GpiLine, for example, draws a line that intersects the pick 
  13799. aperture, it returns a value of GPI_HITS to indicate a correlation hit. If the 
  13800. line does not intersect the pick aperture, GpiLine returns a value of GPI_OK, 
  13801. to indicate the successful drawing of a line without a correlation hit. GpiLine 
  13802. returns a value of GPI_ERROR if an error is detected. 
  13803.  
  13804. If the line intersects the pick aperture, a correlation hit is returned even if 
  13805. the line style is LINETYPE_INVISIBLE. For other primitives, if the object is 
  13806. drawn in outline mode, a correlation hit is returned only if the pick aperture 
  13807. intersects the boundary.  If the object is in fill mode, a correlation hit is 
  13808. returned if the pick aperture intersects or lies within the boundary. 
  13809.  
  13810. The following figure is an example of primitives intersecting the pick 
  13811. aperture. 
  13812.  
  13813. Correlating Nonretained Graphics 
  13814.  
  13815. Each GPI function whose output intersects the pick aperture returns a hit 
  13816. (GPI_HIT). GpiBox, whose output does not intersect the pick aperture, returns 
  13817. GPI_OK. 
  13818.  
  13819.  
  13820. ΓòÉΓòÉΓòÉ 14.1.2. Correlating Retained Graphics ΓòÉΓòÉΓòÉ
  13821.  
  13822. The information in a retained graphic segment can be redrawn; therefore, 
  13823. setting up an environment for correlation is not necessary. Correlation on 
  13824. retained segments is processed through segment IDs and tags throughout the 
  13825. segments. 
  13826.  
  13827. For any retained segment to be a candidate for correlation, the following must 
  13828. be done: 
  13829.  
  13830.  1. Call GpiOpenSegment with a unique, nonzero identifier. 
  13831.  
  13832.  2. Call GpiSetSegmentAttrs with the following settings: 
  13833.  
  13834.     a. ATTR_DETECTABLE switched ON 
  13835.     b. ATTR_DYNAMIC left OFF (default), 
  13836.        unless the segment is unchained and, therefore, drawn non-dynamically. 
  13837.     c. ATTR_PROP_DETECTABLE left ON (default), 
  13838.        in any segment that calls the candidate segment. 
  13839.  
  13840.  3. Call GpiSetTag at appropriate locations within the segment 
  13841.  
  13842. Note:  The preceding is the recommended method.  However, an application still 
  13843.        can receive correlation data about invisible segments, as explained in 
  13844.        The lType Input Parameter. 
  13845.  
  13846.  
  13847. ΓòÉΓòÉΓòÉ 14.1.2.1. Tagging Primitives within a Segment ΓòÉΓòÉΓòÉ
  13848.  
  13849. The GpiSetTag function inserts a long integer value, called a tag, at the 
  13850. current element pointer position. The tag becomes a segment element, which 
  13851. serves as an identifier for the primitives that follow until the next tag is 
  13852. issued. Tags also are called pick tags or pick identifiers.  Typically, 
  13853. applications assign tags only to elements that correspond to primitives. You 
  13854. can determine the value of the last tag assigned to an element using 
  13855. GpiQueryTag. 
  13856.  
  13857. Note:  Tags are used only in correlation; they are not used in the chaining or 
  13858.        calling of segments, nor do they cause or modify output. 
  13859.  
  13860. The long integer value of the tag is 0 by default. However, a 0 value makes the 
  13861. subsequent primitives undetectable. An application can use this effect to make 
  13862. some parts of a segment detectable and other parts of it non-detectable. If you 
  13863. know that this capability is unnecessary, you can change the default tag value 
  13864. using GpiSetDefTag. 
  13865.  
  13866. The tag you specify becomes the current tag, and it applies to all subsequent 
  13867. primitives until you next call GpiSetTag. The tag can be considered one of the 
  13868. attributes of the primitive, and, therefore, affected by the current attribute 
  13869. mode. In AM_PRESERVE mode, it is stored on the LIFO stack and can be recalled 
  13870. with GpiPop. Tags cannot be inserted between a GpiBeginArea and GpiEndArea area 
  13871. bracket; therefore, all primitives within an area have the same tag. 
  13872.  
  13873. A tag value greater than 0 enables correlation on the subsequent primitives, 
  13874. but only if the segment ID is greater than 0 as well. The data returned from 
  13875. each correlation consists of a set of segment-tag pairs. The reason for this 
  13876. pairing is that a single segment can draw objects in several locations. By 
  13877. adding identifiers within the segment, an application has a more exact 
  13878. description of what has intersected the pick aperture. 
  13879.  
  13880. For simple chained segments, each unique segment-tag pair within the pick 
  13881. aperture is known as a hit. If two or more primitives in the pick aperture have 
  13882. the same tag, they are considered a single hit. Hits for called segments differ 
  13883. slightly and are described in The lMaxDepth Input Parameter. 
  13884.  
  13885.  
  13886. ΓòÉΓòÉΓòÉ 14.1.2.2. Correlation Functions for Retained Graphics ΓòÉΓòÉΓòÉ
  13887.  
  13888. The PM programming interface has 3 different functions that enable you to 
  13889. correlate a uniquely identified retained segment. 
  13890.  
  13891. Function                 Description 
  13892.  
  13893. GpiCorrelateSegment      Permits correlation on a single segment. 
  13894.  
  13895. GpiCorrelateFrom         Permits correlation on a range of segments from a 
  13896.                          segment chain. 
  13897.  
  13898. GpiCorrelateChain        Permits correlation on the entire segment chain. 
  13899.  
  13900. For nonretained graphics, the correlation hits are returned by the actual 
  13901. drawing commands.  For retained graphics, the correlation hits are returned by 
  13902. the 3 correlation functions, listed above. 
  13903.  
  13904. The size of the pick aperture is set using GpiSetPickApertureSize, just as with 
  13905. nonretained graphics. However, the coordinate position on which the pick 
  13906. aperture is centered usually is obtained from operator input, for example, from 
  13907. a WM_BUTTON1DOWN message, instead of from GpiSetPickAperturePosition. 
  13908.  
  13909. After the graphics orders that create pictures are stored in retained segments, 
  13910. the pictures can be re-created by your application with the various GpiDrawxxx 
  13911. functions.  Then the user can view the pictures, if the output is directed to a 
  13912. screen for example. After the user selects an area of interest, a 
  13913. GpiCorrelatexxx function redraws the picture internally to determine just what 
  13914. intersects the pick aperture. The user does not see the re-creation. A standard 
  13915. order of functions within your application would be: 
  13916.  
  13917. o GpiDrawxxx 
  13918. o GpiSetPickApertureSize 
  13919. o GpiCorrelatexxx. 
  13920.  
  13921.  
  13922. ΓòÉΓòÉΓòÉ 14.1.2.3. The Correlation Input Parameters ΓòÉΓòÉΓòÉ
  13923.  
  13924. There is only one segment chain per presentation space; therefore, 
  13925. GpiCorrelateChain needs the presentation space handle as input. The segment 
  13926. correlation functions need both the presentation space handle and the segment 
  13927. IDs. 
  13928.  
  13929. All three correlation functions require the following as input: 
  13930.  
  13931. o Correlation attribute type 
  13932. o Maximum number of hits 
  13933. o Number of segment-tag pairs to be returned for a single hit, called the pair 
  13934.   depth. 
  13935.  
  13936.  
  13937. ΓòÉΓòÉΓòÉ 14.1.2.3.1. The lType Input Parameter ΓòÉΓòÉΓòÉ
  13938.  
  13939. The two classifications of segments upon which you can request correlation are 
  13940. the following: 
  13941.  
  13942. o Segments that have been defined as both detectable and visible 
  13943. o All nonzero segments, regardless of their detectability and visibility 
  13944.   attributes. 
  13945.  
  13946.  
  13947. ΓòÉΓòÉΓòÉ 14.1.2.3.2. The lMaxHits Input Parameter ΓòÉΓòÉΓòÉ
  13948.  
  13949. The correlation functions return the number of hits made on the retained 
  13950. segments. The following figure is an example of a line intersecting the pick 
  13951. aperture. 
  13952.  
  13953. Retained Segment Correlation with One Hit 
  13954.  
  13955. The intersection of a unique segment-identified and -tagged primitive with the 
  13956. pick aperture (pa) produces one hit.  If the pick aperture size were increased, 
  13957. there still would be only 1 hit. The triangle produces no hit because its tag 
  13958. is 0. 
  13959.  
  13960. The following figure is an example of multiple primitives intersecting the pick 
  13961. aperture. 
  13962.  
  13963. Retained Segment Correlation with Multiple Hits 
  13964.  
  13965. Four separate primitives intersect the pick aperture; however, since 2 
  13966. primitives share the same tag, and 1 primitive has a segment ID of 0, there are 
  13967. only 2 hits. 
  13968.  
  13969. Your application can set a limit on the number of hits to return from a 
  13970. correlation function. The maximum-number-of-hits parameter influences the size 
  13971. of the array created to handle the segment-tag pair returned for each hit.  By 
  13972. comparing the maximum number desired to the actual number of hits, your 
  13973. application can determine whether all hits are accounted for. The following 
  13974. figure shows an example of the alSegTag data structure that contains the 
  13975. segment-tag pairs for the previous figure. 
  13976.  
  13977. alSegTag Data Structure 
  13978.  
  13979. As shown in the previous figure, the identifier-tag pairs are returned to the 
  13980. application in the reverse order of their occurrence on the segment chain. That 
  13981. is, the highest priority segment is returned first. Therefore, the application 
  13982. can identify the topmost segment, which is the segment most likely to have been 
  13983. picked. 
  13984.  
  13985.  
  13986. ΓòÉΓòÉΓòÉ 14.1.2.3.3. The lMaxDepth Input Parameter ΓòÉΓòÉΓòÉ
  13987.  
  13988. When a called segment is picked, correlation data is returned also for all 
  13989. segments above it in the hierarchy, up to and including the root segment. The 
  13990. following figure is an example of a picture drawn from a complex segment chain 
  13991. with called segments. 
  13992.  
  13993.  
  13994.                    Correlation on Retained Segments
  13995.  
  13996.                           Presentation Space          ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  13997.                                                       Γöé             id=222Γöé
  13998.                                                 ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇGpi Set Tag (...,6)Γöé
  13999.                                                 Γöé     Γöé                   Γöé
  14000.                                                 Γöé     Γöé       (Draws moon)Γöé
  14001.                                                 Γöé     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14002.                  Γöé Γöé                 ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14003.                  Γöé Γöé                 Γöé             id=220Γöé
  14004.                  Γöé Γöé               ΓöîΓöÇGpi Set Tag (...,4)Γöé   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14005.                  Γöé Γöé               Γöé ΓöéGpi ...            Γöé ΓöîΓöÇ      id=223Γöé
  14006.                  Γöé Γöé               Γöé Γöé     (Draws planet)Γöé Γöé Γöé(draws moon)Γöé
  14007.                  Γöé Γöé               Γöé ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ Γöé ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14008.                  Γöé Γöé    ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ   Γöé          Γöé
  14009.                  Γöé Γöé    Γöé             id=200Γöé   Γöé          Γöé ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14010.                  Γöé Γöé  ΓöîΓöÇGpi Set Tag (...,2)Γöé   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇ      id=224Γöé
  14011.                  Γöé Γöé  Γöé ΓöéGpi ...            Γöé              Γöé Γöé(draws moon)Γöé
  14012.                  Γöé Γöé  Γöé Γöé        (Draws sun)Γöé              Γöé ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14013.                  Γöé Γöé  Γöé ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ              Γöé
  14014.           ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓö┤ΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ   Γöé ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ Γöé ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14015.  chained Γöé Γöé             id=100Γöé   Γöé Γöé             id=230Γöé ΓööΓöÇ      id=225Γöé
  14016. segments Γöé ΓöéGpi Set Tag (...,1)Γöé   ΓööΓöÇ                   Γöé   Γöé(draws moon)Γöé
  14017.          Γöé ΓöéGpi ...            Γöé     Γöé                   Γöé   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14018.          Γöé Γöé       Root SegmentΓöé     Γöé     (Draws planet)Γöé
  14019.           ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓö¼ΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ     ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14020.                  Γöé Γöé  Γöé ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14021.                  Γöé Γöé  Γöé Γöé             id=300Γöé
  14022.                  Γöé Γöé  Γö£ΓöÇGpi Set Tag (..,12)Γöé
  14023.                  Γöé Γöé  Γöé ΓöéGpi ...            Γöé
  14024.                  Γöé Γöé  Γöé Γöé     (Draws course)Γöé
  14025.                  Γöé Γöé  Γöé ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14026.                  Γöé Γöé  Γöé
  14027.                  Γöé Γöé  Γöé ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14028.                  Γöé Γöé  Γöé Γöé             id=400Γöé
  14029.                  Γöé Γöé  ΓööΓöÇGpi Set Tag (..,22)Γöé
  14030.                  Γöé Γöé    ΓöéGpi ...            Γöé
  14031.                  Γöé Γöé    Γöé     (Draws rocket)Γöé
  14032.                  Γöé Γöé    ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14033.                            called segment
  14034.                          ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇ
  14035.  
  14036. Multiple Hits from a Called Segment 
  14037.  
  14038. Two separate items, called from different portions of the segment chain, 
  14039. intersect the pick aperture.  Each has a unique segment identifier and tag, so 
  14040. there are two hits. 
  14041.  
  14042. For called segments, the group of segment-tag pairs constitutes a single hit. 
  14043. You can limit the number of segment and tag pairs returned for each hit using 
  14044. the maximum depth parameter, just as you can limit the total number of hits 
  14045. returned to you using the maximum number of hits parameter. The following 
  14046. figure shows two examples of the alSegTag data structure from the previous 
  14047. figure, for two different lMaxDepth values. 
  14048.  
  14049.           ΓöîΓöÇ ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ ΓöÇΓöÇΓöÉ            ΓöîΓöÇΓöÇΓöÇ ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ ΓöÇΓöÇΓöÉ
  14050.           Γöé  Γöéid = 300Γöé  0Γöé            Γöé    Γöéid = 300Γöé  0Γöé
  14051.           Γöé  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé            Γöé    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé
  14052.           Γöé  Γöétag = 12Γöé  1Γöé            Γöé    Γöétag = 12Γöé  1Γöé
  14053.     ΓöîΓöÇ ΓöÇΓöÇΓöñ  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé            Γöé    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé
  14054.     Γöé     Γöé  Γöéid = 100Γöé  2Γöé            Γöé    Γöéid = 100Γöé  2Γöé
  14055.     Γöé     Γöé  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé            Γöé    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé
  14056.     Γöé     Γöé  Γöétag = 1 Γöé  3Γöé  2 actual  Γöé    Γöétag = 1 Γöé  3Γöé
  14057.     Γöé     Γò₧ΓòÉ Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γö£ΓöÇΓöÇ  hits  ΓöÇΓöÇΓöñ    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γö£ΓöÇ ΓöÇΓöÉ
  14058.     Γöé     Γöé  Γöéid = 222Γöé  4Γöé  returned  Γöé    Γöé    0   Γöé  4Γöé    Γöé
  14059.     Γöé     Γöé  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé            Γöé    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé    Γöé
  14060.  IMax     Γöé  Γöétag = 6 Γöé  5Γöé            Γöé    Γöé    0   Γöé  5Γöé    Γöé
  14061.  hitsΓöÇ ΓöÇΓöÇΓöñ  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé            Γöé    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé    Γöé
  14062.  = 3      Γöé  Γöéid = 220Γöé  6Γöé            Γöé    Γöé    0   Γöé  6Γöé    Γöé
  14063.     Γöé     Γöé  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé            Γöé    Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé    Γöé
  14064.     Γöé     Γöé  Γöétag = 4 Γöé  7Γöé            Γöé    Γöé    0   Γöé  7Γöé    Γöé
  14065.     Γöé     Γò₧ΓòÉ Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ ΓòÉΓòÉΓòí            Γöé ΓöîΓöÇ Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ ΓòÉΓòÉΓòí    Γöé
  14066.     Γöé     Γöé  Γöé    ?   Γöé  8Γöé            Γöé Γöé  Γöéid = 222Γöé  8Γöé    Γöé
  14067.     Γöé     Γöé  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé            Γöé Γöé  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé    Γöé
  14068.     Γöé     Γöé  Γöé    ?   Γöé  9Γöé  IMax      Γöé Γöé  Γöétag = 6 Γöé  9Γöé    Γöé
  14069.     ΓööΓöÇ ΓöÇΓöÇΓöñ  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γö£ΓöÇ Depth     Γöé Γöé  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé    Γöé
  14070.           Γöé  Γöé    ?   Γöé 10Γöé  = 2       Γöé Γöé  Γöéid = 220Γöé 10Γöé    Γöé
  14071.           Γöé  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé            Γöé Γöé  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé    Γöé
  14072.           Γöé  Γöé    ?   Γöé 11Γöé       IMax Γöé Γöé  Γöétag = 4 Γöé 11Γöé  IMax
  14073.           ΓööΓöÇ ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ ΓöÇΓöÇΓöÿ       DepthΓöéΓöÇΓöñ  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γö£ΓöÇ hits
  14074.                                   = 4  Γöé Γöé  Γöéid = 200Γöé 12Γöé  = 3
  14075.                                        Γöé Γöé  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé    Γöé
  14076.                                        Γöé Γöé  Γöétag = 2 Γöé 13Γöé    Γöé
  14077.                                        Γöé Γöé  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé    Γöé
  14078.                                        Γöé Γöé  Γöéid = 100Γöé 14Γöé    Γöé
  14079.                                        Γöé Γöé  Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé    Γöé
  14080.                                        Γöé Γöé  Γöétag = 1 Γöé 15Γöé    Γöé
  14081.                                        ΓööΓöÇΓööΓöÇ Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ ΓòÉΓòÉΓòí    Γöé
  14082.                                             Γöé    ?   Γöé 16Γöé    Γöé
  14083.                                             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé    Γöé
  14084.                                             Γöé    ?   Γöé 17Γöé    Γöé
  14085.                                             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé    Γöé
  14086.                                             Γöé    ?   Γöé 18Γöé    Γöé
  14087.                                             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé    Γöé
  14088.                                             Γöé    ?   Γöé 19Γöé    Γöé
  14089.                                             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γö£ΓöÇ ΓöÇΓöÿ
  14090.                                             Γöé    ?   Γöé 20Γöé
  14091.                                             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé
  14092.                                             Γöé    ?   Γöé 21Γöé
  14093.                                             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé
  14094.                                             Γöé    ?   Γöé 22Γöé
  14095.                                             Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ   Γöé
  14096.                                             Γöé    ?   Γöé 23Γöé
  14097.                                             ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ ΓöÇΓöÇΓöÿ
  14098.  
  14099. alSegTag Data Structure for Different lMaxDepth Values 
  14100.  
  14101. Unused segment-tag pairs for actual hits are set to 0 in the alSegTag array. 
  14102.  
  14103. There are two major reasons for the PM programming interface to provide this 
  14104. capacity. The first is the consideration of application storage. If your 
  14105. application is a graphics package, for example, providing extensive design 
  14106. capabilities to an end user, the user's drawing may be very complex with 10 or 
  14107. more levels of segment calling. The data returned from a single hit could 
  14108. require an alSegTag array so large the data overruns the application storage 
  14109. you had reserved. By setting a maximum calling depth, your application can 
  14110. reserve the correct amount of storage. 
  14111.  
  14112. The second consideration is the knowledge that your application's user is 
  14113. interested only in a certain level of calling depth. Many users will be 
  14114. interested only in the topmost called segment, because it usually is the 
  14115. segment containing the functions that performs the actual drawing. 
  14116.  
  14117.  
  14118. ΓòÉΓòÉΓòÉ 14.1.3. Pick Aperture ΓòÉΓòÉΓòÉ
  14119.  
  14120. Your application determines the size of the pick aperture using 
  14121. GpiQueryPickApertureSize, and determines the page space coordinates of the 
  14122. center of the aperture with GpiQueryPickAperturePosition. 
  14123.  
  14124. Because your objective is to retrieve a single detectable object for each 
  14125. correlation operation, you have to obtain a balance between the number of 
  14126. detectable objects in a picture and the size of the pick aperture. The more 
  14127. detectable objects you define, the smaller the pick aperture must be to return 
  14128. a manageable amount of information to the application. However, the pick 
  14129. aperture usually is not a 1 pel-by-1 pel rectangle. A larger rectangle makes 
  14130. better sense because the pick aperture can be difficult to hit with a single 
  14131. pel; but a larger sampling area, for example 4 pels-by-4 pels, increases the 
  14132. probability of an intersection between a lighted pel and the pick aperture. 
  14133.  
  14134. The pick aperture can be specified in any of the units available to the 
  14135. presentation space.  However, the type of unit must be identical to the type 
  14136. specified for the presentation page. The default size of the pick aperture is 
  14137. square, with sides equal to the default character cell height. 
  14138.  
  14139.  
  14140. ΓòÉΓòÉΓòÉ 14.2. Using Correlation ΓòÉΓòÉΓòÉ
  14141.  
  14142. This section explains how to perform correlation on the graphics associated 
  14143. with a segment. 
  14144.  
  14145. The following figure shows how to set the pick aperture size with 
  14146. GpiSetPickAperture, and correlate the segment chain with GpiCorrelateChain, 
  14147. passing it the pick-aperture position as the third argument. The functions use 
  14148. the psizlPick and pptlPick arguments to set the aperture size and position the 
  14149. aperture center. The correlation is performed on visible and detectable 
  14150. segments only (PICKSEL_VISIBLE). GpiCorrelateChain copies any segment-tag pairs 
  14151. to the buffer pointed to by alSegTag and returns the count of hits detected. 
  14152.  
  14153. #define INCL_GPICORRELATION
  14154. #include <os2.h>
  14155. LONG fncCORL01  (HPS hps, PSIZEL psizlPick, PPOINTL pptlPick,
  14156.                   LONG lMaxHits, LONG lMaxDepth, PLONG alSegTag)
  14157.     {
  14158.         LONG cHits;
  14159.  
  14160.         GpiSetPickApertureSize(hps, PICKAP_REC, psizlPick);
  14161.                                                      /* Set the pick aperture. */
  14162.  
  14163.         cHits = GpiCorrelateChain(hps, PICKSEL_VISIBLE, pptlPick,
  14164.                     lMaxHits, lMaxDepth, alSegTag);
  14165.                                                      /* Correlate the hits.    */
  14166.  
  14167.         return (cHits);                              /* Return count of hits.  */
  14168.  
  14169. } /* fncCORL01 */
  14170.  
  14171.  
  14172. Performing a Correlation Operation 
  14173.  
  14174.  
  14175. ΓòÉΓòÉΓòÉ 14.3. Summary ΓòÉΓòÉΓòÉ
  14176.  
  14177. The following table summarizes the functions used to correlate both retained 
  14178. and nonretained graphics and segments. 
  14179.  
  14180. Correlation Functions 
  14181.  
  14182. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14183. ΓöéFunction Name                 ΓöéDescription                   Γöé
  14184. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14185. ΓöéGpiCorrelateChain             ΓöéDetermines whether correlationΓöé
  14186. Γöé                              Γöéhits occurred at the current  Γöé
  14187. Γöé                              Γöépick-aperture location for anyΓöé
  14188. Γöé                              Γöésegment either actually in theΓöé
  14189. Γöé                              Γöésegment chain or called by a  Γöé
  14190. Γöé                              Γöésegment in the chain.         Γöé
  14191. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14192. ΓöéGpiCorrelateFrom              ΓöéDetermines whether correlationΓöé
  14193. Γöé                              Γöéhits occurred at the current  Γöé
  14194. Γöé                              Γöépick-aperture location for anyΓöé
  14195. Γöé                              Γöésegment in a range of chained Γöé
  14196. Γöé                              Γöésegments.                     Γöé
  14197. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14198. ΓöéGpiCorrelateSegment           ΓöéDetermines whether correlationΓöé
  14199. Γöé                              Γöéhits occurred at the current  Γöé
  14200. Γöé                              Γöépick-aperture location for a  Γöé
  14201. Γöé                              Γöégiven segment.                Γöé
  14202. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14203. ΓöéGpiErase                      ΓöéClears a window identified by Γöé
  14204. Γöé                              Γöéa screen device context, and  Γöé
  14205. Γöé                              Γöépaints the window, using the  Γöé
  14206. Γöé                              Γöécolor identified by index 0 inΓöé
  14207. Γöé                              Γöéthe presentation space color  Γöé
  14208. Γöé                              Γöétable.                        Γöé
  14209. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14210. ΓöéGpiQueryBoundaryData          ΓöéRetrieves the size of the     Γöé
  14211. Γöé                              Γöésmallest rectangle that       Γöé
  14212. Γöé                              Γöécompletely surrounds the      Γöé
  14213. Γöé                              Γöécurrent segment output, if theΓöé
  14214. Γöé                              Γöédrawing control DCTL_BOUNDARY Γöé
  14215. Γöé                              Γöéhas been set by calling       Γöé
  14216. Γöé                              ΓöéGpiSetDrawControl.            Γöé
  14217. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14218. ΓöéGpiQueryPickAperturePosition  ΓöéRetrieves the location of the Γöé
  14219. Γöé                              Γöécenter of the pick aperture inΓöé
  14220. Γöé                              Γöéthe application's page space. Γöé
  14221. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14222. ΓöéGpiQueryPickApertureSize      ΓöéRetrieves the dimensions of   Γöé
  14223. Γöé                              Γöéthe pick aperture in          Γöé
  14224. Γöé                              Γöépresentation page coordinates.Γöé
  14225. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14226. ΓöéGpiQueryTag                   ΓöéRetrieves the value of the    Γöé
  14227. Γöé                              Γöélast tag set by calling       Γöé
  14228. Γöé                              ΓöéGpiSetTag.                    Γöé
  14229. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14230. ΓöéGpiResetBoundaryData          ΓöéResets the boundary data to   Γöé
  14231. Γöé                              ΓöéNULL.                         Γöé
  14232. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14233. ΓöéGpiSetDrawControl             ΓöéSets one of the five drawing  Γöé
  14234. Γöé                              Γöécontrols. These controls are  Γöé
  14235. Γöé                              Γöédescribed in a previous table.Γöé
  14236. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14237. ΓöéGpiSetPickAperturePosition    ΓöéSets the location of the      Γöé
  14238. Γöé                              Γöécenter of the pick aperture inΓöé
  14239. Γöé                              Γöéthe application's page space. Γöé
  14240. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14241. ΓöéGpiSetPickApertureSize        ΓöéSets the dimensions of the    Γöé
  14242. Γöé                              Γöépick aperture in presentation Γöé
  14243. Γöé                              Γöépage coordinates.             Γöé
  14244. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14245. ΓöéGpiSetTag                     ΓöéAssigns a tag to an element inΓöé
  14246. Γöé                              Γöéa segment.                    Γöé
  14247. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14248.  
  14249.  
  14250. ΓòÉΓòÉΓòÉ 15. Metafiles ΓòÉΓòÉΓòÉ
  14251.  
  14252. A metafile is a graphics object that, like a segment, contains the GPI 
  14253. instructions that contribute to the final version of a picture. Unlike a 
  14254. segment, a metafile also contains a header, with state information, and all 
  14255. resources necessary to identically create the picture. Because pictures that 
  14256. are displayed when a graphics application is executed are lost when the 
  14257. application finishes, metafiles provide a method of retaining pictures beyond a 
  14258. single execution of an application. 
  14259.  
  14260. The following topics are related to the information in this chapter: 
  14261.  
  14262. o Presentation spaces 
  14263. o Device contexts 
  14264. o Line primitives 
  14265. o Marker primitives 
  14266. o Area primitives 
  14267. o Character string primitives 
  14268. o Color and mix attributes 
  14269. o Paths 
  14270. o Regions 
  14271. o Fonts 
  14272. o Printing 
  14273. o Segments 
  14274. o Bit maps 
  14275. o Coordinate spaces and transformations. 
  14276.  
  14277.  
  14278. ΓòÉΓòÉΓòÉ 15.1. About Metafiles ΓòÉΓòÉΓòÉ
  14279.  
  14280. Metafiles can exist in three distinct forms.  A metafile that has just been 
  14281. created is called a memory metafile because it exists in memory managed by the 
  14282. Presentation Manager on behalf of the application that created it. A metafile 
  14283. that is transferred to disk storage as a file with the default extension of 
  14284. .MET is called a disk metafile.  A metafile that is loaded into an 
  14285. application's memory is editable by the application. 
  14286.  
  14287. Metafiles save resources in the following ways: 
  14288.  
  14289. o Metafiles can be created and used in draw mode by a single application. 
  14290.   Therefore, an application that is not retaining segments in a segment store 
  14291.   can retain graphics in a metafile. 
  14292.  
  14293. o Metafiles remain available while the owning application is running, 
  14294.   regardless of the number of presentation spaces the application obtains or 
  14295.   defines. 
  14296.  
  14297. o Given the same starting conditions in each presentation space, you can 
  14298.   produce an identical picture each time the metafile contents are executed. 
  14299.  
  14300. o Different threads or processes within an application can display a picture 
  14301.   stored as a metafile without each having to own the metafile. 
  14302.  
  14303. o If your organization has common graphical resources, such as a company logo, 
  14304.   those resources can be stored in a metafile. This avoids the overhead of 
  14305.   re-creating the resources each time they are needed. 
  14306.  
  14307. o Because the metafile is a device-independent format, it is useful for 
  14308.   transferring pictures that are to be printed when the printer-type is 
  14309.   unknown. 
  14310.  
  14311. o PM applications can exchange graphical information by using metafiles, either 
  14312.   by using the clipboard or by transferring them over a network. 
  14313.  
  14314. o Your application can also exchange graphics data with non-PM applications 
  14315.   that support the Mixed Object Document Content Architecture (MO:DCA) 
  14316.   interchange standard. 
  14317.  
  14318.  
  14319. Unlike bit-maps, metafiles offer some device-independence. Bit maps store 
  14320. picture information on a pel-by-pel basis.  Metafiles store picture information 
  14321. in the form of low-level graphics commands that the operating system uses to 
  14322. construct the pictures. 
  14323.  
  14324. Note:  Metafiles can contain bit maps or other graphics information that is in 
  14325.        device-dependent format. 
  14326.  
  14327. The graphics commands, called "graphics orders", represent graphics functions 
  14328. that create a picture. These include drawing instructions, as well as 
  14329. attribute-setting instructions (for example, color tables and logical fonts) 
  14330. and anything that describes the structure of the picture.  The contents of a 
  14331. metafile, therefore, are similar to those of the graphics presentation space in 
  14332. which the picture is drawn.  The Presentation Manager automatically records the 
  14333. environmental detail of the presentation space in which a picture is drawn in 
  14334. the metafile. 
  14335.  
  14336. Note:  A metafile can contain data generated from GPI functions only.  Any 
  14337.        non-graphical data included in a metafile is ignored. 
  14338.  
  14339. An application can re-create a picture from a metafile and display it in a 
  14340. window on the screen or print it by "playing" the metafile. When an application 
  14341. displays the contents of a metafile, it can use the color table, font, fill 
  14342. pattern, and transformations that are stored in the metafile, or it can use the 
  14343. logical color table, logical font, fill pattern, and transformations that are 
  14344. set for the current presentation space.  The appearance of the picture stored 
  14345. in the metafile can, therefore, be changed by editing the current presentation 
  14346. space before playing the metafile. 
  14347.  
  14348. An application can save metafiles to a disk to be loaded later by any 
  14349. application that chooses to access the metafile.  Disk metafiles loaded into 
  14350. application memory can also be edited in the same manner as elements in 
  14351. graphics segments are edited. 
  14352.  
  14353.  
  14354. ΓòÉΓòÉΓòÉ 15.1.1. Contents of a Metafile ΓòÉΓòÉΓòÉ
  14355.  
  14356. Every graphic function can be represented by one or more graphics orders. The 
  14357. operating system defines graphics orders for: 
  14358.  
  14359. o Areas 
  14360. o Bit maps (for fill patterns) and pattern-reference points 
  14361. o Character output and attribute 
  14362. o Colors and mix modes (foreground and background) 
  14363. o Lines and arcs and line and arc attributes (including GpiBox) 
  14364. o Paths (including clip paths) 
  14365. o Position (for example, GpiMove) 
  14366. o Saving and resetting attributes (including GpiPop) 
  14367. o Transformations (in model space) 
  14368. o Viewing Limits. 
  14369.  
  14370. Editing Retained Graphics and Graphics Segments also describes orders and how 
  14371. to edit them. 
  14372.  
  14373. When a picture is drawn in a presentation space associated with a metafile 
  14374. device context, the operating system converts the primitive attributes and 
  14375. drawing functions into graphics orders and stores them in the metafile. 
  14376.  
  14377. The operating system stores the effects of region and other operations that are 
  14378. not permitted as escape orders in the metafile. When an application finishes 
  14379. playing a metafile, the system restores any regions that were defined for the 
  14380. presentation space prior to calling GpiPlayMetaFile. 
  14381.  
  14382. An application can use any of the query functions while creating a metafile, 
  14383. but the system will not store those query functions in the metafile. 
  14384. Similarly, an application can set a value by using a mathematical operator, but 
  14385. the system will store only the result of the operation in the metafile.  For 
  14386. example, if an application determines the end point of a line by subtracting 
  14387. 100 from the x- and y-coordinates of the upper-right corner of a window, the 
  14388. system records the end point, not the relative distance, in the metafile. 
  14389.  
  14390. Because the output of bit map functions is dependent upon the capabilities of 
  14391. the output device, Gpi bit map functions might produce unexpected results when 
  14392. they are used in a metafile.  If the pel dimensions of the output device are 
  14393. different from the pel dimensions of the device on which the metafile was 
  14394. created, the bit map will be distorted.  If the output device is a plotter, the 
  14395. bit map functions will not work at all. 
  14396.  
  14397. Most of the escape functions used by the DevEscape function can be used in 
  14398. metafiles.  The escape functions that the system does not save in metafiles are 
  14399. DEVESC_QUERYESCSUPPORT and DEVESC_GETSCALINGFACTOR. 
  14400.  
  14401.  
  14402. ΓòÉΓòÉΓòÉ 15.1.1.1. Metafile Content Restrictions ΓòÉΓòÉΓòÉ
  14403.  
  14404. Like areas and paths, not all functions and attributes can be represented in a 
  14405. metafile. Metafile content is mainly dependent upon the drawing mode in which 
  14406. the metafile is to be played. If the metafile is to be played when the current 
  14407. drawing-mode parameter is DM_DRAW (and in no other drawing mode), the metafile 
  14408. content is restricted as shown in Draw-Mode Restrictions. If the metafile is to 
  14409. be played when the current drawing-mode parameter is DM_RETAIN or 
  14410. DM_DRAWANDRETAIN, or if the file is to conform to SAA* guidelines, the metafile 
  14411. content is restricted as shown in Creating Metafiles for Interchange. 
  14412.  
  14413. Metafile restrictions are also described in Appendix G in Presentation Manager 
  14414. Programming Reference Volume III. 
  14415.  
  14416.  
  14417. ΓòÉΓòÉΓòÉ 15.1.1.1.1. Draw-Mode Restrictions ΓòÉΓòÉΓòÉ
  14418.  
  14419. The following restrictions apply if the metafile is to be played when the 
  14420. current drawing mode parameter is DM_DRAW: 
  14421.  
  14422. o If the DCTL_DISPLAY flag of GpiSetDrawControl is OFF when you are sending 
  14423.   graphics to a metafile, the graphics will not be visible when the metafile is 
  14424.   played.  Their effects on the current position and on current attribute 
  14425.   settings are recorded. 
  14426.  
  14427. o Region functions are not recorded in a metafile. The effects of the following 
  14428.   functions, however, are recorded: 
  14429.  
  14430.    - GpiSetClipRegion 
  14431.    - GpiIntersectClipRegion 
  14432.    - GpiExcludeClipRegion 
  14433.    - GpiOffsetClipRegion 
  14434.    - GpiPaintRegion. 
  14435.  
  14436.   When the metafile is played into a presentation space, temporary regions are 
  14437.   created.  Upon completion of GpiPlayMetaFile, these temporary regions are 
  14438.   automatically deleted and the clipping region that was current before the 
  14439.   metafile was played, is restored. 
  14440.  
  14441. o In general, escape functions identified by reserved escape codes (that is, 
  14442.   escape codes in the range of 0 through 32767) are recorded in a metafile. 
  14443.   However, the DevEscape functions DEVESC_QUERYESCSUPPORT (escape code 0) and 
  14444.   DEVESC_GETSCALINGFACTOR (escape code 1) are not stored in the metafile. 
  14445.  
  14446. o The effect GpiErase, including close-segment processing, is recorded in a 
  14447.   metafile. 
  14448.  
  14449. o The following functions can produce unexpected effects if the metafile 
  14450.   contents are displayed on a different device from the one they were created 
  14451.   for: 
  14452.  
  14453.    - GpiBitBlt 
  14454.    - GpiSetPel 
  14455.    - GpiSetClipRegion 
  14456.    - GpiOffsetClipRegion 
  14457.    - GpiPaintRegion 
  14458.    - GpiIntersectClipRectangle 
  14459.    - GpiExcludeClipRectangle. 
  14460.  
  14461.   The reason for the unexpected effects is because the pel resolutions of the 
  14462.   devices might differ.  Raster operations (for example, GpiBitBlt) do not work 
  14463.   on plotters. 
  14464.  
  14465. o You can associate the metafile device context with a different presentation 
  14466.   space while creating the metafile, but the new presentation space must have 
  14467.   the same format as the original. 
  14468.  
  14469.  
  14470. ΓòÉΓòÉΓòÉ 15.1.1.1.2. Creating Metafiles for Interchange ΓòÉΓòÉΓòÉ
  14471.  
  14472. The following restrictions apply if the metafile is to be played when the 
  14473. current drawing-mode parameter is DM_DRAWANDRETAIN or DM_RETAIN, or if the 
  14474. metafile is to conform to SAA guidelines: 
  14475.  
  14476. o Before you issue the first drawing instruction to a graphics presentation 
  14477.   space that has been associated with a metafile device context, you must 
  14478.   establish (or default) the following: 
  14479.  
  14480.    - The graphics field (use GpiSetGraphicsField) 
  14481.  
  14482.    - The color table (use GpiCreateLogColorTable) 
  14483.  
  14484.    - The code page for the default character set (use GpiSetCp) 
  14485.  
  14486.    - The default viewing transformation (use GpiSetDefaultViewMatrix) 
  14487.  
  14488.    - The settings of the drawing controls (use GpiSetDrawControl; DCTL_DISPLAY 
  14489.      must be set on) 
  14490.  
  14491.    - The default values of attributes (use GpiSetDefAttrs) 
  14492.  
  14493.    - The default viewing limits (use GpiSetDefViewingLimits) 
  14494.  
  14495.    - The primitive tag (use GpiSetDefTag) 
  14496.  
  14497.    - The default arc parameters (use GpiSetDefArcParams). 
  14498.  
  14499.   You must not specify a graphics field if the metafile is to conform to SAA 
  14500.   guidelines.  If a graphics field is specified, you can play the metafile in 
  14501.   DM_RETAIN or DM_DRAWANDRETAIN mode, but the graphics field must be specified 
  14502.   before the first drawing instruction is issued to the metafile. The effect of 
  14503.   the graphics field in the target presentation space when playing the metafile 
  14504.   is controlled by the PMF_LOADTYPE option of GpiPlayMetafile. 
  14505.  
  14506. o You can define logical fonts and identify bit maps to be used as area-fill 
  14507.   patterns at any time.  You must not, however, issue GpiDeleteSetId against 
  14508.   these resources after they have been established. Once assigned, therefore, 
  14509.   lcids cannot be reused. 
  14510.  
  14511. o The size of the logical-color-table data must not exceed 31KB. 
  14512.  
  14513. o You must not use clipping regions.  Therefore, none of the following 
  14514.   functions is supported: 
  14515.  
  14516.    - GpiSetClipRegion 
  14517.    - GpiExcludeClipRectangle 
  14518.    - GpiIntersectClipRectangle 
  14519.    - GpiOffsetClipRegion. 
  14520.  
  14521. o You must not reassociate the metafile device context. 
  14522.  
  14523. o When you use a bit map as the source of a GpiWCBitBlt operation or as an 
  14524.   area-fill pattern, it must not be modified. 
  14525.  
  14526. o Only the following foreground mixes can be used: 
  14527.  
  14528.    - FM_DEFAULT 
  14529.    - FM_OR 
  14530.    - FM_OVERPAINT 
  14531.    - FM_LEAVEALONE. 
  14532.  
  14533. o Only the following background mixes can be used: 
  14534.  
  14535.    - BM_DEFAULT 
  14536.    - BM_OVERPAINT 
  14537.    - BM_LEAVEALONE. 
  14538.  
  14539. o The following functions are not supported: 
  14540.  
  14541.    - GpiBitBlt 
  14542.    - GpiSetPel 
  14543.    - GpiSetPS 
  14544.    - GpiResetPS 
  14545.    - GpiErase 
  14546.    - GpiPaintRegion 
  14547.    - DevEscape. 
  14548.  
  14549.  
  14550. ΓòÉΓòÉΓòÉ 15.1.1.1.3. Micro Presentation Space Restrictions ΓòÉΓòÉΓòÉ
  14551.  
  14552. When you create a metafile from a micro presentation space, or play the 
  14553. metafile through a micro presentation space, the contents of the metafile are 
  14554. restricted to those GPI functions that are valid in a micro presentation space. 
  14555. In this case, the application must use GpiDestroyPS instead of GpiAssociate 
  14556. before issuing DevCloseDC.  GpiAssociate is not permitted in a micro 
  14557. presentation space. 
  14558.  
  14559.  
  14560. ΓòÉΓòÉΓòÉ 15.1.1.1.4. Query Restrictions ΓòÉΓòÉΓòÉ
  14561.  
  14562. Query functions can be issued, with the usual restrictions, unless the metafile 
  14563. device context was created using the no query option, OD_METAFILE_NOQUERY. 
  14564.  
  14565.  
  14566. ΓòÉΓòÉΓòÉ 15.1.1.1.5. Segment Restrictions ΓòÉΓòÉΓòÉ
  14567.  
  14568. Chained and unchained segments invoked by any GpiDraw command are written to 
  14569. the metafile.  Primitives outside segments are recorded automatically as zero 
  14570. segments.  If the metafile is subsequently played in DM_RETAIN mode, all 
  14571. graphics are directed to the segment store. 
  14572.  
  14573. Chained dynamic segments cannot be recorded in a metafile. GpiRemoveDynamics 
  14574. and GpiDrawDynamics cause an error condition to be raised when the presentation 
  14575. space is associated with a metafile device context. Unchained dynamic segments 
  14576. are recorded as zero segments.  To draw an unchained dynamic segment, use 
  14577. GpiDrawSegment. 
  14578.  
  14579.  
  14580. ΓòÉΓòÉΓòÉ 15.1.1.1.6. Asynchronous Drawing Thread Restrictions ΓòÉΓòÉΓòÉ
  14581.  
  14582. If the metafile is being created on an asynchronous drawing thread and the 
  14583. thread is suspended by GpiSetStopDraw, an unusable metafile results. 
  14584.  
  14585.  
  14586. ΓòÉΓòÉΓòÉ 15.1.2. Metafile Functions ΓòÉΓòÉΓòÉ
  14587.  
  14588. OS/2 2.0 provides a set of functions that allow you to: 
  14589.  
  14590. o Create a metafile 
  14591. o Store pictures in a metafile 
  14592. o Play a metafile 
  14593. o Save a metafile 
  14594. o Load a metafile 
  14595. o Edit a metafile 
  14596. o Copy a metafile 
  14597. o Delete a metafile. 
  14598.  
  14599. How these functions are used to create and manipulate metafiles in relationship 
  14600. to applications and components of the operating system is illustrated in the 
  14601. following figure. 
  14602.  
  14603. Metafile Functions 
  14604.  
  14605.  
  14606. ΓòÉΓòÉΓòÉ 15.1.2.1. Creating a Metafile ΓòÉΓòÉΓòÉ
  14607.  
  14608. Pictures are drawn in presentation spaces associated with device contexts. PM 
  14609. considers a metafile to be an output device or destination, in the same manner 
  14610. as a window or printer. This means that to record a picture in a metafile, a 
  14611. metafile device context must be created and associated with a presentation 
  14612. space. 
  14613.  
  14614. A metafile device context is created by calling DevOpenDC and specifying the 
  14615. type of device context as: 
  14616.  
  14617. o OD_METAFILE 
  14618. o OD_METAFILE_NOQUERY. 
  14619.  
  14620. OD_METAFILE is generally used to specify a metafile device context, although 
  14621. OD_METAFILE_NOQUERY provides better recording performance. OD_METAFILE_NOQUERY 
  14622. does not support attribute queries, for example, GpiQueryCurrentPosition, or 
  14623. GpiQueryColor. 
  14624.  
  14625. The device driver for the device that the metafile device context is associated 
  14626. with is specified in the DEVOPENSTRUC data structure required for DevOpenDC. 
  14627. DEVOPENSTRUC is described in Print Job Submission and Manipulation. 
  14628.  
  14629. A metafile device context can be associated with a newly-created presentation 
  14630. space by calling GpiCreatePS and specifying the handle to the metafile device 
  14631. context returned from the call to DevOpenDC. A metafile device context can also 
  14632. be associated with an existing, normal presentation space by calling 
  14633. GpiAssociate and specifying the handle to the metafile device context returned 
  14634. from the call to DevOpenDC. 
  14635.  
  14636.  
  14637. ΓòÉΓòÉΓòÉ 15.1.2.2. Storing Pictures in a Metafile ΓòÉΓòÉΓòÉ
  14638.  
  14639. When a metafile device context is associated with a presentation space, 
  14640. presentation space resources (such as the current logical color table ) and 
  14641. environmental settings (such as the presentation-page format) are copied 
  14642. automatically into the metafile. These items must be established before the 
  14643. presentation space is associated with the metafile device context. 
  14644.  
  14645. Loading of additional resources (such as fonts) and adjustments to the 
  14646. environment (such as modifying the default viewing transform) should be made 
  14647. before you begin drawing. Attribute settings, segment-creation requests, and 
  14648. primitive-drawing requests that contribute to the picture are directed to the 
  14649. metafile after its device context has been associated with a presentation 
  14650. space. 
  14651.  
  14652. If an application calls GpiSetDrawControl, specifying DCTL_DISPLAY and 
  14653. DCTL_OFF, before drawing graphics into a metafile, the graphics are not visible 
  14654. when the metafile is played.  However, the metafile records any changes made to 
  14655. the current position or presentation-space attributes. 
  14656.  
  14657. When the metafile device context has been associated with a graphics 
  14658. presentation space, the metafile is ready to receive graphical data. Just as 
  14659. with any other output destination, whether the picture is sent directly to the 
  14660. metafile is controlled by the current drawing mode, as shown in the following 
  14661. table. 
  14662.  
  14663. Drawing Mode Dependencies When Recording Metafiles 
  14664.  
  14665. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14666. ΓöéDrawing Mode          ΓöéEffect                                Γöé
  14667. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14668. ΓöéDraw mode             ΓöéGraphics go directly to the metafile. Γöé
  14669. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14670. ΓöéRetain mode           ΓöéGraphics go to the segment store of   Γöé
  14671. Γöé                      Γöéthe presentation space. They are not  Γöé
  14672. Γöé                      Γöédirected to the metafile until the    Γöé
  14673. Γöé                      Γöéapplication issues an appropriate     Γöé
  14674. Γöé                      ΓöéGpiDraw request (GpiDrawChain,        Γöé
  14675. Γöé                      ΓöéGpiDrawFrom, GpiDrawSegment).         Γöé
  14676. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14677. ΓöéDraw-and-retain mode  ΓöéGraphics go directly to the metafile, Γöé
  14678. Γöé                      Γöéand also to the segment store of the  Γöé
  14679. Γöé                      Γöépresentation space.                   Γöé
  14680. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14681.  
  14682. The drawing mode can be changed at any time while the metafile device context 
  14683. remains open by calling GpiSetDrawingMode. 
  14684.  
  14685. As long as the metafile device context remains open, you can continue drawing. 
  14686. A metafile can only contain data generated from GPI functions. Any nongraphical 
  14687. data included in a metafile is ignored. The following list describes items 
  14688. found in a metafile: 
  14689.  
  14690. o Picture 
  14691. o Logical color table 
  14692. o Logical font 
  14693. o Fill pattern 
  14694. o Viewing transformation 
  14695. o Page units 
  14696. o Page dimensions. 
  14697.  
  14698. When an application finishes drawing in a metafile, it must disassociate the 
  14699. metafile device context from the presentation space by calling GpiAssociate. If 
  14700. the metafile is associated with or through a micro presentation space, call 
  14701. GpiDestroyPS to perform an implicit disassociation. 
  14702.  
  14703. When you have finished drawing in the metafile, and the presentation space has 
  14704. been disassociated, the application can close the metafile device context and 
  14705. obtain a handle to the metafile by calling DevCloseDC. A closed metafile cannot 
  14706. be reopened; therefore, additional drawing in the metafile is not possible.  A 
  14707. closed metafile can be referenced by the metafile handle. The metafile handle 
  14708. is used to reference the metafile for subsequent operations on the metafile. 
  14709. Use the metafile handle to: 
  14710.  
  14711. o Transfer a metafile to application memory 
  14712. o Transfer a metafile from application memory 
  14713. o Save a metafile on disk 
  14714. o Play a metafile into presentation space 
  14715. o Edit a metafile 
  14716. o Copy a metafile 
  14717. o Delete a metafile. 
  14718.  
  14719. Because each metafile can be distinctly identified, your application can work 
  14720. with more than one metafile at a time. However, because metafiles can be very 
  14721. large files, you must make maximum use of the metafile handles to avoid 
  14722. duplicating the actual metafiles in memory. 
  14723.  
  14724.  
  14725. ΓòÉΓòÉΓòÉ 15.1.2.3. Playing a Metafile ΓòÉΓòÉΓòÉ
  14726.  
  14727. An application can redraw a picture stored in a metafile by executing the 
  14728. contents of metafile. This is known as playing a metafile into a graphics 
  14729. presentation space. How a picture is redrawn (that is, how the metafile is 
  14730. replayed) depends on the current drawing-mode of the target presentation space. 
  14731. The following table describes these dependencies. 
  14732.  
  14733. Drawing Mode Dependencies When Playing Metafiles 
  14734.  
  14735. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14736. ΓöéDrawing Mode      ΓöéResult               ΓöéIf the metafile      Γöé
  14737. Γöé                  Γöé                     Γöécontains a segment   Γöé
  14738. Γöé                  Γöé                     Γöéchain...             Γöé
  14739. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14740. ΓöéDM_DRAW           ΓöéThe metafile contentsΓöéThe contents of the  Γöé
  14741. Γöé                  Γöéare executed, and theΓöésegments in the chainΓöé
  14742. Γöé                  Γöépicture is directed  Γöérepresent the pictureΓöé
  14743. Γöé                  Γöéto the current outputΓöéoutput that is       Γöé
  14744. Γöé                  Γöédevice.              Γöédirected at the      Γöé
  14745. Γöé                  Γöé                     Γöétarget output device.Γöé
  14746. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14747. ΓöéDM_RETAIN         ΓöéThe metafile contentsΓöéThe chain is added toΓöé
  14748. Γöé                  Γöéare retained in the  Γöéthe end of any chain Γöé
  14749. Γöé                  Γöéapplication's segmentΓöéthat may already be  Γöé
  14750. Γöé                  Γöéstore. The picture   Γöéin the segment store.Γöé
  14751. Γöé                  Γöédefined in the       ΓöéIf any segment in theΓöé
  14752. Γöé                  Γöémetafile is not      Γöémetafile has the sameΓöé
  14753. Γöé                  Γöédirected to an outputΓöénonzero name as a    Γöé
  14754. Γöé                  Γöédevice until the     Γöésegment already in   Γöé
  14755. Γöé                  Γöéapplication issues anΓöéthe segment store of Γöé
  14756. Γöé                  Γöéappropriate GpiDraw. Γöéthe presentation     Γöé
  14757. Γöé                  Γöé                     Γöéspace, an error      Γöé
  14758. Γöé                  Γöé                     Γöécondition is raised. Γöé
  14759. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14760. ΓöéDM_DRAWANDRETAIN  ΓöéThe metafile contentsΓöéSee above.           Γöé
  14761. Γöé                  Γöéare both stored and  Γöé                     Γöé
  14762. Γöé                  Γöéexecuted.            Γöé                     Γöé
  14763. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14764.  
  14765. Note:  Unchained segments in the metafile are always retained, regardless of 
  14766. the current drawing-mode parameter. 
  14767.  
  14768. When the contents of a metafile are retained in the segment store of the target 
  14769. presentation space, they can be manipulated by the application as if the 
  14770. application had created them. For example, the segments can be edited, drawn, 
  14771. correlated, and deleted. 
  14772.  
  14773. A metafile is "played" by calling GpiPlayMetaFile.  A metafile cannot, however, 
  14774. be "played" within a segment bracket. GpiPlayMetaFile requires a metafile 
  14775. handle, an option count, an options array, a byte count of a descriptive 
  14776. record, and the descriptive record. 
  14777.  
  14778. The GpiPlayMetaFile descriptive record is a natural-language description of the 
  14779. picture contents. For example, its value might be A House. This description is 
  14780. provided on input to the DevOpenDC function that defines the metafile device 
  14781. context.  It can be used, for example, in a list box from which a user can 
  14782. select a picture. 
  14783.  
  14784. The GpiPlayMetaFile options array specifies how the operating system alters 
  14785. your application's presentation space before playing the metafile. The options 
  14786. array determines the display attributes of the metafile. The array fields and 
  14787. their respective attributes, as numbered consecutively in the array, are shown 
  14788. in the following table. 
  14789.  
  14790. GpiPlayMetaFile Options 
  14791.  
  14792. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14793. ΓöéOption                        ΓöéAttribute                     Γöé
  14794. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14795. ΓöéPMF_SEGBASE                   ΓöéReserved, must be 0.          Γöé
  14796. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14797. ΓöéPMF_LOADTYPE                  ΓöéViewing transform, graphics.  Γöé
  14798. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14799. ΓöéPMF_RESOLVE                   ΓöéReserved, must be 0.          Γöé
  14800. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14801. ΓöéPMF_LCIDS                     ΓöéFont and local bit map local  Γöé
  14802. Γöé                              Γöéidentifiers.                  Γöé
  14803. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14804. ΓöéPMF_RESET                     ΓöéDrawing attributes.           Γöé
  14805. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14806. ΓöéPMF_SUPPRESS                  ΓöéActual playing of the         Γöé
  14807. Γöé                              Γöémetafile.                     Γöé
  14808. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14809. ΓöéPMF_COLORTABLES               ΓöéColor tables, color palettes. Γöé
  14810. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14811. ΓöéPMF_COLORREALIZABLE           ΓöéRealization of metafile color Γöé
  14812. Γöé                              Γöétable.                        Γöé
  14813. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14814. ΓöéPMF_DEFAULTS                  ΓöéDrawing defaults values.      Γöé
  14815. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14816.  
  14817.  
  14818. ΓòÉΓòÉΓòÉ 15.1.2.3.1. PMF_RESET Option ΓòÉΓòÉΓòÉ
  14819.  
  14820. The PMF_RESET option, more so than the other array options, controls the 
  14821. effects of other array options. This option allows a total reset of the 
  14822. presentation space and provides further control of the following presentation 
  14823. space environmental attributes: 
  14824.  
  14825. o Page units (device transform) 
  14826. o Page dimensions 
  14827. o Default viewing transform. 
  14828.  
  14829. Warning: If the metafile page units, page dimensions and page coordinate format 
  14830. do not match those in the presentation space, playing the metafile will cause 
  14831. an error. 
  14832.  
  14833. The PMF_RESET option can have one of the values shown in the following table. 
  14834.  
  14835. PMF_RESET Options for GpiPlayMetaFile 
  14836.  
  14837. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14838. ΓöéValue           ΓöéDescription                                 Γöé
  14839. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14840. ΓöéRES_RESET       ΓöéAllows the presentation space to be         Γöé
  14841. Γöé                Γöécompletely reset, just as if it were newly  Γöé
  14842. Γöé                Γöécreated, and the values of the              Γöé
  14843. Γöé                Γöéaforementioned environmental attributes to  Γöé
  14844. Γöé                Γöébe specified from the metafile into the     Γöé
  14845. Γöé                Γöépresentation space.                         Γöé
  14846. Γöé                Γöé                                            Γöé
  14847. Γöé                ΓöéThis option is equivalent to specifying     Γöé
  14848. Γöé                ΓöéGRES_ALL on GpiResetPS. If this option is   Γöé
  14849. Γöé                Γöéused, the target presentation page is       Γöé
  14850. Γöé                Γöéredefined so that it is the same size, and  Γöé
  14851. Γöé                Γöédefined in the same units, as the metafile. Γöé
  14852. Γöé                ΓöéIt also ensures that the physical size of   Γöé
  14853. Γöé                Γöéthe metafile picture is preserved if the    Γöé
  14854. Γöé                Γöépresentation page is defined in units other Γöé
  14855. Γöé                Γöéthan pels, or arbitrary units.              Γöé
  14856. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14857. ΓöéRES_NORESET     ΓöéPrevents resetting of the presentation      Γöé
  14858. ΓöéRES_DEFAULT     Γöéspace. The existing presentation space      Γöé
  14859. Γöé                Γöévalues of the environmental attributes will Γöé
  14860. Γöé                Γöébe preserved, and their values in the       Γöé
  14861. Γöé                Γöémetafile will be discarded.                 Γöé
  14862. Γöé                Γöé                                            Γöé
  14863. Γöé                ΓöéIf this option is used, ensure that the     Γöé
  14864. Γöé                Γöépresentation-page units of the target       Γöé
  14865. Γöé                Γöépresentation space are the same as those    Γöé
  14866. Γöé                Γöéwith which the metafile was generated,      Γöé
  14867. Γöé                Γöébefore you play a metafile into the         Γöé
  14868. Γöé                Γöépresentation space. For example, if the     Γöé
  14869. Γöé                Γöéoriginal presentation page is defined in    Γöé
  14870. Γöé                Γöéincrements of 0.1 mm, the target            Γöé
  14871. Γöé                Γöépresentation page must be defined in the    Γöé
  14872. Γöé                Γöésame way.                                   Γöé
  14873. Γöé                Γöé                                            Γöé
  14874. Γöé                ΓöéTo change the format of the target          Γöé
  14875. Γöé                Γöépresentation page, if the presentation-page Γöé
  14876. Γöé                Γöéformats do not match, issue GpiSetPS, but   Γöé
  14877. Γöé                Γöéonly if you know the metafile               Γöé
  14878. Γöé                Γöépresentation-page units.                    Γöé
  14879. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14880.  
  14881. If you are certain that the settings of the current presentation space are 
  14882. appropriate for the metafile, then you can play the metafile with the NO_RESET 
  14883. option. To reset some or all of the current values in the target presentation 
  14884. space, without redefining the presentation page, call: 
  14885.  
  14886.  1. GpiResetPS, with the GRES_ATTRS or GRES_SEGMENTS option 
  14887.  2. GpiPlayMetaFile, with the NO_RESET option. 
  14888.  
  14889. The PMF_LCID option may be used to append or replace fonts from the metafile to 
  14890. the fonts in the presentation space. The PMF_COLORTABLES option may be used to 
  14891. append or replace color table entries in the presentation space from the 
  14892. metafile. Other options (PMF_LOADTYPE, PMF_DEFAULTS, and so on) can be used to 
  14893. selectively replace settings in the presentation space from the metafile. 
  14894.  
  14895. Like the PMF_RESET option, other options, except for PMF_SUPPRESS, either: 
  14896.  
  14897. o Allow the values in the presentation space to be preserved and those in the 
  14898.   metafile to be discarded, or 
  14899.  
  14900. o Allow the presentation space to be loaded using the values in the metafile. 
  14901.  
  14902. If the first choice is used with RES_RESET, then the items controlled by the 
  14903. PMF_options will be left set to their default reset state, otherwise it will 
  14904. occur as described in the first choice above. 
  14905.  
  14906. If the second choice is used with RES_RESET, then the items controlled by the 
  14907. PMF_options are as described above. If it is used with RES_NORESET, then the 
  14908. fonts and color tables in the metafile can append to the existing color tables 
  14909. and fonts in the presentation space. Existing presentation space color table 
  14910. entries and fonts, such as viewing transform will be replaced if respecified in 
  14911. the metafile. 
  14912.  
  14913. Note:  If your application uses the attributes from the metafile, the 
  14914.        attributes that were specified in the presentation space before the 
  14915.        metafile was played are overwritten. 
  14916.  
  14917.  
  14918. ΓòÉΓòÉΓòÉ 15.1.2.3.2. PMF_SUPPRESS Option ΓòÉΓòÉΓòÉ
  14919.  
  14920. The PMF_SUPPRESS option allows you to control the playing of the metafile. The 
  14921. PMF_SUPPRESS option can have one of the values shown in the following table. 
  14922.  
  14923. PMF_SUPPRESS Options for GpiPlayMetafile 
  14924.  
  14925. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14926. ΓöéValue           ΓöéDescription                                 Γöé
  14927. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14928. ΓöéSUP_SUPPRESS    ΓöéThe operating system does not draw the      Γöé
  14929. Γöé                Γöémetafile on the device associated with the  Γöé
  14930. Γöé                Γöépresentation space. This option is useful ifΓöé
  14931. Γöé                Γöéyou need to alter the presentation space    Γöé
  14932. Γöé                Γöébefore drawing it on an output device.      Γöé
  14933. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14934. ΓöéSUP_NOSUPPRESS  ΓöéThe operating system draws the metafile on  Γöé
  14935. ΓöéSUP_DEFAULT     Γöéthe device associated with the presentation Γöé
  14936. Γöé                Γöéspace.                                      Γöé
  14937. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  14938.  
  14939. You can use the RES_RESET option to reinitialize the presentation space and 
  14940. modify certain resources or presentation space environmental attributes from 
  14941. the application before playing the remainder of the metafile by: 
  14942.  
  14943.  1. Saving the current state of the presentation space by calling GpiSavePS. 
  14944.  
  14945.     Use this function only if you wish to restore the previous state of the 
  14946.     presentation space after playing the metafile. 
  14947.  
  14948.  2. Calling GpiPlayMetaFile and specifying: 
  14949.  
  14950.    o The PMF_RESET option with the value RES_RESET 
  14951.    o The PMF_SUPPRESS option with the value SUP_SUPPRESS. 
  14952.  
  14953.     This causes GpiPlayMetaFile to set the presentation space to the 
  14954.     specifications recorded in the metafile but not to play the picture in the 
  14955.     metafile. 
  14956.  
  14957.  3. Making any required changes to the presentation space. 
  14958.  
  14959.  4. Calling GpiPlayMetaFile and specifying: 
  14960.  
  14961.    o The PMF_RESET option with the value RES_NORESET. 
  14962.    o The PMF_SUPPRESS option with the value SUP_NOSUPPRESS. 
  14963.  
  14964.     This causes the picture to play. 
  14965.  
  14966.  5. Restoring the state of the presentation space after playing the metafile by 
  14967.     calling GpiRestorePS. 
  14968.  
  14969.  
  14970. ΓòÉΓòÉΓòÉ 15.1.2.3.3. PMF_LOADTYPE Option ΓòÉΓòÉΓòÉ
  14971.  
  14972. The PMF_LOADTYPE option of GpiPlayMetaFile determines which viewing 
  14973. transformations and graphics fields affect the metafile picture. The 
  14974. PMF_LOADTYPE option can have one of the values shown in the following table. 
  14975.  
  14976. PMF_LOADTYPE Options for GpiPlayMetafile 
  14977.  
  14978. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  14979. ΓöéValue           ΓöéDescription                                 Γöé
  14980. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14981. ΓöéLT_ORIGINALVIEW ΓöéViewing transformations recorded in the     Γöé
  14982. Γöé                Γöémetafile are used in the target presentationΓöé
  14983. Γöé                Γöéspace.                                      Γöé
  14984. Γöé                Γöé                                            Γöé
  14985. Γöé                ΓöéIf changes to the graphics field are        Γöé
  14986. Γöé                Γöérecorded in the metafile, the graphics fieldΓöé
  14987. Γöé                Γöéin the target presentation space is updated,Γöé
  14988. Γöé                Γöéand the picture is clipped to that graphics Γöé
  14989. Γöé                Γöéfield.                                      Γöé
  14990. Γöé                Γöé                                            Γöé
  14991. Γöé                ΓöéChanges to the default viewing              Γöé
  14992. Γöé                Γöétransformation recorded in the metafile are Γöé
  14993. Γöé                Γöéused to update the default viewing          Γöé
  14994. Γöé                Γöétransformation in the target presentation   Γöé
  14995. Γöé                Γöéspace.                                      Γöé
  14996. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  14997. ΓöéLT_NOMODIFY     ΓöéAny viewing transformations recorded in the Γöé
  14998. ΓöéLT_DEFAULT      Γöémetafile are ignored. The metafile contents Γöé
  14999. Γöé                Γöéare drawn in accordance with the current    Γöé
  15000. Γöé                Γöéviewing transformation in the target        Γöé
  15001. Γöé                Γöépresentation space. (Note that, if you also Γöé
  15002. Γöé                Γöéspecify RES_RESET, the current viewing      Γöé
  15003. Γöé                Γöétransformation is reset to its default      Γöé
  15004. Γöé                Γöévalue.)                                     Γöé
  15005. Γöé                Γöé                                            Γöé
  15006. Γöé                ΓöéThe picture is clipped to any graphics fieldΓöé
  15007. Γöé                Γöédefined in the target presentation space,   Γöé
  15008. Γöé                Γöéand any graphics field recorded in the      Γöé
  15009. Γöé                Γöémetafile is ignored.                        Γöé
  15010. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  15011.  
  15012. The PMF_RESET option RES_RESET changes values in the target presentation space. 
  15013. Therefore, the effect of the PMF_LOADTYPE option should always be considered in 
  15014. conjunction with the PMF_RESET option. For example, if you specify both 
  15015. RES_RESET and LT_NOMODIFY, the default viewing transformation in the target 
  15016. presentation space is updated with that from the metafile, even though 
  15017. LT_NOMODIFY means that such values should be ignored. 
  15018.  
  15019.  
  15020. ΓòÉΓòÉΓòÉ 15.1.2.3.4. PMF_LCIDS Option ΓòÉΓòÉΓòÉ
  15021.  
  15022. The PMF_LCIDS option of GpiPlayMetaFile controls whether logical resources 
  15023. referenced by a local identifier (lcid) are loaded from the metafile. Logical 
  15024. resources include logical fonts and bit maps used as area-fill patterns. The 
  15025. PMF_LCIDS option can have one of the values shown in the following table. 
  15026.  
  15027. PMF_LCIDS Options for GpiPlayMetafile 
  15028.  
  15029. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  15030. ΓöéValue           ΓöéDescription                                 Γöé
  15031. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15032. ΓöéLC_LOADDISC     ΓöéLoads lcid-referenced resources from the    Γöé
  15033. Γöé                Γöémetafile.                                   Γöé
  15034. Γöé                Γöé                                            Γöé
  15035. Γöé                ΓöéIf the lcids of those resources are already Γöé
  15036. Γöé                Γöéin use in the target presentation space, theΓöé
  15037. Γöé                Γöéresources currently identified by those     Γöé
  15038. Γöé                Γöélcids are deleted and their lcids are freed Γöé
  15039. Γöé                Γöébefore the metafile contents are loaded. TheΓöé
  15040. Γöé                Γöénew fonts and bit maps replace the existing Γöé
  15041. Γöé                Γöéones in the presentation space. (If the     Γöé
  15042. Γöé                Γöéoperating system uses a local identifier    Γöé
  15043. Γöé                Γöéthat the application has already defined,   Γöé
  15044. Γöé                ΓöéGpiPlayMetaFile deletes the existing        Γöé
  15045. Γöé                Γöéidentifier before using it for the metafile Γöé
  15046. Γöé                Γöéresource.)                                  Γöé
  15047. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15048. ΓöéLC_NOLOAD       ΓöéThe operating system uses the presentation  Γöé
  15049. ΓöéLC_DEFAULTS     Γöéspace's logical font and custom fill        Γöé
  15050. Γöé                Γöépattern; it will ignore any logical font or Γöé
  15051. Γöé                Γöécustom fill pattern in the metafile.        Γöé
  15052. Γöé                Γöé                                            Γöé
  15053. Γöé                ΓöéAn application can use the GpiSavePS and    Γöé
  15054. Γöé                ΓöéGpiRestorePS functions to maintain the localΓöé
  15055. Γöé                Γöéidentifiers it has already defined.         Γöé
  15056. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  15057.  
  15058.  
  15059. ΓòÉΓòÉΓòÉ 15.1.2.3.5. PMF_COLORTABLE Option ΓòÉΓòÉΓòÉ
  15060.  
  15061. The PMF_COLORTABLES option may be used to append or replace color table entries 
  15062. in the presentation space from the metafile. The PMF_COLORTABLES option can 
  15063. have one of the values shown in the following table. 
  15064.  
  15065. PMF_COLORTABLES Options for GpiPlayMetafile 
  15066.  
  15067. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  15068. ΓöéValue               ΓöéDescription                             Γöé
  15069. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15070. ΓöéCTAB_REPLACE        ΓöéReplaces the logical color table in the Γöé
  15071. Γöé                    Γöépresentation space with the color table Γöé
  15072. Γöé                    Γöéin the metafile.                        Γöé
  15073. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15074. ΓöéCTAB_REPLACEPALETTE ΓöéReplaces the current palette, if it     Γöé
  15075. Γöé                    Γöéexists, in the presentation space with  Γöé
  15076. Γöé                    Γöéthe palette in the metafile.            Γöé
  15077. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15078. ΓöéCTAB_NOMODIFY       ΓöéMaintains the logical color table in theΓöé
  15079. ΓöéCTAB_DEFAULT        Γöépresentation space.                     Γöé
  15080. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  15081.  
  15082.  
  15083. ΓòÉΓòÉΓòÉ 15.1.2.3.6. PMF_COLORREALIZABLE Option ΓòÉΓòÉΓòÉ
  15084.  
  15085. The PMF_COLORREALIZABLE option may be used to select whether color table from 
  15086. the metafile is realized upon loading. The PMF_COLORREALIZEABLE option can have 
  15087. one of the values shown in the following table. 
  15088.  
  15089. PMF_COLORREALIZABLE Options for GpiPlayMetafile 
  15090.  
  15091. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  15092. ΓöéValue               ΓöéDescription                             Γöé
  15093. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15094. ΓöéCREA_DOREALIZE      ΓöéSets the realizable option when loading Γöé
  15095. Γöé                    Γöéthe color table.                        Γöé
  15096. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15097. ΓöéCREA_NOREALIZE      ΓöéDoes not set the realizable option when Γöé
  15098. ΓöéCREA_DEFAULT        Γöéloading the color table.                Γöé
  15099. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  15100.  
  15101.  
  15102. ΓòÉΓòÉΓòÉ 15.1.2.3.7. PMF_DEFAULTS Option ΓòÉΓòÉΓòÉ
  15103.  
  15104. The PMF_DEFAULTS option can have one of the values shown in the following 
  15105. table. 
  15106.  
  15107. PMF_DEFAULTS Options for GpiPlayMetafile 
  15108.  
  15109. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  15110. ΓöéValue               ΓöéDescription                             Γöé
  15111. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15112. ΓöéDDEF_LOADDISC       ΓöéReplaces the default attributes, defaultΓöé
  15113. Γöé                    Γöéviewing limits, and default arc         Γöé
  15114. Γöé                    Γöéparameters in the presentation space    Γöé
  15115. Γöé                    Γöéwith the values specified in the        Γöé
  15116. Γöé                    Γöémetafile.                               Γöé
  15117. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15118. ΓöéDDEF_IGNORE         ΓöéMaintains the default attributes,       Γöé
  15119. ΓöéDDEF_DEFAULTS       Γöédefault viewing limits, and default arc Γöé
  15120. Γöé                    Γöéparameters in the presentation space.   Γöé
  15121. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  15122.  
  15123.  
  15124. ΓòÉΓòÉΓòÉ 15.1.2.4. Saving a Metafile ΓòÉΓòÉΓòÉ
  15125.  
  15126. A metafile is not a permanent object and, unless it is explicitly saved, 
  15127. disappears when the application that creates it ends.  Metafiles are saved in 
  15128. disk files by calling GpiSaveMetaFile. 
  15129.  
  15130. This function accepts as input the metafile handle and the name of the disk 
  15131. file in which the metafile is to be saved.  As the disk file is created by this 
  15132. function, an error condition is raised if a file with this name already exists. 
  15133. When you call GpiSaveMetaFile, the memory version of the metafile is deleted. 
  15134. Its handle is no longer valid, until the file is reloaded from disk. 
  15135.  
  15136.  
  15137. ΓòÉΓòÉΓòÉ 15.1.2.5. Loading a Metafile ΓòÉΓòÉΓòÉ
  15138.  
  15139. A metafile saved on disk has to be reloaded before it can be used. Any 
  15140. application with access to the disk file can transfer the file from disk 
  15141. storage to application storage by calling GpiLoadMetaFile. GpiLoadMetaFile 
  15142. returns a metafile handle, which identifies the metafile after it has been 
  15143. loaded. 
  15144.  
  15145.  
  15146. ΓòÉΓòÉΓòÉ 15.1.2.6. Editing a Metafile ΓòÉΓòÉΓòÉ
  15147.  
  15148. Metafiles can be edited in a manner similar to editing graphics segments. To 
  15149. edit graphics orders in a metafile, an application transfers them into 
  15150. application storage (an array of bytes) by calling the GpiQueryMetaFileBits 
  15151. function. The number of graphics orders copied depends on the size of the array 
  15152. that the application supplies.  The application can determine the size of the 
  15153. metafile (in bytes) by calling the GpiQueryMetaFileLength function.  When the 
  15154. application has finished editing the graphics orders, it can copy them back 
  15155. into the metafile by calling the GpiSetMetaFileBits function. 
  15156.  
  15157. Edited versions of metafiles can be saved by calling GpiSaveMetaFile. The disk 
  15158. file that contains the edited version of the metafile cannot have the same name 
  15159. as the file from which the metafile was originally loaded. GpiSaveMetaFile 
  15160. raises an error condition if the disk file already exists. 
  15161.  
  15162.  
  15163. ΓòÉΓòÉΓòÉ 15.1.2.7. Copying a Metafile ΓòÉΓòÉΓòÉ
  15164.  
  15165. A copy of a memory metafile can be made by calling GpiCopyMetaFile. PM makes a 
  15166. copy of the metafile and returns a new handle to the new metafile. 
  15167.  
  15168.  
  15169. ΓòÉΓòÉΓòÉ 15.1.2.8. Deleting a Metafile ΓòÉΓòÉΓòÉ
  15170.  
  15171. A memory metafile is deleted by calling GpiDeleteMetaFile. After the operation 
  15172. is complete, the handle to the metafile no longer points to a usable object. A 
  15173. disk file containing the metafile remains untouched by this operation. A disk 
  15174. metafile is deleted by using operating system commands that delete any other 
  15175. type of file. 
  15176.  
  15177.  
  15178. ΓòÉΓòÉΓòÉ 15.1.3. Metafiles and the System Clipboard ΓòÉΓòÉΓòÉ
  15179.  
  15180. A metafile that you have created or loaded can be made available to other 
  15181. applications at the same workstation by placing the handle to the metafile in 
  15182. the system clipboard. When a resource is passed to the clipboard, it  becomes 
  15183. the property of the system, and is not deleted when the owning application 
  15184. ends. Any application that can access the clipboard can retrieve the handle to 
  15185. the metafile.  Using the handle to the metafile, the application should copy 
  15186. the metafile by calling GpiCopyMetaFile before closing the clipboard.  The 
  15187. application can then perform any metafile operation on the metafile. 
  15188.  
  15189. For more information on the system clipboard, see the Programming Guide Volume 
  15190. II. 
  15191.  
  15192.  
  15193. ΓòÉΓòÉΓòÉ 15.2. Using Metafiles ΓòÉΓòÉΓòÉ
  15194.  
  15195. Use metafile functions to: 
  15196.  
  15197. o Create a metafile 
  15198. o Draw into a metafile 
  15199. o Load a metafile to disk 
  15200. o Load a metafile from disk into an application 
  15201. o Play a metafile 
  15202. o Edit a metafile 
  15203. o Copy a metafile 
  15204. o Transfer metafile contents to application memory 
  15205. o Transfer metafile contents from application memory. 
  15206.  
  15207.  
  15208. ΓòÉΓòÉΓòÉ 15.2.1. Creating and Drawing into a Metafile ΓòÉΓòÉΓòÉ
  15209.  
  15210. To create a metafile, you must: 
  15211.  
  15212.  1. Create a metafile device context with DevOpenDC. 
  15213.  
  15214.  2. Create a presentation space with GpiCreatePS function, and associate the 
  15215.     presentation space with the metafile device context. 
  15216.  
  15217.  3. Draw into the metafile with various Gpi drawing functions. 
  15218.  
  15219.  4. Disassociate the metafile device context from the presentation space with 
  15220.     GpiAssociate. 
  15221.  
  15222.  5. Close the metafile device context with DevCloseDC. 
  15223.  
  15224. The following figure shows how to create a simple metafile that draws text 
  15225. within the borders of a three-color box. 
  15226.  
  15227. #include <os2.h>
  15228. void fncMETA01(void){
  15229.     DEVOPENSTRUC dop;
  15230.     HDC hdcMeta;
  15231.     HPS hpsMeta;
  15232.     HMF hmf;
  15233.     HAB hab;
  15234.     SIZEL sizlPage;
  15235.     POINTL ptl;
  15236.  
  15237.     dop.pszLogAddress = (PSZ) NULL;
  15238.     dop.pszDriverName = "DISPLAY";
  15239.  
  15240.     hdcMeta = DevOpenDC(hab,
  15241.         OD_METAFILE,                 /* Metafile device context             */
  15242.         "*",                         /* Ignores OS2.INI                     */
  15243.         2L,                          /* Uses first two fields               */
  15244.         (PDEVOPENDATA) &dop,         /* Device information                  */
  15245.         (HDC) NULLHANDLE);           /* Compatible device context           */
  15246.  
  15247.     hpsMeta = GpiCreatePS(hab,
  15248.         hdcMeta,                     /* Metafile device context             */
  15249.         &sizlPage,                   /* Page viewport                       */
  15250.         PU_PELS | GPIA_ASSOC);       /* Device units and associated context */
  15251.  
  15252.     /* Draw a box in a metafile. */
  15253.  
  15254.     GpiSetColor(hpsMeta, CLR_CYAN);
  15255.  
  15256.     ptl.x = 150; ptl.y = 200;
  15257.     GpiMove(hpsMeta, &ptl);
  15258.  
  15259.  
  15260.     ptl.x = 300; ptl.y = 275;
  15261.     GpiBox(hpsMeta, DRO_FILL, &ptl, 0L, 0L);
  15262.  
  15263.     GpiSetColor(hpsMeta, CLR_GREEN);
  15264.  
  15265.     ptl.x = 300; ptl.y = 200;
  15266.     GpiMove(hpsMeta, &ptl);
  15267.  
  15268.     ptl.x = 390; ptl.y = 275;
  15269.     GpiBox(hpsMeta, DRO_FILL, &ptl, 0L, 0L);
  15270.  
  15271.  
  15272.     GpiSetColor(hpsMeta, CLR_YELLOW);
  15273.  
  15274.     ptl.x = 390; ptl.y = 200;
  15275.     GpiMove(hpsMeta, &ptl);
  15276.  
  15277.     ptl.x = 530; ptl.y = 275;
  15278.     GpiBox(hpsMeta, DRO_FILL, &ptl, 0L, 0L);
  15279.  
  15280.     ptl.x = 175; ptl.y = 230;
  15281.     GpiMove(hpsMeta, &ptl);
  15282.  
  15283.  
  15284.     GpiSetColor(hpsMeta, CLR_PINK);
  15285.  
  15286.     GpiCharString(hpsMeta, 41,
  15287.         "METAFILE COPY METAFILE COPY METAFILE COPY");
  15288.  
  15289.     GpiAssociate(hpsMeta, (HDC) NULLHANDLE);
  15290.     hmf = DevCloseDC(hdcMeta);
  15291. } /* fncMETA01 */
  15292.  
  15293. Creating a Metafile 
  15294.  
  15295.  
  15296. ΓòÉΓòÉΓòÉ 15.2.2. Drawing into a Metafile in Retain Mode ΓòÉΓòÉΓòÉ
  15297.  
  15298. To draw into a metafile, set the drawing mode to the appropriate value for your 
  15299. application and then perform the drawing operations. The following figure shows 
  15300. an example of how to copy the contents of a segment into a metafile. 
  15301.  
  15302. #define INCL_GPIMETAFILES
  15303. #define INCL_GPICONTROL
  15304. #include <os2.h>
  15305. void fncMETA02(void){
  15306.     HDC hdcMeta, hdc;
  15307.     POINTL ptl;
  15308.     HMF hmf;
  15309.     LONG alOpt[10];
  15310.     HPS hps;
  15311.  
  15312.     /*
  15313.      * Open a segment, assign it an identifier of 10,
  15314.      * and draw some text into it.
  15315.      */
  15316.  
  15317.     GpiSetDrawingMode(hps, DM_RETAIN);
  15318.     GpiOpenSegment(hps, 10L);
  15319.     ptl.x = 175; ptl.y = 230;
  15320.     GpiMove(hps, &ptl);
  15321.     GpiSetColor(hps, CLR_PINK);
  15322.     GpiCharString(hps, 41,
  15323.         "METAFILE COPY METAFILE COPY METAFILE COPY");
  15324.     GpiCloseSegment(hps);
  15325.  
  15326.     GpiAssociate(hps, NULLHANDLE);   /* Disassociates PS and screen DC */
  15327.     GpiAssociate(hps, hdcMeta);      /* Associates PS and meta DC      */
  15328.     GpiDrawSegment(hps, 10L);        /* Draws segment into metafile    */
  15329.     GpiAssociate(hps, NULLHANDLE);   /* Disassociates PS and meta DC   */
  15330.     hmf = DevCloseDC(hdcMeta);       /* Closes metafile                */
  15331.  
  15332.     GpiAssociate(hps, hdc);          /* Associates PS and screen DC    */
  15333.     GpiSetDrawingMode(hps, DM_DRAW); /* Sets drawing mode to DM_DRAW   */
  15334.  
  15335.     /*
  15336.      * Load the array of options for GpiPlayMetaFile
  15337.      * with default values.
  15338.      */
  15339.  
  15340.     alOpt[PMF_SEGBASE]  = 0;                   /* Reserved                */
  15341.     alOpt[PMF_LOADTYPE] = LT_DEFAULT;          /* Default transformations */
  15342.     alOpt[PMF_RESOLVE]  = 0;                   /* Reserved                */
  15343.     alOpt[PMF_LCIDS]    = LC_DEFAULT;          /* Uses default lcids      */
  15344.     alOpt[PMF_RESET]    = RES_DEFAULT;         /* Uses default            */
  15345.     alOpt[PMF_SUPPRESS] = SUP_DEFAULT;         /* Uses default            */
  15346.     alOpt[PMF_COLORTABLES] = CTAB_DEFAULT;     /* Uses default            */
  15347.     alOpt[PMF_COLORREALIZABLE] = CREA_DEFAULT; /* Uses default            */
  15348.  
  15349.     GpiPlayMetaFile(hps,                  /* Plays metafile onto screen   */
  15350.         hmf, 8L, alOpt, (PLONG) NULL, 0L, (PSZ) NULL);
  15351. } /* fncMETA02 */
  15352.  
  15353.  
  15354. Copying a Graphic Segment to a Metafile 
  15355.  
  15356. If you want to create a simple drawing in a metafile for repeated display, you 
  15357. can set the drawing mode to DM_DRAW and draw directly into the metafile. The 
  15358. code in the first code fragment shows an example of how to do this. You can 
  15359. store named segments in the metafile that you are recording in DM_DRAW mode by 
  15360. bracketing your output primitive functions between GpiOpenSegment and 
  15361. GpiCloseSegment. 
  15362.  
  15363.  
  15364. ΓòÉΓòÉΓòÉ 15.2.3. Copying a Metafile to Disk ΓòÉΓòÉΓòÉ
  15365.  
  15366. You can copy a metafile to disk using GpiSaveMetaFile function, and you can 
  15367. load the file back into your application using GpiLoadMetaFile function. The 
  15368. following figure shows an example of how to copy a metafile to a file named 
  15369. META.MET, then load the same file back into the application and play it. 
  15370.  
  15371. #define INCL_GPIMETAFILES
  15372. #include <os2.h>
  15373. void fncMETA03(void){
  15374.     HMF hmf;
  15375.     HAB hab;
  15376.     HPS hps;
  15377.     LONG alOpt[10];
  15378.  
  15379.     GpiSaveMetaFile(hmf, "meta.met");           /* Saves metafile on disk  */
  15380.  
  15381.     hmf = GpiLoadMetaFile(hab, "meta.met");     /* Loads metafile          */
  15382.  
  15383.     alOpt[PMF_SEGBASE]  = 0;                    /* Reserved                */
  15384.     alOpt[PMF_LOADTYPE] = LT_DEFAULT;           /* Default transformations */
  15385.     alOpt[PMF_RESOLVE]  = 0;                    /* Reserved                */
  15386.     alOpt[PMF_LCIDS]    = LC_DEFAULT;           /* Uses default lcids      */
  15387.     alOpt[PMF_RESET]    = RES_DEFAULT;          /* Uses default            */
  15388.     alOpt[PMF_SUPPRESS] = SUP_DEFAULT;          /* Uses default            */
  15389.     alOpt[PMF_COLORTABLES]     = CTAB_DEFAULT;  /* Uses default            */
  15390.     alOpt[PMF_COLORREALIZABLE] = CREA_DEFAULT;  /* Uses default            */
  15391.  
  15392.     GpiPlayMetaFile(hps, hmf, 8, alOpt, (PLONG) NULL, 0L, (PSZ) NULL);
  15393. } /* fncMETA03 */
  15394.  
  15395.  
  15396. Copying a Metafile to Disk 
  15397.  
  15398.  
  15399. ΓòÉΓòÉΓòÉ 15.2.4. Playing a Metafile ΓòÉΓòÉΓòÉ
  15400.  
  15401. The following figure shows an example of how to play the metafile using the 
  15402. font, color table, and fill-pattern descriptions in your application's 
  15403. presentation space. 
  15404.  
  15405. #define INCL_GPIMETAFILES
  15406. #include <os2.h>
  15407. void fncMETA04(void){
  15408.     HPS hps;
  15409.     HMF hmf;
  15410.     LONG alOpt[10];
  15411.  
  15412.     alOpt[PMF_SEGBASE]  = 0;               /* Reserved                        */
  15413.     alOpt[PMF_LOADTYPE] = LT_DEFAULT;      /* Viewing transformation in PS    */
  15414.     alOpt[PMF_RESOLVE]  = RS_DEFAULT;      /* Reserved                        */
  15415.     alOpt[PMF_LCIDS]    = LC_DEFAULT;      /* Font and fill pattern in PS     */
  15416.     alOpt[PMF_RESET]    = RES_DEFAULT;     /* Page units and dimensions in PS */
  15417.     alOpt[PMF_SUPPRESS] = SUP_DEFAULT;     /* Draws metafile into PS          */
  15418.     alOpt[PMF_COLORTABLES]     = CTAB_DEFAULT;    /* Color table in PS        */
  15419.     alOpt[PMF_COLORREALIZABLE] = CREA_DEFAULT;    /* Sets realizable option   */
  15420.  
  15421.     GpiPlayMetaFile(hps, hmf, 8, alOpt, (PLONG) NULL, 0L, (PSZ) NULL);
  15422. } /* fncMETA04 */
  15423.  
  15424.  
  15425. Playing a Metafile 
  15426.  
  15427. The following figure shows an example of how to play a metafile using the font, 
  15428. color table, and fill-pattern descriptions in the metafile. 
  15429.  
  15430. #define INCL_GPIMETAFILES
  15431. #include <os2.h>
  15432. void fncMETA05(void){
  15433.     HPS hps;
  15434.     HMF hmf;
  15435.     LONG alOpt[10];
  15436.  
  15437.     alOpt[PMF_SEGBASE]  = 0;             /* Reserved                          */
  15438.     alOpt[PMF_LOADTYPE] = LT_DEFAULT;    /* Viewing transformation in PS      */
  15439.     alOpt[PMF_RESOLVE]  = RS_DEFAULT;    /* Reserved                          */
  15440.     alOpt[PMF_LCIDS]    = LC_LOADDISC;   /* Font and fill pattern in metafile */
  15441.     alOpt[PMF_RESET]    = RES_DEFAULT;   /* Page units and dimensions in PS   */
  15442.     alOpt[PMF_SUPPRESS] = SUP_DEFAULT;   /* Draws metafile into PS            */
  15443.     alOpt[PMF_COLORTABLES]     = CTAB_REPLACE;    /* Color table in metafile  */
  15444.     alOpt[PMF_COLORREALIZABLE] = CREA_DEFAULT;    /* Sets realizable option   */
  15445.  
  15446.     GpiPlayMetaFile(hps, hmf, 8, alOpt, (PLONG) NULL, 0L, (PSZ) NULL);
  15447. } /* fncMETA05 */
  15448.  
  15449.  
  15450. Playing a Metafile Using Font, Color, and Fill-Pattern Descriptions 
  15451.  
  15452. The following figure shows an example of how to play a metafile using the 
  15453. viewing transformation, page units, and presentation-page dimensions specified 
  15454. in the metafile. 
  15455.  
  15456. #define INCL_GPIMETAFILES
  15457. #include <os2.h>
  15458. void fncMETA06(void){
  15459.     HPS hps;
  15460.     HMF hmf;
  15461.     LONG alOpt[10];
  15462.  
  15463.     alOpt[PMF_SEGBASE]  = 0;                    /* Reserved                    */
  15464.     alOpt[PMF_LOADTYPE] = LT_ORIGINALVIEW;      /* Viewing transformation      */
  15465.     alOpt[PMF_RESOLVE]  = RS_DEFAULT;           /* Reserved                    */
  15466.     alOpt[PMF_LCIDS]    = LC_DEFAULT;           /* Font and fill pattern in PS */
  15467.     alOpt[PMF_RESET]    = RES_RESET;            /* Page units/dimensions       */
  15468.     alOpt[PMF_SUPPRESS] = SUP_DEFAULT;          /* Draws metafile into PS      */
  15469.     alOpt[PMF_COLORTABLES]     = CTAB_DEFAULT;  /* Uses color table in PS      */
  15470.     alOpt[PMF_COLORREALIZABLE] = CREA_DEFAULT;  /* Sets realizable option      */
  15471.  
  15472.     GpiPlayMetaFile(hps, hmf, 8, alOpt, (PLONG) NULL, 0L, (PSZ) NULL);
  15473. } /* fncMETA06 */
  15474.  
  15475. Playing a Metafile Using Transformation and Page Units 
  15476.  
  15477.  
  15478. ΓòÉΓòÉΓòÉ 15.3. Summary ΓòÉΓòÉΓòÉ
  15479.  
  15480. The following table summarizes the metafile object functions. 
  15481.  
  15482. Metafile Functions 
  15483.  
  15484. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  15485. ΓöéFunction Name           ΓöéDescription                         Γöé
  15486. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15487. ΓöéDevCloseDC              ΓöéCloses a metafile device context andΓöé
  15488. Γöé                        Γöéreturns a handle that identifies a  Γöé
  15489. Γöé                        Γöémetafile.                           Γöé
  15490. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15491. ΓöéDevOpenDC               ΓöéCreates a metafile device context   Γöé
  15492. Γöé                        Γöéwhen you pass it the OD_METAFILE    Γöé
  15493. Γöé                        Γöéconstant as the second argument.    Γöé
  15494. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15495. ΓöéGpiCopyMetaFile         ΓöéCreates a copy of a metafile.       Γöé
  15496. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15497. ΓöéGpiDeleteMetaFile       ΓöéDeletes a metafile.                 Γöé
  15498. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15499. ΓöéGpiLoadMetaFile         ΓöéLoads data from disk storage into a Γöé
  15500. Γöé                        Γöémetafile and returns a handle that  Γöé
  15501. Γöé                        Γöéidentifies the metafile.            Γöé
  15502. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15503. ΓöéGpiPlayMetaFile         ΓöéPlays the contents of a metafile    Γöé
  15504. Γöé                        Γöéinto a presentation space.          Γöé
  15505. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15506. ΓöéGpiQueryMetaFileBits    ΓöéCopies the contents of a metafile   Γöé
  15507. Γöé                        Γöé(such as drawing orders, color-tableΓöé
  15508. Γöé                        Γöédescription, and page units) into anΓöé
  15509. Γöé                        Γöéarray of bytes. The number of bytes Γöé
  15510. Γöé                        Γöécopied depends on the size of the   Γöé
  15511. Γöé                        Γöéarray.                              Γöé
  15512. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15513. ΓöéGpiQueryMetaFileLength  ΓöéRetrieves the size of a metafile in Γöé
  15514. Γöé                        Γöébytes. You use this function to     Γöé
  15515. Γöé                        Γöédetermine the size of the array you Γöé
  15516. Γöé                        Γöéwill need when you issue the        Γöé
  15517. Γöé                        ΓöéGpiQueryMetaFileBits function.      Γöé
  15518. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15519. ΓöéGpiSaveMetaFile         ΓöéCopies a metafile to a disk and thenΓöé
  15520. Γöé                        Γöéremoves it from your application's  Γöé
  15521. Γöé                        Γöémemory.                             Γöé
  15522. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15523. ΓöéGpiSetMetaFileBits      ΓöéCopies drawing orders from an array Γöé
  15524. Γöé                        Γöéof bytes to a metafile. You use thisΓöé
  15525. Γöé                        Γöéfunction to copy drawing orders backΓöé
  15526. Γöé                        Γöéinto a metafile from application    Γöé
  15527. Γöé                        Γöémemory.                             Γöé
  15528. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  15529.  
  15530.  
  15531. ΓòÉΓòÉΓòÉ 16. Clipping and Boundary Determination ΓòÉΓòÉΓòÉ
  15532.  
  15533. Both Clipping and boundary determination are graphics operations concerned with 
  15534. limiting the amount of graphics information passed between different coordinate 
  15535. spaces. The following topics are related to the information in this chapter: 
  15536.  
  15537. o Presentation spaces 
  15538. o Device contexts 
  15539. o Coordinate spaces 
  15540. o Transformations 
  15541. o Regions 
  15542. o Paths. 
  15543.  
  15544.  
  15545. ΓòÉΓòÉΓòÉ 16.1. About Clipping ΓòÉΓòÉΓòÉ
  15546.  
  15547. Clipping enables the PM programming interface to discard parts of a picture 
  15548. that lie outside a specified clipping boundary.  The parts of the picture 
  15549. enclosed by the boundary are said to be inside the clipping area.  A clipping 
  15550. area might be a single rectangle or a complex shape, depending on the method 
  15551. used to define it. 
  15552.  
  15553. Note:  In this chapter, the word area does not refer to an area primitive; it 
  15554.        describes the shape or shapes used for clipping graphics output. 
  15555.  
  15556. If an application attempts to draw outside of a clipping area, the operating 
  15557. system ensures that the output does not appear on the drawing surface of the 
  15558. output device. For example, if an application defined a triangular clipping 
  15559. area before drawing text output, all text outside of the triangle would be 
  15560. discarded, even though an entire page of text was defined. The following figure 
  15561. illustrates the result. 
  15562.  
  15563. Triangular Clip Path 
  15564.  
  15565. Clipping boundaries are defined by the application. The PM programming 
  15566. interface performs some clipping automatically when, for example, your 
  15567. application's graphic output is clipped to fit a client window area or the 
  15568. device's output area for a hardcopy device. 
  15569.  
  15570.  
  15571. ΓòÉΓòÉΓòÉ 16.1.1. Types of Clipping Areas ΓòÉΓòÉΓòÉ
  15572.  
  15573. Clipping can occur at each stage in the viewing pipeline. The viewing pipeline 
  15574. is described and illustrated in Coordinate Spaces and Transformations. Objects 
  15575. in world coordinate, model, page, or device space can be clipped. When an 
  15576. application defines clipping areas in several coordinate spaces, the final 
  15577. result is similar to combining all the areas into a single clipping area. This 
  15578. single area is defined by the intersection of the areas in each coordinate 
  15579. space. 
  15580.  
  15581. Clipping in different coordinate spaces, however, is a means of conceptualizing 
  15582. the process to aid in its understanding. Clipping, like transformations, 
  15583. actually happens in one operation, with all the different types of clipping 
  15584. being performed on all primitives in the device space at once. 
  15585.  
  15586. The following table describes the different types of clipping areas associated 
  15587. with the different coordinate spaces. 
  15588.  
  15589. Clipping Areas and Coordinate Space Summary 
  15590.  
  15591. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  15592. ΓöéClipping Area   ΓöéCoordinate SpaceΓöéDescription                 Γöé
  15593. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15594. ΓöéClip path       ΓöéWorld space     ΓöéAlways inclusive/inclusive  Γöé
  15595. Γöé                Γöé                Γöé                            Γöé
  15596. Γöé                Γöé                ΓöéClipping area can have      Γöé
  15597. Γöé                Γöé                Γöécurved edges                Γöé
  15598. Γöé                Γöé                Γöé                            Γöé
  15599. Γöé                Γöé                ΓöéClipping area can be        Γöé
  15600. Γöé                Γöé                Γöérotated.                    Γöé
  15601. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15602. ΓöéViewing limit   ΓöéModel space     ΓöéAlways a rectangular        Γöé
  15603. Γöé                Γöé                Γöéclipping boundary           Γöé
  15604. Γöé                Γöé                Γöé                            Γöé
  15605. Γöé                Γöé                ΓöéAlways inclusive/inclusive  Γöé
  15606. Γöé                Γöé                Γöé                            Γöé
  15607. Γöé                Γöé                ΓöéRotating clipping area      Γöé
  15608. Γöé                Γöé                Γöéresults in larger rectangle.Γöé
  15609. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15610. ΓöéGraphics field  ΓöéPage space      ΓöéAlways a rectangular        Γöé
  15611. Γöé                Γöé                Γöéclipping boundary           Γöé
  15612. Γöé                Γöé                Γöé                            Γöé
  15613. Γöé                Γöé                ΓöéAlways inclusive/inclusive  Γöé
  15614. Γöé                Γöé                Γöé                            Γöé
  15615. Γöé                Γöé                ΓöéRotating clipping area      Γöé
  15616. Γöé                Γöé                Γöéimpossible. Cannot specify aΓöé
  15617. Γöé                Γöé                Γöédevice transform with       Γöé
  15618. Γöé                Γöé                Γöérotation.                   Γöé
  15619. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  15620. ΓöéClip region     ΓöéDevice space    ΓöéCan be a single rectangle orΓöé
  15621. Γöé                Γöé                Γöémultiple rectangles that    Γöé
  15622. Γöé                Γöé                Γöéoverlap or remain separate  Γöé
  15623. Γöé                Γöé                Γöé                            Γöé
  15624. Γöé                Γöé                ΓöéAlways inclusive/exclusive  Γöé
  15625. Γöé                Γöé                Γöé                            Γöé
  15626. Γöé                Γöé                ΓöéRotating the clipping area  Γöé
  15627. Γöé                Γöé                Γöéis impossible.              Γöé
  15628. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  15629.  
  15630. Note:  Inclusive/inclusive means that the operating system includes the bottom 
  15631. and leftmost edges of the rectangle in the clipping area as well as the top and 
  15632. rightmost edges. Inclusive/exclusive means that the operating system includes 
  15633. the bottom and leftmost edges but excludes the top and rightmost edges. This 
  15634. concept is illustrated in the following figure. 
  15635.  
  15636. The followingfigure illustrates the differences between inclusive-inclusive and 
  15637. inclusive-exclusive clipping. dup. 
  15638.  
  15639. Inclusive/Inclusive and Inclusive/Exclusive Clipping 
  15640.  
  15641.  
  15642. ΓòÉΓòÉΓòÉ 16.1.1.1. The Clip Path ΓòÉΓòÉΓòÉ
  15643.  
  15644. The clip path defines the clipping boundary in world coordinate space. Paths 
  15645. are graphic objects that serve many purposes, only one of which is to be used 
  15646. as a clipping mechanism. Paths are described in Paths. The recommended 
  15647. functional sequence for creating a clip path is as follows: 
  15648.  
  15649. Function                 Effect 
  15650.  
  15651. GpiBeginPath             Begins the path definition. 
  15652.  
  15653. Line and arc GPIs        Gives the path shape. 
  15654.  
  15655. GpiEndPath               Ends the path definition. 
  15656.  
  15657. GpiModifyPath            An optional step explained below. 
  15658.  
  15659. GpiSetClipPath           Converts the path to a clip path. 
  15660.  
  15661. Before converting to a clip path, the path can be modified using GpiModifyPath. 
  15662. If modified, the path is converted to a geometric (wide) line using the current 
  15663. geometric width, line join, and line end attributes. The shape defined by the 
  15664. geometric line then is used for the clip path. The clip path can be a simple 
  15665. unmodified path. 
  15666.  
  15667. GpiSetClipPath accepts two different path identifiers as input: 
  15668.  
  15669. o 1 
  15670. o 0 (default). 
  15671.  
  15672. The default path identifier of 0, called SCP_RESET, resets the clip path to 
  15673. infinity, which displays the picture without clipping. If this value is 
  15674. selected, the current clip path definition is discarded instead of stored. 
  15675.  
  15676. A path identifier of 1 is called SCP_AND and specifies that the clip path be 
  15677. redefined as the mathematical intersection of the stored clip path and the 
  15678. current path definition. The only method of specifying the clip path to the 
  15679. current path, after GpiSetClipPath has been issued, is to issue GpiSetClipPath 
  15680. twice:  the first issuance with a path identifier of 0; the second, a path 
  15681. identifier of 1. 
  15682.  
  15683. The following figure shows a triangle shape that has been defined within a path 
  15684. bracket and selected as the current clip path. The filled box shape is drawn 
  15685. subsequently, and, therefore, is clipped to the triangle. 
  15686.  
  15687. The Clipping Path 
  15688.  
  15689. The broken lines show the area of the box that has been clipped. 
  15690.  
  15691. Clip paths are most useful when you want to use an irregular clipping boundary, 
  15692. or when the clipping boundary itself is an integral part of the picture. Both 
  15693. are true of the clip path in the previous figure. 
  15694.  
  15695. GpiSetClipPath also accepts 1 of 2 construction options as input: 
  15696.  
  15697. o SCP_ALTERNATE (default) 
  15698. o SCP_WINDING (must be selected if path has been modified). 
  15699.  
  15700. Any drawing that is clipped to the current clip path must follow the alternate 
  15701. or the winding rules as to whether that portion of a picture is included in the 
  15702. clip area. The alternate and winding modes are described for paths in Paths in 
  15703. Alternate Mode and Paths in Winding Mode. Any point on the boundary of the path 
  15704. is considered within the path and is not clipped. 
  15705.  
  15706. To end clipping to the current clip path, issue GpiSetClipPath with an 
  15707. identifier of 0. This function deselects the current clip path by setting it to 
  15708. infinity. In some circumstances, the current clip path is deselected 
  15709. automatically. 
  15710.  
  15711. A path definition can be stored in a graphics segment; and, if that segment is 
  15712. retained, the path can be re-created as required when the segment is redrawn. 
  15713. Clip path definitions can be stored in a retained segment also and redrawn when 
  15714. required. In draw-and-retain mode, the initial path or clip path is created as 
  15715. the segment is constructed. If the current drawing mode is retain, however, the 
  15716. path or clip path is not created until the first time the segment is drawn. 
  15717.  
  15718.  
  15719. ΓòÉΓòÉΓòÉ 16.1.1.2. The Viewing Window ΓòÉΓòÉΓòÉ
  15720.  
  15721. The viewing window defines a rectangular clipping boundary in model space.  It 
  15722. is defined with GpiSetViewingLimits. As input to this function, you supply the 
  15723. model coordinates of the lower-left and upper-right corners of the viewing 
  15724. window. 
  15725.  
  15726. When a drawing primitive, such as a line, intersects a viewing window, any part 
  15727. of that line outside of the viewing window is clipped. Any point on the 
  15728. boundary of the viewing window is considered within the window, and is not 
  15729. clipped. By default, the viewing window performs no clipping. In this case, all 
  15730. graphics output in the model space is transformed. The following figure shows 
  15731. how the viewing window outlines a part of model space. 
  15732.  
  15733. The Viewing Window 
  15734.  
  15735. This example shows how a presentation page is constructed. The viewing window 
  15736. outlines the tail of the aircraft, which is scaled and translated when drawn in 
  15737. presentation-page space.  The rest of the aircraft is clipped away during the 
  15738. drawing process. 
  15739.  
  15740.  
  15741. ΓòÉΓòÉΓòÉ 16.1.1.3. The Graphics Field ΓòÉΓòÉΓòÉ
  15742.  
  15743. The graphics field defines a rectangular clipping area in the presentation 
  15744. page.  It is defined in GpiSetGraphicsField. 
  15745.  
  15746. Note:  If this clipping area is to be used, it must be defined before any 
  15747.        drawing begins. 
  15748.  
  15749. Specify the size of the graphics field in presentation page coordinates as 
  15750. input to GpiSetGraphicsField. 
  15751.  
  15752. Only the graphic output contained in this clipping boundary is visible when the 
  15753. presentation page is transformed to device space. By default, the graphics 
  15754. field is infinitely large and, therefore, performs no clipping. If you do 
  15755. specify a graphics field, however, any point on its boundary is considered 
  15756. within the graphics field and is not clipped. When a drawing primitive, such as 
  15757. a line, intersects a graphic field, any part of the line outside the graphics 
  15758. field is clipped. The following figure shows how a graphics field could be 
  15759. defined for a presentation page. 
  15760.  
  15761. The Graphics Field 
  15762.  
  15763. The broken line shows an arbitrary graphics field that is smaller than the 
  15764. presentation page. The aircraft tail, a separate object in the presentation 
  15765. page, is outside the graphics field and is clipped away as it is drawn. 
  15766.  
  15767. The picture assembled in the graphics field is the picture that is displayed or 
  15768. printed. If you do not define a graphics field, the picture assembled in the 
  15769. presentation page is the picture that is displayed or printed. The presentation 
  15770. page is not a clipping boundary, and graphics in page coordinate space that are 
  15771. outside the presentation page boundary, therefore, might be visible. 
  15772.  
  15773.  
  15774. ΓòÉΓòÉΓòÉ 16.1.1.4. The Current Clipping Region ΓòÉΓòÉΓòÉ
  15775.  
  15776. Clipping regions are clipping areas defined (as regions) by one or more 
  15777. rectangles in device coordinates. Because they are defined in device 
  15778. coordinates, clipping regions do not suffer from the rounding errors associated 
  15779. with other types of clipping. Therefore, they are ideally suited to redraw part 
  15780. of the picture without boundary discontinuities, for example, after a BitBlt 
  15781. operation has been used to scroll a picture in a window. 
  15782.  
  15783. Regions are not available automatically for clipping. To select an existing 
  15784. region as the current clipping region, use GpiSetClipRegion. By default, the 
  15785. clipping region is the same size as the drawing surface. Only one clipping 
  15786. region can exist in the presentation space at one time.  To end clipping to the 
  15787. current clipping region, deselect it by issuing GpiSetClipRegion with a NULL 
  15788. region handle. A deselected clipping region retains the effects of any changes 
  15789. made to it while it was a clipping region and can be reselected. 
  15790.  
  15791. You do not have to deselect the current clipping region before selecting 
  15792. another.  Each selected clipping region automatically replaces the one before 
  15793. it. If a clipping region exists when you issue GpiSetClipRegion, the existing 
  15794. clipping region reverts to being a normal region, and its handle is returned. 
  15795.  
  15796. Clip paths and clip regions share a common implementation, but clip regions are 
  15797. faster to create than clip paths. This might be a performance factor when 
  15798. designing your application for repairing the screen, or redrawing the picture 
  15799. in a client window after the display has changed. The following figure 
  15800. illustrates this use of regions. 
  15801.  
  15802. Screen Repairing 
  15803.  
  15804. Note:  GpiSetClipRegion does not cause graphics orders to be added to the 
  15805.        current segment. Therefore, variations in the clip region must not be 
  15806.        used to construct the picture. The clip region is intended to define a 
  15807.        fixed clipping area for the entire picture. 
  15808.  
  15809. When you select the current clipping region, none of the region-related GPI 
  15810. functions can be used for that region. The PM programming interface provides a 
  15811. series of functions that mirror the region-related functions.  However, all of 
  15812. these functions work in world coordinates rather than device coordinates, and, 
  15813. therefore, are subject to current transformations. 
  15814.  
  15815. Any of the following functions can be used to get information about or to 
  15816. redefine the current clipping region. 
  15817.  
  15818. o GpiQueryClipBox 
  15819.  
  15820.   You can request the dimensions of the smallest rectangle that encloses all 
  15821.   current clipping boundaries by issuing GpiQueryClipBox. The following 
  15822.   boundaries are included in this calculation: 
  15823.  
  15824.    - Current clip path 
  15825.    - Current viewing window 
  15826.    - Current graphics field 
  15827.    - Current clipping region 
  15828.    - Visible region of the window. 
  15829.  
  15830. o GpiIntersectClipRectangle 
  15831.  
  15832.   GpiIntersectClipRectangle redefines the current clipping region to the 
  15833.   intersection of the existing clipping region with the rectangle whose 
  15834.   dimensions you supply in this function. This has the same effect as CRGN_AND 
  15835.   in GpiCombineRegion. 
  15836.  
  15837. o GpiExcludeClipRectangle 
  15838.  
  15839.   You also can redefine the current clipping region using 
  15840.   GpiExcludeClipRectangle.  This function excludes a specified rectangle from 
  15841.   the current region, and has the same effect as CRGN_DIFF on GpiCombineRegion. 
  15842.  
  15843. o GpiOffsetClipRegion 
  15844.  
  15845.   The current clipping region can be moved from its current position using 
  15846.   GpiOffsetClipRegion. 
  15847.  
  15848. o GpiPtVisible 
  15849.  
  15850.   GpiPtVisible tells you whether a point, expressed in world coordinates, is 
  15851.   visible on the screen. A point is visible if it is within all current 
  15852.   clipping boundaries and is in the visible region of the window. 
  15853.  
  15854. o GpiRectVisible 
  15855.  
  15856.   GpiRectVisible tells you whether any part or the whole of a rectangle, whose 
  15857.   dimensions you supply in world coordinates, is visible on the screen. The 
  15858.   rectangle is visible if it intersects both the visible region of the window 
  15859.   and all current clipping boundaries. 
  15860.  
  15861.  
  15862. ΓòÉΓòÉΓòÉ 16.1.2. How Clipping Is Implemented ΓòÉΓòÉΓòÉ
  15863.  
  15864. The rules by which the PM programming interface implements clipping are as 
  15865. follows: 
  15866.  
  15867. o Any primitive completely outside the clipping boundary is discarded. 
  15868.  
  15869.   When a primitive crosses a clipping boundary, any part outside the boundary 
  15870.   is discarded. 
  15871.  
  15872. o Any primitive completely within the clipping boundary is retained. 
  15873.  
  15874.   When a primitive crosses a clipping boundary, any part within the boundary is 
  15875.   retained. 
  15876.  
  15877. o When the clipping boundary is a clip path, viewing window, or graphics field, 
  15878.   any point that falls on the boundary is considered within the clipping 
  15879.   boundary. 
  15880.  
  15881.   When the clipping boundary is a clipping region, any point on the top or 
  15882.   right boundaries of a rectangle is discarded; and any point on the bottom or 
  15883.   left boundaries of a rectangle, that is not on the right or top boundaries 
  15884.   also, is included in the region. 
  15885.  
  15886.  
  15887. ΓòÉΓòÉΓòÉ 16.1.3. Redrawing Nondynamic Graphics ΓòÉΓòÉΓòÉ
  15888.  
  15889. An interactive graphics application usually permits changes to the displayed 
  15890. picture, for example, an object can be moved or sized; and you can plan for 
  15891. this by defining particular segments as dynamic.  Dynamic segments are 
  15892. described in Editing Retained Graphics and Graphics Segments. 
  15893.  
  15894. If dynamic segments are inappropriate (when you are using nonretained graphics, 
  15895. for example), you can repair the picture using a clipping region, for example, 
  15896. a picture of a hexagon and a circle as shown in the following figure. 
  15897.  
  15898. A Hexagon and Circle 
  15899.  
  15900. If the circle is moved to another screen position by the use of an input 
  15901. device, you must repair its original location, and redraw it in its new 
  15902. location. The following figure shows this sequence of events. Following are the 
  15903. steps required to do this: 
  15904.  
  15905.  1. Determine the size of the smallest rectangle that contains the circle in 
  15906.     its current position using a process called boundary determination. 
  15907.  
  15908.  2. Switch off the DCTL_DISPLAY flag of GpiSetDrawControl, apply a translation 
  15909.     transformation to the circle, and redraw it in its new position. 
  15910.  
  15911.  3. Determine the size of the smallest rectangle that contains the circle in 
  15912.     its new position using boundary determination. 
  15913.  
  15914.  4. Use GpiConvert to convert the model-space coordinates provided by the 
  15915.     boundary-determination process to device-space coordinates. 
  15916.  
  15917.  5. Use the device-space coordinates of the two rectangles to create a region, 
  15918.     and select it as the current clipping region. 
  15919.  
  15920.  6. Switch on the DCTL_DISPLAY flag of GpiSetDrawControl. 
  15921.  
  15922.  7. Issue GpiErase (or set the erase-before-draw control) to erase the current 
  15923.     contents of the clipping region. 
  15924.  
  15925.  8. Redraw the picture with the circle in its new position. Any part of the 
  15926.     picture within the clipping region is redrawn. That part of the hexagon 
  15927.     that is outside the clipping region is unaffected by the change and does 
  15928.     not have to be redrawn. 
  15929.  
  15930. Defining a Clipping Region 
  15931.  
  15932. The broken circle shows the position to which the circle is to be moved.  The 
  15933. two bounding rectangles overlap, and produce a complex region.  If the circle 
  15934. were to be moved much farther away from its start position, the region would 
  15935. comprise two disjoint rectangles. 
  15936.  
  15937.  
  15938. ΓòÉΓòÉΓòÉ 16.2. About Boundary Determination ΓòÉΓòÉΓòÉ
  15939.  
  15940. Boundary determination is an operation to compute the size of the smallest 
  15941. rectangle that encloses a graphics output in model space.  One use of boundary 
  15942. determination is to enable you to repair only the affected parts of the screen, 
  15943. when a graphics object is moved, for example, or when a graphics object is 
  15944. changed some other way. Dynamic segments are not included in 
  15945. boundary-determination operations. 
  15946.  
  15947. Boundary determination can be performed on both retained and nonretained 
  15948. graphics.  In both instances, you request boundary data to be calculated by 
  15949. setting the boundary data flag (DCTL_BOUNDARY) in GpiSetDrawControl. If you do 
  15950. not set this flag (for example, if you do not want to collect boundary data 
  15951. unnecessarily) and later find that you need boundary data for a particular 
  15952. object, you can do the following: 
  15953.  
  15954.  1. Switch on the boundary-data flag, and switch off the display flag, using 
  15955.     GpiSetDrawControl. 
  15956.  
  15957.  2. Redraw the object in its current location. Boundary data is collected, but 
  15958.     the object is unaltered. 
  15959.  
  15960. If you are drawing retained graphics, each drawing request (GpiDrawSegment, 
  15961. GpiDrawFrom, and GpiDrawChain) causes the boundary data resulting from the 
  15962. drawing to be made available. The application must request this data explicitly 
  15963. by issuing GpiQueryBoundaryData after each drawing request for which it wants 
  15964. to examine boundary data. Boundary data is returned to the application in model 
  15965. space coordinates. The boundary data is reset before each retained drawing 
  15966. operation, so there is no risk of accumulating data from separate operations. 
  15967.  
  15968. If you are drawing nonretained graphics, boundary data is accumulated for each 
  15969. GpiPutData and for each individual primitive-drawing function. The application 
  15970. can request the accumulated boundary data at any time by issuing 
  15971. GpiQueryBoundaryData. Data continues to accumulate unless you issue the 
  15972. GpiResetBoundaryData; it is not reset automatically. 
  15973.  
  15974. The boundary data returned to you is in the form of 4 model-space coordinates, 
  15975. which are the lowest (x,y) positions and the highest (x,y) positions of the 
  15976. bounding rectangle in model space, as illustrated in the following figure. 
  15977.  
  15978. The Bounding Rectangle 
  15979.  
  15980.  
  15981. ΓòÉΓòÉΓòÉ 16.3. Using Clipping and Boundary Determination ΓòÉΓòÉΓòÉ
  15982.  
  15983. This section explains how to use clipping functions to: 
  15984.  
  15985. o Create a clip path or clip region 
  15986. o Exclude a rectangular area from a clip region 
  15987. o Add a rectangular area to a clip region 
  15988. o Set the clip region to the intersection of the current clip region and a 
  15989.   specified rectangle 
  15990. o Determine the size of the smallest rectangle that will surround the 
  15991.   intersection of the current clipping areas completely. 
  15992.  
  15993.  
  15994. ΓòÉΓòÉΓòÉ 16.3.1. Creating a Clip Path ΓòÉΓòÉΓòÉ
  15995.  
  15996. A drawing and computer-aided-design (CAD) application may require the ability 
  15997. to clip to curved edges.  If so, it must use a clip path to define a curved 
  15998. clipping area in world coordinates.  Because clip paths (especially ones that 
  15999. clip to curved edges) require considerable memory and processing time, use them 
  16000. only when necessary; whenever possible, your application must use a clip 
  16001. region, graphics field, or viewing limit. 
  16002.  
  16003. To create a clip path, do the following: 
  16004.  
  16005.  1. Determine the clip path's shape and size (in world coordinates). 
  16006.  
  16007.  2. Issue GpiBeginPath to begin defining the path. 
  16008.  
  16009.  3. Create the path. 
  16010.  
  16011.  4. Close the path definition with GpiEndPath. 
  16012.  
  16013.  5. Create a clip path from the path definition with GpiSetClipPath. 
  16014.  
  16015. The following figure uses this procedure to create an elliptical clip path. 
  16016.  
  16017. #define INCL_GPIPATHS
  16018. #include <os2.h>
  16019. void fncCLIP01(void){
  16020.     HPS    hps;                      /* Presentation-space handle */
  16021.     POINTL ptl1;                     /* Point structure           */
  16022.     FIXED  fxArc;                    /* Multiplier for arc        */
  16023.     LONG idPath;                     /* Path identifier           */
  16024.         .
  16025.         .           /* Load ptl1 with coordinates of clip path.   */
  16026.         .
  16027.     idPath = 1;
  16028.     GpiBeginPath(hps, idPath);       /* Begins path               */
  16029.     GpiMove(hps, &ptl1);             /* Sets current position     */
  16030.     fxArc  = MAKEFIXED(50, 0);       /* Sets arc multiplier       */
  16031.     GpiFullArc(hps, DRO_OUTLINE, fxArc);  /* Defines ellipse      */
  16032.     GpiEndPath(hps);                 /* Ends path                 */
  16033.     GpiSetClipPath(hps, idPath, SCP_ALTERNATE | SCP_AND);
  16034. } /* fncCLIP01 */
  16035.  
  16036.  
  16037. Creating a Clip Path 
  16038.  
  16039.  
  16040. ΓòÉΓòÉΓòÉ 16.3.2. Creating a Clip Region ΓòÉΓòÉΓòÉ
  16041.  
  16042. To create a clip region, first determine its size and shape (in device 
  16043. coordinates).  Load the coordinates for the rectangles that define the clip 
  16044. region into an array of RECTL structures. Then create the region and set it to 
  16045. a clip region with GpiCreateRegion and GpiSetClipRegion respectively. 
  16046.  
  16047. The following figure shows how to create a clip region. 
  16048.  
  16049. #include <os2.h>
  16050. void fncCLIP02(void){
  16051.     HPS  hps;
  16052.     HRGN hrgn;
  16053.     RECTL arcl[3];
  16054.         .
  16055.         .  /* Load array of RECTL structures with coordinates.       */
  16056.         .
  16057.     hrgn = GpiCreateRegion(hps, sizeof(arcl) / sizeof(RECTL), arcl);
  16058.     GpiSetClipRegion(hps, hrgn, NULL);
  16059. } /* fncCLIP02 */
  16060.  
  16061.  
  16062. Creating a Clip Region 
  16063.  
  16064.  
  16065. ΓòÉΓòÉΓòÉ 16.3.3. Excluding a Rectangular Area from a Clip Region ΓòÉΓòÉΓòÉ
  16066.  
  16067. Some applications let you prepare output in multiple stages. For example, a 
  16068. word-processing application might permit you to prepare your text first and 
  16069. then add bit maps that enhance and support the text. These applications can use 
  16070. GpiExcludeClipRectangle to exclude an area from a clip region, preventing the 
  16071. user from deleting output that already exists. 
  16072.  
  16073. To exclude an area from a clip region, first determine the dimensions (in 
  16074. device coordinates) of the smallest rectangle that completely surrounds the 
  16075. area to exclude from the clip region. Then, issue GpiExcludeClipRectangle, 
  16076. including, as input, the dimensions of the area to exclude. The following 
  16077. figure illustrates these steps. 
  16078.  
  16079. #include <os2.h>
  16080. void fncCLIP03(void){
  16081.     HPS   hps;
  16082.     RECTL rcl;
  16083.         .
  16084.         .  /* Set rectangle coordinates here. */
  16085.         .
  16086.     GpiExcludeClipRectangle(hps, &rcl);
  16087. } /* fncCLIP03 */
  16088.  
  16089.  
  16090. Excluding a Rectangular Area from a Clip Region 
  16091.  
  16092.  
  16093. ΓòÉΓòÉΓòÉ 16.3.4. Adding a Rectangular Area to a Clip Region ΓòÉΓòÉΓòÉ
  16094.  
  16095. Some applications might need to increase the size of a clip region. For 
  16096. example, a user might request that a desktop-publishing application extend a 
  16097. column of text on a page. 
  16098.  
  16099. To add a rectangular area to a clip region, follow these steps: 
  16100.  
  16101.  1. Determine the dimensions (in device coordinates) of the rectangular area to 
  16102.     add to the current clip region. 
  16103.  
  16104.  2. Release the current clip region using GpiSetClipRegion. GpiCombineRegion 
  16105.     cannot combine regions if either of the regions is a clip region. 
  16106.  
  16107.  3. Issue GpiCreateRegion and pass it the dimensions of the rectangle that you 
  16108.     defined in Step 1. This creates a second region that you can combine with 
  16109.     the first. 
  16110.  
  16111.  4. Reissue GpiCreateRegion and create a third region that will be the final 
  16112.     destination region. 
  16113.  
  16114.  5. Issue GpiCombineRegion to create a region that combines the original region 
  16115.     and the region you created in Step 2. It is not essential to create a third 
  16116.     region because GpiCombineRegion can use one of the 2 source regions being 
  16117.     combined for a target region. 
  16118.  
  16119.  6. Issue GpiSetClipRegion and pass it the handle returned by GpiCombineRegion. 
  16120.  
  16121. The following figure illustrates these steps. 
  16122.  
  16123. #define INCL_GPIREGIONS
  16124. #include <os2.h>
  16125. void fncCLIP04(void){
  16126.     HPS   hps;
  16127.     RECTL rcl1, rcl2, rcl3;
  16128.     HRGN  hrgn1, hrgn2, hrgn3;
  16129.  
  16130.     hrgn1 = GpiCreateRegion(hps, sizeof(rcl1) / sizeof(RECTL), &rcl1);
  16131.     GpiSetClipRegion(hps, hrgn1, NULL);       /* Creates first clipping region */
  16132.         .
  16133.         .  /* Compute coordinates of second region here.                       */
  16134.         .
  16135.     GpiSetClipRegion(hps, NULLHANDLE, NULL);  /* Releases first clipping region*/
  16136.     hrgn2 = GpiCreateRegion(hps, sizeof(rcl2) / Sizeof(RECTL), &rcl2);
  16137.     hrgn3 = GpiCreateRegion(hps, sizeof(rcl3) / Sizeof(RECTL), &rcl3);
  16138.     GpiCombineRegion(hps, hrgn3, hrgn1, hrgn2, CRGN_OR);
  16139.     GpiSetClipRegion(hps, hrgn3, NULL);       /* Creates second clipping region*/
  16140. } /* fncCLIP04 */
  16141.  
  16142.  
  16143. Adding a Rectangular Area to a Clip Region 
  16144.  
  16145. This operation also could be performed with GpiIntersectClipRectangle. 
  16146.  
  16147.  
  16148. ΓòÉΓòÉΓòÉ 16.3.5. Setting the Clip Region to a Region Intersection ΓòÉΓòÉΓòÉ
  16149.  
  16150. Your application might require the ability to set the clip region to the 
  16151. intersection of the current clip region and another region.  Do this with 
  16152. GpiIntersectClipRectangle, as shown in the following figure. 
  16153.  
  16154. #include <os2.h>
  16155. void fncCLIP05(void){
  16156.     RECTL rcl;
  16157.     HPS hps;
  16158.         .
  16159.         . /* Load rcl with coordinates of rectangle to intersect. */
  16160.         .
  16161.     GpiIntersectClipRectangle(hps, &rcl);
  16162. } /* fncCLIP05 */
  16163.  
  16164.  
  16165. Setting the Clip Region to a Region Intersection 
  16166.  
  16167.  
  16168. ΓòÉΓòÉΓòÉ 16.3.6. Determining the Size of a Clipping Area ΓòÉΓòÉΓòÉ
  16169.  
  16170. If an application is able to specify a clip path in world space, a viewing 
  16171. limit in model space, a graphics field in page space, and a clip region in 
  16172. device space, it might be necessary for your application to determine the size 
  16173. of the clipping area formed by the intersection of the four. GpiQueryClipBox 
  16174. returns the dimensions (in world coordinates) of the smallest rectangle that 
  16175. completely surrounds the intersection of all the defined clipping areas, 
  16176. including the visible region. 
  16177.  
  16178. The following figure shows how to use GpiQueryClipBox to fill a RECTL structure 
  16179. with the desired coordinates. 
  16180.  
  16181. #include <os2.h>
  16182. void fncCLIP06(void){
  16183.     HPS   hps;
  16184.     RECTL rclClip;
  16185.     GpiQueryClipBox(hps, &rclClip);
  16186. } /* fncCLIP06 */
  16187.  
  16188.  
  16189. Determining the Size of a Clipping Area 
  16190.  
  16191.  
  16192. ΓòÉΓòÉΓòÉ 16.4. Summary ΓòÉΓòÉΓòÉ
  16193.  
  16194. The following table summarizes the functions used to perform clipping. 
  16195.  
  16196. Clipping Functions 
  16197.  
  16198. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  16199. ΓöéFunction Name             ΓöéDescription                       Γöé
  16200. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16201. ΓöéGpiExcludeClipRectangle   ΓöéExcludes a specified rectangle    Γöé
  16202. Γöé                          Γöéfrom the current clipping region. Γöé
  16203. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16204. ΓöéGpiIntersectClipRectangle ΓöéCombines a rectangle with the     Γöé
  16205. Γöé                          Γöécurrent clipping region to form a Γöé
  16206. Γöé                          Γöénew clipping region.              Γöé
  16207. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16208. ΓöéGpiOffsetClipRegion       ΓöéMoves the clipping region by a    Γöé
  16209. Γöé                          Γöéspecified amount.                 Γöé
  16210. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16211. ΓöéGpiPtVisible              ΓöéDetermines whether a point, given Γöé
  16212. Γöé                          Γöéin world coordinates, is within   Γöé
  16213. Γöé                          Γöéall current clipping boundaries.  Γöé
  16214. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16215. ΓöéGpiQueryClipBox           ΓöéDetermines the smallest rectangle Γöé
  16216. Γöé                          Γöéthat encloses all current clippingΓöé
  16217. Γöé                          Γöéboundaries.                       Γöé
  16218. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16219. ΓöéGpiQueryClipRegion        ΓöéDetermines the handle of the      Γöé
  16220. Γöé                          Γöécurrently selected clip region.   Γöé
  16221. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16222. ΓöéGpiQueryGraphicsField     ΓöéDetermines the location, in page  Γöé
  16223. Γöé                          Γöécoordinates, of the lower-left andΓöé
  16224. Γöé                          Γöéupper-right corners of the currentΓöé
  16225. Γöé                          Γöégraphics field rectangle.         Γöé
  16226. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16227. ΓöéGpiQueryViewingLimits     ΓöéDetermines the location, in model Γöé
  16228. Γöé                          Γöécoordinates, of the lower-left andΓöé
  16229. Γöé                          Γöéupper-right corners of the currentΓöé
  16230. Γöé                          Γöéviewing limits rectangle.         Γöé
  16231. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16232. ΓöéGpiRectVisible            ΓöéDetermines whether any part or theΓöé
  16233. Γöé                          Γöéwhole of a rectangle, given in    Γöé
  16234. Γöé                          Γöéworld coordinates, is within all  Γöé
  16235. Γöé                          Γöécurrent clipping boundaries.      Γöé
  16236. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16237. ΓöéGpiSetClipPath            ΓöéDefines the current path as a clipΓöé
  16238. Γöé                          Γöépath.                             Γöé
  16239. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16240. ΓöéGpiSetClipRegion          ΓöéDefines the current region as a   Γöé
  16241. Γöé                          Γöéclip region.                      Γöé
  16242. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16243. ΓöéGpiSetGraphicsField       ΓöéDefines the rectangle in          Γöé
  16244. Γöé                          Γöépresentation-page space as the    Γöé
  16245. Γöé                          Γöégraphics field clipping boundary. Γöé
  16246. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16247. ΓöéGpiSetViewingLimits       ΓöéDefines the rectangle in model    Γöé
  16248. Γöé                          Γöéspace as the viewing limits       Γöé
  16249. Γöé                          Γöéclipping boundary.                Γöé
  16250. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  16251.  
  16252. The following table summarizes the data structure used by the functions that 
  16253. perform clipping. 
  16254.  
  16255. Clipping Structure 
  16256.  
  16257. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  16258. ΓöéStructure Name          ΓöéDescription                         Γöé
  16259. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16260. ΓöéRECTL                   ΓöéA structure specifying the values ofΓöé
  16261. Γöé                        Γöétwo (x,y) coordinate pairs, definingΓöé
  16262. Γöé                        Γöéthe bottom-left and top-right       Γöé
  16263. Γöé                        Γöécoordinates of a rectangle.         Γöé
  16264. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  16265.  
  16266.  
  16267. ΓòÉΓòÉΓòÉ 17. Coordinate Spaces and Transformations ΓòÉΓòÉΓòÉ
  16268.  
  16269. A transformation is an operation performed on a graphic object that changes the 
  16270. object in one of four ways:  translation, rotation, scaling and shearing. 
  16271. Transformations enable an application to control the location, orientation, 
  16272. size, and shape of graphics output on any output device. 
  16273.  
  16274. The transformation of graphic output can be conceptually divided into a series 
  16275. of distinct transformations applied from 1 logical stopping point to another. 
  16276. Coordinate spaces are used as a method of conceptualizing these logical 
  16277. stopping points. The coordinate spaces are concepts used to explain and 
  16278. manipulate the transformation process. 
  16279.  
  16280. A graphic primitive in an intermediate coordinate space cannot be displayed on 
  16281. an output device and a transformation cannot be interrupted at one of the 
  16282. distinct stages. The entire series of transformation steps, is applied all at 
  16283. once. 
  16284.  
  16285. This chapter describes the transformation design process. The following topics 
  16286. are related to the information in this chapter: 
  16287.  
  16288. o Presentation spaces 
  16289. o Device contexts 
  16290. o Segments and retained graphics 
  16291. o Clipping. 
  16292.  
  16293.  
  16294. ΓòÉΓòÉΓòÉ 17.1. About Coordinate Spaces ΓòÉΓòÉΓòÉ
  16295.  
  16296. Most of the GPI functions draw their output in a conceptual area called the 
  16297. world coordinate space. If you picture the presentation space as a blank canvas 
  16298. on which to draw, the world coordinate space is a Cartesian grid that provides 
  16299. a reference of scale for what is being drawn. 
  16300.  
  16301. The components of a picture defined in a world coordinate space are often 
  16302. defined to a scale convenient only to that component. Applications also can 
  16303. define each component, or subpicture, starting at the origin (0,0). This 
  16304. enables applications to define the scale of a subpicture and the location of 
  16305. the subpicture separately. The ability to define all subpictures at the origin 
  16306. means there is not always 1-to-1 correspondence between a presentation space 
  16307. and a world coordinate space. Frequently a separate world coordinate space 
  16308. exists for every subpicture. 
  16309.  
  16310. After subpictures are defined in the world coordinate space, they undergo a 
  16311. process called transformation then appear on an output device. If an 
  16312. application has not specifically applied a transformation to its subpictures, 
  16313. by default the PM programming interface applies the identity transformation, 
  16314. which, in effect, makes no changes to the subpicture. 
  16315.  
  16316. All graphics systems, not just the PM programming interface, use at least 1 
  16317. coordinate space to generate output. The simplest graphics systems use a single 
  16318. coordinate space, whose points are the pels on the display. These are sometimes 
  16319. called single-space systems. 
  16320.  
  16321. The PM programming interface creates multiple coordinate spaces and uses 
  16322. transformations to move subpictures between the coordinate spaces. The PM 
  16323. programming interface assembles the application's graphic output in a process 
  16324. that can use up to 5 coordinate spaces, known collectively as the viewing 
  16325. pipeline. The PM programming interface coordinate spaces are: 
  16326.  
  16327. o World Coordinate Space 
  16328. o Model Space 
  16329. o Page Space 
  16330. o Device Space 
  16331. o Media Space. 
  16332. For those who are more familiar with a graphics system that uses a 
  16333. single-coordinate space, the following table lists the differences to expect 
  16334. when using PM's multi-coordinate space. 
  16335.  
  16336. Single-Coordinate vs. Multi-Coordinate Space Systems 
  16337.  
  16338. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  16339. ΓöéSingle-Coordinate Space       ΓöéPM Multi-Coordinate System    Γöé
  16340. ΓöéSystems                       Γöé                              Γöé
  16341. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16342. ΓöéDistances and locations       ΓöéSeven units of measurement,   Γöé
  16343. Γöéspecified in pels.            Γöéincluding pels, are available.Γöé
  16344. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16345. ΓöéBecause the shape, or aspect  ΓöéThe output is device          Γöé
  16346. Γöératio, and size of pels can   Γöéindependent.                  Γöé
  16347. Γöévary on different devices, theΓöé                              Γöé
  16348. Γöégraphic primitives on 1 deviceΓöé                              Γöé
  16349. Γöémight look different on       Γöé                              Γöé
  16350. Γöéanother.                      Γöé                              Γöé
  16351. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16352. ΓöéCoordinates entered must      ΓöéCoordinates are made device   Γöé
  16353. Γöéalready be device coordinates.Γöécompatible through the PM     Γöé
  16354. Γöé                              Γöéprogramming interface.        Γöé
  16355. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  16356.  
  16357. Additionally, a single-space system requires that applications keep track of: 
  16358.  
  16359. o The scaling between the subpictures. Often this is accomplished by forcing 
  16360.   the definition of objects to the scale of the picture, instead of to the 
  16361.   scale of the subpicture. 
  16362.  
  16363. o The scaling between the creation space and output space. Often this is 
  16364.   accomplished by forcing the definition of objects to the scale of the paper 
  16365.   or window, instead of to the scale of the subpicture. 
  16366.  
  16367. o All aspects of other transformations. 
  16368.  
  16369.  
  16370. ΓòÉΓòÉΓòÉ 17.1.1. World Coordinate Space ΓòÉΓòÉΓòÉ
  16371.  
  16372. The world coordinate space is where most drawing coordinates are specified. 
  16373. Each primitive in a world coordinate space is defined using the coordinate 
  16374. positions in the primitive's definition. For example, if an application draws a 
  16375. line from (8,4) to (20,75), the coordinate values (8,4) and (20,75) are world 
  16376. coordinates. 
  16377.  
  16378. The world coordinate space is specified when the presentation space is created 
  16379. with GpiCreatePS. The PS_FORMAT option supports 2 sizes of world coordinate 
  16380. spaces:  short and long. If the size is short (GPIF_SHORT), the world 
  16381. coordinate space is a rectangular Cartesian space with maximum coordinates of 
  16382. (32767, 32767) and minimum coordinates of (-32768, -32768). If the world 
  16383. coordinate space is short, it is the application's responsibility to ensure 
  16384. that the coordinates defining the subpicture fall within this range. 
  16385.  
  16386. The second size, long (GPIF_LONG), is the default for the world coordinate 
  16387. space. Most GPI functions that direct their output to the world coordinate 
  16388. space, for example GpiLine, accept 32-bit integers as parameters. A 32-bit 
  16389. integer is equivalent to a rectangular Cartesian space with maximum coordinates 
  16390. of (134217727, 134217727) and minimum coordinates of (-134217728, -134217728). 
  16391.  
  16392. World coordinates do not have to be within the range of the presentation page. 
  16393. A graphic image that requires a high degree of detail and precision might use 
  16394. most or all of the available coordinate range. A transformation is used to 
  16395. scale the graphic image down to an appropriate size. The actual presentation 
  16396. page size is unimportant in most cases. It is used with the page viewport to 
  16397. redefine the device transform if GpiSetPageViewport is called. 
  16398.  
  16399. An application can use a clip path clipping area to define the part of the 
  16400. world space to place in the next coordinate space (the model space). A clip 
  16401. path is the only clipping region that can be nonrectangular. Its edges can 
  16402. include arcs, curves, and straight lines. The coordinates that define the 
  16403. dimensions and shape of a clip path are always world coordinates. (Clipping is 
  16404. further described in Clipping and Boundary Determination.) 
  16405.  
  16406. In a world-coordinate space, there can be several graphic primitives. If, 
  16407. however, an application uses the DM_RETAIN drawing mode to store output in 
  16408. graphic segments, the operating system assigns a new world space to each 
  16409. segment. There is also a world space for the drawings outside of segments. 
  16410.  
  16411.  
  16412. ΓòÉΓòÉΓòÉ 17.1.2. Model Space ΓòÉΓòÉΓòÉ
  16413.  
  16414. Model space is the conceptual area where the separate components of a picture, 
  16415. defined in world space, are brought together. To assemble one or more 
  16416. primitives from world spaces to model space the application specifies the 
  16417. transformations to occur, then the PM programming interface applies them to 
  16418. each of the components. Model transformations convert world coordinates to 
  16419. model-space coordinates. For example, an octagon and the word STOP, defined 
  16420. individually in separate world-coordinate spaces, can be assembled into a stop 
  16421. sign in model space. 
  16422.  
  16423. Graphics applications can have more than one model space. If there is more than 
  16424. one model space, the picture components are assembled in page space. If an 
  16425. application has each model space in a different segment, the model transforms 
  16426. are reset for each segment. 
  16427.  
  16428. An application can use a viewing limit clipping area to define the part of a 
  16429. model space to place in the next coordinate space (the page space). A viewing 
  16430. limit is always rectangular, and the coordinates that define its location and 
  16431. dimensions are always model coordinates. 
  16432.  
  16433.  
  16434. ΓòÉΓòÉΓòÉ 17.1.3. Page Space ΓòÉΓòÉΓòÉ
  16435.  
  16436. The page space is where a complete picture is assembled for viewing on a 
  16437. display screen, or for printing or plotting on a piece of paper. Page 
  16438. coordinate units can be increments of an inch, a meter, pels, or some arbitrary 
  16439. value. An application uses GpiCreatePS to specify the units used for page 
  16440. coordinates. 
  16441.  
  16442. If the application uses retained-drawing mode, the picture in page space 
  16443. contains parts of models (or pictures) from each of the model spaces that have 
  16444. not been clipped. The picture also contains any additional unclipped 
  16445. graphics-primitive output that the application generated in nonretained-drawing 
  16446. mode. If the application uses nonretained-drawing mode, the picture in page 
  16447. space contains all the graphics-primitive output that has not been clipped. 
  16448.  
  16449. In the page space, an application can use a rectangular clipping area called a 
  16450. graphics field to define the part of the page space to place in the next 
  16451. coordinate space (the device space). The coordinates that define the location 
  16452. and dimensions of the graphics field are always page coordinates. 
  16453.  
  16454. The page space contains the presentation page whose size and units are defined 
  16455. when creating the presentation space with GpiCreatePS. The presentation page is 
  16456. a rectangle in page space. 
  16457.  
  16458.  
  16459. ΓòÉΓòÉΓòÉ 17.1.4. Device Space ΓòÉΓòÉΓòÉ
  16460.  
  16461. The device space is the coordinate space in which a picture is drawn before it 
  16462. appears in a display screen window or on the printer or plotter. 
  16463.  
  16464. Device space is defined in device-specific units. Depending on the page unit 
  16465. used, device-coordinate units can be pels, increments of an inch, increments of 
  16466. a meter, or arbitrary. For example, if the page unit is pels, the 
  16467. device-coordinate unit is pels; if the page units are arbitrary, the 
  16468. device-coordinate units are arbitrary. 
  16469.  
  16470.  
  16471. ΓòÉΓòÉΓòÉ 17.1.5. Media Space ΓòÉΓòÉΓòÉ
  16472.  
  16473. The media space is used only with windows. When an application draws a 
  16474. primitive at a specified location in a window, it is not actually drawing in 
  16475. the device space, as the device is the entire terminal screen. 
  16476.  
  16477. Drawing in a window involves a shifting transformation which moves a drawing 
  16478. from the given (unitless) position, to position in the specified window. 
  16479.  
  16480.  
  16481. ΓòÉΓòÉΓòÉ 17.2. About Transformations ΓòÉΓòÉΓòÉ
  16482.  
  16483. The coordinate spaces are connected by different transformation functions. In 
  16484. reality, the input coordinates of the world coordinate space are transformed 
  16485. directly into device coordinates in a single operation. The intermediate 
  16486. coordinate spaces exist only to provide a useful model to assist in the 
  16487. understanding of how to define the different transformation matrixes. 
  16488.  
  16489. Transformation of graphic primitives occur when a transformation matrix is 
  16490. applied to those primitives. The individual transformations introduced here, do 
  16491. not actually transform the primitives, but rather define portions of the 
  16492. transformation matrix. After all portions of the matrix are identified, the 
  16493. actual operation is performed in a single step. 
  16494.  
  16495. The transformation functions manipulate graphics primitives as they move from 
  16496. one coordinate space to the next. Transformation functions usually begin with 
  16497. the letters Gpi. Most of the function names have a transformation type that 
  16498. identifies the entities on which it operates. For example, a model 
  16499. transformation is the transformation type that transforms graphics primitives 
  16500. between a world coordinate space and a model space. There is a 1-to-1 
  16501. correspondence between these transformation types and the actual functions. The 
  16502. transformation matrix data structure is called MATRIXLF. 
  16503.  
  16504. The following figure lists the sequence of coordinate spaces and the 
  16505. transformation types between the coordinate spaces. Internally, all 
  16506. transformations are combined, and the resulting values are held in the same 
  16507. format as the individual components. By default, there is no viewing window and 
  16508. no graphics field. The application can use the default page viewport. Clipping 
  16509. regions for each coordinate space are also shown. 
  16510.  
  16511. Viewing Pipeline 
  16512.  
  16513.  
  16514. ΓòÉΓòÉΓòÉ 17.2.1. Identity Transformation ΓòÉΓòÉΓòÉ
  16515.  
  16516. The identity transformation is the default transformation between all 
  16517. coordinate spaces. The identity transformation, makes no change to the original 
  16518. coordinates of an object. This transformation is also referred to as the unity 
  16519. transformation, because of the mathematical matrix used to make this 
  16520. transformation. 
  16521.  
  16522. The identity matrix looks like this: 
  16523.  
  16524.  
  16525.      Γöî         ΓöÉ
  16526.      Γöé 1  0  0 Γöé
  16527.      Γöé 0  1  0 Γöé
  16528.      Γöé 0  0  1 Γöé
  16529.      Γöö         Γöÿ
  16530.  
  16531. (Transformations are accomplished with matrix multiplication; and 1, not 0, is 
  16532. the multiplication identity.) 
  16533.  
  16534. If a transformation is not explicitly specified, the identity transformation is 
  16535. used to create that portion of the transformation matrix. Most transformations 
  16536. applied to a primitive can be in addition to, or instead of, the current 
  16537. transformation. 
  16538.  
  16539.  
  16540. ΓòÉΓòÉΓòÉ 17.2.2. Moving through Coordinate Spaces Using the Identity Transformation ΓòÉΓòÉΓòÉ
  16541.  
  16542. The effects of transformation can be minimized by defaulting to the identity 
  16543. transformation. This means that no deliberate action is requested by the 
  16544. application. 
  16545.  
  16546. Graphic primitives are drawn in their own coordinate scale in world coordinate 
  16547. space. The primitives are then combined in model space. Neither the world 
  16548. coordinate space or the model space have "real world" units associated with 
  16549. them. This means that if an application draws a line on the x-axis from -300000 
  16550. to +300000, the line exists as a line 600000 Cartesian units long in both world 
  16551. coordinate and model space. 
  16552.  
  16553. Page space is the first of the coordinate spaces to be associated with units 
  16554. such as millimeters or inches. These units are set with the GpiCreatePS option 
  16555. PS_UNITS. If the application specifies the option PS_UNITS with the value 
  16556. PU_ARBITRARY, the page space remains unitless; units are applied when the 
  16557. output is drawn in device space. 
  16558.  
  16559. As an example, assume that the units PU_LOMETRIC, (0.1 mm) have been chosen. 
  16560. Again, assuming the identity transformation between model and page space, the 
  16561. primitive appears in the page space as a line that extends 
  16562.  
  16563. 300000 * 0.1mm to the right of the origin
  16564. 300000 * 0.1mm to the left of the origin
  16565.  
  16566. A presentation page, a rectangle in page space, has its size defined when a 
  16567. presentation space is created with GpiCreatePS. The presentation page format is 
  16568. defined with the GpiCreatePS option, PS_FORMAT. The three choices for that 
  16569. option are: 
  16570.  
  16571. o GPIF_DEFAULT-32-bit integers or 2GB 
  16572. o GPIF_LONG-32-bit integers 
  16573. o GPIF_SHORT-16-bit integers or 32KB. 
  16574.  
  16575. PS_FORMAT effects the number of units permitted along the coordinate axes of 
  16576. the presentation page. If the choice was GPIF_LONG or GPIF_DEFAULT, and, for 
  16577. example, PS_UNITS remains PU_LOMETRIC, the presentation page axes could range 
  16578. from 0 to 134217727 0.1mm. If the choice was GPIF_SHORT, the coordinate axes 
  16579. could range only from 0 to 32767 0.1mm. These limits are the maximum number of 
  16580. units, presentation pages are usually much smaller. 
  16581.  
  16582. The presentation page does not effect the primitive in presentation space, it 
  16583. determines what parts of the primitive are visible. With no transformation to 
  16584. scale down the primitive from the model to the page space, the presentation 
  16585. page acts like a sheet of cardboard with a rectangular hole. Only the part of 
  16586. the page space behind the "hole" is visible in page space. The view of 
  16587. everything else is blocked by the "cardboard." Only what is visible in the page 
  16588. space is drawn to the next coordinate space. 
  16589.  
  16590. Continuing with the example of the 600000 units line above, if GPIF_LONG (or 
  16591. GPIF_DEFAULT) is selected, the 600000 unit line could easily be viewed in the 
  16592. presentation page. If GPIF_SHORT is selected, the maximum presentation page 
  16593. size is 65534 * 0.1 mm units long. In the case, much of the 600000 unit line 
  16594. would not be drawn into the next coordinate space. 
  16595.  
  16596. The device space is not affected by the PS_FORMAT option. Whether GPIF_LONG, or 
  16597. GPIF_SHORT, the device space is a rectangle with maximum coordinates of (32767, 
  16598. 32767) and minimum coordinates of (-32768, -32768). Note that not all of this 
  16599. rectangle is visible, since real devices aren't that big. The device space 
  16600. relates to the physical device. 
  16601.  
  16602. The transformation between the page and device space is handled automatically 
  16603. by the PM programming interface. The presentation page is mapped into a 
  16604. rectangle in the device space called the page viewport. This transformation is 
  16605. based on the parameters and options of the GpiCreatePS function. 
  16606.  
  16607. Confusion can arise because the effects of the presentation page and the page 
  16608. viewport appear to be a clipping of the primitives in page and device space. 
  16609. While the action taken is identical, the term clipping is reserved for the 
  16610. activity deliberately designated by the application with clipping functions. 
  16611.  
  16612.  
  16613. ΓòÉΓòÉΓòÉ 17.2.3. Applying Transformations Other Than the Identity Transformation ΓòÉΓòÉΓòÉ
  16614.  
  16615. To better understand the workings of transformations other than the identity 
  16616. transformation, an example of the picture assembly process is illustrated in 
  16617. the following figure, and a detailed explanation follows. 
  16618.  
  16619. Picture Assembly Process 
  16620.  
  16621. In the world space of the following figure four segments are drawn, each 
  16622. containing a different subpicture. The units of the subpictures can be 
  16623. different (for example, the building might be measured in feet, while the 
  16624. window might be measured in inches), because each subpicture is converted to 
  16625. the scale of the completed picture when it is transformed into the completed 
  16626. picture. All of the subpictures in the previous figure are defined at "real 
  16627. world" scales in their own (Cartesian) world coordinate space. 
  16628.  
  16629. The difference between applying and not applying transformations can be seen in 
  16630. the model space in the previous figure. Without transformations, the 
  16631. subpictures would be drawn at exactly the coordinates given in the world space 
  16632. and thus all four subpictures would overlap. With transformations, the 
  16633. subpictures can be scaled and translated to the scale of the final picture. The 
  16634. window subpicture, Segment id=200 has been scaled, rotated, and translated. 
  16635.  
  16636. The model space contains the model of what the application is trying to draw. 
  16637. There can be more than one model space for very complex drawings, but this is 
  16638. not a recommended style of programming. 
  16639.  
  16640. The building also resides in the page space, and is prepared in the device 
  16641. space for printing on an 8 and a half by 11 sheet of paper. This is shown in 
  16642. the following figure. Most often the page space to device space transformation 
  16643. (the device transformation) is the identity transformation. 
  16644.  
  16645. Different Spaces 
  16646.  
  16647. The transformation process in the previous figure is acting on segments. To 
  16648. draw the composite picture in model space, create a segment chain that plays 
  16649. all 4 segments associated with the building. The purpose of the world to model 
  16650. space transformation is to transform the graphic segments into a composite 
  16651. picture. 
  16652.  
  16653. Having built the composite picture, the next step is to map the composite into 
  16654. the page space. Usually, the model-to-page space transformation is the identity 
  16655. transformation. The different coordinate spaces are shown in the previous 
  16656. figure. 
  16657.  
  16658. The user might want an exploded diagram as well as the composite picture. This 
  16659. is illustrated in the following figure. To create the exploded diagram, the 
  16660. application must draw the segment chain again, with a slight translation down, 
  16661. and scaled up (enlarged) with a very large scaling factor. 
  16662.  
  16663. Again, while it is possible to create several complex images in different model 
  16664. spaces that must be assembled in the page space, the most frequent use of the 
  16665. page space is to prepare a view of the model-from-model space with the first 
  16666. application of "real world" units such as inches or millimeters. As shown in 
  16667. the previous figures, both world and model space share unitless Cartesian 
  16668. coordinates. 
  16669.  
  16670. The usual purpose of the page space is to show multiple views of the image 
  16671. residing in the model space, as shown in the following figure. 
  16672.  
  16673. Different Spaces with an Exploded View 
  16674.  
  16675. The enlarged image on the right side of the page space is drawn after the image 
  16676. on the left. It therefore has a higher priority, and therefore would be drawn 
  16677. on top of the left side image. To obtain a multi-viewed page space image, the 
  16678. application defines a clipping region, and applies this region to the second 
  16679. (enlarged image) playback of the segment chain. The clipping region permits the 
  16680. enlarged image to appear only on the right side of the page space. 
  16681.  
  16682. The same building also resides in this model space; but, it resides in the page 
  16683. space, along with an exploded view of the uppermost right side window. The view 
  16684. is enlarged to such a magnitude that the details of the window are once again 
  16685. evident. If the images in world coordinate space are not able to be drawn in 
  16686. the amount of detail now supported by the PM programming interface, then 
  16687. drawing details, such as an exploded view, would reveal the barrenness of the 
  16688. image. 
  16689.  
  16690. Subpictures can be drawn in world coordinate space without being drawn inside a 
  16691. graphics segment. 
  16692.  
  16693.  
  16694. ΓòÉΓòÉΓòÉ 17.2.4. Combining Transformations Between a Coordinate Space Pair ΓòÉΓòÉΓòÉ
  16695.  
  16696. There are more than one transformation between the world coordinate and model 
  16697. spaces, and between the model and page spaces. Depending on the desired output, 
  16698. the transformations can be combined in different ways. 
  16699.  
  16700. Between the world coordinate and model space, there are five ways of combining 
  16701. the three transformations. 
  16702.  
  16703. World Coordinate to Model Space Transformation Combinations 
  16704.  
  16705. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  16706. ΓöéTransformation Function       ΓöéEffect          ΓöéTransformationΓöé
  16707. Γöé                              Γöé                ΓöéType Sequence Γöé
  16708. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16709. ΓöéGpiCallSegMatrix              ΓöéADD             ΓöéM   I   S     Γöé
  16710. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16711. Γöé                              ΓöéPREEMPT         ΓöéI   M   S     Γöé
  16712. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16713. Γöé                              ΓöéREPLACE         Γöé    I   S     Γöé
  16714. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16715. ΓöéGpiPlaySegment (Call Segment) ΓöéDrawing outside Γöé    M   S     Γöé
  16716. Γöé                              Γöéof an instance  Γöé              Γöé
  16717. Γöé                              Γöédrawing         Γöé              Γöé
  16718. Γöé                              Γöéprimitive but   Γöé              Γöé
  16719. Γöé                              Γöéinside a        Γöé              Γöé
  16720. Γöé                              Γöésegment.        Γöé              Γöé
  16721. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16722. ΓöéNo specific function          ΓöéDrawing outside Γöé        M     Γöé
  16723. Γöé                              Γöéof segments     Γöé              Γöé
  16724. Γöé                              Γöéaltogether.     Γöé              Γöé
  16725. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  16726.  
  16727. Abbreviations:  I - Instance Transformation, M - Model Transformation, S - 
  16728. Segment Transformation 
  16729.  
  16730. Between the model and page space pair are two transformations and they also can 
  16731. be combined in different ways. 
  16732.  
  16733. Model to Page Space Transformation Combinations 
  16734.  
  16735. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  16736. ΓöéTransformation Function       ΓöéEffect          ΓöéTransformationΓöé
  16737. Γöé                              Γöé                ΓöéType Sequence Γöé
  16738. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16739. ΓöéGpiSetPageViewport            ΓöéDrawing inside  ΓöéV   D         Γöé
  16740. Γöé                              Γöéof and outside  Γöé              Γöé
  16741. Γöé                              Γöéof segments.    Γöé              Γöé
  16742. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16743. ΓöéGpiSetDefaultViewMatrix       ΓöéDrawing outside Γöé    D         Γöé
  16744. Γöé                              Γöéof segments.    Γöé              Γöé
  16745. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  16746.  
  16747. Abbreviations:  V - Viewing Transformation, D - Default Viewing Transformation 
  16748.  
  16749.  
  16750. ΓòÉΓòÉΓòÉ 17.2.5. Transformation Mathematics ΓòÉΓòÉΓòÉ
  16751.  
  16752. The transformation of a picture can be represented in general terms by two 
  16753. linear equations that define how the (x,y) coordinates of each point in the 
  16754. picture are changed. 
  16755.  
  16756.  ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  16757.  Γöé  The general form of these equations is:  Γöé  where                                  Γöé
  16758.  Γöé                                           Γöé                                         Γöé
  16759.  Γöé  x' = Ax + Cy + E                         Γöé    (x,y) defines the original point     Γöé
  16760.  Γöé                                           Γöé    (x',y') is the transformed point     Γöé
  16761.  Γöé  y' = Bx + Dy + F                         Γöé    A, B, C, D, E, and F are constants.  Γöé
  16762.  Γöé                                           Γöé                                         Γöé
  16763.  ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  16764.  
  16765. The transformations that result from these equations depend on the values of 
  16766. the constants, which in turn vary according to the type of transformation being 
  16767. applied. 
  16768.  
  16769. The operating system handles transformations by using matrix mathematics. In 
  16770. the matrix mathematics, 
  16771.  
  16772. o Translation is an addition operation 
  16773. o Scaling, reflecting, rotation, and shear are multiplication operations. 
  16774.  
  16775. If all the transformations were multiplication operations, different types of 
  16776. transformation could be applied with a single transformation operation. 
  16777. Therefore, to facilitate the combining of calls, translation in the OS/2 
  16778. operating system is performed as a multiplication operation, rather than an 
  16779. addition operation. 
  16780.  
  16781. This requires that the vector representing a point, [ x   y ] 
  16782. be extended by a third component, w: [ x   y   w ] 
  16783. This enables all the transformations to be handled in a uniform manner. 
  16784.  
  16785. This is called a homogeneous coordinate system. The value, w, is a multiplier, 
  16786. so that the point represented is: (wx, wy). 
  16787.  
  16788. Note:  The PM programming interface does not support a 3-dimensional 
  16789.        presentation space. The 3-dimensional matrix is created to effect matrix 
  16790.        multiplication. 
  16791.  
  16792. In this notation, the point (x, y) is represented as [ x   y   1 ]. To be able 
  16793. to operate on such three-element vectors, and to combine translation with the 
  16794. multiplication operations, the 2-by-2 matrix has to be extended to a 3-by-3 
  16795. matrix, with the third column being: 
  16796.  
  16797.  
  16798.        0
  16799.        0
  16800.        1
  16801.  
  16802.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  16803.   Γöé  The linear equations:         Γöé  become the matrix equations:           Γöé
  16804.   Γöé                                Γöé                            Γöî         ΓöÉ  Γöé
  16805.   Γöé  x' = Ax + Cy + E              Γöé                            Γöé A  B  0 Γöé  Γöé
  16806.   Γöé                                Γöé  [ x' y' 1 ] = [ x y 1 ] * Γöé C  D  0 Γöé  Γöé
  16807.   Γöé  y' = Bx + Dy + F              Γöé                            Γöé E  F  1 Γöé  Γöé
  16808.   Γöé                                Γöé                            Γöö         Γöÿ  Γöé
  16809.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  16810.  
  16811. In standard matrix notation, you have: 
  16812.  
  16813.  
  16814.                             Γöî                      ΓöÉ
  16815.                             Γöé Msub11 Msub12 Msub13 Γöé
  16816.   [ x' y' 1 ] = [ x y 1 ] * Γöé Msub21 Msub22 Msub23 Γöé
  16817.                             Γöé Msub31 Msub32 Msub33 Γöé
  16818.                             Γöö                      Γöÿ
  16819.  
  16820.  
  16821. ΓòÉΓòÉΓòÉ 17.2.6. Model for Building the Transformation Matrix ΓòÉΓòÉΓòÉ
  16822.  
  16823. The transformation matrix shown above can be set equal to an entity as complex 
  16824. as: 
  16825.  
  16826. M*I*S*V*D 
  16827.  
  16828. where * symbolizes matrix multiplication. As mentioned earlier, all the 
  16829. transformation types might not have a distinct value at all times. One, or all, 
  16830. could simply be the identity transformation. 
  16831.  
  16832. These intermediate space and step-wise transformations are not actually how the 
  16833. operating system performs transformations. The reason for this relates to the 
  16834. way the PM programming interface stores transformation information. The 
  16835. transformation matrix data structure MATRIXLF, undergoes continuous 
  16836. modification during the drawing process, and it can be influenced by more than 
  16837. one transformation function from the application responding, for example, to 
  16838. what a user wants the drawing to look like. 
  16839.  
  16840. For example, after creating the model of a building from drawing primitives, 
  16841. the user might want to see 2 identical buildings side-by-side. The application 
  16842. has already applied a series of transformations to the 2 segments in world 
  16843. coordinate space to create the model of the building. If the application, 
  16844. rather than the PM programming interface, had to perform the entire 
  16845. transformation over again from start to finish, it would have to keep track of 
  16846. much more detail. The PM programming interface enables applications to process 
  16847. a smaller portion of the MATRIXLF structure, in this example the "V" or "V and 
  16848. D" component, to enable the user to see 2 buildings side-by-side. 
  16849.  
  16850.  
  16851. ΓòÉΓòÉΓòÉ 17.2.7. MATRIXLF, the Transformation Matrix ΓòÉΓòÉΓòÉ
  16852.  
  16853. For all the transformation functions, the 3-by-3 transformation matrix is 
  16854. specified as a one-dimensional array in the following order: 
  16855.  
  16856. (M11, M12, 0, M21, M22, 0, M31, M32, 1) 
  16857.  
  16858. This one-dimensional array corresponds to the data structure, MATRIXLF. The 
  16859. elements in the data structure correspond to the matrix multiplication 
  16860. constants, as shown in the following table. 
  16861.  
  16862. Transformation Factors in the MATRIXLF Data Structure. 
  16863.  
  16864. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  16865. ΓöéTransformation Type           ΓöéMatrix Values                 Γöé
  16866. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16867. ΓöéScaling, Reflection           ΓöéM11 and M22                   Γöé
  16868. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16869. ΓöéRotation                      ΓöéM11, M12, M21, M22            Γöé
  16870. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16871. ΓöéTranslation                   ΓöéM31 and M32                   Γöé
  16872. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  16873.  
  16874. All nine elements do not have to be specified for every transformation 
  16875. function. However, those specified are interpreted as the first n of the nine. 
  16876. If the third, sixth, and ninth elements are specified, they must be 0, 0, and 1 
  16877. respectively. 
  16878.  
  16879.  
  16880. ΓòÉΓòÉΓòÉ 17.2.7.1. MATRIXLF Structure ΓòÉΓòÉΓòÉ
  16881.  
  16882. Of the nine fields in MATRIXLF, four are special 32-bit FIXED variables. The 
  16883. remaining 5 are 32-bit long integer variables. 
  16884.  
  16885. The scaling, reflecting, and rotation constants, M11,M12,M21, M22, are the 
  16886. 32-bit, signed, FIXED variables, with an implied binary point between the 
  16887. second and third bytes. The translation constants, M31 and M32, and the 3 
  16888. third-column variables, are 32-bit long integers. 
  16889.  
  16890. A FIXED variable is a binary representation of a floating-point number. A FIXED 
  16891. variable has 2 parts: 
  16892.  
  16893. o The high-order 16-bits which contain a signed integer in the range -32768 
  16894.   through 32767 
  16895.  
  16896. o The low-order 16-bits which contain the numerator of a fraction in the range 
  16897.   0 through 65535. The denominator for this fraction is 65536. 
  16898.  
  16899. For example, to store the cosine of 60┬░ (0.5) in a FIXED variable, an 
  16900. application would multiply 65536 by 0.5. The result, 32768, would be the value 
  16901. to assign to a field in the MATRIXLF structure. 
  16902.  
  16903. To store a scaling factor of 3 in a FIXED variable, the application would 
  16904. multiply 65536 by 3. Again, the result, 196608, would be the value to assign to 
  16905. a field in the MATRIXLF structure. 
  16906.  
  16907.  
  16908. ΓòÉΓòÉΓòÉ 17.2.7.2. MAKEFIXED Macro ΓòÉΓòÉΓòÉ
  16909.  
  16910. The MAKEFIXED macro provides a quick and convenient method for setting the 
  16911. value of FIXED variables. This macro requires 2 arguments:  the first is the 
  16912. integer part of the FIXED value, and the second is the fraction part of the 
  16913. FIXED value. In the following example, MAKEFIXED is used to assign the FIXED 
  16914. value equivalent of 1 1/8 to the matrix component M11. 
  16915.  
  16916.     matlf.fxM11 = MAKEFIXED(1, 8192)
  16917.  
  16918.  
  16919. Determining a FIXED Equivalent 
  16920.  
  16921. The first argument, 1, is the integer part of the FIXED value. The second 
  16922. argument, 8192, is the result of multiplying 65536 by 1/8. 
  16923.  
  16924. If it is necessary for an application to scale or rotate an object, the 
  16925. application can avoid most of these mathematics by using the helper functions, 
  16926. GpiRotate and GpiScale. GpiRotate accepts a rotation in degrees and converts 
  16927. this value into the appropriate fields in the MATRIXLF structure. Similarly, 
  16928. GpiScale accepts a scaling factor and fills in the MATRIXLF structure with the 
  16929. appropriate values. 
  16930.  
  16931.  
  16932. ΓòÉΓòÉΓòÉ 17.3. About Transformation Operations ΓòÉΓòÉΓòÉ
  16933.  
  16934. The available transformations are listed in the following table. 
  16935.  
  16936. Transformations 
  16937.  
  16938. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  16939. ΓöéOperation       ΓöéResult                                      Γöé
  16940. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16941. ΓöéScaling         ΓöéShrinks or enlarges the object              Γöé
  16942. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16943. ΓöéReflection      ΓöéCreates a mirror image of an object with    Γöé
  16944. Γöé                Γöérespect to the x- or y- axis                Γöé
  16945. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16946. ΓöéRotation        ΓöéRotates the object                          Γöé
  16947. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16948. ΓöéTranslation     ΓöéShifts the object with respect to the originΓöé
  16949. Γöé                Γöéof the coordinate system                    Γöé
  16950. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  16951. ΓöéShear           ΓöéRotates either all the vertical or all the  Γöé
  16952. Γöé                Γöéhorizontal lines in an object               Γöé
  16953. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  16954.  
  16955. These basic operations can be combined. 
  16956.  
  16957. The PM programming interface provides special functions to perform scaling, 
  16958. rotation, and translation and also enables applications to specify the 
  16959. transformation matrix directly. Applications can specify values for more than 
  16960. one type of transformation on a single transformation call. 
  16961.  
  16962. Transformations are used to manipulate graphic objects as they are being moved 
  16963. from 1 coordinate space to another. These operations are performed by functions 
  16964. called transformation functions. There are also functions that help perform the 
  16965. transformations called helper functions. 
  16966.  
  16967. The scaling, reflection, rotation, translation, and shear transformations are 
  16968. best demonstrated by applying them to a picture. The following figure shows the 
  16969. image of a flag before any transformations have been applied. The flag is 
  16970. defined by 5 points. Their (x,y) coordinates are (0,0), (0,4), (0,6), (2,6), 
  16971. and (2,4). 
  16972.  
  16973. Flag Before Transformation 
  16974.  
  16975. In the next several sections, where the transformations are described in 
  16976. detail, the effect of the transformation on the flag is illustrated. 
  16977.  
  16978.  
  16979. ΓòÉΓòÉΓòÉ 17.3.1. Scaling and Reflection Transformations ΓòÉΓòÉΓòÉ
  16980.  
  16981. Applications can scale an object by using GpiScale or by modifying the MATRIXLF 
  16982. structure directly. A scaling transformation reduces or increases the size of a 
  16983. graphics object. A reflecting transformation creates a mirror image of an 
  16984. object with respect to the x- or y-axis. 
  16985.  
  16986. A scaling factor of: 
  16987.  
  16988. o greater than 1 causes an increase in size 
  16989.  
  16990. o greater than 0 but less than 1 causes a reduction in size, 
  16991.  
  16992. o less than 0 causes a reflection about that axis. That is, a negative x 
  16993.   scaling factor causes reflection in the x direction. 
  16994.  
  16995. Note:  If an application specifies a scaling factor of greater than 1, the 
  16996.        graphics presentation space must be defined with the coordinate format 
  16997.        GPIF_LONG. This is because 32-bit matrix elements are required to store 
  16998.        these values in retained segment and metafile orders. 
  16999.  
  17000. The equations to scale by factors Sx and Sy are obtained from the general 
  17001. equations (with M11 = Sx and M22 = Sy) and can be written: 
  17002.  
  17003. x' = xSx 
  17004.  
  17005. y' = ySy 
  17006.  
  17007. A scaling transformation reduces or increases all the coordinates of an object 
  17008. by the scaling factor. Any object not aligned on the x- and y-axes is therefore 
  17009. moved nearer to the origin by a reduction in size, and away from the origin by 
  17010. an increase in size. For example, if an application applies a scaling factor of 
  17011. 0.5 to a simple box with its corners at (4,4), (10,4), (10,10), and (4,10), the 
  17012. four corners moves to (2,2), (5,2), (5,5), and (2,5). 
  17013.  
  17014. To scale an object about a point without causing it to move, the following 
  17015. sequence of transformations is required: 
  17016.  
  17017.  1. Translate the scaling point of the object to the origin. 
  17018.  
  17019.  2. Scale the object at the origin. 
  17020.  
  17021.  3. Translate the scaling point of the object back to its original position. 
  17022.  
  17023.  
  17024. ΓòÉΓòÉΓòÉ 17.3.1.1. Scaling a Graphics Object ΓòÉΓòÉΓòÉ
  17025.  
  17026. An application can scale the flag by 0.5, by applying: 
  17027.  
  17028. x' = 0.5x 
  17029.  
  17030. y' = 0.5y 
  17031.  
  17032. The original 5 points of the flag are transformed: 
  17033.  
  17034. (0,0) ΓöÇ (0,0)
  17035. (0,4) ΓöÇ (0,2)
  17036. (0,6) ΓöÇ (0,3)
  17037. (2,4) ΓöÇ (1,2)
  17038. (2,6) ΓöÇ (1,3)
  17039. The following figure shows the effect of the scaling. 
  17040.  
  17041. Scaling by 0.5 
  17042.  
  17043. This scaling preserves the shape and orientation of the object, because the 
  17044. scaling factors in both directions are the same. However, scaling equations 
  17045. permit different scaling factors to be applied to x and y, which can cause 
  17046. distortion of the original shape of the object. 
  17047.  
  17048.  
  17049. ΓòÉΓòÉΓòÉ 17.3.1.2. Reflecting a Graphics Object ΓòÉΓòÉΓòÉ
  17050.  
  17051. A negative scaling factor causes a reflection of the object to be drawn. A 
  17052. scaling factor of -1, for example, causes a mirror image of the object to be 
  17053. drawn in the appropriate direction. 
  17054.  
  17055. The following figure shows the flag reflected by applying a negative y scaling 
  17056. factor. 
  17057.  
  17058. Reflection 
  17059.  
  17060.  
  17061. ΓòÉΓòÉΓòÉ 17.3.1.3. MATRIXLF Structure for Scaling and Reflecting ΓòÉΓòÉΓòÉ
  17062.  
  17063. When an application scales an object by using the scaling transformation, the 
  17064. matrix element M11 contains the horizontal scaling component (Sx), and the 
  17065. matrix element M22 contains the vertical scaling component (Sy). 
  17066.  
  17067.  
  17068.                           Γöî         ΓöÉ
  17069.                           Γöé Sx 0  0 Γöé
  17070. [ x' y' 1 ] = [ x y 1 ] * Γöé 0  Sy 0 Γöé
  17071.                           Γöé 0  0  1 Γöé
  17072.                           Γöö         Γöÿ
  17073.  
  17074. If the matrix element M11 contains a negative horizontal reflection component 
  17075. (-Sx), it causes reflection about the y-axis. If the matrix element M22 
  17076. contains a negative vertical reflection component (-Sy) it causes reflection 
  17077. about the x-axis. 
  17078.  
  17079.  
  17080. ΓòÉΓòÉΓòÉ 17.3.2. Rotation Transformations ΓòÉΓòÉΓòÉ
  17081.  
  17082. The application can rotate an object either using GpiRotate or by modifying the 
  17083. MATRIXLF structure directly. 
  17084.  
  17085. The operating system applies a transformation to all points in the source 
  17086. coordinate space. This means that unless an object is drawn about the origin of 
  17087. the source coordinate space, translation occurs when the object is rotated or 
  17088. scaled. GpiRotate enables an application to specify a point, relative to the 
  17089. origin, that is, the center of rotation. 
  17090.  
  17091. The equations for the rotation of an object about the origin (0,0) through an 
  17092. angle (theta), can be written: 
  17093.  
  17094. x' = x cos (theta) - y sin (theta) 
  17095.  
  17096. y' = x sin (theta) + y cos (theta) 
  17097.  
  17098. A negative (theta) value rotates the object clockwise. For clockwise rotation, 
  17099. the rotation equations are: 
  17100.  
  17101. x' = x cos (theta) + y sin (theta) 
  17102.  
  17103. y' = -x sin (theta) + y cos (theta) 
  17104.  
  17105. To rotate an object about some other point (p,q), the following sequence of 
  17106. transformations is required: 
  17107.  
  17108.  1. Translate the object by (-p,-q) to move the point of rotation to the 
  17109.     origin. 
  17110.  
  17111.  2. Rotate the object around the origin. 
  17112.  
  17113.  3. Translate the object by (p,q) to move it back to its original position. 
  17114.  
  17115. Rotation preserves the shape and size of the object. 
  17116.  
  17117.  
  17118. ΓòÉΓòÉΓòÉ 17.3.2.1. Rotating a Graphics Object ΓòÉΓòÉΓòÉ
  17119.  
  17120. An application can rotate the flag counterclockwise through 90┬░, by applying: 
  17121.  
  17122. x' = x cos 90 - y sin 90 
  17123.  
  17124. y' = x sin 90 + y cos 90 
  17125.  
  17126. Because cos 90 = 0 and sin 90 = 1, these equations become: 
  17127.  
  17128. x' = - y 
  17129.  
  17130. y' = x 
  17131.  
  17132. The original 5 points are transformed: 
  17133.  
  17134. (0,0) ΓöÇ (0,0)
  17135. (0,4) ΓöÇ (-4,0)
  17136. (0,6) ΓöÇ (-6,0)
  17137. (2,4) ΓöÇ (-4,2)
  17138. (2,6) ΓöÇ (-6,2)
  17139.  
  17140. The following figure shows the effect of rotating the flag 90┬░. 
  17141.  
  17142. Rotation Counterclockwise through 90┬░ 
  17143.  
  17144.  
  17145. ΓòÉΓòÉΓòÉ 17.3.2.2. MATRIXLF Structure for Rotating ΓòÉΓòÉΓòÉ
  17146.  
  17147. For counterclockwise rotation: 
  17148.  
  17149.  
  17150.                           Γöî                              ΓöÉ
  17151.                           Γöé  cos (theta)  sin (theta)  0 Γöé
  17152. [ x' y' 1 ] = [ x y 1 ] * Γöé -sin (theta)  cos (theta)  0 Γöé
  17153.                           Γöé   0            0           1 Γöé
  17154.                           Γöö                              Γöÿ
  17155.  
  17156. For clockwise rotation: 
  17157.  
  17158.  
  17159.                           Γöî                              ΓöÉ
  17160.                           Γöé  cos (theta) -sin (theta)  0 Γöé
  17161. [ x' y' 1 ] = [ x y 1 ] * Γöé  sin (theta)  cos (theta)  0 Γöé
  17162.                           Γöé   0            0           1 Γöé
  17163.                           Γöö                              Γöÿ
  17164.  
  17165.  
  17166. ΓòÉΓòÉΓòÉ 17.3.3. Translation Transformations ΓòÉΓòÉΓòÉ
  17167.  
  17168. The application can translate an object either using GpiTranslate or by 
  17169. modifying the MATRIXLF structure directly. 
  17170.  
  17171. To move a graphics object by an absolute number of coordinate units, a 
  17172. translation equation is applied. The equations for translation by Tx and Ty are 
  17173. obtained from the general equations (with E = Tx, and F = Ty) and can be 
  17174. written: 
  17175.  
  17176. x' = x + Tx 
  17177.  
  17178. y' = y + Ty 
  17179.  
  17180. Translation preserves the shape, size, and orientation of the object. A 
  17181. negative Tx value causes movement to the left. A negative Ty value causes 
  17182. movement downward. 
  17183.  
  17184.  
  17185. ΓòÉΓòÉΓòÉ 17.3.3.1. Translating a Graphics Object ΓòÉΓòÉΓòÉ
  17186.  
  17187. If Tx is equal to 8 and Ty is equal to 5, then: 
  17188.  
  17189. x' = x + 8 
  17190.  
  17191. y' = y + 5 
  17192.  
  17193. The original 5 points are transformed: 
  17194.  
  17195. (0,0) ΓöÇ (8,5)
  17196. (0,4) ΓöÇ (8,9)
  17197. (0,6) ΓöÇ (8,11)
  17198. (2,4) ΓöÇ (10,9)
  17199. (2,6) ΓöÇ (10,11)
  17200.  
  17201. The following figure shows the effect of translating the flag by (8,5). 
  17202.  
  17203. Translation by (8,5) 
  17204.  
  17205.  
  17206. ΓòÉΓòÉΓòÉ 17.3.3.2. MATRIXLF Structure for Translating ΓòÉΓòÉΓòÉ
  17207.  
  17208. When an application translates an object by using the translation 
  17209. transformation, the matrix element M31 contains the horizontal translation 
  17210. component, and the matrix element M32 contains the vertical translation 
  17211. component, as follows: 
  17212.  
  17213.  
  17214.                           Γöî         ΓöÉ
  17215.                           Γöé 1  0  0 Γöé
  17216. [ x' y' 1 ] = [ x y 1 ] * Γöé 0  1  0 Γöé
  17217.                           Γöé Tx Ty 1 Γöé
  17218.                           Γöö         Γöÿ
  17219.  
  17220.  
  17221. ΓòÉΓòÉΓòÉ 17.3.4. Shearing Transformations ΓòÉΓòÉΓòÉ
  17222.  
  17223. There are 2 shear transformations:  vertical and horizontal. The vertical shear 
  17224. transformation affects only the y-component of the coordinates of points in an 
  17225. object; the horizontal shear transformation affects only the x-component. 
  17226.  
  17227. If an application shears an object that contains 2 orthogonal vectors (2 
  17228. perpendicular lines), the vectors are no longer orthogonal. 
  17229.  
  17230. A shearing transformation alters the shape of an object by translating its 
  17231. x-coordinates relative to its y-coordinates, or its y-coordinates relative to 
  17232. its x-coordinates. The amount by which the coordinates are translated is 
  17233. determined by the angle of the shear. 
  17234.  
  17235. The equation for shearing an object to the left along the x axis by angle 
  17236. (theta) is: 
  17237.  
  17238. x' = x - y tan (theta) 
  17239.  
  17240. y' = y 
  17241.  
  17242. To shear an object along the y-axis, the tangent of the angle of the shear is 
  17243. represented by constant B in the general equation. 
  17244.  
  17245.  
  17246. ΓòÉΓòÉΓòÉ 17.3.4.1. Shearing a Graphics Object ΓòÉΓòÉΓòÉ
  17247.  
  17248. The following figure shows the flag sheared to the left along the x-axis. 
  17249.  
  17250. Shearing Along the X-Axis 
  17251.  
  17252.  
  17253. ΓòÉΓòÉΓòÉ 17.3.4.2. MATRIXLF Structure for Shearing ΓòÉΓòÉΓòÉ
  17254.  
  17255. For vertical shear transformation, the matrix element M11 contains the 
  17256. horizontal shear component, and the element M21 contains the vertical shear 
  17257. component, as follows: 
  17258.  
  17259.  
  17260.                           Γöî                    ΓöÉ
  17261.                           Γöé   1           0  0 Γöé
  17262. [ x' y' 1 ] = [ x y 1 ] * Γöé -tan (theta)  1  0 Γöé
  17263.                           Γöé   0           0  1 Γöé
  17264.                           Γöö                    Γöÿ
  17265.  
  17266. For horizontal shear transformation, the matrix element M21 contains the 
  17267. horizontal shear component, and the matrix element M22 contains the vertical 
  17268. shear component, as follows: 
  17269.  
  17270.  
  17271.                           Γöî                    ΓöÉ
  17272.                           Γöé +tan (theta)  0  0 Γöé
  17273. [ x' y' 1 ] = [ x y 1 ] * Γöé   1           1  0 Γöé
  17274.                           Γöé   0           0  1 Γöé
  17275.                           Γöö                    Γöÿ
  17276.  
  17277.  
  17278. ΓòÉΓòÉΓòÉ 17.4. About Transformation Functions ΓòÉΓòÉΓòÉ
  17279.  
  17280. Transformation functions manipulate objects between coordinate spaces by 
  17281. applying transformations. Transformation functions require 2 coordinate spaces: 
  17282. a source coordinate space, and a target coordinate space. Which transformation 
  17283. function an application should use is determined by the 2 coordinate spaces and 
  17284. by the transformation effect desired. 
  17285.  
  17286. The world-to-model space, model-to-page space, and page-to-device space 
  17287. transformations are all actually performed as a single operation. The different 
  17288. coordinate spaces are conceptual in nature, rather than explicitly defined 
  17289. entities. Describing them separately is meant to help explain the levels of 
  17290. activity during transformations. 
  17291.  
  17292. All transformation functions share certain parameters, although the values and 
  17293. defaults of those parameters might not be identical. 
  17294.  
  17295.  
  17296. ΓòÉΓòÉΓòÉ 17.4.1. Current Transformation ΓòÉΓòÉΓòÉ
  17297.  
  17298. Every graphics object, whether in world, model, page, or device space, has a 
  17299. current transformation value, even if that value is simply the identity 
  17300. transformation. 
  17301.  
  17302. The default current model transformation is the concatenation of any instance, 
  17303. segment, and model transformations from the root segment downward. The default 
  17304. current viewing transformation is the 1 most recently specified. The device 
  17305. transformation, which is set by the page viewport and the presentation page, 
  17306. should not be changed while drawing is in progress. 
  17307.  
  17308.  
  17309. ΓòÉΓòÉΓòÉ 17.4.2. Accumulating Transformations ΓòÉΓòÉΓòÉ
  17310.  
  17311. Each time one of the transformation functions is called by an application, the 
  17312. application can set the function's option parameter to control how the function 
  17313. combines the transformation with existing transformations and in what order the 
  17314. transformations are applied. 
  17315.  
  17316. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  17317. ΓöéIf the application uses this flag...ΓöéThen the operating      Γöé
  17318. Γöé                                    Γöésystem...               Γöé
  17319. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17320. ΓöéTRANSFORM_REPLACE                   ΓöéReplaces any existing   Γöé
  17321. Γöé                                    Γöétransformations with theΓöé
  17322. Γöé                                    Γöénew transformation. The Γöé
  17323. Γöé                                    Γöéexisting value of the   Γöé
  17324. Γöé                                    Γöématrix is discarded and Γöé
  17325. Γöé                                    Γöéreplaced by straight    Γöé
  17326. Γöé                                    Γöésubstitution.           Γöé
  17327. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17328. ΓöéTRANSFORM_PREEMPT                   ΓöéApplies the new         Γöé
  17329. Γöé                                    Γöétransformation before   Γöé
  17330. Γöé                                    Γöéapplying the existing   Γöé
  17331. Γöé                                    Γöétransformation.         Γöé
  17332. Γöé                                    ΓöéThe transformation      Γöé
  17333. Γöé                                    Γöématrix of the new       Γöé
  17334. Γöé                                    Γöétransformation is       Γöé
  17335. Γöé                                    Γöépre-multiplied with the Γöé
  17336. Γöé                                    Γöétransformation matrix ofΓöé
  17337. Γöé                                    Γöéthe current             Γöé
  17338. Γöé                                    Γöétransformation.         Γöé
  17339. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17340. ΓöéTRANSFORM_ADD                       ΓöéApplies the new         Γöé
  17341. Γöé                                    Γöétransformation after    Γöé
  17342. Γöé                                    Γöéapplying the existing   Γöé
  17343. Γöé                                    Γöétransformation.         Γöé
  17344. Γöé                                    ΓöéThe transformation      Γöé
  17345. Γöé                                    Γöématrix of the new       Γöé
  17346. Γöé                                    Γöétransformation is       Γöé
  17347. Γöé                                    Γöépost-multiplied with theΓöé
  17348. Γöé                                    Γöétransformation matrix ofΓöé
  17349. Γöé                                    Γöéthe current             Γöé
  17350. Γöé                                    Γöétransformation.         Γöé
  17351. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  17352.  
  17353. The order in which transformations are applied affects the appearance of the 
  17354. picture. For example, suppose that a box primitive has been defined, with its 
  17355. lower-left corner at (4,2) and its upper-right corner at (8,8), and that you 
  17356. want both to scale the box by 0.5 and to translate it by (-10,-10). 
  17357.  
  17358. If the box is translated before scaling it, the transformed box is as shown in 
  17359. the following figure. 
  17360.  
  17361. If the box is scaled before translating it, the transformed box is as shown in 
  17362. the figure after the following figure. 
  17363.  
  17364. When an application is drawing a picture in which there are called segments, 
  17365. and in which transformations are applied to the root segments, the root-segment 
  17366. transformations should usually be applied to any segments they call. For 
  17367. example, if a segment that is translated to the left of the picture (by 
  17368. changing its segment transformation) calls a second segment, that leftward 
  17369. transformation should also be applied to the called segment. In this instance, 
  17370. the application would specify TRANSFORM_ADD in the call to GpiCallSegmentMatrix 
  17371. to add the instance transformation to the calling segments' segment 
  17372. transformation. Instance transformations are automatically reset on return to 
  17373. the calling segment. 
  17374.  
  17375. Translating before Scaling 
  17376.  
  17377. The translated box has its lower-left corner at (-6,-8), and its upper-right 
  17378. corner at (-2,-2). Each of its coordinates is then scaled by 0.5, and the 
  17379. transformed box has its corners at (-3,-1), (-1,-1), (-3,-4), and (-1,-4). 
  17380.  
  17381. Scaling before Translating 
  17382.  
  17383. The scaled box has its lower-left corner at (2,1), and its upper-right corner 
  17384. at (4,4). The box is then translated by (-10,-10), and the transformed box has 
  17385. its corners at (-8,-6), (-6,-6), (-6,-9), and (-8,-9). 
  17386.  
  17387.  
  17388. ΓòÉΓòÉΓòÉ 17.4.3. Concatenating Transformations ΓòÉΓòÉΓòÉ
  17389.  
  17390. When an application applies more than one transformation, it can concatenate 
  17391. the individual transformations to produce a final result. To concatenate 
  17392. transformations, multiply the individual transformation matrixes. The product 
  17393. of this multiplication is the concatenated transformation. 
  17394.  
  17395. There are four ways the final matrix can be concatenated: 
  17396.  
  17397.  1. Hard code the matrix values into the application, then call the 
  17398.     transformation functions. 
  17399.  
  17400.  2. Multiply the individual matrixes, then call the transformation functions. 
  17401.  
  17402.  3. Use the helper functions with the TRANSFORM_ADD option, then call the 
  17403.     transformation functions. 
  17404.  
  17405.  4. Alternately apply transformation operations directly to the transformation 
  17406.     matrix, then apply a transformation function. 
  17407.  
  17408. Concatenating before calling provides better performance. 
  17409.  
  17410.  
  17411. ΓòÉΓòÉΓòÉ 17.4.3.1. Hard Coding Values for a Concatenated Matrix ΓòÉΓòÉΓòÉ
  17412.  
  17413. Pre-calculating the concatenated matrix values, then hard coding the values 
  17414. into the application, gives the fastest performance. However, this is rarely 
  17415. practical as the actual transformations to be performed are often variable. 
  17416.  
  17417. If an application is, for example, performing interactive graphics, and one of 
  17418. the options offered to the user is a menu choice of rotate by 90┬░, and enlarge 
  17419. by 4, then the rotational and scaling factors would not change, and the matrix 
  17420. values could be hard coded into the application. 
  17421.  
  17422.  
  17423. ΓòÉΓòÉΓòÉ 17.4.3.2. Multiplying Matrix Values ΓòÉΓòÉΓòÉ
  17424.  
  17425. Multiplying transformation matrix values directly offers the second fastest 
  17426. performance, yet can still respond to a variety of desired transformations. As 
  17427. many transformation matrixes as needed can be multiplied together. If the 
  17428. application is concatenating the matrixes itself, it is responsible for 
  17429. preventing the accumulated transformation side effects. 
  17430.  
  17431. For example, to rotate an object counterclockwise about the point (p,q) using a 
  17432. single transformation call requires 3 transformations to be concatenated. When 
  17433. the application is specifying each transformation, step-by-step, the sequence 
  17434. of actions would be: 
  17435.  
  17436.  1. Translate the object by (-p,-q) to move the point of rotation to the 
  17437.     origin. 
  17438.  
  17439.  2. Rotate the object about the origin. 
  17440.  
  17441.  3. Translate the object by (p,q) to move it back to its original position. 
  17442.  
  17443. The individual matrixes are: 
  17444.  
  17445.  
  17446. Γöî           ΓöÉ Γöî                              ΓöÉ Γöî         ΓöÉ
  17447. Γöé  1   0  0 Γöé Γöé  cos (theta)  sin (theta)  0 Γöé Γöé 1  0  0 Γöé
  17448. Γöé  0   1  0 Γöé Γöé -sin (theta)  cos (theta)  0 Γöé Γöé 0  1  0 Γöé
  17449. Γöé -Tx -Ty 1 Γöé Γöé   0            0           1 Γöé Γöé Tx Ty 1 Γöé
  17450. Γöö           Γöÿ Γöö                              Γöÿ Γöö         Γöÿ
  17451.  
  17452. The matrix for the concatenated transformation is produced incrementally. That 
  17453. is, 2 adjacent matrixes are multiplied to produce a single matrix, which is 
  17454. then multiplied with the third matrix. You can begin by multiplying either the 
  17455. first 2 matrixes or the second 2 matrixes. If you start by multiplying matrixes 
  17456. 2 and 3 together, the resulting matrix is: 
  17457.  
  17458.  
  17459.           Γöî                              ΓöÉ
  17460.           Γöé  cos (theta)  sin (theta)  0 Γöé
  17461.           Γöé -sin (theta)  cos (theta)  0 Γöé
  17462.           Γöé   Tx           Ty          1 Γöé
  17463.           Γöö                              Γöÿ
  17464.  
  17465. This matrix is multiplied with the first matrix to produce the matrix for 
  17466. rotating an object at the point (p,q): 
  17467.  
  17468.  
  17469.           Γöî                              ΓöÉ
  17470.           Γöé  cos (theta)  sin (theta)  0 Γöé
  17471.           Γöé -sin (theta)  cos (theta)  0 Γöé
  17472.           Γöé   a            b           1 Γöé
  17473.           Γöö                              Γöÿ
  17474.  
  17475. where: 
  17476.  
  17477. a = (-Txcos (theta) + Ty sin (theta) + Tx) 
  17478.  
  17479. and 
  17480.  
  17481. b = (-Txsin (theta) - Ty cos (theta) + Ty) 
  17482.  
  17483. If an application were performing the concatenation for a scaling operation, 
  17484. again it would have to specify the transformation step-by-step. The sequence of 
  17485. actions would be: 
  17486.  
  17487.  1. Translate the object's scaling point to the origin. 
  17488.  
  17489.  2. Scale the object at the origin. 
  17490.  
  17491.  3. Translate the object back to its original position. 
  17492.  
  17493. Here are the 3 matrixes required to obtain this effect: 
  17494.  
  17495.  
  17496. Γöî           ΓöÉ Γöî            ΓöÉ Γöî         ΓöÉ
  17497. Γöé  1   0  0 Γöé Γöé  Sx  0   0 Γöé Γöé 1  0  0 Γöé
  17498. Γöé  0   1  0 Γöé Γöé  0   Sy  0 Γöé Γöé 0  1  0 Γöé
  17499. Γöé -Tx -Ty 1 Γöé Γöé  0   0   1 Γöé Γöé Tx Ty 1 Γöé
  17500. Γöö           Γöÿ Γöö            Γöÿ Γöö         Γöÿ
  17501.  
  17502. The matrix of the concatenated transformation is: 
  17503.  
  17504.  
  17505.    Γöî                           ΓöÉ
  17506.    Γöé     Sx          0       0 Γöé
  17507.    Γöé     1           Sy      0 Γöé
  17508.    Γöé (-TxSx+Tx)  (-TySy+Ty)  1 Γöé
  17509.    Γöö                           Γöÿ
  17510.  
  17511.  
  17512. ΓòÉΓòÉΓòÉ 17.4.3.3. Transformation Helper Functions ΓòÉΓòÉΓòÉ
  17513.  
  17514. Three helper functions, are provided to perform the matrix math required to 
  17515. concatenate transformations: 
  17516.  
  17517. o GpiTranslate 
  17518. o GpiRotate 
  17519. o GpiScale. 
  17520.  
  17521. Any of these three functions can be used with the TRANSFORM_ADD option to 
  17522. concatenate the new matrix with an existing matrix. This method builds up the 
  17523. matrix in application storage in a sequence of steps before issuing a single 
  17524. transform function. 
  17525.  
  17526. While this is slower than hard coding the matrix, it is faster than alternating 
  17527. between applying transformation operations directly to the matrix then applying 
  17528. a transformation function. 
  17529.  
  17530. The helper functions merely calculate the appropriate matrix. The 
  17531. transformation is not applied until the array containing the matrix values is 
  17532. passed to the appropriate transformation function. 
  17533.  
  17534. Applications use GpiTranslate to change the position of an object. The 
  17535. application specifies the coordinates of the point to which to move the object 
  17536. and the name of the transform matrix to use as input to GpiTranslate. The 
  17537. transformation matrix must be in the form of a one-dimensional array. The 
  17538. application also can specify whether this transformation is to replace the 
  17539. value for a previous transformation, or whether it is to be added to it. 
  17540.  
  17541. Applications use GpiRotate to rotate an object. The application specifies the 
  17542. angle of rotation, the coordinates of the point around which the object is to 
  17543. rotate, and the transformation matrix. The transformation matrix must be in the 
  17544. form of a 1 dimensional array. The application also can specify whether this 
  17545. transformation is to replace the value for a previous transformation, or 
  17546. whether it is to be added to it. 
  17547.  
  17548. To scale an object at a point without also moving the object, applications use 
  17549. GpiScale. When using GpiScale, the application specifies the scaling factor, 
  17550. the coordinates of the center point, and the transformation matrix. The 
  17551. transformation matrix must be in the form of a one-dimensional array. The 
  17552. application also can specify whether this transformation is to replace the 
  17553. value for a previous transformation, or whether it is to be added to it. 
  17554.  
  17555.  
  17556. ΓòÉΓòÉΓòÉ 17.4.3.4. Applying Transformation Operations Directly to the Transformation Matrix and Using Transformation Functions ΓòÉΓòÉΓòÉ
  17557.  
  17558. An application could alternate between applying transformation operations 
  17559. directly to the transformation matrix, then applying a transformation function 
  17560. with the TRANSFORM_ADD option set. This would build up the matrix in the 
  17561. presentation space. This method has the slowest performance of the four 
  17562. concatenation methods. 
  17563.  
  17564.  
  17565. ΓòÉΓòÉΓòÉ 17.4.4. Round-Off Error ΓòÉΓòÉΓòÉ
  17566.  
  17567. Whenever an application uses transformations, it should handle any round-off 
  17568. error that occurs after multiple scaling, rotation, shear, or reflection 
  17569. transformations. The rounding error increases because a transformation is 
  17570. incrementally updated by the amount of the error with, for example, the 
  17571. TRANSFORM_ADD option. For the rotation to remain accurate, the application 
  17572. should recalculate the transformation, rather that accumulate many small 
  17573. changes. 
  17574.  
  17575. For example, if an application uses a rotation transformation to rotate the 
  17576. hands of a clock, the accuracy of the clock diminishes due to rounding off 
  17577. after the transformation. The rounding error should be periodically removed by 
  17578. using the TRANSFORM_REPLACE option at known points, for example, every 90┬░ or 
  17579. every complete revolution of the clock. 
  17580.  
  17581.  
  17582. ΓòÉΓòÉΓòÉ 17.4.5. World Space-to-Model Space Transformations ΓòÉΓòÉΓòÉ
  17583.  
  17584. The model transformation drawing attribute operates between world and model 
  17585. space. This attribute can be updated by one of the three following 
  17586. transformation functions: 
  17587.  
  17588. o GpiSetModelTransformMatrix 
  17589. o GpiSetSegmentTransformationsMatrix 
  17590. o GpiCallSegmentMatrix. 
  17591.  
  17592. If the model transformation drawing attribute has never been updated, the 
  17593. attribute defaults to the identity transformation. If the drawing attribute has 
  17594. been updated, the existing transformation is the concatenation of any instance, 
  17595. segment, or model transformations from the root segment downwards. Each time a 
  17596. new segment is opened (using GpiOpenSegment), the model transformation drawing 
  17597. attribute is reset to its default value. 
  17598.  
  17599. The three transformations that operate between world space and model space are: 
  17600.  
  17601. o Model transformations 
  17602. o Segment transformations 
  17603. o Instance transformations. 
  17604.  
  17605. The transformations that occur between world-coordinate and model spaces depend 
  17606. on the drawing mode and the possible segment type of the drawing primitive. 
  17607.  
  17608. The drawing mode can be either nonretain or retain. Nonretain mode is also 
  17609. called draw mode, as the graphics are immediately displayed. In retain mode, 
  17610. the graphics orders are stored in chained and unchained segments. A series of 
  17611. segments are shown in the following figure. 
  17612.  
  17613. Segments 
  17614.  
  17615. A model transformation effects objects in any of these segments. A segment 
  17616. transformation effects the 6 chained segments, on the left and must be issued 
  17617. before Root Segment 1 is accessed. An instance transformation can be applied 
  17618. only to Segment B, or Segment D; and must be issued from Segment A or Segment 
  17619. 2, or Segment C. The instance transformation is reset on return to the calling 
  17620. segment. 
  17621.  
  17622.  
  17623. ΓòÉΓòÉΓòÉ 17.4.5.1. Model Transformations ΓòÉΓòÉΓòÉ
  17624.  
  17625. Model transformations also can be applied to objects both inside and outside of 
  17626. segments. Model transformations also can be applied to objects created under 
  17627. retained or nonretained drawing mode. This means model transformations affect 
  17628. the output from: 
  17629.  
  17630. o GpiDrawChain 
  17631. o GpiDrawFrom 
  17632. o GpiDrawSegment 
  17633. o Any GPI functions that occur outside of a retained-drawing segment. 
  17634.  
  17635. Applications can change the model transformation any number of times in a 
  17636. single segment. Changing the model transformation changes the transformation 
  17637. applied to any drawing primitives issued subsequently. 
  17638.  
  17639. An application can determine the values for the current model transformation by 
  17640. calling GpiQueryModelTransformMatrix, which returns the model transformation's 
  17641. scaling, rotation, and translation values in a one-dimensional array 
  17642. representing elements in the MATRIXLF structure. 
  17643.  
  17644. GpiSetModelTransformMatrix specifies the model transformation's scaling, 
  17645. rotation, and translation values applied to subsequent primitives in the 
  17646. segment. As this function does not require the name a segment, it also can be 
  17647. used to apply transformations to primitives outside of segments. 
  17648.  
  17649. For example, in the building example earlier in the chapter, if the window is 
  17650. stored in a retained segment, an application could draw several identical 
  17651. windows on the house by setting a new translation component in the model 
  17652. transformation before calling GpiBox. 
  17653.  
  17654.  
  17655. ΓòÉΓòÉΓòÉ 17.4.5.2. Segment Transformations ΓòÉΓòÉΓòÉ
  17656.  
  17657. The segment transformation provides a way of defining the model transformation 
  17658. drawing attribute at the start of a retained segment. The attribute can 
  17659. subsequently be updated by the model transform orders within the segment. A 
  17660. segment transformation can be applied only to a retained segment. 
  17661.  
  17662. Segment transformations alter retained-drawing output. Unlike a model 
  17663. transformation, which can be set and reset within a segment bracket, a segment 
  17664. transformation must be set outside of a segment bracket. 
  17665.  
  17666. An application can determine the values for the current segment transformation 
  17667. by calling GpiQuerySegmentTransformMatrix, which returns the model 
  17668. transformation's scaling, rotation, and translation values in a one-dimensional 
  17669. array representing elements in the MATRIXLF structure. 
  17670.  
  17671. To apply a segment transformation, applications use 
  17672. GpiSetSegmentTransformMatrix. GpiSetSegmentTransformMatrix can be used to apply 
  17673. any sort of transformation to a segment. For example, it can be used to 
  17674. translate a dynamic segment from one screen position to another, when movement 
  17675. is requested by the user. The application could perform the following steps, 
  17676. for example, on receipt of a WM_MOUSEMOVE message: 
  17677.  
  17678.  1. Use the new mouse position to calculate the required displacement from the 
  17679.     current position. 
  17680.  2. Call GpiRemoveDynamics to remove the dynamic segment from its current 
  17681.     position. 
  17682.  3. Call GpiSetSegmentTransformMatrix to translate the segment coordinates by 
  17683.     the required amount. 
  17684.  4. Call GpiDrawDynamics to redraw the segment in its new position. 
  17685.  
  17686.  
  17687. ΓòÉΓòÉΓòÉ 17.4.5.3. Instance Transformations ΓòÉΓòÉΓòÉ
  17688.  
  17689. Instance transformations provide a way of defining the model transformation 
  17690. drawing attribute for the duration of a called segment. 
  17691.  
  17692. Instance transformations alter the retained-drawing output from special 
  17693. segments referred to as called segments. A called segment usually contains a 
  17694. subpicture duplicated several times in other subpictures. The instance 
  17695. transformation positions, sizes, and rotates the subpicture each time the 
  17696. segment is duplicated, because the transformation is set each time the segment 
  17697. is called. An instance transformation applies only to the called segment, and 
  17698. is reset on return to the calling segment. There is no query function 
  17699. associated with the transformation as it must be explicitly set for each called 
  17700. segment. 
  17701.  
  17702. To apply an instance transformation, applications call GpiCallSegmentMatrix 
  17703. from the calling segment. GpiCallSegmentMatrix calls the segment and also 
  17704. applies the model transformation's scaling, rotation, and translation values in 
  17705. a one-dimensional array representing elements in the MATRIXLF structure and 
  17706. passes a segment identifier. 
  17707.  
  17708.  
  17709. ΓòÉΓòÉΓòÉ 17.4.5.4. World Space-to-Model Space Transformation Summary ΓòÉΓòÉΓòÉ
  17710.  
  17711. The following table summarizes the choices available during world-coordinate 
  17712. space to model space transformations. 
  17713.  
  17714. World to Model Space Transformation Summary 
  17715.  
  17716. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  17717. ΓöéTransformation ΓöéTransformation Function           ΓöéApplies    Γöé
  17718. ΓöéType           Γöé                                  Γöéto...      Γöé
  17719. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17720. ΓöéModel          ΓöéGpiSetModelTransformMatrix        ΓöéPrimitives Γöé
  17721. ΓöétransformationsΓöé                                  Γöéboth insideΓöé
  17722. Γöé               Γöé                                  Γöéand outsideΓöé
  17723. Γöé               Γöé                                  Γöéa segment. Γöé
  17724. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17725. ΓöéSegment        ΓöéGpiSetSegmentTransformationsMatrixΓöéA retained Γöé
  17726. ΓöétransformationsΓöé                                  Γöésegment,   Γöé
  17727. Γöé               Γöé                                  Γöéissued at  Γöé
  17728. Γöé               Γöé                                  Γöéthe first  Γöé
  17729. Γöé               Γöé                                  Γöéelement of Γöé
  17730. Γöé               Γöé                                  Γöéthe        Γöé
  17731. Γöé               Γöé                                  Γöésegment.   Γöé
  17732. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17733. ΓöéInstance       ΓöéGpiCallSegmentMatrix              ΓöéOnly the   Γöé
  17734. ΓöétransformationsΓöé                                  Γöécalled     Γöé
  17735. Γöé               Γöé                                  Γöésegment.   Γöé
  17736. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  17737.  
  17738. Note:  The effect of GpiSetModelTransformMatrix and GpiCallSegmentMatrix on the 
  17739. model transformation drawing attribute can be duplicated by an equivalent 
  17740. drawing order in a drawn retained segment. 
  17741.  
  17742.  
  17743. ΓòÉΓòÉΓòÉ 17.4.6. Model Space-to-Page Space Transformations ΓòÉΓòÉΓòÉ
  17744.  
  17745. There are two transformations that operate between the model space and the page 
  17746. space: 
  17747.  
  17748. o Viewing transformations 
  17749. o Default viewing transformations 
  17750.  
  17751. All three model transformation types and the viewing transformations can be 
  17752. considered a part of the picture. The default viewing transformation is part of 
  17753. the environment, and must not be used for picture construction. 
  17754.  
  17755. Viewing transformations only apply in retained or nonretained segments. The 
  17756. viewing transformation attribute is set to the presentation space viewing 
  17757. transformation matrix value at the start of each drawn root segment and remains 
  17758. constant for that segment. If GpiSetViewingTransformMatrix is called, the new 
  17759. value is not used until the next segment is opened. The matrix drawing 
  17760. attribute is reset to identity at the end of the segment. Each change in a 
  17761. viewing transformation is equivalent to defining a new model space. 
  17762.  
  17763. The default viewing transformation is a presentation space attribute, and 
  17764. should not normally be modified in the middle of a picture. This attribute can 
  17765. be updated by the transformation function GpiSetDefaultViewMatrix. 
  17766.  
  17767. A picture is normally constructed in the presentation page with an identity 
  17768. default viewing transformation. The default viewing transformation can then be 
  17769. used to scale and scroll the entire picture in the presentation page. 
  17770.  
  17771.  
  17772. ΓòÉΓòÉΓòÉ 17.4.6.1. Viewing Transformations ΓòÉΓòÉΓòÉ
  17773.  
  17774. More than one copy of an entire model space can be drawn in page coordinate 
  17775. space, and each copy can be transformed as required. Parts of the model space 
  17776. also can be transformed to the presentation page. For example, an enlarged view 
  17777. of the tail of an aircraft can be shown with a reduced view of the complete 
  17778. aircraft in 1 corner. This is shown in the following figure. In this example, 
  17779. the picture assembled in the presentation page is derived from a single model 
  17780. space. 
  17781.  
  17782. Presentation-Page Space 
  17783.  
  17784. The entire model space (the aircraft) and a part of the model space (the tail 
  17785. of the aircraft) are drawn to a single page coordinate space. In each instance, 
  17786. scaling and translation transformations have been applied. 
  17787.  
  17788. Alternatively, the displayed picture can be made up of several subpictures with 
  17789. no common graphical elements. For example, the aircraft can be drawn in one 
  17790. part of the display, and a map of an airport in another part of the display. In 
  17791. this instance, the final picture would be derived from different model spaces. 
  17792.  
  17793. Whether multiple views are derived from a single model space or from different 
  17794. model spaces, there are two items to address for each instance of a model space 
  17795. incorporated into the presentation page: 
  17796.  
  17797.  1. The part of the model space to be displayed must be identified by defining 
  17798.     a viewing window for the model space. 
  17799.  
  17800.  2. To position and size the contents of the model space in page coordinate 
  17801.     space, a viewing transformation must be specified. 
  17802.  
  17803. To get views of one or more model spaces on the screen simultaneously, each 
  17804. model space is drawn the required number of times. Before each drawing request, 
  17805. the viewing window is defined and a viewing transformation is specified. 
  17806.  
  17807.  
  17808. ΓòÉΓòÉΓòÉ 17.4.6.2. Defining the Viewing Window ΓòÉΓòÉΓòÉ
  17809.  
  17810. The viewing window is a conceptual boundary around a part of the model space. 
  17811. To produce the picture in the previous figure, the aircraft is drawn twice. The 
  17812. first time, the viewing window is on only the tail of the aircraft, and the 
  17813. second time, the viewing window is on the entire aircraft. Only those parts of 
  17814. the model space within the viewing window are visible in the picture assembled 
  17815. in presentation-page space. GpiSetViewingLimits is used to define the viewing 
  17816. window. 
  17817.  
  17818.  
  17819. ΓòÉΓòÉΓòÉ 17.4.6.3. Graphics Field ΓòÉΓòÉΓòÉ
  17820.  
  17821. Applications also can specify a type of viewing window for the presentation 
  17822. page smaller than the page. This window is known as the graphics field. To 
  17823. define a graphics field use GpiSetGraphicsField. By default, no graphics field 
  17824. is specified. If a graphics field is defined, the picture assembled within it 
  17825. is the picture that is visible on the output device. 
  17826.  
  17827. An application can determine the current values for the viewing transformation 
  17828. by calling GpiQueryViewingTransformMatrix, which returns the transformation 
  17829. values in a one-dimensional array representing elements in the MATRIXLF 
  17830. structure. The application can set the values by calling 
  17831. GpiSetViewingTransformMatrix, and passing the transformation values in a 
  17832. one-dimensional array representing elements in the MATRIXLF structure. 
  17833.  
  17834.  
  17835. ΓòÉΓòÉΓòÉ 17.4.6.4. Default Viewing Transformations ΓòÉΓòÉΓòÉ
  17836.  
  17837. The default viewing window is the same size as the model space. Therefore, to 
  17838. display 1 or more entire model spaces, draw the picture the required number of 
  17839. times and let the viewing window default each time. 
  17840.  
  17841. Default viewing transformations scroll or zoom pictures in a window on a 
  17842. display screen. An application can determine the current values for the default 
  17843. viewing transformation by calling GpiQueryDefaultViewMatrix, which returns the 
  17844. default-viewing-transformation values in a one-dimensional array representing 
  17845. elements in the MATRIXLF structure. The application can set these values by 
  17846. calling GpiSetDefaultViewMatrix and passing the transformation values in a 
  17847. one-dimensional array representing elements in the MATRIXLF structure. 
  17848.  
  17849. A default viewing transformation is applied when the screen contents are zoomed 
  17850. or scrolled by user interaction. A picture is zoomed when the user wants to 
  17851. increase or decrease the size of an area of interest. A picture is usually 
  17852. scrolled when there is more in the presentation page than can be displayed in a 
  17853. single page of output. Anything lying off the screen, but within the range of 
  17854. the presentation page, can be scrolled into view. The default viewing 
  17855. transformation applies to the entire page coordinate space, and can be added 
  17856. to, or can replace, the current default viewing transformation. The PM 
  17857. programming interface applies it after any viewing transformations. 
  17858.  
  17859. When a presentation page is created, the default viewing transformation is set 
  17860. to identity. For example, if the presentation-page contents are scrolled: 
  17861.  
  17862. o Erase the screen contents. 
  17863.  
  17864. o Call GpiSetDefaultViewMatrix to translate the presentation-page picture by 
  17865.   the required amount. 
  17866.  
  17867. o Draw the picture again. 
  17868.  
  17869. The following figure shows the airplane presentation-page contents scrolled to 
  17870. the left. 
  17871.  
  17872. Scrolling the Presentation Page 
  17873.  
  17874. Every presentation-page coordinate is translated to the left by the same 
  17875. amount. 
  17876.  
  17877. Zooming is implemented in the same way, except that the default viewing 
  17878. transformation is used to scale the picture up or down as required. 
  17879.  
  17880. If you want to display only one view of a single picture, and if you do not 
  17881. want scrolling and zooming capabilities, you can let the viewing and default 
  17882. viewing transformations default. When both transformations are permitted to 
  17883. default, page coordinate space is effectively the same as model space. 
  17884.  
  17885.  
  17886. ΓòÉΓòÉΓòÉ 17.4.7. Page Space-to-Device Space Transformations ΓòÉΓòÉΓòÉ
  17887.  
  17888. There is only one transformation between the page coordinate space and the 
  17889. device space, the device transformation. The device transformation enables 
  17890. applications to work in any presentation-page units regardless of the target 
  17891. device. Unlike the transformations previously described, the device 
  17892. transformation: 
  17893.  
  17894. o Only scales and translates objects 
  17895. o Is defined by 2 rectangles. 
  17896.  
  17897. The first rectangle is called the presentation page. Its location is the bottom 
  17898. left origin and its dimensions are fixed. The second is called the page 
  17899. viewport. Its location is the bottom left origin and its dimensions can be 
  17900. varied. 
  17901.  
  17902. The device transformation, which maps the picture in presentation-page space to 
  17903. device space, happens automatically. The device transformation is established 
  17904. when the presentation space is created, and ensures that graphics are displayed 
  17905. in the correct size and, where possible, that their aspect ratio is preserved. 
  17906. The rules by which the device transformation is implemented are described in 
  17907. Mapping the Presentation Page to the Device. 
  17908.  
  17909. To modify the device transformation, applications use GpiSetPageViewport. Input 
  17910. for this function is the device coordinates of the lower-left and upper-right 
  17911. corners of the page viewport. Applications should modify the default device 
  17912. transformation only when it is necessary to use nonstandard page units. 
  17913.  
  17914.  
  17915. ΓòÉΓòÉΓòÉ 17.4.7.1. Presentation Pages ΓòÉΓòÉΓòÉ
  17916.  
  17917. A presentation page is a rectangle in a page space. Its lower-left corner is 
  17918. always positioned at the origin of the page space. 
  17919.  
  17920. An application can determine the dimensions of the presentation page by calling 
  17921. GpiQueryPS. It returns a pointer to a SIZEL structure that contains the page 
  17922. dimensions. If an application specifies arbitrary page units when creating a 
  17923. presentation space with GpiCreatePS, the page viewport is constructed such that 
  17924. the origin of the page rectangle maps to the origin of the default device 
  17925. rectangle and either the right or top edge maps to the corresponding edge. 
  17926. Thus, the aspect ratio of the graphic is preserved. 
  17927.  
  17928. If either the height or width of the presentation page is set to 0 (using 
  17929. GpiCreatePS), the application must set GPIA_ASSOC to set the default 
  17930. presentation page size to the default device rectangle size. 
  17931.  
  17932.  
  17933. ΓòÉΓòÉΓòÉ 17.4.7.2. Page Viewports ΓòÉΓòÉΓòÉ
  17934.  
  17935. A page viewport is a rectangle in device space, whose origin and size can be 
  17936. varied. The operating system uses the presentation-page rectangle and the 
  17937. page-viewport rectangle to define the device transformation. 
  17938.  
  17939. An application can determine the current dimensions of the page viewport by 
  17940. calling GpiQueryPageViewport, which returns a pointer to a RECTL structure that 
  17941. contains the coordinates of the viewport. The application can set the location 
  17942. and dimensions of the page viewport by calling GpiSetPageViewport and passing 
  17943. it a pointer to a RECTL structure that contains the new values. 
  17944.  
  17945. The ratio of the page width to the page-viewport width defines a horizontal 
  17946. scaling factor. The ratio of the page height to the viewport height defines a 
  17947. vertical scaling factor. Applications can use DevQueryCaps to obtain the 
  17948. horizontal and vertical resolution of a device in pels per meter. The 
  17949. dimensions of a pel can vary from one device to another, but they usually fall 
  17950. in the range of 0.25 to 0.50 mm. 
  17951.  
  17952. The page viewport can be shifted in the device space by a translation 
  17953. transformation. 
  17954.  
  17955.  
  17956. ΓòÉΓòÉΓòÉ 17.4.7.3. Mapping the Presentation Page to the Device ΓòÉΓòÉΓòÉ
  17957.  
  17958. When an application associates a presentation space with a device context, a 
  17959. default device transformation is set. A page viewport is defined according to 
  17960. the rules in the following table: 
  17961.  
  17962. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  17963. ΓöéPresentation-page ΓöéPage viewport size  ΓöéUsage.                Γöé
  17964. Γöéspecification     Γöé                    Γöé                      Γöé
  17965. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17966. ΓöéPels              ΓöéThe same size as theΓöéThe lower-left corner Γöé
  17967. Γöé                  Γöépresentation page.  Γöéof the presentation   Γöé
  17968. Γöé                  Γöé                    Γöépage maps to the      Γöé
  17969. Γöé                  Γöé                    Γöélower-left corner of  Γöé
  17970. Γöé                  Γöé                    Γöéthe device space. For Γöé
  17971. Γöé                  Γöé                    Γöéexample, if an        Γöé
  17972. Γöé                  Γöé                    Γöéapplication defines a Γöé
  17973. Γöé                  Γöé                    Γöépresentation page of  Γöé
  17974. Γöé                  Γöé                    Γöé300 coordinates       Γöé
  17975. Γöé                  Γöé                    Γöé(x-axis)-by-200       Γöé
  17976. Γöé                  Γöé                    Γöécoordinates (y-axis), Γöé
  17977. Γöé                  Γöé                    Γöéthen the picture is   Γöé
  17978. Γöé                  Γöé                    Γöétransformed to a      Γöé
  17979. Γöé                  Γöé                    Γöéscreen area of the    Γöé
  17980. Γöé                  Γöé                    Γöésame size.            Γöé
  17981. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17982. ΓöéMetric units      ΓöéThe coordinates thatΓöéThe lower-left corner Γöé
  17983. Γöé                  Γöéproduce the correct Γöéof the presentation   Γöé
  17984. Γöé                  Γöématrix for the      Γöépage maps to the      Γöé
  17985. Γöé                  Γöéphysical spacing of Γöélower-left corner of  Γöé
  17986. Γöé                  Γöéthe pels.           Γöéthe device space.     Γöé
  17987. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  17988. ΓöéArbitrary units   ΓöéThe default size forΓöéThe page viewport is  Γöé
  17989. Γöé                  Γöéthe device is used. Γöéconstructed such that Γöé
  17990. Γöé                  ΓöéFor a plotter or    Γöéthe presentation-page Γöé
  17991. Γöé                  Γöéprinter, this is theΓöécoordinates give equalΓöé
  17992. Γöé                  Γöémaximum accessible  Γöéx- and y-spacing. The Γöé
  17993. Γöé                  Γöéarea of the paper,  Γöélower-left corner of  Γöé
  17994. Γöé                  Γöéand for a screen, itΓöéthe presentation page Γöé
  17995. Γöé                  Γöéis the maximized    Γöémaps to the lower-leftΓöé
  17996. Γöé                  Γöéwindow size.        Γöécorner of the device  Γöé
  17997. Γöé                  Γöé                    Γöéspace, and either the Γöé
  17998. Γöé                  Γöé                    Γöéright or the top edgesΓöé
  17999. Γöé                  Γöé                    Γöémap, such that the    Γöé
  18000. Γöé                  Γöé                    Γöépicture is contained  Γöé
  18001. Γöé                  Γöé                    Γöéwithin the device     Γöé
  18002. Γöé                  Γöé                    Γöérectangle and its     Γöé
  18003. Γöé                  Γöé                    Γöéaspect ratio is       Γöé
  18004. Γöé                  Γöé                    Γöépreserved.            Γöé
  18005. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  18006. The following figure shows mapping from the presentation page to the device. 
  18007.  
  18008. The device transformation can be explicitly specified using GpiSetPageViewport. 
  18009.  
  18010. Mapping a Picture from the Presentation Page to the Device 
  18011.  
  18012. In this example, a map of the world has been drawn in a presentation page, 
  18013. defined in arbitrary units, that is much larger than the device space. The 
  18014. device transformation scales the picture to fit the maximized window size and 
  18015. preserves its aspect ratio. 
  18016.  
  18017.  
  18018. ΓòÉΓòÉΓòÉ 17.4.7.4. Coding the Device Transformation ΓòÉΓòÉΓòÉ
  18019.  
  18020. The PM programming interface automatically transforms the presentation-page 
  18021. contents to the area of the device space within the page viewport. The drawing 
  18022. is not clipped to the page viewport because this is a scaling transformation 
  18023. only. The entire picture is displayed, regardless of the size of the page 
  18024. viewport specified. The following figure shows the airplane presentation-page 
  18025. contents scaled to fit the page viewport. 
  18026.  
  18027. Device Space 
  18028.  
  18029. A page viewport smaller than the presentation page has been defined. The 
  18030. picture assembled in the presentation page is therefore scaled to fit the page 
  18031. viewport. 
  18032.  
  18033. After transformation to device space, graphics coordinates must be in the range 
  18034. -32768 through +32767, even if the presentation page is defined in GPIF_LONG 
  18035. format. An attempt to address a coordinate outside this range results in a 
  18036. coordinate-overflow error. To determine if a graphics object will give an 
  18037. error, applications can do the following: 
  18038.  
  18039. o If the application is not rotating or shearing a graphics object, it calls 
  18040.   GpiConvert to convert the device-space limits to world-coordinate-space 
  18041.   limits, then uses these limits when creating the graphics object. 
  18042.  
  18043. o If the application is rotating or shearing a graphics object, it uses 
  18044.   GpiConvert to convert the device-space limits back to model space, and 
  18045.   ensures that the picture boundary is inside these limits. Note that this 
  18046.   method only applies if all rotational and shearing is performed using 1 of 
  18047.   the model transformation types. 
  18048.  
  18049. Remember that world-coordinate space has its own limits: 
  18050.  
  18051. o -32768 through +32767 for a GPIF_SHORT-format presentation page 
  18052.  
  18053. o -134217728 through +134217727 for a GPIF_LONG-format presentation page. 
  18054.  
  18055. Although applications can specify a page viewport of any size, the presentation 
  18056. page can be mapped only to an area equal to, or less than, the available device 
  18057. space. If an application specifies a viewport larger than the available device 
  18058. space, part of the presentation page contents are displayed outside the visible 
  18059. device output area. To find out the dimensions of the page viewport for the 
  18060. currently associated device, use GpiQueryPageViewport. Applications can store 
  18061. the dimensions of the current page viewport before changing them, and restore 
  18062. them later. 
  18063.  
  18064.  
  18065. ΓòÉΓòÉΓòÉ 17.4.7.5. Device-Transformation Matrix ΓòÉΓòÉΓòÉ
  18066.  
  18067. To directly manipulate the device-transformation matrix it is necessary for 
  18068. applications to know the following values: 
  18069.  
  18070. X1   the x-coordinate of the lower-left corner of the page viewport 
  18071.  
  18072. Y1   the y-coordinate of the lower-left corner of the page viewport 
  18073.  
  18074. X2   the x-coordinate of the upper-right corner of the page viewport 
  18075.  
  18076. Y2   the y-coordinate of the upper-right corner of the page viewport 
  18077.  
  18078. XPS  the presentation-space width -1 
  18079.  
  18080. YPS  the presentation-space height -1. 
  18081.  
  18082. The device-transformation matrix is defined as: 
  18083.  
  18084.   ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  18085.   Γöé  The device-transformation matrix: Γöé  where:                      Γöé
  18086.   Γöé  Γöî                 ΓöÉ               Γöé                              Γöé
  18087.   Γöé  Γöé Msub11  0     0 Γöé               Γöé a = (Xsub2-Xsub1)/(Xps+1)    Γöé
  18088.   Γöé  Γöé  0     Msub22 0 Γöé               Γöé                              Γöé
  18089.   Γöé  Γöé Msub31 Msub32 1 Γöé               Γöé b = (Ysub2-Ysub1)/(Yps+1)    Γöé
  18090.   Γöé  Γöö                 Γöÿ               Γöé                              Γöé
  18091.   Γöé                                    Γöé c = Xsub1+(a-1)/2            Γöé
  18092.   Γöé                                    Γöé                              Γöé
  18093.   Γöé                                    Γöé d = Ysub1+(b-1)/2            Γöé
  18094.   Γöé                                    Γöé                              Γöé
  18095.   ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  18096.  
  18097.  
  18098. ΓòÉΓòÉΓòÉ 17.4.8. Windowing-System Transformation ΓòÉΓòÉΓòÉ
  18099.  
  18100. There is 1 transformation, the windowing-system transformation, performed 
  18101. automatically by the PM programming interface. The windowing-system 
  18102. transformation, which is a translation transformation only, maps the 
  18103. coordinates of the picture in device space to the coordinates of the screen 
  18104. window or printer page. This happens when a picture is first drawn, and 
  18105. whenever the display window in which the picture has been drawn is moved. 
  18106.  
  18107.  
  18108. ΓòÉΓòÉΓòÉ 17.4.9. Transforming Bit-Map Data ΓòÉΓòÉΓòÉ
  18109.  
  18110. In general, graphics defined in device coordinates (bit maps and image 
  18111. primitives) cannot be transformed. For example, the size of an image primitive 
  18112. is specified in device coordinates, and cannot be altered. The size, therefore, 
  18113. remains unaltered down the viewing pipeline. The position of an image 
  18114. primitive, however, is specified in world coordinates. The image is therefore 
  18115. subject to translation transformations. Note, however, that GpiWCBitBlt permits 
  18116. the target rectangle to be specified in world coordinates, which are 
  18117. transformed. 
  18118.  
  18119. Because the position of the image primitive is specified in world coordinates 
  18120. and its width is specified in device coordinates, positioning 2 images together 
  18121. on the screen causes special difficulties. The second image cannot be 
  18122. positioned without knowing the width, in world coordinates, of the first image. 
  18123. To get the width of the first image: 
  18124.  
  18125.  1. Identify 2 coordinate positions, 1 on the image's left edge, and 1 on its 
  18126.     right edge. For example, the 2 positions could be (10,80) and (150,80). 
  18127.     These positions are in device coordinates. 
  18128.  
  18129.  2. Convert these device coordinates to world coordinates using GpiConvert. 
  18130.     GpiConvert converts an array of (x,y) coordinates that apply in 1 
  18131.     coordinate space to their corresponding values in another coordinate space. 
  18132.  
  18133.  3. Subtract the lower x-coordinate from the higher x-coordinate. In the above 
  18134.     example, the width of the image is the difference between the 
  18135.     world-coordinate equivalents of 150 and 10. 
  18136.  
  18137. When you have the width of the first image in world coordinates, you can 
  18138. calculate the start position of the second image. 
  18139.  
  18140. Paths, although defined in world coordinates, are device-dependent and are 
  18141. bound in device coordinates when they are defined. Subsequent transformations 
  18142. (other than the windowing-system transformation) have no effect on paths. 
  18143. However, if a path is used to create a wide line, the width of the line is 
  18144. scaled as required. 
  18145.  
  18146.  
  18147. ΓòÉΓòÉΓòÉ 17.5. Using Coordinate Spaces and Transformations ΓòÉΓòÉΓòÉ
  18148.  
  18149. This section explains how to: 
  18150.  
  18151. o Set an application's drawing units to convenient units 
  18152. o Translate, rotate, and scale a picture 
  18153. o Shear a picture. 
  18154.  
  18155.  
  18156. ΓòÉΓòÉΓòÉ 17.5.1. Setting Drawing Units ΓòÉΓòÉΓòÉ
  18157.  
  18158. Applications can use GpiCreatePS to set the device transformation so that it 
  18159. uses page units that might be more convenient than pels; for example, 
  18160. centimeters. If the output device is a screen, the application first opens a 
  18161. device context by calling WinOpenWindowDC. If the output device is a printer or 
  18162. plotter, the application opens a printer or plotter device context by calling 
  18163. DevOpenDC. The application then creates a presentation space by calling 
  18164. GpiCreatePS, specifying low-metric page units and associating the device 
  18165. context with the presentation space. The following figure is an example of how 
  18166. to set drawing units. 
  18167.  
  18168.  
  18169.     HWND hwnd;                    /* Client-window handle         */
  18170.     HAB hab;                      /* Anchor-block handle          */
  18171.     HPS hps;                      /* Presentation-space handle    */
  18172.     HDC hdc;                      /* Device-context handle        */
  18173.     SIZEL sizlPage;               /* Presentation-page rectangle  */
  18174.  
  18175.     hdc = WinOpenWindowDC(hwnd);
  18176.     sizlPage.cx = 0;
  18177.     sizlPage.cy = 0;
  18178.     hps = GpiCreatePS(hab,        /* Anchor-block handle          */
  18179.           hdc,                    /* Device-context handle        */
  18180.           &sizlPage,              /* Address of SIZEL structure   */
  18181.           PU_LOMETRIC             /* Centimeters as page units    */
  18182.           | GPIA_ASSOC);          /* Associates window DC with PS */
  18183.  
  18184.  
  18185. Setting Drawing Units 
  18186.  
  18187.  
  18188. ΓòÉΓòÉΓòÉ 17.5.2. Translating, Rotating, and Scaling a Picture ΓòÉΓòÉΓòÉ
  18189.  
  18190. GpiTranslate, GpiRotate, and GpiScale provide a convenient method for 
  18191. transforming objects in a picture. The following figure shows how to use these 
  18192. functions to translate, rotate, and scale a triangle. 
  18193.  
  18194.     MATRIXLF matlfTransform;
  18195.     POINTL ptlStart, ptlTrans, ptlRotate, ptlScale;
  18196.     FIXED fxAngle, afxScale[2];
  18197.     POINTL aptlTriangle[] = { 575, 300, 575, 500, 500, 300 };
  18198.  
  18199.     ptlStart.x = 500;                      /* Starting point x direction   */
  18200.     ptlStart.y = 300;                      /* Starting point y direction   */
  18201.     GpiMove(hps, &ptlStart);
  18202.     GpiPolyLine(hps, sizeof(aptlTriangle) / sizeof(POINTL), aptlTriangle);
  18203.  
  18204.     ptlTrans.x = 75;                       /* x coordinate for translation */
  18205.     ptlTrans.y = 75;                       /* y coordinate for translation */
  18206.  
  18207.     GpiTranslate(hps,                      /* Presentation-space handle    */
  18208.         &matlfTransform,                   /* Address of matrix            */
  18209.         TRANSFORM_REPLACE,                 /* Replace old matrix with new  */
  18210.         &ptlTrans);                        /* Coordinates for translation  */
  18211.  
  18212.     GpiSetModelTransformMatrix(hps,        /* Presentation-space handle    */
  18213.         9,                                 /* Number of points in matrix   */
  18214.         &matlfTransform,                   /* Address of matrix            */
  18215.         TRANSFORM_REPLACE);                /* Replace old matrix with new  */
  18216.  
  18217.     GpiMove(hps, &ptlStart);               /* Move to starting point       */
  18218.     GpiPolyLine(hps, sizeof(aptlTriangle) / sizeof(POINTL), aptlTriangle);
  18219.  
  18220.     fxAngle = MAKEFIXED(-45, 0);           /* Rotate 45 degrees clockwise  */
  18221.     ptlRotate.x = 550;                     /* x coordinate rotation origin */
  18222.     ptlRotate.y = 350;                     /* y coordinate rotation origin */
  18223.  
  18224.     GpiRotate(hps,                         /* Presentation-space handle    */
  18225.         &matlfTransform,                   /* Address of matrix            */
  18226.         TRANSFORM_REPLACE,                 /* Replace old matrix with new  */
  18227.         fxAngle,                           /* Rotation angle               */
  18228.         &ptlRotate);                       /* Origin of rotation           */
  18229.  
  18230.     GpiSetModelTransformMatrix(hps, 9, &matlfTransform, TRANSFORM_REPLACE);
  18231.  
  18232.     GpiMove(hps, &ptlStart);               /* Move to starting point       */
  18233.     GpiPolyLine(hps, sizeof(aptlTriangle) / sizeof(POINTL), aptlTriangle);
  18234.  
  18235.     ptlScale.x = 550;                      /* x coordinate scale origin    */
  18236.     ptlScale.y = 350;                      /* y coordinate scale origin    */
  18237.     afxScale[0] = MAKEFIXED(2, 0);         /* Scaling factor on x axis     */
  18238.     afxScale[1] = MAKEFIXED(2, 0);         /* Scaling factor on y axis     */
  18239.  
  18240.     GpiScale(hps,                          /* Presentation-space handle    */
  18241.         &matlfTransform,                   /* Address of matrix            */
  18242.         TRANSFORM_REPLACE,                 /* Replace old matrix with new  */
  18243.         &afxScale[0],                      /* Scaling factor               */
  18244.         &ptlScale);                        /* Origin of scaling operation  */
  18245.  
  18246.     GpiSetModelTransformMatrix(hps, 9, &matlfTransform, TRANSFORM_REPLACE);
  18247.  
  18248.     GpiMove(hps, &ptlStart);               /* Move to starting point       */
  18249.     GpiPolyLine(hps, sizeof(aptlTriangle) / sizeof(POINTL), aptlTriangle);
  18250.  
  18251. Translating, Rotating, and Scaling a Triangle 
  18252.  
  18253.  
  18254. ΓòÉΓòÉΓòÉ 17.5.3. Shearing a Picture ΓòÉΓòÉΓòÉ
  18255.  
  18256. The following figure is an example of shearing a picture by modifying the 
  18257. transformation matrix directly. 
  18258.  
  18259.  
  18260.    MATRIXLF matlfTransform;
  18261.    POINTL ptlStart, ptlEnd;
  18262.  
  18263.    ptlStart.x = 500;          /* x coordinate, lower-left corner of box   */
  18264.    ptlStart.y = 300;          /* y coordinate, lower-left corner of box   */
  18265.    GpiMove(hps, &ptlStart);
  18266.    ptlEnd.x = 700;      ;     /* x coordinate, upper-right corner of box  */
  18267.    ptlEnd.y = 500;      ;     /* y coordinate, upper-right corner of box  */
  18268.    GpiBox(hps, DRO_OUTLINE, &ptlEnd, 0, 0);  /* Draw first box            */
  18269.  
  18270.     matlfTransform.fxM11 = MAKEFIXED(1, 0);
  18271.     matlfTransform.fxM12 = MAKEFIXED(0, 0);
  18272.     matlfTransform.lM13 = 0;
  18273.     matlfTransform.fxM21 = MAKEFIXED(0, 65536 / 2);  /* Shear factor .5   */
  18274.     matlfTransform.fxM22 = MAKEFIXED(1, 0);
  18275.     matlfTransform.lM23 = 0;
  18276.     matlfTransform.lM31 = 200;               /* Translate 200 units right */
  18277.     matlfTransform.lM32 = 0;
  18278.     matlfTransform.lM33 = 1;
  18279.     GpiSetDefaultViewMatrix(hps, 9, &matlfTransform, TRANSFORM_REPLACE);
  18280.  
  18281.     GpiMove(hps, &ptlStart);
  18282.     GpiBox(hps, DRO_OUTLINE, &ptlEnd, 0, 0); /* Draw sheared box          */
  18283.  
  18284.  
  18285. Shearing a Picture 
  18286.  
  18287.  
  18288. ΓòÉΓòÉΓòÉ 17.5.4. Using World to Model Space Transformations ΓòÉΓòÉΓòÉ
  18289.  
  18290. The following is an example of a sequence of calls in which segment, model, and 
  18291. instance transformations are applied to graphics objects. 
  18292.  
  18293. GpiSetDrawingMode (DM_RETAIN)   /* Sets the current drawing mode        */
  18294.                                 /* to DM_RETAIN                         */
  18295.  
  18296. GpiOpenSegment (segment 1)      /* Creates a chained segment            */
  18297.  
  18298. GpiCloseSegment
  18299. GpiSetSegmentAttrs              /* Make segment 1 an unchained segment  */
  18300.  
  18301. GpiOpenSegment (segment 2)      /* Creates a retained, chained segment  */
  18302.  
  18303. GpiSetModelTransformMatrix (TRANSFORM_ADD)
  18304.                                 /* Specifies a transformation to        */
  18305.                                 /* apply to subsequent primitives.      */
  18306.                                 /* This is in addition to the current   */
  18307.                                 /* model transformation.                */
  18308.  
  18309. GpiCallSegmentMatrix (1, TRANSFORM_ADD)
  18310.                                 /* Calls segment 1 and applies a        */
  18311.                                 /* transformation to it.                */
  18312.                                 /* This transformation is in addition   */
  18313.                                 /* to the current model transformation, */
  18314.                                 /* and applies only to the called       */
  18315.                                 /* segment.                             */
  18316.    .
  18317.    .
  18318. GpiSetCurrentArcParams
  18319. GpiPointArc                     /* The 3-point arc is not subject       */
  18320.                                 /* to the transformation specified      */
  18321.                                 /* on the call to GpiCallSegmentMatrix. */
  18322.                                 /* The transformation that was          */
  18323.                                 /* current before segment 1 was called  */
  18324.                                 /* is applied to the remainder of       */
  18325.                                 /* segment 2.                           */
  18326.  
  18327. GpiCloseSegment
  18328. GpiSetSegmentTransformMatrix (segment 2)
  18329.                                 /* Specifies a segment transformation   */
  18330.                                 /* for segment 2                        */
  18331.  
  18332. GpiDrawSegment                  /* Draws segment 2                      */
  18333.  
  18334.  
  18335. Using World-to-Model Transformations 
  18336.  
  18337.  
  18338. ΓòÉΓòÉΓòÉ 17.5.5. Viewing Transformation ΓòÉΓòÉΓòÉ
  18339.  
  18340. Each time an application draws the model space, it specifies a different 
  18341. viewing transformation to transfer a view of the picture-to-page coordinate 
  18342. space. GpiSetViewingTransformMatrix is used to apply a viewing transformation. 
  18343. There is one viewing transformation for each part or whole model space to be 
  18344. incorporated in page-coordinate space. 
  18345.  
  18346. GpiSetViewingTransformMatrix cannot be called while there is an open segment, 
  18347. and it has no effect on primitives outside segments. When it has been 
  18348. specified, the viewing transformation applies to all subsequently created 
  18349. segments until it is next changed. The viewing transformation that is current 
  18350. when a segment is created is a fixed part of the segment. Once specified, the 
  18351. viewing transformation cannot be queried, nor can it be altered, unless you 
  18352. re-create the segment. This is inconvenient when several versions of the same 
  18353. picture are being drawn. The problem can be solved by: 
  18354.  
  18355. o Defining the picture in one or more unchained segments. 
  18356.  
  18357. o Creating a segment chain and calling the unchained segments from each root 
  18358.   segment. 
  18359.  
  18360. o Setting the viewing transformation before each root segment. 
  18361.  
  18362. Each time the segment chain is drawn, multiple views of the same picture are 
  18363. produced. This sequence is illustrated in the following example, where the 
  18364. segment chain comprises 3 root segments, each of which calls a single unchained 
  18365. segment. 
  18366.  
  18367. GpiSetInitialSegmentAttrs      /* Switches off the chained attribute   */
  18368.  
  18369. GpiOpenSegment                 /* Creates an unchained segment         */
  18370.                                /* containing the picture definition    */
  18371.  
  18372. GpiCloseSegment
  18373. GpiSetInitialSegmentAttrs      /* Switches on the chained attribute    */
  18374.  
  18375. GpiSetViewingTransformMatrix   /* Sets the viewing transformation      */
  18376.                                /* for segment 1                        */
  18377.  
  18378. GpiOpenSegment (segment 1)
  18379. GpiCallSegmentMatrix           /* Calls the unchained segment          */
  18380.  
  18381. GpiCloseSegment
  18382. GpiSetViewingTransformMatrix   /* Sets the viewing transformation      */
  18383.                                /* for segment 2                        */
  18384.  
  18385. GpiOpenSegment (segment 2)
  18386. GpiSetViewingLimits            /* Specifies the area of interest       */
  18387.                                /* in the model space.                  */
  18388.  
  18389. GpiCallSegmentMatrix           /* Calls the unchained segment          */
  18390.  
  18391. GpiCloseSegment
  18392. GpiSetViewingTransformMatrix   /* Sets the viewing transformation      */
  18393.                                /* for segment 3                        */
  18394.  
  18395. GpiOpenSegment (segment 3)
  18396. GpiCallSegmentMatrix           /* Calls the unchained segment          */
  18397. GpiCloseSegment
  18398.  
  18399.  
  18400. Using Viewing Transformations 
  18401.  
  18402. When a segment chain has been created using this method, an application cannot 
  18403. change the viewing transformation unless it re-creates the segment chain. The 
  18404. viewing transformation of a segment is permanently recorded and cannot be 
  18405. edited. The application would not, however, have to re-create the picture 
  18406. definition in the unchained segment. 
  18407.  
  18408. If the picture definition comprises a number of unchained segments, an 
  18409. application must create an intermediate segment to contain the 
  18410. GpiCallSegmentMatrix calls for those segments. Each root segment would then 
  18411. call the intermediate segment. 
  18412.  
  18413. The viewing transformation applies to the entire root segment and cannot be 
  18414. overridden from within the segment. It is particularly useful for positioning 
  18415. and scaling 1 or more segments of a subpicture within the presentation page 
  18416. when a segment transformation cannot be used. A segment transformation can be 
  18417. overridden by any model or instance transformations within the segment. A 
  18418. typical example of its use is when importing a subpicture using GpiPutData or 
  18419. GpiPlayMetaFile. 
  18420.  
  18421. Note:  The viewing transformation must be set to its default value before an 
  18422.        application defines an unchained segment to be called from another 
  18423.        segment. 
  18424.  
  18425.  
  18426. ΓòÉΓòÉΓòÉ 17.6. Summary ΓòÉΓòÉΓòÉ
  18427.  
  18428. The following table summarizes the functions used with coordinate spaces and 
  18429. transformations. 
  18430.  
  18431. Coordinate-Space and Transformation Functions 
  18432.  
  18433. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  18434. ΓöéFunction Name                   ΓöéDescription                 Γöé
  18435. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18436. ΓöéGpiCallSegmentMatrix            ΓöéApplies an instance         Γöé
  18437. Γöé                                Γöétransformation.             Γöé
  18438. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18439. ΓöéGpiConvert                      ΓöéTransforms an array of      Γöé
  18440. Γöé                                Γöépoints from one coordinate  Γöé
  18441. Γöé                                Γöéspace to another.           Γöé
  18442. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18443. ΓöéGpiConvertWithMatrix            ΓöéTransforms an array of      Γöé
  18444. Γöé                                Γöépoints using a specified setΓöé
  18445. Γöé                                Γöéof transformation matrix    Γöé
  18446. Γöé                                Γöévalues.                     Γöé
  18447. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18448. ΓöéGpiCreatePS                     ΓöéDefines presentation page   Γöé
  18449. Γöé                                Γöésize and initial page       Γöé
  18450. Γöé                                Γöéviewport.                   Γöé
  18451. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18452. ΓöéGpiQueryDefaultViewMatrix       ΓöéDetermines the current      Γöé
  18453. Γöé                                Γöévalues for the default      Γöé
  18454. Γöé                                Γöéviewing transformation.     Γöé
  18455. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18456. ΓöéGpiQueryModelTransformMatrix    ΓöéDetermines the values for   Γöé
  18457. Γöé                                Γöéthe current model           Γöé
  18458. Γöé                                Γöétransformation.             Γöé
  18459. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18460. ΓöéGpiQueryPageViewport            ΓöéDetermines the coordinates  Γöé
  18461. Γöé                                Γöéof the current page         Γöé
  18462. Γöé                                Γöéviewport.                   Γöé
  18463. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18464. ΓöéGpiQuerySegmentTransformMatrix  ΓöéDetermines the values for   Γöé
  18465. Γöé                                Γöéthe current segment         Γöé
  18466. Γöé                                Γöétransformation.             Γöé
  18467. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18468. ΓöéGpiQueryViewingTransformMatrix  ΓöéDetermines the current      Γöé
  18469. Γöé                                Γöévalues for the viewing      Γöé
  18470. Γöé                                Γöétransformation.             Γöé
  18471. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18472. ΓöéGpiRotate                       ΓöéGenerates a transformation  Γöé
  18473. Γöé                                Γöématrix to perform rotation  Γöé
  18474. Γöé                                Γöéby a given number of        Γöé
  18475. Γöé                                Γöédegrees.                    Γöé
  18476. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18477. ΓöéGpiScale                        ΓöéGenerates a transformation  Γöé
  18478. Γöé                                Γöématrix to scale by a given  Γöé
  18479. Γöé                                Γöéscaling factor.             Γöé
  18480. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18481. ΓöéGpiSetDefaultViewMatrix         ΓöéDefines the default viewing Γöé
  18482. Γöé                                Γöétransformation values.      Γöé
  18483. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18484. ΓöéGpiSetModelTransformMatrix      ΓöéDefines the model           Γöé
  18485. Γöé                                Γöétransformation attribute    Γöé
  18486. Γöé                                Γöévalues, the values to be    Γöé
  18487. Γöé                                Γöéstored in a retained        Γöé
  18488. Γöé                                Γöésegment, or both.           Γöé
  18489. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18490. ΓöéGpiSetPageViewport              ΓöéSets page viewport size and Γöé
  18491. Γöé                                Γöéorigin.                     Γöé
  18492. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18493. ΓöéGpiSetSegmentTransformMatrix    ΓöéDefines the segment         Γöé
  18494. Γöé                                Γöétransformation values to be Γöé
  18495. Γöé                                Γöéstored in a specified       Γöé
  18496. Γöé                                Γöéretained segment.           Γöé
  18497. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18498. ΓöéGpiSetViewingLimits             ΓöéDefines the viewing window. Γöé
  18499. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18500. ΓöéGpiSetViewingTransformMatrix    ΓöéDefines the values of the   Γöé
  18501. Γöé                                Γöéviewing transformation      Γöé
  18502. Γöé                                Γöématrix.                     Γöé
  18503. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18504. ΓöéGpiTranslate                    ΓöéGenerates a transformation  Γöé
  18505. Γöé                                Γöématrix to translate by a    Γöé
  18506. Γöé                                Γöégiven horizontal value,     Γöé
  18507. Γöé                                Γöévertical value, or both.    Γöé
  18508. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  18509.  
  18510. The following table summarizes the data structures used to manipluate 
  18511. coordinate spaces and transformations. 
  18512.  
  18513. Coordinate-Space and Transformation Structure 
  18514.  
  18515. ΓöîΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö¼ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÉ
  18516. ΓöéStructure Name          ΓöéDescription                         Γöé
  18517. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18518. ΓöéMATRIXLF                ΓöéThe values of the transformation    Γöé
  18519. Γöé                        Γöématrix.                             Γöé
  18520. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18521. ΓöéRECTL                   ΓöéThe values of the page viewport.    Γöé
  18522. Γö£ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö╝ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöñ
  18523. ΓöéSIZEL                   ΓöéThe presentation page dimensions.   Γöé
  18524. ΓööΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓö┤ΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÇΓöÿ
  18525.  
  18526.  
  18527. ΓòÉΓòÉΓòÉ 18. Print Job Submission and Manipulation ΓòÉΓòÉΓòÉ
  18528.  
  18529. The print subsystem of the OS/2 operating system provides a flexible, 
  18530. high-level interface between your application and an output device.  Because 
  18531. most of the internal workings of the subsystem are shielded from both user and 
  18532. programmer, this chapter concentrates on the programming process required to 
  18533. produce hardcopy output.  Querying of printer resources, working under a 
  18534. specific user's environment, designing for application-specific requirements, 
  18535. and manipulation of print jobs also are described. 
  18536.  
  18537.  
  18538. ΓòÉΓòÉΓòÉ 18.1. About the Print Subsystem Components ΓòÉΓòÉΓòÉ
  18539.  
  18540. The print subsystem comprises the following software components of the 
  18541. operating system: 
  18542.  
  18543. o Spooler 
  18544. o Print subsystem user interface 
  18545. o Queue drivers (queue processors) 
  18546. o Printer drivers 
  18547. o File system 
  18548. o Kernel device drivers. 
  18549.  
  18550.  
  18551. ΓòÉΓòÉΓòÉ 18.1.1. Spooler ΓòÉΓòÉΓòÉ
  18552.  
  18553. The spooler is the central coordinating process for the print subsystem.  It 
  18554. gives the user flexibility in organizing and optimizing the use of the system's 
  18555. printers. The spooler has a global view of the system's printing resources, 
  18556. particularly in a server environment; and, therefore, is able to make the best 
  18557. use of those resources, as follows: 
  18558.  
  18559. o Print output from two separately executing applications cannot be intermixed 
  18560.   on the printer.  As an optional optimization, the spooler can start a 
  18561.   printing job before it is completely queued.  Any successive jobs are queued 
  18562.   normally. 
  18563.  
  18564. o The spooler can print a job in the background while the user continues to use 
  18565.   the application.  Other single-tasking operating systems, such as DOS, 
  18566.   require the user to wait until the print output is sent completely to the 
  18567.   printer. 
  18568.  
  18569. o The spooler can send jobs from PM applications, across a network, to a remote 
  18570.   server, without the application's knowledge. 
  18571.  
  18572.   Note:  The file system handles print jobs from non-PM applications. 
  18573.  
  18574. o Queues within the spooler can be used for various purposes.  For example, one 
  18575.   queue can be used for large print jobs that are printed at times when print 
  18576.   demand is low.  Or a queue can be configured to print jobs using a special 
  18577.   size paper; print jobs on this queue would be held until the correct paper is 
  18578.   loaded into the printer. 
  18579.  
  18580. o The spooler can support a number of printers simultaneously.  It can be 
  18581.   configured so that jobs on a single queue can be shared among all the 
  18582.   printers.  This load balancing, which is particularly important in server 
  18583.   environments, can be achieved without the application's knowledge. 
  18584.  
  18585. o Jobs can be prioritized while in the queue. For example, an urgent job can be 
  18586.   given a higher priority than ordinary jobs. 
  18587.  
  18588. The spooler consists of one or more print queues; one for each printer object 
  18589. defined by the user.  Jobs are created by applications and placed in a queue, 
  18590. waiting to print.  When the previous job is completed, the next job in the 
  18591. queue is sent to the printer. 
  18592.  
  18593.  
  18594. ΓòÉΓòÉΓòÉ 18.1.1.1. Print Job Formats ΓòÉΓòÉΓòÉ
  18595.  
  18596. The print jobs held in a spooler queue are known as spool files.  Spool files 
  18597. contain the following: 
  18598.  
  18599. o Parameters submitted with the print job 
  18600. o Print job data. 
  18601.  
  18602. Print job data is in one of two formats: 
  18603.  
  18604. PM_Q_STD       Standard output data, PM_Q_STD, is spooled as a PM metafile; 
  18605.                that is, as a series of graphics orders stored in a packed 
  18606.                binary format.  PM_Q_STD print jobs are created through the GPI. 
  18607.  
  18608.                An advantage of the PM_Q_STD format is that the files are 
  18609.                smaller than PM_Q_RAW format files.  The smaller size saves disk 
  18610.                space for jobs in the spooler queue and reduces network traffic 
  18611.                when transmitting the data to a network server. 
  18612.  
  18613.                The content of PM_Q_STD jobs can be viewed using the PICVIEW 
  18614.                application.  This is achieved using the job-content menu on a 
  18615.                print job in the printer object.  The multi-page spool file can 
  18616.                be shown in a device-independent manner so that the content of 
  18617.                the job can be recognized easily. 
  18618.  
  18619.                After a job is spooled and ready to print, the spooler sends the 
  18620.                PM_Q_STD job to the queue driver. The queue driver replays the 
  18621.                metafile, through the GPI, to the appropriate printer driver. 
  18622.                The driver, in turn, converts the data to printer-specific 
  18623.                commands, that is, a printer-specific format. 
  18624.  
  18625.                There are some restrictions on the content of PM_Q_STD jobs that 
  18626.                are related to the restrictions for PM metafiles.  For details, 
  18627.                refer to the Presentation Manager Programming Reference, Volume 
  18628.                III, Appendix G.  PM applications that cannot deal with these 
  18629.                restrictions should enqueue print jobs using PM_Q_RAW, but there 
  18630.                is an increase in required disk space and, possibly, network 
  18631.                traffic. 
  18632.  
  18633.                Print jobs sent to network servers that do not support PM are 
  18634.                converted automatically to the PM_Q_RAW format by the system. 
  18635.                The application still can continue specifying PM_Q_STD. 
  18636.  
  18637.                Note:  The effect of converting all PM_Q_STD print jobs to 
  18638.                       PM_Q_RAW can be turned on by the user's selecting 
  18639.                       Printer-specific format in a printer object settings 
  18640.                       page. 
  18641.  
  18642. PM_Q_RAW       Raw data, PM_Q_RAW, is the actual printer command to print the 
  18643.                job.  For example, raw data created for an HP** LaserJet** 
  18644.                printer contains Printer Command Language (PCL) commands; and 
  18645.                raw data created for a PostScript** printer contains PostScript 
  18646.                commands. 
  18647.  
  18648.                The content of PM_Q_RAW jobs can be viewed with the system 
  18649.                editor.  This is achieved using the job content menu on a print 
  18650.                job in the printer object.  However, it is not always easy to 
  18651.                recognize the content of a job.  For example PostScript is very 
  18652.                hard to understand and get a visual idea of the actual output. 
  18653.  
  18654.                Print jobs are created by the file system as a result of 
  18655.                printing directly to the physical port using either INT 17 or 
  18656.                INT 21 under DOS or the OS/2 DosOpen API.  These print jobs 
  18657.                always are queued using PM_Q_RAW.  The actual queue chosen 
  18658.                depends on the port used and the configuration of the print 
  18659.                subsystem.  See Submitting a Non-Presentation Manager (Base) 
  18660.                Print Job for more information. 
  18661.  
  18662.                PM applications also can use the PM_Q_RAW format, but the 
  18663.                overall print-job creation process normally is slower because 
  18664.                the printer driver has to perform more work to create the 
  18665.                printer-specific format. 
  18666.  
  18667.                If the Print while spooling printer object setting is turned on, 
  18668.                the user can perceive a faster response.  In particular for a 
  18669.                multi-page document, the first page starts printing as soon as 
  18670.                the printer driver has