AminetAminet
Search:
82050 packages online
About
Recent
Browse
Search
Upload
Setup
Services

text/show/EvenMorePlugins.lha

Mirror:Random
Showing:ppc-amigaosgeneric
No screenshot available
Short:V0.89: EvenMore textviewer plugins source
Author:chris at prophecynews.co.uk (Chris Perver)
Uploader:chris prophecynews co uk (Chris Perver)
Type:text/show
Version:0.89
Replaces:text/show/EvenMorePlugins.lha
Requires:ECX or AmigaE
Architecture:generic
Date:2017-06-13
Download:http://aminet.net/text/show/EvenMorePlugins.lha - View contents
Readme:http://aminet.net/text/show/EvenMorePlugins.readme
Downloads:2899
These are the source code for the plugins for EvenMore. They are written in  the
AmigaE  and ECX programming languages, but there is no reason why you should not
be able to create plugins using any programming language.

USAGE
=====

These source codes have been uploaded to Aminet so that others can  see  how  to
create  their own plugins for EvenMore. You are free to use and modify this code
for your own personal use. The only thing I would ask is, if you are  interested
in  writing  a  plugin  for  EvenMore,  to  let me know so I can put it up on my
website. If you do want to use some of this code for  your  own  programming,  I
have  no objection to that, so long as you mention where you got it from in your
documentation. Apart from some example code taken from the ROM  Kernel  manuals,
this  is  all  my  own  work,  and  represents  many  years work. I also take no
responsibility for any bugs left in it!

THE PLUGIN SYSTEM
=================

The old EvenMore plugin system used the Amiga  library  system.  EvenMore  would
open  these  libraries  sequentially  and  check  to  see if the plugin criteria
matched those of the open file. If a match was found, EvenMore passed  the  file
onto  the  plugin,  which then processed the file and returned the results. This
system worked well for AmigaE, but when I moved onto the ECX compiler to make  a
MorphOS version of EvenMore, I found it was not able to compile Amiga libraries.
So I had to come up with an alternative method of creating the plugins. Now each
plugin is compiled as an executable file. When EvenMore opens, it launches these
plugins. Each plugin opens a port through which it communicates  with  the  main
program,  and passes information to and from it as necessary. While this uses up
a little more memory than your average plugin system, it is quite  fast  as  the
plugin  code  is  always resident in memory. The only real processor power being
used is to convert the file.

PLUGIN TYPES
============

There are several main types of file plugin that can be  created  for  EvenMore.
Each  of  these  has  a  specific ID tag. They are as follows, and are called by
EvenMore in this order.

                FTYP
                 |
              No-+-Yes
              |
             ARCH
              |
           No-+-Yes
           |     |
          PACK   |
           |     |
          FILE   |
           |     |
        No-+-Yes-+
        |        |
       DTYP      |
        |        |
     No-+-Yes----+
     |           |
    GENE         |
     |           |
  No-+-Yes-------+
  |              |
  +--------------+
                 |
                FRMT

FTYP

The FTYP plugins will be called before the file is  opened  by  EvenMore.  These
plugins  just  check  the  extension  name  of the file to see if it needs to be
passed onto another program specified in  the  filetypes.txt  file  rather  than
opened in EvenMore. For example, PDF files, picture or sound files.

ARCH

ARCH plugins can be used for browsing archived files and  directories.  EvenMore
does  not open the file at this stage, but passes only the name of the file onto
the plugin. It is then up to the plugin to analyze  the  file  and  construct  a
textual  version  of  its  contents  if necessary. There is a subfilename string
which can be set in order to  extract  and  browse  a  particular  file  in  the
archive.

PACK

PACK  plugins  enable  EvenMore  to  open  compressed  files  such  as  XPK  and
PowerPacker.  They  are called before the main file conversion plugins. EvenMore
opens the file and passes it onto these plugins. The plugin  then  analyzes  it,
performs  any  necessary  operations  and  returns  the  buffer back to the main
program. EvenMore then passes  the  updated  buffer  onto  the  file  conversion
plugins.

FILE

The FILE plugins are used to convert  one  document  format  into  another.  For
example,  MSWord  files,  AmigaGuide,  etc into plain text. If the file does not
match the criteria of any of these plugins, it is passed onto the following  two
plugin types.

DTYP

The DTYP plugins will check the file against any text  datatypes  the  user has
installed on the operating system. As these datatypes generally do not allow for
ANSI escape code sequences, they are called after the main  file  conversion
plugins.  But  if  there  is  a  particular filetype you want the DTYP plugin to
handle instead of the FILE plugin, it is just a case of deleting that particular
FILE plugin.

GENE

If the file does not match the  criteria  of  any  of  the  file  conversion  or
datatype  plugins,  it  will  be  checked against the generic plugins. These are
fall-back plugins which will  analyze  the  file  for  ASCII  text  and  discard
anything  that  is  unprintable.  Sometimes this works for more obscure document
formats that do not have a particular plugin made for them.

