#include <ShapeUpAPI.h>
Inheritance diagram for SUWorkspace:
Public Member Functions | |
SUWorkspace () | |
SUWorkspace (SUHANDLE hWorkspace) | |
SUMap | GetMapWindow () |
size_t | GetThemeCount () const |
SUTheme | GetTheme (size_t index) |
SUTheme | GetSelectedTheme () |
SURecordset | GetSelectedThemes () |
size_t | GetSelectionCount () |
SUTheme | CreateNewTheme (ShapeType type, const char *name) |
SUTheme | CreateNewThemeFromSelection (SUTheme source, const char *name) |
bool | BrowseTheme (const char *title, SUTheme &theme) |
void | GetBounds (SURectf &r) |
void | Log (const char *line) |
bool | IsActive () |
void | Refresh () |
SUJavaScript | LoadJavaScript (const char *file) |
std::string | GetComment () |
void | SetComment (const char *comment) |
bool | RemoveTheme (SUTheme theme) |
void | SetSerialData (size_t byteCount, const void *bytes) |
SUHANDLE | AddDataPage (const char *name) |
void | ClearSelection () |
Most hook functions supply a handle to the active workspace, or the workspace where the action takes place. These workspaces are not necessarily the same!
You may always query ShapeUp for workspaces using the ShapeUp_GetWorkspaceCount(), ShapeUp_GetWorkspace() and ShapeUp_GetActiveWorkspace() API functions.
example_loadergpi.cpp, example_sudatapage.cpp, and example_sutoolbar.cpp.
SUWorkspace::SUWorkspace | ( | ) | [inline] |
Default constructor.
SUWorkspace::SUWorkspace | ( | SUHANDLE | hWorkspace | ) | [inline] |
Constructor.
hWorkspace | is a handle to a ShapeUp workspace. |
SUMap SUWorkspace::GetMapWindow | ( | ) | [inline] |
Queries the workspace for its map window.
size_t SUWorkspace::GetThemeCount | ( | ) | const [inline] |
Retrieves the number of themes currently in this workspace.
SUTheme SUWorkspace::GetTheme | ( | size_t | index | ) | [inline] |
Retrieves a theme in this workspace.
index | is the zero-based index of the theme to retrieve, where 0 is the topmost layer. |
SUTheme SUWorkspace::GetSelectedTheme | ( | ) | [inline] |
Queries ShapeUp for a single selected theme in this workspace.
SURecordset SUWorkspace::GetSelectedThemes | ( | ) | [inline] |
Queries ShapeUp for the selected themes in this workspace.
size_t SUWorkspace::GetSelectionCount | ( | ) | [inline] |
Returns the number of selected themes in this workspace.
SUTheme SUWorkspace::CreateNewTheme | ( | ShapeType | type, | |
const char * | name | |||
) | [inline] |
Creates a new theme of specified sort in this workspace.
type | is the type of objects this theme should contain. | |
name | is a null-terminated string used as the themes initial name. This parameter might be NULL to get default naming. |
Creates a new theme based on the selection in a source theme in this workspace.
source | is the theme containing selected shapes to be copied. | |
name | is a null-terminated string used as the themes initial name. This parameter might be NULL to get default naming. |
bool SUWorkspace::BrowseTheme | ( | const char * | title, | |
SUTheme & | theme | |||
) | [inline] |
Opens the Browse Theme dialog, and lets the user select a theme.
title | is the title of this dialog. If NULL, the title will default to "Select Theme" | |
theme | [out] is an SUTheme that will receive the selected theme. |
void SUWorkspace::GetBounds | ( | SURectf & | r | ) | [inline] |
Gets the workspace's bounding box.
r | [out] is a rectangle that will receive the aggregated bounds of all themes. |
void SUWorkspace::Log | ( | const char * | line | ) | [inline] |
Writes a line of text to the console window of this workspace.
line | is the text to be written. |
bool SUWorkspace::IsActive | ( | ) | [inline] |
Retrieves the active state of this workspace.
void SUWorkspace::Refresh | ( | ) | [inline] |
Forces the workspace to repaint all components.
SUJavaScript SUWorkspace::LoadJavaScript | ( | const char * | file | ) | [inline] |
Loads a JavaScript from file.
file | is the name of the JavaScript file to load. If no absolute path is given, the script will be searched for relative the ShapeUp Scripts sub-directory. |
std::string SUWorkspace::GetComment | ( | ) | [inline] |
Gets the workspace comment found in the workspace properties dialog.
void SUWorkspace::SetComment | ( | const char * | comment | ) | [inline] |
Sets the workspace comment found in the workspace properties dialog.
comment | is the new workspace comment. |
bool SUWorkspace::RemoveTheme | ( | SUTheme | theme | ) | [inline] |
Removes a theme from a workspace.
theme | is the SUHANDLE to the theme to remove. |
void SUWorkspace::SetSerialData | ( | size_t | byteCount, | |
const void * | bytes | |||
) | [inline] |
Sets data to be serialized with a workspace. This function can be called at any time setting new data. However, when this function is called, any old data is discarded and fully replaced with the new.
This data can later be restored from a ShapeUp workspace file when it is loaded, if the plug-in has set up a deserialize hook using the ShapeUp_AddDeserializeHook call.
byteCount | is the size of the bytes array. | |
bytes | is a pointer to a byte sequence containing the data to be serialized. |
SUHANDLE SUWorkspace::AddDataPage | ( | const char * | name | ) | [inline] |
Adds a new custom data page to the workspace.
name | is the name for the new data page. |
void SUWorkspace::ClearSelection | ( | ) | [inline] |
Deselects all themes in the workspace.