Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
|
Allows access to a wide variety of Illustrator app-related runtime attributes, documents, fonts, etc. More...
#include <hdicoreIllustrator.h>
Public Types | |
enum | ThemeWindowType { PanelOrControlBarType = 10 , ModalOrFloatingDialogType = 20 } |
Used when querying for current UI colors. | |
enum | BuiltinToolbox { UnknownBuiltinToolbox = 0 , BasicBuiltinToolbox = 1 << 0 , AdvancedBuiltinToolbox = 1 << 1 } |
Used to describe a given builtin Illustrator toolbox. | |
enum | FolderType { UnknownFolderType = 0 , ApplicationFolderType = 10 , PluginsFolderType = 20 , PrimaryScratchFolderType = 30 , SecondaryScratchFolderType = 40 , PreferencesFolderType = 50 , UserSupportFolderType = 60 , UserSupportAIFolderType = 70 , UserSupportAIPluginsFolderType = 80 , ApplicationSupportCommonFolderType = 90 , ApplicationSupportCommonColorFolderType = 100 , ApplicationSupportCommonTypeSupportFolderType = 110 , ApplicationSupportCommonFontsFolderType = 120 , ApplicationSupportCommonFontsRequiredFolderType = 130 , ApplicationSupportCommonFontsRequiredCMapsFolderType = 140 , RequiredFontsFolderType = 150 , FontsFolderType = 160 , MyDocumentsFolderType = 170 , ApplicationSupportCommonWorkflowFolderType = 180 , PrinterDescriptionsFolderType = 190 , RequiredPluginsFolderType = 200 , SettingsFolderType = 210 , ColorTableSettingsFolderType = 220 , OptimizeSettingsFolderType = 230 , HelpFolderType = 240 , RootFolderType = 250 , PresetsFolderType = 260 , PresetActionsFolderType = 270 , PresetBrushesFolderType = 280 , PresetGradientsFolderType = 290 , PresetKeyboardShortcutsFolderType = 300 , PresetPatternsFolderType = 310 , PresetScriptsFolderType = 320 , PresetStylesFolderType = 330 , PresetSwatchesFolderType = 340 , DictionariesFolderType = 350 , LegalFolderType = 360 , SampleFilesFolderType = 370 , UtilitiesFolderType = 380 , PackageFolderType = 390 , ApplicationSupportCommonFontsRequiredBaseFolderType = 400 , HelpersFolderType = 410 , PreviewInFolderType = 420 , RidersFileFolderType = 430 , HyphenationDictFolderType = 440 , ApplicationSupportCommonPDFLFolderType = 450 , ApplicationSupportCommonPDFL5FolderType = 460 , ApplicationSupportCommonPDFL5CMapsFolderType = 470 , ApplicationSupportCommonPDFL5FontsFolderType = 480 , ApplicationSupportCommonPrintSupportFolderType = 490 , ApplicationSupportCommonColorProfilesFolderType = 500 , ApplicationSupportCommonColorSettingsFolderType = 510 , ContentsFolderType = 520 , HelpImagesFolderType = 530 , FontsCMapsFolderType = 540 , PresetSymbolsFolderType = 550 , TsumeFolderType = 560 , SpellingDictFolderType = 570 , PresetTemplatesFolderType = 580 , FontsCFFolderType = 590 , ApplicationSupportCommonKinsokuSetFolderType = 600 , ApplicationSupportCommonMojikumeSetFolderType = 610 , PresetBlankDocumentsFolderType = 620 , UserSupportCommonFontsFolderType = 630 , FontsCFTempFolderType = 640 , LogsFolderType = 650 , SampleArtFolderType = 660 , SampleSVGFolderType = 670 , SampleGraphDesignsFolderType = 680 , SampleDataDrivenGraphicsFolderType = 690 , WorkspacesFolderType = 700 , PresetColorBooksFolderType = 710 , PresetLegacyColorBooksFolderType = 720 , PresetSwatchExchangeFolderType = 730 , ApplicationSupportCommonLinguisticsFolderType = 740 , ApplicationSupportCommonLinguisticsProvidersFolderType = 750 , DemonstratorFolderType = 760 , ResourcesFolderType = 770 , CoolExtrasFolderType = 780 , OutputSettingsFolderType = 790 , StartupScriptsFolderType = 800 , DesktopFolderType = 810 , IllustratorFormatsFolderType = 820 , AdditionalAIPluginsFolderType = 830 , UserWritableStartupFileFolderType = 840 , UserWritablePresetBrushesFolderType = 850 , UserWritablePresetStylesFolderType = 860 , UserWritablePresetSwatchesFolderType = 870 , UserWritablePresetSwatchExchangeFolderType = 880 , UserWritablePresetSymbolsFolderType = 890 , PresetFlashPanelsFolderType = 900 , UserWritablePresetSettingsFolderType = 910 , UserWritablePresetOptimizeSettingsFolderType = 920 , UserWritablePresetOutputSettingsFolderType = 930 , UserWritablePresetColorTableSettingsFolderType = 940 , RequiredStartupProfilesFolderType = 950 , PresetWorkspacesFolderType = 960 , PresetWelcomeScreenFolderType = 970 , RequiredFolderType = 980 , RequiredResourcesFolderType = 990 , RequiredLocalizedResourcesFolderType = 1000 , WSMgrCfgFolderType = 1010 , ModifiedWorkspacesFolderType = 1020 , ToolsFolderType = 1030 , PreferencesRootFolderType = 1040 , RequiredLinguisticsFolderType = 1050 , TemporaryFolder = 1060 } |
Describes a particular folder in an Illustrator installation, whose path can be acquired via the Illustrator class. | |
typedef std::vector< std::shared_ptr< Font > > | FontVector |
typedef std::map< std::string, SuiteInfo > | SuiteInfoMap |
typedef std::map< std::string, ThirdPartyPlugin * > | ThirdPartyPluginMap |
Public Member Functions | |
~Illustrator () | |
Destructs an Illustrator object. | |
PlatformAppPtr | platformApp () const |
Gets a pointer to the platform object representing the current Illustrator instance. | |
void * | alloc (const int32_t size_) const |
Allocates a block of memory in Illustrator's memory heap (rather than the caller's memory heap); required for data that Illustrator will store for you, or data passed to another plugin. | |
void * | realloc (void *const block_, const int32_t newSize_) const |
Reallocates a block of memory in Illustrator's memory heap (that was previously allocated using the Illustrator::alloc() method), while attempting to resize the block rather than relocate it. | |
void | free (void *const block_) const |
Frees a block of memory previously allocated with the Illustrator::alloc() method. | |
std::string | userName () const |
Gets the name of the registered Illustrator user. | |
std::string | userOrganization () const |
Gets the organization/company name of the registered Illustrator user. | |
std::string | serialNumber () const |
Gets the serial number of the registered Illustrator user. | |
int32_t | majorVersion () const |
Gets the Illustrator major version number (e.g. "16" from "16.0.2") | |
int32_t | minorVersion () const |
Gets the Illustrator minor version number (e.g. "0" from "16.0.2") | |
int32_t | revisionVersion () const |
Gets the Illustrator revision/bugfix version number (e.g. "2" from "16.0.2") | |
int16_t | bitness () const |
Gets the bitness of Illustrator at runtime. | |
std::string | versionString (const bool useRevision_=false) const |
Gets the Illustrator version as a string (e.g. "16.0" for Illustrator 16) | |
std::string | versionDescription () const |
Gets the Illustrator version description, a.k.a. the marketed version name. | |
SuiteInfoMap | allSuites () const |
Gets a map of all available suites, keyed on their name. | |
ThirdPartyPluginMap | allPlugins () const |
Gets a map of all available plugins, keyed on their name. | |
std::unique_ptr< ThirdPartyPlugin > | pluginWithName (const std::string &name_) const |
Gets a specific plugin by its name (must be an exact match) | |
ai::Preferences *const | preferences () const |
Convenience method to return the ai::Preferences instance. | |
CurrentDocument *const | currentDocument () |
Acquires an instance of the CurrentDocument class for the current document. | |
uint32_t | documentCount () const |
Gets the open document count. | |
std::unique_ptr< Document > | documentAtIndex (const uint32_t index_) const |
Gets an open document by its index. | |
std::unique_ptr< Document > | openDocument (const std::string &path_, const DocumentColorModel colorModel_, const bool showDialog_, const bool forceCopy_=false) const |
Opens a document and returns it. | |
bool | openURL (const std::string &url_) const |
Causes the OS's default browser to open a given URL. | |
void | cacheFonts () |
Caches all the available fonts in an internal map until clearFontCache() is called. | |
void | clearFontCache () |
Clears fonts previously cached by the cacheFonts() method. | |
uint32_t | fontCount () const |
Gets the count of available fonts. | |
std::unique_ptr< Font > | fontAtIndex (const uint32_t index_) const |
Gets a Font object via its index. | |
std::unique_ptr< Font > | fontWithName (const std::string &faceName_) const |
Gets a Font object via its name (case-insensitive) | |
FontVector | allFonts () const |
Gets a vector containing Font objects for all available fonts. | |
uint32_t | typefaceCount () const |
Gets the count of available typefaces. | |
std::unique_ptr< Typeface > | typefaceAtIndex (const uint32_t index_) const |
Gets a Typeface object via its index. | |
Locale | locale () const |
Gets the current locale of Illustrator. | |
std::string | localeString () const |
Gets a string describing the current locale of Illustrator. | |
uint32_t | fileFormatCount () const |
Gets the count of available file formats. | |
std::unique_ptr< FileFormat > | fileFormatAtIndex (const uint32_t index_) const |
Gets a file format object via its index. | |
bool | registerFileFormat (FileFormat &ff_) |
Registers a new file format with Illustrator, which will be displayed in Illustrator's file dialog. | |
uint32_t | liveEffectCount () const |
Gets the count of available live effects. | |
std::unique_ptr< LiveEffect > | liveEffectAtIndex (const uint32_t index_) const |
Gets a live effect object via its index. | |
uint32_t | menuGroupCount () const |
Gets the count of menu groups in Illustrator (at all levels) | |
std::unique_ptr< MenuGroup > | menuGroupAtIndex (const uint32_t index_) const |
Gets a menu group object via its index. | |
void | suspendExistingContext () |
Suspends the existing Illustrator app context, storing it for later resuming. | |
void | resumeSuspendedContext () |
Resumes a previously suspended Illustrator app context. | |
void | pushContext () |
Pushes a new Illustrator app context onto the stack. | |
void | popContext () |
Pops a previously pushed Illustrator app context from the stack. | |
bool | hasContext () const |
Checks whether an Illustrator app context currently exists. | |
std::string | folderPath (const FolderType folder_) const |
Gets the folder path for a given illustrator folder. | |
bool | checkFolderForFile (const FolderType folder_, const std::string &fileName_) const |
Checks whether a given file exists within one of Illustrator's support folders. | |
bool | existsInPluginsFolder (const std::string &fileName_) const |
Verifies that a file is located in one of the Illustrator plugins folders. | |
bool | existsInToolsFolder (const std::string &fileName_) const |
Verifies that a file is located in the Illustrator tools folder. | |
bool | fileSavePrompt (const std::string &title_, const std::string &fileName_, std::string &path__) const |
Displays to the user a prompt to choose a location and file name for some data to be written to disk. | |
bool | fileOpenPrompt (const std::string &title_, std::string &path__) const |
Displays to the user a prompt to choose a file to be read from disk. | |
bool | folderPrompt (const std::string &title_, std::string &path__) const |
Displays to the user a prompt to choose a folder on disk. | |
BuiltinToolbox | visibleBuiltinToolboxes () const |
Gets which built-in toolbox(es) is/are currently showing. | |
bool | uiThemeDark () const |
Gets whether the current Illustrator UI theme color is considered dark. | |
Color | uiThemeColor (const ThemeWindowType dialog_, const ThemeComponentType component_) const |
Gets the current color for a given widget component. | |
bool | uiShouldScale () const |
Gets whether the Illustrator UI should be scaled at all (reads the Illustrator pref for this purpose, if necessary/available) | |
double | uiScalingFactor () const |
Gets the factor by which the Illustrator UI is scaled. | |
Static Public Member Functions | |
static Illustrator * | instance () |
Acquires an instance of the Illustrator class. | |
Allows access to a wide variety of Illustrator app-related runtime attributes, documents, fonts, etc.
hdi::core::Illustrator::~Illustrator | ( | ) |
Destructs an Illustrator object.
FontVector hdi::core::Illustrator::allFonts | ( | ) | const |
void * hdi::core::Illustrator::alloc | ( | const int32_t | size_ | ) | const |
Allocates a block of memory in Illustrator's memory heap (rather than the caller's memory heap); required for data that Illustrator will store for you, or data passed to another plugin.
size_ | Number of bytes to allocate |
ThirdPartyPluginMap hdi::core::Illustrator::allPlugins | ( | ) | const |
Gets a map of all available plugins, keyed on their name.
SuiteInfoMap hdi::core::Illustrator::allSuites | ( | ) | const |
Gets a map of all available suites, keyed on their name.
int16_t hdi::core::Illustrator::bitness | ( | ) | const |
Gets the bitness of Illustrator at runtime.
void hdi::core::Illustrator::cacheFonts | ( | ) |
Caches all the available fonts in an internal map until clearFontCache() is called.
bool hdi::core::Illustrator::checkFolderForFile | ( | const FolderType | folder_, |
const std::string & | fileName_ | ||
) | const |
Checks whether a given file exists within one of Illustrator's support folders.
folder_ | The illustrator folder type to look in |
fileName_ | Name of file whose existence (in folder_) is in question, as UTF-8 |
void hdi::core::Illustrator::clearFontCache | ( | ) |
Clears fonts previously cached by the cacheFonts() method.
CurrentDocument *const hdi::core::Illustrator::currentDocument | ( | ) |
Acquires an instance of the CurrentDocument class for the current document.
std::unique_ptr< Document > hdi::core::Illustrator::documentAtIndex | ( | const uint32_t | index_ | ) | const |
Gets an open document by its index.
index_ | Index number of the document |
uint32_t hdi::core::Illustrator::documentCount | ( | ) | const |
bool hdi::core::Illustrator::existsInPluginsFolder | ( | const std::string & | fileName_ | ) | const |
Verifies that a file is located in one of the Illustrator plugins folders.
fileName_ | Name of the file (e.g. "MyPlugin.aip"), as UTF-8 |
bool hdi::core::Illustrator::existsInToolsFolder | ( | const std::string & | fileName_ | ) | const |
Verifies that a file is located in the Illustrator tools folder.
fileName_ | Name of the file (e.g. "MyToolsPlugin.aip"), as UTF-8 |
std::unique_ptr< FileFormat > hdi::core::Illustrator::fileFormatAtIndex | ( | const uint32_t | index_ | ) | const |
Gets a file format object via its index.
index_ | Index number of the desired file format |
uint32_t hdi::core::Illustrator::fileFormatCount | ( | ) | const |
Gets the count of available file formats.
bool hdi::core::Illustrator::fileOpenPrompt | ( | const std::string & | title_, |
std::string & | path__ | ||
) | const |
Displays to the user a prompt to choose a file to be read from disk.
title_ | Title of the dialog, as UTF-8 |
path__ | Return-by-reference for the path to the file to be read, as UTF-8 |
bool hdi::core::Illustrator::fileSavePrompt | ( | const std::string & | title_, |
const std::string & | fileName_, | ||
std::string & | path__ | ||
) | const |
Displays to the user a prompt to choose a location and file name for some data to be written to disk.
title_ | Title of the dialog, as UTF-8 |
fileName_ | Default file name, as UTF-8 |
path__ | Return-by-reference for the path to the file to be saved, as UTF-8 |
std::string hdi::core::Illustrator::folderPath | ( | const FolderType | folder_ | ) | const |
Gets the folder path for a given illustrator folder.
folder_ | The Illustrator folder type whose path is desired |
bool hdi::core::Illustrator::folderPrompt | ( | const std::string & | title_, |
std::string & | path__ | ||
) | const |
Displays to the user a prompt to choose a folder on disk.
title_ | Title of the dialog, as UTF-8 |
path__ | Return-by-reference for the path of the folder, as UTF-8 |
std::unique_ptr< Font > hdi::core::Illustrator::fontAtIndex | ( | const uint32_t | index_ | ) | const |
Gets a Font object via its index.
index_ | Index number of the desired font |
uint32_t hdi::core::Illustrator::fontCount | ( | ) | const |
Gets the count of available fonts.
std::unique_ptr< Font > hdi::core::Illustrator::fontWithName | ( | const std::string & | faceName_ | ) | const |
Gets a Font object via its name (case-insensitive)
faceName_ | Name of the desired font, as UTF-8 |
void hdi::core::Illustrator::free | ( | void *const | block_ | ) | const |
Frees a block of memory previously allocated with the Illustrator::alloc() method.
block_ | Pointer to the block of memory to free |
bool hdi::core::Illustrator::hasContext | ( | ) | const |
Checks whether an Illustrator app context currently exists.
|
static |
std::unique_ptr< LiveEffect > hdi::core::Illustrator::liveEffectAtIndex | ( | const uint32_t | index_ | ) | const |
Gets a live effect object via its index.
index_ | Index number of the desired live effect |
uint32_t hdi::core::Illustrator::liveEffectCount | ( | ) | const |
Gets the count of available live effects.
Locale hdi::core::Illustrator::locale | ( | ) | const |
std::string hdi::core::Illustrator::localeString | ( | ) | const |
Gets a string describing the current locale of Illustrator.
int32_t hdi::core::Illustrator::majorVersion | ( | ) | const |
Gets the Illustrator major version number (e.g. "16" from "16.0.2")
std::unique_ptr< MenuGroup > hdi::core::Illustrator::menuGroupAtIndex | ( | const uint32_t | index_ | ) | const |
Gets a menu group object via its index.
index_ | Index number of the desired menu group |
uint32_t hdi::core::Illustrator::menuGroupCount | ( | ) | const |
Gets the count of menu groups in Illustrator (at all levels)
int32_t hdi::core::Illustrator::minorVersion | ( | ) | const |
Gets the Illustrator minor version number (e.g. "0" from "16.0.2")
std::unique_ptr< Document > hdi::core::Illustrator::openDocument | ( | const std::string & | path_, |
const DocumentColorModel | colorModel_, | ||
const bool | showDialog_, | ||
const bool | forceCopy_ = false |
||
) | const |
Opens a document and returns it.
path_ | Path to the file, as UTF-8 |
colorModel_ | Color mode for the file |
showDialog_ | Whether to show the new document dialog to query the user for parameters |
forceCopy_ | If true, duplicates the file and names the copy "Untitled" |
bool hdi::core::Illustrator::openURL | ( | const std::string & | url_ | ) | const |
Causes the OS's default browser to open a given URL.
url_ | URL to open, as UTF-8 |
PlatformAppPtr hdi::core::Illustrator::platformApp | ( | ) | const |
Gets a pointer to the platform object representing the current Illustrator instance.
std::unique_ptr< ThirdPartyPlugin > hdi::core::Illustrator::pluginWithName | ( | const std::string & | name_ | ) | const |
Gets a specific plugin by its name (must be an exact match)
name_ | Exact name of the plugin in question, as UTF-8 |
void hdi::core::Illustrator::popContext | ( | ) |
Pops a previously pushed Illustrator app context from the stack.
ai::Preferences *const hdi::core::Illustrator::preferences | ( | ) | const |
Convenience method to return the ai::Preferences instance.
void hdi::core::Illustrator::pushContext | ( | ) |
Pushes a new Illustrator app context onto the stack.
void * hdi::core::Illustrator::realloc | ( | void *const | block_, |
const int32_t | newSize_ | ||
) | const |
Reallocates a block of memory in Illustrator's memory heap (that was previously allocated using the Illustrator::alloc() method), while attempting to resize the block rather than relocate it.
block_ | Pointer to the block previously allocated with Illustrator::alloc() |
newSize_ | The new size of the block, in bytes |
bool hdi::core::Illustrator::registerFileFormat | ( | FileFormat & | ff_ | ) |
Registers a new file format with Illustrator, which will be displayed in Illustrator's file dialog.
ff_ | New file format to be registered |
void hdi::core::Illustrator::resumeSuspendedContext | ( | ) |
Resumes a previously suspended Illustrator app context.
int32_t hdi::core::Illustrator::revisionVersion | ( | ) | const |
Gets the Illustrator revision/bugfix version number (e.g. "2" from "16.0.2")
std::string hdi::core::Illustrator::serialNumber | ( | ) | const |
Gets the serial number of the registered Illustrator user.
void hdi::core::Illustrator::suspendExistingContext | ( | ) |
Suspends the existing Illustrator app context, storing it for later resuming.
std::unique_ptr< Typeface > hdi::core::Illustrator::typefaceAtIndex | ( | const uint32_t | index_ | ) | const |
Gets a Typeface object via its index.
index_ | Index number of the desired typeface |
uint32_t hdi::core::Illustrator::typefaceCount | ( | ) | const |
Gets the count of available typefaces.
double hdi::core::Illustrator::uiScalingFactor | ( | ) | const |
Gets the factor by which the Illustrator UI is scaled.
bool hdi::core::Illustrator::uiShouldScale | ( | ) | const |
Gets whether the Illustrator UI should be scaled at all (reads the Illustrator pref for this purpose, if necessary/available)
Color hdi::core::Illustrator::uiThemeColor | ( | const ThemeWindowType | dialog_, |
const ThemeComponentType | component_ | ||
) | const |
Gets the current color for a given widget component.
selector_ | Indicates whether the component is within a panel (or control bar) or modal dialog |
component_ | The type of widget, in dialog_, whose color is needed |
bool hdi::core::Illustrator::uiThemeDark | ( | ) | const |
Gets whether the current Illustrator UI theme color is considered dark.
std::string hdi::core::Illustrator::userName | ( | ) | const |
Gets the name of the registered Illustrator user.
std::string hdi::core::Illustrator::userOrganization | ( | ) | const |
Gets the organization/company name of the registered Illustrator user.
std::string hdi::core::Illustrator::versionDescription | ( | ) | const |
Gets the Illustrator version description, a.k.a. the marketed version name.
std::string hdi::core::Illustrator::versionString | ( | const bool | useRevision_ = false | ) | const |
Gets the Illustrator version as a string (e.g. "16.0" for Illustrator 16)
useRevision_ | Whether to show the revision number at the end |
BuiltinToolbox hdi::core::Illustrator::visibleBuiltinToolboxes | ( | ) | const |
Gets which built-in toolbox(es) is/are currently showing.