FRMT

EvenMore will then pass the file onto the FRMT plugins for formatting. Even if a
plugin  has  already  been found for the file, EvenMore will still pass it on to
these plugins. These will make minor formatting changes  to  the  document.  One
such  plugin is the wordwrapping plugin, which ensures that the document appears
in a format that is easy to read.

The other two plugins that EvenMore uses are for controlling the preferences.

MPRF

The MPRF plugin holds the main GUI and  settings  for  the  EvenMore  preference
window.

PREF

The PREF plugins are used for creating additional pages in the preference window
to store settings for specific plugins.

HOW THEY WORK
=============

The plugins are executable  files  that  EvenMore  launches  whenever  the  main
program starts. EvenMore opens a special port called EVENMOREP and then executes
the plugin. The plugin initializes itself and  passes  a  message  back  to  the
EVENMOREP port to signal that it is ready.

When EvenMore is opening a file, it will scan  through  all  the  plugin  ports,
passing a status ID and file information to them. The status ID tells the plugin
what function to execute in relation to the file.

STATUS

-1 -  Close the plugin, EvenMore is quitting

0  -  Not used

1  -  Initialize the plugin, open libraries, etc if necessary

2  -  Examine the filename or file contents to see if we can process it

      RETURNS:

      FALSE - The file did not match the criteria specified       TRUE  - A
match has been found but we do not need to allocate memory, just              
modify the original text buffer in place       1     - Signal EvenMore to
allocate an area of memory for a new file               buffer       2     -
Signal EvenMore to create a linked list for a new file buffer

3  -  Run the file conversion routine on the file
4  -  Load the plugin preference file
5  -  Save the plugin preference file
6  -  Open the plugin preference GUI
7  -  Return plugin title for the information page

EvenMore used to always allocate a section of memory for  file  conversion,  but
this was unstable because there was a chance the output format could overrun the
buffer allocated. I have tried to get as many of the plugins to use  the  linked
list format as possible, as this memory is dynamically allocated.

I hope this source code can be of some benefit to the Amiga community.


