cutview(1) HP-UX cutview(1) NAME cutview - displays X-Windows paste buffer SYNOPSIS cutview [ options ] DESCRIPTION The utility cutview displays the current contents of the X-Windows paste buffer, or the current selection. Since both the paste buffer and the current selection are moni- tored, cutview will automatically update one if the other changes. This allows applications which use one mechanism to work with other applications which use the other mecha- nism exclusively. The window is updated using the interval specified by the -time option (default is 1 second). By specifying a positive integer greater than 1 with the -buffers option or the buffers option in the .Xdefaults file, cutview will create multiple buffers which will con- tain the contents of previous cut operations, in effect providing a history mechanism for the X-Windows paste buffer/selection. The buffers are updated in a least recently used method, so that the buffer replaced with new data is the least recently updated buffer. The windows used to display the contents of the buffers are Motif text edit widgets, which allow the user to move around within the buffer to see parts not visible because of the size, or even edit the contents. The widgets may also be resized dynamically to suit the user's needs. Single buffer An up arrow and a down arrow will appear at the side of the text, as well as a key or padlock symbol. To see the other buffers, place the mouse cursor on one of the arrows, and press the left mouse button. This will cause the next (or previous) buffer to be displayed. The buffer displayed in the window is the buffer that will be pasted in the next time the paste operation is performed. A padlock symbol next to the text signifies that the buffer is "locked", that is, it will not be overwritten by a subsequent cut operation, until it is unlocked, in which case a key symbol will replace the lock. To lock or unlock a buffer simply place the mouse cursor on the area with the key or lock and press the left mouse button, which will toggle the lock on the buffer. The contents of the buffers are automatically saved to the buffers file when a buffer is locked by the user, or when a locked buffer is edited (either within the text edit widget, or by selecting "edit buffer" in the menu). 1 cutview(1) HP-UX cutview(1) A button to access the menu may be on the left-most posi- tion of the single buffer window. This button can be removed at invocation of cutview by using the -smb option or setting the *singleMenu resource 'off'. If this button is present, the menu may be accessed when the mouse cursor is placed on this button, and the left mouse button is pressed. Multiple buffer Another way to view the buffers is to press the right mouse button to obtain a menu, and select the "multi buffer" item. This will cause a window showing all of the buffers to be created. The current buffer is displayed with an arrow pointing to it. To choose a new buffer, simply place the mouse cursor on the 'ghost' arrow next to the desired buffer and press the left mouse button. To close this window select the "single buffer" menu item. Operations cutview will by default attempt to read the buffers file. This file contains the contents of the buffers of the last invocation of cutview. The current contents of the buffers may be saved to the file by selecting the "save buffers" menu item. The contents of the buffers are auto- matically dumped to the buffers file upon exit from cutview. The default location for the buffers file is $HOME/.cutview. The user may specify an alternate name for the buffers file with the -file option on the command line, or buffersFile entry in the X-Windows defaults file. If the buffers file is not writable, then cutview will allow the user to select a buffer in cutview, but not mod- ify any of the contents of the buffers. If the user does attempt to modify the contents of a buffer, cutview will reset the buffer to the contents from the buffers file. To edit the current buffer, select the "edit buffer" menu item. The specified editCommand will be executed (the default is hpterm -e vi %s). The %s is required in the command string, since it specifies the filename in the command syntax. This command execution will only function properly if the edit operation is blocking (that is, does not return until the operation is completed). The current buffer may also be printed using the specified printCommand by selecting the "print buffer" menu item. (The default print command is lp %s). To exit cutview, select the "quit" menu item. Sometimes it is useful to turn off buffer update (both reading from the global buffer, and setting the global buffer from cutview). It is possible to turn off updating on startup with the -update option, or the update entry in 2 cutview(1) HP-UX cutview(1) the X-Windows default file. Interactively, buffer updat- ing can be turned off by selecting the menu item "update off". Selecting "update on" will turn buffer updating on. Some widgets/applications handle text selections which can cause partial selections to be made available, which causes multiple buffers to get cluttered. To provide a solution for some applications, cutview has a menu item which can be used to toggle detection of this event. The reason this is not simply a standard behavior is that not all applications interact with cutview well when cutview performs this checking. Another way to deal with this is to increase the time interval for checking for changed selections (see -time ). To turn off window decoration (borders not supplied by the application), use the clientDecoration directive in the .Xdefaults file (i.e., Mwm*CutView.clientDecoration: none). Autoraise is also a function of the window man- ager, and with the Motif Window Manager autoraise may be turned on by setting the focusAutoRaise directive in the .Xdefaults file (i.e., Mwm*CutView.focusAutoRaise: true). By default the Motif text edit widgets have relatively large margins around the text being displayed. To mini- mize this, and to maximize the number of buffers displayed in a given space, the resource MarginHeight can be set to zero, for example: cutview*MarginHeight: 0 OPTIONS The following are options specific to cutview: -buffers number Specifies the number of buffers to start with. Associated resource: ``*buffers''. -file file_name Specifies a file for reading/storing the contents of the buffers in cutidsp. If no path (absolute or relative) is specified, the file will be in the user's home directory. The default value is .cutview. Associated resource: ``*buffersFile''. -read Do not read the buffers file on startup. Associ- ated resource: ``*readFile''. -resize Resize single buffer window automatically accord- ing to contents. Associated resource: ``*resize''. -small Starts cutview with the small window. Associated 3 cutview(1) HP-UX cutview(1) resource: ``*small''. -smb Turns off the button on the small window for accessing the menu. Associated resource: ``*sin- gleMenu''. -subset Turns on subset checking of selection. Associated resource: ``*subset''. -time number Time interval for checking the paste buffer in seconds (default is 1 second). Associated resource: ``*time''. -toggle Specifies that the windows are not to be toggled, that is, that when the multi-buffers window is visible, the small window is also visible. Default is for toggle to be enabled. Associated resource: ``*toggle''. -smallGeometry geometry The geometry of the window, of the form =WIDTHx- HEIGHT[+-]x[+-]y, where WIDTH and HEIGHT are the width and height of the single buffer window in characters, and "x" and "y" are the positions on the screen. Associated resource: ``*smallGeome- try''. -bigGeometry geometry Specifies the geometry of the multi-buffer window (if different). Associated resource: ``*bigGeome- try''. Options used by the toolkit are: -display display Specifies the display to use. -font font Specifies the font to use. Associated resource: ``*fontList''. -fg color Specifies the color to be used for the foreground. Associated resource: ``*foreground''. -bg color Specifies the background color. Associated resource: ``*background''. -rv Reverse the foreground and background. Associated resource: ``*reverseVideo''. 4 cutview(1) HP-UX cutview(1) -title string Specifies the name of the window and icon. Default value is cutview. Associated resource: ``*title''. -n string Specifies the name of the icon. Default value is cutview. Associated resource: ``*iconName''. -name string Specifies the name to be used when looking for resources in the X-Windows defaults database. The default value is cutview. Menu Items multi buffer/single buffer Create the window described. add buffer Add a buffer delete buffer Delete the current buffer (if unlocked). edit buffer Edit the current buffer. print buffer Print the current buffer. save buffers Save the buffers to the file. subset check on/subset check off Check if selection is a subset of a recent new selection. May not interact well with all appli- cations when turned on. update off/update on Set the update mode to that indicated. quit Quit (exit) from cutview. RESOURCES The resources specific to cutview are as follows: buffers Specifies the number of buffers cutview is to retain (this may be superseded if the geometry specifies a height greater than this value). buffersFile Specifies the name of the file to read/store the contents of the buffers (default is .cutview). 5 cutview(1) HP-UX cutview(1) smallGeometry Specifies the geometry of the small (single buffer) window. bigGeometry Specifies the geometry for the multi-buffers window (if different from the small window). editCommand Specifies the command for editing a buffer (default is hpterm -e vi %s). printCommand Specifies the command for printing a buffer (default is lp %s). readFile Specifies whether cutview is to read the buffers file upon startup (default is yes). resize Specifies whether single buffer window should resize automatically according to the contents. Default is off. small If true, starts cutview with the small window when toggle is set and the number of buffers is greater than 1 (default is false). singleMenu Specifies if button on the small window to access the menu is present or not. The default is on. subset Specifies is subset checking is to be turned on or off. The default is off. time Specifies the time interval in seconds for checking the paste buffer. toggle Specifies whether the single-buffer window and multi-buffer window are to be shown one at a time (on) or together (off). The default is on. Options used by the toolkit are as follows: fontList The font to be used by cutview. background Identifies the background color of the window. borderColor Identifies the color of the border of the window. 6 cutview(1) HP-UX cutview(1) borderWidth Specifies the width of the border around the win- dows. foreground Identifies the foreground color of the window. iconName Specifies the name of the icon (default is cutview). title Specifies the name of the window (default is cutview). EXAMPLES Typical entries for cutview in a .Xdefaults file would look like the following. Mwm*CutView.focusAutoRaise: true Mwm*CutView.clientDecoration: resize cutview*smallGeometry: =30x10-150+0 cutview*bigGeometry: =30x10-0+0 cutview*foreground: white cutview*background: navy cutview*fontList: 9x15 WARNINGS The window position may change when the windows are tog- gled if the windows have been moved from the original startup position. This is because cutview unmaps the win- dows when switching between the small and the large win- dows. This will be corrected sometime in the future. Since there is at this time no reliable way to detect the X-Windows server going away, it is recommended practice to save buffers immediately when there is data the user wishes to save. (Buffers are automatically saved when locked.) Applications have been known to have memory leaks in their code to handle requests for the selection. Since cutview issues requests for the selection often (according to the setting for time), it can seem that cutview is causing a problem with the other application. This problem can be observed using top or ps to observe the size of the sus- pected process. If its size is growing while no other activities are occurring, it is likely experiencing a mem- ory leak. Notify the owner of that code of the problem. It is possible to reduce the symptoms of this problem by increasing the interval between updates of cutview (see -time). This does not fix the problem in the other appli- cation. 7 cutview(1) HP-UX cutview(1) FILES buffers file (see description) AUTHORS cutview was written by Hugh Mahon. 8