DISCLAMER - Everything here is pre alpha, do not run anything as root!!!, stuff in bmps.h might be deemed copywrite micro$oft corp.

Project started June 7th 1998

One of the things that I did like when runnning windows was the file manager (winfile.exe). This project is to produce a linux version of winfile.exe, but without the MDI ( I think an MDI widget is available from ftp://itimail.iti-oh.com/pub/project/sws/MDI-.tar.gz if you think its important). The source code presented here is VERY unstable, it leaks memory like a seive, the drawing routines are very inefficient, global variables everywhere, you will also soon find out that it dumps core if more than 50 files/folders are found in a directory. I started coding (06-06-1998).

Here are a few screen grabs to see what it currently looks like.
pic deleted here 11-06-1998 to reduce page size

Enough of pretty pictures, you want the raw & dirty source code.

Makefile

main.cc

bmps.hHeader file containing bitmaps - not Xpm!

dir.hHeader file with class declarations

I'll briefly explain how things work. One Folder object is initailised as the root directory "/", this then reads the root directory using the Folder::Open() function. To make the window white I call XFillRectangle(), I then draw the Folder object using Folder::Draw, recursion ensures siblings that have isExpanded == TRUE will be drawn also.

The Folder::Expand() function works by finding the folder that was 'clicked', this is done using the 'stack' argument, again recursion is the engine. Folder::Close _SHOULD_ delete the memory allocated for siblings, I think I should also free the memory allocated by the call to readdir() in Folder::Open(), but am not sure if it is free'd on the return(?).

Ok things that need doing (in no particular order),

Sort out the 'Object Design'... let it evolve :-)
Fix Memory leaks
Change 50 file/directory limit (line 231 main.cc)
Add some more file icons - file link, executable, maybe change the others to non M$
Code vertical sash/pane bar (big job this..)
Add motif style scroll bars
Add ShellExecute() function, will probably require a '~/.some-app-name.conf' data file
Give this app a decent name
Sort out the [+] [-] icons, also the '|' need fixing (playing around with the app for a few minutes will make things a bit more clear..
Change the displayed file name to just the string after the last "/" (an easy one!)
Add a menu-bar
Add a tool-bar (resolves disks from /etc/fstab ?)
Drag & Drop (the most important bit, probably)

Because I hate all the other 'X' file managers so much I will probably get this beast up and running within 2-3 months, however I will need you people to alpha/beta test it for me ;-) , help me with the bugs & give me advise on increasing speed.
You will notice that there is no header in the source code, once fixes & additions start to come in I will make a header file, everyone that submits something(with fix!) gets their name in the source code.
Licencing issues. I claim no copywrite on any of the material here, bmps.h might be a seen as a misco$oft rip off, so be careful. Once the program becomes 'usable' I will decide on the GNU, or X11R5 style header. Personally I think I should just say - here it is, free, do what you like with it :).

You can contact me by e-mail[email protected]

Please do not distribute this app in binary form (because it is so bad)

Please do not tell me to use lesstiff, tcl etc, I want this app to be QUICK!!

Please do tell all your friends & newsgroups about this project & give them the source code

If anyone wants to host this site LMK


Update 07-06-1998

Well I thought the horizontal panes might be tricky, however after getting hold of Paned.c from the Xaw (athena widgets) I simply changed the vertical to horizontal & things now are starting to come into shape :).
This next pic is what things are looking like 07-06-1998 (pm), the top pane will house menu & toolbar, the right pane needs to get populated with the files/folders of the directory on the left. I need to hack Paned.c some more & also the Grip Widget to truely emulate windows. Thats it for now, check back in later this week & you may get to see some buttons on a toolbar :)

Update 08-06-1998

Icons done for disk & floppy drive, as you can see from the .gif file I have yet to do the cdrom (/dev/scd0), sda1 & sda3 are "none" according to mntent->mnt_dir, i'll hide these as well as swap & proc later, the selected blue rectangle attaches itself to the first mounted disk found, once I write the callback for this widget it might actually do something. It might also be nice to put /dev/fd* at the left "a: b: c:" style.
Hopefully you noticed that /dev/scd0 is 'greyed out' - done by parsing both /etc/mtab & /etc/fstab, easy :)
Source code is still in a mess, I am going to need to split main.cc into managably sized files, however since I think the disk resolving might be of interest to some people I've 'upped' the latest main.cc.
BTW - page count stands at 61 hits, not bad for 2 days?
main.cc (07-08-1998)

