/trunk/telegraphics_common/adobeplugin/A4Stuff.h |
---|
/trunk/telegraphics_common/adobeplugin/PiPL-illustrator-68k.r |
---|
0,0 → 1,37 |
/* |
This file is part of a common library for Adobe(R) plugins |
Copyright (C) 2002-9 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 |
*/ |
#include "types.r" |
#include "systypes.r" |
#include "PiPL.r" |
resource 'PiPL' (16000, purgeable) { |
0, |
{ |
PIAdobeVendorID, |
PIKindProperty { 'SPEA' }, |
PIAdobeVendorID, |
PISPVersionProperty { 2 }, |
PIAdobeVendorID, |
PI68KCodeProperty { 'ARPI', 16000 } |
} |
}; |
/trunk/telegraphics_common/adobeplugin/PiPL-illustrator-fat.r |
---|
0,0 → 1,44 |
/* |
This file is part of a common library for Adobe(R) plugins |
Copyright (C) 2002-9 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 |
*/ |
#include "types.r" |
#include "systypes.r" |
#include "PiPL.r" |
#ifdef BUILD_68K |
include "68k.rsrc"; |
#endif |
resource 'PiPL' (16000, purgeable) { |
0, |
{ |
PIAdobeVendorID, |
PIKindProperty { 'SPEA' }, |
PIAdobeVendorID, |
PISPVersionProperty { 2 }, |
#ifdef BUILD_68K |
PIAdobeVendorID, |
PI68KCodeProperty { 'ARPI', 16000 }, |
#endif |
PIAdobeVendorID, |
PIPowerPCCodeProperty { 0, 0, "" } |
} |
}; |
/trunk/telegraphics_common/adobeplugin/PiPL.r |
---|
0,0 → 1,123 |
/* |
This file is part of a common library for Adobe(R) plugins |
Copyright (C) 2002-9 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 |
*/ |
#if 0 |
//// from SPPiPL.h |
#define PIAdobeVendorID 'ADBE' |
#define PIKindProperty 'kind' /* 4-byte value, eg. PIAdobeVendorID */ |
#define PISPVersionProperty 'ivrs' /* long */ |
#define PIExportsProperty 'expt' |
#define PI68KCodeProperty 'm68k' |
#define PIPowerPCCodeProperty 'pwpc' |
#define PIPowerPCCodeResProperty 'ppcR' |
#define PIWin32X86CodeProperty 'wx86' |
#define PIWin16X86CodeProperty 'fx86' |
#define PIDestinationHeapProperty 'heap' /* Mac PPC only. If non-existent, loads in */ |
#define PILoadInAppHeap (1L<<0) /* host default heap. If 0, loads in sys heap. */ |
#define PIPluginNameProperty 'pinm' |
#define PIConditionalMessages 'AcpM' /* and other flags */ |
#define PIAcceptsPropertyMessage (1L<<0) |
#define PISkipShutDownMessage (1L<<1) |
#define PIAcceptsPurgeCachesMessage (1L<<2) |
#define kCurrentPiPLVersion 0 |
//// |
#endif |
#define NULL_ID 0 |
type 'PiPL' { |
longint; // version |
longint = $$countof(PIPropertyList); |
array PIPropertyList{ |
literal longint PIAdobeVendorID = 'ADBE'; // vendorID |
switch{ // propertyKey |
case PIKindProperty: |
key literal longint = 'kind'; |
longint = NULL_ID; // propertyID |
longint = 4; // propertyLength |
literal longint; |
case PISPVersionProperty: |
key literal longint = 'ivrs'; |
longint = NULL_ID; // propertyID |
longint = 4; // propertyLength |
longint; |
case PI68KCodeProperty: |
key literal longint = 'm68k'; |
longint = NULL_ID; // propertyID |
longint = 6; // propertyLength |
literal longint; |
integer; |
align long; |
case PIPowerPCCodeProperty: |
key literal longint = 'pwpc'; |
longint = NULL_ID; // propertyID |
longint = (pwpcend[$$ArrayIndex(PIPropertyList)] - pwpcstart[$$ArrayIndex(PIPropertyList)]) / 8; |
pwpcstart: |
longint; |
longint; |
pstring; |
pwpcend: |
align long; |
// see SDK/IllustratorAPI/PICA_SP/SPPiPL.h |
// for the rest of this definition |
// since CS3 at least, a complete PiPL.r is at: |
// SDK/samplecode/pipl/PiPL.r |
/* |
case AIImportList: |
key literal longint = 'impt'; |
longint; |
longint = $$countof(propertyData); |
array propertyData{ |
longint = $$countof(fImpExp); |
array fImpExp{ |
longint; |
cstring; |
align long; |
longint; |
}; |
}; |
case AIExportList: |
key literal longint = 'expt'; |
longint; |
longint = $$countof(propertyData); |
array propertyData{ |
longint = $$countof(fImpExp); |
array fImpExp{ |
longint; |
cstring; |
align long; |
longint; |
}; |
}; |
*/ |
}; |
}; |
}; |
/trunk/telegraphics_common/adobeplugin/SAGlobals.c |
---|
0,0 → 1,52 |
/*------------------------------------------------------------------------------ |
# |
# Macintosh Developer Technical Support |
# |
# Sample Control Panel Device and INIT Combination |
# |
# Program: INIT - CDEV |
# File: SAGlobals.c - C Source |
# |
# Copyright © 1990 Apple Computer, Inc. |
# All rights reserved. |
# |
------------------------------------------------------------------------------*/ |
#include <Memory.h> |
#include <OSUtils.h> |
#include "SAGlobals.h" |
#define kAppParmsSize 32 |
/* |
!!! NOTE !!! |
These routines are used to implement global variables in standalone code, |
as per Technote #256. However, they have been modified here to allocate |
the buffer space from a non-relocatable pointer rather than a relocatable |
handle. ... since the best place for a |
block of memory that isn't going to be moving is low in the heap, we |
allocate the block with NewPtr. |
*/ |
long A5Size (void); |
/* prototype for routine in MacRuntime.o */ |
void A5Init (Ptr myA5); |
/* prototype for routine in MacRuntime.o */ |
pascal void MakeA5World (A5RefType *A5Ref) { |
DebugStr("\pMakeA5World"); |
*A5Ref = NewPtr(A5Size()); |
if ((long)*A5Ref) { |
A5Init((Ptr)( (long)*A5Ref + A5Size() - kAppParmsSize)); |
} |
} |
pascal long SetA5World (A5RefType A5Ref) { |
return SetA5( (long)A5Ref + A5Size() - kAppParmsSize); |
} |
pascal void DisposeA5World (A5RefType A5Ref) { |
DisposePtr((Ptr)A5Ref); |
} |
/trunk/telegraphics_common/adobeplugin/SAGlobals.h |
---|
0,0 → 1,38 |
/*------------------------------------------------------------------------------ |
# |
# Macintosh Developer Technical Support |
# |
# Sample Control Panel Device and INIT Combination |
# |
# Program: INIT - CDEV |
# File: SAGlobals.h - C Header for SAGlobals.c |
# |
# Copyright © 1990 Apple Computer, Inc. |
# All rights reserved. |
# |
------------------------------------------------------------------------------*/ |
/* Stand-alone code modules which need to use global variables |
may include the interfaces in this unit. Such code modules |
must also be linked with Runtime.o and SAGlobals.o. */ |
#include <Types.h> |
typedef Ptr A5RefType; /* !!! changed from Handle to Ptr for this sample */ |
/* MakeA5World allocates space for an A5 world based on the |
size of the global variables defined by the module and its |
units. If sufficient space is not available, MakeA5World |
returns NIL for A5Ref and further initialization is aborted. */ |
pascal void MakeA5World (A5RefType *A5Ref); |
/* SetA5World locks down a previously-allocated handle containing |
an A5 world and sets the A5 register appropriately. The return |
value is the old value of A5 and the client should save it for |
use by RestoreA5World. */ |
pascal long SetA5World (A5RefType A5Ref); |
/* DisposeA5World simply disposes of the A5 world handle. */ |
pascal void DisposeA5World (A5RefType A5Ref); |
/trunk/telegraphics_common/adobeplugin/ai6main.c |
---|
0,0 → 1,58 |
/* |
This file is part of a common library for Adobe(R) Illustrator(R) plugins |
Copyright (C) 2002-6 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 |
*/ |
#include "common.h" |
#include "aipluginmain.h" |
DLLEXPORT FXErr ai6main( char *selector, void *stuff ){ |
FXErr e = kSPNoError; |
PUSH_GLOBALS |
if(!strcmp(selector,kSelectorAI60StartupPlugin)) |
plugin_startup( (SPInterfaceMessage*)message ); |
else if(!strcmp(selector,kSelectorAI60ShutdownPlugin)) |
plugin_shutdown( (SPInterfaceMessage*)message ); |
else if(!strcmp(selector,kSelectorAI60AboutPlugin)) |
plugin_about( (SPInterfaceMessage*)message ); |
#ifdef ISFILTER |
else if(!strcmp(selector,)) |
filter_go( (AIFilterMessage*)message ); |
#endif |
POP_GLOBALS |
return e; |
} |
#ifdef kAIRealMathSuite |
SPErr acq_suite( SPMessageData *m,const char *name, long version, const void **suite ) // from AI10 SDK |
#else |
SPErr acq_suite( SPMessageData *m,char *name, long version, void **suite ) // from AI7 SDK |
#endif |
{ |
SPErr e = m->basic->AcquireSuite(name,version,suite); |
if(e){ |
char s[0x100]; |
SPRINTF(s,"AcquireSuite \"%s\" (%ld) failed: %c%c%c%c",name,version,e>>24,e>>16,e>>8,e); |
dbg(s); |
} |
return e; |
} |
/trunk/telegraphics_common/adobeplugin/aics3/PiPL.r |
---|
0,0 → 1,266 |
//======================================================================================== |
// |
// $File: //ai/ai13/devtech/sdk/public/samplecode/pipl/PiPL.r $ |
// |
// $Revision: #3 $ |
// |
// Copyright 1987-2007 Adobe Systems Incorporated. All rights reserved. |
// |
// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance |
// with the terms of the Adobe license agreement accompanying it. If you have received |
// this file from a source other than Adobe, then your use, modification, or |
// distribution of it requires the prior written permission of Adobe. |
// |
//======================================================================================== |
#ifndef __PIPL_r__ // Only include this once. |
#define __PIPL_r__ |
//------------------------------------------------------------------------------- |
// Definitions -- Version and include information |
//------------------------------------------------------------------------------- |
// Version of Plug In Properties Template described in this file: |
#ifndef kPIPropertiesVersion |
#define kPIPropertiesVersion 0 |
#endif |
//------------------------------------------------------------------------------- |
// PiPL resource template |
//------------------------------------------------------------------------------- |
type 'PiPL' |
{ |
longint = kPIPropertiesVersion; |
longint = $$CountOf(properties); |
array properties |
{ |
switch |
{ |
//------------------------------------------------------------------- |
// Illustrator/SweetPea PiPL properties |
//------------------------------------------------------------------- |
case ADBEKind: |
longint = 'ADBE'; // SweetPea/Illustrator host. |
key longint = 'kind'; |
longint = 0; // Index. |
longint = 4; // Length. |
literal longint PIPiPLTypes; // Version. |
case InterfaceVersion: |
longint = 'ADBE'; // SweetPea/Illustrator host. |
key longint = 'ivrs'; |
longint = 0; // Index. |
longint = 4; // Length. |
longint; // Version. |
case ADBECodeCarbon: |
longint = 'ADBE'; |
key longint = 'ppcb'; |
longint = 0; |
#if DeRez |
fill long; |
#else |
longint = (ADBEppcbEnd[$$ArrayIndex(properties)] - ADBEppcbStart[$$ArrayIndex(properties)]) / 8; |
#endif |
ADBEppcbStart: |
longint; |
longint; |
pstring; |
ADBEppcbEnd: |
align long; |
case ADBECodeMachO: |
longint = 'ADBE'; |
key longint = 'mach'; |
longint = 0; |
#if DeRez |
fill long; |
#else |
longint = (ADBEmachEnd[$$ArrayIndex(properties)] - ADBEmachStart[$$ArrayIndex(properties)]) / 8; |
#endif |
ADBEmachStart: |
pstring; |
ADBEmachEnd: |
align long; |
case ADBECodeMacIntel32: |
longint = 'ADBE'; |
key longint = 'mi32'; |
longint = 0; |
#if DeRez |
fill long; |
#else |
longint = (ADBEmi32End[$$ArrayIndex(properties)] - ADBEmi32Start[$$ArrayIndex(properties)]) / 8; |
#endif |
ADBEmi32Start: |
pstring; |
ADBEmi32End: |
align long; |
case SP_STSP: |
longint = 'ADBE'; // SweetPea/Illustrator host. |
key longint = 'StsP'; |
longint = 0; // Index. |
longint = 4; // Length. |
longint; |
case InternalName: |
longint = 'ADBE'; // SweetPea/Illustrator host. |
key longint = 'pinm'; |
longint = 0; // Index. |
#if DeRez |
fill long; |
#else |
longint = (plugInNameEnd[$$ArrayIndex(properties)] - |
plugInNameStart[$$ArrayIndex(properties)]) / 8; |
#endif |
plugInNameStart: |
cstring; |
plugInNameEnd: |
align long; |
case BuildVersion: |
longint = 'ADBE'; // SweetPea/Illustrator host. |
key longint = 'bvrs'; |
longint = 0; // Index. |
longint = 4; // Length. |
longint; // Version. |
case ADBEVersion: |
longint = 'ADBE'; |
key longint = 'vers'; |
longint = 0; |
longint = 4; |
longint; |
case ADBECategory: |
longint = 'ADBE'; |
key longint = 'catg'; |
longint = 0; |
#if DeRez |
fill long; |
#else |
longint = (ADBEcatgEnd[$$ArrayIndex(properties)] - ADBEcatgStart[$$ArrayIndex(properties)]) / 8; |
#endif |
ADBEcatgStart: |
pstring |
// Use Help category to put automation plug-ins in the "Help" menu: |
PSHelpMenu = "**Help**", |
// Use Hidden category to keep plug-ins out of menus. |
// WARNING: The only way to access a hidden plug-in is |
// by calling it by its event ID from the Play callback! |
PSHidden = "**Hidden**", |
// Use Copyright-Checker category to detect copyrights on first-opened files: |
PSCopyrightChecker = "**Copyright-Checker**"; |
ADBEcatgEnd: |
align long; |
case ADBEName: |
longint = 'ADBE'; |
key longint = 'name'; |
longint = 0; |
#if DeRez |
fill long; |
#else |
longint = (ADBEnameEnd[$$ArrayIndex(properties)] - ADBEnameStart[$$ArrayIndex(properties)]) / 8; |
#endif |
ADBEnameStart: |
pstring; |
ADBEnameEnd: |
align long; |
case AdapterVersion: |
longint = 'ADBE'; // SweetPea/Illustrator host. |
key longint = 'adpt'; |
longint = 0; // Index. |
longint = 4; // Length. |
longint; // Version. |
case Imports: |
longint = 'ADBE'; // SweetPea/Illustrator host. |
key longint = 'impt'; |
longint = 0; // Index. |
#if DeRez |
fill long; |
#else |
longint = (importsEnd[$$ArrayIndex(properties)] - |
importsStart[$$ArrayIndex(properties)]) / 8; |
#endif |
importsStart: |
longint = $$CountOf(ImportSuites); |
wide array ImportSuites |
{ |
isuitesStart: |
// Length (including this long): |
#if DeRez |
fill long; |
#else |
longint = ((isuitesEnd[$$ArrayIndex(properties), $$ArrayIndex(ImportSuites)] - |
isuitesStart[$$ArrayIndex(properties), $$ArrayIndex(ImportSuites)]) / 8); |
#endif |
cstring; |
align long; |
longint; // Suite version. |
isuitesEnd: |
}; |
importsEnd: |
case Exports: |
longint = 'ADBE'; // SweetPea/Illustrator host. |
key longint = 'expt'; |
longint = 0; // Index. |
#if DeRez |
fill long; |
#else |
longint = (exportsEnd[$$ArrayIndex(properties)] - |
exportsStart[$$ArrayIndex(properties)]) / 8; |
#endif |
exportsStart: |
longint = $$CountOf(ExportSuites); |
wide array ExportSuites |
{ |
esuitesStart: |
// Length (including this long): |
#if DeRez |
fill long; |
#else |
longint = ((esuitesEnd[$$ArrayIndex(properties), $$ArrayIndex(ExportSuites)] - |
esuitesStart[$$ArrayIndex(properties), $$ArrayIndex(ExportSuites)]) / 8); |
#endif |
cstring; |
align long; |
longint; // Suite version. |
esuitesEnd: |
}; |
exportsEnd: |
case Messages: |
longint = 'ADBE'; // SweetPea/Illustrator host |
key longint = 'AcpM'; |
longint = 0; // Index. |
longint = 4; // Length. |
fill bit[28]; // Reserved. |
boolean startupRequired, noStartupRequired; |
boolean doesNotPurgeCache, purgeCache; |
boolean shutdownRequired, noShutdownRequired; // Default is to give shutdown msg. |
boolean doNotAcceptProperty, acceptProperty; |
}; |
}; |
}; |
#undef PIPiPLTypes |
//------------------------------------------------------------------------------- |
#endif // PIPL.r |
/trunk/telegraphics_common/adobeplugin/aipluginmain.c |
---|
0,0 → 1,103 |
/* |
This file is part of a common library for Adobe(R) Illustrator(R) plugins |
Copyright (C) 2002-6 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 |
*/ |
#include <stdio.h> |
#include "aipluginmain.h" |
DLLEXPORT SPAPI |
PLUGINRETURN ENTRYPOINT( char *caller, char *selector, SPMessageData *message ){ |
SPBasicSuite *b = message->basic; |
SPErr e = kSPNoError; |
EnterCodeResource(); |
// char s[0x100]; sprintf(s,"PluginMain(\"%s\",\"%s\")",caller,selector); dbg(s); |
if( message->SPCheck == kSPValidSPMessageData ){ |
if(b->IsEqual(caller, kSPInterfaceCaller)){ |
if(b->IsEqual(selector, kSPInterfaceStartupSelector)) |
e = plugin_startup( (SPInterfaceMessage*)message ); |
else if(b->IsEqual(selector, kSPInterfaceShutdownSelector)){ |
e = plugin_shutdown( (SPInterfaceMessage*)message ); |
}else if(b->IsEqual(selector, kSPInterfaceAboutSelector)) |
e = plugin_about( (SPInterfaceMessage*)message ); |
} |
#ifdef ISFILTER |
else if(b->IsEqual(caller, kCallerAIFilter)){ |
if(b->IsEqual(selector, kSelectorAIGoFilter)) |
e = filter_go( (AIFilterMessage*)message ); |
} |
#endif |
#ifdef ISTOOL |
else if(b->IsEqual( caller, kCallerAITool)){ |
if(b->IsEqual(selector, kSelectorAIEditToolOptions)) |
e = toolOptions( (AIToolMessage*)message ); |
else if(b->IsEqual(selector, kSelectorAITrackToolCursor)) |
e = toolTrackCursor( (AIToolMessage*)message ); |
else if(b->IsEqual(selector, kSelectorAIToolMouseDown)) |
e = toolMouseDown( (AIToolMessage*)message ); |
else if(b->IsEqual(selector, kSelectorAIToolMouseDrag)) |
e = toolMouseDrag( (AIToolMessage*)message ); |
else if(b->IsEqual(selector, kSelectorAIToolMouseUp)) |
e = toolMouseUp( (AIToolMessage*)message ); |
else if(b->IsEqual(selector, kSelectorAISelectTool)) |
e = toolSelect( (AIToolMessage*)message ); |
else if(b->IsEqual(selector, kSelectorAIDeselectTool)) |
e = toolDeselect( (AIToolMessage*)message ); |
} |
#endif |
}else{ |
char s[0x100]; |
sprintf(s,"invalid SPCheck (caller=\"%s\",selector=\"%s\")",caller,selector); |
dbg(s); |
} |
ExitCodeResource(); |
return e; |
} |
SPErr acq_suite(SPMessageData *m, char *name, long version, ppsuite suite) |
{ |
unsigned long e = m->basic->AcquireSuite(name, version, suite); |
if(e){ |
char s[0x200], ai_vers[16]; |
// version is BCD encoded, e.g. 0xNN000000 |
int v = 10*(kPluginInterfaceVersion >> 28) + ((kPluginInterfaceVersion >> 24) & 0xf); |
if(v > 10) |
sprintf(ai_vers, "CS%c", v > 11 ? v+'1'-11 : ' '); |
else |
sprintf(ai_vers, "%d", v); |
sprintf(s, "Could not load the plugin.\n\n" |
"This plugin was built for Illustrator %s.\n\n" |
"Please obtain the correct version for your installation " |
"from http://www.telegraphics.com.au/sw/\n" |
"or contact support@telegraphics.com.au if you cannot resolve the problem.\n\n" |
"Details: AcquireSuite failed \"%s\" (%ld): %c%c%c%c", |
ai_vers, name, version, (int)(e>>24), (int)(e>>16), (int)(e>>8), (int)e); |
dbg(s); |
} |
return e; |
} |
/trunk/telegraphics_common/adobeplugin/aipluginmain.h |
---|
0,0 → 1,67 |
/* |
This file is part of a common library for Adobe(R) Illustrator(R) plugins |
Copyright (C) 2002-6 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 |
*/ |
#include "entry.h" |
#if defined(MAC68K_ENV) && defined(__MWERKS__) |
#include <a4stuff.h> // Metrowerks support for A4-based globals |
#else |
#define EnterCodeResource() |
#define ExitCodeResource() |
#endif |
#include "ASConfig.h" |
#include "AITypes.h" |
#include "AIFilter.h" |
#include "AITool.h" |
#include "AIDocument.h" // need kAIRealMathSuite if it exists, to differentiate pre-8.0 API |
#include "SPMData.h" |
#include "dbg.h" |
AIErr plugin_startup( SPInterfaceMessage *im ); |
/*AIErr unload( SPInterfaceMessage *im ); |
AIErr reload( SPInterfaceMessage *im );*/ |
AIErr plugin_shutdown( SPInterfaceMessage *im ); |
AIErr plugin_about( SPInterfaceMessage *im ); |
AIErr filter_go( AIFilterMessage *fm ); |
AIErr toolOptions( AIToolMessage *message ); |
AIErr toolTrackCursor( AIToolMessage *message ); |
AIErr toolMouseDown( AIToolMessage *message ); |
AIErr toolMouseDrag( AIToolMessage *message ); |
AIErr toolMouseUp( AIToolMessage *message ); |
AIErr toolSelect( AIToolMessage *message ); |
AIErr toolDeselect( AIToolMessage *message ); |
AIErr toolValidate( AIToolMessage *message ); |
DLLEXPORT SPAPI |
PLUGINRETURN ENTRYPOINT( char *caller, char *selector, SPMessageData *message ); |
//FXErr ai6main( char *selector, void *stuff ); |
// the prototype for AcquireSuite() changed at AI8 |
// allow for both flavours. |
#ifdef kPluginInterfaceVersion8001 |
typedef const void **ppsuite; |
#else |
typedef void **ppsuite; |
#endif |
SPErr acq_suite(SPMessageData *m, char *name, long version, ppsuite suite); |
/trunk/telegraphics_common/adobeplugin/dllmain.c |
---|
0,0 → 1,32 |
/* |
This file is part of a common library |
Copyright (C) 2002-6 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 |
*/ |
#include <windows.h> |
HANDLE hDllInstance = NULL; /* DLL instance handle */ |
BOOL APIENTRY DllMain(HANDLE hInstance, DWORD fdwReason, LPVOID lpReserved); |
BOOL APIENTRY DllMain(HANDLE hInstance, DWORD fdwReason, LPVOID lpReserved){ |
if (fdwReason == DLL_PROCESS_ATTACH) |
hDllInstance = hInstance; |
return TRUE; // Indicate that the DLL was initialized successfully. |
} |
/trunk/telegraphics_common/adobeplugin/dprintf.c |
---|
0,0 → 1,17 |
#include <stdarg.h> |
#include <stdio.h> |
#include "dbg.h" |
int dprintf(const char *fmt, ...){ |
char s[0x200]; |
int n; |
va_list v; |
va_start(v,fmt); |
n = vsprintf(s,fmt,v); |
va_end(v); |
dbg(s); |
return n; |
} |
/trunk/telegraphics_common/adobeplugin/entry.h |
---|
0,0 → 1,48 |
/* |
This file is part of a common library for Adobe(R) plugins |
Copyright (C) 2002-6 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 |
*/ |
// AI CS2 SDK must be compiled with C++ |
// but we still require C linkage on entry point. |
#ifdef MAC_ENV |
#ifdef __cplusplus |
#define DLLEXPORT extern "C" |
#else |
#define DLLEXPORT |
#endif |
#define MACPASCAL pascal |
#define ENTRYPOINT main |
#else |
#ifdef __cplusplus |
#define DLLEXPORT extern "C" __declspec(dllexport) |
#else |
#define DLLEXPORT __declspec(dllexport) |
#endif |
#define MACPASCAL |
#define ENTRYPOINT PluginMain |
#endif |
// C++ is strict about main() returning int |
#ifdef __cplusplus |
//typedef int PluginReturn_t; |
#define PLUGINRETURN int |
#else |
//typedef SPErr PluginReturn_t; |
#define PLUGINRETURN SPErr |
#endif |
/trunk/telegraphics_common/adobeplugin/setcursor_mac.c |
---|
0,0 → 1,17 |
#include "ASConfig.h" |
#include <quickdraw.h> |
#include "astypes.h" |
#include "spplugs.h" |
#include "common.h" |
void SetPlatformCursor(SPPluginRef pluginRef, int nCursorID) |
{ |
ASErr e = kNoErr; |
CursHandle cursor; |
if ( cursor = GetCursor( nCursorID ) ) |
SetCursor( *cursor ); |
} |
/trunk/telegraphics_common/adobeplugin/setcursor_win.c |
---|
0,0 → 1,21 |
#include "common.h" |
#include <windows.h> |
void SetPlatformCursor(SPPluginRef pluginRef, int nCursorID) |
{ |
ASErr e = kNoErr; |
HCURSOR cursor; |
SPAccessRef access; |
SPPlatformAccessInfo spAccessInfo; |
e = sSPAccess->GetPluginAccess(pluginRef, &access); |
if( kNoErr == e) |
e = sSPAccess->GetAccessInfo(access, &spAccessInfo); |
if( kNoErr == e) |
{ |
cursor = LoadCursor((HINSTANCE)spAccessInfo.defaultAccess, MAKEINTRESOURCE(nCursorID)); |
if ( cursor ) |
SetCursor(cursor); |
} |
} |
/trunk/telegraphics_common/adobeplugin/stubs-mpwstdio.c |
---|
0,0 → 1,15 |
/* this hack (to fool MPW linker) is due to |
http://www.mactech.com/articles/develop/issue_15/117-131_Q_As.html */ |
#include <stdio.h> |
#include <mactypes.h> |
// These calls won't actually be called by sprintf. |
size_t fwrite (const void *a, size_t b, size_t c, FILE *d) { |
DebugStr("\pstubs-mpwstdio.c: fwrite called (THIS SHOULD NOT HAPPEN)"); |
return 0; |
} |
int _flsbuf(unsigned char a, FILE *b) { |
DebugStr("\pstubs-mpwstdio.c: _flsbuf called (THIS SHOULD NOT HAPPEN)"); |
return 0; |
} |
/trunk/telegraphics_common/adobeplugin/world.h |
---|
0,0 → 1,114 |
/* |
This file is part of a common library for Adobe(R) plugins |
Copyright (C) 2002-6 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 |
*/ |
/* Build environment for cross-platform plugin */ |
#ifndef WORLD_H_ |
#define WORLD_H_ |
#include <string.h> |
#include <stdlib.h> |
//#include <stddef.h> |
#include <stdio.h> |
#if defined(__GNUC__) |
// probably OS X or MinGW gcc |
#include <stdint.h> // for intptr_t req'd by CS4 SDK |
#elif defined(powerc) || defined(__SC__) |
// Mac PPC and 68K have 32 bit pointers |
typedef long intptr_t; |
#endif |
#include "dbg.h" |
#include "str.h" |
#ifdef macintosh |
#include "carbonstuff.h" |
#include <quickdraw.h> |
#include <events.h> |
#define TICKCOUNT TickCount |
#define TICKS_SEC 60 |
#if defined(powerc) || defined(__GNUC__) |
#define EnterCodeResource() |
#define ExitCodeResource() |
#define ENTERCALLBACK() |
#define EXITCALLBACK() |
#else |
#ifdef __SC__ |
// Symantec C (MPW compiler) - does not support A4 globals |
#define EnterCodeResource() |
#define ExitCodeResource() |
#define ENTERCALLBACK() |
#define EXITCALLBACK() |
// avoid some standard library routines (can't have global data) |
#include "sprintf_tiny.h" |
#define sprintf sprintf_tiny |
#define memset my_memset |
#include <macmemory.h> |
#define malloc (void*)NewPtr |
#define free(p) DisposePtr((void*)(p)) |
#else |
// CodeWarrior supports A4-based globals |
#include <a4stuff.h> |
#define ENTERCALLBACK() long old_a4 = SetCurrentA4() |
#define EXITCALLBACK() SetA4(old_a4) |
#endif |
#endif |
#define DIRSEP ':' |
typedef Handle HMODULE; |
#else |
// Win32 target |
#include <windows.h> |
#include "compat_win.h" |
#define TICKCOUNT GetTickCount |
#define TICKS_SEC 1000 |
#define EnterCodeResource() |
#define ExitCodeResource() |
#define DIRSEP '\\' |
extern HANDLE hDllInstance; |
#endif |
#define SETRECT(rect,l,t,r,b) \ |
((rect).left=(l),(rect).top=(t),(rect).right=(r),(rect).bottom=(b)) |
#define OFFSETRECT(rect,h,v) \ |
( (rect).left+=(h),(rect).right+=(h),(rect).top+=(v),(rect).bottom+=(v) ) |
#ifdef __GNUC__ |
#define ATTRIBUTE_PACKED __attribute__ (( packed )) |
#else |
#define ATTRIBUTE_PACKED |
#endif |
#endif |