ThinkC MacDock dev progress -- Like today's macOS Dock but for System 7

Relating to ThinkC Development

MacOfAllTrades

Tinkerer
Oct 5, 2022
158
163
43
It’s not the 68000 that’s tripping you up, it’s the ROM. The Plus ROM doesn’t have the Graphics Devices calls in it, so you can’t call GetMainDevice.

Pre-Device Manager, you can check the QuickDraw global variable screenBits.bounds to get the bounding rectangle of the display. (You meant 512x342 above, not 512x384, but anyway that would be wrong on a Portable.)
Quick question @Crutch. Why does
GetNewCWindow() crash the old rom machines? In addition to not calling devicemanager stuff the last thing I had to do was instead call
GetNewWindow() if the machine was one of these old machines.
Meanwhile my Se/30 was cool with calling GetNewCWindow() despite not having a color screen.

lastly- when I tried calling the Gestalt(gestaltQuickdrawFeatures) the mac plus would still claim true for gestaltHasColor. Which may make sense in that the version of quickdraw I’m running has color support despite my monitor not having it— but then again why would GetNewCWindow crash.

For now, I just looked at either the processor type or the machine type to decide what to do. But I feel there has to be a better determiner. Or perhaps, looking at the ROM version is really the correct move?
 

lilliputian

Tinkerer
Mar 6, 2022
225
91
28
Los Angeles, California, USA
@lilliputian , try this branch! It should fix the issue with the older Macintoshes:
I have it up as a pre-release on the releases page too

On the plus side (no pun intended) this also includes the dynamic sizing stuff I've been talking about - all wrapped into the beta release.

Give it a whirl - thanks for all the great feedback. Yeeesh can't believe I broke compatibility without knowing it with the color stuff.
Lookit that!
 

Attachments

  • PXL_20230919_202758880~2.jpg
    PXL_20230919_202758880~2.jpg
    2.1 MB · Views: 43
  • Love
Reactions: MacOfAllTrades

MacOfAllTrades

Tinkerer
Oct 5, 2022
158
163
43
Lookit that!
Nice. ((That extra blank spot on the right end has me worried… should never be a blank unless you were in the middle of launching or quitting a program when you took the photo?))

amazing that the code I was writing this morning is now executing on a 40 year old machine who-knows-how-far away.

That beta has the funsies/non-release zoom ++ and - - feature. Fun to see it all big and goofy

if you have applescript and the finder scripting extension installed you can also command click on items. Enjoy and let me know of any (more) issues!!
 

MacOfAllTrades

Tinkerer
Oct 5, 2022
158
163
43
After fiddling with it, it appears that the "blank" spot (which was present at launch) is MacDock itself. Clicking on it from another program switches to make MacDock active in the Application Menu.
Hm that is a bug, obviously. It should show its icon, for one, but there is a menu option to opt into showing it (default is no show at start). Geez i swear it wasn’t doing that on my test setups of my physical SE and mini vMac.
Mo code mo bugs… :p

edit: retried it on my SE with 7.0.1 and couldn’t reproduce the blank square. Are you running any interesting programs or sophisticated extensions. macdock goes through all the processes and for any that are of type APPL (or whatever the application type designator is) it will put it in the dock. The two exceptions are the finder which is not technicaly of type appl instead it is ‘MACS’ and macDock itself which I filter out by its signature and only include it if the menu option is set to “Show self in Dock”.

however, I have noticed if you have two macdock copies running it will produce one excess blank spot like you see in yours.

@lilliputian does that blank spot BLINK when you click it? That would help clue me in whether you are clicking on a mal-plotted macdock app icon or if its just (incorrect) extra wide dock border.
 
Last edited:

Sideburn

Tinkerer
Jun 16, 2023
246
79
28
California
youtube.com
Thanks for the tips as always.
I implemented the window redraws by hiding the window before the resize+move. Tradeoff being that it technically disappears momentarily while it resizes+moves in the background before drawing it again in the new size+position but on my SE/30 it was unnoticeable. I should try it on my SE to see a slower system try it.

