Author Topic: Designing a new Finder  (Read 65386 times)

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: Designing a new Finder
« Reply #100 on: December 23, 2020, 04:34:59 AM »
I know a bit more. It requires the Display Manager.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: Designing a new Finder
« Reply #101 on: December 23, 2020, 04:37:02 AM »
What do you think of Finder++ ?

It indicates that it’s better than Finder and that it’s written in C++.

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Designing a new Finder
« Reply #102 on: December 25, 2020, 03:19:08 AM »
or Finder II
insert arbitrary signature here

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: Designing a new Finder
« Reply #103 on: December 25, 2020, 07:29:57 AM »
The title of Finder's invisible window is "Desktop". Its contRgn and visRgn are equal to desktopRegion. It’s the same handle. strucRgn is 0,0,0,0.

I tried the solution with the special WDEF. I made a window with precisely the same regions as the Finder window. It doesn't crash, but it doesn't actually draw the desktop.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: Designing a new Finder
« Reply #104 on: December 26, 2020, 04:58:49 AM »
Finder.be

This indicates that it's made in Belgium.
Belgium is supposed to have such big brains
but Belgium doesn't have a single noteworthy software product,
or it would have to be mine.

Space Finder
Deep Finder
Deep Finder 9
Finder into darkness
Blue Finder
Cube Finder
Jackass Finder
Finder for the rest of us
Wonder Finder
Dream Finder
Galactic Finder
Woke Finder
Finder Ascending
Kick-ass Finder
Deadpool Finder
Finder unto dawn
Telltale Finder
Autobahn Finder
Shadow Finder
Fake Finder
Deepfake Finder
Finder double
Ersatz Finder
Wannabe Finder
Finder clone
Top Finder
Ultra Finder
Smart Finder
Unfinder
Express Finder
Alt Finder
Next Generation Finder
Community Finder

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Designing a new Finder
« Reply #105 on: December 27, 2020, 09:05:19 AM »
image line is from belgium. but there it stops. :)
insert arbitrary signature here

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: Designing a new Finder
« Reply #106 on: December 29, 2020, 06:06:17 AM »
That's not my idea of noteworthy.

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Designing a new Finder
« Reply #107 on: December 29, 2020, 01:56:01 PM »
of course. they did not support mac for a long time, i should have taken that into account. :)
insert arbitrary signature here

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: Designing a new Finder
« Reply #108 on: December 31, 2020, 08:37:28 AM »
I take into account how many Belgians can name one Belgian software product. We don’t have something like AppleWorks, Photoshop or Firefox, Tor, YouTube or Facebook, nothing. We have mail.be but most people don’t know it.

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Designing a new Finder
« Reply #109 on: December 31, 2020, 10:30:46 AM »
germany... has maxxon, inno/bluebyte/gameforge/funatic/crytek/halyconmedia/sandbox/ubisoft/thq/spellbound, steinberg/emagic/tcworks/NI(except brian), SAP/datev/softwareAG ... i can name them by heart in under a minute.

even the wamcom browser has its seat around the corner from my view.

but belgium... well, has swift. and that is not nothing, it is quite a big club, 7th biggest IT company in europe. https://www.swift.com/
« Last Edit: December 31, 2020, 11:03:14 AM by IIO »
insert arbitrary signature here

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Designing a new Finder
« Reply #110 on: December 31, 2020, 10:37:39 AM »
and swift is quite important.

they manage and monitor when you transfer money after you bought something which you dont need, to impress people you dont like, from money you dont have.

and they offer two superb extra services with that: 1.) they do not give you a warranty if a transaction fails and 2.) they give all your data to the CIA because we are all terrorists.

plus it is only located in belgium because of their tax policy. :)
insert arbitrary signature here

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: Designing a new Finder
« Reply #111 on: January 01, 2021, 05:05:25 AM »
... located in Belgium because Belgians want to meddle in everything.

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Designing a new Finder
« Reply #112 on: January 01, 2021, 08:44:54 AM »
dont cry. you still have caramel wafers and newbeat. both is much appreciated.
insert arbitrary signature here

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: Designing a new Finder
« Reply #113 on: January 06, 2021, 10:00:12 AM »
Good news. I can now draw the desktop just like Finder does. This works as a 68K extension. I’ll write a PPC version and a control panel. In theory I can also claim an area of the desktop, and this may have any shape and doesn’t even have to be contiguous, and leave the rest of the desktop to Finder. In theory I can also divide the desktop among different programs.

