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  SWIGOUT(%newobject paneUnderCursor;)
72  virtual HOM_Pane *paneUnderCursor() = 0;
73  SWIGOUT(%newobject paneTabUnderCursor;)
74  virtual HOM_PaneTab *paneTabUnderCursor() = 0;
75 
76  virtual HOM_EnumValue &orientationUpAxis() = 0;
77 
78  SWIGOUT(%kwargs displayConfirmation;)
79  virtual bool displayConfirmation(
80  const char *text,
81  HOM_EnumValue &severity = HOM_severityType::Message,
82  const char *help = NULL,
83  const char *title = NULL,
84  const char *details = NULL,
85  const char *details_label = NULL,
86  HOM_EnumValue &suppress = HOM_confirmType::OverwriteFile) = 0;
87 
88  SWIGOUT(%kwargs displayMessage;)
89  virtual int displayMessage(
90  const char *text,
91  const std::vector<std::string> &buttons =
92  std::vector<std::string>(1, "OK"),
93  HOM_EnumValue &severity = HOM_severityType::Message,
94  int default_choice = 0,
95  int close_choice = -1,
96  const char *help = NULL,
97  const char *title = NULL,
98  const char *details = NULL,
99  const char *details_label = NULL,
100  bool details_expanded = false) = 0;
101 
102  SWIGOUT(%kwargs readInput;)
103  virtual std::pair<int, std::string> readInput(
104  const char *message,
105  const std::vector<std::string> &buttons =
106  std::vector<std::string>(1, "OK"),
107  HOM_EnumValue &severity = HOM_severityType::Message,
108  int default_choice = 0,
109  int close_choice = -1,
110  const char *help = NULL,
111  const char *title = NULL,
112  const char *initial_contents = NULL) = 0;
113 
114  SWIGOUT(%kwargs readMultiInput;)
115  virtual std::pair<int, std::vector<std::string> > readMultiInput(
116  const char *message,
117  const std::vector<std::string> &input_labels,
118  const std::vector<int> &password_input_indices = std::vector<int>(),
119  const std::vector<std::string> &buttons =
120  std::vector<std::string>(1, "OK"),
121  HOM_EnumValue &severity = HOM_severityType::Message,
122  int default_choice = 0,
123  int close_choice = -1,
124  const char *help = NULL,
125  const char *title = NULL,
126  const std::vector<std::string> &initial_contents =
127  std::vector<std::string>() ) = 0;
128 
129  SWIGOUT(%kwargs selectFromList;)
130  virtual std::vector<int> selectFromList(
131  const std::vector<std::string> &choices,
132  const std::vector<int> &default_choices = std::vector<int>(),
133  bool exclusive = false,
134  const char *message = NULL,
135  const char *title = NULL,
136  const char *column_header = "Choices",
137  int num_visible_rows = 10,
138  bool clear_on_cancel = false) = 0;
139 
140  SWIGOUT(%kwargs selectFromTree;)
141  virtual std::vector<std::string> selectFromTree(
142  const std::vector<std::string> &choices,
143  const std::vector<std::string> &picked = std::vector<std::string>(),
144  bool exclusive = false,
145  const char *message = NULL,
146  const char *title = NULL,
147  bool clear_on_cancel = false) = 0;
148 
149  SWIGOUT(%kwargs selectFile;)
150  virtual std::string selectFile(
151  const char *start_directory = NULL,
152  const char *title = NULL,
153  bool collapse_sequences = false,
154  HOM_EnumValue &file_type = HOM_fileType::Any,
155  const char *pattern = NULL,
156  const char *default_value = NULL,
157  bool multiple_select = false,
158  bool image_chooser = false,
159  HOM_EnumValue &chooser_mode = HOM_fileChooserMode::ReadAndWrite) = 0;
160 
161  SWIGOUT(%kwargs selectNode;)
162  SWIGOUT(%newobject selectNode;)
163  virtual char *selectNode(
164  HOM_Node *relative_to_node = NULL,
165  HOM_Node *initial_node = NULL,
166  HOM_EnumValue *node_type_filter = NULL) = 0;
167 
168  SWIGOUT(%ignore _selectNodeDataInternal;)
169  virtual std::vector<std::string> _selectNodeDataInternal(
170  const char *title = NULL,
171  const char *message = NULL,
172  int width = 0,
173  int height = 0,
174  const std::vector<std::string> &
175  initial_selection = std::vector<std::string>(),
176  HOM_EnumValue *node_type_filter = nullptr,
177  bool multiple_select = false,
178  bool include_data_type_headers = true,
179  bool include_parms=true,
180  bool include_object_transforms=true,
181  bool include_geometry_bounding_boxes=true,
182  bool include_geometry_attributes=true,
183  bool expand_components=true,
184  void *custom_data_callback=nullptr,
185  const char *help_url=nullptr) = 0;
186 
187  SWIGOUT(%kwargs selectParmTag;)
188  virtual std::vector<std::string> selectParmTag() = 0;
189 
190  SWIGOUT(%kwargs selectParm;)
191  virtual std::vector<std::string> selectParm(
192  HOM_NodeTypeCategory *category = NULL,
193  bool bound_parms_only = false,
194  HOM_Node *relative_to_node = NULL,
195  const char *message = NULL,
196  const char *title = NULL,
197  const std::vector<std::string> &
198  initial_parms = std::vector<std::string>(),
199  bool multiple_select = true,
200  bool use_parm_labels = false) = 0;
201 
202  SWIGOUT(%kwargs selectParmTuple;)
203  virtual std::vector<std::string> selectParmTuple(
204  HOM_NodeTypeCategory *category = NULL,
205  bool bound_parms_only = false,
206  HOM_Node *relative_to_node = NULL,
207  const char *message = NULL,
208  const char *title = NULL,
209  const std::vector<std::string> &
210  initial_parm_tuples = std::vector<std::string>(),
211  bool multiple_select = true,
212  bool use_parm_tuple_labels = false) = 0;
213 
214  SWIGOUT(%kwargs selectColor;)
215  SWIGOUT(%newobject selectColor;)
216  virtual HOM_Color *selectColor(HOM_Color *initial_color = NULL) = 0;
217 
218  virtual std::vector<HOM_Color> loadPaletteFile(const char *file) = 0;
219  virtual void savePaletteFile(const char *file,
220  const std::vector<HOM_Color> &colors) = 0;
221 
222  SWIGOUT(%kwargs displayFileDependencyDialog;)
223  virtual hboost::tuple<bool,
224  std::vector<std::pair<HOM_ElemPtr<HOM_Parm>, std::string> > >
225  displayFileDependencyDialog(
226  HOM_Node *rop_node = NULL,
227  const std::vector<std::string> &uploaded_files =
228  std::vector<std::string>(),
229  const std::vector<std::string> &forced_unselected_patterns =
230  std::vector<std::string>(),
231  const char *project_dir_variable="HIP",
232  bool is_standalone=true) = 0;
233 
234  virtual void displayNodeHelp(HOM_NodeType &node_type) = 0;
235  virtual void openTypePropertiesDialog(
236  HOM_Node &node, bool promote_spare_parms=false,
237  bool immediately_save=false) = 0;
238  virtual void openTypePropertiesDialog(
239  HOM_NodeType &node_type, bool promote_spare_parms=false,
240  bool immediately_save=false) = 0;
241 
242  virtual void openRenderDialog(HOM_RopNode &rop) = 0;
243 
244  virtual void openRenameSelectedDialog(HOM_Node &network) = 0;
245 
246  virtual HOM_EnumValue &updateMode() = 0;
247 
248  virtual void setUpdateMode(HOM_EnumValue &mode) = 0;
249  virtual void triggerUpdate() = 0;
250  virtual void reloadViewportColorSchemes() = 0;
251 
252  virtual std::vector<int> _getTabMenuIconSize() = 0;
253 
254  SWIGOUT(%ignore addOpaqueEventLoopCallback;)
255  virtual void addOpaqueEventLoopCallback(void *callback) = 0;
256  SWIGOUT(%ignore removeOpaqueEventLoopCallback;)
257  virtual void removeOpaqueEventLoopCallback(void *callback) = 0;
258  SWIGOUT(%ignore opaqueEventLoopCallbacks;)
259  virtual std::vector<void *> opaqueEventLoopCallbacks() = 0;
260 
261  SWIGOUT(%newobject createDialog;)
262  virtual HOM_Dialog *createDialog(const char *ui_file_name) = 0;
263  SWIGOUT(%newobject findDialog;)
264  virtual HOM_Dialog *findDialog(const char *ui_file_name) = 0;
265  virtual std::vector<HOM_ElemPtr<HOM_Dialog> > dialogs() = 0;
266 
267  SWIGOUT(%ignore opaqueWaitUntil;)
268  virtual void opaqueWaitUntil(void *condition_callback) = 0;
269 
270  SWIGOUT(%kwargs writePythonShellHistoryFile;)
271  virtual void writePythonShellHistoryFile(const char *filename=NULL) = 0;
272 
273  SWIGOUT(%kwargs readPythonShellHistoryFile;)
274  virtual void readPythonShellHistoryFile(const char *filename=NULL) = 0;
275 
276  SWIGOUT(%kwargs setStatusMessage;)
277  virtual void setStatusMessage(
278  const char *message,
279  HOM_EnumValue &severity=HOM_severityType::Message) = 0;
280 
281  virtual void openAssetUploadDialog(
282  HOM_Node *uploading_node, const char *session_key,
283  HOM_Node *containing_node) = 0;
284 
285  virtual void openAssetDependenciesDialog(
286  const std::vector<HOM_Node *> &uploading_nodes,
287  const std::vector<HOM_Node *> &uploaded_nodes,
288  const char *session_key,
289  HOM_Node *containing_node) = 0;
290 
291  virtual bool hasDragSourceData(const char *label) = 0;
292  virtual HOM_DDSourceAny getDragSourceData(const char *label, int index) = 0;
293 
294  virtual std::string resourceValueFromName(const char *name) = 0;
295  virtual HOM_Color colorFromName(const char *name) = 0;
296 
297  virtual double globalScaleFactor() = 0;
298  virtual int scaledSize(int size) = 0;
299 
300  virtual double inchesToPixels(double inches) = 0;
301  virtual double pixelsToInches(double pixels) = 0;
302 
303  virtual void copyTextToClipboard(const char *text) = 0;
304  virtual std::string getTextFromClipboard() = 0;
305 
306  virtual std::vector<std::string> hotkeys(const char *hotkey_symbol) = 0;
307  virtual std::string hotkeyDescription(const char *hotkey_symbol) = 0;
308  virtual bool isKeyMatch(const char *key, const char *hotkey_symbol) = 0;
309 
310  virtual void openCaptureWeightSpreadsheet(HOM_Node *node,
311  const char *pattern = NULL) = 0;
312 
313 #ifdef SWIG
314 %extend
315 {
316  SWIGOUT(%kwargs _selectNodeData;)
317  std::vector<std::string> _selectNodeData(
318  const char *title = NULL,
319  const char *message = NULL,
320  int width = 0,
321  int height = 0,
322  const std::vector<std::string> &
323  initial_selection = std::vector<std::string>(),
324  HOM_EnumValue *node_type_filter = nullptr,
325  bool multiple_select = false,
326  bool include_data_type_headers = true,
327  bool include_parms=true,
328  bool include_object_transforms=true,
329  bool include_geometry_bounding_boxes=true,
330  bool include_geometry_attributes=true,
331  bool expand_components=true,
332  InterpreterObject custom_data_callback=nullptr,
333  const char *help_url=nullptr)
334  {
335  if (custom_data_callback && custom_data_callback == Py_None)
336  custom_data_callback = nullptr;
337 
338  return self->_selectNodeDataInternal(
339  title,
340  message,
341  width,
342  height,
343  initial_selection,
344  node_type_filter,
345  multiple_select,
346  include_data_type_headers,
347  include_parms,
348  include_object_transforms,
349  include_geometry_bounding_boxes,
350  include_geometry_attributes,
351  expand_components,
352  custom_data_callback,
353  help_url
354  );
355  }
356 
357  void addEventLoopCallback(InterpreterObject callback)
358  { self->addOpaqueEventLoopCallback(callback); }
359 
360  void removeEventLoopCallback(InterpreterObject callback)
361  { self->removeOpaqueEventLoopCallback(callback); }
362 
363  // Note that we return a vector of borrowed references because swig
364  // will increment the reference counts.
365  std::vector<InterpreterObject> eventLoopCallbacks()
366  {
367  std::vector<void *> opaque_callbacks(self->opaqueEventLoopCallbacks());
368 
369  std::vector<InterpreterObject> callbacks;
370  for (int i=0; i< opaque_callbacks.size(); ++i)
371  callbacks.push_back((InterpreterObject)opaque_callbacks[i]);
372  return callbacks;
373  }
374 
375  void waitUntil(InterpreterObject callback)
376  { self->opaqueWaitUntil(callback); }
377 }
378 #endif
379 
380 };
381 
382 #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