Update 09-06-1998

Callback is now written for the 'disk bar', clicking on a disk will make it the 'root' of the left hand pane. I've also drawn in the CDROM icon (/dev/scd*). The right hand side pane will now contain all files and folders of the currently selected directory, unfortantly the currently selected direcory is not highlighted (white text on a blue background), fix this later.
You will also notice that file names are missing their directoy name, looks much better now, only the 'Folder' at the top of the stack on the LHS has its full path (i.e. mount point). No memory leaks have been fixed :( & I have more problems in that the both 'disk bar' & 'right hand pane' do not have fully working 'Expose' functions. If you don't know what that means - minmise, maximize, click again..
Ok, Pics!

In the above .gif I have the "apps" CDROM (part of sunsite 3CD set from linuxmall) in /dev/scd0, files are still appearing on the LHS (easy enough to filter!), files and folders appear on RHS, i should really have a ".." entry on the RHS (icon is in bmps.h already). As you can see /mnt/cdrom is the mount point & therefor has the full path displayed.
That bit of the 'sash' missing 1/4 inch from the bottom is infact the 'grab' widget - must sort this out..
You get the full source today in a .tgz file, except its .tgz.html because I have not figured out how to upload a .tgz file to geocites (anyone?), maybe I can turn this into a plea for a better host !BG!
09-06-1998.tgz.html
Download it, rename it, unzip it (tar xvfz ./09-06-1998.tgz), make it (make test), run it (./test), remove core file...
Hey it will not be like this forever... :-).
Come back tommorow for more developments (over 100 hits on this page WOW) [email protected]

Update 11-06-1998

No post last night, not much done what with all the footy. Camereoon-Austria dead boring so I've done a bit more. The menubar, now has 'buttons' & a call back, this will turn the background blue & the text white, it also handles PointerMotionMask events so after selecting 'File' (say), then moving the pointer over to 'Disk' will turn off File, & Disk on (true windows behaivor).

The normal X handler for popup menus is smeBSBObjectClass however these things don't stay up if you take you finger off the mouse button (very annoying IMO), so I have to code my own popup. I'm using the XtCreatePopupShell, with a simpleMenuWidgetClass, this I have coded in the 'border' of the widget & also the dividing line... (See gif)

