* * *

Author Topic: Compile Photoshop Pascal Code  (Read 1165 times)

x2nie

  • Sr. Member
  • ****
  • Posts: 476
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Compile Photoshop Pascal Code
« on: April 24, 2018, 11:22:24 am »

Hi guys, you know Adobe Photoshop source code is available to download and was written in Pascal programming language.
http://forum.lazarus.freepascal.org/index.php/topic,19922.0.html


It said that it is released to public for learning purpose.


Sadly I didn't understand it because it is not written in OOP (which I expected to be).
Perhaps the dialect is too old, and I assumed that nowadays Pascal Language is very different.
--------


So, for learning purpose I have few questions:


1. What is advantage of using "Object" rather than "Class"
2. What is difference between "Object" and "TObject" ?
3. Was there OOP implementation in the day Photoshop 1.0 being written ?
3.b) if it was, why they were using Object instead of Class ?
4. How can we compile the source code (using cross-compile or whatever) ?
5. What the compiler they use to build/compile ?
6. Am I right: I think the fpc is not available yet in that day?


I am very curios because all information/comment in internet of Photoshop 1.xx source code is about general programming, I didn't found yet in specific Pascal Programming Languange, which is it was written in.


thanks you :-*
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

Handoko

  • Hero Member
  • *****
  • Posts: 2305
  • My goal: build my own game engine using Lazarus
Re: Compile Photoshop Pascal Code
« Reply #1 on: April 24, 2018, 12:04:01 pm »
I ever heard that using object is faster than class because object allocate memory on the stack while class is on the heap.

TObject is the base class of all classes. Read more: http://wiki.freepascal.org/TObject

Free Pascal first released on 1997, Adobe Photoshop in 1990. Not sure what compiler they used. I guess Delphi/TP/TPWIn, because those were very famous in the old time.
« Last Edit: April 24, 2018, 12:09:16 pm by Handoko »

RayoGlauco

  • Jr. Member
  • **
  • Posts: 59
Re: Compile Photoshop Pascal Code
« Reply #2 on: April 24, 2018, 12:39:11 pm »
I found a web page that explains how to compile the old version of Photoshop. It says:
Quote
If you are going to build Photoshop from the distributed files, you need a Macintosh Object Pascal compiler, its associated libraries, and the appropriate version of the MacApp class library.

http://basalgangster.macgui.com/RetroMacComputing/The_Long_View/Entries/2013/3/30_Building_Photoshop.html
« Last Edit: April 24, 2018, 12:43:10 pm by RayoGlauco »
To err is human, but to really mess things up, you need a computer.

Thaddy

  • Hero Member
  • *****
  • Posts: 6116
Re: Compile Photoshop Pascal Code
« Reply #3 on: April 24, 2018, 12:43:59 pm »
I found a web page that explains how to compile the old Photoshop version. It says:
Quote
If you are going to build Photoshop from the distributed files, you need a Macintosh Object Pascal compiler, its associated libraries, and the appropriate version of the MacApp class library.

http://basalgangster.macgui.com/RetroMacComputing/The_Long_View/Entries/2013/3/30_Building_Photoshop.html
Indeed. Note FPC supports -Mmacpas but it may be that not all dependencies can be resolved against anything other than a Macintosh OS. As I understand the first Windows version was written in mspascal/quickpascal which is TP compatible (including bugs!). That would be 16 bit Windows.....
I blew up my Macintosh more than 10 years ago..... Can't test.
« Last Edit: April 24, 2018, 12:46:49 pm by Thaddy »
I might not give the answer that you want me to.. Peter Green 1969

tr_escape

  • Sr. Member
  • ****
  • Posts: 311
  • sector name toys | respect to spectre
    • Github:
Re: Compile Photoshop Pascal Code
« Reply #4 on: April 24, 2018, 01:42:38 pm »
I looked up some files of project it has got assembly parts (example: USeparation.a).

It is not easy to convert...


Ok they only compiled parts :) but it isn't easy to convert
« Last Edit: April 24, 2018, 01:44:59 pm by tr_escape »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6238
Re: Compile Photoshop Pascal Code
« Reply #5 on: April 24, 2018, 02:19:13 pm »
Note also that in old Apple Object Pascal (and mode macpas), the object()  syntax is reference based like Delphi class, and thus NOT equal to Turbo Pascal static object() syntax.

Leledumbo

  • Hero Member
  • *****
  • Posts: 7904
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Compile Photoshop Pascal Code
« Reply #6 on: April 24, 2018, 04:29:51 pm »
1. What is advantage of using "Object" rather than "Class"
I'm answering from TP/FPC POV, not MacPas. Object is allocated on the stack, class is always on the heap. Object will be freed automatically when the function goes out of scope, class requires either garbage collection or explicit deallocation.
2. What is difference between "Object" and "TObject" ?
Object is a reserved word, it's mean to signify that a type is... well... an object. TObject is the root class (or object) of all other defined classes / objects.
3. Was there OOP implementation in the day Photoshop 1.0 being written ?
No idea, but the first Object Pascal proposal is from 1982, while Photoshop 1.0 was born in 1990. Note that the proposal was never finalized, so it's unknown whether there's a compiler implemeting it that day.
3.b) if it was, why they were using Object instead of Class ?
No idea again, you might want to just read the proposal: http://www.pascal-central.com/OOE-stds.html
4. How can we compile the source code (using cross-compile or whatever) ?
Answered above, in short: it's hard to find the dependencies.
5. What the compiler they use to build/compile ?
MacPas compiler of that day for sure.
6. Am I right: I think the fpc is not available yet in that day?
No, FPC was first started in 1992, when Borland said there will be no TP 8. First public release I believe it was around 1998. Florian should be able to confirm, my first encounter with FPC was at version 1.0.2 around 2000.

x2nie

  • Sr. Member
  • ****
  • Posts: 476
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Compile Photoshop Pascal Code
« Reply #7 on: April 25, 2018, 07:40:18 am »

Thanks you every body. Your answers enlighten me so much.

Read more: http://wiki.freepascal.org/TObject
then this too: http://wiki.freepascal.org/Object


1. What is advantage of using "Object" rather than "Class"
I'm answering from TP/FPC POV, not MacPas. Object is allocated on the stack, class is always on the heap. Object will be freed automatically when the function goes out of scope, class requires either garbage collection or explicit deallocation.
5. What the compiler they use to build/compile ?
MacPas compiler of that day for sure.
MacPas, I found nothing about it except that in fpc there is compiler-compatible-mod {$mode macpas}.
http://wiki.freepascal.org/Mode_MacPas
There is said: "Mode MacPas tries to be compatible with the Pascal dialects commonly used on Macintosh, that is THINK Pascal, Metrowerks Pascal and MPW Pascal. For tips on porting from traditional Mac Pascal compiler to Free Pascal, see Porting from Mac Pascal"
So, I think youre talking about any of compiler for mac. Never mind.


Thanks you every body, its enough and is satisfied my curiosity. In fact, the answers are beyond it  :o 8-)
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

Thaddy

  • Hero Member
  • *****
  • Posts: 6116
Re: Compile Photoshop Pascal Code
« Reply #8 on: April 25, 2018, 12:03:45 pm »
AFAIk macpas mode ==~ Think pascal. Not the other ones.
I might not give the answer that you want me to.. Peter Green 1969

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus