19 nov 2003 - by Maurizio Colucci

For comments, write to  Maurizio Colucci - seguso.forever@tin.it
----------------------------------------------------------------

INTRO
-----

This is a completely new paradigm of user interaction.  It could turn
into a diversifying factor in the GNU/Linux world.

This is my vision.

BASIC IDEA
----------

The user interacts with the computer by specifying ACTIONS. Actions
are a mix of VERBS, OBJECTS and TIMES.

For example, an action could be

  print the file "doc.pdf" with the printer "HP Laserjet" and the
  program "Acrobat reader" at time "8.30 pm".

Here, "print" is the verb, "8.30 pm" is a time, and the objects are
"doc.pdf", "Acrobat reader" and "HP laserjet".

The main idea, from which everything started, is this:

  If the user specifies a verb, we can hide everything that does not
  make sense with that verb. If he specifies a program, we can hide
  everything that does not make sense with that program. If he
  specifies BOTH a program and a VERB, we can hide everything that
  does not make sense with BOTH a program and a verb. The more things
  he selects, the more useless things are hidden.

First I am going to formalize this idea, then give some examples.

THEORY
------

We say that the world is divided into OBJECTS, VERBS and TIMES. In
turn, objects are divided into FILES, DEVICES and PROGRAMS. This is a
taxonomy.

We can represent this in a tree:

THING
   OBJECT
      FILE
      DEVICE
      PROGRAM
   VERB
   TIME

Some terminology: A "kind" is a leaf of the above tree. In other
words, the possible "kinds" are [file, device, program, verb,
time]. (This is useful when reading the code.)

When you launch the program, you see every "thing". But as soon as you
select a THING, many other THINGs disappear, LEAVING ONLY THE THINGS
WHICH MAKE SENSE WITH WHAT YOU HAVE SELECTED.

As you select another thing yet, the visible THINGS disappear even
further.

I called this technique "intelligent narrowing".

If this is difficult to understand, don't worry and read on.

EXPLANATION BY EXAMPLES
-----------------------

* With segusoLand I can select programs, verbs and times. Not just
  files and devices, as in MS Windows. This is new.

* if I select a verb, only the objects which make sense with that verb
  are shown. This is new. For example, if you select the action "play
  audio", you see only those files which can be played
  (mp3/ogg...). So not only the selected objects determine the visible
  verbs, but also viceversa, the selected verb determines the visible
  objects. This is new.

* If I select a program, I see only those VERBS which are supported by
   that program. This is another innovation (just imagine some newbie
   installing a program and not knowing what the program does: he
   discovers it at once).

* If I select a program, I see only those FILES which are supported by
   that program. This means that if you select xmms, you see only the
   mp3/ogg/ape/mpc/flac files. No need to choose the folder.

* If I select a file,

    - I see only those verbs which make sense with that file. (This is
      nothing new on windows XP and KDE).

    - Furthermore, I see only those FILES, DEVICES and PROGRAMS which
      make sense with that file. (this IS new).

* segusoLand  does not  impose  an order  of  selection. Currently  MS
  Windows and KDE impose the order file->verb->device-or-program. This
  is not always  ideal. There are some verbs  that are better selected
  first,  because they  cut many  objects. For  example: checkNewEmail
  cuts  almost   everything:  every  file   disappears,  every  device
  disappears,  and  any  program   not  cappable  of  checking  emails
  disappears. IT  SHOULD BE POSSIBLE  TO SELECT SUCH VERBS  FOR FIRST.

  Some other times, it is  better to select the PROGRAM first, because
  then you  see only  files and  verbs which make  sense with  it. For
  example, xmms  is better selected  first, because then you  only see
  the "play"and  "enqueue" verbs, and  the mp3/ogg files.

  On the other hand, there are verbs that do not cut much, such as
  deleteFile. For these verbs, it is better to select the object
  first, as usual.


  To sum up, segusoLand does not force the user to specify an
  object-first or a verb-first (also known as task-based
  interface). He can choose the style he wants: object-oriented or
  verb-oriented (=task-based). Each style is useful in some situation.

* if I select a hardware device:

   - I see only the actions which make sense with that device. (This
     is nothing new on Windows).

   - I see only those files, devices, and programs which make sense
      with that device (this is new).

* The narrowing is done on the CUMULATIVE selection, that is, from
  items selected FROM ALL WINDOWS. For example, if I select BOTH a
  file AND a device (from different windows!), I see only those
  actions that make sense with BOTH. (this is another innovation).

* This paradigm makes toolbars, buttons and menus useless. It is a
  sort of "great unification". So we remove a lot of complexity.

