THE CLIPBOARD MANAGER UTILITY
version 3.0
The Clipboard Manager utility is a clipboard viewer for the Microsoft
Windows 95 or NT. Any time when a Windows application places some text
onto the clipboard, the utility tries to convert the clipboard contents.
According to the radio button checked onto the utility control panel the
utility can:
-
Leave the clipboard contents unchanged;
-
Format the text in the clipboard;
-
Sort lines in the clipboard;
With the aid of the Clipboard Manager you can teach your preferable
text editor to format or sort the selected text. Just run the clipboard
manager. Choose conversion mode on the control panel. Select the text you
want to convert. Make `Cut' and immediately `Paste'. Here you are!
The utility was compiled using the Microsoft Visual C++ and Borland
C++ compilers. However it is a pure Windows application, i.e. it uses neither
Microsoft Foundation Classes (MFC) nor Borland class library. Theoretically
it can be compiled by any C++ compiler that supports Win32 API.
The clipboard manager was developed by Dmitry A. Kazakov. It is distrubuted
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later versionterms GNU. This library is distributed in the hope that
it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
The current version works under Windows 95 and Windows NT (both Intel
and Alpha). Download: clipman.zip (zip)
or clipman.tgz (tar + gzip).
I would be glad to hear your comments. My E-mail address is dmitry@gandalf.atm.fh-luebeck.de.
Buttons and the front panel
The Clipboard Manager starts minimized. It shows its buttons on the taskbar:
You can use these buttons to change the clipboard formatting mode without
task switching.
You open the Clipboard Manager to change the default formatting mode
and parameters. The panel of the Clipboard Manager looks like follows:
You can set:
-
The mode: Do not touch, Format,
Sort.
-
The tabulation size (tells how the tab character is expanded). Initially
tab is treated as 8 spaces.
-
The right margin of the text used for justification. By default it is set
to 72.
-
Up to four prefix-suffix pairs (see below).
You can save the current settings using the Save
button.
Formatting
The way the text is formatted is defined by the shape of the first two
lines of the text.
For example, let's consider this paragraph.
The paragraph indentation is taken from the second line.
However the first line indentation is preserved.
The formatted text is justified. So the result is
For example, let's consider
this paragraph. The
paragraph indentation is taken from the second line. However
the first line indentation is preserved. The formatted text
is justified. So the result is
Another case is hanging paragraph text:
Note how the paragraph is formatted when
the first line is less indented
than the second one.
The paragraph indentation
is lead by
the second line indentation.
Note how the paragraph is formatted when the first
line is
less indented
than the second one. The paragraph
indentation is lead by the
second line indentation.
Hyphenations are correctly processed. Leading tabulators in the first two
lines are expanded before text formatting. Other tabulators are assumed
to be particular spaces.
Prefixes and Suffixes
On the front panel of the Clipboard Manager you may
find four fields for formatting prefixes and suffixes. When a prefix appears
in the first formatted line, the Clipboard Manager uses the prefix and
the corresponding suffix for formatting. The following example shows how
it works:
/* Many C programmers like to arrange the multi-
/* line comments using /* as the prefix and */ as
the suffix for each line of a comment.
If you set /* as a prefix and */ as the
corresponding suffix of the Clipboard Manager,
this text will be formatted by
the following way:
/* Many C programmers like to
arrange the */
/* multi-line comments using /* as the prefix
*/
/* and */ as the suffix for
each line of a */
/* comment. If you set /* as a prefix and */ as */
/* the corresponding suffix of the Clipboard
*/
/* Manager, this text will be formatted by the
*/
/* following way:
*/
When a prefix is recognized, the Clipboard Manager works so as if the prefix
and the corresponding suffix were removed from all lines of the clipboard
text before formatting. Formatting the text it adds the prefix and
the suffix to each formatted line.
Sorting
Lines in the clipboard are sorted according to their alphabetical order.
Tabulators are considered as if they were expanded to spaces before sorting.
Building
For Microsoft Visual C++ and Borland C++ there are ready to use make files:
nmake -f vc.mak
(for Visual C++)
make -f bcc.mak
(for Borland C++)
I did not provide a make file for gcc (GNU C++), because the current version
of the compiler shipped by Cygnus (Cygwin32
beta 19) lacks some important Win32 API calls. If you have a more recent
version, it should be no problem to get clipman compiled with gcc.
Last note. Tabs are used in source texts The texts may look a bit strange
if your editor has tab stops other than 8.