Contents of text/show/EvenMorePlugins.lha
PERMISSION  UID  GID    PACKED    SIZE  RATIO METHOD CRC     STAMP     NAME
---------- ----------- ------- ------- ------ ---------- ------------ ----------
[unknown]                 2338    6460  36.2% -lh5- c9fb Jun 28  2014 AmigaWriter2Text.e
[unknown]                 3026    9722  31.1% -lh5- 2377 Jul  1  2014 AmigaWriter2Text2.e
[unknown]                 3071    9338  32.9% -lh5- 687e Nov  8  2015 AmigaWriter2Text3.e
[unknown]                 3993   13594  29.4% -lh5- f012 Feb 20  2016 arc2text3.e
[unknown]                 4655   15494  30.0% -lh5- 77df May 30 19:00 arc2text3xad2.e
[unknown]                 1883    4455  42.3% -lh5- 6c02 Dec 30  2014 becker2text.e
[unknown]                11467   74954  15.3% -lh5- 3a0b Oct 21  2016 converthtml.e
[unknown]                24953   75640  33.0% -lh5- c1c3 Jun 13 12:59 converthtml.m
[unknown]                23265   81688  28.5% -lh5- 42f3 Dec  2  2014 converthtml2.m
[unknown]                 9668   67985  14.2% -lh5- 766a Feb 20  2016 converthtml3.e
[unknown]                22572   69928  32.3% -lh5- 39b9 Feb 20  2016 converthtml3.m
[unknown]                 5136   27781  18.5% -lh5- 69b4 Mar 31  2014 converthtmlold.e
[unknown]                 8279   59258  14.0% -lh5- f902 Dec  2  2014 converthtmlold2.e
[unknown]                 2500    6760  37.0% -lh5- 702f Dec 31  2014 datatypes.e
[unknown]                 2657    7103  37.4% -lh5- 816b Nov  9  2014 dir2text.e
[unknown]                 3205    9707  33.0% -lh5- bb8b May 30 19:02 dir2text2.e
[unknown]                    6       6 100.0% -lh0- bc67 Jun  5 20:24 Dir2TextPrefs.config
[unknown]                 2658    7328  36.3% -lh5- 3db2 Feb 17  2016 dir2textprefs.e
[unknown]                 2990   10005  29.9% -lh5- 072b Dec 31  2014 Eml2Text.e
[unknown]                 1716    4678  36.7% -lh5- f562 May 28 21:36 epo.e
[unknown]                 1139    2992  38.1% -lh5- db33 Jun 13 12:59 epo.m
[unknown]                 3092    7575  40.8% -lh5- 31a2 Feb 29  2016 EvenMorePlugins.readme
[unknown]                 2229    5271  42.3% -lh5- b93f Mar 23  2014 FileTypes.e
[unknown]                  616    3378  18.2% -lh5- 9b95 Apr 18  2014 filetypes.txt
[unknown]                 2294    5765  39.8% -lh5- 685e Dec 30  2014 FileTypes2.e
[unknown]                 2473    6674  37.1% -lh5- 7154 Dec 30  2014 FinalWriter2Text.e
[unknown]                 2527    6881  36.7% -lh5- 87a7 Nov  7  2015 FinalWriter2Text2.e
[unknown]                 3033    8428  36.0% -lh5- eba5 Dec 30  2014 generic2text.e
[unknown]                   12      12 100.0% -lh0- a2d9 Jun  5 20:24 GenericPrefs.config
[unknown]                   12      12 100.0% -lh0- 036b Nov 18  2014 GenericPrefs.config2
[unknown]                 3240    9328  34.7% -lh5- e7fb Feb 17  2016 genericprefs.e
[unknown]                 4108   16823  24.4% -lh5- fbe2 Jan 29  2012 guide2text.e
[unknown]                 4333   17937  24.2% -lh5- c7f5 Apr 29  2014 guide2text2.e
[unknown]                 4229   17693  23.9% -lh5- 106f Apr 30  2014 guide2text3.e
[unknown]                 3606   14557  24.8% -lh5- 375e Feb 19  2016 guide2text4.e
[unknown]                 1875    4719  39.7% -lh5- 1935 Apr 21  2014 HTML2Text.e
[unknown]                 2060    5158  39.9% -lh5- 7956 Apr 23  2014 HTML2Text2.e
[unknown]                 2153    5645  38.1% -lh5- e1e0 Dec 27  2014 HTML2Text3.e
[unknown]                 2430    6904  35.2% -lh5- 2934 Feb 25  2016 HTML2Text4.e
[unknown]                 2037    4944  41.2% -lh5- 9ebb Dec 30  2014 macword2text.e
[unknown]                 3098    9499  32.6% -lh5- 385e Dec 30  2014 msword2text.e
[unknown]                 2831   12096  23.4% -lh5- de1e Dec 30  2014 PageStream2Text.e
[unknown]                 2871    5648  50.8% -lh5- 28c4 Jun 13 10:38 pipe2text
[unknown]                 1979    4839  40.9% -lh5- 9334 Jun 13 12:25 Pipe2Text.e
[unknown]                 2249    5356  42.0% -lh5- c045 Dec 31  2014 powerpacker.e
[unknown]                 6000   26374  22.7% -lh5- 2128 Dec  9  2011 PrefsEasyGUI.e
[unknown]                 5882   13988  42.1% -lh5- a0cb Mar 27  2016 prefsmui
[unknown]                 5688   22592  25.2% -lh5- 2782 Jan 13  2015 PrefsMUI-antialias.e
[unknown]                 5590   22524  24.8% -lh5- 71b3 May 20 19:17 prefsmui.e
[unknown]                 2812    8988  31.3% -lh5- 216a Dec 30  2014 ProWrite2Text.e
[unknown]                 3813   20310  18.8% -lh5- dd1f Dec 30  2014 RTF2Text.e
[unknown]                 2209    5539  39.9% -lh5- c2bb Nov 27  2014 starwriter2text.e
[unknown]                 4212   14262  29.5% -lh5- 81c0 Jun 21  2014 starwriter52text.e
[unknown]                10261   25644  40.0% -lh5- 7c75 Nov 27  2014 starwriter52text2
[unknown]                 4586   16759  27.4% -lh5- f8b7 Dec  2  2014 starwriter52text2.e
[unknown]                 4297   15743  27.3% -lh5- fdbf Dec 30  2014 starwriter52text3.e
[unknown]                 3275   15608  21.0% -lh5- b6cb Jan 29  2012 Troff2Text.e
[unknown]                 2727    9141  29.8% -lh5- ecb0 Jun 23  2014 WordPerfect2Text.e
[unknown]                12466   35248  35.4% -lh5- 9643 Nov 30  2014 wordperfect2text2
[unknown]                 3956   20670  19.1% -lh5- 1299 Dec 30  2014 WordPerfect2Text2.e
[unknown]                 3026   10221  29.6% -lh5- 6ed4 Mar 28  2014 WordWorth2Text.e
[unknown]                 3031   10225  29.6% -lh5- 9b69 Mar 28  2014 WordWorth2Text2.e
[unknown]                 3334   11217  29.7% -lh5- 1780 Dec 30  2014 WordWorth2Text3.e
[unknown]                 2820   10629  26.5% -lh5- e78d Jan 20  2015 wordwrap.e
[unknown]                 7311   18712  39.1% -lh5- d0fe Feb 16  2016 wordwrap2
[unknown]                 3003   11836  25.4% -lh5- a5dd Oct 18  2016 wordwrap2.e
[unknown]                 2234    5537  40.3% -lh5- 0824 Jan  8  2015 xpk.e
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total        67 files  303097 1101785  27.5%            Jun 13 20:40

Aminet © 1992-2017 Urban Müller and the Aminet team. Aminet contact address: <aminetaminet net>