Looks ok, except that its in the wrong place (I can fix this), it also occupies all my workspaces (I'm in CDE), but worst of all it is actually 'below' the application (so you would not see it if it was in the right place :-(.
I've got the source code for xterm, so I am trying to figure out how the -ctrl-left mouse down- events are handled, once sorted I should be able to get the whole menu-bar coded quickly (without callbacks).
I should say that I have had a few e-mails about this project, mainly you want to know how much of winfile.exe's functionallity, I plan to put in, as well as one or two requests for 'explorer' features. To be honest I have not thought of what the 'Final' version will look like, putting in all the keyboard short-cuts should be quite easy, I've never coded drag & drop before, but this is definately something to go in. The 'File | Associate' feature, could pick up info from the CDE, there is also a 'cross platform registry project' (http://???), I'm sure fvwm & kde have something similar. But for simplicity I think I will simply have a ~/.winfile ascii file, if you want to code something else, be my guest.
I would like to have a 'Disk | Connect network drive' that could connect to an anonymous ftp site, that sounds kewl, ( a bit like nortons sytem commander(?)). The Properties, & Send To from explorer are also nice features, & would take very little code to implement
Blimey a cameroon gooaaaalll....
Later..

Update 12-06-1998

Not much to report tonight. I figured out what was up with my popup (had a stray realise widget), I've written the routine to size the pulldown & put on the buttons, take a look,

Don't wory about the '&' characters for now, these are for accelerators. I'll try to get all the pulldown resources typed in tommorow, (yawn). I might have time to think about an 'isGreyed' property, and maybe a Help|About. I'll post another .tgz also.

Update 13-06-1998

All resources coded for the menus, the buttons on the pulldowns have 'white on blue' colour change during 'mouse over' events. This is riddled with bugs at the moment - but it looks good.
Here is the latest code 12-06-1998.tgz
Because the code is so unstable at the moment I am going to fixing things for the next few days before I can actually go any further.

Update 16-06-1998

Speed has been increased in the menu drawing routines, the menu behaviour is a little different to windows at the moment, not sure if it is a bug or a feature yet. I've coded the translation from '&' to _ and restructured the code into c++, this is not total since X callbacks must be static - so all widgets are global.
I've managed to code the Help|About dialog without using static (i.e. my own event loop), I'd like to use this for the main-app since this does of course block Redraw event to the main app.

I'll leave you with the Help|About dialog, you may notice that the RHS pane is empty - I've split the main.cc into 'one file per class' now so 'folder.cc' does not know about the RH pane, this should get fixed once it's all written in C++, which is when you will get the next .tgz
Oh yea "Linfile".. what do you think??

Update 28-06-1998

Things are now a bit tider as far as source code is concerned, there also seems to problems with loading .tgz archives onto geocities, so I'm trying shar format archive today (good luck).
Click here for 28-06-1998.shar

As you can see I'm no artist but I have managed to hack together the winfile icon with the linux penguin logo, this will now be the 'official' linfile logo (copywrite free naturally). Your probably wondering how unstable it is,.. next question :-P
From the gif below you can see that I have added file size (bytes), & modification date (these are st_size & st_ctime from stat struct), It is apparent that I need to add sizable buttons at the top of the RHS pane for sorting & to ensure that the user can see everything, this needs to be controlled from the View pulldown menu.
The more observent will notice the .. icon at the top of the RHS pane, does nothing :). I'll try to get some scroll bars incorporated & also a better looking grab widget (+ those buttony things at the top of the RHS pane),
BTW you may want to check out http://www.x-plorer.org/ for an implementation of M$ explorer, It has speed problems, but it is a lot more complete than linfile.


Update 29-06-1998

As promised some attention has been directed to the grab widgets. I've changed the (already hacked) Xaw pane widget to use a grab widget 2 pixels wide & 1000 tall..

This is probably not wide enough to be user friendly, 4 would be better. The sort buttons are sizable BTW, next job is to get them to change file property fields widths, should not be too tricky. Might also get something put under the "View | Partial details" menu entry, but probably not tommorow (ENGLAND .vs.argentina)

Update 02-07-1998

Site moved to fortunecity.com host. This page is now the 'development history' because its starting to get a bit large. I've started on the < - | | - > cursor font, but have not figured out how to set the mask up. This is whats in the latest .tgz file
02-06-1998.tgz BTW yes I know this icon is in menupopups, but i'm trying to get it to work properly..

Update 03-07-1998

Cursorfont done for the panes and sizable sort buttons on the RHS pane. menupops now has a much nicer XC_right_ptr cursor.
I could not figure out why the pixmap mask was not working so I changed from using pixmap (xpm) to bitmap (xpm) & it worked ??. The bitmaps themselves are pasted into the top of the phaned.c source file. 03-07-1998.tgz

Update 06-07-1998

I've started work on the scrollbars. Good old Athena widgets again Viewport.c provides the container for the main pane & both scrollbars. The standard Xaw scrollbar is not very similar at all to the M$ implementation, I've stripped out the Button1 & Button3 callbacks have gone & button2 shifted onto 1. The scrollbar is 32 pixels shorted than it should be (for the buttons) & the scrollbar 'thumb' dissapears when the DC is smaller than the pane.
I think that I'll end up creating actual CButton widget rather than 'drawn' buttons...Hmmn
Probably be easier..
06-07-1998.tgz

Update 11-07-1998

Scroll bars are in a usable state, the only GC that changes its size on the fly is the left hand pane - & then only the height :(
I've started to think about the buttons on the toolbar & could really use a cButton class. I'm contemplating writing a cWidget class & then porting the Athena widgets that I'm using to c++, but its probably to much work.
..Before that happens I'll be adding something to the 'isSelected' property of folders (i.e. white lettering in a blue box, with dashed black line border.), which should mean I can start to play around with drag & drop (remind me not to use pixmaps!).
More seriously there is a serious memory leak in the Folder::Open() routine, or rather lack of memory allocation. From what gdb seems to be telling me only the first depth of this recursive function actually allocates memory. 11-07-1998.tgz