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

text/show/EvenMorePlugins.lha

Mirror:Random
Showing:i386-amithlongeneric
No screenshot available
Short: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:2020-05-17
Download:http://aminet.net/text/show/EvenMorePlugins.lha - View contents
Readme:http://aminet.net/text/show/EvenMorePlugins.readme
Downloads:6927

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]                 3046    9303  32.7% -lh5- c0cf May 10 13:49 AmigaWriter2Text3.e
[unknown]                 3996   13604  29.4% -lh5- 0ec6 Apr 29 19:46 arc2text3.e
[unknown]                 4660   15518  30.0% -lh5- 1b18 May 10 13:48 arc2text3xad2.e
[unknown]                 1883    4455  42.3% -lh5- 6c02 Dec 30  2014 becker2text.e
[unknown]                10050   71335  14.1% -lh5- 00e3 May  4 10:04 converthtml.e
[unknown]                22801   70816  32.2% -lh5- 92a5 May 17 23:18 converthtml.m
[unknown]                23265   81688  28.5% -lh5- 42f3 Dec  2  2014 converthtml2.m
[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]                 9665   67985  14.2% -lh5- 3d77 Apr 27 14:01 converthtmlold3.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]                 2873    9070  31.7% -lh5- 82aa May 13 07:45 dir2text2.e
[unknown]                    6       6 100.0% -lh0- 188d May  1 20:33 Dir2TextPrefs.config
[unknown]                 2428    6420  37.8% -lh5- aefb May 14 09:08 dir2textprefs.e
[unknown]                 2651    7366  36.0% -lh5- 4af5 May  9 21:05 dir2textprefsold.e
[unknown]                 2991   10009  29.9% -lh5- fee7 May 10 13:49 Eml2Text.e
[unknown]                 2093    6154  34.0% -lh5- 12a9 May 14 07:48 epo.e
[unknown]                 1177    3132  37.6% -lh5- 7f0f May 17 23:18 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]                 2295    5771  39.8% -lh5- 30b6 May 10 13:51 FileTypes2.e
[unknown]                 2473    6674  37.1% -lh5- 7154 Dec 30  2014 FinalWriter2Text.e
[unknown]                 2518    6865  36.7% -lh5- 9686 May 10 13:52 FinalWriter2Text2.e
[unknown]                 3064    8495  36.1% -lh5- e237 May 13 07:40 generic2text.e
[unknown]                   12      12 100.0% -lh0- 9235 May  1 20:33 GenericPrefs.config
[unknown]                   12      12 100.0% -lh0- 036b Nov 18  2014 GenericPrefs.config2
[unknown]                 2684    7447  36.0% -lh5- dabb May 14 09:31 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]                 3608   14561  24.8% -lh5- 4235 May 10 13:55 guide2text4.e
[unknown]                 1875    4719  39.7% -lh5- a609 Apr 27 14:05 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]                 2429    6913  35.1% -lh5- 15c6 May 10 13:56 HTML2Text4.e
[unknown]                 2039    4948  41.2% -lh5- 4ee6 May 10 13:56 macword2text.e
[unknown]                 3063    9432  32.5% -lh5- c7ee May 13 07:26 msword2text.e
[unknown]                 2807   12009  23.4% -lh5- cebe May 13 07:24 PageStream2Text.e
[unknown]                 2871    5648  50.8% -lh5- 28c4 Jun 13  2017 pipe2text
[unknown]                 1980    4843  40.9% -lh5- c887 May 10 13:59 Pipe2Text.e
[unknown]                 2251    5357  42.0% -lh5- cd79 May 10 14:00 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]                 5441   20196  26.9% -lh5- d71e May 14 09:22 prefsmui.e
[unknown]                 2754    8874  31.0% -lh5- ab72 May 10 14:01 ProWrite2Text.e
[unknown]                 3805   20294  18.7% -lh5- 787c May 10 14:02 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]                 4270   15689  27.2% -lh5- 1a2f May  4 09:21 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   20652  19.2% -lh5- 5cea May 10 14:03 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]                 3315   11178  29.7% -lh5- 2459 May 10 14:04 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]                 3000   11850  25.3% -lh5- d552 May 10 14:04 wordwrap2.e
[unknown]                 2234    5537  40.3% -lh5- 0824 Jan  8  2015 xpk.e
---------- ----------- ------- ------- ------ ---------- ------------ ----------
 Total        68 files  301163 1096271  27.5%            May 17 23:44

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