Simple SFML GUI  0.2a
GUIInspectorApp.hpp
1 #ifndef GUIINSPECTORAPP_HPP
2 #define GUIINSPECTORAPP_HPP
3 
4 #include <SFML/Graphics.hpp>
5 #include "PanelSplitted.hpp"
6 #include "TextInput.hpp"
7 #include "Button.hpp"
8 #include "InspectedNode.hpp"
9 
10 typedef std::set<const Element*> SetGE;
11 typedef std::set<const DestructionNotifier*> SetDN;
12 typedef std::vector<std::pair<const Element*, const sf::RenderWindow*>> InspectedVec;
13 
15 private:
16  virtual void notifyDestruction(const DestructionNotifier* ptr);
17 
18 public:
19  bool refreshTree;
20  InspectedVec inspectedElements;
21 
23 };
24 
26 public:
28  void update(sf::RenderWindow& target);
29  void draw(sf::RenderWindow& target, const sf::RenderStates& states = sf::RenderStates());
30  void setRefreshTree();
31  void clear();
32  void inspect(const Element* ptr, const sf::RenderWindow* target=nullptr);
33  void registerConfigVar();
34  void loadVisibleButtonsState();
35 
36 private:
37  std::map<const Element*, ButtonPtr> inspectedButtons;
38  std::map<sf::String, ButtonPtr> visibleInfoButtons;
39  std::string visibleInfoButtonsState;
40  SetDN allNodes;
41  SetGE openedNodes;
42  SetGE observedNodes;
43  SetGE hoveredNodes;
44  SetGE pressedNodes;
45  SetGE focusedNodes;
46 
47  PanelSplittedPtr mainPanel;
48  PanelSplittedPtr leftSplitted;
49  PanelSplittedPtr rightSplitted;
50  PanelSplittedScrolledPtr secondRightSplitted;
51  PanelScrolledPtr nodesPanel;
52  TextInputPtr filterInput;
53  ButtonPtr clearFilter;
54  ButtonPtr rebuildTree;
55  ButtonPtr showObserved;
56  ButtonPtr showHovered;
57  ButtonPtr showPressed;
58  ButtonPtr showFocused;
59  ButtonPtr openAllNodes;
60  sf::String filterString;
61  InspectedNode inspectedTree;
62  InspectorDestructionObserver destructionObserver;
63 
64  void eventsHandle(sf::RenderWindow& target);
65  void initMainPanel();
66  void updateNodesInfo();
67  void updateInspectedTree();
68  void updateVisibleNodes();
69  void recurrentVisibleNodes(const InspectedNode& node, bool closedParent = false);
70  void recurrentNodeInfo(const InspectedNode& node);
71  void initNodesPanel();
72  void initLeftSplitted();
73  void initRightSplitted();
74  void initInfoHeaders();
75  void initOpenAllNodes();
76  void initVisibleInfoButtons();
77  sf::String elementDescription(const Element* element);
78  void debugRectangle(const InspectedNode&);
79  void revalidateObservedNodes();
80  void handleNodeButtonSymbol(const Element* element);
81 };
82 
83 #endif // GUIINSPECTORAPP_HPP
Definition: DestructionNotifier.hpp:6
Definition: GUIInspectorApp.hpp:14
Definition: DestructionObserver.hpp:6
Definition: Element.hpp:22
Definition: InspectedNode.hpp:6
Definition: GUIInspectorApp.hpp:25