/** Retrieves the name of the specified artboard. if the index is -1 it gets the name of the active artboard @param name [out] A buffer in which to return the name. @param isDefault [out] A bool which indicates if the name is default or not. @param index [in] The artboard index (-1 if active artboard). */ AIErr GetArtboardName(ai::UnicodeString& name,bool& isDefault, ArtboardID index ) { AIErr error = kNoErr; isDefault = false; ArtboardList list; if(index == kActiveArtboard) error = list.GetActive(index); ArtboardProperties artboardProps(list.GetArtboardProperties(index)); artboardProps.GetName(name); AIBoolean isDefaultName = FALSE; artboardProps.IsDefaultName(isDefaultName); if(name.empty()) { isDefaultName=TRUE; const char* abString = "$$$/Artboards/Name/Str=Artboard"; name = ai::UnicodeString(ZREF(abString)); char artboardnum[4]; ::sprintf(artboardnum,"%d",index+1); name.append(ai::UnicodeString(" ")); name.append(ai::UnicodeString(artboardnum)); artboardProps.SetName(name); artboardProps.SetIsDefaultName(TRUE); } isDefault = (isDefaultName == 1); return error; }
void MapColorChangerPlugin::CStrToPStr(char *s, ai::UnicodeString::size_type len) { const ai::UnicodeString sAsUnicode((const char*)s); ai::PStr sAsPStr((unsigned char*) s); sAsUnicode.getToBuffer(sAsPStr, len, kAIUTF8CharacterEncoding ); }
static void CStrToPStr(char *s, unsigned long len) { const ai::UnicodeString sAsUnicode((const char*)s); ai::PStr sAsPStr((unsigned char*) s); sAsUnicode.getToBuffer(sAsPStr, len, kAIUTF8CharacterEncoding ); }
void stringToPascal(char *s, ai::UnicodeString::size_type len) { const ai::UnicodeString sAsUnicode((const char*)s); ai::PStr sAsPStr((unsigned char*) s); sAsUnicode.getToBuffer(sAsPStr, len, kAIUTF8CharacterEncoding ); }