GrWin Graphics Library Version 0.99.9b Copyright (C) 1998 - 2003 Tamaribuchi, Tsuguhiro tamari@spdg1.sci.shizuoka.ac.jp http://spdg1.sci.shizuoka.ac.jp/grwinlib/english/ Table of contents # Fortran C Function n 1. gwinit GWinit Initialize0 1. gwinitx GWinitx Initialize0 2. gwopen GWopen Open Window1 2. gwopenx GWopenx Open Window1 3. gwquit GWquit Quit0 3. gwquitx GWquitx Quit0 4. gwleave GWleave Leave0 5. gwjoin GWjoin Join in a Window0,2 6. gwreset GWreset Reset Parameters1 7. gwclose GWclose Close Window0 8. gwindow GWindow Set World Coordinate System0 9. gwgetwn GWgetwn Get World Coordinate System0 10. gwvport GWvport Set View Port0 11. gwport GWport Set View Port (in the world coordinate)0 12. gwgetvp GWgetvp Get View Port0 13. gwsavevp GWsavevp Save View Port Info0 14. gwselvp GWselvp Select View Port0 15. gwfirst GWfirst Get Window / First0 16. gwnext GWnext Get Window / Next0 17. gwselect GWselect Select Window0 18. gwshowwn GWshowwn Set Window's Show State0 19. gwshowfr GWshowfr Set Frame's Show State0 20. gwarrange GWarrange Arrange Windows0 21. gwldcpos GWldcpos Get Position in LDCS0 22. gwldcsiz GWldcsiz Get Sise in LDCS0 23. gwpxlsiz GWpxlsiz Retrieve Pixel Sise in WCS0 24. gwsetpen GWsetpen Set Pen Attributes1 25. gwgetpen GWgetpen Get Pen Attributes0 26. gwsetbrs GWsetbrs Set Brush Attributes1 27. gwgetbrs GWgetbrs Get Brush Attributes0 28. gwsettxt GWsettxt Set Text Font Attributes1 29. gwgettxt GWgettxt Get Text Extent0 30. gwputtxt GWputtxt Draw Text String1 31. gwsetsym GWsetsym Set Symbol Font Attributes1 32. gwgetsym GWgetsym Get Symbol Extent0 33. gwputsym GWputsym Draw Symbol1 34. gwsetmsg GWsetmsg Status Bar0 35. msgbox* GWmsgbox Message Box0 36. gwgetpos GWgetpos Pen Position0 37. gwmove2 GWmove2 Move Pen1 38. gwline2 GWline2 Draw Line To1 39. gwline GWline Draw Line2 40. gwrect GWrect Draw Rectangle1 41. gwsrect GWsrect Draw Rectangle Filled with Solid Color1 42. gwrrect GWrrect Draw Round Rectangle1 43. gwellipse GWellipse Draw Ellipse1 44. gwarc GWarc Draw Arc1 45. gwchord GWchord Draw Closed Arc1 46. gwpie GWpie Draw Pie1 47. gwplot1 GWplot1 Plot 1D Array Elementsx 48. gwpolygon GWpolygon Draw Polygon1 49. gwpolylin GWpolylin Draw Line Segments1 50. gwbezier GWbezier Draw Bezier1 51. gwflood GWflood Fill Bounded Area1 52. gwclear GWclear Clear Window1 53. gwsetmrk GWsetmrk Set Mark Attributes1 54. gwputmrk GWputmrk Draw Mark1 55. gwgetmrk GWgetmrk Get Mark Attributes0 56. gwsetxfrm GWsetxfrm Set Transformation Matrix1 57. gwgetxfrm GWgetxfrm Get Transformation Matrix0 58. gwsetrgn GWsetrgn Set Clipping Region1 59. gwsetpxl GWsetpxl Set Pixel1 60. gwgetpxl GWgetpxl Get Pixel0 61. gwcolor GWcolor Set Color1 62. gwgetrgb GWgetrgb Get RGB0 63. krgb* GWkrgb Set RGB0 64. kcolor* GWkcolor Get COLORREF value0 65. ipalette* GWipalette Windows Palette0 66. gwncolor GWncolor Get Palette Number0 67. gwsavecc GWsavecc Save Custom Color0 68. gwloadcc GWloadcc Load Custom Color0 69. gwsysclr GWsysclr Get System Color0 70. gwcappnt GWcappnt Capture Point0 71. gwcapvec GWcapvec Capture Vector0 72. gwcaplin GWcaplin Capture Line0 73. gwcaprect GWcaprect Capture Rectangle0 74. gwloadbmp GWloadbmp Load Bitmap0 75. gwsavebmp GWsavebmp Save Bitmap0 76. gwmakebmp GWmakebmp Make Bitmap0 77. gwfnt2bmp GWfnt2bmp Make Bitmap0 78. gwsetbmp GWsetbmp Set Bitmap Attributes0 79. gwgetbmp GWgetbmp Get Bitmap Attributes0 80. gwputbmp GWputbmp Draw Bitmap1 81. gwcopybmp GWcopybmp Copy Stored Bitmap0 82. gwdelbmp GWdelbmp Delete Bitmap0 83. gwcapimg GWcapimg Capture Image0 84. gwclipimg GWclipimg Copy To Clipboard0 85. gwloadcmb GWloadcmb Load Metafile0 86. gwsavecmb GWsavecmb Save Combo as Combo File0 87. gwcmbmrk GWcmbmrk Create Mark as a Combo0 88. gwbegincmb GWbegincmb Begin Making a Combo0 89. gwendcmb GWendcmb End Making a Combo0 90. gwputcmb GWputcmb Draw Combo1 91. gwgetcmb GWgetcmb Get Attributes of Combo0 92. gwcopycmb GWcopycmb Copy Stored Combo0 93. gwdelcmb GWdelcmb Delete Combo0 94. gwinput GWinput Input String0 95. gwfiledlg GWfiledlg Popup File Dialog0 96. gwload GWload Load Data0 97. gwsaveas GWsaveas Save Data0 98. gwprint GWprint Print0 99. gwsetogn GWsetogn Set Object-Group Number0 100. gwanchor GWanchor Anchor1,-x 101. gwsetbk GWsetbk Set Backgroundx 102. gwerase GWerase Erase-x 103. gwflush GWflush Flushing-x 104. gwrefresh GWrefresh Refresh0 105. gwvwmod GWvwmod View Mode0 106. gwmode GWmode Setting and Inquiring Modes0 107. gwkybrd GWkybrd Get Keyboard Status On Window0 108. gwmouse GWmouse Get Mouse Status0 109. gwtimer GWtimer Interval Timer0 110. gwevent GWevent Get Event Status0 111. gwidle GWidle Idling0 112. gwidle2 GWidle2 Idling 20 113. gwsleep GWsleep Sleep1 114. gwsleep2 GWsleep2 Sleep 21 115. gwctime GWctime Get Current time0 116. gwpause GWpause Pause0 117. gwsize GWsize Get/Set Size0 118. gwaspect* GWaspect Get Aspect Ratio0 119. gwfmax* GWfmax Maximum value of Floating Point Numbers0 120. gwversion GWversion Get Version Numbers0 121. kbhit* kbhit Get Keyboard Status On Console0 122. kbgetch* kbgetch Get a Key Code On Console0 123. gwtspawn GWTspawn Tortoise: Create0 124. gwdtturn GWTturn Tortoise: Turn1 124. gwdtturn GWDTturn Tortoise: Turn1 125. gwdtforward GWTforward Tortoise: Move Forward1 125. gwdtforward GWDTforward Tortoise: Move Forward1 126. gwdtshift GWTshift Tortoise: Displace1 126. gwdtshift GWDTshift Tortoise: Displace1 127. gwdtmove2 GWTmove2 Tortoise: Move To1 127. gwdtmove2 GWDTmove2 Tortoise: Move To1 128. gwtclone GWTclone Tortoise: Copy0 129. gwtremove GWTremove Tortoise: Remove0 130. gwdtsetpos GWTsetpos Tortoise: Set Position1 130. gwdtsetpos GWDTsetpos Tortoise: Set Position1 131. gwdtgetpos GWTgetpos Tortoise: Get Position0 131. gwdtgetpos GWDTgetpos Tortoise: Get Position0 132. gwdtsetdir GWTsetdir Tortoise: Set Direction1 132. gwdtsetdir GWDTsetdir Tortoise: Set Direction1 133. gwdtgetdir GWTgetdir Tortoise: Get Direction0 133. gwdtgetdir GWDTgetdir Tortoise: Get Direction0 134. gwtsetcol GWTsetcol Tortoise: Set Color1 135. gwtgetcol GWTgetcol Tortoise: Get Color1 136. gwtsetpen GWTsetpen Tortoise: Set Pen Attributes1 137. gwdtsetmrk GWTsetmrk Tortoise: Set Mark Attributes1 137. gwdtsetmrk GWDTsetmrk Tortoise: Set Mark Attributes1 138. plots None Initialize (Calcomp compatible)0 139. plote None Quit (Calcomp compatible)0 140. plot None Draw Line To/Move Pen (Calcomp compatible)1 141. window None Set World Coordinate System (Calcomp compatible)0 142. newpen None New Pen (Calcomp compatible)1 143. symbol None Draw Character String (Calcomp compatible)1 144. number None Draw Numeric Value (Calcomp compatible)2 145. gcls None Erase Window (Calcomp compatible)0 grwnd.exe uses an internal coordinate system, the logical device coordinate system (LDCS), fixed on the entire drawing rectangle, the paper, defined on opening a window. In the LDCS, a point on the paper is specified by [u,v] with u to the right and v to the bottom from the origin at the top-left. On printing, the unit lengths in the LDCS are mapped to the unit pixel lengths of the printer. The normalized logical coordinate system (NLCS) is used to define a view port, a temporal drawing rectangle set inside the paper, by calling GWVPORT. The unit in the NLCS is determined by normalizing the width and the height of the paper in the LDCS with the same fraction to give the unit length of the shorter of the width and the height. The origin of the NLCS is at the bottom-left of the paper. The world coordinate system (WCS) is the user's coordinate system defined by calling GWINDOW to give the coordinates of the bottom-left and the top-right corners of the view port in this coordinate system. Almost all routines of the GrWin Library assume this world coordinate system. In each of the following items of this manual, [F] stands for a declaration in Fortarn, and [C] in C. In Fortran, there is no need to use capital letters as in the body of this manual below, since a capital letter and the corresponding small letter are not distinguished at all in Fortran except in character constants, and in contrast, of course, they are distinguished in C. As seen in the above table each of all subroutines and functions in Fortran except the last 8 routines (#138 .. #145) has the counterpart in C. Unless stated explicitly the first argument IRTN of each subroutine for Fortranhas a nonzero value if succeeded, and 0 otherwise, and is the same as the return value of the corresponding function in C. Output variables in the argument list of the Fortran counterpart are listed at "Output". In C any pointer argument for output, except those for GWsize, can be NULL if the output parameter is not used. The routines GWTxxxxx's are for the tortoise graphics (a.k.a. the turtle graphics). Also available, though not described here, are the GWDTxxxxx's, which are the double precision counterparts of the GWTxxxxx's. To use GWDTxxxxx's you must read REAL as REAL*8 or DOUBLE PRECISION for [F], and float as double for [C] in this manual. Those tortoise graphics routines maintain the world coordinate internally in real ( for GWTxxxxx's ) or in double precision ( for GWDTxxxxx's ) , accumulated errors in coordinates expected, in drawings using relative coordinates for example, to be very small, compared with other GWxxxxx routines, which internally maintain the logical device coordinate. The last 8 subroutines in the above table, which are written using GrWin intrinsic routines, GWxxxxx's, are for least compatibility to programs using Calcomp routines. There is no [C] counterparts for them as noted above. There is no problem if some of the routines for the tortoise graphics and/or the Calcomp compatible routines with some of the GrWin intrinsics are used in a program. The column 'n' stands for the number the object(s) created by the routine. The stored objects are used to redraw the window, etc. By using gwsaveas/GWsaveas or gwload/GWload the objects can be saved to a file or can be loaded from a file. Index sorted by Function is available at the end of this manual. GrWin Library Routines 1. Initialize ----------------------------------------------------------------------------- [F] SUBROUTINE GWINIT(IRTN) INTEGER IRTN [C] int GWinit(void); ----------------------------------------------------------------------------- Description Initializes the GrWin Library, and open the main frame window by executing grwnd.exe with no option if it has not yet been opened. This routine is equivalent to GWinitx(-1,-1,-1,-1,-1,-1,-1,-1,-1). Usually there is no need to call this routine because GWopen (or GWopenx) calls this automatically if necessary. ----------------------------------------------------------------------------- [F] SUBROUTINE GWINITX(IRTN, IRB, IX, IY, IW, IH, MA, MM, MZ, ND) INTEGER IRTN, IRB, IX, IY, IW, IH, MA, MM, MZ, ND [C] int GWinitx(int IRB, int IX, int IY, int IW, int IH, int MA, int MM, int MZ, int ND); ----------------------------------------------------------------------------- Description Initializes the GrWin Library, and open the main frame window by executing grwnd.exe with options corresponding to the arguments given. If a negative value is specified for an argument, no corresponding option is generated. Usually there is no need to call this routine because GWopen (or GWopenx) calls GWinitx(-1,-1,-1,-1,-1,-1,-1,-1,-1) automatically if necessary, unless you want to specify options. Input IRB = O*32 + L*16 + I*8 + R*4 + B*2 + T*1 + 65536*(o*32 + l*16 + i*8 + r*4 + b*2 + t*1) O = 1[0] the staying open on QUIT mode is set ON [OFF]. L = 1[0] the landscape printer mode is set ON [OFF]. I = 1[0] the inquring mode is set ON [OFF]. R = 1[0] the status bar is displayed [not displayed]. B = 1[0] the buffering mode is set ON [OFF]. T = 1[0] the storing mode is set ON [OFF]. [ l, i,... are the mask bits for the above setting switches L, I,..., respectively. A setting switch with the corresponding mask bit set 1 is ignored. ] IX, IY = Screen coordinates (in pixels) of the top-left corner of the frame IW, IH = Width and height (in pixels) of the frame MA = Mode number (MA = 1..4) for Arrange Window. [GWarrange(MA)] MM = Mode number (MM = 0..14) for Frame's Show State. [GWshowfr(MM)] MZ = Mode number (MZ = 1..4) for the Z-Order of the frame. [GWshowfr(MZ+10)] ND = The default dpi value for printing, etc. Output IRTN = return code [TOC] [INDEX] 2. Open Window ----------------------------------------------------------------------------- [F] SUBROUTINE GWOPEN(IRTN, NW) INTEGER IRTN, NW [C] int GWopen(int NW); ----------------------------------------------------------------------------- Description This routine is equivalent to GWopenx (see the next) with IW = 0, IH = 0, IFC = -1, IBC = -1, M = -1 and FN = ''(NULL). ----------------------------------------------------------------------------- [F] SUBROUTINE GWOPENX(IRTN, NW, IW, IH, IFC, IBC, M, FN) INTEGER IRTN, NW, IW, IH, IFC, IBC, M CHARACTER FN*(*) [C] int GWopenx(int NW, int IW, int IH, int IFC, int IBC, int M, char *FN); ----------------------------------------------------------------------------- Description When NW > 0 a new window with the specified window number NW opens, and an unused window number is used for the new window when NW = 0. When the join mode (see GWJOIN) has been set up successflly parameters NW and FN are ignored. In any case GWinitx(-1,-1,-1,-1,-1,-1,-1,-1) is called to open a main frame window if necessary. If the opening or the joining to an window is succeeded the number of actually opened window, or 0 otherwise, is returned to IRTN. The argument FN is used to the default file name in saving data. The internal paper size in unit of 0.1 mm is given by the width IW and the height IH assuming landscape (IW > IH). Internally these values are used with the resolution assumed in printing, etc. (see GWinitx) to determin sizes of bitmaps for buffers, for example. If the value is equal to 0 for IW or IH, or '' for FN, default values are used. IFC and IBC are initial logical color values (LCV: See GWCOLOR) for the foreground color and the background color, respectively. Only one of the reserved color values 0..20 or a palette-relative RGB values (See GWCOLOR) can be specified for the initial background color IBC. M is an initial window's show state (0..10: see GWshowwn) for the window. For IFC, IBC or M, if an invalid value is specified, a default value is used. Input NW > window number = 0: open a new window IW > paper width (in 0.1 mm) = 0: width of the current printer in pixels is used IH > paper height (in 0.1 mm) = 0: height of the current printer in pixels is used IFC = initial LCV of the foreground color (>= 0); 0 (black) on default IBC = initial LCV of the background color (>= 0); 19 (white) on default M = window's show state (0..10) FN = default file name in saving graphics data Output IRTN = window number ( > 0 ), 0 if failed. [TOC] [INDEX] 3. Quit ----------------------------------------------------------------------------- [F] SUBROUTINE GWQUIT(IRTN) INTEGER IRTN [C] int GWquit(void); ----------------------------------------------------------------------------- Description Pops up an ending dialog, and wait for a button clicked. Then close all window which is/are opened by the application, and close the main frame window if there is no other application which has opened windows in it. This routine is equivalent to GWquitx(1). ----------------------------------------------------------------------------- [F] SUBROUTINE GWQUITX(IRTN, MQ) INTEGER IRTN, MQ [C] int GWquitx(int MQ); ----------------------------------------------------------------------------- Description Closes the window(s) opened by the application and the main frame window. When the input parameter MQ is not equal to 0 an ending dialog appears. Input MQ = 0 : quit now != 0 : popup an ending dialog, and then quit. Output IRTN = return code [TOC] [INDEX] 4. Leave ----------------------------------------------------------------------------- [F] SUBROUTINE GWLEAVE(IRTN) INTEGER IRTN [C] int GWleave(void); ----------------------------------------------------------------------------- Description Leaves from the graphics window without closing the window. Input None Output IRTN = return code [TOC] [INDEX] 5. Join in a Window ----------------------------------------------------------------------------- [F] SUBROUTINE GWJOIN(IRTN, NW, IN, IS, JND) INTEGER IRTN, NW, IN, IS CHARACTER JND*(*) [C] int GWjoin(int NW, int IN, int IS, char *JND); ----------------------------------------------------------------------------- Description Joins in an existent window, that is, begins drawing in the existent window specified. A main frame (GrWnd) window as the target is specified by the input parameter IN, and a child window within the main frame window by NW. This routine must be called before any calls to GWopen[x] and GWinit[x] and tries to change manners of working of them suited to the join mode. For each of the parameters NW and IN, an corresponding existent window found first is used when the specified value is set equal to 0. When failed or a negative value is spesified to an input paramter a corresponding new window opens. If succeeded the actually joined window number, or 0 if failed, is returned to IRTN. Information of the joining window can be retrieved by the variable JND. If the specified value for IS is 0, no joining is made at all, but the output variables are set as if it was actually made. Getting information with setting IS = 0 you can make joining by calling again this routine with IS != 0. CAUTION: Result when more than one applications are joined togather in a frame window is unknown. Input NW = a window number IN = a main frame window (GrWnd) number Output JND = a string composed of the main frame window number and the window number followed by the application name with commas as separators if succeeds. An empty string otherwise. IRTN = the joined window number ( > 0 ), 0 if failed. [TOC] [INDEX] 6. Reset Parameters ----------------------------------------------------------------------------- [F] SUBROUTINE GWRESET(IRTN) INTEGER IRTN [C] int GWreset(void); ----------------------------------------------------------------------------- Description Resets the internal parameters for the current window. Input None Output IRTN = return code [TOC] [INDEX] 7. Close Window ----------------------------------------------------------------------------- [F] SUBROUTINE GWCLOSE(IRTN, NW) INTEGER IRTN, NW [C] int GWclose(int NW); ----------------------------------------------------------------------------- Description Closes the window(s) depending on the value of NW. Input NW > 0: window number = 0: the current window < 0: the all windows which are opened by the application Output IRTN = the current window number, or 0 if there is no window opened by the application [TOC] [INDEX] 8. Set World Coordinate System ----------------------------------------------------------------------------- [F] SUBROUTINE GWINDOW(IRTN, X1,Y1,X2,Y2) INTEGER IRTN REAL X1,Y1,X2,Y2 [C] int GWindow(float X1, float Y1, float X2, float Y2); ----------------------------------------------------------------------------- Description Sets the world coordinate system (WCS) by specifying the bottom-left corner (X1, Y1) and the top-right corner (X2, Y2) of the view port in WCS to be set. On default WCS is defined as identical as the logical coordinate system where the size is equal to the paper size and the origin is at the bottom- left corner of the view port. If X1 = X2 with Y1 != Y2 is specified, the width in WCS of the view port is chosen so as to make isotropic window with the aspect ratio 1:1 using the height |Y2 - Y1| in WCS. In this case the world coordinate of the bottom-center becomes (X1, Y1). Similarly if X1 != X2 with Y1 = Y2 is specified, an isotropic world coordinate system is made using the width of the view port |X2 - X1| in WCS. When X1 = X2 and Y1 = Y2, WCS is chosen identical to the logical device coordinate system as default. Input X1 = the world x-coordinate of the bottom-left corner of the view port Y1 = the world y-coordinate of the bottom-left corner of the view port X2 = the world x-coordinate of the top-right corner of the view port Y2 = the world y-coordinate of the top-right corner of the view port Output IRTN = return code [TOC] [INDEX] 9. Get World Coordinate System ----------------------------------------------------------------------------- [F] SUBROUTINE GWGETWN(IRTN, X1,Y1,X2,Y2) INTEGER IRTN REAL X1,Y1,X2,Y2 [C] int GWgetwn(float *X1, float *Y1, float *X2, float *Y2); ----------------------------------------------------------------------------- Description Gets the current world coordinates (see GWINDOW). Input None Output X1 = the world x-coordinate of the bottom-left corner of the view port Y1 = the world y-coordinate of the bottom-left corner of the view port X2 = the world x-coordinate of the top-right corner of the view port Y2 = the world y-coordinate of the top-right corner of the view port IRTN = return code [TOC] [INDEX] 10. Set View Port ----------------------------------------------------------------------------- [F] SUBROUTINE GWVPORT(IRTN, U1,V1,U2,V2) INTEGER IRTN REAL U1,V1,U2,V2 [C] int GWvport(float U1, float V1, float U2, float V2); ----------------------------------------------------------------------------- Description Sets the view port by specifying the bottom-left (BL) corner and the top- right (TR) corner of the view port in the normalized logical coordinate system (NLCS). The normalized logical coordinate system is the coordinate system where the shorter of the width and the height of the paper in pixels is normalized to unity. That is, the coordinates of the BL and the TR corners of the paper are (0.0, 0.0) and (max(W/H, 1.0), max(H/W, 1.0)), respectively, in the normalized logical coordinate system. If the specified view port has null area, that is U1 = U2 or V1 = V2, the whole paper is used as the view port. Input U1 = the x-coordinate of the BL corner of the view port (NLCS) V1 = the y-coordinate of the BL corner of the view port (NLCS) U2 = the x-coordinate of the TR corner of the view port (NLCS) V2 = the y-coordinate of the TR corner of the view port (NLCS) Output IRTN = return code [TOC] [INDEX] 11. Set View Port (in the world coordinate) ----------------------------------------------------------------------------- [F] SUBROUTINE GWPORT(IRTN, X1,Y1,X2,Y2) INTEGER IRTN REAL X1,Y1,X2,Y2 [C] int GWport(float X1, float Y1, float X2, float Y2); ----------------------------------------------------------------------------- Description Sets the view port by specifying the bottom-left (BL) corner and the top- right (TR) corner of the view port in the world coordinate system (WCS). If the specified view port has null area, that is X1 = X2 or Y1 = Y2, the whole paper is used as the view port. To preserve the world coordinate system GWINDOW(IRTN, X1,Y1,X2,Y2) must follow. Input X1 = the world x-coordinate of the BL corner of the view port Y1 = the world y-coordinate of the BL corner of the view port X2 = the world x-coordinate of the TR corner of the view port Y2 = the world y-coordinate of the TR corner of the view port Output IRTN = return code [TOC] [INDEX] 12. Get View Port ----------------------------------------------------------------------------- [F] SUBROUTINE GWGETVP(IRTN, U1,V1,U2,V2) INTEGER IRTN REAL U1,V1,U2,V2 [C] int GWgetvp(float *U1, float *V1, float *U2, float *V2); ----------------------------------------------------------------------------- Description Gets the current view port (see GWVPORT). Input None Output U1 = the x-coordinate of the BL corner of the view port (NLCS) V1 = the y-coordinate of the BL corner of the view port (NLCS) U2 = the x-coordinate of the TR corner of the view port (NLCS) V2 = the y-coordinate of the TR corner of the view port (NLCS) IRTN = return code [TOC] [INDEX] 13. Save View Port Info ----------------------------------------------------------------------------- [F] SUBROUTINE GWSAVEVP(IRTN, IVP) INTEGER IRTN, IVP [C] int GWsavevp(int IVP); ----------------------------------------------------------------------------- Description Sets the view port number to the current view port. The view port number set is used to recall the view port by calling GWselvp. Input IVP = the view port number ( > 0 ) Output IRTN = return code [TOC] [INDEX] 14. Select View Port ----------------------------------------------------------------------------- [F] SUBROUTINE GWSELVP(IRTN, IVP) INTEGER IRTN, IVP [C] int GWselvp(int IVP); ----------------------------------------------------------------------------- Description Selects the view port of the view port number IVP set by GWsavevp. Nothing is done if the view port number specified is not defined. If succeeded the view port is restored with the world coordinate system. The default view port is stored with VPN = 0. Input IVP = the view port number Output IRTN = return code [TOC] [INDEX] 15. Get Window / First ----------------------------------------------------------------------------- [F] SUBROUTINE GWFIRST(IRTN, NW) INTEGER IRTN, NW [C] int GWfirst(void); ----------------------------------------------------------------------------- Description Gets the window number of the first window opened by the application. Input None Output IRTN = the first window number (> 0), or 0 if failed. [TOC] [INDEX] 16. Get Window / Next ----------------------------------------------------------------------------- [F] SUBROUTINE GWNEXT(IRTN, NW) INTEGER IRTN, NW [C] int GWnext(int NW); ----------------------------------------------------------------------------- Description Gets the window number of the next window to the specified window. To get all window numbers belonging to the application, call GWfirst first, and then call GWnext's until 0 is returned. Input NW = a window number Output IRTN = the next window number (> 0), or 0 if failed. [TOC] [INDEX] 17. Select Window ----------------------------------------------------------------------------- [F] SUBROUTINE GWSELECT(IRTN, NW) INTEGER IRTN, NW [C] int GWselect(int NW); ----------------------------------------------------------------------------- Description Sets the specified window the current window. Input NW = window number (1,2,3,...) Output IRTN = the current window number [TOC] [INDEX] 18. Set Window's Show State ----------------------------------------------------------------------------- [F] SUBROUTINE GWSHOWWN(IRTN, NW, IS) INTEGER IRTN, NW, IS [C] int GWshowwn(int NW, int IS); ----------------------------------------------------------------------------- Description Sets the specified window's show state. The current window is not changed. When NW = 0, the current window is specified. Input NW = window number (0,1,2,3,...) IS = 0: Hides the window and activates another window. 1: Maximizes the specified window. 2: Minimizes the specified window and activates the next top-level window in the Z order. 3: Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window. 4: Activates the window and displays it in its current size and position. 5: Activates the window and displays it as a maximized window. 6: Activates the window and displays it as a minimized window. 7: Displays the window as a minimized window. The active window remains active. 8: Displays the window in its current state. The active window remains active. 9: Displays a window in its most recent size and position. The active window remains active. 10: Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time. Output IRTN = return code [TOC] [INDEX] 19. Set Frame's Show State ----------------------------------------------------------------------------- [F] SUBROUTINE GWSHOWFR(IRTN, IS) INTEGER IRTN, IS [C] int GWshowfr(int IS); ----------------------------------------------------------------------------- Description Sets the frame's show state. Input IS = 0: Hides the frame and activates another frame. 1: Maximizes the specified frame. 2: Minimizes the specified frame and activates the next top-level frame in the Z order. 3: Activates and displays the frame. If the frame is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized frame. 4: Activates the frame and displays it in its current size and position. 5: Activates the frame and displays it as a maximized frame. 6: Activates the frame and displays it as a minimized frame. 7: Displays the frame as a minimized frame. The active frame remains active. 8: Displays the frame in its current state. The active frame remains active. 9: Displays a frame in its most recent size and position. The active frame remains active. 10: Activates and displays a frame. If the frame is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the frame for the first time. 11: Place the frame window at topmost 12: Place the frame window behind all topmost windows 13: Place the frame window at the top 14: Place the frame window at the bottom Output IRTN = return code [TOC] [INDEX] 20. Arrange Windows ----------------------------------------------------------------------------- [F] SUBROUTINE GWARRANGE(IRTN, M) INTEGER IRTN, M [C] int GWarrange(int M); ----------------------------------------------------------------------------- Description Arranges the windows in the main window. Same as [Window] -> [...] at the Menu Bar for M < 5. Input M = 1: Cascade 2: Tile Horizontally 3: Tile Vertically 4: Arrange Icons 5: Activate the current window 6: Maximize the current window 7: Restore the current window 8: Destroy the current window Output IRTN = return code [TOC] [INDEX] 21. Get Position in LDCS ----------------------------------------------------------------------------- [F] SUBROUTINE GWLDCPOS(IRTN, X, Y, IU, IV) REAL X, Y INTEGER IRTN, IU, IV [C] int GWldcpos(float X, float Y, int *IU, int *IV); ----------------------------------------------------------------------------- Description Transforms world coordinates (X,Y) into logical device coordinate [IU,IV]. The logical device coordinate system (LDC) is defined by specifying the top-left corner of "the paper" as the origin [0,0], the u-axis to the right and the v-axis to the bottom, in the unit of pixel for the current printer. Input X = the world x-coordinate Y = the world y-coordinate Output IU = the logical device u-coordinate IV = the logical device v-coordinate IRTN = return code [TOC] [INDEX] 22. Get Sise in LDCS ----------------------------------------------------------------------------- [F] SUBROUTINE GWLDCSIZ(IRTN, W, H, IU, IV) REAL X, Y INTEGER IRTN, IU, IV [C] int GWldcsiz(float W, float H, int *IU, int *IV); ----------------------------------------------------------------------------- Description The width W and the height H in the WCS are transformed into those in LDCS. Input W = width in the WCS H = height in the WCS Output IU = width in the LDCS IV = height in the LDCS IRTN = return code [TOC] [INDEX] 23. Retrieve Pixel Sise in WCS ----------------------------------------------------------------------------- [F] SUBROUTINE GWPXLSIZ(IRTN, W, H) REAL X, Y [C] int GWpxlsiz(float *W, float *H); ----------------------------------------------------------------------------- Description Retrieves the current values for the width W and the height H in the WCS of a pixel on the working display. These values depend on the current size of the graphics window and the current display mode. Input None Output W = width of a pixel in the WCS H = height of a pixel in the WCS IRTN = return code [TOC] [INDEX] 24. Set Pen Attributes ----------------------------------------------------------------------------- [F] SUBROUTINE GWSETPEN(IRTN, IPC, IPS, IPW, MX) INTEGER IRTN, IPC, IPS, IPW, MX [C] int GWsetpen(int IPC, int IPS, int IPW, int MX); ----------------------------------------------------------------------------- Description Set color, style, width and mix mode of the current pen. When the pen style is specified other than as the solid line (IPS=1), the width is set to 1. The mix mode defines how to mix the colors of the current pen or the current brush and the back grownd, or lines, etc., already drawn on the window. When MX > 15, the value (MX-16) is used as the "binary raster operation code [W]". In principle, a negative input parameter does not change the corresponding attribute of the current pen. It should be noted that negative numbers other than -1 specified for IBC have special meanings. When the all parameters are specified to be equal to -1 the current pen position is initialized (see GWLINE2). Input IPC != -1: Logical color number (see GWCOLOR). = -1: unchanged IPS = pen style 0: NULL 1: SOLID 2: DASH 3: DOT 4: DASHDOT 5: DASHDOTDOT IPW = pen width in the logical device coordinate system. When 0, the width is set as 1 pixcel, regardless of the current output device. MX = mix mode 0: NOP 1: BLACK 2: WHITE 3: NOT 4: COPYPEN 5: MASKPEN 6: MERGEPEN 7: XORPEN 8: NOTCOPYPEN 9: NOTMASKPEN 10: NOTMERGEPEN 11: NOTXORPEN 12: MASKNOTPEN 13: MASKPENNOT 14: MERGENOTPEN 15: MERGEPENNOT Output IRTN = return code [TOC] [INDEX] 25. Get Pen Attributes ----------------------------------------------------------------------------- [F] SUBROUTINE GWGETPEN(IRTN, IPC, IPS, IPW, MX) INTEGER IRTN, IPC, IPS, IPW, MX [C] int GWgetpen(int *IPC, int *IPS, int *IPW, int *MX); ----------------------------------------------------------------------------- Description Get the logical color value, style, width and mix mode of the current pen. Input None Output IPC = the logical color value IPS = style IPW = width MX = mix mode IRTN = return code [TOC] [INDEX] 26. Set Brush Attributes ----------------------------------------------------------------------------- [F] SUBROUTINE GWSETBRS(IRTN, IBC, IBS, IBH) INTEGER IRTN, IBC, IBS, IBH [C] int GWsetbrs(int IBC, int IBS, int IBH); ----------------------------------------------------------------------------- Description Set color, style and hatch pattern of the current brush. If a negative number is specified as an input parameter the corresponding attribute is not changed. It should be noted that for IBC, negative numbers other than -1 have special meanings. Input IBC >= 0: Logical color number. = -1: unchanged < -1: Refer to GWCOLOR in this manual IBS = 1: SOLIDBRUSH 2: HATCHED 3: BSPATTERN (not implemented) 4: DIBPATTERN (not implemented) 5: DIBPATTERNPT (not implemented) IBH = 1: HORIZONTAL 2: VERTICAL 3: FDIAGONAL 4: BDIAGONAL 5: CROSS 6: DIAGCROSS Output IRTN = return code [TOC] [INDEX] 27. Get Brush Attributes ----------------------------------------------------------------------------- [F] SUBROUTINE GWGETBRS(IRTN, IBC, IBS, IBH) INTEGER IRTN, IBC, IBS, IBH [C] int GWgetbrs(int *IBC, int *IBS, int *IBH); ----------------------------------------------------------------------------- Description Get color, style and hatch pattern of the current brush. Refer to GWSETBRS to know meanings of parameters . Input None Output IBC = logical color value IBS = Style IPW = Hatch pattern IRTN = return code [TOC] [INDEX] 28. Set Text Font Attributes ----------------------------------------------------------------------------- [F] SUBROUTINE GWSETTXT(IRTN, H, A, IO, K, KB, FACE) INTEGER IRTN, IO, K, KB REAL H, A CHARACTER FACE*(*) [C] int GWsettxt(float H, float A, int IO, int K, int KB, char *FACE); ----------------------------------------------------------------------------- Description Set attributes for the current text font. Only a face name of an installed TrueType font can be specified to the input parameter FACE. When a space is specified to the string variable FACE the face name of the current text font is not changed. If failed to create a font using the specified parameters, or FACE is set as '*', a font dialog is used to create the current text font. Input H > 0: height in world coordinate system = 0: use default value < 0: not changed A = angle (in deg/360, counterclockwise; |A| < 1.0) not changed if |A| >= 1.0 IO = set the reference point at = 0: center = 1: bottom-left (default) = 2: bottom-right = 3: top-right = 4: top-left = 5: left = 6: bottom = 7: right = 8: top K = logical color number (see GWCOLOR) for text color = -1: not changed KB = logical color number (see GWCOLOR) for text-background color = -1: not changed = -100: transparent(default) FACE = TrueType face name Output IRTN = return code [TOC] [INDEX] 29. Get Text Extent ----------------------------------------------------------------------------- [F] SUBROUTINE GWGETTXT(IRTN, W, H, X, Y, TXT) INTEGER IRTN REAL W, H, X, Y CHARACTER TXT*(*) [C] int GWgettxt(float *W, float *H, float *X, float *Y, char *TXT); ----------------------------------------------------------------------------- Description Retrieve extent of a text string in the world coordinate. Inget W = width of the string in the world coordinate H = height of the string in the world coordinate X = the world x-coordinate of the offset of the reference point Y = the world y-coordinate of the offset of the reference point TXT = string Outget IRTN = return code [TOC] [INDEX] 30. Draw Text String ----------------------------------------------------------------------------- [F] SUBROUTINE GWPUTTXT(IRTN, X, Y, TXT) INTEGER IRTN REAL X, Y CHARACTER TXT*(*) [C] int GWputtxt(float X, float Y, char *TXT); ----------------------------------------------------------------------------- Description Draw a text string on the current window using the current text font. Attributes of the current text font can be changed by GWSETTXT or manually from [Options] -> [Font] at the menu bar. The width of the string cannot be set because it depends on the contents and the font using. If a point far outside the paper (see GWINDOW) as the bottom-left corner of the string to be drawn is specified, by using GWFMAX() for example, the output string follows the previous one. Input X = the world x-coordinate of the reference point of the string Y = the world y-coordinate of the reference point of the string TXT = string to be drawn Output IRTN = return code [TOC] [INDEX] 31. Set Symbol Font Attributes ----------------------------------------------------------------------------- [F] SUBROUTINE GWSETSYM(IRTN, H, A, IO, K, KB, FACE) INTEGER IRTN, IO, K, KB REAL H, A CHARACTER FACE*(*) [C] int GWsetsym(float H, float A, int IO, int K, int KB, char *FACE); ----------------------------------------------------------------------------- Description Set attributes for the current symbol font. Only a face name of an installed TrueType font can be specified to the input parameter FACE. When a space is specified to the string variable FACE the face name of the current symbol font is not changed. If failed to create a font using the specified parameters, a font dialog is used to create the current symbol font. Input H > 0: height in the world coordinate system = 0: use the default value < 0: not changed A = angle (in deg/360, counterclockwise; |A| < 1.0) not changed if |A| >= 1.0 IO = set the reference point at = 0: center (default) = 1: bottom-left = 2: bottom-right = 3: top-right = 4: top-left = 5: left = 6: bottom = 7: right = 8: top K = logical color number (see GWCOLOR) for text color = -1: not changed KB = logical color number (see GWCOLOR) for text-background color = -1: not changed = -100: transparent(default) FACE = TrueType face name Output IRTN = return code [TOC] [INDEX] 32. Get Symbol Extent ----------------------------------------------------------------------------- [F] SUBROUTINE GWGETSYM(IRTN, W, H, IC) INTEGER IRTN, IC REAL W, H [C] int GWgetsym(float *W, float *H, int IC); ----------------------------------------------------------------------------- Description Retrieve extent of a symbol in the world coordinate. Inget W = width of the symbol in the world coordinate H = height of the symbol in the world coordinate IC = symbol code (0..255) Outget IRTN = return code [TOC] [INDEX] 33. Draw Symbol ----------------------------------------------------------------------------- [F] SUBROUTINE GWPUTSYM(IRTN, X, Y, IC) INTEGER IRTN, IC REAL X, Y [C] int GWputsym(float X, float Y, int IC); ----------------------------------------------------------------------------- Description Draw a symbol character on the current window using the current symbol font. Attributes of the current symbol font can be changed by GWSETSYM or manually from [Options] -> [Symbol] at the menu bar. On default the face name is assumed to be "WingDings". The attributes of the current symbol font are not changed. Input X = the world x-coordinate of the center of the symbol Y = the world y-coordinate of the center of the symbol IC = symbol code (0..255) Output IRTN = return code [TOC] [INDEX] 34. Status Bar ----------------------------------------------------------------------------- [F] SUBROUTINE GWSETMSG(IRTN, TXT) INTEGER IRTN CHARACTER TXT*(*) [C] int GWsetmsg(char *TXT); ----------------------------------------------------------------------------- Description Display a text string at the status bar. Input TXT = string to be displayed Output IRTN = return code [TOC] [INDEX] 35. Message Box ----------------------------------------------------------------------------- [F] INTEGER FUNCTION MSGBOX(TXT) CHARACTER TXT*(*) [C] int GWmsgbox(char *TXT); ----------------------------------------------------------------------------- Description Popup a message box, and get the ending status of the selected button. Input TXT = string to be displayed in the message box Output None Return value 1: YES button was selected -1: NO button was selected 0: otherwise [TOC] [INDEX] 36. Pen Position ----------------------------------------------------------------------------- [F] SUBROUTINE GWGETPOS(IRTN, X, Y) INTEGER IRTN REAL X, Y [C] int GWgetpos(float *X, float *Y); ----------------------------------------------------------------------------- Description Retrieves the current pen position in the world coordinate. Input None Output X = the world x-coordinate of the current pen position. Y = the world y-coordinate of the current pen position. IRTN = return code [TOC] [INDEX] 37. Move Pen ----------------------------------------------------------------------------- [F] SUBROUTINE GWMOVE2(IRTN, X, Y) INTEGER IRTN REAL X, Y [C] int GWmove2(float X, float Y); ----------------------------------------------------------------------------- Description Moves current pen position to the point (X, Y) in the world coordinate. Nothing is drawn. Input X = x coordinate of the destination point. Y = y coordinate of the destination point. Output IRTN = return code [TOC] [INDEX] 38. Draw Line To ----------------------------------------------------------------------------- [F] SUBROUTINE GWLINE2(IRTN, X, Y) INTEGER IRTN REAL X, Y [C] int GWline2(float X, float Y); ----------------------------------------------------------------------------- Description Draws a line connecting the current pen position and the point (X, Y) specified, and then update the current pen position. The current pen is used to draw the line. If the pen position is undefined, as in the initial state, no line is drawn. The pen position can be initialized by GWSETPEN. Input X = the world x-coordinate of the destination point. Y = the world y-coordinate of the destination point. Output IRTN = return code [TOC] [INDEX] 39. Draw Line ----------------------------------------------------------------------------- [F] SUBROUTINE GWLINE(IRTN, X1, Y1, X2, Y2) INTEGER IRTN REAL X1, Y1, X2, Y2 [C] int GWline(float X1, float Y1, float X2, float Y2); ----------------------------------------------------------------------------- Description Draws a line connecting the two points (X1, Y1) and (X2, Y2) using the current pen. Output X1 = x coordinate of the beginning point. Y1 = y coordinate of the beginning point. X2 = x coordinate of the end point. Y2 = y coordinate of the end point. Output IRTN = return code [TOC] [INDEX] 40. Draw Rectangle ----------------------------------------------------------------------------- [F] SUBROUTINE GWRECT(IRTN, X1, Y1, X2, Y2) INTEGER IRTN REAL X1, Y1, X2, Y2 [C] int GWrect(float X1, float Y1, float X2, float Y2); ----------------------------------------------------------------------------- Description Draws a rectangle specified by a pair of two diagonal points (X1, Y1) and (X2, Y2). The current pen is used to draw the rectangle, and the current brush is used to fill the rectangle. Input X1 = the world x-coordinate of the point 1. Y1 = the world y-coordinate of the point 1. X2 = the world x-coordinate of the point 2. Y2 = the world y-coordinate of the point 2. Output IRTN = return code [TOC] [INDEX] 41. Draw Rectangle Filled with Solid Color ----------------------------------------------------------------------------- [F] SUBROUTINE GWSRECT(IRTN, X1, Y1, X2, Y2, K) INTEGER IRTN, K REAL X1, Y1, X2, Y2 [C] int GWsrect(float X1, float Y1, float X2, float Y2, int K); ----------------------------------------------------------------------------- Description Fills the given rectangle with the specified solid color in a logical color value (LCV). The rectangle is specified by a pair of two diagonal points (X1, Y1) and (X2, Y2). Input X1 = the world x-coordinate of the point 1. Y1 = the world y-coordinate of the point 1. X2 = the world x-coordinate of the point 2. Y2 = the world y-coordinate of the point 2. K = color in LCV Output IRTN = return code [TOC] [INDEX] 42. Draw Round Rectangle ----------------------------------------------------------------------------- [F] SUBROUTINE GWRRECT(IRTN, X1, Y1, X2, Y2, W, H) INTEGER IRTN REAL X1, Y1, X2, Y2, W, H [C] int GWrrect(float X1, float Y1, float X2, float Y2, float W, float H); ----------------------------------------------------------------------------- Description Draws a rectangle with rounded corners using the current pen. The two points (X1, Y1) and (X2, Y2) specify a pair of diagonal points of the bounding rectangle, and (W, H) the width and the height of the ellipse used to draw the rounded corners. The interior of the rectangle is filled using the current brush. Input X1 = the world x-coordinate of the point 1. Y1 = the world y-coordinate of the point 1. X2 = the world x-coordinate of the point 2. Y2 = the world y-coordinate of the point 2. W = the width of the ellipse used to draw the rounded corners. H = the height of the ellipse used to draw the rounded corners. Output IRTN = return code [TOC] [INDEX] 43. Draw Ellipse ----------------------------------------------------------------------------- [F] SUBROUTINE GWELLIPSE(IRTN, X1, Y1, X2, Y2) INTEGER IRTN REAL X1, Y1, X2, Y2 [C] int GWellipse(float X1, float Y1, float X2, float Y2); ----------------------------------------------------------------------------- Description Draws an ellipse. The center of the ellipse is the center of the bounding rectangle specified by a pair of two diagonal points (X1, Y1) and (X2, Y2). The ellipse is drawn with the current pen, and its interior is filled with the current brush. Input X1 = the world x-coordinate of the point 1. Y1 = the world y-coordinate of the point 1. X2 = the world x-coordinate of the point 2. Y2 = the world y-coordinate of the point 2. Output IRTN = return code [TOC] [INDEX] 44. Draw Arc ----------------------------------------------------------------------------- [F] SUBROUTINE GWARC(IRTN, X1, Y1, X2, Y2, A, AW) INTEGER IRTN REAL X1, Y1, X2, Y2, A, AW [C] int GWarc(float X1, float Y1, float X2, float Y2, float A, float AW); ----------------------------------------------------------------------------- Description Draws an arc of an ellipse. The center of the ellipse is the center of the bounding rectangle specified by a pair of two diagonal points (X1, Y1) and (X2, Y2). The starting point of the arc is specified by the start angle A measured counterclockwise from the x-direction in the unit of degrees/360. The ending point is similarly located by measuring counterclockwise from the starting point with the sweep angle AW. For A and AW, if a value less than or equal to -1.0 is specified, the default value is used. The arc is drawn using the current pen, and it is not filled. Input X1 = the world x-coordinate of the point 1. Y1 = the world y-coordinate of the point 1. X2 = the world x-coordinate of the point 2. Y2 = the world y-coordinate of the point 2. A = the start angle relative to the x-axis (in deg/360). AW = the sweep angle relative to the starting angle (in deg/360). Output IRTN = return code [TOC] [INDEX] 45. Draw Closed Arc ----------------------------------------------------------------------------- [F] SUBROUTINE GWCHORD(IRTN, X1, Y1, X2, Y2, A, AW) INTEGER IRTN REAL X1, Y1, X2, Y2, A, AW [C] int GWchord(float X1, float Y1, float X2, float Y2, float A, float AW); ----------------------------------------------------------------------------- Description Draws an arc of an ellipse with the chord closing the arc. The center of the arc is the center of the bounding rectangle specified by a pair of two diagonal points (X1, Y1) and (X2, Y2). The starting point of the arc is specified by the start angle A measured counterclockwise from the x- direction in the unit of degrees/360. The ending point is similarly located by measuring counterclockwise from the starting point with the sweep angle AW. For A and AW, if a value less than or equal to -1.0 is specified, the default value is used. The curve is drawn using the current pen, and it is filled using the current brush. Input X1 = the world x-coordinate of the point 1. Y1 = the world y-coordinate of the point 1. X2 = the world x-coordinate of the point 2. Y2 = the world y-coordinate of the point 2. A = the start angle relative to the x-axis (in deg/360). AW = the sweep angle relative to the starting angle (in deg/360). Output IRTN = return code [TOC] [INDEX] 46. Draw Pie ----------------------------------------------------------------------------- [F] SUBROUTINE GWPIE(IRTN, X1, Y1, X2, Y2, A, AW) INTEGER IRTN REAL X1, Y1, X2, Y2, A, AW [C] int GWpie(float X1, float Y1, float X2, float Y2, float A, float AW); ----------------------------------------------------------------------------- Description Draws a pie. The pie consists of an arc of an ellipse and the two closing radials from the center of the ellipse. The bounding rectangle of the ellipse is specified by a pair of two diagonal points (X1, Y1) and (X2, Y2). The starting point of the arc is specified by the start angle A measured counterclockwise from the x-direction in the unit of degrees/360. The ending point is similarly located by measuring counterclockwise from the starting point with the sweep angle AW. For A and AW, if a value less than or equal to -1.0 is specified, the default value is used. The curve is drawn using the current pen, and it is filled using the current brush. Input X1 = the world x-coordinate of the point 1. Y1 = the world y-coordinate of the point 1. X2 = the world x-coordinate of the point 2. Y2 = the world y-coordinate of the point 2. A = the start angle relative to the x-axis (in deg/360). AW = the sweep angle relative to the starting angle (in deg/360). Output IRTN = return code [TOC] [INDEX] 47. Plot 1D Array Elements ----------------------------------------------------------------------------- [F] SUBROUTINE GWPLOT1(IRTN, M, N, P1, PN, S, O, A, B, ARRY) INTEGER IRTN, M, N REAL P1, PN, S, O, A, B, ARRY(N) [C] int GWplot1(int M, int N, float P1, float PN, float S, float O, float A, float B, float *ARRY); ----------------------------------------------------------------------------- Description Transforms lenearly the first |N| elements of the 1D array ARRY, and then plots them at regular horizantal or vertical intervals in a format specified by M. The world (x,y) coordinate of the i-th point (i = 1..|N|) is given as (P1 + (i - 1)*(PN - P1)/(N - 1), A*ARRY(i)+B) when N > 0 or (A*ARRY(i)+B, P1 + (i - 1)*(PN - P1)/( - N - 1)) when N < 0 in FORTRAN. In C, ARRY(i) should read ARRY[i-1]. Input M = format of the plot = -1: line segments drawn with the current pen = -2(-3): vertical(horizontal) lines drawn with the current pen = -4(-5): vertical(horizontal) bars of the width S drawn with the current brush = -6(-7): vertical(horizontal) bars of the width S drawn with the current pen as edges and with the current brush for interiors = 0: marks of the current mark of the height S > 0: combo's of the combo number M already defined |N| = the number ( > 1: for line segments ) of points to be plot. When N > 0 the values A*ARRY()+B are regarded as world y coordinates, and when N < 0 as world x coordinates. P1 = the world x (or y) coordinate of the first point when N > 0 (< 0) PN = the world x (or y) coordinate of the last point when N > 0 (< 0) S = the width (in the world coordinate) of each bar when M < -1, or the mark height when M == 0 O = the base world y or x coordinate of each vertical or horizontal bar when M < -1, or the IOF parameter (see GWPUTCMB) when M > 0. A = the coefficient in the linear transformation B = the additive constant in the linear transformation ARRY = 1D array to be plotted Output IRTN = return code [TOC] [INDEX] 48. Draw Polygon ----------------------------------------------------------------------------- [F] SUBROUTINE GWPOLYGON(IRTN, POINTS, N, MF) INTEGER IRTN, N, MF REAL POINTS(2,N) [C] int GWpolygon(float *POINTS, int N, int MF); ----------------------------------------------------------------------------- Description Draws a polygon consisting of two or more points (vertices) connected by lines, using the current pen. The system closes the polygon automatically, if necessary, by drawing a line from the last vertex to the first. The current polygon-filling mode can be set by the parameter MF. When MF < 0 it is not changed. In C the memory block that the pointer POINTS points to must be contiguous, and *(POINTS + 2*i - 2) and *(POINTS + 2*i - 1) must be the x and the y cordinates of the i-th vertex, respectively, for i = 1 to N. Input POINTS(1,i) = the world x-coordinate of the i-th vertex (i = 1 to N). POINTS(2,i) = the world y-coordinate of the i-th vertex (i = 1 to N). N = number of vertices MF = polygon-filling mode 0: Alternate mode (default) 1: Winding mode otherwise: Left unchanged Output IRTN = return code [TOC] [INDEX] 49. Draw Line Segments ----------------------------------------------------------------------------- [F] SUBROUTINE GWPOLYLIN(IRTN, POINTS, N) INTEGER IRTN, N REAL POINTS(2,N) [C] int GWpolylin(float *POINTS, int N); ----------------------------------------------------------------------------- Description Draws lines connecting the given points successively, using the current pen. The figure is not filled if it is a closed one. In C the memory block that the pointer POINTS points to must be contiguous, and *(POINTS + 2*i - 2) and *(POINTS + 2*i - 1) must be the x and the y cordinates of the i-th vertex, respectively, for i = 1 to N. Input POINTS(1,i) = the world x-coordinate of the i-th point (i = 1 to N). POINTS(2,i) = the world y-coordinate of the i-th point (i = 1 to N). N = number of points ( > 1 ) Output IRTN = return code [TOC] [INDEX] 50. Draw Bezier ----------------------------------------------------------------------------- [F] SUBROUTINE GWBEZIER(IRTN, POINTS, N) INTEGER IRTN, N REAL POINTS(2,N) [C] int GWbezier(float *POINTS, int N); ----------------------------------------------------------------------------- Description Draws one or more Bezier splines using the current pen without filling. This function draws cubic Bezier splines by using the endpoints and control points specified by the array POINT. The first spline is drawn from the first point to the fourth point by using the second and third points as control points. Each subsequent spline in the sequence needs exactly three more points: the end point of the previous spline is used as the starting point, the next two points in the sequence are control points, and the third is the end point. The number of the points N must be one more than three times the number of splines to be drawn. In C the memory block that the pointer POINTS points to must be contiguous, and *(POINTS + 2*i - 2) and *(POINTS + 2*i - 1) must be the x and the y cordinates of the i-th vertex, respectively, for i = 1 to N. Input POINTS(1,i) = the world x-coordinate of the i-th point (i = 1 to N). POINTS(2,i) = the world y-coordinate of the i-th point (i = 1 to N). N = the number of points in the POINTS array. Output IRTN = return code [TOC] [INDEX] 51. Fill Bounded Area ----------------------------------------------------------------------------- [F] SUBROUTINE GWFLOOD(IRTN, X, Y) INTEGER IRTN REAL X, Y [C] int GWflood(float X, float Y); ----------------------------------------------------------------------------- Description Fills an area of the display surface with the current brush. The area is assumed to be bounded as specified by the same color as the color of the pixel at the beginning point (X, Y) [This routine is rather inefficient, and many printer (drivers) do not support this feature]. Input X = the world x-coordinate of the point where filling begins. Y = the world x-coordinate of the point where filling begins. Output IRTN = return code [TOC] [INDEX] 52. Clear Window ----------------------------------------------------------------------------- [F] SUBROUTINE GWCLEAR(IRTN, K) INTEGER IRTN, K [C] int GWclear(int K); ----------------------------------------------------------------------------- Description Fills the current viewport with the specified collor. Input K != -1: a logical color value (see GWCOLOR) = -1: clears the window with erasing the objects on memory Output IRTN = return code [TOC] [INDEX] 53. Set Mark Attributes ----------------------------------------------------------------------------- [F] SUBROUTINE GWSETMRK(IRTN, MT, S, K, KB, MX) INTEGER IRTN, MT, K, KB, MX REAL S [C] int GWsetmrk(int MT, float S, int K, int KB, int MX); ----------------------------------------------------------------------------- Description Sets mark number MT, size S in world coordinate, logical mark color K, logical background mark color KB, and the mix mode MX to the current mark. When MX > 15, the value (MX-16) is used as the "binary raster operation code [W]". Negative numbers specified for parameters do not change corresponding attributes, except for K and KB (see GWCOLOR). If MT = 0 is specified, the parameter S is read a size of a dot, precisely a small solid rectangle, in pixels and so the size of any instance of such a dot is independent of the view mode, or not expanded even in 'Zoom in' mode, for example. Input MT = 0: dot 1: solid rectangle 2: + 3: x 4: superposition of + and X 5: filled rectangle 6: filled circle others: neglected S = size of a dot in pixels (MT = 0) = height in the world coordinate > 0.0 (MT > 0) K != -1: logical mark color value (see GWCOLOR) = -1: unchanged KB != -1: logical mark background color value (see GWCOLOR) = -1: unchanged = -100: transparent(default) MX = mix mode for the mark (see GWSETPEN) Output IRTN = return code [TOC] [INDEX] 54. Draw Mark ----------------------------------------------------------------------------- [F] SUBROUTINE GWPUTMRK(IRTN, X, Y) INTEGER IRTN REAL X, Y [C] int GWputmrk(float X, float Y); ----------------------------------------------------------------------------- Description Draws the current mark set by GWSETMRK at the point (X, Y). Input X = the world x-coordinate of the center of the mark) Y = the world y-coordinate of the center of the mark) Output IRTN = return code [TOC] [INDEX] 55. Get Mark Attributes ----------------------------------------------------------------------------- [F] SUBROUTINE GWGETMRK(IRTN, MT, S, K, KB, MX) INTEGER IRTN, MT, K, KB, MX REAL S [C] int GWgetmrk(int *MT, float *S, int *K, int *KB, int *MX); ----------------------------------------------------------------------------- Description Gets mark number, mark size, mark color, mark background color and mix mode for the current mark. Input None Output MT = mark number S = mark height in the world coordinate K = logical mark color value (see GWCOLOR) KB = logical mark background color value (see GWCOLOR) MX = mix mode for the mark (see GWSETPEN) IRTN = return code [TOC] [INDEX] 56. Set Transformation Matrix ----------------------------------------------------------------------------- [F] SUBROUTINE GWSETXFRM(IRTN, XFRM) INTEGER IRTN REAL XFRM(6) [C] int GWsetxfrm(float *XFRM); ----------------------------------------------------------------------------- Description Sets the transformation matrix. The transformation matrix is used for transformations such as rotations of bitmaps and marks. A world coordinate point (x, y) is transformed to (x', y') using x' = XFRM(1) + XFRM(2) * x + XFRM(3) * y y' = XFRM(4) + XFRM(5) * x + XFRM(6) * y This does not work properly on Windows 9x/Me. Input XFRM = the elements of the transformation matrix Output IRTN = return code [TOC] [INDEX] 57. Get Transformation Matrix ----------------------------------------------------------------------------- [F] SUBROUTINE GWGETXFRM(IRTN, XFRM) INTEGER IRTN REAL XFRM(6) [C] int GWgetxfrm(float *XFRM); ----------------------------------------------------------------------------- Description Retrieves the current transformation matrix. The transformation matrix is used for transformations such as rotations of bitmaps and marks. Input None Output XFRM = the elements of the transformation matrix(See GWSETXFRM). IRTN = return code [TOC] [INDEX] 58. Set Clipping Region ----------------------------------------------------------------------------- [F] SUBROUTINE GWSETRGN(IRTN, X1, Y1, X2, Y2, M) INTEGER IRTN, M REAL X1, Y1, X2, Y2 [C] int GWsetrgn(float X1, float Y1, float X2, float Y2, int M); ----------------------------------------------------------------------------- Description Combines the current clipping region and a rectangular region specified by a pair of two diagonal points (X1, Y1) and (X2, Y2) using a mode specified by M, and sets the combined region as the current clipping region. If M < 0 or M > 4 and X1 = X2 or Y1 = Y2 the clipping region is removed. Input X1 = the world x-coordinate of the point 1. Y1 = the world y-coordinate of the point 1. X2 = the world x-coordinate of the point 2. Y2 = the world y-coordinate of the point 2. M = 1: AND 2: OR 3: DIFF 4: XOR otherwise: COPY Output IRTN = return code [TOC] [INDEX] 59. Set Pixel ----------------------------------------------------------------------------- [F] SUBROUTINE GWSETPXL(IRTN, X, Y, K) INTEGER IRTN, K REAL X, Y [C] int GWsetpxl(float X, float Y, int K); ----------------------------------------------------------------------------- Description Set the logical color value to the pixel at the point specified by x and y. Input X = the world x-coordinate of the point Y = the world y-coordinate of the point K = the logical color value Output IRTN = return code [TOC] [INDEX] 60. Get Pixel ----------------------------------------------------------------------------- [F] SUBROUTINE GWGETPXL(IRTN, X, Y) INTEGER IRTN REAL X, Y [C] int GWgetpxl(float X, float Y); ----------------------------------------------------------------------------- Description Retrieve the logical color value of the pixel at the point specified by x and y. Input X = the world x-coordinate of the point Y = the world y-coordinate of the point Output IRTN = the logical color value (if succeeded) = -1 (if failed) [TOC] [INDEX] 61. Set Color ----------------------------------------------------------------------------- [F] SUBROUTINE GWCOLOR(IRTN, K, IDST) INTEGER IRTN, K, IDST [C] int GWcolor(int K, int IDST); ----------------------------------------------------------------------------- Description Set a color specified by the logical color value (LCV) K to the destination IDST. When K = -1 a color-selection dialog box is popped up, and the selected color is set to the destination. The LCV's are defined as follows: 0..19 : reserved by Windows 0 : black 1 : dark red 2 : dark green 3 : dark yellow 4 : dark blue 5 : dark magenta 6 : dark cyan 7 : light gray 8 : money green 9 : sky blue 10 : cream 11 : medium gray 12 : dark gray 13 : red 14 : green 15 : yellow 16 : blue 17 : magenta 18 : cyan 19 : white 20..35 : custom colors made by a color-selection dialog box, which can be popped up from [Options] -> [Color] at the menu bar. 0x02000000 ..0x02ffffff : palette-relative RGB specifiers ("PALETTERGB[W]") -1 : color specified by a color-selection dialog box -2 : current foreground color -3 : current background color -4 : current pen color -5 : current brush color -6 : current mark color -7 : current mark-background color -8 : current text color -9 : current text-background color -10 : current symbol color -11 : current symbol-background color -12 : current pixel color -100 : transparent (for background colors) others : color specified by a color-selection dialog box Input K = logical color value (LCV) IDST = destination 1: foreground color 2: background color 3: pen color 4: brush color 5: mark color 6: mark-background color 7: text color 8: text-background color 9: symbol color 10: symbol-background color 11: pixel color 20..35: custom colors (0..15) others: neglected Output IRTN = return code [TOC] [INDEX] 62. Get RGB ----------------------------------------------------------------------------- [F] SUBROUTINE GWGETRGB(IRTN, K, IR, IG, IB) INTEGER IRTN, K, IR, IG, IB [C] int GWgetrgb(int K, int *IR, int *IG, int *IB); ----------------------------------------------------------------------------- Description Translate a logical color value to RGB. Input K = the logical color value Output IR = the intensity of the red color (0-255). IG = the intensity of the green color (0-255). IB = the intensity of the blue color (0-255). IRTN = return code [TOC] [INDEX] 63. Set RGB ----------------------------------------------------------------------------- [F] INTEGER FUNCTION KRGB(IR, IG, IB) INTEGER IR, IG, IB [C] int GWkrgb(int IR, int IG, int IB); ----------------------------------------------------------------------------- Description Translate the RGB value specified by (IR, IG, IB) into the corresponding logical color value. This may be used, for example, GWSETPEN and GWSETBRS, which require logical color values as an input parameter. The logical color value is an internal representation of colors in the GrWin Library (see GWCOLOR). Input IR = the intensity of the red color (0-255). IG = the intensity of the green color (0-255). IB = the intensity of the blue color (0-255). Output None Return value the resultant logical color value (see GWCOLOR) [TOC] [INDEX] 64. Get COLORREF value ----------------------------------------------------------------------------- [F] INTEGER FUNCTION KCOLOR(IC) INTEGER IC [C] int GWkcolor(int IC); ----------------------------------------------------------------------------- Description Translate the COLORREF value specified by IC into the corresponding logical color value. COLORREF is 32-bit values used as color values in Windows, in the following hexadecimal form as 0x00bbggrr, where 0xbb, 0xgg and 0xrr are intensities of the blue, green and red colors, respectively. The logical color value is an internal representation of colors in the GrWin Library (see GWCOLOR). Input IC = COLORREF value to be transformed Output None Return value the resultant logical color value (see GWCOLOR) [TOC] [INDEX] 65. Windows Palette ----------------------------------------------------------------------------- [F] INTEGER FUNCTION IPALETTE(IP) INTEGER IP [C] int GWipalette(int IP); ----------------------------------------------------------------------------- Description Translate an index IP to a logical-color palette entry on Windows into the corresponding logical color value. This may be used, for example, GWSETPEN and GWSETBRS, which require logical color values as an input parameter. The logical color value is an internal representation of colors in the GrWin Library (see GWCOLOR). Input IP = Windows palette number (0..255) Output None Return value the resultant logical color value (see GWCOLOR) [TOC] [INDEX] 66. Get Palette Number ----------------------------------------------------------------------------- [F] SUBROUTINE GWNCOLOR(IRTN) INTEGER IRTN [C] int GWncolor(void); ----------------------------------------------------------------------------- Description Get the number of pallets available. In the current version of the GrWin library this value is set fixed as 36. The palette numbers 0..19 are reserved for the Windows (see GWCOLOR) and 0 for the black and 19 for the white. The palette numbers 20..35 are reserved for the custom colors, which can be made by a color-selection dialog box popped up from [Options] -> [Color] at the menu bar. Input None Output IRTN = 36 [TOC] [INDEX] 67. Save Custom Color ----------------------------------------------------------------------------- [F] SUBROUTINE GWSAVECC(IRTN, FN) INTEGER IRTN CHARACTER FN*(*) [C] int GWsavecc(char *FN); ----------------------------------------------------------------------------- Description Save the Windows custom color table into a file Input FN = file name Output IRTN = return code [TOC] [INDEX] 68. Load Custom Color ----------------------------------------------------------------------------- [F] SUBROUTINE GWLOADCC(IRTN, FN) INTEGER IRTN CHARACTER FN*(*) [C] int GWloadcc(char *FN); ----------------------------------------------------------------------------- Description Restore the Windows custom color table from a file. The file consists of 16 lines, and each line has the form of "0x02bbggrr" as a string, where 0x00bbggrr is the COLORREF value of the entry. Any file created with GWSAVECC can be loaded as is by this routine. Input FN = file name Output IRTN = return code [TOC] [INDEX] 69. Get System Color ----------------------------------------------------------------------------- [F] SUBROUTINE GWSYSCLR(IRTN, IDX) INTEGER IRTN, IDX [C] int GWsysclr(int IDX); ----------------------------------------------------------------------------- Description Get system color information specified. To know details of the system color, refer to documents about GetSysColor() of Win32 API. Input IDX = 0: SCROLLBAR 1: BACKGROUND 2: ACTIVECAPTION 3: INACTIVECAPTION 4: MENU 5: WINDOW 6: WINDOWFRAME 7: MENUTEXT 8: WINDOWTEXT 9: CAPTIONTEXT 10: ACTIVEBORDER 11: INACTIVEBORDER 12: APPWORKSPACE 13: HIGHLIGHT 14: HIGHLIGHTTEXT 15: BTNFACE 16: BTNSHADOW 17: GRAYTEXT 18: BTNTEXT 19: INACTIVECAPTIONTEXT 20: BTNHIGHLIGHT Output IRTN = CORORREF values (Windows) [TOC] [INDEX] 70. Capture Point ----------------------------------------------------------------------------- [F] SUBROUTINE GWCAPPNT(IRTN, X, Y, TEXT) INTEGER IRTN REAL X, Y CHARACTER TEXT*(*) [C] int GWcappnt(float *X, float *Y, char *TEXT); ----------------------------------------------------------------------------- Description Wait for the left mouse button turned down, and retrieve the world x, y coordinates and the logical color (see GWCOLOR) value of the point. Input TEXT = a string to be notified at the status bar. Output IRTN = the logical color value ( -1 if failed ) X = the world x-coordinate of the point Y = the world y-coordinate of the point [TOC] [INDEX] 71. Capture Vector ----------------------------------------------------------------------------- [F] SUBROUTINE GWCAPVEC(IRTN, X1, Y1, X2, Y2, IBTN, TEXT) INTEGER IRTN, IBTN REAL X1, Y1, X2, Y2 CHARACTER TEXT*(*) [C] int GWcapvec(float X1, float Y1, float *X2, float *Y2, char *TEXT); ----------------------------------------------------------------------------- Description Giving the coordinates of a beginning point as inputs, wait for the left mouse button turned down, and retrieve the world x, y coordinates. In capturing, a rubber band connecting the beginning point and the current mouse pointer is displayed. Input TEXT = a string to be notified at the status bar. X1 = the world x-coordinate of the beginning point Y1 = the world y-coordinate of the beginning point Output IRTN = 1: the left button was pushed to get the end point = 2: the right button was pushed to get the end point <= 0: otherwise X2 = the world x-coordinate of the end point Y2 = the world y-coordinate of the end point IRTN = return code [TOC] [INDEX] 72. Capture Line ----------------------------------------------------------------------------- [F] SUBROUTINE GWCAPLIN(IRTN, X1, Y1, X2, Y2, TEXT) INTEGER IRTN REAL X1, Y1, X2, Y2 CHARACTER TEXT*(*) [C] int GWcaplin(float *X1, float *Y1, float *X2, float *Y2, char *TEXT); ----------------------------------------------------------------------------- Description Wait for the end of mouse dragging, and return the coordinates of the beginning point, where the left mouse button is turned down, and the end point, where the left mouse button is released. In dragging, a rubber band connecting between the beginning point and the current mouse pointer is displayed, and the dragging can be canceled by the right mouse button. Input TEXT = a string to be notified at the status bar. Output IRTN > 0: succeeded <= 0: canceled X1 = the world x-coordinate of the beginning point Y1 = the world y-coordinate of the beginning point X2 = the world x-coordinate of the end point Y2 = the world y-coordinate of the end point IRTN = return code [TOC] [INDEX] 73. Capture Rectangle ----------------------------------------------------------------------------- [F] SUBROUTINE GWCAPRECT(IRTN, X1, Y1, X2, Y2, TEXT) INTEGER IRTN REAL X1, Y1, X2, Y2 CHARACTER TEXT*(*) [C] int GWcaprect(float *X1, float *Y1, float *X2, float *Y2, char *TEXT); ----------------------------------------------------------------------------- Description Wait for the end of mouse dragging followed by the right mouse button turned down. The coordinates of the beginning point, where the left mouse button is turned down, and the end point, where the left mouse button is released, are returned. In dragging, a rectangular rubber band whose diagonal is the pair of the beginning point and the current mouse pointer is displayed, and the dragging can be canceled by the right mouse button. Until the right mouse button is turned down after dragging the rectangle to be captured can be changed by dragging a corner of the rectangular rubber band displayed. Input TEXT = a string to be notified at the status bar. Output IRTN != 0: succeeded = 0: canceled X1 = the world x-coordinate of the beginning point Y1 = the world y-coordinate of the beginning point X2 = the world x-coordinate of the end point Y2 = the world y-coordinate of the end point IRTN = return code [TOC] [INDEX] 74. Load Bitmap ----------------------------------------------------------------------------- [F] SUBROUTINE GWLOADBMP(IRTN, NB, FN) INTEGER IRTN, NB CHARACTER FN*(*) [C] int GWloadbmp(int NB, char *FN); ----------------------------------------------------------------------------- Description Load a bitmap from a bitmap file (*.bmp) with bitmap number NB. When NB = 0 unused array element is used. Maximun number of stored bitmaps depends on amount of available system resources though is not restricted. It should be noted that no test has been done for the case where available system resources are exhausted. Input NB = bitmap number (>0) or 0 to use unused array element. FN = bitmap file name (the bitmap file must be in the same directory as the exe file for the application unless specified as full path). Output IRTN = bitmap number used (>0), or 0 if failed. [TOC] [INDEX] 75. Save Bitmap ----------------------------------------------------------------------------- [F] SUBROUTINE GWSAVEBMP(IRTN, NB, FN) INTEGER IRTN, NB CHARACTER FN*(*) [C] int GWsavebmp(int NB, char *FN); ----------------------------------------------------------------------------- Description Save the bitmap specified by NB to a bitmap file. Input NB = bitmap number FN = bitmap file name Output IRTN = return code [TOC] [INDEX] 76. Make Bitmap ----------------------------------------------------------------------------- [F] SUBROUTINE GWMAKEBMP(IRTN, NB, IW, IH, IBC, IBITS) INTEGER IRTN, NB, IW, IH, IBITS(*) [C] int GWmakebmp(int NB, int IW, int IH, int IBC, int *IBITS); ----------------------------------------------------------------------------- Description Make a bitmap using bitmap data stored in the array IBITS with the bitmap number NB. When NB = 0 unused array element is used. If an invalid value is set to IBC the default value is used. Input NB = bitmap number (>0) IW = width of the bitmap(pixel) IH = height of the bitmap(pixel) IBC = color depth per pixel(bits per pixel) = 1: monochrome(1 bit) = 4: 16 colors (4 bits) = 8: 256 colors (8 bits: default) = 16: 2^16 colors (16 bits) = 24: 2^24 colors (24 bits) = 32: 2^32 colors (32 bits) IBITS = the bitmap data the logical color value of the pixels [i,j] are stored to IBITS(i+IW*j+1) : [F} or IBITS[i+IW*j] : [C] where the origin [0,0] is assumed at the top-left corner of the bitmap, and i = 0..IW-1 and j = 0..IH-1. Output IRTN = bitmap number used (>0), or 0 if failed. [TOC] [INDEX] 77. Make Bitmap ----------------------------------------------------------------------------- [F] SUBROUTINE GWFNT2BMP(IRTN, NB, IW, IH, IU, IV, TEXT) INTEGER IRTN, NB, IW, IH, IC, IU, IV CHARACTER TEXT*(*) [C] int GWfnt2bmp(int NB, int IW, int IH, int IU, int IV, char *TEXT); ----------------------------------------------------------------------------- Description Make a bitmap with the bitmap number NB from a text string using the current text font. When NB = 0 unused array element is used. Input NB = bitmap number (>0) IW = width of the bitmap(pixel) IH = height of the bitmap(pixel) IU = offset of the reference point to the right(pixel) IV = offset of the reference point to the bottom(pixel) TEXT = the string Output IRTN = bitmap number used (>0), or 0 if failed. [TOC] [INDEX] 78. Set Bitmap Attributes ----------------------------------------------------------------------------- [F] SUBROUTINE GWSETBMP(IRTN, NB, W, H, MX, ITR, IOF) INTEGER IRTN, NB, MX, ITR, IOF REAL W, H [C] int GWsetbmp(int NB, float W, float H, int MX, int ITR, int IOF); ----------------------------------------------------------------------------- Description Set drawing attributes for a stored bitmap NB. The bitmap number NB = 0 is reserved for a bitmap imported from the clipboard [W]. When W = H = 0, the original bitmap size in pixels are assumed in the LDCS. Bitmap-mix modes MX define how colors are combined in output operations that involve a current brush, a possible source bitmap, and a destination bitmap. When MX > 15, the value is used as the "ternary raster-operation code[W]". When ITR > 0 the value specifies the transparent color, which becomes transparent. The parameter IOF specifies the reference point of the bit map. When a parameter has a negative value the corresponding attribute is not changed. Input NB = bitmap number to be drawn W = width of the bitmap in the world coordinate system H = height of the bitmap in the world coordinate system MX = 0 ... 15 : bitmap-mix mode (see below) > 15 : (MX - 16) = "ternary raster-operation code[W]" ITR = transparent mode flag = 0: non transparent mode (the bitmap is drawn as a rectangle) = 1: transparent mode (white pixels in the bitmap becomes transparent) > 1: (a positive logical color value) + 2 for the transparent color ex. 2 => black IOF = set the reference point at = 0: center (default) = 1: bottom-left = 2: bottom-right = 3: top-right = 4: top-left = 5: left = 6: bottom = 7: right = 8: top bitmap-mix mode (see "ternary raster-operation code[W]") 0: INVERTNOT = source XOR (NOT dest) Inverts the destination bitmap and combines the result with the source bitmap using the Boolean XOR operator. 1: SRCCOPY = source Copies the source bitmap to the destination bitmap. 2: SRCPAINT = source OR dest Combines pixels of the destination and source bitmaps using the Boolean OR operator. 3: SRCAND = source AND dest Combines pixels of the destination and source bitmaps using the Boolean AND operator. 4: SRCINVERT= source XOR dest Combines pixels of the destination and source bitmaps using the Boolean XOR operator. 5: SRCERASE = source AND (NOT dest ) Inverts the destination bitmap and combines the result with the source bitmap using the Boolean AND operator. 6: NOTSRCCOPY = (NOT source) Copies the inverted source bitmap to the destination. 7: NOTSRCERASE = (NOT src) AND (NOT dest) Inverts the result of combining the destination and source bitmaps using the Boolean OR operator. 8: MERGECOPY = (source AND pattern) Combines the pattern and the source bitmap using the Boolean AND operator. 9: MERGEPAINT = (NOT source) OR dest Combines the inverted source bitmap with the destination bitmap using the Boolean OR operator. 10: PATCOPY = pattern Copies the pattern to the destination bitmap. 11: PATPAINT = DPSnoo Combines the inverted source bitmap with the pattern using the Boolean OR operator. Combines the result of this operation with the destination bitmap using the Boolean OR operator. 12: PATINVERT = pattern XOR dest Combines the destination bitmap with the pattern using the Boolean XOR operator. 13: DSTINVERT = (NOT dest) Inverts the destination bitmap. 14: BLACKNESS = BLACK Turns all outset black. 15: WHITENESS = WHITE Turns all outset white. Output IRTN = return code [TOC] [INDEX] 79. Get Bitmap Attributes ----------------------------------------------------------------------------- [F] SUBROUTINE GWGETBMP(IRTN, NB, W, H, IW, IH, IB, MAXNB, FN) INTEGER IRTN, NB, IW, IH, NC, MAXNB CHARACTER FN*(*) REAL W, H [C] int GWgetbmp(int NB, float *W, float *H, int *IW, int *IH, int *NC, int *MAXNB, char *FN, int l); ----------------------------------------------------------------------------- Description Get bitmap attributes. Input NB = bitmap number (>0), or 0 for imported clipboard obtained by [Edit] -> [Import Clipboard] on the menu bar. l = length of the char variable FN ([C]) Output W = width of the bitmap in the world coordinate H = height of the bitmap in the world coordinate IW = width of the bitmap in pixels IH = height of the bitmap in pixels IB = the number of bits per pixel MAXNB = maximum bitmap number of stored bitmaps FN = bitmap file name. It is neglected when FN == NULL ([C]) or the length of the FN is insufficient to retrieve the file name. IRTN = return code [TOC] [INDEX] 80. Draw Bitmap ----------------------------------------------------------------------------- [F] SUBROUTINE GWPUTBMP(IRTN, NB, X, Y, IBK) INTEGER IRTN, NB, IBK REAL X, Y [C] int GWputbmp(int NB, float X, float Y, int IBK); ----------------------------------------------------------------------------- Description Draw a stored bitmap NB at the point (X, Y) with attributes set by GWSETBMP. The parameter IBK is the switches (1 = on | 0 = off) for Restoring(R) and Saving(S) the background of the bitmap and for Drawing(D) the bitmap. Saving the background before drawing a bitmap and restoring it, that is clearing the bitmap, before the next drawing, a simple animation can be made. Input NB = bitmap number to be drawn X = the world x-coordinate of the reference point of the bitmap Y = the world y-coordinate of the reference point of the bitmap IBK = R*4 + S*2 + D*1 R = switch for restoring the background before the drawing S = switch for saving the background before the drawing D = switch for drawing the bitmap ex) IBK = 7: restoring (clearing) > saving > drawing IBK = 4: restoring (clearing) only Output IRTN = return code [TOC] [INDEX] 81. Copy Stored Bitmap ----------------------------------------------------------------------------- [F] SUBROUTINE GWCOPYBMP(IRTN, NB1, NB2) INTEGER IRTN, NB1, NB2 [C] int GWcopybmp(int NB1, int NB2); ----------------------------------------------------------------------------- Description Copy stored bitmap of the bitmap number NB1 to a bitmap with bitmap number NB2. Input NB1 = bitmap number of the bitmap to be copied NB2 = destination bitmap number (>0), or NB = 0 for using unused array element. Output IRTN = bitmap number used (>0), or 0 if failed. [TOC] [INDEX] 82. Delete Bitmap ----------------------------------------------------------------------------- [F] SUBROUTINE GWDELBMP(IRTN, NM) INTEGER IRTN, NM [C] int GWdelbmp(int NM); ----------------------------------------------------------------------------- Description Deletes stored bitmap of the bitmap number NM. If the spesified bitmap number is not used, nothing is done. Input NM = bitmap number of the bitmap to be deleted Output IRTN = bitmap number deleted (>0), or 0 if failed. [TOC] [INDEX] 83. Capture Image ----------------------------------------------------------------------------- [F] SUBROUTINE GWCAPIMG(IRTN, NB, X1, Y1, X2, Y2) INTEGER IRTN, NB REAL X1, Y1, X2, Y2 [C] int GWcapimg(int NB, float X1, float Y1, float X2, float Y2); ----------------------------------------------------------------------------- Description Capture image of a rectangular area specified by a pair of two diagonal points (X1,Y1) and (X2,Y2) into an element of the internal bitmap array. The array element can be specified with the bitmap number NB. When NB = 0 is specified, an unused element will be used. If the specified rectangle has no area the bounding rectangle for the current window is assumed. Input NB = bitmap number (>=0) X1 = the world x-coordinate of the point 1. Y1 = the world y-coordinate of the point 1. X2 = the world x-coordinate of the point 2. Y2 = the world y-coordinate of the point 2. Output IRTN = bitmap number used (>0), or 0 if failed. [TOC] [INDEX] 84. Copy To Clipboard ----------------------------------------------------------------------------- [F] SUBROUTINE GWCLIPIMG(IRTN, X1, Y1, X2, Y2) INTEGER IRTN REAL X1, Y1, X2, Y2 [C] int GWclipimg(float X1, float Y1, float X2, float Y2); ----------------------------------------------------------------------------- Description Copy rectangular area specified by a pair of diagonal points (X1,Y1) and (X2,Y2) into the Windows clipboard and also into an array element with the bitmap number NB = 0. If the specified rectangle has no area the bounding rectangle for the current window is assumed. Input X1 = the world x-coordinate of the point 1. Y1 = the world y-coordinate of the point 1. X2 = the world x-coordinate of the point 2. Y2 = the world y-coordinate of the point 2. Output IRTN = return code [TOC] [INDEX] 85. Load Metafile ----------------------------------------------------------------------------- [F] SUBROUTINE GWLOADCMB(IRTN, NM, FN) INTEGER IRTN, NM CHARACTER FN*(*) [C] int GWloadcmb(int NM, char *FN); ----------------------------------------------------------------------------- Description Load a combo file into a combo, a set of graphic objects, with the combo number NM. A combo file, whose default file extention is *.emf, is composed of the graphic objects of a combo with the same format as an enhanced-format metafile. If NM = 0 is specified unused array element is used. Maximun number of stored combos depends on amount of available system resources though is not restricted. It should be noted that no test has been done for the case where available system resources are exhausted. Input NM = combo number (>0) or 0 to use unused array element. FN = metafile name (the metafile must be in the same directory as the .exe file for the application unless specified as full path). Output IRTN = combo number used (>0), or 0 if failed. [TOC] [INDEX] 86. Save Combo as Combo File ----------------------------------------------------------------------------- [F] SUBROUTINE GWSAVECMB(IRTN, NM, FN) INTEGER IRTN, NM CHARACTER FN*(*) [C] int GWsavecmb(int NM, char *FN); ----------------------------------------------------------------------------- Description Save a combo as a combo file. Input NM = combo number to be saved as a combo file FN = combo file name Output IRTN = return code [TOC] [INDEX] 87. Create Mark as a Combo ----------------------------------------------------------------------------- [F] SUBROUTINE GWCMBMRK(IRTN, NM, MT, S, K, KB, MX) INTEGER IRTN, NM, MT, K, KB, MX REAL S [C] int GWcmbmrk(int NM, int MT, float S, int K, int KB, int MX); ----------------------------------------------------------------------------- Description Creates a mark (see GWSETMRK) as a combo of the combo number NM with using mark number MT, size S in world coordinate, logical mark color K, logical background mark color KB, and the mix mode MX. The mark attributes (see GWSETMRK) are unchanged. If a specified parameter is invalid, the corresponding current mark attribute is used. When NM = 0 or the specified combo number has already in use, an available number is used. Input NM = combo number MT = 0: dot 1: solid rectangle 2: + 3: x 4: superposition of + and X 5: filled rectangle 6: filled circle S = height in the world coordinate >= 0.0 K = logical mark color value (see GWCOLOR) = -1: the current mark color KB = logical mark background color value (see GWCOLOR) = -1: the current mark background color MX = mix mode for the mark (see GWSETPEN) Output IRTN = the combo number used [TOC] [INDEX] 88. Begin Making a Combo ----------------------------------------------------------------------------- [F] SUBROUTINE GWBEGINCMB(IRTN, NM, W, H) INTEGER IRTN, NM REAL W, H [C] int GWbegincmb(int NM, float W, float H); ----------------------------------------------------------------------------- Description Begins making a combo, a set of graphic objects, on memory and reserve the combo number NM for later uses. When NM = 0 an unused array element is used. The combo being made with the reserved combo number cannot be used until it is successfully closed by GWENDCMB. A combo can be used to draw a set of objects as an object, and can be saved in a file. Input NM = combo number (>0) W = width of the combo ( > 0: world coordinate) H = height of the combo ( > 0: world coordinate) Output IRTN = the reserved combo number (>0), or 0 if failed. [TOC] [INDEX] 89. End Making a Combo ----------------------------------------------------------------------------- [F] SUBROUTINE GWENDCMB(IRTN) INTEGER IRTN [C] int GWendcmb(void); ----------------------------------------------------------------------------- Description Ends making a combo and makes the combo available for drawings. Input none Output IRTN = the number (>0) of the generated combo, or 0 if failed. [TOC] [INDEX] 90. Draw Combo ----------------------------------------------------------------------------- [F] SUBROUTINE GWPUTCMB(IRTN, NM, X, Y, W, H, IOF) INTEGER IRTN, NM, IOF REAL X, Y, W, H [C] int GWputcmb(int NM, float X, float Y, float W, float H, int IOF); ----------------------------------------------------------------------------- Description Draws a stored combo NM at the point (X, Y) with the width W and the height H. If W == 0.0 or H == 0.0 the corresponding size on generated are used. The parameter IOF specifies the reference point of the bit map. Input NM = combo number to be drawn X = the world x-coordinate of the reference point of the combo Y = the world y-coordinate of the reference point of the combo W = width of the bitmap in the world coordinate system H = height of the bitmap in the world coordinate system IOF = set the reference point at = 0: center (default) = 1: bottom-left = 2: bottom-right = 3: top-right = 4: top-left = 5: left = 6: bottom = 7: right = 8: top Output IRTN = return code [TOC] [INDEX] 91. Get Attributes of Combo ----------------------------------------------------------------------------- [F] SUBROUTINE GWGETCMB(IRTN, NM, W, H, W0, H0, MAXNM, FN) INTEGER IRTN, NM, MAXNM CHARACTER FN*(*) REAL W, H, W0, H0 [C] int GWgetcmb(int NM, float *W, float *H, float *W0, float *H0, int *MAXNM, char *FN, int l); ----------------------------------------------------------------------------- Description Gets attributes of a combo. If an unregistered or invalid value is specified for NM, only the value of MAXNM is returned. Input NM = combo number (>0). l = length of the char variable FN ([C]) Output W = width of the combo in the world coordinate H = height of the combo in the world coordinate W0 = width of the combo in mm as a metafile H0 = height of the combo in mm as a metafile MAXNM = maximum combo number of stored combos FN = metafile name. If FN == NULL ([C]) or the length of the FN is insufficient to retrieve the file name, no value returns. IRTN = return code [TOC] [INDEX] 92. Copy Stored Combo ----------------------------------------------------------------------------- [F] SUBROUTINE GWCOPYCMB(IRTN, NM1, NM2) INTEGER IRTN, NM1, NM2 [C] int GWcopycmb(int NM1, int NM2); ----------------------------------------------------------------------------- Description Copy stored combo of the combo number NM1 to a combo with combo number NM2. Input NM1 = combo number of the combo to be copied NM2 = destination combo number (>0), or NM = 0 for using unused array element. Output IRTN = combo number used (>0), or 0 if failed. [TOC] [INDEX] 93. Delete Combo ----------------------------------------------------------------------------- [F] SUBROUTINE GWDELCMB(IRTN, NM) INTEGER IRTN, NM [C] int GWdelcmb(int NM); ----------------------------------------------------------------------------- Description Deletes stored combo of the combo number NM. If the spesified combo number is not used, nothing is done. Input NM = combo number of the combo to be deleted Output IRTN = combo number deleted (>0), or 0 if failed. [TOC] [INDEX] 94. Input String ----------------------------------------------------------------------------- [F] SUBROUTINE GWINPUT(IRTN, TITLE, TXT) INTEGER IRTN CHARACTER TITLE*(*), TXT*(*) [C] int GWinput(char *TITLE, char *TXT, int l); ----------------------------------------------------------------------------- Description Opens a dialog box to retrieve a string from keyboard. Input TITLE = string to be displayed at the title bar l = Length of the string variable TXT ([C]). Output IRTN = length (Bytes) of the string retrieved. TXT = the string retrieved (input is terminated by Enter). [TOC] [INDEX] 95. Popup File Dialog ----------------------------------------------------------------------------- [F] SUBROUTINE GWFILEDLG(IRTN, FN) INTEGER IRTN CHARACTER FN*(*) [C] int GWfiledlg(char *FN, int l); ----------------------------------------------------------------------------- Description Retrieves a file name using File Dialog (Windows). If the length of the specified file name, which depends on the implementation of the compiler used, is longer than the length of the string variable FN or l ([C]), it fails and the variable FN is unchanged. Input FN = a filename used to initialize the File Name edit control. l = Length of the string buffer ([C]). Output FN > 0: length of the file name retrieved. < 0: -(length of the file name specified in the dialog box > l). = 0: failed IRTN = FN = Retrieved file name (when succeeded). [TOC] [INDEX] 96. Load Data ----------------------------------------------------------------------------- [F] SUBROUTINE GWLOAD(IRTN, IC, FN) INTEGER IRTN CHARACTER FN*(*) [C] int GWload(int IC, char *FN); ----------------------------------------------------------------------------- Description Loads the graphic objects from a file (*.gwd) specified with a file name FN. A File Dialog pops up if failed to load with the specified file name. The parameter IC controls size matchings for the saved objects and restorations of internal parameters for a continuation of the saved job. Input IC = 0: only draws the objects (no resize, no parameter restoration) 1: draws the objects with resizes (no parameter restoration) 2: draws the objects with parameter restorations (no resize) otherwise: draws the objects with resizes and parameter restorations FN = file name (the file must be in the same directory as the exe file for the application unless specified as full path). Output IRTN = return code [TOC] [INDEX] 97. Save Data ----------------------------------------------------------------------------- [F] SUBROUTINE GWSAVEAS(IRTN, MF, MV, IW, IH, FN) INTEGER IRTN, MF, MV, IW, IH CHARACTER FN*(*) [C] int GWsaveas(int MF, int MV, int IW, int IH, char *FN); ----------------------------------------------------------------------------- Description Saves the graphics data into a named file with a file format specified by the parameter MF. If the specified value MF is equal to or less than 0, or another invalid value is specified, the file format is determined from the specified file name if possible, or otherwise is assumed to be the GWD format, the internal format for grwnd.exe, with the extension '.gwd' appended. A File Dialog pops up when the length of the file name specified by FN is equal to zero (or FN == NULL [C]). The result, the aspect ratio and the saved area, etc., depends on the viewmode specified by MV and the sizes IW and IH. When a negative value is specified for IW or IH the corresponding direction is reversed. A default value is used for an integral parameter if the value 0 is specified for it. This routine works normally in case the storing mode is set on. Input MF = file format (the file extention, the unit assumed for IW and IH) = 1: GWD format ('.gwd', n/a) = 2: extended metafile format ('.emf', 0.01 mm) = 3: DIB (device independent bitmap) format ('.bmp', pixels) MV = view mode 1: Bitmap 2: Isotropic 3: Fit 4: Total 5: the current view port IW = width (see above for the unit) IH = height (see above for the unit) FN = file name Output IRTN = return code [TOC] [INDEX] 98. Print ----------------------------------------------------------------------------- [F] SUBROUTINE GWPRINT(IRTN, IW, MV) INTEGER IRTN, IW, MV [C] int GWprint(int IW, int MV); ----------------------------------------------------------------------------- Description Prints out a window specified with the window number IW. When IW = 0, the current window is printed out. When IW < 0 all windows opened by the apprication are printed out. The view mode for the printing can be specified by MV. When MV < 0, the current view mode (see GWMODE) of the current window is assumed. This routine works normally in case the storing mode is set on. Input IW = the window number to be printed MV = view mode 1: Bitmap 2: Isotropic 3: Fit 4: Total 5: the current window Output IRTN = return code [TOC] [INDEX] 99. Set Object-Group Number ----------------------------------------------------------------------------- [F] SUBROUTINE GWSETOGN(IRTN, ISRC, IDST) INTEGER IRTN, ISRC, IDST [C] int GWsetogn(int ISRC, int IDST); ----------------------------------------------------------------------------- Description The object-group number (OGN) is an attribute of an object for grouping the objects. The objects having a negative OGN are stored in an internal flush buffer (FB) corresponding to the value of the OGN, and are suspended or not displayed in drawing until a flushing is made. A flushing is made by turning the negative OGN of them to a positive one. When the storing mode is set on (see GWMODE), objects drawn are stored or serialized in memory. The OGN is referred, for example, in selective erasing (GWERASE) of those serialized objects with the OGN. On default the current OGN is set equal to 1. The OGN = 0 is used by the system. When the storing mode is set off (see GWMODE), drawn objects are not serialized and the features referring OGN's for serialized objects are not available, in principle. |OGN| must be less than 32768. When ISRC != 0 the OGN's of the objects whose OGN's are equal to ISRC are set equal to IDST, and the number of them is returned to IRTN. When ISRC = 0 and IDST != 0, the current OGN for the subsequent objects is set equal to IDST, and the current number of the stored objects is returned. When ISRC = IDST = 0, the current OGN is returned. The storing mode must be set on to use this routine. ISRC IDST : action : return value ------------+---------------------------+-------------------------- + ! 0 : protects ISRC : # of stored objs that got protected + = + : nothing : # of stored objs with OGN = ISRC + ! + : changes OGN of stored objs: # of stored objs with OGN = IDST + = - : hides ISRC : # of objs that got hidden + ! - : hides ISRC as -IDST : # of objs that got hidden - ! 0 : flushes & protects ISRC : # of objs that got protected - = + : flushes ISRC : # of objs that got flushed - ! + : flushes ISRC & changes OGN: # of objs that got flushed - = - : nothing : # of objs in the FB with OGN = ISRC - ! - : merge ISRC to IDST in FB : # of objs that got merged 0 = 0 : nothing : the current OGN 0 ! +/- : changes the current OGN : total # of the stored objs [ The symbol '=' or '!' between src and dst stands for whether src and dst are equal in their absolute values or not.] Input ISRC != 0: sets OGN's of the existing objects with OGN = ISRC equal to IDST = 0: sets the current OGN equal to IDST (!= 0) IDST = the OGN to be set Output IRTN = the number of objects whose OGN's are equal to ISRC (if ISRC != 0) = the current number of the objects (if ISRC = 0 and IDST != 0) = the current OGN (if ISRC = IDST = 0) < 0 failed [TOC] [INDEX] 100. Anchor ----------------------------------------------------------------------------- [F] SUBROUTINE GWANCHOR(IRTN, N) INTEGER IRTN, N [C] int GWanchor(int N); ----------------------------------------------------------------------------- Description Adds or removes anchors. An anchor is an object that does nothing with the object group number 0. Anchors are used to protect earlier objects from erasing with GWERASE or GWFRUSH. On default, the anchor added with this function becomes the background anchor, which is associated with a background surface used in fast redrawings. Each anchor is identified with the anchor number, the sequential number of the anchor in the anchors counted from the head of the objects. When the storing mode is set off, the anchor is not an object but is used only to store a background surface. Input N > 0: adds an anchor at the tail of the objects. If the value of N is equal to the current number of the anchors, the last anchor is removed before adding. < 0: removes |N| anchors from the tail = 0: removes all anchors Output IRTN > 0: the anchor number == 0: failed to add an anchor < 0: -(number of the anchors that could not been removed) [TOC] [INDEX] 101. Set Background ----------------------------------------------------------------------------- [F] SUBROUTINE GWSETBK(IRTN, N) INTEGER IRTN, N [C] int GWsetbk(int N); ----------------------------------------------------------------------------- Description Sets the anchor with the anchor number N (> 0) to be the background anchor. If N = 0, the background mode is turned off. When N < 0 is specified, inquires the current anchor number or the number of the anchors. Input N > 0: sets the anchor with the anchor number N to be the background anchor, or does nothing if no anchor of the specified anchor number exists. = 0: turns OFF the background mode = -1: inquires the current anchor number < -1: inquires the current total number of the anchors Output IRTN >= 0: the current background anchor number (N >= -1) or the current number of the anchors (N < -1) < 0: error [TOC] [INDEX] 102. Erase ----------------------------------------------------------------------------- [F] SUBROUTINE GWERASE(IRTN, N, LRF) INTEGER IRTN, N, LRF [C] int GWerase(int N, int LRF); ----------------------------------------------------------------------------- Description Erases the objects with the abs(OGN) = N when N > 0. When N = 0 the objects with non zero object group numbers are erased. If a negative integer is given for N, the last abs(N) objects are erased. The argument LRF is a flag for refreshing. The current window is not refreshed immediately when LRF = 0 is specified, otherwise the graphic objects as instances of the objects deleted disappear from the current window. The erasing is made from the tail of the objects, and is quitted if an object with OGN = 0 is reached. This routine works normally in case the storing mode is set on. Input N > 0: erases the objects with the abs(OGN) = N = 0: erases the current window < 0: erases the last abs(N) objects LRF = flag for refreshing ( no refreshing when LRF = 0 ) Output IRTN = the number of the erased objects [TOC] [INDEX] 103. Flushing ----------------------------------------------------------------------------- [F] SUBROUTINE GWFLUSH(IRTN, N) INTEGER IRTN, N [C] int GWflush(int N); ----------------------------------------------------------------------------- Description Flushes suspended objects. When N > 0 the objects with the OGN being equal to -N are flushed and the OGN's of them is inverted to be positive. When N < 0 the objects with the OGN being equal to -N are erased, and the objects with the OGN being equal to N are flushed with the sign inversions. When N = 0 all suspended objects with negative OGN are flushed with the sign inversions. The number of the objects flushed is returned to IRTN. The storing mode must be set on to use this routine. Input N > 0: flushes the objs with the OGN = -N < 0: erases the objs with the OGN = -N and flushes the objs with the OGN = N = 0: flushes all suspended objects Output IRTN = the number of the objects flushed [TOC] [INDEX] 104. Refresh ----------------------------------------------------------------------------- [F] SUBROUTINE GWREFRESH(IRTN) INTEGER IRTN [C] int GWrefresh(void); ----------------------------------------------------------------------------- Description Refreshs the current window ( = [View] -> [Redraw] at Menu Bar). This routine works normally in case the storing mode is set on. Input None Output IRTN = return code [TOC] [INDEX] 105. View Mode ----------------------------------------------------------------------------- [F] SUBROUTINE GWVWMOD(IRTN, M) INTEGER IRTN, M [C] int GWvwmod(int M); ----------------------------------------------------------------------------- Description Sets or inquires the view mode of the current window, if any, or the default view mode, which is reffered in opening a windos (see GWopen). Input M = 1: Bitmap 2: Isotropic 3: Fit 4: Total 5: Zoom in (to the current view port, on setting) otherwise: inquire the view mode Output IRTN = the view mode of the current window (see above, 0: if failed) [TOC] [INDEX] 106. Setting and Inquiring Modes ----------------------------------------------------------------------------- [F] SUBROUTINE GWMODE(IRTN, MD, M) INTEGER IRTN, MD, M [C] int GWmode(int MD, int M); ----------------------------------------------------------------------------- Description Sets or inquires a mode (see below). The input parameters MD and M are for specifying a sort of mode and the mode to be set, respectively. 1. Storing: When this mode is set on, objects drawn are stored (serialized) in memory, and will be used in redrawing printing, and saving to a file, etc. With this mode set off, on the contrary, they are deleted and the amount of memories used can be reduced, though features based on the serialization such as redrawing, printing and saving are not available, in principle. The default status of this mode is set on. 2. Buffering: When status of this mode turned on an internal bitmap is created as a copy of the current window, and subsequent drawings are made on the bitmap. The drawing on the bitmap is faster but is memory consuming. The default status of this mode is set on. 3. Displaying status bar: For fast drawings it is recommended to set this mode off. The default status of this mode is set on. 4. Inquiring: Shows dialog boxes in some aspects. The default status of this mode is set off. 5. Landscape: The landscape mode is used in printing. The default status of this mode is set on. 6. Staying open on QUIT: Leaves the main frame window open when GWQUIT is called. The default status of this mode is set off. 7. Embedding BMPs: Embedes the bitmaps in a gwd file (see GWsaveas) when the gwd is specified as an output file format. To extract bitmaps to *.bmp files this mode must set off. The default status of this mode is set on. Input MD = 1 : storing mode 2 : buffering mode 3 : displaying status bar mode 4 : Inquiring 5 : Landscape 6 : Staying open on QUIT 7 : Embedding BMPs others : not defined M = 0 : sets off > 0 : sets on < 0 : inquires the current status Output IRTN = 0 : off 1 : on -1 : error [TOC] [INDEX] 107. Get Keyboard Status On Window ----------------------------------------------------------------------------- [F] SUBROUTINE GWKYBRD(IRTN, ICH, NCNT, IFLG, M) INTEGER IRTN, ICH, NCNT, IFLG, M [C] int GWkybrd(int *ICH, int *NCNT, int *IFLG, int M); ----------------------------------------------------------------------------- Description Gets the keyboard status on the associated window. Depending on the value of the argument M specified when invoked, the control returns in different ways as seen in the following descriptions. For each of ICH, NCNT and IFLG the value remains unchanged if no change was detected (IRTN = 0). Input M = 0: returns immediately with the keyboard status 1: after a keystroke, e.g. SHIFT+A, waits for the compretion of the translation to a nonsystem character (ASCII code). 2: waits for a key down 3: waits for a key up otherwise: if a key down was detected, waits for the key up and then returns with the keyboard status on invoked, otherwise returns immediately Output IRTN = The virtual-key code (Windows) if the key is down, 0 otherwise. ICH = The key code for the last nonsystem key down. NCNT = Repeat count (the number of times the keystroke is repeated as a result of the user holding down the key). IFLG = Flags with meaningful bits listed as follows: 0-7 Scan code (OEM-dependent value). 8 Extended key, such as a function key or a key on the numeric keypad (1 if it is an extended key). 13 Context code (1 if the ALT key is held down while the key is pressed; otherwise 0). 14 Previous key state (1 if the key is down before the call, 0 if the key is up). 15 Transition state (1 if the key is being released, 0 if the key is being pressed). [TOC] [INDEX] 108. Get Mouse Status ----------------------------------------------------------------------------- [F] SUBROUTINE GWMOUSE(IRTN, IRB, X, Y) INTEGER IRTN, IRB REAL X, Y [C] int GWmouse(int *IRB, float *X, float *Y); ----------------------------------------------------------------------------- Description Gets the mouse status on the current window. Input None Output IRTN = The left button status. (0 when up) IRB = The right button status. (0 when up) X = X coordinate of the mouse pointer in World Coordinate System. Y = Y coordinate of the mouse pointer in World Coordinate System. [TOC] [INDEX] 109. Interval Timer ----------------------------------------------------------------------------- [F] SUBROUTINE GWTIMER(IRTN, MS, N) INTEGER IRTN, MS, N [C] int GWtimer(int MS, int N); ----------------------------------------------------------------------------- Description Starts the interval timer if N != 0 or stops it if N == 0. The interval timer generates timer events, which can be detected by GWEVENT, at regular intervals specified with MS (milliseconds). If N > 0 the interval timer stops after generating N timer events. Input MS = the time interval between timer events (milliseconds) N > 0: generates N timer events, and then stops the interval timer < 0: starts the interval timer == 0: stops the interval timer Output IRTN = return code [TOC] [INDEX] 110. Get Event Status ----------------------------------------------------------------------------- [F] SUBROUTINE GWEVENT(IRTN, X, Y) INTEGER IRTN REAL X, Y [C] int GWevent(float *X, float *Y); ----------------------------------------------------------------------------- Description Gets the event status on the current window. The event status is set with the current mouse position when an event such that a key on the keyboard or on the mouse is down or the interval timer is expired is detected, and is kept until this routine is called. The event status is reset by a call to this routine. Input None Output IRTN = 0: no event detected > 0: the virtual-key code (Windows) of the key down detected last = -1: the left mouse button down = -2: the right mouse button down = -3: interval timer expired (see GWTIMER) X = the world X coordinate of the mouse pointer. Y = the world Y coordinate of the mouse pointer. [TOC] [INDEX] 111. Idling ----------------------------------------------------------------------------- [F] SUBROUTINE GWIDLE(IRTN, ICH, X, Y, MSEC) INTEGER IRTN, ICH, MSEC REAL X, Y [C] int GWidle(int *ICH, float *X, float *y, int MSEC); ----------------------------------------------------------------------------- Description Leaves the status of the application in idling mode, during which the control is not returned and the execution of the application is suspended, until a keyboard input or a mouse button down is detected, or the specified time is elapsed. In the idling mode the menu operations, e.g. Print, and moves of the mouse pointer by the cursor keys can be done. Input MSEC = the maximum elapsed time (milliseconds) for the idling. If 0 or a negative value is specified, the maximum elapsed time is set as 300000 (5 minutes). Output IRTN = the elapsed time (milliseconds) ICH > 0: the key code (ASCII) for the detected nonsystem key down = 0: the specified elapsed time expired -1: the left mouse button down was detected -2: the right mouse button down was detected X = the world x-coordinate of the mouse pointer Y = the world y-coordinate of the mouse pointer [TOC] [INDEX] 112. Idling 2 ----------------------------------------------------------------------------- [F] SUBROUTINE GWIDLE2(IRTN, ICH, X, Y, MSEC) INTEGER IRTN, ICH, MSEC REAL X, Y [C] int GWidle2(int *ICH, float *X, float *y, int MSEC); ----------------------------------------------------------------------------- Description Is the same as GWIDLE except that the meaning of the input parameter MSEC is the time (milliseconds) measured by the internal clock (see GWSLEEP2) at which the idling is stopped if no event that causes the termination of the idling mode is detected, and the return value is not the elapsed time but the time of the internal clock. The internal clock can be reset to be 0 using GWSLEEP2. [TOC] [INDEX] 113. Sleep ----------------------------------------------------------------------------- [F] SUBROUTINE GWSLEEP(IRTN, MS) INTEGER IRTN, MS [C] int GWsleep(int MS); ----------------------------------------------------------------------------- Description Suspends execution for the specified time in milliseconds. Input MS = the time, in milliseconds, for which to suspend execution. Output IRTN = return code [TOC] [INDEX] 114. Sleep 2 ----------------------------------------------------------------------------- [F] SUBROUTINE GWSLEEP2(IRTN, MS) INTEGER IRTN, MS [C] int GWsleep2(int MS); ----------------------------------------------------------------------------- Description Suspends execution until the specified wake-up time is up. The time ( > 0, in milliseconds) is measured with the internal clock associated with the current window. If a value MS <= 0 is specified, the time of the internal clock is set to be |MS| and the control is returned immediately. If the wake-up time specified with MS (> 0) is earlier than the current time, which can be obtained by GWCTIME, the control is returned immediately. On opening a window the time of the associated internal clock is reset to be 0. Input MS > 0: the wake-up time (in milliseconds) at which the control is to be returned. <= 0: the time of the internal clock is initialized with the value |MS| Output IRTN = the time (in milliseconds) of the internal clock at the invocation [TOC] [INDEX] 115. Get Current time ----------------------------------------------------------------------------- [F] SUBROUTINE GWCTIME(IRTN) INTEGER IRTN [C] int GWctime(void); ----------------------------------------------------------------------------- Description Gets the current time (in milliseconds) of the internal clock associated with the current window. Input None Output IRTN = the current time of the internal clock (in milliseconds) [TOC] [INDEX] 116. Pause ----------------------------------------------------------------------------- [F] SUBROUTINE GWPAUSE(IRTN, TXT) INTEGER IRTN CHARACTER TXT*(*) [C] int GWpause(char *TXT); ----------------------------------------------------------------------------- Description Pops up a message box, and wait for a button selected. Input TXT = string to be displayed in the message box Output IRTN = return code [TOC] [INDEX] 117. Get/Set Size ----------------------------------------------------------------------------- [F] SUBROUTINE GWSIZE(IRTN, N, IW, IH) INTEGER IRTN, N, IX, IY [C] int GWsize(int N, int *IW, int *IH); ----------------------------------------------------------------------------- Description Gets a size or a position if N > 0, or set a size or a position if N < 0. The item(s) marked with '*' cannot be set to change. If IW = 0 or IH = 0 is specified in setting the current frame size (N = 3) the frame fits the view. Each position is the set of the relative coordinates of the top-left corner of the specified window measured from the top-left corner of its parent window. Only the size of the display surface (N = 2) can be retrieved before the initialization of the library, say a call to GWOPEN or GWINIT. Input N = 1: the current `paper' size (in pixels). *2: the size of the display surface (in pixels). 3: the current size of the frame (in pixels). 4: the current position of the frame (in pixels) on the display. 5: the current size of the view (in pixels). 6: the current position of the view (in pixels) in the parent frame. 7: the current view port size (in pixels). 8: the current view port position (in pixels) in the parent view. 9: the default `paper' size (in pixels). 10: the resolution assumed in printing, etc. (in dpi). 11: the current margin in printing (in 0.1 mm). *12: the paper size for a working printer (in 0.1 mm), if any. *13: the resolution (in dpi) for a working printer, if any. > 13: not defined Input (when N < 0) IW = Width IH = Height Output (when N > 0) IW = Width IH = Height IRTN = return code [TOC] [INDEX] 118. Get Aspect Ratio ----------------------------------------------------------------------------- [F] REAL FUNCTION GWASPECT(N) [C] float GWaspect(int N); ----------------------------------------------------------------------------- Description Get aspect ratios defined as ratios of the width and the height of rectangles. To draw a circle, not an ellipse, in [Bitmap] or [Isotropic] display mode draw an ellipse with a bounding rectangle with the ratio obtained by GWASPECT(-1) in the world coordinate system (WCS), for example. Input N = sort of aspect ratio Output None Return value If N = 1: the aspect ratio of the `paper' size (in pixels). 2: the aspect ratio of the current size of the view (in pixels). 3: the aspect ratio of the current size of the frame (in pixels). 4: the aspect ratio of the size of the display surface (in pixels). 5: the aspect ratio of the resolution (in dpi) of a working printer. 6: the aspect ratio of the paper size of a working printer (in pixels). 7: the aspect ratio of the current view port size (in pixels). otherwise: the aspect ratio needed to draw a circle (in WCS). On error an error code ( <= 0 ) is returned. [TOC] [INDEX] 119. Maximum value of Floating Point Numbers ----------------------------------------------------------------------------- [F] REAL FUNCTION GWFMAX() [C] float GWfmax(void); ----------------------------------------------------------------------------- Description Returns the maximum floating point value. Input None Output None Return value the maximum floating point value [TOC] [INDEX] 120. Get Version Numbers ----------------------------------------------------------------------------- [F] SUBROUTINE GWVERSION(IRTN,IS,STR) INTEGER IRTN, IS CHARACTER STR*(*) [C] int GWversion(int IS, char *STR, int l); ----------------------------------------------------------------------------- Description Retrieve embedded strings, e.g. for the version number, in the library file. This can be called befor the initialization of the library. Input IS specifies the string to be retrieved = 0: the number of the strings that can be retrieved is returned in STR as a string 1: the version numbers separated by commas, for each of which the larger it is the later the version is. 2: the version number of the grwnd.exe compatible with the library. 3: the creation date 4: copyright 5: build No. l = length of the string (character) variable STR Output IRTN > the number of the strings that can be retrieved (currently 5) = 0; if the specified number for a string is invalid = - (the length of the string to be retrieved) < 0; if failed STR = the retrieved string [TOC] [INDEX] 121. Get Keyboard Status On Console ----------------------------------------------------------------------------- [F] INTEGER FUNCTION KBHIT() [C] int kbhit(void); ----------------------------------------------------------------------------- Description Get the keyboard status on the console window where the application started up. The return value is 0 if no key is down (see GWKYBRD). Input None Output None Return value keyboard status [TOC] [INDEX] 122. Get a Key Code On Console ----------------------------------------------------------------------------- [F] INTEGER FUNCTION KBGETCH(N) INTEGER N [C] int kbgetch(int N); ----------------------------------------------------------------------------- Description Wait until a key is down and then get the key code on the console window where the application started up. Internally getch() or getche() is called in this routine. Input N = 0: whithout echoing <> 0: whith echoing Output None Return value key code [TOC] [INDEX] 123. Tortoise: Create ----------------------------------------------------------------------------- [F] SUBROUTINE GWTSPAWN(IRTN, IT, IS, M) INTEGER IRTN, IT, IS, M [C] int GWTspawn(int IT, int IS, int M); ----------------------------------------------------------------------------- Description Creates a tortoise for Tortoise Graphics, a.k.a. Turtle Graphics. A tortoise possesses a graphic object, which is one of a pen, a mark, a symbol, a bitmap or a combo, to leave its trail as graphics and has the current position and the current direction as its attributes. Any number of tortoises can be created and each tortoise is identified with a positive number, the tortoise number. The tortoise number of a tortoise to be created can be specified with the input parameter IT. If IT <= 0 is specified, an available number for the tortoise number is used. If succeeded this returnes the tortoise number of the one created, otherwise returnes 0 if failed due to a tortoise that has the same tortoise number, for example. The sort of the graphic object is specified by IS with M. The initial position is set equal to the current position (see GWLINE2) and the initial direction to the right. When the specified graphic object is not a bitmap nor a combo, its logical color number is set equal to '(the tortoise number) mod 18 + 1' if none specified. Other initial attributes of the graphic object are the same as those of the corresponding current object (see GWSETPEN, GWTSETMRK, GWTSETSYM). As default a pen is used for the graphic object. Input IT = a tortoise number of a tortoise to be created IS = sort of the graphic object (meaning of the input parameter M) = 1: pen (the logical color number) = 2: mark (the logical color number) = 3: symbol (the logical color number) --- not supported yet = 4: bitmap (the bitmap number) --- not supported yet = 5: combo (the combo number) --- not supported yet Output IRTN = the number of the tortoise created ( > 0 ), 0 if failed. [TOC] [INDEX] 124. Tortoise: Turn ----------------------------------------------------------------------------- [F] SUBROUTINE GWTTURN(IRTN, IT, DA) INTEGER IRTN, IT REAL DA [F] SUBROUTINE GWDTTURN(IRTN, IT, DA) INTEGER IRTN, IT REAL*8 DA [C] int GWTturn(int IT, float DA); [C] int GWDTturn(int IT, double DA); ----------------------------------------------------------------------------- Description Turns a specified tortoise by changing the current forward direction by an amount DA. Input IT = the tortoise number ( > 0 ) DA = change in angle of the forward direction of the tortoise measured with respect to the x-axis in counterclockwise in the unit of deg/360. Output IRTN = the number of the tortoise ( > 0 ), 0 if failed. [TOC] [INDEX] 125. Tortoise: Move Forward ----------------------------------------------------------------------------- [F] SUBROUTINE GWTFORWARD(IRTN, IT, D) INTEGER IRTN, IT REAL D [F] SUBROUTINE GWDTFORWARD(IRTN, IT, D) INTEGER IRTN, IT REAL*8 D [C] int GWTforward(int IT, float D); [C] int GWDTforward(int IT, double D); ----------------------------------------------------------------------------- Description Moves forward (D > 0) or backward (D < 0) the tortoise specified with |IT| from its current position by the distance |D|, and draws a line segment if IT > 0. The world coordinates of the end point of the move is calculated as (x + D*cos(2*pi*A), y + D*sin(2*pi*A)) where (x, y) is the current world position and A the angle of the forward direction (in deg/360) with pi = 3.14... So it should be note that if the world coordinate system ( see GWINDOW ) is not set isotropic the actual angle of the line segment appeared on your display is different from that expected with the value of the current direction A. Input |IT| = the tortoise number |D| = the world distance to the end point Output IRTN = the number of the tortoise ( > 0 ), 0 if failed. [TOC] [INDEX] 126. Tortoise: Displace ----------------------------------------------------------------------------- [F] SUBROUTINE GWTSHIFT(IRTN, IT, DX, DY) INTEGER IRTN, IT REAL DX, DY [F] SUBROUTINE GWDTSHIFT(IRTN, IT, DX, DY) INTEGER IRTN, IT REAL*8 DX, DY [C] int GWTshift(int IT, float DX, float DY); [C] int GWDTshift(int IT, double DX, double DY); ----------------------------------------------------------------------------- Description Displaces the tortoise specified with |IT| from its current position by the displacement (DX, DY) given in the world coordinate system, and draws a line segment if IT > 0. Input IT = the tortoise number ( > 0 ) DX = the world x component of the displacement DY = the world y component of the displacement Output IRTN = the number of the tortoise ( > 0 ), 0 if failed. [TOC] [INDEX] 127. Tortoise: Move To ----------------------------------------------------------------------------- [F] SUBROUTINE GWTMOVE2(IRTN, IT, X, Y) INTEGER IRTN, IT REAL X, Y [F] SUBROUTINE GWDTMOVE2(IRTN, IT, X, Y) INTEGER IRTN, IT REAL*8 X, Y [C] int GWTmove2(int IT, float X, float Y); [C] int GWDTmove2(int IT, double X, double Y); ----------------------------------------------------------------------------- Description Moves the tortoise specified with |IT| from its current position to the specified end point (X, Y) given in the world coordinate system, and draws a line segment if IT > 0. Input IT = the tortoise number ( > 0 ) X = the world x coordinate of the end point Y = the world x coordinate of the end point Output IRTN = the number of the tortoise ( > 0 ), 0 if failed. [TOC] [INDEX] 128. Tortoise: Copy ----------------------------------------------------------------------------- [F] SUBROUTINE GWTCLONE(IRTN, IT1, IT2) INTEGER IRTN, IT1, IT2 [C] int GWTclone(int IT1, int IT2); ----------------------------------------------------------------------------- Description Copies a tortoise of the specified number IT1 > 0 to one with the tortoise number IT2 > 0. If no tortoise with the specified number IT1 does not exists or one with IT2 exists, this routine failes and does nothing. If IT2 == 0 is specified an available number is used as the destination tortoise number. Input IT1 = the source tortoise number ( > 0 ) IT2 = the destination tortoise number ( > 0 ) or 0 Output IRTN = the number of the tortoise created ( > 0 ), 0 if failed. [TOC] [INDEX] 129. Tortoise: Remove ----------------------------------------------------------------------------- [F] SUBROUTINE GWTREMOVE(IRTN, IT) INTEGER IRTN, IT [C] int GWTremove(int IT); ----------------------------------------------------------------------------- Description Removes a tortoise of the specified number IT > 0. If no tortoise with the specified number exists this routine does nothing. Input IT = a tortoise number of a tortoise to be removed Output IRTN = the number of the tortoise removed ( > 0 ), 0 if failed. [TOC] [INDEX] 130. Tortoise: Set Position ----------------------------------------------------------------------------- [F] SUBROUTINE GWTSETPOS(IRTN, IT, X, Y) INTEGER IRTN, IT REAL X, Y [F] SUBROUTINE GWDTSETPOS(IRTN, IT, X, Y) INTEGER IRTN, IT REAL*8 X, Y [C] int GWTsetpos(int IT, float X, float Y); [C] int GWDTsetpos(int IT, double X, double Y); ----------------------------------------------------------------------------- Description Sets the position of a specified tortoise without drawing. Input IT = the tortoise number ( > 0 ) X = the world x coordinate of the tortoise Y = the world x coordinate of the tortoise Output IRTN = the number of the tortoise ( > 0 ), 0 if failed. [TOC] [INDEX] 131. Tortoise: Get Position ----------------------------------------------------------------------------- [F] SUBROUTINE GWTGETPOS(IRTN, IT, X, Y) INTEGER IRTN, IT REAL X, Y [F] SUBROUTINE GWDTGETPOS(IRTN, IT, X, Y) INTEGER IRTN, IT REAL*8 X, Y [C] int GWTgetpos(int IT, float *X, float *Y); [C] int GWDTgetpos(int IT, double *X, double *Y); ----------------------------------------------------------------------------- Description Retrieves the current position in the world coordinate. Input IT = the tortoise number ( > 0 ) Output X = the world x coordinate of the tortoise Y = the world x coordinate of the tortoise IRTN = the number of the tortoise ( > 0 ), 0 if failed. [TOC] [INDEX] 132. Tortoise: Set Direction ----------------------------------------------------------------------------- [F] SUBROUTINE GWTSETDIR(IRTN, IT, A) INTEGER IRTN, IT REAL A [F] SUBROUTINE GWDTSETDIR(IRTN, IT, A) INTEGER IRTN, IT REAL*8 A [C] int GWTsetdir(int IT, float A); [C] int GWDTsetdir(int IT, double A); ----------------------------------------------------------------------------- Description Sets the forward direction of a specified tortoise. Input IT = the tortoise number ( > 0 ) A = angle of the forward direction of the tortoise measured with respect to the x-axis in counterclockwise with the unit of deg/360. This parameter is ignored if |A| >= 1.0. Output IRTN = the number of the tortoise ( > 0 ), 0 if failed. [TOC] [INDEX] 133. Tortoise: Get Direction ----------------------------------------------------------------------------- [F] SUBROUTINE GWTGETDIR(IRTN, IT, A) INTEGER IRTN, IT REAL A [F] SUBROUTINE GWDTGETDIR(IRTN, IT, A) INTEGER IRTN, IT REAL*8 A [C] int GWTgetdir(int IT, float *A); [C] int GWDTgetdir(int IT, double *A); ----------------------------------------------------------------------------- Description Gets the forward direction of a specified tortoise. Input IT = the tortoise number ( > 0 ) Output A = angle of the forward direction of the tortoise measured with respect to the x-axis in counterclockwise with the unit of deg/360. IRTN = the number of the tortoise ( > 0 ), 0 if failed. [TOC] [INDEX] 134. Tortoise: Set Color ----------------------------------------------------------------------------- [F] SUBROUTINE GWTSETCOL(IRTN, IT, IPC) INTEGER IRTN, IT, IPC [C] int GWTsetcol(int IT, int IPC); ----------------------------------------------------------------------------- Description Sets the color of a specified tortoise. Input IT = the tortoise number ( > 0 ) IPC = the logical color number (see GWCOLOR) Output IRTN = the number of the tortoise ( > 0 ), 0 if failed. [TOC] [INDEX] 135. Tortoise: Get Color ----------------------------------------------------------------------------- [F] SUBROUTINE GWTGETCOL(IPC, IT) INTEGER IPC, IT [C] int GWTgetcol(int IT); ----------------------------------------------------------------------------- Description Gets the color of a specified tortoise. Input IT = the tortoise number ( > 0 ) Output IPC <> -1; the logical color number (see GWCOLOR) = -1; if failed [TOC] [INDEX] 136. Tortoise: Set Pen Attributes ----------------------------------------------------------------------------- [F] SUBROUTINE GWTSETPEN(IRTN, IT, IPC, IPS, IPW) INTEGER IRTN, IT, IPC, IPS, IPW [C] int GWTsetpen(int IT, int IPC, int IPS, int IPW); ----------------------------------------------------------------------------- Description Sets the pen attributes of a specified tortoise. Input IT = the tortoise number ( > 0 ) IPC = the logical color number (see GWCOLOR) IPS = pen style (see GWCOLOR) IPW = pen width (see GWCOLOR) Output IRTN = the number of the tortoise ( > 0 ), 0 if failed. [TOC] [INDEX] 137. Tortoise: Set Mark Attributes ----------------------------------------------------------------------------- [F] SUBROUTINE GWTSETMRK(IRTN, IT, MT, S, K, KS, KB, MX) INTEGER IRTN, IT, MT, K, KS, KB, MX REAL S [F] SUBROUTINE GWDTSETMRK(IRTN, IT, MT, S, K, KS, KB, MX) INTEGER IRTN, IT, MT, K, KS, KB, MX REAL*8 S [C] int GWTsetmrk(int IT, int MT, float S, int K, int KS, int KB, int MX); [C] int GWDTsetmrk(int IT, int MT, double S, int K, int KS, int KB, int MX); ----------------------------------------------------------------------------- Description Sets the mark number MT, the size S in world coordinate, the logical mark color K for the pen, the logical mark color KS for the brush, the logical background mark color KB, and the mix mode MX to the current mark. When MX > 15, the value (MX-16) is used as the "binary raster operation code [W]". Negative numbers specified for parameters do not change corresponding attributes, except for K and KB (see GWCOLOR). If MT = 0 is specified, the parameter S is read a size of a dot, precisely a small solid rectangle, in pixels and so the size of any instance of such a dot is independent of the view mode, or not expanded even in 'Zoom in' mode, for example. Input IT = the tortoise number ( > 0 ) MT = 0: dot 1: solid rectangle 2: + 3: x 4: superposition of + and X 5: filled rectangle 6: filled circle others: neglected S = the size of a dot in pixels (MT = 0) = the height in the world coordinate > 0.0 (MT > 0) K != -1: the logical color value for the pen (see GWCOLOR) = -1: unchanged KS != -1: the logical color value for the brush (see GWCOLOR) = -1: unchanged KB != -1: the logical color value for the background (see GWCOLOR) = -1: unchanged = -100: transparent(default) MX = mix mode for the mark (see GWSETPEN) Output IRTN = return code [TOC] [INDEX] 138. Initialize (Calcomp compatible) ----------------------------------------------------------------------------- [F] SUBROUTINE PLOTS(X, Y, LD) [C] None ----------------------------------------------------------------------------- Description Initialize the GrWin library, and then open a window. Implement using GrWin intrinsics: CALL GWOPEN(NW,0) Input X = x coordinate of the initial pen position (in world coordinate system) Y = y coordinate of the initial pen position (in world coordinate system) LD = dummy for compatibility Output None [TOC] [INDEX] 139. Quit (Calcomp compatible) ----------------------------------------------------------------------------- [F] SUBROUTINE PLOTE(MQ) [C] None ----------------------------------------------------------------------------- Description Close all windows opened by the application, and do ending procedures. Implement using GrWin intrinsics: CALL GWQUIT Input MQ = 0 : Display a ending prompt '>' on the console window. 1 : Popup an ending dialog. otherwise: without any prompting Output None [TOC] [INDEX] 140. Draw Line To/Move Pen (Calcomp compatible) ----------------------------------------------------------------------------- [F] SUBROUTINE PLOT(X, Y, IP) REAL X, Y INTEGER IP [C] None ----------------------------------------------------------------------------- Description Move the pen to the point specified by (X, Y). Implement using GrWin intrinsics: CALL GWLINE2(X, Y) or CALL GWMOVE2(X, Y) Input X = x coordinate of the destination point (in world coordinate system) Y = y coordinate of the destination point (in world coordinate system) IP = +/-2: Move with the pen down (draw a line) +/-3: Move with the pen up (do not draw) 999: End of plot (PLOTE) < 0: The origin of the world coordinate is moved to the destination point. Output None [TOC] [INDEX] 141. Set World Coordinate System (Calcomp compatible) ----------------------------------------------------------------------------- [F] SUBROUTINE WINDOW(XL, YT, XR, YB) REAL XL, YT, XR, YB [C] None ----------------------------------------------------------------------------- Description Set the world coordinate system by giving the left, top, right and bottom coordinates of the view port in the required world coordinate system. It should be noted that the argument list is different from the corresponding GrWin intrinsic GWINDOW. Implement using GrWin intrinsics: CALL GWINDOW(XL, YB, XR, YT) Input XL = x coordinate of the left position of the view port YT = y coordinate of the top of the view port XR = x coordinate of the right position of the view port YB = y coordinate of the bottom of the view port Output None [TOC] [INDEX] 142. New Pen (Calcomp compatible) ----------------------------------------------------------------------------- [F] SUBROUTINE NEWPEN(IPC) INTEGER IPC [C] None ----------------------------------------------------------------------------- Description Set the logical color number of the pen. Implement using GrWin intrinsics: GWSETPEN(IPC, -1, -1, -1) Input IPC >= 0: Logical color number. = -1: unchanged < -1: Refer to GWCOLOR in this manual Output None [TOC] [INDEX] 143. Draw Character String (Calcomp compatible) ----------------------------------------------------------------------------- [F] SUBROUTINE SYMBOL(X, Y, H, TXT, A, NC) REAL X, Y, H, A CHARACTER TXT*(*) INTEGER NC [C] None ----------------------------------------------------------------------------- Description Draw a character string from the point (X, Y). Implement using GrWin intrinsics: CALL GWSETTXT(H, A, -1, -1, -1, ' ') CALL GWPUTTXT(X, Y, TXT) Input X = the world x-coordinate of the bottom-left corner of the string Y = the world y-coordinate of the bottom-left corner of the string H > 0: height of the font = 0: use the default height for text fonts < 0: use the height of the current text font TXT = string to be drawn A = angle (in deg, counterclockwise) NC = length of the string in bytes. If 0 or a negative number is specified all characters in TXT are drawn. Output None [TOC] [INDEX] 144. Draw Numeric Value (Calcomp compatible) ----------------------------------------------------------------------------- [F] SUBROUTINE NUMBER(X, Y, H, D, A, ND) REAL X, Y, H, D, A INTEGER ND [C] None ----------------------------------------------------------------------------- Description Draw a numeric value as a string from the point (X, Y). The parameter ND specifies decimal places. Implement using GrWin intrinsics: WRITE(TXT, *) N CALL GWSETTXT(H, A, -1, -1, -1, ' ') CALL GWPUTTXT(X, Y, TXT) Input X = x coordinate of the bottom-left corner of the string Y = y coordinate of the bottom-left corner of the string H > 0: height = 0: use default height for text strings < 0: use current height for text strings D = a REAL to be drawn A = angle (in deg, counterclockwise) ND > 0: decimal places = 0: no decimal place with a decimal point = -1: truncate into an integer < -1: upper |ND| digits in integer part Output None [TOC] [INDEX] 145. Erase Window (Calcomp compatible) ----------------------------------------------------------------------------- [F] SUBROUTINE GCLS(IDMY) [C] None ----------------------------------------------------------------------------- Description Erase the current window. Input IDMY = dummy for compatibility Output None [TOC] [INDEX] Index Function Fortran C # Anchor gwanchor GWanchor 100. Arrange Windows gwarrange GWarrange 20. Begin Making a Combo gwbegincmb GWbegincmb 88. Capture Image gwcapimg GWcapimg 83. Capture Line gwcaplin GWcaplin 72. Capture Point gwcappnt GWcappnt 70. Capture Rectangle gwcaprect GWcaprect 73. Capture Vector gwcapvec GWcapvec 71. Clear Window gwclear GWclear 52. Close Window gwclose GWclose 7. Copy Stored Bitmap gwcopybmp GWcopybmp 81. Copy Stored Combo gwcopycmb GWcopycmb 92. Copy To Clipboard gwclipimg GWclipimg 84. Create Mark as a Combo gwcmbmrk GWcmbmrk 87. Delete Bitmap gwdelbmp GWdelbmp 82. Delete Combo gwdelcmb GWdelcmb 93. Draw Arc gwarc GWarc 44. Draw Bezier gwbezier GWbezier 50. Draw Bitmap gwputbmp GWputbmp 80. Draw Character String (Calcomp compatible) symbol None 143. Draw Closed Arc gwchord GWchord 45. Draw Combo gwputcmb GWputcmb 90. Draw Ellipse gwellipse GWellipse 43. Draw Line Segments gwpolylin GWpolylin 49. Draw Line To/Move Pen (Calcomp compatible) plot None 140. Draw Line To gwline2 GWline2 38. Draw Line gwline GWline 39. Draw Mark gwputmrk GWputmrk 54. Draw Numeric Value (Calcomp compatible) number None 144. Draw Pie gwpie GWpie 46. Draw Polygon gwpolygon GWpolygon 48. Draw Rectangle Filled with Solid Color gwsrect GWsrect 41. Draw Rectangle gwrect GWrect 40. Draw Round Rectangle gwrrect GWrrect 42. Draw Symbol gwputsym GWputsym 33. Draw Text String gwputtxt GWputtxt 30. End Making a Combo gwendcmb GWendcmb 89. Erase Window (Calcomp compatible) gcls None 145. Erase gwerase GWerase 102. Fill Bounded Area gwflood GWflood 51. Flushing gwflush GWflush 103. Get Aspect Ratio gwaspect* GWaspect 118. Get Attributes of Combo gwgetcmb GWgetcmb 91. Get Bitmap Attributes gwgetbmp GWgetbmp 79. Get Brush Attributes gwgetbrs GWgetbrs 27. Get COLORREF value kcolor* GWkcolor 64. Get Current time gwctime GWctime 115. Get Event Status gwevent GWevent 110. Get Keyboard Status On Console kbhit* kbhit 121. Get Keyboard Status On Window gwkybrd GWkybrd 107. Get Mark Attributes gwgetmrk GWgetmrk 55. Get Mouse Status gwmouse GWmouse 108. Get Palette Number gwncolor GWncolor 66. Get Pen Attributes gwgetpen GWgetpen 25. Get Pixel gwgetpxl GWgetpxl 60. Get Position in LDCS gwldcpos GWldcpos 21. Get RGB gwgetrgb GWgetrgb 62. Get Sise in LDCS gwldcsiz GWldcsiz 22. Get Symbol Extent gwgetsym GWgetsym 32. Get System Color gwsysclr GWsysclr 69. Get Text Extent gwgettxt GWgettxt 29. Get Transformation Matrix gwgetxfrm GWgetxfrm 57. Get Version Numbers gwversion GWversion 120. Get View Port gwgetvp GWgetvp 12. Get Window / First gwfirst GWfirst 15. Get Window / Next gwnext GWnext 16. Get World Coordinate System gwgetwn GWgetwn 9. Get a Key Code On Console kbgetch* kbgetch 122. Get/Set Size gwsize GWsize 117. Idling 2 gwidle2 GWidle2 112. Idling gwidle GWidle 111. Initialize (Calcomp compatible) plots None 138. Initialize gwinit GWinit 1. Initialize gwinitx GWinitx 1. Input String gwinput GWinput 94. Interval Timer gwtimer GWtimer 109. Join in a Window gwjoin GWjoin 5. Leave gwleave GWleave 4. Load Bitmap gwloadbmp GWloadbmp 74. Load Custom Color gwloadcc GWloadcc 68. Load Data gwload GWload 96. Load Metafile gwloadcmb GWloadcmb 85. Make Bitmap gwfnt2bmp GWfnt2bmp 77. Make Bitmap gwmakebmp GWmakebmp 76. Maximum value of Floating Point Numbers gwfmax* GWfmax 119. Message Box msgbox* GWmsgbox 35. Move Pen gwmove2 GWmove2 37. New Pen (Calcomp compatible) newpen None 142. Open Window gwopen GWopen 2. Open Window gwopenx GWopenx 2. Pause gwpause GWpause 116. Pen Position gwgetpos GWgetpos 36. Plot 1D Array Elements gwplot1 GWplot1 47. Popup File Dialog gwfiledlg GWfiledlg 95. Print gwprint GWprint 98. Quit (Calcomp compatible) plote None 139. Quit gwquit GWquit 3. Quit gwquitx GWquitx 3. Refresh gwrefresh GWrefresh 104. Reset Parameters gwreset GWreset 6. Retrieve Pixel Sise in WCS gwpxlsiz GWpxlsiz 23. Save Bitmap gwsavebmp GWsavebmp 75. Save Combo as Combo File gwsavecmb GWsavecmb 86. Save Custom Color gwsavecc GWsavecc 67. Save Data gwsaveas GWsaveas 97. Save View Port Info gwsavevp GWsavevp 13. Select View Port gwselvp GWselvp 14. Select Window gwselect GWselect 17. Set Background gwsetbk GWsetbk 101. Set Bitmap Attributes gwsetbmp GWsetbmp 78. Set Brush Attributes gwsetbrs GWsetbrs 26. Set Clipping Region gwsetrgn GWsetrgn 58. Set Color gwcolor GWcolor 61. Set Frame's Show State gwshowfr GWshowfr 19. Set Mark Attributes gwsetmrk GWsetmrk 53. Set Object-Group Number gwsetogn GWsetogn 99. Set Pen Attributes gwsetpen GWsetpen 24. Set Pixel gwsetpxl GWsetpxl 59. Set RGB krgb* GWkrgb 63. Set Symbol Font Attributes gwsetsym GWsetsym 31. Set Text Font Attributes gwsettxt GWsettxt 28. Set Transformation Matrix gwsetxfrm GWsetxfrm 56. Set View Port (in the world coordinate) gwport GWport 11. Set View Port gwvport GWvport 10. Set Window's Show State gwshowwn GWshowwn 18. Set World Coordinate System (Calcomp compatible) window None 141. Set World Coordinate System gwindow GWindow 8. Setting and Inquiring Modes gwmode GWmode 106. Sleep 2 gwsleep2 GWsleep2 114. Sleep gwsleep GWsleep 113. Status Bar gwsetmsg GWsetmsg 34. Tortoise: Copy gwtclone GWTclone 128. Tortoise: Create gwtspawn GWTspawn 123. Tortoise: Displace gwdtshift GWDTshift 126. Tortoise: Displace gwdtshift GWTshift 126. Tortoise: Get Color gwtgetcol GWTgetcol 135. Tortoise: Get Direction gwdtgetdir GWDTgetdir 133. Tortoise: Get Direction gwdtgetdir GWTgetdir 133. Tortoise: Get Position gwdtgetpos GWDTgetpos 131. Tortoise: Get Position gwdtgetpos GWTgetpos 131. Tortoise: Move Forward gwdtforward GWDTforward 125. Tortoise: Move Forward gwdtforward GWTforward 125. Tortoise: Move To gwdtmove2 GWDTmove2 127. Tortoise: Move To gwdtmove2 GWTmove2 127. Tortoise: Remove gwtremove GWTremove 129. Tortoise: Set Color gwtsetcol GWTsetcol 134. Tortoise: Set Direction gwdtsetdir GWDTsetdir 132. Tortoise: Set Direction gwdtsetdir GWTsetdir 132. Tortoise: Set Mark Attributes gwdtsetmrk GWDTsetmrk 137. Tortoise: Set Mark Attributes gwdtsetmrk GWTsetmrk 137. Tortoise: Set Pen Attributes gwtsetpen GWTsetpen 136. Tortoise: Set Position gwdtsetpos GWDTsetpos 130. Tortoise: Set Position gwdtsetpos GWTsetpos 130. Tortoise: Turn gwdtturn GWDTturn 124. Tortoise: Turn gwdtturn GWTturn 124. View Mode gwvwmod GWvwmod 105. Windows Palette ipalette* GWipalette 65. ----------------------------------------------------------------------------- Created: Jun 28, 2003