Diary of an Amiga fanatic

Tag Archives: Redhouse File Manager

Being true to what I said in my last column I reserved this Monday evening for spending some time with my AmigaOne SE and OS4.1. Not the entire evening but getting about one or two hours would be some achievement. After a Monday work day you just got to relax and what better way then calling upon the mighty Amiga with it’s sidekick OS4.1.

CodeBench

CodeBench is a Jack of all trades but I still always compiled my code from the shell. Even when you could do it, and with CodeBench is intended for, from within CodeBench I would still do it myself from the shell. But not any more. Now I also us CodeBench to compile my code and tell me about any errors and if there are none run it to see the end result.

I have a lot of Amiga plans I want to realize this year. One of them is starting something I will program and actually finish and during it write about it so you readers can learn some things. Like the Redhouse File Manager but actually continue and making it to the end. I wanted to start something new and something that I could get behind and finish. I will continue with Redhouse File Manager at some point but I am afraid that if I try to use that as a project now I would not get motivated enough to keep going. So I need something new and exciting. Besides a File Manager I always have had a soft spot for creating an editor. So that is what I will start with and slowly move forward and adding stuff to it and write about it. I am already writing a bit for the first article. Looking at what I have written so far here and that I am also working already on the first Amiga Editor article I really have a great Amiga start of this week.

Skipping forward to Friday evening. The start of the weekend and time to publish this column and start working on the Amiga Editor project. And of course play some classic Amiga games.


I left my Redhouse file manager project on hold for some time already. Started out on OS4.x I thought it was a good time to continue with it on Aros for now. I am getting myself familiar with Aros so what better way better than to involve Aros in to it. One thing I really miss, and “highlighted” already several times is a editor that supports C syntax highlights. Being used to CodeBench and Cubic IDE it is a big must for me. I really hope someone will create this. For now I am using the NoWinED editor. When the code is not that large yet it is fine but once it grows you just loose that great ability of oversight.

NoWinED

Programming on Aros is somewhat different compared to OS4.x. The approach to libraries and the GUI toolkit of choice are different. When it comes to libraries we will switch back to the old classic way of opening them. I actually like this since it is true to the classic way of doing things and since I invested a lot of time in Amiga OS libraries the classic way and new OS4.x way it is not really a problem to switch back to this way of opening libraries.

Instead of ReAction which is used on OS4.x we are using Zune on Aros. Zune is an object-oriented GUI toolkit. It is nearly a clone (at both API and Look&Feel level) of MUI, a well-known Amiga shareware product by Stefan Stuntz. I have no experience with MUI so for me this will be a bit of a hurdle. I always got the idea that there are more and better MUI classes one can use giving you a more easier way of getting your code done. So far I already have small example of a window that is being displayed with some control code that will close it again. That will be the basis from which I will continue. First I will start with a split window look which is the basis for each Amiga file manager if you ask me.


I noticed it has been some time since I posted a Bucket Weekly. Lately most of my time is being used on my new project the Redhouse File Manager. If you follow my articles you know what I am up to now. The last article was about me hunting for that bug. I found it which was a great relief. I will write some more about it later this week. Yesterday afternoon (Sunday) I played some Amiga games on my A1Se OS4 using RunInUAE. That was some great fun. I played License to Kill which is in my top 10 Amiga games of all time.

I was thinking that I maybe should do some game reviews. But for this I want to play them on a real Amiga and not using a emulator. Also I need to use the keyboard on my A1SE which is not really great. For the time being I might set up my Amiga 500 upstairs so I can play and review them. Another great thing are disk magazines. Currently I have The Vague running a lot. I love The Vague 2 the most because of the mod “Jakim – Clear Mind”. It just brings back all those wonderful memories. Making a disk magazine has always been high on my list. Would be really great if I ever get around making one.

 


I already ran into my first problem. Well not so much a problem but more of a query. It has to do with checking if something was successfully opened. We do it when we open a library and also the interface of it. You might still remember it from The Bucket Programming Corner but for reference I will place the source code below.

(Note: the code is not complete since we use a if statement to make a check but we need to use the else statement to complement it. Of course in the example code of the article it is complete.)

struct Library *IntuitionBase = NULL;

struct IntuitionIFace *IIntuition = NULL;

/* Opening the Intuition Library */
IntuitionBase = IExec->OpenLibrary(“intuition.library”, 50L);

/* Did we manage to open the Intuition Library? */
if (IntuitionBase != NULL)
{

printf (“We opened the Intuition Library!!\n”);

/* Open the Intuition Interface */
IIntuition = (struct IntuitionIFace *) IExec->GetInterface (IntuitionBase, “main”, 1, NULL);

/* Did we get the Intuition Interface? */
if (IIntuition != NULL)
{

printf (“We did get the Intuition Interface!!\n”);

The most important thing you need to do is to make sure you set both *IntuitionBase and *IIntuition to zero (NULL). If we set it to NULL and we open the library and get the interface the value of both *IntuitionBase and *IIntuition should be NOT (hence the !=NULL) zero. If they are it would mean that we failed to open the library or did not get the interface. If we do not set both *IntuitionBase and IIntuition to NULL we cannot do a proper check. Even worse we could and almost surely would crash the system.

All of the above bring me to the issue I ran into. If you read Trixie’s article over at OS4Coding.net you know that instead of using OpenLibrary() to open ReAction Classes we should use OpenClass() to open the ReAction Classes. Besides returning the class library base (which we store in WindowBase) it will also return something called the class pointer. Have a look at the below code.

struct ClassLibrary *WindowBase = NULL;

Class *WindowClass;

WindowBase = IIntuition->OpenClass(“window.class”, 50, &WindowClass);

if (WindowBase != NULL)
{

printf (“We opened the Window Class Library!!\n”);

}
else

printf (“We failed opening the Window Class Library!!\n”);

As you can see we open the Window class and with it the class pointer. My question about this is that when we check if we opened the Window class do we also need to check if we got the pointer and if so how? Or can we assume that if we succeed in opening the Window class we also have successfully got the class pointer? I assume the last is the case. If we successfully opened the Window class we will also have successfully got the class pointer. Let’s say the system is not capable of storing the class pointer in &WindowClass for whatever reason it will mark it as failing to open the Window class and the WindowBase value would be NULL. I am not 100% sure about this but for now I will assume this is the case. I am still trying to figure this out by speaking to some OS4 programmers and once I got the final answer I will let you all know.


The subject says it all about my new project; what it is and what the name is. For some time already I am thinking about what my next project should be. I started on a file manager project some months ago but stopped with it after running into some issues with ReAction. I got that stuck I just left it for what it was. But after reading Trixie’s articles about how to proper use ReAction over at OS4Coding I got a burst of new energy to attack ReAction again. When trying to come up with a new project I kept coming back to the file manager and since I got a better understanding of ReAction thanks to Trixie I concluded to give it another try. Why the name Redhouse? I tribute to Alan Redhouse because without him I would not be programming on OS4 or even having this blog.

DiskMaster has always been my favourite file manager. Even now on OS4 I still use it a lot. I always wanted to develop a file manager myself which is now actually going to happen. I am going to provide regular updates about the progress of it but that is not all. I will also show how I do certain things which means I will also show some programming code and explain it. If there is demand for it I might actually go into great details but at first I will do a sort of global explanation. I have to say that I have no clue on how to put it all together but that is also the fun of it. Learning along the way and getting others to experience the same. I will also create the file manager my way which means I might not follow the “correct” way of handling such a project. Planning everything on paper first before even writing a single line of code is not for me. When you follow my articles you will see what I mean. Let the fun begin!