There are now 2 mystery problems left: Unicode window titles and colorful window frames.

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Designing a new Finder
« Reply #114 on: January 06, 2021, 02:38:46 PM »
wow great.

color borders? around the original desktop window or what?

there are those rounded corner badges, that i know. i once tried to find them in the suitcase to get rid of them.
insert arbitrary signature here

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: Designing a new Finder
« Reply #115 on: January 08, 2021, 01:53:39 PM »
I mean the gray window frames.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: Designing a new Finder
« Reply #116 on: January 10, 2021, 10:11:04 AM »
I chose the solution where I divide the desktop among different programs. I can now create widgets on the desktop. It does only drawing, no clicking, dragging or resizing yet. I'll do that later. With clicking, dragging and resizing it will be possible to have a dock like in OSX.

It continues to work when Finder quits. If Finder is running, then it continues to draw icons on the desktop. You should quit Finder, except if you are developing widgets and you have no Finder replacement.

Widgets have to be applications or appe extensions. Typically you program widgets as appe extensions and the rest of the desktop as an application. You can resort to offscreen drawing to avoid flickering (unlike Finder). Widgets may be stopped in the debugger. This doesn't cause the extension to crash.

This works now as a 68K extension. This is already so fast that you don't notice it, but I'll write a PPC version anyway.

Errors are logged in the "Log" file in the "OS 9.3" folder in the documents folder to make debugging easier.

You need to install the extension and include this library, which is fairly simple:

Code: [Select]
//========================================
// File: Desktop.h
//========================================

#pragma once

class Desktop
{
public:
    // Global functions.
    static Bool Init_class();
    static Bool Claim(OSType creator,
                      RgnHandle claimRgn,
                      UInt32 &ref);
    static Bool ClaimRest(OSType creator,
                          UInt32 &ref);
    static Bool Release(OSType creator);
    static Bool ReleaseRest();
    static Bool Check();
    static Bool CheckPart(UInt32 ref,
                          bool &needsUpdate);
    static Bool BeginUpdate(UInt32 ref);
    static Bool EndUpdate(UInt32 ref);
    static Bool Refresh(UInt32 ref);

    // Forbidden.
private:
    Desktop();
};

claimRgn is the region of the desktop that you would like to have. Sometimes this won't be possible because part of the region is already taken. Then you get what's left over, or nothing. With every claim or release the desktop regions are recalculated.

BeginUpdate and EndUpdate set and restore the right port and clipping and clear the update region.

This will be more complicated when I have done the clicking, dragging and resizing.

The following example is a widget that draws a white ball with a black border:

Code: [Select]
//========================================
// File: Ball.cp
//========================================

#include "Ball.h"

#include "BallApp.h"

int main()
{
    SetDebugThrow_(debugAction_Alert);
    SetDebugSignal_(debugAction_Alert);
    InitializeHeap(3);
    UQDGlobals::InitializeToolbox();
    new LGrowZone(20000);

    GuiError::Init_class();
    #ifdef __DEBUG__
        Error::Show("\pDebug version");
    #endif

    if (!Desktop::Init_class())
        {
        Return_0("\pInit Desktop class fails");
        }

    BallApp app;
    app.Run();

    return 0;
}
Code: [Select]
//========================================
// File: BallApp.h
//========================================

#pragma once

class BallApp : public LApplication
{
private:
    // Derivation.
    typedef LApplication base;

    // Global data.
    static const OSType creator=
    #ifdef __DEBUG__
        'ball'
    #else
        'Ball'
    #endif
    ;

    // Member data.
    Rect m_bounds;
    RgnHandle m_claimRgn;
    UInt32 m_ref;

    // Construction.
public:
    BallApp();

