<commit_before>#include "STD_TabDesktop.h"

#include <SUIT_Session.h>
#include <SUIT_ViewWindow.h>
#include <SUIT_ResourceMgr.h>

#include <QtxAction.h>
#include <QtxWorkstack.h>
#include <QtxActionMenuMgr.h>
#include <QtxWorkstackAction.h>

#include <qvbox.h>
#include <qmenubar.h>
#include <qworkspace.h>
#include <qobjectlist.h>

#include <stdarg.h>

/*!Constructor.Create new instances of QVBox and QtxWorkstack.*/
STD_TabDesktop::STD_TabDesktop()
: SUIT_Desktop(),
myWorkstack( 0 ),
myWorkstackAction( 0 )
{
  QVBox* base = new QVBox( this );
  base->setFrameStyle( QFrame::Panel | QFrame::Sunken );

  setCentralWidget( base );

  myWorkstack = new QtxWorkstack( base );

  myWorkstack->setAccel(QtxWorkstack::SplitVertical,   SHIFT + Key_V);
  myWorkstack->setAccel(QtxWorkstack::SplitHorizontal, SHIFT + Key_H);
  myWorkstack->setAccel(QtxWorkstack::Close,           SHIFT + Key_C);

  connect( myWorkstack, SIGNAL( windowActivated( QWidget* ) ),
           this, SLOT( onWindowActivated( QWidget* ) ) );

  createActions();
}

/*!Destructor.*/
STD_TabDesktop::~STD_TabDesktop()
{
}

/*!\retval SUIT_ViewWindow - return const active window.*/
SUIT_ViewWindow* STD_TabDesktop::activeWindow() const
{
  SUIT_ViewWindow* wnd = 0;

  QWidget* wid = myWorkstack->activeWindow();
  if ( wid && wid->inherits( "SUIT_ViewWindow" ) )
    wnd = (SUIT_ViewWindow*)wid;

  return wnd;
}

/*!\retval QPtrList<SUIT_ViewWindow> - return const active window list.*/
QPtrList<SUIT_ViewWindow> STD_TabDesktop::windows() const
{<commit_msg>A minor modification: Expanding size policy is set to central QxtWorckstack.  why? - see comment in the code.<commit_after>#include "STD_TabDesktop.h"

#include <SUIT_Session.h>
#include <SUIT_ViewWindow.h>
#include <SUIT_ResourceMgr.h>

#include <QtxAction.h>
#include <QtxWorkstack.h>
#include <QtxActionMenuMgr.h>
#include <QtxWorkstackAction.h>

#include <qvbox.h>
#include <qmenubar.h>
#include <qworkspace.h>
#include <qobjectlist.h>

#include <stdarg.h>

/*!Constructor.Create new instances of QVBox and QtxWorkstack.*/
STD_TabDesktop::STD_TabDesktop()
: SUIT_Desktop(),
myWorkstack( 0 ),
myWorkstackAction( 0 )
{
  QVBox* base = new QVBox( this );
  base->setFrameStyle( QFrame::Panel | QFrame::Sunken );

  setCentralWidget( base );

  myWorkstack = new QtxWorkstack( base );
  // setting Expanding size policy for central workstack.  If there are several widgets
  // in central area of Desktop, other widgets will be added below the workstack (CATHARE, TIRPOLI modules).  
  // But the workstack must occupy as much space as possible -- set Expanding for it.
  myWorkstack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );

  myWorkstack->setAccel(QtxWorkstack::SplitVertical,   SHIFT + Key_V);
  myWorkstack->setAccel(QtxWorkstack::SplitHorizontal, SHIFT + Key_H);
  myWorkstack->setAccel(QtxWorkstack::Close,           SHIFT + Key_C);

  connect( myWorkstack, SIGNAL( windowActivated( QWidget* ) ),
           this, SLOT( onWindowActivated( QWidget* ) ) );

  createActions();
}

/*!Destructor.*/
STD_TabDesktop::~STD_TabDesktop()
{
}

/*!\retval SUIT_ViewWindow - return const active window.*/
SUIT_ViewWindow* STD_TabDesktop::activeWindow() const
{
  SUIT_ViewWindow* wnd = 0;

  QWidget* wid = myWorkstack->activeWindow();
  if ( wid && wid->inherits( "SUIT_ViewWindow" ) )
    wnd = (SUIT_ViewWindow*)wid;

  return wnd;
}

/*!\retval QPtrList<SUIT_ViewWindow> - return const active window list.*/
QPtrList<SUIT_ViewWindow> STD_TabDesktop::windows() const
{
{'fraction_non_alphanumeric': 0.13129598189020938, 'fraction_numerical': 0.001697792869269949, 'mean_word_length': 5.042735042735043, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2854179', 'n_tokens_mistral': 1300, 'n_tokens_neox': 1242, 'n_words': 276}