ROOT logo
// $Id: ShellInfo.cxx 2597 2011-11-13 08:03:06Z matevz $

// Copyright (C) 1999-2008, Matevz Tadel. All rights reserved.
// This file is part of GLED, released under GNU General Public License version 2.
// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.

#include "ShellInfo.h"
#include "MetaViewInfo.h"
#include "ShellInfo.c7"
#include "NestInfo.h"
#include <Glasses/ZQueen.h>

//__________________________________________________________________________
//
// Glass representation of GUI shell 'FTW_Shell'.
// Note that FTW_Shell itself is subclassed from Eye.
// ShellInfo can not subclass EyeInfo as it is instantiated on the
// Sun Absolute.
// In principle should have a link to swallowed view and display a canvas
// of some sort if it is not set.

ClassImp(ShellInfo);

/**************************************************************************/

void ShellInfo::_init()
{
  mSubShells   = 0;
  mDefSubShell = 0;
  mBeta = mGamma = 0;
  mMessageRecipient = 0;

  mDefW       = 80;
  mDefSShellH = 28;
  bDefSourceVis = true;
  bDefSinkVis   = false;

  mMsgOutH     = 5;

  bFancyClassView       = true; bCollZGlass = bCollAList = true;
  bShowLinksInClassView = true;
}

/**************************************************************************/

void ShellInfo::AdEnlightenment()
{
  PARENT_GLASS::AdEnlightenment();
  if(mSubShells == 0) {
    assign_link<ZHashList>(mSubShells, FID(), "SubShells",
			   GForm("SubShells of %s", GetName()));
    mSubShells->SetMIRActive(false);
  }
  const TString etc("Etc");
  if(!GetElementByName(etc)) {
    ZNameMap* nm = new ZNameMap(etc.Data());
    mQueen->CheckIn(nm);
    Add(nm);
  }
}

/**************************************************************************/

SubShellInfo* ShellInfo::MakeDefSubShell()
{
  NestInfo* nest = new NestInfo("Default Nest");
  mQueen->CheckIn(nest);
  nest->ImportKings();
  AddSubShell(nest);
  SetDefSubShell(nest);
  return nest;
}

/**************************************************************************/

void ShellInfo::AddSubShell(SubShellInfo* sub_shell)
{
  mSubShells->Add(sub_shell);
  if(mQueen && mSaturn->AcceptsRays()) {
    auto_ptr<Ray> ray
      (Ray::PtrCtor(this, PRQN_add_subshell, mTimeStamp, FID()));
    ray->SetBeta(sub_shell);
    mQueen->EmitRay(ray);
  }
}

void ShellInfo::RemoveSubShell(SubShellInfo* sub_shell)
{
  mSubShells->Remove(sub_shell);
  if(mQueen && mSaturn->AcceptsRays()) {
    auto_ptr<Ray> ray
      (Ray::PtrCtor(this, PRQN_remove_subshell, mTimeStamp, FID()));
    ray->SetBeta(sub_shell);
    mQueen->EmitRay(ray);
  }
}

/**************************************************************************/

void ShellInfo::SetDefSubShell(SubShellInfo* ss)
{
  static const Exc_t _eh("ShellInfo::SetDefSubShell ");
  if(ss && !mSubShells->Has(ss)) {
    AddSubShell(ss);
  }
  set_link_or_die(mDefSubShell.ref_link(), ss, FID());
  if(mQueen && mSaturn->AcceptsRays()) {
    auto_ptr<Ray> ray
      (Ray::PtrCtor(this, PRQN_set_def_subshell, mTimeStamp, FID()));
    ray->SetBeta(ss);
    mQueen->EmitRay(ray);
  }
}

void ShellInfo::SetSubShells(ZHashList* ss)
{
  static const Exc_t _eh("ShellInfo::SetSubShells ");
  if(mSubShells != 0)
    throw(_eh + "can not be changed.");
  set_link_or_die(mSubShells.ref_link(), ss, FID());
}

/**************************************************************************/

void ShellInfo::SpawnClassView(ZGlass* source)
{
  if(mQueen && mSaturn->AcceptsRays()) {
    auto_ptr<Ray> ray
      (Ray::PtrCtor(this, PRQN_spawn_classview, mTimeStamp, FID()));
    ray->SetBeta(source);
    mQueen->EmitRay(ray);
  }
}

void ShellInfo::SpawnMetaGui(ZGlass* source, MetaViewInfo* gui_template)
{
  if(mQueen && mSaturn->AcceptsRays()) {
    auto_ptr<Ray> ray
      (Ray::PtrCtor(this, PRQN_spawn_metagui, mTimeStamp, FID()));
    ray->SetBeta(source);
    ray->SetGamma(gui_template);
    mQueen->EmitRay(ray);
  }
}

/**************************************************************************/