    // Destruction.
    virtual ~BallApp();

    // Forbidden.
private:
    BallApp(const BallApp &original);
    void operator=(const BallApp &original);

    // LApplication.
public:
    virtual void ProcessNextEvent();
protected:
    virtual void Initialize();

    // Manipulators.
private:
    Bool HandleDesktop();
    void Draw();
};
Code: [Select]
//========================================
// File: BallApp.cp
//========================================

#include "BallApp.h"

BallApp::BallApp()
    : m_ref(0)
{
    ::SetRect(&m_bounds,
              100,
              100,
              200,
              200);

    m_claimRgn=::NewRgn();
    ::OpenRgn();
    ::FrameOval(&m_bounds);
    ::CloseRgn(m_claimRgn);
}

BallApp::~BallApp()
{
    if (m_ref)
        {
        if (!Desktop::Release(creator))
            {
            Return("\pRelease fails");
            }
        }

    ::DisposeRgn(m_claimRgn);
}

void BallApp::ProcessNextEvent()
{
    EventRecord macEvent;

    if (IsOnDuty())
        {
        UEventMgr::GetMouseAndModifiers(macEvent);
        AdjustCursor(macEvent);
        }

    SetUpdateCommandStatus(false);

    Boolean gotEvent=::WaitNextEvent(everyEvent,
                                     &macEvent,
                                     mSleepTime,
                                     mMouseRgn);

    if (!HandleDesktop())
        {
        EXIT("\pHandle desktop fails");
        }

    if (LAttachable::ExecuteAttachments(msg_Event,
                                        &macEvent))
        {
        if (gotEvent)
            {
            DispatchEvent(macEvent);
            }
        else
            {
            UseIdleTime(macEvent);
            }
        }

    LPeriodical::DevoteTimeToRepeaters(macEvent);

    if (IsOnDuty() and GetUpdateCommandStatus())
        {
        UpdateMenus();
        }
}

void BallApp::Initialize()
{
    // Rem: m_claimRgn will be copied to system memory,
    // but I keep it around just in case.
    // For example, I might want to claim another area
    // minus this one.

    if (!Desktop::Claim(creator,
                        m_claimRgn,
                        m_ref))
        {
        EXIT("\pClaim fails");
        }
}

Bool BallApp::HandleDesktop()
{
    if (!Desktop::Check())
        {
        Return_false("\pCheck fails");
        }

    bool needsUpdate;
    if (!Desktop::CheckPart(m_ref,
                            needsUpdate))
        {
        Return_false("\pCheck part fails");
        }

    if (!needsUpdate)
        {
        return True;
        }

    if (!Desktop::BeginUpdate(m_ref))
        {
        Return_false("\pBegin update fails");
        }
    Draw();
    if (!Desktop::EndUpdate(m_ref))
        {
        Return_false("\pEnd update fails");
        }

    return True;
}

void BallApp::Draw()
{
    ::RGBForeColor(&Color_Black);
    ::RGBBackColor(&Color_White);
    ::EraseRgn(m_claimRgn);
    ::FrameRgn(m_claimRgn);
}

Now I concentrate on the problem of colored window frames. See in the attachment the sort of windows that I want.

Offline IIO

  • Platinum Member
  • *****
  • Posts: 4439
  • just a number
Re: Designing a new Finder
« Reply #117 on: January 10, 2021, 02:57:29 PM »
once the technical matters work i will happily provide you with a set of schemes using the correct luminance modes and everyrthing what is needed to make them work together and with original platinum.
insert arbitrary signature here

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: Designing a new Finder
« Reply #118 on: January 19, 2021, 11:15:26 AM »
The PPC version is finished. If you install the 68K extension then you can use 68K widgets. If you install the PPC extension then you can use PPC widgets. You can't mix them.

Offline OS923

  • Platinum Member
  • *****
  • Posts: 888
Re: Designing a new Finder
« Reply #119 on: January 19, 2021, 11:18:07 AM »
The colors are wrong. Red and blue are too light and green is much too dark. If I make a screenshot and I watch it on a Windows computer then the colors are correct. How is that possible?