/usr/include/KWWidgets/vtkKWToolbarSet.h 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 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | /*=========================================================================
Module: $RCSfile: vtkKWToolbarSet.h,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.
=========================================================================*/
// .NAME vtkKWToolbarSet - a "set of toolbars" widget
// .SECTION Description
// A simple widget representing a set of toolbars..
#ifndef __vtkKWToolbarSet_h
#define __vtkKWToolbarSet_h
#include "vtkKWCompositeWidget.h"
class vtkKWFrame;
class vtkKWMenu;
class vtkKWSeparator;
class vtkKWToolbar;
class vtkKWToolbarSetInternals;
class KWWidgets_EXPORT vtkKWToolbarSet : public vtkKWCompositeWidget
{
public:
static vtkKWToolbarSet* New();
vtkTypeRevisionMacro(vtkKWToolbarSet,vtkKWCompositeWidget);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Get the frame that can be used as a parent to a toolbar
vtkGetObjectMacro(ToolbarsFrame, vtkKWFrame);
// Description:
// Add a toolbar to the set.
// The default_visibility parameter sets the visibility of the toolbar
// in the set once it is added (so that it can be added hidden for example,
// before its visibility setting is retrieved from the registry).
// Return 1 on success, 0 otherwise.
virtual int AddToolbar(vtkKWToolbar *toolbar)
{ return this->AddToolbar(toolbar, 1); };
virtual int AddToolbar(vtkKWToolbar *toolbar, int default_visibility);
virtual int HasToolbar(vtkKWToolbar *toolbar);
// Description:
// Get the n-th toolbar, and the number of toolbars.
virtual vtkKWToolbar* GetNthToolbar(int rank);
virtual int GetNumberOfToolbars();
// Description:
// Remove a toolbar (or all) from the set.
// Return 1 on success, 0 otherwise.
virtual int RemoveToolbar(vtkKWToolbar *toolbar);
virtual void RemoveAllToolbars();
// Description:
// Set/Get the aspect of the toolbar (flat or 3D GUI style, or unchanged)
// Important: this will *not* override the toolbar aspect of a toolbar
// which aspect was already set to 'UnChanged'.
virtual void SetToolbarsAspect(int);
// Description:
// Set/Get the aspect of the widgets (flat, 3D GUI style, or unchanged)
// Important: this will *not* override the widgets aspect of a toolbar
// which widgets aspect was already set to 'UnChanged'.
virtual void SetToolbarsWidgetsAspect(int);
// Description:
// Set the visibility of a toolbar.
virtual void HideToolbar(vtkKWToolbar *toolbar);
virtual void ShowToolbar(vtkKWToolbar *toolbar);
virtual void SetToolbarVisibility(vtkKWToolbar *toolbar, int flag);
virtual int GetToolbarVisibility(vtkKWToolbar *toolbar);
virtual void ToggleToolbarVisibility(vtkKWToolbar *toolbar);
// Description:
// Return the number of visible toolbars
virtual int GetNumberOfVisibleToolbars();
// Description:
// Set a toolbar's anchor. By default, toolbars are packed from left
// to right in the order they were added to the toolbar set, i.e. each
// toolbar is "anchored" to the west side of the set. One can change
// this anchor on a per-toolbar basis. This means that all toolbars anchored
// to the west side will be grouped together on that side, and all toolbars
// anchored to the east side will be grouped on the opposite side. Note
// though that anchoring acts like a "mirror": packing starts from the
// anchor side, progressing towards the middle of the toolbar set (i.e.,
// toolbars anchored west are packed left to right, toolbars anchored east
// are packed right to left, following the order they were inserted in
// the set).
//BTX
enum
{
ToolbarAnchorWest = 0,
ToolbarAnchorEast
};
//ETX
virtual void SetToolbarAnchor(vtkKWToolbar *toolbar, int anchor);
virtual int GetToolbarAnchor(vtkKWToolbar *toolbar);
virtual void SetToolbarAnchorToWest(vtkKWToolbar *toolbar)
{ this->SetToolbarAnchor(toolbar, vtkKWToolbarSet::ToolbarAnchorWest); };
virtual void SetToolbarAnchorToEast(vtkKWToolbar *toolbar)
{ this->SetToolbarAnchor(toolbar, vtkKWToolbarSet::ToolbarAnchorEast); };
// Description:
// Save/Restore the visibility flag of one/all toolbars to/from the registry
// Note that the name of each toolbar to save/restore should have been set
// for this method to work (see vtkKWToolbar).
virtual void SaveToolbarVisibilityToRegistry(vtkKWToolbar *toolbar);
virtual void RestoreToolbarVisibilityFromRegistry(vtkKWToolbar *toolbar);
virtual void SaveToolbarsVisibilityToRegistry();
virtual void RestoreToolbarsVisibilityFromRegistry();
// Description:
// Set/Get if the visibility flag of the toolbars should be saved
// or restored to the registry automatically.
// It is restored when the toolbar is added, and saved when the visibility
// flag is changed.
vtkBooleanMacro(SynchronizeToolbarsVisibilityWithRegistry, int);
vtkGetMacro(SynchronizeToolbarsVisibilityWithRegistry, int);
vtkSetMacro(SynchronizeToolbarsVisibilityWithRegistry, int);
// Description:
// Create and update a menu that can be used to control the visibility of
// all toolbars.
// The Populate...() method will repopulate the menu (note that it does
// *not* remove all entries, so that this menu can be used for several
// toolbar sets).
// The Update...() method will update the state of the entries according
// to the toolbarsvisibility (the first one will call the second one
// automatically).
virtual void PopulateToolbarsVisibilityMenu(vtkKWMenu *menu);
virtual void UpdateToolbarsVisibilityMenu(vtkKWMenu *menu);
// Description:
// Specifies a command to associate with the widget. This command is
// typically invoked when the visibility of a toolbar is changed.
// The 'object' argument is the object that will have the method called on
// it. The 'method' argument is the name of the method to be called and any
// arguments in string form. If the object is NULL, the method is still
// evaluated as a simple command.
// The following parameters are also passed to the command:
// - pointer to the toolbar which visibility changed: vtkKWToolbar*
virtual void SetToolbarVisibilityChangedCommand(
vtkObject *object, const char *method);
// Description:
// Specifies a command to associate with the widget. This command is
// typically invoked when the number of toolbars has changed
// (i.e. a toolbar is added or removed).
// The 'object' argument is the object that will have the method called on
// it. The 'method' argument is the name of the method to be called and any
// arguments in string form. If the object is NULL, the method is still
// evaluated as a simple command.
virtual void SetNumberOfToolbarsChangedCommand(
vtkObject *object, const char *method);
// Description:
// Set/Get the visibility of the separator at the bottom of the set
virtual void SetBottomSeparatorVisibility(int);
vtkBooleanMacro(BottomSeparatorVisibility, int);
vtkGetMacro(BottomSeparatorVisibility, int);
// Description:
// Set/Get the visibility of the separator at the top of the set
virtual void SetTopSeparatorVisibility(int);
vtkBooleanMacro(TopSeparatorVisibility, int);
vtkGetMacro(TopSeparatorVisibility, int);
// Description:
// Update the toolbar set
// (update the enabled state of all toolbars, call PackToolbars(), etc.).
virtual void Update();
// Description:
// (Re)Pack the toolbars, if needed (if the widget is created, and the
// toolbar is created, AddToolbar will pack the toolbar automatically).
virtual void Pack();
// Description:
// Update the "enable" state of the object and its internal parts.
// Depending on different Ivars (this->Enabled, the application's
// Limited Edition Mode, etc.), the "enable" state of the object is updated
// and propagated to its internal parts/subwidgets. This will, for example,
// enable/disable parts of the widget UI, enable/disable the visibility
// of 3D widgets, etc.
virtual void UpdateEnableState();
protected:
vtkKWToolbarSet();
~vtkKWToolbarSet();
// Description:
// Create the widget.
virtual void CreateWidget();
vtkKWSeparator *TopSeparator;
vtkKWFrame *ToolbarsFrame;
vtkKWSeparator *BottomSeparator;
int BottomSeparatorVisibility;
int TopSeparatorVisibility;
int SynchronizeToolbarsVisibilityWithRegistry;
char *ToolbarVisibilityChangedCommand;
char *NumberOfToolbarsChangedCommand;
virtual void InvokeToolbarVisibilityChangedCommand(
vtkKWToolbar *toolbar);
virtual void InvokeNumberOfToolbarsChangedCommand();
//BTX
// A toolbar slot stores a toolbar + some infos
class ToolbarSlot
{
public:
int Visibility;
int Anchor;
vtkKWSeparator *Separator;
vtkKWToolbar *Toolbar;
};
// PIMPL Encapsulation for STL containers
vtkKWToolbarSetInternals *Internals;
friend class vtkKWToolbarSetInternals;
// Helper methods
ToolbarSlot* GetToolbarSlot(vtkKWToolbar *toolbar);
//ETX
virtual void PackToolbars();
virtual void PackBottomSeparator();
virtual void PackTopSeparator();
private:
vtkKWToolbarSet(const vtkKWToolbarSet&); // Not implemented
void operator=(const vtkKWToolbarSet&); // Not implemented
};
#endif
|