
                             GEM DESKTOP 3.03 GPL
                                 Feb 25, 2000
                    --------------------------------------
                       Restored Portions & documentation
                             (except where noted)
                    (C)1999 Ken Mauro, all rights reserved.

                                Contributors
                                -------------
                                 Gene Buckle
                                 Tim Olmstead

                                Ben AL Jemmett

                         Original GEM Desktop Sources
                         (C)1987 Digital Research Inc.
                    (C)1999 Caldera Thin Clients Inc. (GPL)

                        Original and Restored Portions
                          free for non-commercial use.
                       (see GPL license.txt for details)




Introduction
------------
Knowledge of GEM, the desktop, programming and required tools are assumed.
Be sure to backup all current desktop related files before proceeding.

Sources affected are commented and marked by using various keywords such 
as by author or by function(): '-ken', 'KWM', 'BALJ' or 'trashcan'.


Packing list for desk303 GPL   
-----------------------------
(see INSTALLATION section for more details)

pkunzip /d desk303  e:    (ramdisk root directory example)

creates 

e:\src		desk303 sources
e:\bin		desk303 binaries 


Features
--------
This desktop is a restored build with most cut-out features re-enabled:)
Such as: infoline, icon drag, overlapping, adjustable windows w/context save 
enhanced Text/Icon View, Folder rename and the Trashcan:[]


What's New
----------
Well, not really new.. but additional user drive icons may be configured 
manually in desktop.inf by changing the 6th digit in an #M definition using
a simple ascii text editor.

These new icons cannot be directly un-installed using menu [Install Drives]. 
You can however use [Install Drives] to rename an unknown type (converts to 
back to a hard disk icon) which then can properly be un-installed. 

This may also work on earlier desktops using the newer deskhi.icn set.


Modified desktop.inf			Redefined DESKHI.ICN
-------x-------------------		--------------------
#M000001FF A FLOPPY 1.4M@ @		0 = Fixed/Hard Disk
#M000001FF B FLOPPY 1.2M@ @		1 = 3 drive		
#M000000FF C FIXED 211m@ @              4 = Net Drive (viewmax)
#M000000FF D FIXED 211m@ @		5 = 5 drive
#M000000FF E VIRTUAL@ @
#M000000FF F EXTERNAL@ @


There are several undefined icons (indexed less than 7) available that could
be redefined using John Elliott's excellent EDICON series of GEM icon editors.



Desktop windows opened based on number of #W lines in desktop.inf file. 
which can be edited or deleted with a text editor or use the examples supplied.

The window display order is now correctly preserved when saved.

Folder Rename.  Although there is no Cancel button, only a changed name
will actually be written to disk.  


Trashcan:)
----------
The trashcan was implemented in both the DRIVES: (level) and for additional 
convienience, next to the "new folder" (thanks Ben:) of each window, until 
someone can figure out how to get it *safely* back on the Desktop.

The trashcan does not have to be in the same window as the files being deleted.
Any one of them will do.

While the trashcan in each window metaphor is not the ideal, it is still 
more convienient than reaching for the desk menu delete function when 
deleting files.  You may drag files to it, but not select it.  



Window Icon Snap
----------------
An improved View (fit2win) has been implemented using the existing desktop 
menu: ARRANGE [Show Icons] selection now supports [Snap to icons]. The window
will snap to the nearest Icon width.  Snap to Icon is now the default Icon View.


