#pragma once #include "Gui/GuiEvent.h" #include "V8DataModel/InputObject.h" #include "GuiBase.h" #include "V8DataModel/GuiBase2d.h" #include namespace RBX { class Instance; class Adorn; class GuiObject; extern const char* const sLayerCollector; // Controls the rendering order of GUI elements class GuiLayerCollector : public DescribedNonCreatable { protected: GuiLayerCollector(const char* name); public: ~GuiLayerCollector(); //////////////////////////////////////////////////////////////////////////////////// // // GuiTarget /*override*/ GuiResponse process(const shared_ptr& event, bool sinkIfMouseOver = true); /*override*/ GuiResponse processGesture(const UserInputService::Gesture& gesture, const shared_ptr& touchPositions, const shared_ptr& args); void render2d(Adorn* adorn); void render2dContext(Adorn* adorn, const Instance* context); /*override*/ void onDescendantAdded(Instance* instance); /*override*/ void onDescendantRemoving(const shared_ptr& instance); void getGuiObjectsForSelection(std::vector& guiObjects); private: typedef DescribedNonCreatable Super; typedef std::vector > GuiVector; typedef std::vector GuiLayers; bool rebuildGuiVector; static void LoadZ(const shared_ptr& instance, GuiLayers guiVectors[]); void loadZVectors(); void tryReleaseLastButtonDown(const shared_ptr& event); GuiResponse processDescendants(const shared_ptr& event); GuiResponse doProcessGesture(const boost::shared_ptr& guiBase, const UserInputService::Gesture& gesture, const shared_ptr& touchPositions, const shared_ptr& args); void render2dStandardGuiElements(Adorn* adorn, const Instance* context, GuiVector& batch, const Rect2D& viewport); void render2dTextGuiElements(Adorn* adorn, const Instance* context, GuiVector& batch, const Rect2D& viewport); void descendantPropertyChanged(const shared_ptr& gb, const Reflection::PropertyDescriptor* descriptor); GuiLayers mGuiVectors[RBX::GUIQUEUE_COUNT]; // temp arrays for rendering - never realloc, always fast clear boost::unordered_map propertyConnections; }; }