1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
<plugin id="tuto10_launch_basic_config">
<requirement id="sight::module::ui" />
<requirement id="sight::module::ui::qt" />
<requirement id="sight::module::service" />
<!-- Allows to include a xml file containing a sub-configuration -->
<xi:include href="basic_frame_config.xml" xmlns:xi="http://www.w3.org/2003/XInclude" />
<extension implements="sight::app::extension::config">
<id>tuto10_launch_basic_config</id>
<config>
<!-- ******************************* Objects declaration ****************************** -->
<object uid="image" type="sight::data::image" />
<object uid="config_started" type="sight::data::boolean" value="false" />
<!-- ******************************* UI declaration *********************************** -->
<service uid="main_frame" type="sight::module::ui::frame">
<gui>
<frame>
<name>Tutorial 10: Launch a configuration</name>
<icon>tuto10_launch_basic_config/tuto.ico</icon>
<min_size width="800" height="600" />
</frame>
<menubar />
</gui>
<registry>
<menubar sid="menu_bar_view" />
<view sid="image_renderer_srv" />
</registry>
</service>
<service uid="menu_bar_view" type="sight::module::ui::menubar">
<gui>
<layout>
<menu name="File" />
</layout>
</gui>
<registry>
<menu sid="menu_file_view" />
</registry>
</service>
<service uid="menu_file_view" type="sight::module::ui::menu">
<gui>
<layout>
<menu_item name="Open image" shortcut="Ctrl+O" />
<separator />
<menu_item name="Launch config" style="check" shortcut="Ctrl+L" />
<separator />
<menu_item name="Quit" special_action="QUIT" shortcut="Ctrl+Q" />
</layout>
</gui>
<registry>
<menu_item sid="open_image_act" />
<menu_item sid="launch_config_act" />
<menu_item sid="quit_act" />
</registry>
</service>
<!-- ******************************* Actions ****************************************** -->
<service uid="open_image_act" type="sight::module::ui::action" />
<service uid="quit_act" type="sight::module::ui::quit" />
<service uid="launch_config_act" type="sight::module::ui::action">
<properties checked="${config_started}" />
</service>
<!-- ************************ Configuration launchers ********************************* -->
<!--
Configuration launcher:
This service allows to launch a sub-configuration.
The configuration is defined by its id.
-->
<service uid="frame_cfg" type="sight::app::config_launcher">
<properties config="tuto10_launch_basic_config::basic_frame_config" start="${config_started}" />
<!--
replace ${image} in the sub-config by the uid of the object with the key
(ie. ${image} is replaced by "image")
-->
<inout group="object">
<key name="image" uid="image" />
</inout>
</service>
<!-- ******************************* Services ***************************************** -->
<service uid="image_reader_srv" type="sight::module::ui::io::selector">
<inout key="data" uid="image" />
</service>
<service uid="image_renderer_srv" type="sight::module::viz::sample::image">
<in key="image" uid="image" />
</service>
<connect>
<signal>open_image_act/clicked</signal>
<slot>image_reader_srv/update</slot>
</connect>
</config>
</extension>
</plugin>
|