Desk Windows
------------
Based on the available source code, the desktop windows cannot be repeatedly
opened and closed *safely* at the moment.  However, a temporary workaround 
allows the user to determine the number of desktop windows (6 max) by adding 
or removing the number of [ #W ] entries in the DESKTOP.INF file.  
(Two to Six window DESKTOP.INF examples are supplied) 

This method is also supported by DESKTOP 1.2 (maximum of 4 windows).

While this desktop can support more than four windows (6 maximum), 
the stock GEM AES according to DRI can still only handle eight open handles 
including the desktop handle #0. Six windows will support one DeskAcc only. 

Opening a second may crash the system if, it does not do a proper check for 
available windows. (This only refers to DeskAccs actually selected or opened).


Full size windows
-----------------
If a window is fulled, it's previous size is now preserved between 
desktop, GEM program or dos shell [menubar only] runs. While full, the 
Window drag MOVER has been disabled so the the previous size can be
returned to. 

A fulled window's size is now based on the current screen driver resolution, 
rather than the saved desktop.inf values, which previously introduced small 
errors due to limitations in the encoding method used in app_save(). 



Possibilities
-------------
Rewriting the disk icons back on to the desktop would have been preferred
but a little too difficult at this time, given the lack of documentation
(and my experience;).



The Desktop routine that executes output.app (off of the file menu) could
be adapted to the shortcut metaphor. GEM shell command strings in text files.

Hopefully, this will provide a handy start for those wishing to further
improve or enhance the orginal scope of the GEM/3 desktop (i8086 family).


-Ken Mauro.




[ Technical and Documentation Area ]


Installation and setup
----------------------
Be sure to backup or rename all of your current desktop files before using,
then copy the following files from =this= package to your  .\gemsys  subdir..

desktop.app 
desktop.rsc 
desktop.inf  ( 4 window ) 
deskhi.icn   ( new trashcan )  
desklo.icn 


The following examples optionally determine number of desktop windows opened.
rename the chosen file to desktop.inf and copy to the \gemapps\gemsys subdir.

desk2.inf   (2 window)	 desk3.inf   (3 window)
desk4.inf   (4 window)   desk5.inf   (5 window) 

desk6.inf   (6 window)   ** use with caution **



Compiling info 
--------------
Improved assemble/compile/link batchfile that now supports minimal ms/dr-dos
errorlevel style trapping, with error log files for HI-C, RASM86 and LINK86.
Most errors should kick you out of the batch file as they occur..
You would then view the HC.LOG, RASM86.LOG or LINK86.LOG as required.

*****************************************************************************
This package should be compiled from it's own subdir or ramdisk (preferred).
*****************************************************************************

Warning: previously compiled (*.obj) and error (*.log) files are erased at the
start of each build. If not desired, comment out the batch file as required.


Known problems;)
----------------
Windows positioned too close to the menubar, may snap up after save/restore.
Although x/y word aligment is employed to reduce the problem, it may be 
aggrivated when saving under one screen mode and restarting on another.
(Re-saving the preferences should minimize the problem.)

*****************************************************************************
On some machines (from my experience) some programs launched from a desktop 
with greater than *2* or *3* windows open under AES/VDI 2.x or greater 
(including GEM DESKTOP 1.2) may experience GEM app dialog lockup or having to 
click the mouse once before an Dialog field or Selector will become active. 

In some rare cases, a lockup will occur and you will have to reboot. 
******************************************************************************

The easiest workaround is to have only two desktop windows open, the problem 
appears to be more of an AES/VDI problem rather than a desktop problem. 

I solved this problem in the desktop itself by inserting a small delay in 
front of form_do() in GEMBIND.C, which eliminated a similar problem when
opening the about 'dialog' with four windows open and desk accessory active.

Future GEM apps compiled this way may find this as a usefull workaround. 

Apparently some GEMapp developers may/may not have been aware this problem
based on various tech support emails found in a file named GEMBUGS.DOC 

While dragging a file onto a 'disk drives:' window, selecting an icon and then
moving off again before releasing the mouse button; may trigger an AES alert
(from gem.rsc) impling that your application could not open a file or folder.
The desktop code did not catch the error. (non-fatal, just press [OK] )



Desktop Compiler/ Tool Notes
----------------------------

File :  High-C 1.4 (598k bytes, early 1987) Serial# 112
Prob :  DOS command line problems after compiling the C language portions.
        Also may lockup after compiling several modules under batch file.
Fix? :  after the dos prompt returns, using dos's DEL command with a wildcard
        specification (*.obj) produces an error: 'too many parameters - obj'.
        Increasing the dos stack to: STACKS 9,512 cured the problem for me*


File :  Link86
Prob : Occasional emm386 #12 (stack) errors using Link86 2.02 possibly 
        as a result of implementing piping to log files were cured also.
Fix? : Increasing the dos stack to: STACKS 9,512  (worked for me*)

*Note:  It is not clear if the above problems are caused by some interaction
        between my machine, HI-C, LINK86, RASM86, RAMDRIVE or EMM386.

*Note:  High-C 1.4 (642k bytes, late 1987) Serial #113
        This version does not seem to exhibit any of the above problems
        and may have been a maintenance release as the version is the same.
        It also identifies itself as supporting i80386 code.



Desktop Source Changes
----------------------

File :  DESKSTAR.A86
Code :  GLOBAMNT increased from 7D1Ch to 8800* (supports 6 desk windows max).
why? :  make space available for previously reduced/removed window resources.
	The mimimum safe value is 8500h (less than = tricky).

        update: The SIZE_AFILE sets the maximum size of the desktop.inf file
                and appears to have no relationship to GLOBAMNT.

File :  GEMBIND.C
Code :  form_do() - inserted a call to: evnt_timer() (150ms delay)
Why? :  Some machines (possibly speed related) may have intermittant lockup or
        initial lack of control after a dialog is drawn and form_do is entered.

