HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_qt.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_qt_h__
10 #define __HOM_qt_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Module.h"
15 
16 class HOM_LopNode;
17 class HOM_FloatingPanel;
18 class HOM_Node;
19 
20 SWIGOUT(%rename(qt) HOM_qt;)
22 {
23 public:
24  virtual ~HOM_qt()
25  {}
26 
27  virtual std::string __repr__() = 0;
28 
29  virtual void* _mainWindow() = 0;
30  virtual void* _floatingPanelWindow(HOM_FloatingPanel *panel) = 0;
31 
32  virtual void* _createWindow() = 0;
33  virtual void* _createDialog() = 0;
34  virtual void* _createMenu() = 0;
35  virtual void* _createIcon(
36  const char* icon_name, int width, int height,
37  double device_pixel_ratio,
38  const char *accent_color_name, const char *tint_color_name)
39  = 0;
40  virtual bool canCreateIcon(const char *icon_name) = 0;
41  virtual void *_createIconPixmap(
42  const char* icon_name, int size, double device_pixel_ratio,
43  int neutral_tint_r, int neutral_tint_g, int neutral_tint_b,
44  int accent_color_r, int accent_color_g, int accent_color_b) = 0;
45 
46  virtual void* _createParmDialog(HOM_Node *hom_node, bool showTitleBar, bool compact, double labelsize) = 0;
47  virtual void _setParmDialogNode(void *widget, HOM_Node *hom_node) = 0;
48  virtual HOM_Node* _parmDialogNode(void *widget) = 0;
49 
50  virtual std::vector<std::string> _getParmDialogValueNames(void *widget) = 0;
51  virtual std::string _getParmDialogValue(void *widget,const char *name) = 0;
52  virtual bool _setParmDialogValue(void *widget,const char *name, const char* value) = 0;
53  virtual bool _pressParmDialogButton(void *widget,const char *name) = 0;
54 
55  virtual std::vector<std::pair<std::string, std::vector<std::string>>>
56  _getFeelNames(void *widget) = 0;
57  virtual bool _setUIAttribute(void *widget, const char *multiparm,
58  const char *name, const char *value) = 0;
59  virtual std::string _getUIValue(void *widget, const char *multiparm,
60  const char *name) = 0;
61  virtual bool _setUIValue(void *widget, const char *multiparm,
62  const char *name, const char *value) = 0;
63 
64  virtual std::vector<HOM_ElemPtr<HOM_ParmTuple> > _getParmDialogVisibleParms(void *widget) = 0;
65 
66  virtual bool _filterParmDialogFolders(void *widget, const char *pattern) = 0;
67 
68  virtual void* _getColor(const char* color_name) = 0;
69  virtual void* _getCursor(const char *cursor_name) = 0;
70  virtual void* _getBrush(const char* color_name) = 0;
71 
72  virtual std::string styleSheet(const char *file_path=nullptr) = 0;
73 
74  virtual std::map<std::string, int> _qtKeyToUIKey(int qtKey,
75  int qtKeymodifiers) = 0;
76  virtual std::string _qtKeyToString(int qtKey,
77  int qtKeymodifiers,
78  std::string qtkeystring) = 0;
79 
80  virtual HOM_OptionalInt _nativeModifierIndependentKeyCode(
81  int native_scan_code,
82  int native_virtual_key) = 0;
83  virtual bool _hasExtendedKeyEventInfo(int native_key_code) = 0;
84  virtual int _eventKeyIfNoModifiers(int native_key_code) = 0;
85  virtual std::string _eventTextIfNoModifiers(int native_key_code) = 0;
86 
87  SWIGOUT(%ignore _registerOpaqueKeyResolveInfoCallback;)
88  virtual void _registerOpaqueKeyResolveInfoCallback(
89  void *widget,
90  void *py_callback) = 0;
91  SWIGOUT(%ignore _unregisterOpaqueKeyResolveInfoCallback;)
92  virtual void _unregisterOpaqueKeyResolveInfoCallback(
93  void *widget) = 0;
94 
95  SWIGOUT(%ignore _opaqueHotkeyAssignments;)
96  virtual void _opaqueHotkeyAssignments(
97  void *widget,
98  const std::vector<std::string> &hotkey_symbols,
99  std::vector<std::vector<std::string> > &result) = 0;
100 
101 #ifdef SWIG
102 %extend
103 {
104  // TODO: Take an InterpreterObject for the widget and call python to run
105  // hou.qt.__utils__.getCppPointer() on it ourselves?
106  void _registerKeyResolveInfoCallback(int64 widget,
107  InterpreterObject callback)
108  {
109  self->_registerOpaqueKeyResolveInfoCallback(
110  reinterpret_cast<void *>(widget), callback);
111  }
112 
113  void _unregisterKeyResolveInfoCallback(int64 widget)
114  {
115  self->_unregisterOpaqueKeyResolveInfoCallback(
116  reinterpret_cast<void *>(widget));
117  }
118 
119  std::vector<std::vector<std::string> >
120  _hotkeyAssignments(int64 widget,
121  const std::vector<std::string> &hotkey_symbols)
122  {
123  std::vector<std::vector<std::string> > result;
124  self->_opaqueHotkeyAssignments(
125  reinterpret_cast<void *>(widget), hotkey_symbols, result);
126  return result;
127  }
128 }
129 #endif
130 
131  virtual std::string _resolveKeyToCommand(
132  const char *key,
133  const std::vector<std::string> &override_contexts) = 0;
134 
135  virtual void _setDebugKeyEvents(bool on) = 0;
136 
137  virtual double inchesToPixels(double inches) = 0;
138  virtual double pixelsToInches(double pixels) = 0;
139 
140  virtual void skipClosingMenusForCurrentButtonPress() = 0;
141 
142  virtual bool _launchRenderGalleryBackgroundRender(
143  const char *delegate,
144  const char *usd_filepath,
145  const char *rendersettings_prim,
146  const char *override_camera,
147  int override_res_x, int override_res_y,
148  const char *lopnet_path,
149  const char *item_id
150  ) = 0;
151 
152  virtual void _renderGalleryBackgroundRenderMouseClick(
153  int x, int y, const char *lopnet_path,
154  const char *item_id
155  ) = 0;
156 
157  virtual bool _stopRenderGalleryBackgroundRender(
158  const char *lopnet_path,
159  const char *item_id
160  ) = 0;
161 
162  virtual std::string _launchRenderGalleryLiveRender(
163  HOM_LopNode *lop
164  ) = 0;
165  virtual bool _cancelRenderGalleryLiveRender(
166  const char *id
167  ) = 0;
168  virtual bool _pauseRenderGalleryLiveRender(
169  const char *id
170  ) = 0;
171  virtual bool _resumeRenderGalleryLiveRender(
172  const char *id
173  ) = 0;
174 
175  // Supported mime-types for drag-and-drop.
176  virtual std::string _channelPathMimeType() = 0;
177  virtual std::string _chopTrackPathMimeType() = 0;
178  virtual std::string _galleryEntryMimeType() = 0;
179  virtual std::string _galleryEntryNameMimeType() = 0;
180  virtual std::string _itemPathMimeType() = 0;
181  virtual std::string _nodeFlagPathMimeType() = 0;
182  virtual std::string _nodePathMimeType() = 0;
183  virtual std::string _orboltNodeTypeNameMimeType() = 0;
184  virtual std::string _paneTabNameMimeType() = 0;
185  virtual std::string _parmPathMimeType() = 0;
186  virtual std::string _persistentHandleNameMimeType() = 0;
187  virtual std::string _primitivePathMimeType() = 0;
188  virtual std::string _shelfNameMimeType() = 0;
189  virtual std::string _shelfToolNameMimeType() = 0;
190  virtual std::string _takeNameMimeType() = 0;
191  virtual std::string _usdPrimitivePathMimeType() = 0;
192  virtual std::string _usdPrimitivePythonMimeType() = 0;
193  virtual std::string _usdPropertyPathMimeType() = 0;
194  virtual std::string _usdPropertyPythonMimeType() = 0;
195  virtual std::string _nodePathAndUsdPrimitivePathMimeType() = 0;
196  virtual std::string _assetGalleryEntryMimeType() = 0;
197 
198  // If adding a role that reflects a fixed-list of "acceptable values",
199  // you may want to also update __init.py__ (or other files) in
200  // ${PYHOM}/houpythonportion/qt
201  virtual int _galleryNameRole() = 0;
202  virtual int _galleryThumbRole() = 0;
203  virtual int _galleryCreationDateRole() = 0;
204  virtual int _galleryStarRole() = 0;
205  virtual int _galleryDiffMarkerRole() = 0;
206  virtual int _galleryColorRole() = 0;
207  virtual int _galleryTagsRole() = 0;
208  virtual int _galleryThumbValidRole() = 0;
209  virtual int _galleryMetadataRole() = 0;
210  virtual int _gallerySnapshotFileRole() = 0;
211  virtual int _galleryOwnsFileRole() = 0;
212  virtual int _gallerySnapshotRole() = 0;
213  virtual int _galleryRenderMethodRole() = 0;
214  virtual int _galleryRenderingRole() = 0;
215  virtual int _galleryCloneIdRole() = 0;
216 };
217 
218 #endif
virtual ~HOM_qt()
Definition: HOM_qt.h:24
GLsizei const GLfloat * value
Definition: glcorearb.h:824
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:312
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
Definition: glcorearb.h:108
GLint y
Definition: glcorearb.h:103
**But if you need a result
Definition: thread.h:622
Definition: HOM_qt.h:21
GLint GLsizei GLsizei height
Definition: glcorearb.h:103
#define HOM_API
Definition: HOM_API.h:13
void ignore(T const &) VULKAN_HPP_NOEXCEPT
Definition: vulkan.hpp:6508
long long int64
Definition: SYS_Types.h:116
UT_Optional< int > HOM_OptionalInt
Definition: HOM_Defines.h:47
GLuint const GLchar * name
Definition: glcorearb.h:786
GLushort pattern
Definition: glad.h:2583
GLint GLenum GLint x
Definition: glcorearb.h:409
GLsizeiptr size
Definition: glcorearb.h:664
OIIO_UTIL_API bool rename(string_view from, string_view to, std::string &err)
GLint GLsizei width
Definition: glcorearb.h:103