<extension implements="::fwServices::registry::AppConfig">
    <id>Blend</id>
    <type>parameters</type>
    <parameters>
        <param name="WID_PARENT" />
        <param name="GENERIC_UID" />
        <param name="SERIESDB" />
        <param name="AS_UID" />
        <param name="frontImageUid" />
        <param name="backgroundImageUid" />
    </parameters>

    <config>

        <object type="::fwData::Composite">

            <service uid="${GENERIC_UID}_mainView" type="::gui::view::IView" impl="::gui::view::DefaultView" autoConnect="no">
                <gui>
                    <layout type="::fwGui::CardinalLayoutManager">
                        <view align="center" />
                    </layout>
                    <toolBar />
                </gui>
                <registry>
                    <parent wid="${WID_PARENT}" />
                    <toolBar sid="${GENERIC_UID}_toolBar" start="yes" />
                    <view wid="${GENERIC_UID}_WID_VIEW" start="no" />
                </registry>
            </service>

            <service uid="${GENERIC_UID}_toolBar" type="::fwGui::IToolBarSrv" impl="::gui::aspect::DefaultToolBarSrv" autoConnect="no">
                <gui>
                    <layout>
                        <menuItem name="Blend view" style="radio" icon="Bundles/media_0-1/icons/icon-2D.png" />
                        <menuItem name="Edit background Image TF" style="radio" icon="Bundles/media_0-1/icons/icon-tf1.svg" />
                        <menuItem name="Edit front Image TF" style="radio" icon="Bundles/media_0-1/icons/icon-tf2.svg" />
                        <menuItem name="Export Activity" icon="Bundles/media_0-1/icons/Export.svg"  />
                    </layout>
                </gui>
                <registry>
                    <menuItem sid="${GENERIC_UID}_action_blendView" start="no" />
                    <menuItem sid="${GENERIC_UID}_action_bgTFView" start="yes" />
                    <menuItem sid="${GENERIC_UID}_action_frontTFView" start="yes" />
                    <menuItem sid="${GENERIC_UID}_ActionExportActivity" start="yes" />
                </registry>
            </service>

            <item key="seriesDB">
                <object uid="${SERIESDB}" src="ref" type="::fwMedData::SeriesDB">
                    <service uid="${GENERIC_UID}_ActionExportActivity" type="::fwGui::IActionSrv" impl="::uiMedData::action::SExportSeries" autoConnect="yes">
                        <seriesId>${AS_UID}</seriesId>
                    </service>
                </object>
            </item>
            
            <item key="activitySeries">
                <object uid="${AS_UID}" src="ref" type="::fwMedData::ActivitySeries" />
            </item>

            <item key="TFSelectionsKey">
                <object uid="${GENERIC_UID}_TFComposite" type="::fwData::Composite" />
            </item>

            <item key="myBlendSelectionComposite">
                <object uid="${GENERIC_UID}_myBlendSelectionComposite" type="::fwData::Composite">
                
                    <service uid="${GENERIC_UID}_myManagerLockDump" impl="::ctrlMemory::manager::LockDumpManagerSrv" type="::ctrlSelection::IManagerSrv" autoConnect="yes" />

                    <service uid="${GENERIC_UID}_action_blendView" type="::fwGui::IActionSrv" impl="::gui::action::SConfigLauncher" autoConnect="yes">
                        <state active="true" />
                        <config>
                            <appConfig id="ImageMix" >
                               <parameters>
                                    <parameter replace="SELECTED_myBlendSelectionComposite" by="${GENERIC_UID}_myBlendSelectionComposite"  />
                                    <parameter replace="WID_VIEW" by="${GENERIC_UID}_WID_VIEW"  />
                                    <parameter replace="TF_COMPOSITE_ID" by="${GENERIC_UID}_TFComposite"  />
                                    <parameter replace="SELECTED_TF_KEYA" by="tfBackgroundImage"  />
                                    <parameter replace="SELECTED_TF_KEYB" by="tfFrontImage"  />
                               </parameters>
                            </appConfig>
                        </config>
                    </service>

                    <service uid="${GENERIC_UID}_action_bgTFView" type="::fwGui::IActionSrv" impl="::gui::action::SConfigLauncher" autoConnect="yes">
                        <config>
                            <appConfig id="TransferFunctionEditor" >
                                <parameters>
                                    <parameter replace="SELECTED_UID_myImage" by="${backgroundImageUid}"  />
                                    <parameter replace="WID_VIEW" by="${GENERIC_UID}_WID_VIEW"  />
                                    <parameter replace="TF_COMPOSITE_ID" by="${GENERIC_UID}_TFComposite"  />
                                    <parameter replace="SELECTED_TF_KEY" by="tfBackgroundImage"  />
                                </parameters>
                            </appConfig>
                        </config>
                    </service>

                    <service uid="${GENERIC_UID}_action_frontTFView" type="::fwGui::IActionSrv" impl="::gui::action::SConfigLauncher" autoConnect="yes">
                        <config>
                            <appConfig id="TransferFunctionEditor" >
                                <parameters>
                                    <parameter replace="SELECTED_UID_myImage" by="${frontImageUid}"  />
                                    <parameter replace="WID_VIEW" by="${GENERIC_UID}_WID_VIEW"  />
                                    <parameter replace="TF_COMPOSITE_ID" by="${GENERIC_UID}_TFComposite"  />
                                    <parameter replace="SELECTED_TF_KEY" by="tfFrontImage"  />
                                </parameters>
                            </appConfig>
                        </config>
                    </service>
                    
                    <item key="backgroundImage">
                        <object uid="${backgroundImageUid}" type="::fwData::Image" src="ref" />
                    </item>
                    
                    <item key="frontImage">
                        <object uid="${frontImageUid}" type="::fwData::Image" src="ref" />
                    </item>
                </object>
            </item>

            <!-- START AND STOP SERVICES -->
            <start uid="${GENERIC_UID}_mainView" />
            <start uid="${GENERIC_UID}_action_blendView" />
            <start uid="${GENERIC_UID}_myManagerLockDump" />

        </object>


    </config>
</extension>

