+
+string
+Tabbable::xml_node_name()
+{
+ return WindowProxy::xml_node_name();
+}
+
+bool
+Tabbable::tabbed_by_default() const
+{
+ return tab_requested_by_state;
+}
+
+XMLNode&
+Tabbable::get_state()
+{
+ XMLNode& node (WindowProxy::get_state());
+
+ node.add_property (X_("tabbed"), tabbed() ? X_("yes") : X_("no"));
+
+ return node;
+}
+
+int
+Tabbable::set_state (const XMLNode& node, int version)
+{
+ int ret;
+
+ if ((ret = WindowProxy::set_state (node, version)) != 0) {
+ return ret;
+ }
+
+ if (_visible) {
+ show_own_window (true);
+ }
+
+ XMLNodeList children = node.children ();
+ XMLNode* window_node = node.child ("Window");
+
+ if (window_node) {
+ XMLProperty const * prop = window_node->property (X_("tabbed"));
+ if (prop) {
+ tab_requested_by_state = PBD::string_is_affirmative (prop->value());
+ }
+ }
+
+ if (!_visible) {
+ if (tab_requested_by_state) {
+ attach ();
+ } else {
+ /* this does nothing if not tabbed */
+ hide_tab ();
+ }
+ }
+
+ return ret;
+}
+
+void
+Tabbable::window_mapped ()
+{
+ StateChange (*this);
+}
+
+void
+Tabbable::window_unmapped ()
+{
+ StateChange (*this);
+}