HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HOM_ui.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * COMMENTS:
7  */
8 
9 #ifndef __HOM_ui_h__
10 #define __HOM_ui_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Module.h"
15 #include "HOM_Attrib.h"
16 #include "HOM_EnumValue.h"
17 #include "HOM_EnumModules.h"
18 #include "HOM_Color.h"
19 #include "HOM_Errors.h"
20 #include <vector>
21 #include <hboost/tuple/tuple.hpp>
22 
23 class HOM_ShellIO;
24 class HOM_Desktop;
25 class HOM_Pane;
26 class HOM_PaneTab;
27 class HOM_FloatingPanel;
28 class HOM_NodeType;
29 class HOM_Node;
30 class HOM_RadialMenu;
31 class HOM_RopNode;
32 class HOM_Dialog;
33 
34 SWIGOUT(%rename(ui) HOM_ui;)
36 {
37 public:
38  virtual ~HOM_ui()
39  {}
40 
41  virtual std::string __repr__() = 0;
42 
43  virtual HOM_ShellIO &shellIO() = 0;
44 
45  SWIGOUT(%newobject curDesktop;)
46  virtual HOM_Desktop* curDesktop() = 0;
47  SWIGOUT(%newobject desktop;)
48  virtual HOM_Desktop* desktop(const char *name) = 0;
49 
50  virtual std::vector<HOM_ElemPtr<HOM_Desktop> > desktops() = 0;
51 
52  virtual HOM_RadialMenu* radialMenu(const std::string &name) = 0;
53  virtual std::vector<HOM_ElemPtr<HOM_RadialMenu> > radialMenus() = 0;
54  virtual HOM_RadialMenu* createRadialMenu(const std::string &name,
55  const char *label) = 0;
56 
57  virtual std::vector<HOM_ElemPtr<HOM_PaneTab> > paneTabs() = 0;
58 
59  virtual std::vector<HOM_ElemPtr<HOM_PaneTab> > currentPaneTabs() = 0;
60 
61  SWIGOUT(%newobject paneTabOfType;)
62  virtual HOM_PaneTab *paneTabOfType(HOM_EnumValue &type, int index=0) = 0;
63 
64  SWIGOUT(%newobject findPaneTab;)
65  virtual HOM_PaneTab *findPaneTab(const char *name) = 0;
66 
67  virtual std::vector<HOM_ElemPtr<HOM_PaneTab> > floatingPaneTabs() = 0;
68 
69  virtual std::vector<HOM_ElemPtr<HOM_FloatingPanel> > floatingPanels() = 0;
70 
71  virtual HOM_EnumValue &orientationUpAxis() = 0;
72 
73  SWIGOUT(%kwargs displayConfirmation;)
74  virtual bool displayConfirmation(
75  const char *text,
76  HOM_EnumValue &severity = HOM_severityType::Message,
77  const char *help = NULL,
78  const char *title = NULL,
79  const char *details = NULL,
80  const char *details_label = NULL,
81  HOM_EnumValue &suppress = HOM_confirmType::OverwriteFile) = 0;
82 
83  SWIGOUT(%kwargs displayMessage;)
84  virtual int displayMessage(
85  const char *text,
86  const std::vector<std::string> &buttons =
87  std::vector<std::string>(1, "OK"),
88  HOM_EnumValue &severity = HOM_severityType::Message,
89  int default_choice = 0,
90  int close_choice = -1,
91  const char *help = NULL,
92  const char *title = NULL,
93  const char *details = NULL,
94  const char *details_label = NULL,
95  bool details_expanded = false) = 0;
96 
97  SWIGOUT(%kwargs readInput;)
98  virtual std::pair<int, std::string> readInput(
99  const char *message,
100  const std::vector<std::string> &buttons =
101  std::vector<std::string>(1, "OK"),
102  HOM_EnumValue &severity = HOM_severityType::Message,
103  int default_choice = 0,
104  int close_choice = -1,
105  const char *help = NULL,
106  const char *title = NULL,
107  const char *initial_contents = NULL) = 0;
108 
109  SWIGOUT(%kwargs readMultiInput;)
110  virtual std::pair<int, std::vector<std::string> > readMultiInput(
111  const char *message,
112  const std::vector<std::string> &input_labels,
113  const std::vector<int> &password_input_indices = std::vector<int>(),
114  const std::vector<std::string> &buttons =
115  std::vector<std::string>(1, "OK"),
116  HOM_EnumValue &severity = HOM_severityType::Message,
117  int default_choice = 0,
118  int close_choice = -1,
119  const char *help = NULL,
120  const char *title = NULL,
121  const std::vector<std::string> &initial_contents =
122  std::vector<std::string>() ) = 0;
123 
124  SWIGOUT(%kwargs selectFromList;)
125  virtual std::vector<int> selectFromList(
126  const std::vector<std::string> &choices,
127  const std::vector<int> &default_choices = std::vector<int>(),
128  bool exclusive = false,
129  const char *message = NULL,
130  const char *title = NULL,
131  const char *column_header = "Choices",
132  int num_visible_rows = 10,
133  bool clear_on_cancel = false) = 0;
134 
135  SWIGOUT(%kwargs selectFromTree;)
136  virtual std::vector<std::string> selectFromTree(
137  const std::vector<std::string> &choices,
138  const std::vector<std::string> &picked = std::vector<std::string>(),
139  bool exclusive = false,
140  const char *message = NULL,
141  const char *title = NULL,
142  bool clear_on_cancel = false) = 0;
143 
144  SWIGOUT(%kwargs selectFile;)
145  virtual std::string selectFile(
146  const char *start_directory = NULL,
147  const char *title = NULL,
148  bool collapse_sequences = false,
149  HOM_EnumValue &file_type = HOM_fileType::Any,
150  const char *pattern = NULL,
151  const char *default_value = NULL,
152  bool multiple_select = false,
153  bool image_chooser = false,
154  HOM_EnumValue &chooser_mode = HOM_fileChooserMode::ReadAndWrite) = 0;
155 
156  SWIGOUT(%kwargs selectNode;)
157  SWIGOUT(%newobject selectNode;)
158  virtual char *selectNode(
159  HOM_Node *relative_to_node = NULL,
160  HOM_Node *initial_node = NULL,
161  HOM_EnumValue *node_type_filter = NULL) = 0;
162 
163  SWIGOUT(%ignore _selectNodeDataInternal;)
164  virtual std::vector<std::string> _selectNodeDataInternal(
165  const char *title = NULL,
166  const char *message = NULL,
167  int width = 0,
168  int height = 0,
169  const std::vector<std::string> &
170  initial_selection = std::vector<std::string>(),
171  HOM_EnumValue *node_type_filter = nullptr,
172  bool multiple_select = false,
173  bool include_data_type_headers = true,
174  bool include_parms=true,
175  bool include_object_transforms=true,
176  bool include_geometry_bounding_boxes=true,
177  bool include_geometry_attributes=true,
178  bool expand_components=true,
179  void *custom_data_callback=nullptr,
180  const char *help_url=nullptr) = 0;
181 
182  SWIGOUT(%kwargs selectParmTag;)
183  virtual std::vector<std::string> selectParmTag() = 0;
184 
185  SWIGOUT(%kwargs selectParm;)
186  virtual std::vector<std::string> selectParm(
187  HOM_NodeTypeCategory *category = NULL,
188  bool bound_parms_only = false,
189  HOM_Node *relative_to_node = NULL,
190  const char *message = NULL,
191  const char *title = NULL,
192  const std::vector<std::string> &
193  initial_parms = std::vector<std::string>(),
194  bool multiple_select = true,
195  bool use_parm_labels = false) = 0;
196 
197  SWIGOUT(%kwargs selectParmTuple;)
198  virtual std::vector<std::string> selectParmTuple(
199  HOM_NodeTypeCategory *category = NULL,
200  bool bound_parms_only = false,
201  HOM_Node *relative_to_node = NULL,
202  const char *message = NULL,
203  const char *title = NULL,
204  const std::vector<std::string> &
205  initial_parm_tuples = std::vector<std::string>(),
206  bool multiple_select = true,
207  bool use_parm_tuple_labels = false) = 0;
208 
209  SWIGOUT(%kwargs selectColor;)
210  SWIGOUT(%newobject selectColor;)
211  virtual HOM_Color *selectColor(HOM_Color *initial_color = NULL) = 0;
212 
213  virtual std::vector<HOM_Color> loadPaletteFile(const char *file) = 0;
214  virtual void savePaletteFile(const char *file,
215  const std::vector<HOM_Color> &colors) = 0;
216 
217  SWIGOUT(%kwargs displayFileDependencyDialog;)
218  virtual hboost::tuple<bool,
219  std::vector<std::pair<HOM_ElemPtr<HOM_Parm>, std::string> > >
220  displayFileDependencyDialog(
221  HOM_Node *rop_node = NULL,
222  const std::vector<std::string> &uploaded_files =
223  std::vector<std::string>(),
224  const std::vector<std::string> &forced_unselected_patterns =
225  std::vector<std::string>(),
226  const char *project_dir_variable="HIP",
227  bool is_standalone=true) = 0;
228 
229  virtual void displayNodeHelp(HOM_NodeType &node_type) = 0;
230  virtual void openTypePropertiesDialog(
231  HOM_Node &node, bool promote_spare_parms=false,
232  bool immediately_save=false) = 0;
233  virtual void openTypePropertiesDialog(
234  HOM_NodeType &node_type, bool promote_spare_parms=false,
235  bool immediately_save=false) = 0;
236 
237  virtual void openRenderDialog(HOM_RopNode &rop) = 0;
238 
239  virtual void openRenameSelectedDialog(HOM_Node &network) = 0;
240 
241  virtual HOM_EnumValue &updateMode() = 0;
242 
243  virtual void setUpdateMode(HOM_EnumValue &mode) = 0;
244  virtual void triggerUpdate() = 0;
245  virtual void reloadViewportColorSchemes() = 0;
246 
247  virtual std::vector<int> _getTabMenuIconSize() = 0;
248 
249  SWIGOUT(%ignore addOpaqueEventLoopCallback;)
250  virtual void addOpaqueEventLoopCallback(void *callback) = 0;
251  SWIGOUT(%ignore removeOpaqueEventLoopCallback;)
252  virtual void removeOpaqueEventLoopCallback(void *callback) = 0;
253  SWIGOUT(%ignore opaqueEventLoopCallbacks;)
254  virtual std::vector<void *> opaqueEventLoopCallbacks() = 0;
255 
256  SWIGOUT(%newobject createDialog;)
257  virtual HOM_Dialog *createDialog(const char *ui_file_name) = 0;
258  SWIGOUT(%newobject findDialog;)
259  virtual HOM_Dialog *findDialog(const char *ui_file_name) = 0;
260  virtual std::vector<HOM_ElemPtr<HOM_Dialog> > dialogs() = 0;
261 
262  SWIGOUT(%ignore opaqueWaitUntil;)
263  virtual void opaqueWaitUntil(void *condition_callback) = 0;
264 
265  SWIGOUT(%kwargs writePythonShellHistoryFile;)
266  virtual void writePythonShellHistoryFile(const char *filename=NULL) = 0;
267 
268  SWIGOUT(%kwargs readPythonShellHistoryFile;)
269  virtual void readPythonShellHistoryFile(const char *filename=NULL) = 0;
270 
271  SWIGOUT(%kwargs setStatusMessage;)
272  virtual void setStatusMessage(
273  const char *message,
274  HOM_EnumValue &severity=HOM_severityType::Message) = 0;
275 
276  virtual void openAssetUploadDialog(
277  HOM_Node *uploading_node, const char *session_key,
278  HOM_Node *containing_node) = 0;
279 
280  virtual void openAssetDependenciesDialog(
281  const std::vector<HOM_Node *> &uploading_nodes,
282  const std::vector<HOM_Node *> &uploaded_nodes,
283  const char *session_key,
284  HOM_Node *containing_node) = 0;
285 
286  virtual bool hasDragSourceData(const char *label) = 0;
287  virtual HOM_DDSourceAny getDragSourceData(const char *label, int index) = 0;
288 
289  virtual std::string resourceValueFromName(const char *name) = 0;
290  virtual HOM_Color colorFromName(const char *name) = 0;
291 
292  virtual double globalScaleFactor() = 0;
293  virtual int scaledSize(int size) = 0;
294 
295  virtual double inchesToPixels(double inches) = 0;
296  virtual double pixelsToInches(double pixels) = 0;
297 
298  virtual void copyTextToClipboard(const char *text) = 0;
299  virtual std::string getTextFromClipboard() = 0;
300 
301  virtual std::vector<std::string> hotkeys(const char *hotkey_symbol) = 0;
302  virtual std::string hotkeyDescription(const char *hotkey_symbol) = 0;
303  virtual bool isKeyMatch(const char *key, const char *hotkey_symbol) = 0;
304 
305  virtual void openCaptureWeightSpreadsheet(HOM_Node *node,
306  const char *pattern = NULL) = 0;
307 
308 #ifdef SWIG
309 %extend
310 {
311  SWIGOUT(%kwargs _selectNodeData;)
312  std::vector<std::string> _selectNodeData(
313  const char *title = NULL,
314  const char *message = NULL,
315  int width = 0,
316  int height = 0,
317  const std::vector<std::string> &
318  initial_selection = std::vector<std::string>(),
319  HOM_EnumValue *node_type_filter = nullptr,
320  bool multiple_select = false,
321  bool include_data_type_headers = true,
322  bool include_parms=true,
323  bool include_object_transforms=true,
324  bool include_geometry_bounding_boxes=true,
325  bool include_geometry_attributes=true,
326  bool expand_components=true,
327  InterpreterObject custom_data_callback=nullptr,
328  const char *help_url=nullptr)
329  {
330  return self->_selectNodeDataInternal(
331  title,
332  message,
333  width,
334  height,
335  initial_selection,
336  node_type_filter,
337  multiple_select,
338  include_data_type_headers,
339  include_parms,
340  include_object_transforms,
341  include_geometry_bounding_boxes,
342  include_geometry_attributes,
343  expand_components,
344  custom_data_callback,
345  help_url
346  );
347  }
348 
349  void addEventLoopCallback(InterpreterObject callback)
350  { self->addOpaqueEventLoopCallback(callback); }
351 
352  void removeEventLoopCallback(InterpreterObject callback)
353  { self->removeOpaqueEventLoopCallback(callback); }
354 
355  // Note that we return a vector of borrowed references because swig
356  // will increment the reference counts.
357  std::vector<InterpreterObject> eventLoopCallbacks()
358  {
359  std::vector<void *> opaque_callbacks(self->opaqueEventLoopCallbacks());
360 
361  std::vector<InterpreterObject> callbacks;
362  for (int i=0; i< opaque_callbacks.size(); ++i)
363  callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
364  return callbacks;
365  }
366 
367  void waitUntil(InterpreterObject callback)
368  { self->opaqueWaitUntil(callback); }
369 }
370 #endif
371 
372 };
373 
374 #endif
virtual ~HOM_ui()
Definition: HOM_ui.h:38
GLuint GLsizei const GLchar * label
Definition: glcorearb.h:2544
GLsizei const GLchar *const * string
Definition: glcorearb.h:813
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
Definition: glcorearb.h:107
png_uint_32 i
Definition: png.h:2877
GLsizeiptr size
Definition: glcorearb.h:663
GLint GLsizei width
Definition: glcorearb.h:102
#define HOM_API
Definition: HOM_API.h:13
Definition: HOM_ui.h:35
GLenum GLenum severity
Definition: glcorearb.h:2538
GLuint const GLchar * name
Definition: glcorearb.h:785
GLenum mode
Definition: glcorearb.h:98
GLint GLsizei GLsizei height
Definition: glcorearb.h:102
hboost::any HOM_DDSourceAny
Definition: HOM_Defines.h:42
GLuint GLsizei const GLchar * message
Definition: glcorearb.h:2542
GLuint index
Definition: glcorearb.h:785
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
virtual std::string __repr__()=0