void ShellInfo::EmitResizeRay()
{
  if(mQueen && mSaturn->AcceptsRays()) {
    auto_ptr<Ray> ray
      (Ray::PtrCtor(this, PRQN_resize_window, mTimeStamp, FID()));
    mQueen->EmitRay(ray);
  }
}
 ShellInfo.cxx:1
 ShellInfo.cxx:2
 ShellInfo.cxx:3
 ShellInfo.cxx:4
 ShellInfo.cxx:5
 ShellInfo.cxx:6
 ShellInfo.cxx:7
 ShellInfo.cxx:8
 ShellInfo.cxx:9
 ShellInfo.cxx:10
 ShellInfo.cxx:11
 ShellInfo.cxx:12
 ShellInfo.cxx:13
 ShellInfo.cxx:14
 ShellInfo.cxx:15
 ShellInfo.cxx:16
 ShellInfo.cxx:17
 ShellInfo.cxx:18
 ShellInfo.cxx:19
 ShellInfo.cxx:20
 ShellInfo.cxx:21
 ShellInfo.cxx:22
 ShellInfo.cxx:23
 ShellInfo.cxx:24
 ShellInfo.cxx:25
 ShellInfo.cxx:26
 ShellInfo.cxx:27
 ShellInfo.cxx:28
 ShellInfo.cxx:29
 ShellInfo.cxx:30
 ShellInfo.cxx:31
 ShellInfo.cxx:32
 ShellInfo.cxx:33
 ShellInfo.cxx:34
 ShellInfo.cxx:35
 ShellInfo.cxx:36
 ShellInfo.cxx:37
 ShellInfo.cxx:38
 ShellInfo.cxx:39
 ShellInfo.cxx:40
 ShellInfo.cxx:41
 ShellInfo.cxx:42
 ShellInfo.cxx:43
 ShellInfo.cxx:44
 ShellInfo.cxx:45
 ShellInfo.cxx:46
 ShellInfo.cxx:47
 ShellInfo.cxx:48
 ShellInfo.cxx:49
 ShellInfo.cxx:50
 ShellInfo.cxx:51
 ShellInfo.cxx:52
 ShellInfo.cxx:53
 ShellInfo.cxx:54
 ShellInfo.cxx:55
 ShellInfo.cxx:56
 ShellInfo.cxx:57
 ShellInfo.cxx:58
 ShellInfo.cxx:59
 ShellInfo.cxx:60
 ShellInfo.cxx:61
 ShellInfo.cxx:62
 ShellInfo.cxx:63
 ShellInfo.cxx:64
 ShellInfo.cxx:65
 ShellInfo.cxx:66
 ShellInfo.cxx:67
 ShellInfo.cxx:68
 ShellInfo.cxx:69
 ShellInfo.cxx:70
 ShellInfo.cxx:71
 ShellInfo.cxx:72
 ShellInfo.cxx:73
 ShellInfo.cxx:74
 ShellInfo.cxx:75
 ShellInfo.cxx:76
 ShellInfo.cxx:77
 ShellInfo.cxx:78
 ShellInfo.cxx:79
 ShellInfo.cxx:80
 ShellInfo.cxx:81
 ShellInfo.cxx:82
 ShellInfo.cxx:83
 ShellInfo.cxx:84
 ShellInfo.cxx:85
 ShellInfo.cxx:86
 ShellInfo.cxx:87
 ShellInfo.cxx:88
 ShellInfo.cxx:89
 ShellInfo.cxx:90
 ShellInfo.cxx:91
 ShellInfo.cxx:92
 ShellInfo.cxx:93
 ShellInfo.cxx:94
 ShellInfo.cxx:95
 ShellInfo.cxx:96
 ShellInfo.cxx:97
 ShellInfo.cxx:98
 ShellInfo.cxx:99
 ShellInfo.cxx:100
 ShellInfo.cxx:101
 ShellInfo.cxx:102
 ShellInfo.cxx:103
 ShellInfo.cxx:104
 ShellInfo.cxx:105
 ShellInfo.cxx:106
 ShellInfo.cxx:107
 ShellInfo.cxx:108
 ShellInfo.cxx:109
 ShellInfo.cxx:110
 ShellInfo.cxx:111
 ShellInfo.cxx:112
 ShellInfo.cxx:113
 ShellInfo.cxx:114
 ShellInfo.cxx:115
 ShellInfo.cxx:116
 ShellInfo.cxx:117
 ShellInfo.cxx:118
 ShellInfo.cxx:119
 ShellInfo.cxx:120
 ShellInfo.cxx:121
 ShellInfo.cxx:122
 ShellInfo.cxx:123
 ShellInfo.cxx:124
 ShellInfo.cxx:125
 ShellInfo.cxx:126
 ShellInfo.cxx:127
 ShellInfo.cxx:128
 ShellInfo.cxx:129
 ShellInfo.cxx:130
 ShellInfo.cxx:131
 ShellInfo.cxx:132
 ShellInfo.cxx:133
 ShellInfo.cxx:134
 ShellInfo.cxx:135
 ShellInfo.cxx:136
 ShellInfo.cxx:137
 ShellInfo.cxx:138
 ShellInfo.cxx:139
 ShellInfo.cxx:140
 ShellInfo.cxx:141
 ShellInfo.cxx:142
 ShellInfo.cxx:143
 ShellInfo.cxx:144
 ShellInfo.cxx:145
 ShellInfo.cxx:146
 ShellInfo.cxx:147
 ShellInfo.cxx:148
 ShellInfo.cxx:149
 ShellInfo.cxx:150
 ShellInfo.cxx:151
 ShellInfo.cxx:152
 ShellInfo.cxx:153
 ShellInfo.cxx:154
 ShellInfo.cxx:155