tgif(n) tgif(n) NAME tgif - Xlib based interactive 2-D drawing facility under X11. Supports hierarchical construction of drawings and easy navigation between sets of drawings. It’s also a hyper-graphics (or hyper-structured-graphics) browser on the World-Wide-Web. SYNOPSIS tgif [-display displayname] [-fg ] [-bg ] [-bd ] [-rv] [-nv] [-bw] [-reqcolor] [-cwo[+sbwarp]] [-hyper] [-exec ] [-dbim {xcin|chinput|xim|kinput2|tgtwb5[,font]}] [-sbim xim] [-usexlib] [{-a4|-letter}] [-listdontreencode] [-version] [-pdfspd | -pdfspd=true | -pdfspd=false ] [-pssetup "" ] [-tgwb2 [-rmcastlibdir | -rmcastlibpath ]] [-nomode] [-geometry ] [=] [{file[.obj]|-merge file1[.obj] file2[.obj] ...}] or tgif -print [-eps] [-p] [-ps] [-f] [-text] [-epsi] [-tiffepsi] [-gif] [-png] [-jpeg] [-ppm] [-pbm] [-xpm] [-xbm] [-html] [-pdf] [-netlist] [-svg] [-display displayname] [-stdout] [-raw[+h[eaderonly]]] [-doseps- filter [-previewonly]] [-status] [-gray] [-color | -reqcolor] [-adobe | -adobe=/ | -adobe=false ] [-dontreencode= | -listdontreencode] [-version | -justversion] [-producedby=] [-page ] [-print_cmd ""] [-one_file_per_page] [-pepsc] [-pdfspd | -pdfspd=true | -pdfspd=false ] [-pssetup "" ] [-j2p6_cmd "" ] [-dontcondense | -condensed] [{-a4|-letter}] [-noshowpageineps] [-quiet] [-bop_hook ""] [-eop_hook ""] [-tmp_file_mode ""] [-patterndir ""] [-o] [-exec ] [file1[.obj] file2[.obj] ...] DESCRIPTION Tgif is an interactive drawing tool that allows the user to draw and manipulate objects in the X Window System. Tgif runs interactively in the first form. In the second form shown in the SYNOPSIS section, tgif just prints file1.obj, file2.obj, etc. (generated by tgif) into PostScript(TM) page description files (without opening windows or fonts) and pipes them to lpr(1) if none of the -eps, -p, -epsi, -tiffepsi, -gif, -png, -jpeg, -ppm, -pbm, -xpm, -xbm, -html, -pdf, -ps, -f, -text, -netlist, or -svg options are specified. This form of printing is tgif’s way of exporting a tgif file to another format. In this case, any other unrecognized command line options are sent to lpr(1). In this mode, tgif is compatible with the obsoleted prtgif. A symbol file (see descriptions below) can also be printed by specifying the .sym extension explicitly. The command line argument file specifies a file or an Uniform Resource Locator (URL) of objects to be initially edited by tgif. Only HTTP or FTP URL’s are supported. (For a more detailed description of URL and the World-Wide-Web, the reader is referred to [1].) Tgif is purely based on Xlib. It is tested under X11R6, and it requires a 3 button mouse. OPTIONS In the first form shown in the SYNOPSIS section, the command line argu- ments can be: -fg Foreground color specified in . -bg Background color specified in . -bd Border color specified in . -rv Start tgif in reversed-video mode. -nv Start tgif in normal-video mode. -bw Start tgif in black and white mode. -reqcolor Same effect as setting the Tgif.PrintUsingRequestedColor X default to true (see the X DEFAULTS section below). -cwo Canvas Window Only. Only the canvas window (see TGIF SUBWINDOWS section below) will be displayed. This has the same effect as setting the Tgif.CanvasWindowOnly X default to true. -cwo+sbwarp If -cwo+sbwarp is used, single-button-warp (clicking the left mouse button to warp) is used to activate teleporting (see TELE- PORT/HYPERJUMP section below). -hyper Start tgif in the hyperspace mode (see HYPERSPACE section below). -exec After tgif starts, execute the internal command in (see INTERNAL COMMANDS section below). If is the string "-", tgif executes internal commands from the standard input. -dbim method Use method as the input method for double-byte fonts (see SQUARE DOUBLE BYTE FONTS section below). This cannot be used in con- junction with -sbim. -sbim method Use method as the input method for single-byte fonts. This is useful if the X Keyboard Extension is used in inputing interna- tional characters (with dead keys). This cannot be used in con- junction with -dbim. -usexlib If tgif is compiled with -DUSE_XT_INITIALIZE, X Toolkit initial- ization routines will be used to setup tgif. Using this command line option will force tgif to ignore the -DUSE_XT_INITIALIZE compiler option and use Xlib only. This is useful when the sys- tem resource file for tgif is not installed properly or messed up and needs to be bypassed. -a4 Using this option has the same effect as setting the Tgif.PSA4PaperSize X default to true. -letter Using this option has the same effect as setting the Tgif.Ini- tialPaperSize X default to "letter" -noshowpageineps Using this option has the same effect as setting the Tgif.Show- PageInEPS X default to false. -quiet If this option is used, tgif will suppress standard messages. -listdontreencode= If this option is used, tgif will print out the list of PostScript font names specified in the -D_DONT_REENCODE compiler option used in compiling tgif. In the second form shown in the SYNOPSIS section, the command line arguments can be: -version If this option is used, tgif will print out its version number and copyright on the command line. -justversion If this option is used, tgif will print out its version number and copyright on the command line and exits immediately. -nomode Using this option has the same effect as setting the Tgif.NoMod- eWindow X default to true. -eps (or -p) Generates an Encapsulated PostScript(TM) file in file.eps; this file can be included in a LaTeX file through the \psfig, \epsf, or \psfile construct (see the LATEX FIGURE FORMATS section below). -ps (or -f) Generates a PostScript file in file.ps; this file can be printed to a PostScript printer with lpr(1). -text Generates a text file in file.txt; the text file contains all visible text and can be fed to a spell checker. -epsi Generates an Encapsulated PostScript (EPS) file with a preview bitmap in file.eps. Tgif aborts if a valid display is not accessible. -tiffepsi Generates an EPS file with a DOS EPS Binary File Header and a trailing TIFF image in file.eps. See the GENERATING MICROSOFT WINDOWS EPSI FILES section for more details. Tgif aborts if a valid display is not accessible. -gif Generates a GIF file in file.gif. Please see the notes for Tgif.GifToXpm in the X DEFAULTS section below. Tgif aborts if a valid display is not accessible. -png Generates a PNG file in file.png. Tgif aborts if a valid dis- play is not accessible. -jpeg Generates a JPEG file in file.jpg. Tgif aborts if a valid dis- play is not accessible. -ppm Generates a PPM file in file.ppm. Tgif aborts if a valid dis- play is not accessible. -pbm Generates a PBM file in file.pbm. Tgif aborts if a valid dis- play is not accessible. -xpm Generates an X11 pixmap (XPM) file in file.xpm. Tgif aborts if a valid display is not accessible. -xbm Generates an X11 bitmap (XBM) file in file.xbm. Tgif aborts if a valid display is not accessible. -html Generates a GIF file in file.gif and an HTML file in file.html. Tgif aborts if a valid display is not accessible. -pdf Generates a PDF file in file.pdf. Please see the notes for Tgif.PsToPdf in the X DEFAULTS section below. -netlist Generates a text file in file.net and a text file in file.cmp. file.net contains netlist information stored in a table. The first line in it contains column names and each line in it is a port name (surrounded by double-quotes), followed by a comma and a character, followed by a signal name (also surrounded by double-quotes). file.cmp contains information about components in the file. Each component begins with its name followed by its type. The attributes of a component are printed afterwards (indented by characters). -svg Generates an SVG file in file.svg. Please see the notes for Tgif.EpsToTmpSvg and Tgif.TmpSvgToSvg in the X DEFAULTS section below. -stdout Sends the output to the standard output instead of generating the output in a file. -raw Causes the content of the files to be dumped to stdout. -raw+h If -raw+h is used and if the file is an HTTP URL, the HTTP header is also dumped to stdout. -raw+headeronly If -raw+headeronly is used and if the file is an HTTP URL, the HTTP header is dumped to stdout. -dosepsfilter Makes tgif act as a filter for getting rid of the DOS EPS Binary File Header and the trailing TIFF image in a DOS/Windows EPS file. -previewonly If -dosepsfilter is specified, -previewonly makes tgif act as a filter for extracting the preview bitmap from the trailing TIFF image in a DOS/Windows EPS file. -status If this option is used in conjunction with either -raw, -raw+h, or -raw+headeronly causes a status line to be displayed in stderr. -gray Using this option has the same effect as setting the Tgif.UseG- rayScale X default to true (see the X DEFAULTS section below). -color (or -reqcolor) To print in color, one can use either the -color or the -req- color option. The only difference between the two is that using -reqcolor has the same effect as setting the Tgif.PrintUsingRe- questedColor X default to true (see the X DEFAULTS section below). -adobe (or -adobe=/ -adobe=false) Using this option has the same effect as specifying the Tgif.UsePsAdobeString X default. -dontreencode= Using this option has the same effect as specifying the Tgif.DontReencode X default. -producedby= Using this option has the same effect as specifying the Tgif.ProducedBy X default. -page Causes a specified page (specified by ) to be printed. -print_cmd Using this option has the same effect as specifying the Tgif.PrintCommand X default. -one_file_per_page Causes each page to be printed into a separate file. -pepsc Preserve EPS Comment. This command line option became obsolete since EPS comments are always preserved starting from tgif-4.0.11. -nolandpdfspd This commandline option became obsolete in tgif-4.1.42. It is interpreted as -nopdfspd. -pdfspd (or -pdfspd=true -pdfspd=false) If -pdfspd or -pdfspd=true is specified, "setpagedevice" is gen- erated in the interim PostScript file when exporting PDF files or in the final PostScript file when exporting PS files. If -pdfspd=false is specified, no "setpagedevice" will be generated in the interim PostScript file when exporting PDF files or in the final PostScript file when exporting PS files. This option overrides the Tgif.PdfSetPageDevice X default. -pssetup Using these options have the same effect as specifying the Tgif.AdditionalPSSetup X default. -tgwb2 This commandline option enables the Tangram Whiteboard feature in tgif. It requires librmcast.so (Reliable IP-multicast library). The location of the rmcast library can be specified by the optional commandline argument -rmcastlibdir. Alterna- tively, the full path to the rmcast library can be specified by using the optional commandline argument -rmcastlibpath. (Please note that the rmcast library has only been extensively tested on Linux machines.) -j2p6_cmd Using this option has the same effect as specifying the Tgif.JpegToPpm6 X default. -dontcondense Using this option has the same effect as setting the Tgif.Dont- CondensePSFile X default to true. -condensed Using this option has the same effect as setting the Tgif.Dont- CondensePSFile X default to false. -bop_hook and -eop_hook Using these options have the same effect as specifying the Tgif.PSBopHook and Tgif.PSEpsHook X defaults. -tmp_file_mode Using this option have the same effect as specifying the Tgif.TmpFileMode X defaults. -patterndir Using this option have the same effect as specifying the Tgif.CustomPatternDir X defaults. -o If this option is not specified, the output file (eps, ps, etc.) goes into the same directory as the input file. If -o is specified, the output file goes into the directory specified by . -merge file1 file2 ... Using this option merges file1.obj, file2.obj, etc. into a mul- tipage file. BASIC FUNCTIONALITIES Primitive objects supported by tgif are rectangles, ovals, rounded-cor- ner rectangles, arcs, polylines, polygons, open-splines, closed- splines, text, X11 bitmaps, some specific forms of X11 pixmaps, and Encapsulated PostScript. (Please note that the splines tgif draw are not Bezier curves.) Objects can be grouped together to form a grouped object. A primitive or a grouped object can be made into an icon object or a symbol object through user commands. Tgif objects are stored in two types of files. A file with a .obj extension (referred to as an object file) is a file of objects, and a file with a .sym extension (referred to as a symbol file) specifies a ‘‘building-block’’ object. A teleport mechanism is provided to travel (or hyperjump) among the .obj files. A building-block object consists of the representation part and the definition part (which can be empty) of the object. Tgif supports the ‘‘bottom-up’’ construction of hierar- chical drawings by providing the capability to ‘‘instantiate’’ a build- ing-block object in a drawing. Tgif also supports the ‘‘top-down’’ specification of drawings by allowing the user to make any object a representation of an un-specified subsystem. Both types of files are stored in the form of Prolog facts. Prolog code can be written to interpret the drawings! (It is left to the user to produce the code. See the PROLOG/C TESTDRIVE section for more details.) Prolog engines are referred to as drivers in the sections to follow. (Other types of drivers are also allowed, e.g., written in C.) Text based attributes can be attached to any non-text object. Attributes specified in the representation part of a building-block object are non-detachable when such an object is instantiated. See the ATTRIBUTES section for details. Tgif can generate output in a few different formats. By default, the output is in the PostScript format (color PostScript is supported), and it is generated into a file named /tmp/Tgifa* (produced by mktemp() calls) where * is a number; this file is piped to lpr(1). This takes place when the laser-printer icon is displayed in the Choice Window (see the TGIF SUBWINDOWS section for the naming of tgif windows). This output can be redirected to a file with a .ps extension. This takes place when the PS icon is displayed in the Choice Window. When the PDF icon is displayed in the Choice Window, the output is generated into a file with a .pdf extension. By default, tgif calls ps2pdf(1) from the ghostscript(1) package to convert a PS file to a PDF file. When the LaTeX (or EPSI) icon is displayed in the Choice Window, the output is generated into a file with a .eps extension. This file is in the Encapsulated PostScript (or Encapsulated PostScript Interchange) for- mat; it can be included in a LaTeX document with the \psfig or the \epsf construct; this will be discussed later. The only difference between the EPS and EPSI formats is that an EPSI file contains a pre- view bitmap. However, it takes time to generate the preview bitmap. If the EPS/EPSI file is to be incorporated into some tool that does not know how to use the preview bitmap, time can be saved by not using the EPSI format. When the T icon is displayed in the Choice Window, the output is generated into a file with a .txt extension. This is a text file containing all visible text; it can be fed to a spell checker. When the x11bm (X11 bitmap) icon is displayed in the Choice Window and color output is not selected, tgif generates the output with the .xbm extension; the output is in the X11 bitmap format. However, if the x11bm icon is displayed in the Choice Window and color output is selected (through the ^#k keyboard command -- ^ denotes the and # denotes the or key), then tgif generates the output with the .xpm extension, and the output is in the X11 pixmap format (the version of this XPM format depends on the settings of the Tgif.XPmOutputVersion X default). When the GIF icon is displayed in the Choice Window, the output is generated into a file with a .gif extension. By default, tgif calls xpmtoppm and ppmtogif from the netpbm(1) package to convert an XPM file to a GIF file. X11 bitmap files, certain forms of X11 pixmap files (such as the one generated by tgif; see the section on X11 PIXMAP for details), GIF files, and Encapsulated PostScript (EPS) files can be imported into tgif and be represented as tgif primitive objects. Files in other raster formats (e.g, JPEG, TIFF, etc.) can also be imported into tgif if external tools can be used to convert them into X11 pixmap files. Please see the IMPORT RASTER GRAPHICS section for details. Tgif drawings are supposed to be printed on letter size paper (8.5in by 11in). Both landscape and portrait page styles are supported by tgif. Reduction (or magnification) can be controlled by the #% keyboard com- mand to set the reduction/magnification. If the compiler flag -DA4PAPER is defined (in Imakefile or Makefile.noimake), then the out- put is supposed to be printed on A4 papers (which has approximate dimensions of 8.25in by 11.7in). GRAPHICAL OBJECTS An object in an object (.obj) file can be a primitive object, a grouped object, or an icon object. A symbol (.sym) file can have any number of objects allowed in an object file and exactly one symbol object. (Recall that a symbol file specifies a building-block object.) The symbol object in a symbol file is the representation part of the build- ing-block object, and the rest of the symbol file is the definition part of the building-block object. The symbol object is highlighted with a dashed outline to distinguish it from the rest of the objects. When a building-block object is instantiated, the symbol part of the file is copied into the graphics editor, and it becomes the icon for the building-block object. All objects in tgif can be moved, duplicated, deleted, rotated, flipped, and sheared. However, in the non-stretchable text mode, text objects can not be stretched. For an text object, if it has not been stretched, rotated, or sheared, flipping it horizontally will cause the text justification to change and flipping it vertically has no effect. Tgif supports 32 fill patterns, 32 pen patterns, 7 default line widths, 4 line styles (plain, head arrow, tail arrow, double arrows) for poly- lines and open-splines, 9 dash patterns, 3 types of text justifica- tions, 4 text styles (roman, italic, bold, bold-italic), 11 default text sizes (8, 10, 12, 14, 18, and 24 for the 75dpi fonts and 11, 14, 17, 20, 25, and 34 for the 100dpi fonts), 5 default fonts (Times, Courier, Helvetica, New-Century-Schoolbook, Symbol), and 11 default colors (magenta, red, green, blue, yellow, pink, cyan, cadet-blue, white, black, dark-slate-gray). Additional line widths can be added through the use of Tgif.MaxLineWidths, Tgif.LineWidth#, Tgif.ArrowWidth#, and Tgif.ArrowHeight# X defaults. Additional text sizes can be added through the use of Tgif.FontSizes X default. Addi- tional fonts can be added through the use of Tgif.AdditionalFonts X default. If the defaults fonts are not available, their replacement fonts can be specified by Tgif.HasAlternateDefaultFonts and related X defaults. Additional colors can be added through the use of Tgif.Max- Colors, and Tgif.Color# X defaults. One can also select AddColor() or ChooseColor() from the Properties Menu to add a color. Alternate startup colors can be selected through the use of the Tgif.ColorFromX- Pixmap, Tgif.UseStdPalette8, Tgif.UseStdPalette27, Tgif.UseStd- Palette64, Tgif.UseStdPalette216, Tgif.UseMobileWebSafePalette, Tgif.UseOpenOfficeGalaxyPalette, Tgif.UseOpenOfficeGooglePalette, and Tgif.AdditionalColors X defaults. Most commands in tgif can either be activated by a popup menu or by typing an appropriate non-alphanumeric key. All operations that change any object can be undone and then redone. Commands such as zoom, scroll, change fonts while no text objects are selected, etc. are not undoable. The undo/redo history buffer size can be set using the Tgif.HistoryDepth X default. TGIF SUBWINDOWS The tgif windows are described in this section. Top Window Displays the current domain and the name of the file tgif is looking at. Mouse clicks and key presses have no effect. Menubar Window This window is right under the Top Window. Pull-down menus can be activated from it with any mouse buttons. Key presses have no effect. If HideMenubar() is selected from the Layout Menu, this window becomes invisible. If ShowMenubar() is selected from the Layout Menu (which can be activated from the Canvas Window below), this window becomes visible. The View, Text, and Graphics pull-down menus are cascading menus and can not be pinned (see the Popup Menus subsection below for a description). Message Window This is right under the Menubar Window and to the right It dis- plays tgif messages. Clicking the left mouse button in this window scrolls the messages towards the bottom, clicking the right mouse button scrolls towards the top, and clicking or dragging the middle mouse button scrolls to the location in the message history depending on where the mouse is clicked. If the (or ) key is held down when clicking the left/right mouse button, it scrolls right/left. Panel (Choice) Window This is the window to the left of the Message Window, and it contains a collection of icons (not to be confused with the tgif icon objects) reflecting the current state of tgif. In top/bot- tom, left/right order, it displays the current drawing mode, the page style (portrait or landscape), edit (see below), print/export mode, zoom factor, move and stretch mode (con- strained or unconstrained), radius for rounded-corner rectan- gles, text rotation, page number or row/column, page layout mode (stacked or tiled), horizontal alignment (L C R S -), vertical alignment (T M B S -), font, text size, vertical spacing between lines of text within the same text object, text justification, shape (see below), stretchable or non-stretchable text mode, dash pattern, line style, polyline, spline, or interpolated spline, line width, fill pattern, pen pattern, color, and spe- cial (see below). Key presses have no effect in this window. In addition to displaying the current state of tgif, the icons in the Choice Window can also be used to change the current state. Each icon is associated with a particular state variable of tgif. Clicking the left mouse button on top of an icon cycles the state variable associated with the icon forward; clicking the right mouse button cycles the state variable back- wards. Dragging the middle mouse button on top of an icon usu- ally generates a popup menu which corresponds to an entry in the Main Menu for the Canvas Window below. (The ‘‘edit’’, ‘‘shape’’, and ‘‘special’’ icons mentioned above are dummy icons that allow the ‘‘edit’’, ‘‘shape’’, and ‘‘special’’ menus to be accessed in the Choice Window. They do not respond to left and right mouse clicks.) The response to the dragging of the middle mouse button is different for the zoom, radius, and vertical spacing icons. Dragging the mouse left or up increases the zoom or decreases the radius or vertical spacing; dragging the mouse right or down has the opposite effect. If there are objects selected in the canvas window, then the action of the mouse will cause the selected objects to change to the newly selected mode; note that in this case, the current choice won’t change if the middle mouse button is used (unless the Tgif.StickyMenuSelection X default is set to true). The settings of the horizontal and vertical alignments determine how objects (or vertices) align with each other when the ^l key- board command is issued, how each individual object (or vertex) aligns with the grids when the ^t keyboard command is issued, how objects or vertices distribute spatially with respect to each other when the #l keyboard command is issued, and how each icon replaces the old icon when the ^#u keyboard command is issued. The horizontal alignments are left (L), center (C), right (R), space (S), and ignore (-). The vertical alignments are top (T), middle (M), bottom (B), space (S), and ignore (-). In aligning operations, the space (S) and the ignore (-) settings have the same effect. The space settings are used to distribute objects such that the gaps between any two neighbor- ing objects are equal. In vertex mode, any non-ignore setting will cause the selected vertices to be spaced out evenly. The best way to understand them is to try them out. The text vertical spacing determines the vertical distance to advance when a carriage return is pressed during text editing. If the user tries to set the value too negative, such that the next line is exactly at the same position as the current line, such a setting will not be allowed (this distance depends on the current font and font size). Canvas Window This is the drawing area. The effects of the actions of the mouse are determined by the current drawing mode. Before tgif-4.x, dragging the right mouse button will generate the Mode Menu. This is disabled by default in tgif-4.x, but you can turn it on using the Tgif.Btn3PopupModeMenu X default. The drawing modes are (in order, as they appear in the Mode Menu) select, text, rectangle, corner oval, center oval, edge circle, polyline (open-spline), polygon (closed-spline), arc (center first), arc (endpoints first), rounded-corner rectangle, freehand polyline (open-spline), select vertices, and rotate/shear. When drawing a rectangle, an oval, or a rounded- corner rectangle, if the key is held down, a square, a circle, or a rounded-corner square is drawn. Dragging the mid- dle mouse button will generate the Main Menu. In the select mode, left mouse button selects, moves, stretches, and reshapes objects (double-click will ‘‘de-select’’ all selected objects in vertex mode). When an object is selected, it is highlighted by little squares (referred as handles here) at the corners/vertices (using the Tgif.HandleSize X default, the sizes of the handles can be customized). Dragging one of the handles stretches/reshapes the selected object. If one wants to move a selected object, one should not drag the han- dles. Instead, one should drag other parts of the object. For example, if the object is a hollow rectangle (the fill is NONE and the pen is not NONE), in order to select the rectangle, one should click on the outline of the rectangle with the left mouse button. If one would like to move the rectangle, one should drag the outline of the rectangle with the left mouse button. If the object is a filled rectangle (fill is not NONE), one can click inside the rectangle to select it and drag anywhere inside the rectangle to move it. Holding down the key and clicking the left mouse on an object which is not currently selected will add the object to the list of already selected objects. The same action applied to an object which is already selected will cause it to be de- selected. When stretching objects (not reshaping poly-type objects), holding down the key after stretching is ini- tiated activates proportional stretching (basically, a scale operation is being performed). In non-stretchable text mode, text objects can not be stretched or scaled. Double-clicking or clicking the middle mouse button while the key is held down will activate the teleport (or travel), the launch, or the execute internal command mechanism. See the sections on TELEPORT/HYPERJUMP, LAUNCH APPLICATIONS, and INTER- NAL COMMANDS for details. Teleporting has precedence over launching, which has precedence over executing an internal com- mand. In the text drawing mode, dragging the middle mouse but- ton while the key is held down inside the edit text area will move the edit text area. The arrow keys can also be used to move selected objects. How- ever, if no objects are selected, using the arrow keys will scroll the drawing area by a small amount, and using the arrow keys when key is held down will scroll a screen full. In the select vertices mode, left mouse button selects and moves vertices. Only the top-level polyline/open-spline and poly- gon/closed-spline objects which are selected when the vertex mode is activated are eligible for vertex operations. In this mode, all eligible objects have their vertices highlighted with squares. When a vertex is selected (using similar mechanism as selecting objects described above), it is doubly highlighted with a ’+’ sign. Operations available to these doubly high- lighted vertices are move, delete, align (with each other), dis- tribute (space them equally), and align to grid. The arrow keys can also be used to move selected vertices. Objects can be locked (through the #< keyboard command). Locked object are shown with gray handles, and they can not be moved, stretched, flipped, rotated, or sheared. When objects are grouped, the resulting grouped object will also be locked if any one of it’s constituents is locked. Locked objects can have their properties, such as color, font, pen, etc., changed; fur- thermore, they can be deleted. If the current move/stretch mode is of the constrained type (activated and deactivated by the #@ keyboard command), top- level polylines will have the following behavior. In a move operation, if both endpoints of a polyline lie inside the objects being moved, then the whole polyline is moved; other- wise, if only one endpoint falls inside the objects being moved, then that endpoint is moved. The vertex that is the neighbor of the moved endpoint may also be moved either horizontally or ver- tically. If the last line segment is horizontal or vertical, then the neighbor vertex may be moved so that the direction of the last line segment is maintained. In a stretch (not reshape) operation, if an endpoint of a polyline lies inside the objects being moved, that endpoint will be moved. The vertex that is the neighbor of the moved endpoint will also be moved in the same manner as described above. When the drawing mode is set to text (a vertical-bar cursor is shown), clicking the left mouse button causes selected text to go into edit mode. Dragging the left mouse button or clicking the left mouse button while the key is held down high- lights substrings of the text. Double-clicking causes a word to be selected. In edit mode, key presses are treated as text strings being inputed, and arrow keys are used to move the cur- rent input position. If a key press is preceded by an key, then the character’s bit 7 is turned on. This allows non- ASCII (international) characters to be entered. One can use xfd(1) to see what the corresponding international character is for an ASCII character. For the Symbol font, symbols such as the integral, partial derivative, and copyright symbols can all be found in this range. There are some characters that are sup- ported by X11 but not by PostScript; these characters are not accepted by tgif. If the text being edited is an attribute of a object, will move the cursor to the next visible attribute and will move the cursor to the previous visible attribute. If the drawing mode is set to draw polygons (not closed-splines) and if the key is held down, the rubber-banded polygon will be self-closing. The freehand drawing mode can be used to draw polylines and open splines. All intermediate points are specified by moving the mouse (as opposed to clicking the mouse buttons as in the poly- line mode). The second endpoint is specified by releasing the mouse button. In all drawing modes (other than the text mode), pressing the key cancels the drawing (creation) of the current object. Middle mouse button always generates the main tgif popup menu. Holding down the key and clicking the right mouse button will change the drawing mode to select. Key presses with the or key held down (referred to as non-alphanu- meric key presses since they can also generate control charac- ters) are treated as commands, and their bindings are summarized in the next section. Users can also define single key commands to emulate the functions of the non-alphanumeric key commands. The SHORTCUTS section will describe the details. Scrollbars Clicking the left mouse button in the vertical/horizontal scrollbar causes the canvas window to scroll down/right by a small distance; clicking the right mouse button has the reverse effect. (The scrollbars in the popup windows for selecting file names and domain names behave similarly.) Clicking with the key held down will scroll a window full. Clicking or dragging the middle button will cause the page to scroll to the location which corresponds to the gray area in the scrollbars. (Tgif insists that the left-top corner of the Canvas Window is at a distance that is a nonnegative multiple of some internal units from the left-top corner of the actual page.) Rulers They track the mouse location. Mouse clicks and key presses have no effect. When the page reduction/magnification is set at 100%, the markings in the rulers correspond to centimeters when the metric grid system is used, and they correspond to inches when the English grid system is used. When the page reduc- tion/magnification is not set at 100%, the markings do not cor- respond to the above mentioned units any more (this is consid- ered as a known bug). Interrupt/Hyperspace Window This window is right below the Message Window and to the left of the horizontal ruler. When the Tgif.IntrCheckInterval X default has a positive value, an interrupt icon is visible when the Can- vas Window is being redrawn. If the user clicks on this window when the interrupt icon is visible, tgif aborts the repainting of the objects. If this is done when a file is being opened (either through Open() or Push()), the drawing of objects is stopped, but the reading of the file continues (reading of the file is not aborted). If tgif is currently in the hyperspace mode (please see the HYPERSPACE section below for more details), a space ship icon will be displayed when the interrupt icon is not being dis- played. Clicking any button in this window will switch tgif in and out of the hyperspace mode. Page Control Window The Page Control Window is to the left of the horizontal scroll- bar. This window is empty if the current page mode is set to the tiled page mode. If the current page mode is set to the stacked page mode, each page has a tab in tabs subwindow of this window. Clicking the left mouse button on a tab goes to the corresponding page. Clicking the middle mouse button brings up the Page Menu. When there are too many pages in a drawing so that one can not see the tabs for all the pages, one can use the icons to the left side of the Page Control Window to scroll the tabs subwindow. Clicking on the first icon scrolls the tabs subwindow such that the first tab is visible. Clicking on the 4th icon scrolls the tabs subwindow such that the last tab is visible. Clicking on the 2nd icon scrolls the tabs subwindow towards the first tab by one tab and clicking on the 3rd icon scrolls the tabs subwindow towards the last tab by one tab. Status Window This window is below the horizontal scrollbar. It shows what action will be taken if a mouse button is depressed. When a menu is pulled down or popped up, this window shows what action will be taken if a menu item is selected. It also displays mis- cellaneous status information. Mouse clicks and key presses have no effect. If HideStatus() is selected from the Layout Menu, this window becomes invisible. If ShowStatus() is selected from the Layout Menu, this window becomes visible. By default, when this window is displaying mouse button status, right-handed mouse is assumed. Setting the Tgif.ReverseMouseS- tatusButtons X default to true will reverse the status (as if a left-handed mouse is used). Popup Menus When a menu is popped up by a mouse drag, the menu can be pinned if it is dragged far enough horizontally (the distance is deter- mined by the setting of the Tgif.MainMenuPinDistance X default). Clicking the right mouse button in a pinned menu will cause it to disappear. Dragging the left mouse button in a pinned menu will reposition the menu (except when the Tgif.TitledPinnedMenu X default is set to true in which case the left mouse button performs the same function as the middle mouse button). Click- ing the middle mouse button in it will activate the item right below the mouse. NON-ALPHANUMERIC KEY BINDINGS Most operations that can be performed in tgif can be activated through non-alphanumeric keys (some operations can only be activated through popup menus or shortcut keys). This section summarizes the operations that can be activated by a key stroke with the and/or the key held down. ‘‘^’’ denotes the key and ‘‘#’’ denotes the key in the following description. (The ‘‘keys.obj’’ file, distributed with tgif, also summarizes the same information, but it is organized differently. This file can be viewed with tgif, and if installed properly, it can be found in the same directory as the ‘‘tgi- ficon.obj’’ file, mentioned in the FILES section of this document.) ^a select all ^b send selected objects to the back ^c copy selected objects into the cut buffer ^d duplicate selected objects ^e save/restore drawing mode ^f send selected objects to the front ^g group selected objects (the grouped object will be brought to the front) ^i instantiate a building-block object ^k pop back to (or return to) a higher level and close the symbol file (reverse of ^v) ^l align selected objects according to the current alignment settings ^n open a new un-named object file ^o open an object file to edit ^p print the current page (or export in XBM, XPM, GIF, HTML, PDF, EPS, or PS formats) ^q quit tgif ^r redraw the page ^s save the current object/symbol file ^t align selected objects to the grid according to the current align- ment ^u ungroup selected objects ^v paste from the cut buffer ^w change the drawing mode to text ^x delete all selected objects ^y change domain ^z escape to driver ^, scroll left ^. scroll right ^- print the current page with a specified command #a attach selected text objects to a selected non-text object as attributes #b escape to driver #c rotate selected objects counter-clockwise #d decrement the grid size #e send a token on a selected polyline #f flash a selected polyline #g show/un-show grid points #h flip the selected objects horizontally #i increment the grid size #j hide the attribute names of the selected objects #k change the drawing mode to select #l distribute selected objects according to the current alignment #m move/justify an attribute of a selected object #n show all the attribute names of the selected objects #o zoom out #p import a .obj or a .sym file into the current file #q change the drawing mode to polyline/open-spline #r change the drawing mode to rectangle #s escape to driver #t detach all the attributes of the selected objects #u undo #v flip the selected objects vertically #w rotate the selected objects clockwise #x escape to driver #y escape to driver #z zoom in #9 create a user-specified arc (12 o’clock position is 0 degree) #0 update the selected objects according to current settings #, scroll up #. scroll down #- show all the attributes of the selected objects #[ align the left sides of objects #= align the horizontal centers of objects #] align the right sides of objects #{ align the top sides of objects #+ align the vertical centers of objects #} align the bottom sides of objects #" make the selected polygon regular (fit the original bounding box) #% set the percent print reduction (if < 100%) or magnification (if > 100%) #: go to default zoom #‘ zoom out all the way so that the whole page is visible #~ save selected objects in a new file #; cut and/or magnify a selected bitmap/pixmap object #_ abut selected objects horizontally #| abut selected objects vertically ## break up text objects into single character text objects #^ scroll to the origin set by SaveOrigin() #@ toggle between constrained and unconstrained move (stretch) modes #$ change the drawing mode to select vertices #& align selected objects to the paper according to the current alignment #* redo #( import an Encapsulated PostScript file #) scale selected objects by specifying X and Y scaling factors #< lock the selected objects (can’t be moved, stretched, flipped, or rotated) #> unlock the selected objects ^#a add points to the selected poly or spline ^#b change the text style to bold ^#c change to center justified text ^#d delete points from the selected poly or spline ^#e change the drawing mode to rounded-corner rectangles ^#f reverse-video the selected bitmap objects ^#g toggle snapping to the grid points ^#h hide all attributes of the selected objects ^#i make the selected object iconic ^#j make the selected icon object a grouped object ^#k select color or black-and-white output ^#l change to left justified text ^#m make the selected object symbolic ^#n make the selected symbol object a grouped object ^#o change the text style to roman ^#p change the text style to bold-italic ^#q change the drawing mode to polygon/closed-spline ^#r change to right justified text ^#s save the file under a new name ^#t change the text style to italic ^#u update iconic representations of selected objects ^#v change the drawing mode to oval ^#w toggle between poly and spline ^#x cycle among the various output file formats ^#y push into (or edit) the definition part of a building-block (icon) object ^#z change the drawing mode to arcs ^#. import an X11 bitmap file ^#, import an X11 pixmap file ^#- toggle between English and Metric grid systems ^#= repeat the last Find command SHORTCUTS The user can define single character shortcut keys to emulate the func- tion of the non-alphanumeric key presses to activate commands. This is done through the use of the Tgif.ShortCuts X default. (Please note that these shortcut keys are only active when the drawing mode is not set to the text mode.) The Tgif.ShortCuts consists of a list of items, each of which specifies the bindings between a key (may be case sensi- tive) and a command. The items are separated by blanks, and each item is interpreted as follows. It consists of two parts, KEY and COMMAND, which are concatenated together with a ’:’ character. The format of the KEY part is one of :x, !x, or x (here the character ’x’ is used as an example; furthermore, the substring must be spelled exactly the way it appears here). The first 2 formats are equivalent, they specify the lower case x; the 3rd format specifies both the characters ’x’ and ’X’. The COMMAND part is a string that matches strings in tgif’s popup menus with space characters removed (exceptions are noted below). This is illustrated by the following example. In the Edit menu, two of the entries are, "Delete ^x" "SelectAll ^a" which means that x activates and Delete() command, and a activates the SelectAll() command. Therefore, both Delete() and SelectAll() are valid names for the COMMAND part of a shortcut specifi- cation. To complete the example, the following line can be used to bind the lower case ’x’ to Delete() and ’a’ or ’A’ to SelectAll(): Tgif.ShortCuts: !x:Delete() \n\ a:SelectAll() For more examples, please see the sample X defaults file, tgif.Xde- faults, included in the tgif distribution. Here is a list of exceptions where the COMMAND does not match a command name in a menu entry. The left entry is a proper COMMAND name, and the right is a list of strings that’s shown in popup menus which the COM- MAND would correspond to. CyclePrintFormat() Printer, LaTeXFig, RawPSFile, XBitmap, TextFile, EPSI, GIF/ISMAP, TiffEPSI, NetList ToggleBW/ColorPS() BlkWhtPS, ColorPS ToggleGridSystem() EnglishGrid, MetricGrid ToggleMapShown() ShowBit/Pixmap, HideBit/Pixmap ToggleUseGrayScale() UseGrayScale, NoGrayScale ToggleMoveMode() ConstMove, UnConstMove ToggleShowMeasurement() ShowMeasurement, HideMeasurement ToggleLineType() (advances between different curved shapes) ScrollPageUp() (scroll up a window full) ScrollPageDown() (scroll down a window full) ScrollPageLeft() (scroll left a window full) ScrollPageRight() (scroll right a window full) FreeHandMode() (change the drawing mode to freehand poly/open- spline) CenterAnEndPoint() (move an endpoint of a polyline object to the center of another object) ToggleNamedAttrShown(=) (toggle name shown for the attribute ) ToggleSmoothHinge() (convert smooth to hinge and hinge to smooth points) ToggleShowMenubar() ShowMenubar, HideMenubar ToggleShowStatus() ShowStatus, HideStatus ToggleShowMode() ShowMode, HideMode ToggleOneMotionSelMove() OneMotionSelMove, ClickSelClickMove ToggleHyperSpace() GoHyperSpace, LeaveHyperSpace ImportOtherFileType() (import using a filter named ) BrowseOtherType() (browse using a filter named ) PrintSelectedObjs() (print selected objects) In addition to the above list, the following are also valid COMMAND names (having the obvious meaning): ScrollLeft(), ScrollRight(), ScrollUp(), ScrollDown(), SelectMode(), DrawText(), DrawBox(), Dra- wOval(), DrawPoly(), DrawPolygon(), DrawRCBox(), DrawArc(), and SelectVertexMode(). COLORS AND COLORMAPS In most X environments, only 256 colors can be displayed at once. In these environment, if an application needs 128 colors and another application needs a totally different 129 colors, both applications can not be displayed at once with all the colors they want. X solves the problem by allowing applications to use their own colormaps (known as private colormaps). Each private colormap can have at most 256 colors. There is also a shared colormap available for applications that do not wish to use private colormaps. The main problem with using private colormaps is that a user will see the the well-known colormap flashing phenomenon when he/she switches in and out of applications that use private colormaps. Tgif uses the shared colormap initially. When it needs more color than what is available in the shared colormap, it will use a private col- ormap automatically. When tgif no longer needs the extra colors, it does not automatically revert to using the shared colormap because it needs to be able to undo operations that use the extra colors. If one does no longer needs the objects in the undo buffer, one can select FlushUndoBuffer() from the Edit Menu to flush the undo buffer. At this point, tgif will attempt to use the shared colormap to avoid the col- ormap flashing problem. If one often uses XPM and GIF objects, one can bind the f key to the FlushUndoBuffer() operation by setting the following X default and uses the f key to regain entries in the colormap when an XPM/GIF object is deleted: Tgif.ShortCuts: !F:FlushUndoBuffer() Even when a private colormap is used, only 256 colors can be used at once. Therefore, it is not possible to import two 256-colors GIF files into the same drawing unless the colors are somehow reduced to fit in the 256-colors colormap. This can be done through dithering which is described in the IMPORT RASTER GRAPHICS section below. IMPORT RASTER GRAPHICS The native raster graphics formats that tgif supports are the XBM and XPM formats. In order to import color raster graphics file of another format, tgif can work with external tools that can convert non-XPM for- mat files to an XPM files. A popular raster format conversion toolkit is the pbmplus(1) (also known as the netpbm(1)) toolkit. It can con- vert a GIF file (e.g., "foo.gif") to an XPM file (e.g., "foo.xpm") with the following command (giftopnm is in netpbm; an earlier version of it called giftoppm exists in pbmplus): giftopnm foo.gif | ppmtoxpm > foo.xpm When working with tgif, a GIF file name will be supplied by tgif and the output of ppmtoxpm will be directly read by tgif through a pipe; therefore, the previous sequence is replaced by an X default containing the following form (which happens to be the default setting for the Tgif.GifToXpm X default): giftopnm %s | ppmtoxpm The "%s" is to be replaced by a GIF file name. The above is referred to as a filter. To be able to import other types of raster graphics files, one can use Tgif.MaxImportFilters and Tgif.ImportFilter# X defaults to specify additional filters. The following example adds a JPEG filter: Tgif.MaxImportFilters: 1 Tgif.ImportFilter0: \n\ JPEG-222 jpg;jpeg \n\ djpeg -gif -colors 222 %s | \n\ giftopnm | ppmtoxpm The "JPEG-222" above is the name given to the filter (must not contain any space character). The "jpg;jpeg" are possible file extensions sep- arated by semicolons. The rest is the filter specification. The djpeg(1) program is part of the libjpeg distribution. It can convert a JPEG file to a GIF file. The above filter also restrict the output to have a maximum of 222 colors. (The 222 is chosen arbitrarily. Many XPM files use some ‘‘standard’’ 32 colors, so one may want to leave room form them.) To invoke a filter, one can select ImportOtherFile() or BrowseOther() commands from the File Menu. This will bring up a dialogbox listing the available filters by their names (e.g., "JPEG-222"). After select- ing a filter, tgif continues in a similar manner as with invoking ImportXPixmap() or BrowseXPixmap() commands from the File Menu. The above example is not suitable for the BrowseOther() command because only 256 colors can be used in a drawing (as explained in the COLORS AND COLORMAPS section above). In order for BrowseOther() to work well, one can use dithering to represent an image with a dithered image that only uses a set of standard colors. The example below uses ppmdither from the pbmplus/netpbm toolkit: Tgif.MaxImportFilters: 2 Tgif.ImportFilter0: \n\ JPEG-222 jpg;jpeg \n\ djpeg -gif -colors 222 %s | \n\ giftopnm | ppmtoxpm Tgif.ImportFilter1: \n\ JPEG-dithered jpg;jpeg \n\ djpeg -gif %s | \n\ giftopnm | ppmdither | ppmtoxpm If one is working with one JPEG image, one can select ImportOtherFile() then select "JPEG-222" to get as many as 222 colors. If one is brows- ing for JPEG images, one can select BrowseOther() then select "JPEG- dithered". OBJECT NAMES If an object contains an attribute (please see the ATTRIBUTES sections below for details) whose name is the string "name" (case-sensitive), the value part of the attribute is the name of the object. Subobject of a composite object can be named using a path, e.g., !!!..., where is the name of a top-level object which directly contains which directly contains , etc. !* refers to the currently selected object (if more than one object is selected, the top-most object in the stacking order is used). !*! names the subobject of the subobject of the currently selected object. The following is not fully supported, yet (only the # form is supported at this time). Every object in a tgif file can be uniquely named using the notation #!, where can be a string that specifies the name of a page or # which specifies a page number. The is described in the previous paragraph. If an object o1 is referenced by another object o2 within the same file (no file name or URL is specified before #) and is omitted, then o1 must be on the same page as o2. If a file name or URL is specified before # and is omitted, then o1 must be on the first page. ATTRIBUTES Attributes are text strings of the form name=value or value which are attached to either the current drawing or any non-text objects. An attribute attached to the current drawing is called a file attribute; otherwise, it is a regular attribute. Attributes can be attached and detached from these objects except in the following case: Attributes appearing in the symbol object in a building-block object file can not be detached when the building-block object is instantiated. These attributes are considered to be the ‘‘inherited’’ attributes of the icon object. (If it is really necessary to detach inherited attributes of an icon object, the icon object can be ‘‘de-iconified’’ by using UnMakeIconic() in the Special Menu to make it a grouped object; then the attributes can be detached.) A file attribute is always invisible. For a regular attribute, the user has control over which part of the attribute is displayed. An entire attribute can be made invisible, or only its name can be made invisible (accomplished through the commands under the special menu, such as #m, #n, #j, #-, and ^#h). TELEPORT/HYPERJUMP Tgif provides the mechanism to travel between .obj and .sym files. If the middle mouse button is clicked on an object with the key held down (or double-clicking such an object), tgif looks for an attribute named warp_to (by default) or href of that object. The only difference between warp_to and href is that ".obj" is automatically appended to the value of a warp_to attribute while the value of a href attribute is taken as is. (Please note that warp_to is obsolete now. It is still supported for the sake of compatibility.) If such an attribute is found, the value part of the attribute is interpreted as the name of a .obj file to travel to. (If tgif is in the hyperspace mode, then clicking the left mouse button has the same effect.) If there are multiple href attributes on the object, but are in different colors, tgif will use the one that has the same color as the current color appearing in the Choice Window. If the current file is modified, the user is prompted to save the file before traveling to the next file. If the value part of the href attribute starts with the ’/’ character, the value is treated as an absolute file name; otherwise, it is treated as a relative file name. HYPERSPACE Tgif provides a hyperspace mode to facilitate traveling between .obj files. The hyperspace mode is entered when GoHyperSpace() is selected from the Navigate Menu. In hyperspace mode, the little window below the Message Window will show a little space ship. The hyperspace mode is also automatically entered when a remote URL is opened (unless the Tgif.AutoHyperSpaceOnRemote X default is set to false). In the hyperspace mode, certain objects are considered hot-links. When the cursor is placed on top of these object, it will change from a pointer to a hand to indicate that clicking on the left mouse button will invoke some actions. An object is a hot-link if it contains an attribute described in either the TELEPORT/HYPERJUMP, LAUNCH APPLICA- TIONS, or INTERNAL COMMANDS section. The hyperspace mode is exited when the drawing mode is changed or the LeaveHyperSpace() is selected from the Navigate Menu. LAUNCH APPLICATIONS Tgif provides the mechanism to launch applications. If the middle mouse button is clicked on an object with the key held down (or double-clicking such an object), tgif looks for an attribute named launch (by default) of that object. If such an attribute is found, the value part of the attribute is interpreted as a sh(1) command to exe- cute. Same color rule applies as described in the TELEPORT/HYPERJUMP section above. If the command ends with the ’&’ character, tgif forks itself (what actual happens depends on whether the _BACK- GROUND_DONT_FORK compiler flag is defined or not at compile time) and the command is executed by the child process; otherwise, popen() is used to execute the command (in this case, if the command hangs, there is no way provided to terminate the command, and tgif will not be able to recover from it). Within the command, values of other attributes of the same object can be used. The syntax is: $(attr), where attr is the name of another attribute. For example, if one wants to perform a man(1) function, one can draw a box; enter a line of text "title=tgif"; enter another line of text "launch=xterm -rw -e man $(title)"; select all three objects using ^a keyboard command; attach the text strings to the box using #a keyboard command; and launch the man(1) command by clicking the middle mouse button on the box (or the text strings) with the key held down. If one wants to be more fancy, the box can be replaced by an X11 pixmap object; the ’launch’ attribute can be made invisible; and the ’title’ attribute can be center justified and with its name hidden using the #m keyboard command. By default, launching of an application is disabled in the hyperspace mode for security considerations (this can be overridden by the Tgif.AllowLaunchInHyperSpace X default setting). If a lunch command is encountered in the hyperspace mode, the command is displayed and the user is prompted to see if he/she wants to execute the command. INTERNAL COMMANDS Tgif provides the mechanism to execute internal commands. If the mid- dle mouse button is clicked on an object with the key held down (or double-clicking such an object), tgif looks for an attribute named exec (by default) of that object. If such an attribute is found, the value part of the attribute is interpreted as a list of internal com- mands (separated by semicolon) to execute. Same color rule applies as described in the TELEPORT/HYPERJUMP section above. A command usually takes the form: ( , , ..., ) An argument of a command can be a string argument or a numeric argu- ment. A string argument must be enclosed in double-quotes. A numeric argument can be a numerical value or a string of the form "$(x)", where x is the name of another attribute (this form is referred as the sub- stitution form). A string argument can also contain substitution form. Please note that only one-level substitution are performed (the collec- tion of internal commands should be viewed as a simple scripting lan- guage and not a declaration language). When an attribute is referenced in an internal command, the attribute name can be in the form, ., where must be in the form specified in the OBJECT NAMES section above and contains only alphanumeric characters and the underscore (’_’) charac- ter. If the first 2 characters of an attribute name is "!.", the rest of the attribute name names a file attribute. If the first 2 charac- ters of an attribute name is "!*", the rest of the attribute name names an attribute of the currently selected object (if more than one object is selected, the top-most object in the stacking order is used). Please note that lines that begin with "//" are treated as comments. The following internal commands are supported: launch() The value of the attribute specified by is inter- preted as a sh(1) command to execute. Please see the LAUNCH APPLICATIONS section above for more details. exec() The value of the attribute specified by is inter- preted as an internal command to execute. This is similar to a subroutine call. Please note that the internal command is exe- cuted in the context of the top-level which contain the attribute. mktemp(,) This command makes a unique file name. The argument is a template string, e.g., "/tmp/TgifXXXXXX", and it requires at least two "/" in it. The result of mktemp() is stored as the value of the attribute specified by . Please see the man pages of the C library function on mktemp(3C) for more details. (If tgif is compiled with the -D_USE_TMPFILE compiler option, then tempnam(3S) is used instead.) create_file_using_simple_template(