You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ovdCBoxProxy.h 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #include "ovd_base.h"
  3. #include <string>
  4. namespace OpenViBE {
  5. namespace Designer {
  6. class CBoxProxy final
  7. {
  8. public:
  9. CBoxProxy(const Kernel::IKernelContext& ctx, Kernel::IScenario& scenario, const CIdentifier& boxID);
  10. ~CBoxProxy() { if (!m_applied) { this->apply(); } }
  11. operator Kernel::IBox*() const { return m_box; }
  12. operator const Kernel::IBox*() const { return m_constBox; }
  13. int getWidth(GtkWidget* widget) const;
  14. int getHeight(GtkWidget* widget) const;
  15. int getXCenter() const { return m_centerX; }
  16. int getYCenter() const { return m_centerY; }
  17. void setCenter(int x, int y);
  18. void setBoxAlgorithmDescriptorOverride(const Plugins::IBoxAlgorithmDesc* pBoxAlgorithmDescriptor);
  19. void apply();
  20. const char* getLabel() const;
  21. const char* getStatusLabel() const;
  22. bool isBoxAlgorithmPluginPresent() const { return m_isBoxAlgorithmPresent; }
  23. bool isUpToDate() const { return !m_box->hasAttribute(OV_AttributeId_Box_ToBeUpdated); }
  24. bool hasPendingDeprecatedInterfacors() const { return m_box->hasAttribute(OV_AttributeId_Box_PendingDeprecatedInterfacors); }
  25. bool isDeprecated() const { return m_isDeprecated; }
  26. static bool isUnstable() { return false; }
  27. bool isDisabled() const;
  28. bool isMetabox() const { return m_constBox->getAlgorithmClassIdentifier() == OVP_ClassId_BoxAlgorithm_Metabox; }
  29. protected:
  30. void updateSize(GtkWidget* widget, const char* label, const char* status, int* xSize, int* ySize) const;
  31. const Kernel::IKernelContext& m_kernelCtx;
  32. const Plugins::IBoxAlgorithmDesc* m_boxAlgorithmDescOverride = nullptr;
  33. const Kernel::IBox* m_constBox = nullptr;
  34. Kernel::IBox* m_box = nullptr;
  35. bool m_applied = false;
  36. bool m_showOriginalNameWhenModified = false;
  37. int m_centerX = 0;
  38. int m_centerY = 0;
  39. mutable std::string m_label;
  40. mutable std::string m_status;
  41. bool m_isBoxAlgorithmPresent = false;
  42. bool m_isDeprecated = false;
  43. };
  44. } // namespace Designer
  45. } // namespace OpenViBE