Photoshop Plugin Development

From Open Watcom

Jump to: navigation, search

This is a quickstart guide how to build and debug Toby's Count Colours Filter Photoshop plugin with Open Watcom.

Contents

Prerequisites

Adobe Photoshop 6.0 SDK.

You can obtain this from the Photoshop 6.0 install CD. You can also request a current copy from Adobe if you own a copy of PhotoShop. Plugins created with the 6.0 SDK work in modern versions of PhotoShop.

Install the sdk to your disk, preferrably to the root of your drive. Rename the directory to a name without spaces,Watcom doesnt like spaces in filenames.

Watcom 1.6 beta or later

Prior Versions might work, but then you must use another resource compiler and disable the autodepend feature. Get Watcom 1.6beta RC1 here.

SVN client

Get the command line svn client. After installing reboot, or set the environment manually.

Getting the source

Make a directory anywhere for telegraphics plugins, remember, no spaces in pathname

cd {FOLDER}
svn checkout http://www.telegraphics.com.au/svn/common/trunk common
svn checkout http://www.telegraphics.com.au/svn/countcolours/trunk countcolours

Building

cd into countcolours\wpj\
ide countcolours.wpj

The watcom IDE opens. Click menu File->Before... The window contains one Command: set PSSDK=E:\Adobe_Photoshop_6.0_SDK Update this to reflect the location of your Photoshop SDK, close window.

Click Actions->Make All The project should build cleanly now. The makefile, all intermediate files and countcolour.dll should be built. countcolours.dll is copied to countcolours.8bf. All these files are stored in the wpj projectdirectory.

Debugging

  • .8bf plugins are dlls.

Dlls cannot be debugged in the ide, so go back to console. type wdw <Path to your Plugin Host> The debugger opens. Click the menu: Break->On Image Load. Type countcolours, Press enter. Press F5 repeatedly, until the Host runs. Configure your host to find the countcolours plugin. (Alternatively you can copy countcolours.8bf to your plugin directory) Open an image and invoke the plugin. The debugger becomes active when the plugin loads and you can set breakpoints or everything else and debug the plugin. If you dont see the source, open the modules window and doubleclick onto the countcolours module. Of course the plugin has no bugs, if you find any, report them :-)


Notes about compiler and linker options

It is essential to use stack based calling conventions and default (1 byte) structure alignment. It is recommended to use embedded debugging symbols rather than separate symbolfiles. (It is possible to use symbol files, but it is tricky for dlls, requires other precautions)

This is preset in the supplied project.

You can contact Peter Heckery for questions on peter dot heckert at arcor dot de

Personal tools