This file is part of "5_6_5", a filter plugin for Adobe Photoshop Copyright (C) 2004-8 Toby Thain, toby@telegraphics.com.au This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 5_6_5 filter plugin for Photoshop --------------------------------- This code is provided as an example of a simple cross-platform filter plugin, which can be used as a template to start other projects. Notes on source code -------------------- Source code and makefiles under GPL license are provided for MPW (Mac 68K, Mac PowerPC Classic and Carbon targets), mingw32 (Windows/Win32 target) and the free Borland C++ Builder command line tools. A Photoshop SDK is required (available from Adobe Systems, http://www.adobe.com/). The SDK was also distributed with Photoshop 6.0 and earlier. Edit the makefiles ("5_6_5.make" for MPW, "Makefile" for mingw32, or "borland.mak") to reflect the SDK's installed location. Makefiles as distributed also assume some source files are located in directories "../common/tt" and "../common/adobeplugin". This merely reflects what I find convenient for my own personal file organisation, because many files are shared between projects. These files can be moved into the plugin directory then makefiles must be edited to reflect this. In order to build the Carbon plugin with an SDK prior to version 7.0, it is necessary to edit the SDK file :PhotoshopAPI:Resources:PIPL.r as follows: 1. find the line "case CodePowerPC:" 2. duplicate the next 15 lines 3. in the copy only, change "case CodePowerPC:" to "case CodePowerPCbundle:" and change the 5 occurrences of "pwpc" to "ppcb" (Other changes may be necessary if attempting to build with the v7.0 SDK; I have neither seen nor used that version of the SDK, and this code has not been tested with it.) In order to build the 68K plugin with MPW (SC compiler), it is necessary to edit the SDK file :Photoshop:PITypes.h as follows: 1. find the line "typedef long long int64;" 2. add preprocessor directives above and below it, as follows: #ifndef __SC__ typedef long long int64; #endif To build with Borland C++ Builder --------------------------------- A makefile (borland.mak) and compiler defaults (bcc32.cfg) are provided. N.B. bcc32.cfg needs to be edited if tools are in a directory other than c:\borland\bcc55 1. install the (free) command line tools 2. ensure the path variable is set so the tools can be found by name: edit C:\AUTOEXEC.BAT and add the following line: set path=%path%;c:\borland\bcc55\bin (or whatever directory the tools were installed in). 3. in a DOS command window, change directory to the source code directory and execute make -f borland Development systems ------------------- MPW and mingw32 can be freely downloaded from http://developer.apple.com/tools/mpw-tools/ and http://www.mingw.org/ respectively. MinGW32 can be hosted on virtually any UNIX or Linux system, or under Windows. MPW runs on PowerPC and 68K Macs under Mac OS 9 or earlier, or Classic mode under OS X. Borland C++ Builder free command line tools can be downloaded from http://www.borland.com/products/downloads/download_cbuilder.html Building using Visual C++ 2008 Express Edition ---------------------------------------------- Prerequisites: - Visual C++ 2008 Express Edition http://www.microsoft.com/express/download/ - Windows SDK for Windows Server 2008 and .NET Framework 3.5 http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en (for more details, see http://msdn.microsoft.com/en-us/windowsserver/dd146047.aspx ) On Windows: > nmake /f nmake.mak On WINE (Linux/OS X): Some setup is required. (Inspired by: http://issaris.blogspot.com/2008/04/creating-dlls-using-visual-c-8-on.html ) Ensure the VS2008 runtime is installed: $ wget http://www.kegel.com/wine/winetricks $ sh winetricks vcrun2008 Set up necessary environment variables: $ wine regedit Edit Environment key, and add a string PATH with a list of DOS paths separated by ; PATH needs to include the bin, lib and include directories for Visual Studio and the Windows SDK on your system. For example, on my system, I am using these definitions: INCLUDE = d:\microsoft visual studio 9.0\vc\include;e:\Program Files\Microsoft SDKs\Windows\v6.1\include LIB = d:\Microsoft Visual Studio 9.0\VC\lib;e:\Program Files\Microsoft SDKs\Windows\v6.1\Lib PATH = d:\microsoft visual studio 9.0\vc\bin;d:\microsoft visual studio 9.0\common7\ide;e:\Program Files\Microsoft SDKs\Windows\v6.1\bin For more information on environment variables in WINE, see: http://www.winehq.org/docs/en/wineusr-guide.html#ENVIRONMENT-VARIABLES Finally: $ wine nmake /f nmake.mak