Kanzi 3.9 alpha 6 migration guide

Use this migration guide to update Kanzi applications from Kanzi 3.9 alpha 5 to Kanzi 3.9 alpha 6.

Changes to Code Behind

Kanzi 3.9 alpha 6 introduces changes to Code Behind functionality that are not compatible with the previous version of Kanzi. If your Kanzi application uses Code Behind, to migrate your Kanzi 3.9 alpha 5 application to Kanzi 3.9 alpha 6:

  1. Delete directories:

    • <ProjectName>/Tool_project/CodeBehind/Application/configs

    • <ProjectName>/Tool_project/CodeBehind/Application/lib

    • <ProjectName>/Tool_project/CodeBehind/Application/output

  2. From the <KanziWorkspace>/Templates/Code_behind_template/Application directory copy the CMakeLists.txt file to the <ProjectName>/Tool_project/CodeBehind/Application directory.

  3. In the copied CMakeLists.txt file:

    • Replace Code_behind_template with <ProjectName>CodeBehind.

      For example, if your project name is called MyActivities, replace Code_behind_template with MyActivitiesCodeBehind.

    • Replace CODE_BEHIND_TEMPLATE with <PROJECTNAME>CODEBEHIND.

      For example, if your project name is MyActivities, replace CODE_BEHIND_TEMPLATE with MYACTIVITIESCODEBEHIND.

  4. Update the application code:

    • If your application is based on the Application template, in the <ProjectName>/Application/src/<projectname>.cpp file add:

      • The <projectname>_code_behind_module.hpp header:

        #if defined(<PROJECTNAME>CODEBEHIND_API) && !defined(ANDROID) && !defined(KANZI_API_IMPORT)
        #include <<projectname>_code_behind_module.hpp>
        #endif
        
      • The registerMetadataOverride function to your application class:

        void registerMetadataOverride(ObjectFactory& factory) override
        {
            <ProjectName>::registerMetadataOverride(factory);
        
            #if defined(<PROJECTNAME>CODEBEHIND_API) && !defined(ANDROID) && !defined(KANZI_API_IMPORT)
            <ProjectName>CodeBehindModule::registerModule(getDomain());
            #endif
        }
        
    • If your project is based on the Data Source or Engine plugin template, in the <ProjectName>/Application/src/executable/src/<projectname>.cpp file add:

      • The <projectname>_code_behind_module.hpp header:

        #if defined(<PROJECTNAME>CODEBEHIND_API) && !defined(ANDROID) && !defined(KANZI_API_IMPORT)
        #include <<projectname>_code_behind_module.hpp>
        #endif
        
      • In your application class register the Code Behind module in the registerMetadataOverride function:

        #if defined(<PROJECTNAME>CODEBEHIND_API) && !defined(ANDROID) && !defined(KANZI_API_IMPORT)
        <ProjectName>CodeBehindModule::registerModule(getDomain());
        #endif
        
  5. Save the edited files and open the project in Kanzi Studio.

Changes to Light nodes

Kanzi 3.9 alpha 6 removes from Light nodes the Color Scale (Light::ColorScaleProperty) property. To adjust the brightness of a light, set the Intensity (I) of the light color property. See Adjusting the brightness of a light.

When you open your project in Kanzi Studio, Kanzi Studio automatically converts local values of light properties, but in some cases you have to adjust the lights manually after converting your project to Kanzi 3.9 alpha 6. For example, if your project contains a binding that binds a light color property to a custom property type, set the Editor of that custom property type to HDR color editor, then adjust the light color.

Changes to color space

Kanzi 3.9 alpha 6 introduces linear color workflow that is from now on the default color space. If you want to continue using the legacy color space (nonlinear gamma) in your application, in the application.cfg file for that application add:

SurfaceColorSpace = legacy

Note

On the linux_imx8_wayland_aarch64 platform Kanzi applications work only with the legacy color space.

See Color workflow and Surface properties.