Symptom:
        1. cursor may not respond to key unless mouse is clicked first.
        2. with more than 2 windows and accessories active; the 'about' dialog
           does not respond to the mouse although the pointer is still alive.
           the only solution is to reboot.
        3. I have also seen this problem with desktop 1.2 on several machines.

Notes : I have noticed in the desktop sources, that other calls to evnt_timer()
        and wind_get() are commented out at various points, suggesting the
        developers might have been aware of some type of interrupt or dispatch
        timimg problems. See GEMBUGS.TXT (included)



File :  DESKAPP.C
Code :  changed rdicon(), commented out last block.
Why? :  changed the index & portion of the icon used to highlite or select it.
        now uses ib_pmask instead of ib_pdata.
        see also DESKACT.C


File :  DESKAPP.H
Code :  WSAVE
Why? :  WSAVE win_save[2] changed to win_save[6]
        win_save sets number of windows saved in desktop.inf by cnx_save()
        see also DESKWIN.H


File :  DESKHI.ICN
Code :  restored trashcan ( for GEM desktop 1.2  w/ GEM 3.x only)
Why? :  A clean desktop is a happy desktop.
        the desklo.icn has not been updated at this time.

Note:  deskhi & desklo.icn are now interchangeable with GEM desktop 1.2
        desktop.rsc is modified, but still compatible with GEM Desktop 3.x
        desktop.inf is compatible with GEM Desktop 1.2 and greater.    


File :  DESKWIN.C
Code :  w_sinfo(), win_alloc()
Why? :  restore infoline support for desktop windows.
        restored WNODE w_info[81] field in DESKWIN.H (81 bytes per WNODE).


File :  DESKWIN.H
Code :  NUM_WNODES raised from 2 to 6.
Why? :  restore infoline support for desktop windows.
        restored WNODE w_info[81] field in DESKWIN.H (81 bytes per WNODE).
        See also DESKAPP.H


File :  DESKFUN.C
Code :  win_sinfo, wind_set() & fun_rebld().
Why? :  re-enable desktop window infoline (WF_INFO) call.
        destination folder check rewritten to handle >2 windows.       
        *pwname[] size now based on NUM_WNODES+1 defined in DESKWIN.C


File :  DESKFPD.C
Code :  pn_folder() 
Why? :  Add addtional trashcan in front of 'new folder' in each window.
	(Thanks Ben:)

File :  DESKFPD.H
Code :  tie number of PNODES to NUM_WINODES+1
Why? :  The number of pathnodes appear to be related to number of windows+1 
         opened (now dependent on #W found in desktop.inf (6 maximum).


File :  DESKSUPP.C
Code :  win_sinfo, wind_set()
Why? :  implement desk window infoline (WF_INFO) feature.
        this point was chosen because the title (WF_NAME) is set here.


File :  DESKSUPP.C
Code :  do_wfull()
Why? :  re-written to properly resize overlapping windows.
        previously, this routine only supported partial resize
        of two fixed position windows (upper and lower).


File :  DESKACT.C
Code :  gsx_attr(), rc_constrain(), gr_drgplns()
Why? :  restore icon outline drag for original file copy metaphor.
        add AT_ISFILE type to provide additional feedback while dragging.
        previously only disk and folder icons highlite while dragging.
        see also DESKAPP.C 

File :  DESKACT.C
Code :  act_chg(), act_allchg(), do_chg()
Why? :  Adjust do_chg()'s ob_state select values to restore the original
        (inverted) metaphor for selected window objects. ( GEM desktop 1.2 )


File :  DESKTOP.C
Code :  sound(), do_movesiz(), win_hblt(), win_hslide(), do_copywrt()
Why? :  restored easter egg, horiz slide features.
        minor size adjustment to copyright dialog during startup splash.
        full desk window move, resize, horiz and vert scroll restored.


File : DESKTOP.C
code : rc_copy(), cnx_put() changed, fix_wins() removed.
Why? :  fix desktop save/restore context for multiple windows.
        fixwins() method of identifing saved windows (topped/fulled)
        by location and position is no longer suitable for overlapping windows.


File : DESKTOP.C
code : obid_save, gl_idsiztop & gl_whsiztop redefined.
Why? :  save/restore currently topped window & context between desktop runs.
        obid_save was previously hardwired to zero and appears to do nothing.
        In desktop 1.2, the context obid_save is used to remember which drive
        a desk window was opened from. In desktop 302, the left byte of 
        obid_save is used to flag the previously fulled window. 

        gl_idsiztop, a global word previously used by fixwins() is no longer
        required by a 2+ window system and is used for TOPPED window restore.


*The End.