* Only when an action is complete (i.e. when enough objects have been
  selected), a "GO" button appears, allowing the user to execute the
  action.


* If the user does not know what a filesystem is, or what a directory
  is, he doesn't need to. If he wants to print some picture, he just
  selects the verb "print picture" and the visible files SHRINK to
  only those files that can be printed. No need to enter a directory
  or locate the file.

* almost flat learning curve.

* if you choose a program P, you will see the programs which are
  affine to it (i.e.programs that support some verb that P
  supports). This makes the user aware of alternatives and does not
  choose programs for him, yet imposing very little overhead.

* segusoLand can be seen as some kind of indexer, which collects
  knowledge about the right program to use to do things; about how to
  do things. It knows what files a program can manage; it knows the
  command lines of those programs, thus allowing the user to invoke
  all those programs in a homogenous way, transparently, without being
  aware of the differences in the command lines. All other current
  indexers have problems: the start menu is complete, but unpractical,
  because it is not integrated into the file manager. The file manager
  is not verb oriented and does not feature intelligent narrowing. 

  segusoLand imposes a common way of doing things, yet using very
  different programs.

* you only use the left mouse button, and never drag or hold.

* we can specify the time in which the action must be executed (now,
  in 10 minutes...).


QUICK START - trying the program
--------------------------------

You don't need to install prolog to run, but you do need to install it
for compiling. To run, you also need GTK+2. And maybe something
else... :-)

Put some files in your home directory. I suggest you put at least a
PDF, a JPG, a PNG, MP3, an OGG, an AVI, a BIN, a CUE, a SXW, a TXT, a
ZIP, a BZ2, an HTM, an HTML, a DOC, an ISO, an RPM.

Then launch segusoLand.exe.

Click, and try everything. Many verbs are implemented, so you can
actually use it.



QUICK INTRO TO THE CODE
-----------------------

You should open segusoLand.pl and have a look at it. Read the quick
intro on top.



TO DO BEFORE THE FIRST RELEASE (0.1)
-----------------------------------

* rename metadata tables

* add metadata to multiple files at once...

* more verbs should be working...

* allow creation of custom times.

* save and restore custom times in the db.

TO DO AFTER FIRST RELEASE
-------------------------

* undo button.

* make segusoLand usable with gtk themes such as smokey-blue, which have
   skins.

* reprogram CheckListBox so to group selected items always
  visible. The interface stays the same.

* treat pdf.gz like a pdf, and so on.

*  In the options dialog:

   - option "do not change colors of buttons and list items". Useful
     because some GTK themes such as grand-canyon allow changing the
     label color but not the button color. So you end up in white on
     white.

   - in the option dialog, choose 3 levels of tooltips: verbose,
     brief, disabled.

* if the user changes the view and the chosen view is empty, warn the
  user that he hasn't filed anything to appear in this view, and
  return to the previous view. Otherwise newbies could be disoriented.

* recognize plain text files even if they don't end in .txt. How? GNU
  libc? "file" GNU command?

* if you press a letter, move to the first _file_ with that
  letter. (You never want to do the same thing on verbs, devices, or
  programs)

* hook into the directories you watch, to be aware of files deleted or
  created.

* At startup, when parsing the database, if the database contains info
  about a file which is no more on the disk, display the message "you
  have moved, deleted or renamed the file XXX with an external
  program. All database information about this file has been lost. If
  you ahve deleted it, no problem. If you have moved it or renamed it,
  you need to file it again (with the "edit info" button)"

  But what is the file was on a cdrom that was unmounted? Shouldn't we
  keep the info?

* if I insert a cdrom, should its files be automatically inserted in
  the pool? IMO, this should be done only if segusoDir('/mnt/cdrom/'),
  which is the default.

* redesign Choose-view dialog FOR FILES, in order to show advanced
  options:

   * show only files whose name or body contains a given string.

   * filter to show _only_ files from a specific disk --in particular,
     from the cdrom. (only for files). Useless? 

   * show only files from a specific dir? (only for files)

   * show only files with a specific extension? (only for files)
     Useless? (You can choose the program or verb first...)

* allow sorting verbs and programs by usage rate and name. Verbs also
  by relevance.

* show generic verbs at the end? archive, burn, copy... Maybe an
  option?


