TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee NNNNAAAAMMMMEEEE _t_g_i_f - Xlib based interactive 2-D drawing facility under X11. Supports hierarchical construction of drawings and easy navigation between sets of drawings. It can also be used to launch applications. It's also a hyper-graphics (or hyper-structured-graphics) browser on the World-Wide-Web. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS ttttggggiiiiffff [----ddddiiiissssppppllllaaaayyyy displayname] [----ffffgggg ] [----bbbbgggg ] [----bbbbdddd ] [----rrrrvvvv] [----nnnnvvvv] [----bbbbwwww] [----ccccwwwwoooo] [----hhhhyyyyppppeeeerrrr] [----ggggeeeeoooommmmeeeettttrrrryyyy ] [====<<<>>>] [<_f_i_l_e>[._o_b_j]] or ttttggggiiiiffff ----pppprrrriiiinnnntttt [----eeeeppppssss] [----pppp] [----ppppssss] [----ffff] [----tttteeeexxxxtttt] [----ggggrrrraaaayyyy] [----aaaaddddoooobbbbeeee | -adobe=/] [----ppppaaaaggggeeee <<<>>>] [----pppprrrriiiinnnntttt____ccccmmmmdddd """"<<<>>>""""] [---- oooonnnneeee____ffffiiiilllleeee____ppppeeeerrrr____ppppaaaaggggeeee] [----ppppeeeeppppsssscccc] [----bbbboooopppp____hhhhooooooookkkk """"<<<>>>""""] [----eeeeoooopppp____hhhhooooooookkkk """"<<<>>>""""] [----oooodir] [_f_i_l_e_1 _f_i_l_e_2 ...] DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN _T_g_i_f 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, tgif just prints files without opening windows or fonts, and it is compatible with the obsoleted _p_r_t_g_i_f. In the first form, the command line arguments -_f_g, -_b_g, and -_b_d specify the foreground, background, and border colors, respectively. The command line argument _f_i_l_e specifies a file or an URL (only Uniform Resource Locator that specifies a file on a HTTP or FTP server are supported) of objects to be initially edited by tgif. (For a more detailed description of URL, the reader is referred to the World- Wide-Web page, titled "A Beginner's Guild to HTML", located at .) If -_r_v (or -_n_v) is specified, tgif will come up in reverse-video (or normal-video) mode. If -_b_w is specified, tgif will come up in the black and white mode. If -_c_w_o is specified, only the canvas window (see TGIF SUBWINDOWS section below) will be displayed. If -_h_y_p_e_r is specified tgif will be started in the _h_y_p_e_r_s_p_a_c_e mode (see HYPERSPACE section below). This has the same effect as setting the Tgif*CanvasWindowOnly X default to true. The default is false. Tgif is purely based on _X_l_i_b. It is tested under X11R6, and it requires a 3 button mouse. In the second form, tgif prints _f_i_l_e_1._o_b_j, _f_i_l_e_2._o_b_j, etc. (generated by _t_g_i_f) into PostScript(TM) page description files and pipes them to _l_p_r if none of the ----eeeeppppssss, ----pppp, ----ppppssss, ----ffff, or ----tttteeeexxxxtttt options are not specified; in this case, any other command line options are sent to _l_p_r. A symbol file (see descriptions below) can also be printed by specifying the ._s_y_m extension explicitly. Only non-color printing is supported. 9 - 1 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee In the second form, if the ----eeeeppppssss or the ----pppp option is specified, tgif generates an Encapsulated PostScript file in _f_i_l_e._e_p_s; this file is supposed to be included in a LaTeX file through the \psfig, \epsf, or \psfile construct (see the LATEX FIGURE FORMATS section below). If the ----ppppssss or the ----ffff option is specified, it generates a PostScript file in _f_i_l_e._p_s; this file can be printed to a PostScript printer with lpr. If the ----tttteeeexxxxtttt option is specified, it generates a text file in _f_i_l_e._t_x_t; the text file contains all visible text and can be fed to a spell checker. (Note that if any of the ----eeeeppppssss, ----pppp, ----ppppssss, ----ffff, or ----fffftttteeeexxxxtttt options are specified, any other command line options are ignored.) Using the -_g_r_a_y option has the same effect as setting the Tgif*UseGrayScale X default to true (see the X DEFAULTS section below). Using the -_a_d_o_b_e or the -_a_d_o_b_e=<_n_u_m_b_e_r>/<_n_u_m_b_e_r> option has the same effect as specifying the Tgif*UsePsAdobeString X default. Using the -_p_a_g_e option causes a specified page to be printed. Using the -_p_r_i_n_t__c_m_d option has the same effect as specifying the Tgif*PrintCommand X default. Using the -_o_n_e__f_i_l_e__p_e_r__p_a_g_e option causes each page to be printed into a separate file. Using the -_p_e_p_s_c (PreserveEPSComment) option has the same effect as setting the Tgif*StripEPSComment X default to false. Using the -_b_o_p__h_o_o_k and -fI-eop_hook options have the same effect as specifying the Tgif*PSBopHook and Tgif*PSEpsHook X defaults. If the -_o option is not specified, the output file (eps, ps, or txt) goes into the same directory as the input file. If -_odir is specified, the output file goes into the directory specified by _d_i_r. Please note that only running tgif interactively can generate X11 bitmap, X11 pixmap, GIF, or color PostScript files. BBBBAAAASSSSIIIICCCC FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNAAAALLLLIIIITTTTIIIIEEEESSSS Primitive objects supported by tgif are rectangles, ovals, rounded- corner rectangles, arcs, polylines, polygons, open-splines, closed- splines, text, X11 bitmaps, some specific forms of X11 pixmaps, and Encapsulated PostScript(TM). Objects can be grouped together to form a _g_r_o_u_p_e_d object. A primitive or a grouped object can be made into an _i_c_o_n object or a _s_y_m_b_o_l object through user commands. Tgif objects are stored in two types of files. A file with a ._o_b_j extension (referred to as an _o_b_j_e_c_t file) is a file of objects, and a file with a ._s_y_m extension (referred to as a _s_y_m_b_o_l file) specifies a ``building-block'' object. A _t_e_l_e_p_o_r_t mechanism is provided to _t_r_a_v_e_l among the .obj files. A building-block object consists of the _r_e_p_r_e_s_e_n_t_a_t_i_o_n part and the _d_e_f_i_n_i_t_i_o_n part (which can be empty) of the object. Tgif supports the ``bottom-up'' construction of hierarchical drawings by providing the capability to ``instantiate'' a building-block object in a drawing. Tgif also supports the ``top- down'' specification of drawings by allowing the user to make any object a _r_e_p_r_e_s_e_n_t_a_t_i_o_n 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.) 9 - 2 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee Prolog engines will be referred to as _d_r_i_v_e_r_s in the sections to follow. (Other types of drivers are also allowed, e.g., written in C.) Text based _a_t_t_r_i_b_u_t_e_s 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 ATTRIBUTES section for details. Tgif can generate output in four different formats. By default, the output is in the PostScript(TM) 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. This takes place when the laser-printer icon is displayed in the Choice Window (see below for the naming of tgif windows). This output can be redirected to a file with a ._p_s extension. This takes place when the _P_S icon is displayed. When the _L_a_T_e_X (or _E_P_S_I) icon is displayed, the output is generated into a file with a ._e_p_s extension. This file is in the Encapsulated PostScript (or Encapsulated PostScript Interchange) format; it can be included in a LaTeX document with the \_p_s_f_i_g or the \_e_p_s_f construct; this will be discussed later. The only difference between the EPS and EPSI formats is that an EPSI file contains a preview 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, the output generated into a file with a ._t_x_t extension. This is a text file containing all visible text; it can be fed to a spell checker. When the _x_1_1_b_m (X11 bitmap) icon is displayed in the Choice Window and color output is _n_o_t selected, tgif generates the output with the ._x_b_m extension; the output is in the X11 bitmap format. However, if the x11bm icon is displayed in the Choice Window and color output _i_s selected (through the ^#k keyboard command -- ^ denotes the and # denotes the key), then tgif generates the output with the ._x_p_m extension, and the output is in the X11 pixmap format (the version of this XPM format depends on the settings of the XPmOutputVersion X default). 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 _i_m_p_o_r_t_e_d into tgif and be represented as tgif primitive objects. 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 command to set the reduction/magnification. If the compiler flag -DA4PAPER is defined (in Imakefile or Makefile.noimake), then the output is supposed to be printed on A4 papers (which has approximate dimensions of 8.25in by 11.7in). 9 - 3 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee GGGGRRRRAAAAPPPPHHHHIIIICCCCAAAALLLL OOOOBBBBJJJJEEEECCCCTTTTSSSS An object in an _o_b_j_e_c_t (._o_b_j) file can be a primitive object, a grouped object, or an _i_c_o_n object. A _s_y_m_b_o_l (._s_y_m) file can have any number of objects allowed in an object file and exactly one _s_y_m_b_o_l object. (Recall that a symbol file specifies a building-block object.) The symbol object in a symbol file is the representation part of the building-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, and flipped. (However, flipping text objects horizontally will cause the text justification to change, and flipping text objects vertically will usually cause the text object to move.) All objects, except text and rigid icon objects, can be stretched (scaled). (See the TGIF SUBWINDOWS section for the definition of rigid icon objects.) Tgif supports 32 fill patterns, 32 pen patterns, 7 default line widths, 4 line styles (plain, head arrow, tail arrow, double arrows) for polylines and open-splines, 9 dash patterns, 3 types of text justifications, 4 text styles (roman, italic, bold, bold-italic), 11 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 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). Only right-angle rotations are supported. 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 the 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. TTTTGGGGIIIIFFFF SSSSUUUUBBBBWWWWIIIINNNNDDDDOOOOWWWWSSSS The tgif windows are described below. _T_o_p _W_i_n_d_o_w Displays the current domain and the name of the file tgif is looking at. Mouse clicks and key presses have no effect. _M_e_n_u_b_a_r _W_i_n_d_o_w 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. 9 - 4 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee The View, Text, and Graphics pull-down menus are cascading menus and can not be _p_i_n_n_e_d (see the _P_o_p_u_p _M_e_n_u_s subsection below for a description). _M_e_s_s_a_g_e _W_i_n_d_o_w This is right under the Menubar Window on the left. It displays 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. _P_a_n_e_l (_C_h_o_i_c_e) _W_i_n_d_o_w This is the window to the right 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/bottom, left/right order, it displays the current drawing mode, the page style (portrait/landscape), edit (see below), print mode, zoom factor, constrained/unconstrained move (and stretch) mode, radius for rounded-corner rectangles, 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, dash pattern, line style, polyline or spline, line width, fill pattern, pen pattern, color, and special (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 backwards. Dragging the middle mouse button on top of an icon usually generates a popup menu which corresponds to an entry in the Main Menu for the Canvas Window below. (The ``edit'' and ``special'' icons mentioned above are dummy icons that allow the ``edit'' 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 9 - 5 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee choice won't change if the middle mouse button is used. The settings of the horizontal and vertical alignments determine how objects (or vertices) align with each other when the ^l keyboard 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 neighboring 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). _C_a_n_v_a_s _W_i_n_d_o_w This is the drawing area. The effects of the actions of the mouse is determined by the current drawing mode. Normally, dragging the right mouse button will generate the Mode Menu. The drawing modes are (in order, as they appear in the Mode Menu) select, text, rectangle, oval, polyline (open-spline), polygon (closed-spline), arc, rounded-corner rectangle, freehand polyline (open-spline), and select vertices. 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 middle 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 at the corners/vertices (using the Tgif*HandleSize X default, the sizes of the handles can be customized). Dragging one of the little squares stretches/reshapes the selected object. If one wants to move the selected object, one should not drag the little squares. 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 would need to click on the outline of the rectangle with the left mouse button. If one would like to move the rectangle, one would need to drag 9 - 6 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee the outline of the rectangle with the left mouse button. If the object is a filled rectangle (fill is not NONE), the 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 _a_f_t_e_r stretching is initiated results in proportional stretching being activated (basically, a scale operation is being performed). Text and rigid icon objects can not be stretched or scaled. (Rigid icon objects are icons that do not have an inherited attribute whose name is empty and whose value is the string "not_rigid". Rigid icon objects inside a non-rigid icon object are considered non-rigid.) Clicking the middle mouse button while the key is held down will activate the _t_e_l_e_p_o_r_t (or _t_r_a_v_e_l), the _l_a_u_n_c_h, or the _e_x_e_c_u_t_e _i_n_t_e_r_n_a_l _c_o_m_m_a_n_d mechanism. See the sections on TELEPORT, LAUNCH APPLICATIONS, and INTERNAL COMMANDS for details. Teleporting has precedence over launching, which has precedence over executing an internal command. The arrow keys can also be used to move selected objects. However, 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 polygon/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 highlighted vertices are move, delete, align (with each other), distribute (space them equally), and align to grid. The arrow keys can also be used to move selected vertices. Objects can be locked (through the #< command). Locked object are shown with gray handles, and they can not be moved, stretched, flipped, or rotated. 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; furthermore, they can be deleted. If the current move/stretch mode is of the constrained type (activated and deactivated by the #@ command), top-level polylines will have the following behavior. In a move operation, 9 - 7 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee if both endpoints of a polyline lie inside the objects being moved, then the whole polyline is moved; otherwise, 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 vertically. 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. Clicking the left mouse button while the key is held down highlights 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 current 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 supported 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 polyline mode). The second end point is specified by releasing the mouse button. In all drawing modes (other than the text mode), pressing the key cancels the drawing 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 _s_e_l_e_c_t. Key presses with the or key held down (referred to as _n_o_n- _a_l_p_h_a_n_u_m_e_r_i_c key presses since they can also generate control characters) are treated as commands, and their bindings are 9 - 8 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee 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. _S_c_r_o_l_l_b_a_r_s 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.) _R_u_l_e_r_s 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 reduction/magnification is not set at 100%, the markings do not correspond to the above mentioned units any more. _I_n_t_e_r_r_u_p_t/_H_y_p_e_r_s_p_a_c_e _W_i_n_d_o_w 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 Canvas 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 _h_y_p_e_r_s_p_a_c_e mode (please see the HYPERSPACE section below for more details), a space ship icon will be displayed when the interrupt icon is not being displayed. Clicking any button in this window will switch tgif in and out of the hyperspace mode. _S_t_a_t_u_s _W_i_n_d_o_w 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 poped up, this window shows what action will be taken if a menu item is selected. It also displays miscellaneous 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 9 - 9 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee Menu, this window becomes visible. By default, when this window is displaying mouse button status, right-handed mouse is assumed. Setting the Tgif*ReverseMouseStatusButtons X default to true will reverse the status (as if a left-handed mouse is used). _P_o_p_u_p _M_e_n_u_s When a menu is poped up by a mouse drag, the menu can be _p_i_n_n_e_d if it is dragged far enough horizontally (the distance is determined 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. Clicking the middle mouse button in it will activate the clicked item. NNNNOOOONNNN----AAAALLLLPPPPHHHHAAAANNNNUUUUMMMMEEEERRRRIIIICCCC KKKKEEEEYYYY BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS Most operations that can be performed in tgif can be activated through non-alphanumeric keys (a few 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 ``_k_e_y_s._o_b_j'' 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 ``tgificon.obj'' file, mentioned in the FILES section of this document.) ^a select all ^b send selected objects to the back ^c change domain ^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, 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 alignment 9 - 10 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee ^u ungroup selected objects ^v push into (or edit) the definition part of a building-block (icon) object ^w change the drawing mode to text ^x delete all selected objects ^y copy selected objects into the cut buffer ^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 9 - 11 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee > 100%) #: go to default zoom #` zoom out all the way so that the whole page is visible #~ saved 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 paste from the cut buffer ^#z change the drawing mode to arcs ^#. import an X11 bitmap file ^#, import an X11 pixmap file ^#- toggle between English and Metric grid systems 9 - 12 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee SSSSHHHHOOOORRRRTTTTCCCCUUUUTTTTSSSS The user can define single character _s_h_o_r_t_c_u_t keys to emulate the function 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 _n_o_t 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 sensitive) 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 :<_K_e_y>_x, !<_K_e_y>_x, or <_K_e_y>_x (here the character 'x' is used as an example; furthermore, the substring <_K_e_y> must be spelled exactly the way it appears here). The first 2 formats are equivalent, they specify the _l_o_w_e_r _c_a_s_e 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 (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 specification. 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.Xdefaults, 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 COMMAND would correspond to. CyclePrintFormat() Printer, LaTeXFig, RawPSFile, XBitmap, TextFile, EPSI, GIF/ISMAP 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) 9 - 13 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee 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 ToggleOneMotionSelMove() OneMotionSelMove, ClickSelClickMove ToggleHyperSpace() GoHyperSpace, LeaveHyperSpace In addition to the above list, the following are also valid COMMAND names (having the obvious meaning): ScrollLeft(), ScrollRight(), ScrollUp(), ScrollDown(), SelectMode(), DrawText(), DrawBox(), DrawOval(), DrawPoly(), DrawPolygon(), DrawRCBox(), DrawArc(), and SelectVertexMode(). OOOOBBBBJJJJEEEECCCCTTTT NNNNAAAAMMMMEEEESSSS If an object contains an attribute (please see the ATTRIBUTES sections below for details) whose name is the string "_n_a_m_e" (case-sensitive), the value part of the attribute is the _n_a_m_e of the object. Subobject of a composite object can be named using a _p_a_t_h, e.g., <_t>!<_s_1>!<_s_2>, where <_t> is the name of a top-level object which directly contains <_s_1> which directly contains <_s_2>. The following is _n_o_t _f_u_l_l_y support, yet (only the #<_p_a_g_e> form is supported at this time). Every object in a tgif file can be uniquely named using the notation #<_p_a_g_e>!<_p_a_t_h>, where <_p_a_g_e> can be a string that specifies the name of a page or #<_n_u_m_b_e_r> which specifies a page number. The <_p_a_t_h> is described in the previous paragraph. If an object _o_1 is referenced by another object _o_2 within the same file (no file name or URL is specified before #) and <_p_a_g_e> is omitted, then _o_1 must be on the same page as _o_2. If a file name or URL is specified before # and <_p_a_g_e> is omitted, then _o_1 must be on the first page. AAAATTTTTTTTRRRRIIIIBBBBUUUUTTTTEEEESSSS Attributes are text strings of the form _n_a_m_e=_v_a_l_u_e or _v_a_l_u_e which are attached to either the current drawing or any non-text objects. An attribute attached to the current drawing is called a _f_i_l_e _a_t_t_r_i_b_u_t_e; otherwise, it is a _r_e_g_u_l_a_r _a_t_t_r_i_b_u_t_e. 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 9 - 14 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee 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). TTTTEEEELLLLEEEEPPPPOOOORRRRTTTT 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, tgif looks for an attribute named _w_a_r_p__t_o (by default) or _h_r_e_f of that object. The only difference between _w_a_r_p__t_o and _h_r_e_f is that ".obj" is automatically appended to the value of a _w_a_r_p__t_o attribute while the value of a _h_r_e_f attribute is taken as is. (Please note that _w_a_r_p__t_o 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 _t_r_a_v_e_l to. (If tgif is in the _h_y_p_e_r_s_p_a_c_e mode, then clicking the left mouse button has the same effect.) If there are multiple _h_r_e_f 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 there are multiple _h_r_e_f attributes on the object, but are in different colors, tgif will use the one that has the same color as the color appearing in the Choice Window. If the value part of the _h_r_e_f attribute starts with the '/' character, the value is treated as an absolute file name; otherwise, it is treated as a relative file name. HHHHYYYYPPPPEEEERRRRSSSSPPPPAAAACCCCEEEE Tgif provides a _h_y_p_e_r_s_p_a_c_e mode to facilitate traveling between .obj files. The hyperspace mode is entered when GoHyperSpace() is selected from the Navigate Menu. When in hyperspace, 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 _h_o_t-_l_i_n_k_s. 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, LAUNCH APPLICATIONS, or INTERNAL COMMANDS section. The hyperspace mode is exited when the drawing mode is changes. 9 - 15 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee LLLLAAAAUUUUNNNNCCCCHHHH AAAAPPPPPPPPLLLLIIIICCCCAAAATTTTIIIIOOOONNNNSSSS Tgif provides the mechanism to launch applications. If the middle mouse button is clicked on an object with the key held down, tgif looks for an attribute named _l_a_u_n_c_h (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 execute. Same color rule applies as described in the TELEPORT section above. If the command ends with the '&' character, tgif forks itself (what actual happens depends on whether the _BACKGROUND_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: $(_a_t_t_r), where _a_t_t_r 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) withe 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 _h_y_p_e_r_s_p_a_c_e mode. However, this can be overridden by the Tgif*AllowLaunchInHyperSpace X default setting. IIIINNNNTTTTEEEERRRRNNNNAAAALLLL CCCCOOOOMMMMMMMMAAAANNNNDDDDSSSS Tgif provides the mechanism to execute internal commands. If the middle mouse button is clicked on an object with the key held down, tgif looks for an attribute named _e_x_e_c (by default) of that object. If such an attribute is found, the value part of the attribute is interpreted as a list of internal commands (separated by semicolor) to execute. Same color rule applies as described in the TELEPORT section above. A command usually takes the form: ( , , ..., ) An argument of a command can be a string argument or a numeric argument. 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 substitution form). A string argument can also contain substitution form. Please note that only one-level substitution are performed (the collection of internal commands should be viewed as a simple scripting language and _n_o_t a declaration language). 9 - 16 - Formatted: May 21, 1996 TTTTGGGGIIIIFFFF((((nnnn)))) TTTTggggiiiiffff TTTTGGGGIIIIFFFF((((nnnn)))) 9 VVVVeeeerrrrssssiiiioooonnnn 2222....11116666 PPPPaaaattttcccchhhhlllleeeevvvveeeellll 11111111 aaaannnndddd AAAAbbbboooovvvveeee When an attribute is referenced in an internal command, the attribute name can be in the form, <_o_b_j__n_a_m_e>.<_s_t_r_i_n_g>, where <_o_b_j__n_a_m_e> must be in the form specified in the OBJECT NAMES section above and <_s_t_r_i_n_g> contains only alphanumeric characters and the underscore ('_') character. The following internal commands are supported: _l_a_u_n_c_h(<_a_t_t_r__n_a_m_e>) The value of the attribute specified by is interpreted as a sh(1) command to execute. Please see the LAUNCH APPLICATIONS section above for more details. _e_x_e_c(<_a_t_t_r__n_a_m_e>) The value of the attribute specified by is interpreted as an internal command to execute. This is similar to a subroutine call. Please note that the internal command is executed in the context of the top-level which contain the attribute. _m_k_t_e_m_p(<_s_t_r>,<_a_t_t_r__n_a_m_e>) This command makes a unique file name. The argument is a template string, e.g., "/tmp/TgifXXXXXX". 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 for more details. _c_r_e_a_t_e__f_i_l_e__u_s_i_n_g__s_i_m_p_l_e__t_e_m_p_l_a_t_e(<_t_e_m_p_l_a_t_e>,<_o_u_t_p_u_t>,<_s_t_r>,<_a_t_t_r__n_a_m_e>) The file specified by