Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
hdi::core::Illustrator Class Reference

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, SuiteInfoSuiteInfoMap
 
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< ThirdPartyPluginpluginWithName (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< DocumentdocumentAtIndex (const uint32_t index_) const
 Gets an open document by its index.
 
std::unique_ptr< DocumentopenDocument (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< FontfontAtIndex (const uint32_t index_) const
 Gets a Font object via its index.
 
std::unique_ptr< FontfontWithName (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< TypefacetypefaceAtIndex (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< FileFormatfileFormatAtIndex (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< LiveEffectliveEffectAtIndex (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< MenuGroupmenuGroupAtIndex (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 Illustratorinstance ()
 Acquires an instance of the Illustrator class.
 

Detailed Description

Allows access to a wide variety of Illustrator app-related runtime attributes, documents, fonts, etc.

Constructor & Destructor Documentation

◆ ~Illustrator()

hdi::core::Illustrator::~Illustrator ( )

Destructs an Illustrator object.

Author
GW
Date
08/2013

Member Function Documentation

◆ allFonts()

FontVector hdi::core::Illustrator::allFonts ( ) const

Gets a vector containing Font objects for all available fonts.

Author
GW
Date
08/2013
Returns
A vector containing Font objects for all available fonts

◆ alloc()

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.

Author
GW
Date
04/2014
Parameters
size_Number of bytes to allocate
Returns
A pointer to the beginning of the block of memory, or NULL for error
Note
This method is commonly used like: SPMessageData* data = (SPMessageData*) HDI_CORE_ILLUSTRATOR->alloc(sizeof(SPMessageData));

◆ allPlugins()

ThirdPartyPluginMap hdi::core::Illustrator::allPlugins ( ) const

Gets a map of all available plugins, keyed on their name.

Author
GW
Date
04/2014
Returns
A map of all available plugins, keyed on their name (as UTF-8)
Warning
The caller assumes responsibility of the memory for the ThirdPartyPlugin objects in the map. Be sure to iterate over the map and delete the objects when you're finished with it.

◆ allSuites()

SuiteInfoMap hdi::core::Illustrator::allSuites ( ) const

Gets a map of all available suites, keyed on their name.

Author
GW
Date
04/2014
Returns
A map of all available suites' names and version numbers

◆ bitness()

int16_t hdi::core::Illustrator::bitness ( ) const

Gets the bitness of Illustrator at runtime.

Author
GW
Date
08/2014
Returns
32 or 64
Note
Mac Illustrator versions 16 and above will be 64-bit.
Windows Illustrator versions 16 and above will be either 32- or 64-bit.

◆ cacheFonts()

void hdi::core::Illustrator::cacheFonts ( )

Caches all the available fonts in an internal map until clearFontCache() is called.

Author
GW
Date
07/2014
Note
Acquiring fonts by name in Illustrator is notoriously slow. If you expect to be using the fontWithName() method a lot in a short period of time, it would be worthwhile to cache the fonts beforehand. Remember to call clearFontCache() when you are done.

◆ checkFolderForFile()

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.

Author
GW
Date
08/2013
Parameters
folder_The illustrator folder type to look in
fileName_Name of file whose existence (in folder_) is in question, as UTF-8
Returns
true if a file with the provided name exists in folder_, false otherwise

◆ clearFontCache()

void hdi::core::Illustrator::clearFontCache ( )

Clears fonts previously cached by the cacheFonts() method.

Author
GW
Date
07/2014

◆ currentDocument()

CurrentDocument *const hdi::core::Illustrator::currentDocument ( )

Acquires an instance of the CurrentDocument class for the current document.

Author
GW
Date
08/2013
Returns
A pointer to the current document instance

◆ documentAtIndex()

std::unique_ptr< Document > hdi::core::Illustrator::documentAtIndex ( const uint32_t  index_) const

Gets an open document by its index.

Author
GW
Date
08/2013
Parameters
index_Index number of the document
Returns
The document indicated by the index

◆ documentCount()

uint32_t hdi::core::Illustrator::documentCount ( ) const

Gets the open document count.

Author
GW
Date
08/2013
Returns
Number of documents currently open in Illustrator

◆ existsInPluginsFolder()

bool hdi::core::Illustrator::existsInPluginsFolder ( const std::string &  fileName_) const

Verifies that a file is located in one of the Illustrator plugins folders.

Author
GW
Date
08/2013
Parameters
fileName_Name of the file (e.g. "MyPlugin.aip"), as UTF-8
Returns
true if the file exists in an Illustrator plugins folder, false otherwise

◆ existsInToolsFolder()

bool hdi::core::Illustrator::existsInToolsFolder ( const std::string &  fileName_) const

Verifies that a file is located in the Illustrator tools folder.

Author
GW
Date
08/2013
Parameters
fileName_Name of the file (e.g. "MyToolsPlugin.aip"), as UTF-8
Returns
true if the file exists in the Illustrator tools folder, false otherwise

◆ fileFormatAtIndex()

std::unique_ptr< FileFormat > hdi::core::Illustrator::fileFormatAtIndex ( const uint32_t  index_) const

Gets a file format object via its index.

Author
GW
Date
12/2014
Parameters
index_Index number of the desired file format
Returns
The file format at the given index

◆ fileFormatCount()

uint32_t hdi::core::Illustrator::fileFormatCount ( ) const

Gets the count of available file formats.

Author
GW
Date
12/2014
Returns
Count of available file formats

◆ fileOpenPrompt()

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.

Author
GW
Date
02/2015
Parameters
title_Title of the dialog, as UTF-8
path__Return-by-reference for the path to the file to be read, as UTF-8
Returns
true if the user completed the prompt, false if they canceled it

◆ fileSavePrompt()

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.

Author
GW
Date
02/2015
Parameters
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
Returns
true if the user completed the prompt, false if they canceled it

◆ folderPath()

std::string hdi::core::Illustrator::folderPath ( const FolderType  folder_) const

Gets the folder path for a given illustrator folder.

Author
GW
Date
08/2013
Parameters
folder_The Illustrator folder type whose path is desired
Returns
A string for the path to the Illustrator folder type in question, as UTF-8

◆ folderPrompt()

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.

Author
GW
Date
02/2015
Parameters
title_Title of the dialog, as UTF-8
path__Return-by-reference for the path of the folder, as UTF-8
Returns
true if the user completed the prompt, false if they canceled it

◆ fontAtIndex()

std::unique_ptr< Font > hdi::core::Illustrator::fontAtIndex ( const uint32_t  index_) const

Gets a Font object via its index.

Author
GW
Date
08/2013
Parameters
index_Index number of the desired font
Returns
The font at the given index

◆ fontCount()

uint32_t hdi::core::Illustrator::fontCount ( ) const

Gets the count of available fonts.

Author
GW
Date
08/2013
Returns
Count of available fonts

◆ fontWithName()

std::unique_ptr< Font > hdi::core::Illustrator::fontWithName ( const std::string &  faceName_) const

Gets a Font object via its name (case-insensitive)

Author
GW
Date
08/2013
Parameters
faceName_Name of the desired font, as UTF-8
Returns
The font with the given name

◆ free()

void hdi::core::Illustrator::free ( void *const  block_) const

Frees a block of memory previously allocated with the Illustrator::alloc() method.

Author
GW
Date
04/2014
Parameters
block_Pointer to the block of memory to free

◆ hasContext()

bool hdi::core::Illustrator::hasContext ( ) const

Checks whether an Illustrator app context currently exists.

Author
GW
Date
11/2016
Returns
true if currently within an Illustrator app context, false otherwise

◆ instance()

static Illustrator * hdi::core::Illustrator::instance ( )
static

Acquires an instance of the Illustrator class.

Author
GW
Date
08/2013
Returns
The Illustrator instance object

◆ liveEffectAtIndex()

std::unique_ptr< LiveEffect > hdi::core::Illustrator::liveEffectAtIndex ( const uint32_t  index_) const

Gets a live effect object via its index.

Author
GW
Date
08/2014
Parameters
index_Index number of the desired live effect
Returns
The live effect at the given index

◆ liveEffectCount()

uint32_t hdi::core::Illustrator::liveEffectCount ( ) const

Gets the count of available live effects.

Author
GW
Date
08/2014
Returns
Count of available live effects

◆ locale()

Locale hdi::core::Illustrator::locale ( ) const

Gets the current locale of Illustrator.

Author
GW
Date
08/2013
Returns
Illustrator's locale

◆ localeString()

std::string hdi::core::Illustrator::localeString ( ) const

Gets a string describing the current locale of Illustrator.

Author
GW
Date
08/2013
Returns
Illustrator locale description string

◆ majorVersion()

int32_t hdi::core::Illustrator::majorVersion ( ) const

Gets the Illustrator major version number (e.g. "16" from "16.0.2")

Author
GW
Date
08/2013
Returns
Major version number of Illustrator

◆ menuGroupAtIndex()

std::unique_ptr< MenuGroup > hdi::core::Illustrator::menuGroupAtIndex ( const uint32_t  index_) const

Gets a menu group object via its index.

Author
GW
Date
09/2014
Parameters
index_Index number of the desired menu group
Returns
The menu group at the given index
Note
It's worth noting that most groups, due to Illustrator's implementation of "groups", are not actually real UI menu groups at all. Most are just a specific region of some top- level menu or other subgroup. This can be a bit confusing, as some "groups" do not actually behave like proper groups (e.g. their parent cannot be acquired, text value cannot be acquired, etc). See also the isPartial() method in the MenuGroup class.

◆ menuGroupCount()

uint32_t hdi::core::Illustrator::menuGroupCount ( ) const

Gets the count of menu groups in Illustrator (at all levels)

Author
GW
Date
09/2014
Returns
Count of available menu groups

◆ minorVersion()

int32_t hdi::core::Illustrator::minorVersion ( ) const

Gets the Illustrator minor version number (e.g. "0" from "16.0.2")

Author
GW
Date
08/2013
Returns
Minor version number of Illustrator

◆ openDocument()

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.

Author
GW
Date
08/2013
Parameters
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"
Returns
The opened document, or NULL for none

◆ openURL()

bool hdi::core::Illustrator::openURL ( const std::string &  url_) const

Causes the OS's default browser to open a given URL.

Author
GW
Date
08/2013
Parameters
url_URL to open, as UTF-8
Returns
true if the URL is opened, false otherwise

◆ platformApp()

PlatformAppPtr hdi::core::Illustrator::platformApp ( ) const

Gets a pointer to the platform object representing the current Illustrator instance.

Author
GW
Date
08/2013
Returns
A pointer to the platform object for the Illustrator instance

◆ pluginWithName()

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)

Author
GW
Date
04/2014
Parameters
name_Exact name of the plugin in question, as UTF-8
Returns
A smart pointer for the plugin (will contain NULL if the plugin isn't found)

◆ popContext()

void hdi::core::Illustrator::popContext ( )

Pops a previously pushed Illustrator app context from the stack.

Author
GW
Date
08/2013

◆ preferences()

ai::Preferences *const hdi::core::Illustrator::preferences ( ) const

Convenience method to return the ai::Preferences instance.

Author
GW
Date
07/2014
Returns
The Illustrator preferences instance

◆ pushContext()

void hdi::core::Illustrator::pushContext ( )

Pushes a new Illustrator app context onto the stack.

Author
GW
Date
08/2013

◆ realloc()

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.

Author
GW
Date
04/2014
Parameters
block_Pointer to the block previously allocated with Illustrator::alloc()
newSize_The new size of the block, in bytes
Returns
A pointer to the beginning of a new block of memory, or block_ if the original block could be resized, or NULL for error
Note
If the return value is not equal to block_, then block_ is no longer valid (you must use the return value instead).

◆ registerFileFormat()

bool hdi::core::Illustrator::registerFileFormat ( FileFormat ff_)

Registers a new file format with Illustrator, which will be displayed in Illustrator's file dialog.

Author
GW
Date
12/2014
Parameters
ff_New file format to be registered
Returns
true if the format was registered, false otherwise

◆ resumeSuspendedContext()

void hdi::core::Illustrator::resumeSuspendedContext ( )

Resumes a previously suspended Illustrator app context.

Author
GW
Date
08/2013

◆ revisionVersion()

int32_t hdi::core::Illustrator::revisionVersion ( ) const

Gets the Illustrator revision/bugfix version number (e.g. "2" from "16.0.2")

Author
GW
Date
08/2013
Returns
Revision version number of Illustrator

◆ serialNumber()

std::string hdi::core::Illustrator::serialNumber ( ) const

Gets the serial number of the registered Illustrator user.

Author
GW
Date
08/2013
Returns
A "stringified" version of the Illustrator serial number (likely a hash)

◆ suspendExistingContext()

void hdi::core::Illustrator::suspendExistingContext ( )

Suspends the existing Illustrator app context, storing it for later resuming.

Author
GW
Date
08/2013

◆ typefaceAtIndex()

std::unique_ptr< Typeface > hdi::core::Illustrator::typefaceAtIndex ( const uint32_t  index_) const

Gets a Typeface object via its index.

Author
GW
Date
08/2014
Parameters
index_Index number of the desired typeface
Returns
The typeface at the given index

◆ typefaceCount()

uint32_t hdi::core::Illustrator::typefaceCount ( ) const

Gets the count of available typefaces.

Author
GW
Date
08/2014
Returns
Count of available typefaces

◆ uiScalingFactor()

double hdi::core::Illustrator::uiScalingFactor ( ) const

Gets the factor by which the Illustrator UI is scaled.

Author
GW
Date
08/2018
Returns
Illustrator's UI scaling factor
Note
This is independent of the operating system's UI scaling factor. For example, on a Mac with a Retina display, the OS scaling factor will likely be 2.0; however, Illustrator could have a scaling factor of 1.5 itself - this results in a final scaling factor of 3.0. In that case, this method will return 1.5 (to find the scaling factor of a specific window you must call the associated method for said window, after which you can multiply the two numbers together to determine the final scaling factor).

◆ uiShouldScale()

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)

Author
GW
Date
02/2017
Returns
true if the Illustrator UI should be scaled for HiDPI displays, false otherwise
Note
This method always returns true on Mac
As this pref can be changed at runtime, but the UI does not actually update to reflect the new setting until relaunch, the pref value is read at startup and cached for the duration of the plugin's lifecycle.

◆ uiThemeColor()

Color hdi::core::Illustrator::uiThemeColor ( const ThemeWindowType  dialog_,
const ThemeComponentType  component_ 
) const

Gets the current color for a given widget component.

Author
GW
Date
08/2013
Parameters
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
Returns
Ideal color values for the dialog_ and component_ combo

◆ uiThemeDark()

bool hdi::core::Illustrator::uiThemeDark ( ) const

Gets whether the current Illustrator UI theme color is considered dark.

Author
GW
Date
08/2013
Returns
true if the theme is dark, false if light (dark meaning the background color is dark)

◆ userName()

std::string hdi::core::Illustrator::userName ( ) const

Gets the name of the registered Illustrator user.

Author
GW
Date
08/2013
Returns
The user's name, according to Illustrator, as UTF-8

◆ userOrganization()

std::string hdi::core::Illustrator::userOrganization ( ) const

Gets the organization/company name of the registered Illustrator user.

Author
GW
Date
08/2013
Returns
The user's company name, according to Illustrator, as UTF-8

◆ versionDescription()

std::string hdi::core::Illustrator::versionDescription ( ) const

Gets the Illustrator version description, a.k.a. the marketed version name.

Author
GW
Date
09/2014
Returns
"CS6" if the major version is 16, "CC 2013" if the major version is 17, etc.

◆ versionString()

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)

Author
GW
Date
08/2013
Parameters
useRevision_Whether to show the revision number at the end
Returns
The full Illustrator version string, e.g. "16.0" with useRevision_ as false or "16.0.2" as true

◆ visibleBuiltinToolboxes()

BuiltinToolbox hdi::core::Illustrator::visibleBuiltinToolboxes ( ) const

Gets which built-in toolbox(es) is/are currently showing.

Author
GW
Date
09/2018
Returns
A bitwise OR'd combination of values from the BuiltinToolbox enum