* If we are viewing all the files, it is difficult to find the
  selected items. Sometimes you get lost. 

  solution: keep the selected items always visible, and grouped
  otgether, in another panel, above the current file panel.  This also
  removes the need to use togglebuttons! The items in the panel above
  are all selected, the items below are all deselected. We can just
  use boxes and set a common background color! This must be done
  transparently: the CheckListBox class in c++ must create two gtk2
  listboxes, not one.

  discarded solutions: 1: We could supply an alternative toggle
  button: "locate and group selected items". This would simply resort,
  grouping all selected files on top of the list, and moving the
  scrollbar to the top. Difficult because now the sort procedure
  doesn't know which files are selected. 2) supply a "deselect all"
  button. Good, and easy. But does not really solve the problem.

* session remembering: save and restore the 5 views and the selected
  items for each view.

* put the label in different color if the current view != ALL files?

* create the menu (it is really a toolbar). In the menu:

   - options

   - about
  
   - deselect all

   - locate selected items?

   - save database now

   - export/import db

* add actions for scan picture, transfer picture from digital camera,
  add icon for my laptop, my modem...

* improve wrapping: do not wrap based on a fixed number of letters,
  but when the right bound of the viewport has been reached. Also
  resize-tolerant. Also do not break words and do not cut before a
  space.


* put another background for verbs. Reason: verbs and objects are
  different concepts.

* When creating the extension tables, that is, tables like png(X), do
  not create it if the extension ends in ~.

* remove the types that are not made of letters and numbers

* remove duplicates from the recent view list.

* remove current view from the recent view list.

* sort the recent view list by last access.

* add a wizard "What do you want to do?" which asks you if 1) you know
  what you want to do, or 2) you just want to browse. 1.1) you must do
  something with a device (e.g. printer) 1.2) you know what program
  you want to use 1.3) you already know what file (or files) you want
  to use and where it is.

* when you import a directory, see if there is a database file within?

* import/export database.

* should the database be saved in each directory separately? And for
  each user?


* add the possibility to specify the screen for each action. If one
  has only one screen, simpky leaves it always selected, so we don't
  add a click per action? Unfortunately no, because at this point it
  is needed to deselect the screen in order to,say, print a
  pdf. Change this.

* device independency! If i burn a file and move it to a CD, I can
   still select it and compose actions with it. When I execute the
   action, the system will ask me to insert the cd.



TO DO BEFORE RELEASING A NEW VERSION OF SEGUSOLAND
--------------------------------------------------

[nothing]

ADDITIONAL REMARKS
------------------

The program is written in prolog and C++. You need gtk+ 2.2.

Patches will only be accepted if well commented.

Currently segusoLand is not a desktop environment, but a standalone
app. But if we add a panel (like the kicker)...


DONE
----

* speed up toggle-button redrawing, when viewing all files. With
  check-boxes it was much faster... but ugly. 

  it seems that button creation/destruction is the bottleneck. THen we
  could solve this by never destroying or creating, except at the
  beginning. At the beginning, we add all files to the list. When the
  user selects a new table, we just hide the items that are not in the
  table. The problem is sorting.

  write a new GTK+2 widget?  Show CheckListBox all at once, only after
  finishing filling it?

  NOTE: do not think you can speed up by loading icons from disk only
  once. I tested it. This is not the bottleneck. I tried removing
  icons completely, and it takes 4.5 seconds both with and without
  icons.

* if a verb is selected but the go button is not visible, put a
  flashing icon besides the kinds that are missing (e.g. if a time or
  a device is missing, let the user know). Maybe a bouncing arrow.

* fix label widget: slow redraw of labels when they are exposed for
  the fist time.

* fix crash that happens when you select a file whose name contains an
  accent ('). (KNOWN BUG).

* browse dirs with gtkFileSel, in addition to writing them by hand.

* enable the move/copy verb. It asks for the dest dir. If it is a
  segusoDir, segusoLand copies the attributes to the new file. If it
  is not a segusoDir, segusoLand asks you if you want to make it a
  segusoDir. If not, it warns you that all attributes will be lost and
  performs the movement. If yes, asks you whether you want to mark the
  new files with to-dispatch, or with a precise attribute.

* fix label widget: directories overlap with files.

* The go button should turn into an animated icon, in order to be more
  apparent for newbies.

* add a way to remove feature tables!

* enable the rename verb. If you rename with segusoLand, you preserve
  file attributes!

* the delete verb should warn you that you will loose all attributes
  of the files.

* add tooltips. for newbies.

* splash screen because of slow startup

* button to refresh file list, rereading from disk and filling the All
  files table, the ext/2 table, the hidden file table, etc. Also
  updates the date of files, which may have changed. This is useful 1)
  in case some file has been created or deleted externally; 2) in case
  a cdrom or floppy has been inserted/removed. 3) in case some date
  has changed.

* Allow renaming and deleting of metadata tables (good, book,
  picture...).  Currently you must edit the database by hand.