I also added a dynamically-sizing dock over the weekend! @Sideburn def thanks for posting which got my mental juices flowing enough to get excited to buckle down on this some more.
The core of the graphics is nice and modular to support all sorts of icon sizes though I don't think it's worth letting the user customize the dock size ((this little internal build does have a Size++ and Size-- menu option so I could visually try different sizes and even faux-animate by holding a key stroke to see how slow the redraw would be -- it's not bad but probably not worth it.

Here's a video of me using the internal updates including Small Dock toggle and dynamic resizing. It's actually surprisingly satisfying but most people love their own babies no matter how good or bad they are :p:

View attachment 13650



What I really want to try next, and prior to releasing updates, is adding apps that aren't running to the Dock as discussed above. And if I'm doing that I'll probably try letting the user add documents or folders etc because it probably won't take much to add that too. This sort of "favorites" would be great because it would make MacDock not just an app switcher but also your app launcher and documents favorites all in one. Perhaps above all else - the modern Dock lets you do it, too..
Nice updates. Yeah non running apps would tie it all together and then no more need for alias’s on the desktop.
 

Crutch

Tinkerer
Jul 10, 2022
292
226
43
Chicago
Quick question @Crutch. Why does
GetNewCWindow() crash the old rom machines? In addition to not calling devicemanager stuff the last thing I had to do was instead call
GetNewWindow() if the machine was one of these old machines.
Meanwhile my Se/30 was cool with calling GetNewCWindow() despite not having a color screen.

lastly- when I tried calling the Gestalt(gestaltQuickdrawFeatures) the mac plus would still claim true for gestaltHasColor. Which may make sense in that the version of quickdraw I’m running has color support despite my monitor not having it— but then again why would GetNewCWindow crash.

For now, I just looked at either the processor type or the machine type to decide what to do. But I feel there has to be a better determiner. Or perhaps, looking at the ROM version is really the correct move?
Right — the Plus and the SE don’t have Color QuickDraw at all (hence you can’t call GetNewCWindow), whereas the SE/30 does (it just can’t show any of those colors on the internal monitor). This has tripped me up before!

gestaltHasColor shouldn’t be true on a Plus I’m pretty sure — are you certain you’re checking the right bit? Anyway yes I usually check the ROM version for this because I’m too lazy to call Gestalt 😊

C:
#define COLOR_QD (ROM85 >= 0x3FFF)  // checks for IM Vol 5 8-bit (not 32-bit) Color QD

if (COLOR_QD)
    w = GetNewCWindow(...);
else
    w = GetNewWindow(...);
 
Last edited:

MacOfAllTrades

Tinkerer
Oct 5, 2022
158
163
43
Right — the Plus and the SE don’t have Color QuickDraw at all (hence you can’t call GetNewCWindow), whereas the SE/30 does (it just can’t show any of those colors on the internal monitor). This has tripped me up before!

gestaltHasColor shouldn’t be true on a Plus I’m pretty sure — are you certain you’re checking the right bit? Anyway yes I usually check the ROM version for this because I’m too lazy to call Gestalt 😊

C:
#define COLOR_QD (ROM85 >= 0x3FFF)  // checks for IM Vol 5 8-bit (not 32-bit) Color QD

if (COLOR_QD)
    w = GetNewCWindow(...);
else
    w = GetNewWindow(...);
Argh! Double checked and you're right! I should re-enable my human brain's memory check at startup...

Sure enough, the Mac Plus reports no color with
Gestalt(gestaltQuickdrawFeatures, &result);

The bit gestaltHasColor (bit 0) sure enough is a 0. No color.

I hope you never get tired of being right or knowledgable. I know I appreciate it!!
1695235946707.png

edit to add that my masking method is probably not the most straight forward. Better to do if(result&(1<<gestaltHasColor)) so it more clearly reads as bhtshifting a 1 to the right bit spot.
 
  • Like
Reactions: Crutch