Add photoshop exporter template.
This commit is contained in:
76
project/vc8/PhotoshopExporter/PhotoshopExporter.cpp
Normal file
76
project/vc8/PhotoshopExporter/PhotoshopExporter.cpp
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
|
||||||
|
#include "PhotoshopExporter.h"
|
||||||
|
|
||||||
|
#include <Plugin.h>
|
||||||
|
|
||||||
|
SPBasicSuite * sSPBasic = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void InitGlobals (Ptr globalPtr)
|
||||||
|
{
|
||||||
|
Globals * globals = (Globals *)globalPtr;
|
||||||
|
|
||||||
|
// Set default values.
|
||||||
|
globals->queryForParameters = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DLLExport MACPASCAL void PluginMain (const short selector,
|
||||||
|
void *exportParamBlock,
|
||||||
|
long *data,
|
||||||
|
short *result)
|
||||||
|
{
|
||||||
|
if (selector == exportSelectorAbout)
|
||||||
|
{
|
||||||
|
sSPBasic = ((AboutRecord*)exportParamBlock)->sSPBasic;
|
||||||
|
//DoAbout((AboutRecordPtr)exportParamBlock);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sSPBasic = ((ExportRecordPtr)exportParamBlock)->sSPBasic;
|
||||||
|
|
||||||
|
// Allocate and initialize globals.
|
||||||
|
Ptr globalPtr = AllocateGlobals ((uint32)result, (uint32)exportParamBlock, ((ExportRecordPtr)exportParamBlock)->handleProcs, sizeof(Globals), data, InitGlobals);
|
||||||
|
|
||||||
|
if (globalPtr == NULL)
|
||||||
|
{
|
||||||
|
*result = memFullErr;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get our "globals" variable assigned as a Global Pointer struct with the
|
||||||
|
// data we've returned:
|
||||||
|
Globals * globals = (Globals *)globalPtr;
|
||||||
|
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// (3) Dispatch selector.
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
|
||||||
|
switch (selector)
|
||||||
|
{
|
||||||
|
case exportSelectorPrepare:
|
||||||
|
// DoPrepare(globals);
|
||||||
|
break;
|
||||||
|
case exportSelectorStart:
|
||||||
|
// DoStart(globals);
|
||||||
|
break;
|
||||||
|
case exportSelectorContinue:
|
||||||
|
// DoContinue(globals);
|
||||||
|
break;
|
||||||
|
case exportSelectorFinish:
|
||||||
|
// DoFinish(globals);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// unlock handle pointing to parameter block and data so it can move
|
||||||
|
// if memory gets shuffled:
|
||||||
|
if ((Handle)*data != NULL)
|
||||||
|
{
|
||||||
|
PIUnlockHandle((Handle)*data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
27
project/vc8/PhotoshopExporter/PhotoshopExporter.h
Normal file
27
project/vc8/PhotoshopExporter/PhotoshopExporter.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
#ifndef NV_PHOTOSHOP_EXPORTER_H
|
||||||
|
#define NV_PHOTOSHOP_EXPORTER_H
|
||||||
|
|
||||||
|
#include <PIExport.h> // Export Photoshop header file.
|
||||||
|
#include <PIUtilities.h> // SDK Utility library.
|
||||||
|
|
||||||
|
// Photoshop crazyness:
|
||||||
|
//#define gResult (*(globals->result))
|
||||||
|
#define gStuff (globals->exportParamBlock)
|
||||||
|
|
||||||
|
|
||||||
|
// This is our structure that we use to pass globals between routines:
|
||||||
|
struct Globals
|
||||||
|
{
|
||||||
|
short * result; // Must always be first in Globals.
|
||||||
|
ExportRecord * exportParamBlock; // Must always be second in Globals.
|
||||||
|
|
||||||
|
Boolean queryForParameters;
|
||||||
|
|
||||||
|
// ...
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif // NV_PHOTOSHOP_EXPORTER_H
|
234
project/vc8/PhotoshopExporter/PhotoshopExporter.vcproj
Normal file
234
project/vc8/PhotoshopExporter/PhotoshopExporter.vcproj
Normal file
@ -0,0 +1,234 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="8.00"
|
||||||
|
Name="PhotoshopExporter"
|
||||||
|
ProjectGUID="{6CD8908D-06E4-4FD7-907A-0A1BDA67198F}"
|
||||||
|
RootNamespace="PhotoshopExporter"
|
||||||
|
Keyword="Win32Proj"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="2"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;PHOTOSHOPEXPORTER_EXPORTS"
|
||||||
|
MinimalRebuild="true"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
LinkIncremental="2"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Release|Win32"
|
||||||
|
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||||
|
IntermediateDirectory="$(ConfigurationName)"
|
||||||
|
ConfigurationType="2"
|
||||||
|
CharacterSet="2"
|
||||||
|
WholeProgramOptimization="1"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
AdditionalIncludeDirectories="..;..\..\..\src;..\..\..\extern\photoshopapi\photoshop;..\..\..\extern\photoshopapi\pica_sp;..\..\..\extern\photoshopapi\common\includes;..\..\..\extern\photoshopapi\general"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;PHOTOSHOPEXPORTER_EXPORTS"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="true"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
LinkIncremental="1"
|
||||||
|
GenerateDebugInformation="true"
|
||||||
|
SubSystem="2"
|
||||||
|
OptimizeReferences="2"
|
||||||
|
EnableCOMDATFolding="2"
|
||||||
|
TargetMachine="1"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManifestTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAppVerifierTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<Filter
|
||||||
|
Name="Source Files"
|
||||||
|
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||||
|
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\PhotoshopExporter.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Header Files"
|
||||||
|
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||||
|
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath=".\PhotoshopExporter.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Resource Files"
|
||||||
|
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||||
|
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||||
|
>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Common Sources"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\extern\photoshopapi\common\sources\DialogUtilitiesWin.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\extern\photoshopapi\common\sources\FileUtilities.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\extern\photoshopapi\common\sources\FileUtilitiesWin.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\extern\photoshopapi\common\sources\PIDLLInstance.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\extern\photoshopapi\common\sources\PIUSuites.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\extern\photoshopapi\common\sources\PIUtilities.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\extern\photoshopapi\common\sources\PIUtilitiesWin.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
Reference in New Issue
Block a user