[flpsed] Intro

From: jerry <jerry_at_tr2.com>
Date: Mon, 04 Mar 2013 12:19:53 -0800

Greetings!

    I just discovered flpsed, and I am excited. It might be the
lynchpin in my effort to wipe Windows off my desktop, and go with a
total Linux environment.

    As an aside - what keeps Windows on my desktop is two programs:
Paperport and
Quicken. I am investigating replacement of Quicken with gnucash -
that's another - extensive- project. Looking at Paperport - it has a
lot of features I don't use. Basically, I use it as a file browser that
shows thumbnails ( which was hot stuff when Paperport came out, but now
a lot of file managers do that ) and a quick & dirty PDF/Tiff file
viewer that lets you type stuff into arbitrary locations.

    That's where flpsed comes in. I installed it on my Ubuntu 12.10
desktop, it didn't work. OK, went and found the 0.7 source, compiled
and installed - much better. To become the Paperport-replacing killer
app it does need a few things.
My current wish list
------------ snip ------------
            - a "Save" that just overwrites the current file with no
extra
              mouse clicks.

            - Ability to set the font at run-time per individual
annotation and separately set BOLD & ITALIC

            - Ability to insert and delete characters INSIDE
annotations.

            - Different cursor depending on whether you're in "enter new
annotation" or "edit existing annotation" mode.

            - Ability to paste graphic annotions

            - Ability to paste transparent graphic notations
               ( only set pixels from white to black(or non-white),
NEVER from black( or non-white ) to white
               ( this is because I often need to paste in a signature in
a too-small box or over a line ). It would be OK if this only worked in
B&W
               ( one bit per pixel ) files.

            - Ability to do a little tiny bit of image modification.
Just erasing rectangular blocks. Hate to have
               to start up the GIMP for that!

            - support for TIFF files, even if it consists only of
calling tiff2pdf to read them, and then pdf2tiff to
              write them. OK if annotations become cast in stone.

            - ability to write or export "portable" PDFs, which don't
have anything flpsed-specific in them. OK if the annotations become
cast in stone. Just use ghostscript to render it to another PDF? I
see that there already
are "Import" and "Export" buttons. Need to read code and find out what
they do.
----------- endsnip -------------

    Now, here's the beauty of Open Source - I might be able to do it
myself.
While I am not any sort of genius, I did spend 20 years as a software
engineer, mostly writing in C. Never learned C++, but I did a recent
stint writing object oriented Perl, so the OO stuff is not that
difficult.

    The first step is a thorough reading of existing code. Here are my
notes:
------------- snip ---------------
  flipsed fonts - are actually defined in fltk somewhere. So the
numbers
are not in our control.
.... The small integers that specify the standard FLTK fonts are
defined
in .... /usr/include/Fl/Enumerations.H
( GAAK! mixed-case filenames! )

Existing system organization:
--- local includes, starting from the top....
...The hierarchy of runtime code should match that of the includes

flpsed.cxx includes PSEditor.H
PSEditor.H includes PSEditWidget.H
PSEditWidget.H includes GsWidget.H and PSEditModel.H

GSWidget.H includes PostscriptDSC.H

PSEditModel.H includes PSEditText.H

------ C files, starting at the bottom, using the .H files as guidance
PSEditText.cxx: routines for editing the inside of annotations.
             - setting font colors.
             - implements a singly linked list of "texts" ( annotations
)
             - can move annotations, append text to annotations
             - can remove chars from the end.
             - deals with a SINGLE text annotation that can be zero,
one, or
               more characters
             - has no concept of "page"
             - knows the XY location, the color, and the text content.
             - does not know the font. Yet flpsed does save individual
SIZES per annotation.

PSEditModel.cxx: - maintains a model of all the added text in a
document.
                   - can do multiple annotations and multiple pages.
                   - the text, its size, location - is saved inside the
                     model, as a set of PSEditText objects. One set of
PSEditText objects per page.
                   - PSEditModel does not know the font.

GsWidget.cxx - draws the document on the screen using gs (
Ghostscript )
                   - displays a cursor with fltk
                   - sets and maintains the current page number.
                     ( set to zero in the constructor, open_file(),
load(),
                     ( set to other values in load_page(),handleX11 )
                   note: Do pages start at zero or one? Is there logic
to
                          prevent invalid page numbers?
                   note: open_file sets the page size to "DIN_A4" -
for USA
                          possibly need "Letter" ( 8.5 by 11 inches ).
Or
                          it might not make any difference because
PostscriptDCS.cxx
                          reads the actual size out of the file.

PSEditWidget.cxx - displays document pages AND their annotations.
                     can add text to...

PostcriptDSC.cxx - reads and parses Postscript files. Note:
relationship between Postscript and PDF?
                    finds out: * How many pages.
                                * size of the pages : bb_w, bb_h
                                * Offset of each page.

flpsed.cxx - defines all dropdown menus to fltk
              provides callbacks for the dropdown menus.
              contains main()

-------------- endsnip ------------------------

                  - Jerry Kaidor ( jerry_at_tr2.com )
Received on Mon Mar 04 2013 - 21:19:53 CET

This archive was generated by hypermail 2.2.0 : Mon Mar 04 2013 - 20:25:05 CET