![]() | InDesign SDK 20.5 |
As you may be aware, HFS (Hierarchical File System) paths have been deprecated by Apple (since Mac OS 10.0-10.9). Considering this deprecation, InDesign would also move away from HFS and adopt POSIX style paths going forward. (Please refer to the subsection below for details on the differences between HFS and POSIX.)
For a smooth transitioning period and to support the backward compatibility of plugins, refer to the public APIs mentioned here: https://forums.adobeprerelease.com/indesigndev/discussion/407/hfs-action-items-for-developers-and-partners
Remove the use of any hard-coded path delimiter, such as ':', ":", or kTextChar_Colon, etc., as a path separator. Instead, query it from APIs exposed in the FileUtils class as per the need.
Kindly go through all hard coded file/folder paths in your code and let us know if these APIs would aid in the smooth working of your plugins with both HFS & POSIX Path Style.
| HFS (Hierarchical File System) | POSIX (Portable Operating System Interface) |
|---|---|
| a. Developed by Apple | a. Open-source (IEEE Computer Society standard) |
| b. Uses colon(:) as a separator to separate paths | b. Uses forward slash (/) as a separator to separate paths |
| c. Case insensitive | c. Case sensitive |
| d. Absolute path doesn't start with separator | d. Absolute path starts with separator |
| e. Example: "Macintosh HD:Users:Username:Documents:File.txt" | e. Example: "/home/user/Documents/file.txt" |
InDesign is adopting the POSIX Path Style with the InDesign 20.0 release. Users and plug-in developers would not have the ability to switch between HFS and POSIX Style as cookie "ENABLE_POSIX_PATH" is removed.
The public API FileUtils::IDFileToPMString(const IDFile& file, PMString& pathStr, bool16 isPosixPath) has been deprecated as POSIX is the only path style.
The alternative for the removed API is FileUtils::IDFileToPMString(const IDFile& file, PMString& pathStr). Plug-in developers are suggested to make changes to avoid getting a compile time error. Functionality of this API is same as the deprecated API when parameter "bool16 isPosixPath" is set as true.
There are updates in our internal platform components. As part of this, we have upgraded the boost from 1.72 to 1.74. This boost upgrade has breaking changes. To review the changes across different boost versions, please refer to the following boost release notes:
InDesign now uses MacOSX12.x.sdk as the Base SDK, OSX 12.x as the OS X Deployment Target, GNU C++-17 as the C++ Language Dialect, and libc++.dylib as the C++ Standard Library for Xcode projects. If your projects don't use the SDK shared Xcode setting files, you will need to update these settings manually.
Other project changes to note
When installing Visual Studio 2022, please ensure that Windows SDK 10.0.22621.0 is also installed as this is used as the base SDK for InDesign projects. Also, please add a system environment variable called VS2022INSTALLDIR and set it to the path of the VS 2022 installation folder, upto the parent folder of folders "Common7", "VC" etc. For example, if you installed Visual Studio 2022 Enterprise edition, the value of VS2022INSTALLDIR should be C:\Program Files (x86\Microsoft Visual Studio\2022\Enterprise.
To update an existing Visual Studio project, the simplest method is to open the project in Visual Studio 2022 and use the prompt to update the project. In this window, please modify Windows SDK Version to 10.0.22621.0 and Platform Toolset to v143.
Alternatively you can modify the project file in a text editor by changing the ToolsVersion to 17.9.6 and PlatformToolset version to v143 and adding a new entry WindowsTargetPlatformVersion as 10.0.22621.0, as shown below.
Dolly has been updated to generate new projects with these settings.
Other project changes to note
IntelliSense
IntelliSense has never worked very well for InDesign code, and you may find that IntelliSense red squiggles appear under nearly every InDesign type or API, despite your project compiling successfully.
To disable the squiggles:
With InDesign 17.0 SDK, in an effort to move away from std::auto_ptr and adapt higher C++ standards (i.e. C++17), we have removed std::auto_ptr usage from InDesign.
The new SDK and shared samples will expect you to use indesign::autoptr instead of std::auto_ptr.
Here are a few reasons for this.
While doing this change, we have kept in mind that the interface signatures do not change unless change gets us closer to the goal of getting rid of autoptr constructs eventually. This implies that at a few places you may have to directly replae std::auto_ptr with std::unique_ptr or std::shared_ptr. This would be directly available in the API headers as to what is the altername of the std::auto_ptr in new SDK.
If you are not able to find the definition of indesign::autoptr, the header file containing this should be in /source/public/includes/... Calling out a few things explicitly:
For a full list of API changes see the API Changes page.
While InDesign code base is built using C++-11 now, the code does not fully leverage modern STL containers and therefore loses out on newer features introduced in C++-11. We intend to modernize our containers over multiple cycles to be able to leverage these features.
The approach to modernization would be to ideally replace our containers with corresponding STL containers. For example, over time, K2Vector should be replaced by std::vector.
To facilitate the eventual K2Vector migration, following changes would be made to the K2Vector interface in InDesign CC 2018:
K2Vector has a non-standard explicit constructor which takes 'size_type n' as parameter and reserves capacity for 'n' elements, but does not construct any elements so its size remains zero. STL's std::vector has a constructor with similar signature but actually constructs 'n' elements thereby resulting in a vector of size 'n'. Replacing K2Vector with std::vector without addressing this constructor would result in potential breaks in code that is using this K2Vector constructor. Therefore we intend to remove this constructor in InDesign CC 2018, so that existing code can be ported before the switch from K2Vector to std::vector happens. Code that uses this constructor can be ported as follows:
Current code (assuming a typename T):
New code:
K2Vector's Location API has been marked deprecated for several cycles now. This API returns a value of type 'int32'. If the element being searched for is found in the K2Vector, then the return value is the index at which this value was found. Otherwise, the returned value is -1. Since std::vector interface does not contain this API, we need to remove this API altogether to facilitate switching to std::vector in future.
There are several different ways in which code currently using Location can be ported:
Current code (assuming a typename T):
New code:
Current code (assuming a typename T):
New code:
Current code (assuming a typename T):
New code:
K2Vector's Length API has been marked deprecated for several cycles now. This API returns a value of type 'int32' representing the number of elements in the K2Vector. Standard API "size" already exists in the K2Vector interface and can be used in many situations - read the porting examples below where special care needs to be taken when replacing Length with size:
Current code (assuming a typename T):
New code:
Current code (assuming a typename T):
New code:
Current code (assuming a typename T):
New code:
Icons and cursors can be created in their native-platform resource form. InDesign also supports SVG/PNG platform-independent files for icons. SVG is the preferred resource type to use in icon-based widgets. All the application tools icons and cursors use SVG files. Although PNG icons are still supported, continuing to use PNG Icons means that icons will become skewed and blurred when the icons are scaled. Instead of PNG icons, SVG icons should be preferred.
To create a SVG-based icon:
The overall theme of Spectrum UI is to bring a consistency in Adobe productsâ UI and give these products a flat modern look. The major effort in this work is to remove bevels and embossing in the UI.
Ideally, no changes should be needed. API signatures have not been modified in this UI modernization so existing plug-ins should automatically get UI appearance consistent to InDesign, if no custom drawing has been done for any widget i.e. following API has not been implemented:
or following API has not been overridden:
If custom drawing has been done using any of the above APIs, some rework may be needed depending on the type of customization done. An example of customization that was done by InDesign team was bevels. Bevel is a combination of highlight and shadow. We chose to replace it with a uniform border wherever it appeared. Another major change that we made was changing few icons as they did not have a flat appearance. This is an optional change for plug-in developers. If the currently used icons look inconsistent with the rest of the UI, they may be modified to match colors and flatter appearance. In such a situation, the plug-in will need recompilation.
Parameters for GenericPanelWithCustomBorderWidget : Other than the parameters used by GenericPanelWithBorderWidget, the following parameters are needed:
Any change in the value of the slider value is broadcast on ISubject interface of this widget with ClassID as kRealChangeStateMessage.