This file is indexed.

/usr/include/KWWidgets/Templates/vtkKWWidgetWithLabelSubclass.cxx.in is in libkwwidgets1-dev 1.0.0~cvs20100930-8.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/*=========================================================================

  Module:    $RCSfile: vtkKWWidgetWithLabelSubclass.cxx.in,v $

  Copyright (c) Kitware, Inc.
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/

#include "@WidgetType@WithLabel.h"

#include "vtkKWLabel.h"
#include "vtkObjectFactory.h"
#include "@WidgetType@.h"

#include <vtksys/ios/sstream>

//----------------------------------------------------------------------------
vtkStandardNewMacro(@WidgetType@WithLabel);
vtkCxxRevisionMacro(@WidgetType@WithLabel, "$Revision: 1.9 $");

//----------------------------------------------------------------------------
@WidgetType@WithLabel::@WidgetType@WithLabel()
{
  this->ExpandWidget    = 1;
  this->Widget          = @WidgetType@::New();
}

//----------------------------------------------------------------------------
@WidgetType@WithLabel::~@WidgetType@WithLabel()
{
  if (this->Widget)
    {
    this->Widget->Delete();
    this->Widget = NULL;
    }
}

//----------------------------------------------------------------------------
@WidgetType@* @WidgetType@WithLabel::GetWidget()
{
  return this->Widget;
}

//----------------------------------------------------------------------------
void @WidgetType@WithLabel::CreateWidget()
{
  // Check if already created

  if (this->IsCreated())
    {
    vtkErrorMacro("@WidgetType@WithLabel already created");
    return;
    }

  // Call the superclass

  this->Superclass::CreateWidget();

  // Create the widget

  if (!this->Widget->GetParent())
    {
    this->Widget->SetParent(this);
    }
  this->Widget->Create();
  if (!this->Widget->IsCreated())
    {
    vtkErrorMacro(<< this->GetClassName() << " failed creating @WidgetType@");
    return;
    }

  // Pack

  this->Pack();

  // Update enable state
  
  this->UpdateEnableState();
}

//----------------------------------------------------------------------------
void @WidgetType@WithLabel::Pack()
{
  if (!this->IsCreated())
    {
    return;
    }

  // Unpack everything

  if (this->Widget)
    {
    this->Widget->UnpackSiblings();
    }

  // Repack everything

  vtksys_ios::ostringstream tk_cmd;

  const char *side;
  switch (this->LabelPosition)
    {
    case vtkKWWidgetWithLabel::LabelPositionTop:
      side = "top";
      break;
    case vtkKWWidgetWithLabel::LabelPositionBottom:
      side = "bottom";
      break;
    case vtkKWWidgetWithLabel::LabelPositionRight:
      side = "right";
      break;
    case vtkKWWidgetWithLabel::LabelPositionDefault:
    case vtkKWWidgetWithLabel::LabelPositionLeft:
    default:
      side = "left";
      break;
    }

  if (this->LabelVisibility && this->HasLabel() && this->GetLabel()->IsCreated())
    {
    tk_cmd << "pack " << this->GetLabel()->GetWidgetName() 
           << " -anchor nw -side " << side << endl;
    }

  if (this->Widget && this->Widget->IsCreated())
    {
    tk_cmd << "pack " << this->Widget->GetWidgetName() 
           << " -anchor nw "
           << " -fill " << (this->ExpandWidget ? "both" : "none")
           << " -side " << side 
           << " -expand " << (this->ExpandWidget ? "y" : "n") 
           << endl;
    }

  this->Script(tk_cmd.str().c_str());
}

// ----------------------------------------------------------------------------
void @WidgetType@WithLabel::SetExpandWidget(int _arg)
{
  if (this->ExpandWidget == _arg)
    {
    return;
    }

  this->ExpandWidget = _arg;

  this->Modified();

  this->Pack();
}

//----------------------------------------------------------------------------
void @WidgetType@WithLabel::UpdateEnableState()
{
  this->Superclass::UpdateEnableState();
  
  this->PropagateEnableState(this->Widget);
}

// ---------------------------------------------------------------------------
void @WidgetType@WithLabel::SetBalloonHelpString(const char *string)
{
  this->Superclass::SetBalloonHelpString(string);

  if (this->Widget)
    {
    this->Widget->SetBalloonHelpString(string);
    }
}

//----------------------------------------------------------------------------
void @WidgetType@WithLabel::PrintSelf(ostream& os, vtkIndent indent)
{
  this->Superclass::PrintSelf(os,indent);

  os << indent << "ExpandWidget: " 
     << (this->ExpandWidget ? "On" : "Off") << endl;

  os << indent << "Widget: ";
  if (this->Widget)
    {
    os << endl;
    this->Widget->PrintSelf(os, indent.GetNextIndent());
    }
  else
    {
    os << "None" << endl;
    }
}