Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*
Copyright (c) 2017 DIVIDE-Studio
Copyright (c) 2009 Ionut Cava

This file is part of DIVIDE Framework.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software
and associated documentation files (the "Software"), to deal in the Software
without restriction,
including without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

*/

#ifndef _DIVIDE_EDITOR_PANEL_MANAGER_H_
#define _DIVIDE_EDITOR_PANEL_MANAGER_H_

#include "Platform/Headers/PlatformDefines.h"
#include "Core/Headers/PlatformContextComponent.h"

namespace Divide {
    namespace Attorney {
        class PanelManagerWidgets;
        class PanelManagerDockedWindows;
    };

    class DockedWindow;
    class TabbedWindow;
    class PanelManagerPane;
    class ResourceCache;
    class PreferencesWindow;
    FWD_DECLARE_MANAGED_CLASS(Texture);
    class PanelManager : public PlatformContextComponent {
        friend class Attorney::PanelManagerWidgets;
        friend class Attorney::PanelManagerDockedWindows;

      protected:
        enum class TextureUsage : U8 {
            Tile = 0,
            Numbers,
            Dock,
            COUNT
        };

        enum class PanelPositions : U8 {
            TOP = 0,
            LEFT,
            RIGHT,
            BOTTOM,
            CENTER,
            COUNT
        };

      public:
        PanelManager(PlatformContext& context);
        ~PanelManager();

        bool saveToFile() const;
        bool loadFromFile();

        //ToDo: Move these to the Tab window manager
        bool saveTabsToFile() const;
        bool loadTabsFromFile();

        void init();
        void destroy();
        void idle();
        void draw(const U64 deltaTime);
        void resize(int w, int h);
        void drawToggleWindows(ImGui::PanelManagerWindowData& wd);
        void setPanelManagerBoundsToIncludeMainMenuIfPresent(int displayX = -1, int displayY = -1);

        inline ImGui::PanelManager& ImGuiPanelManager() { return *_manager; }

        inline bool simulationPauseRequested() const { 
            return _sceneStepCount == 0 && _simulationPaused != nullptr && *_simulationPaused;
        }


      protected:
        float calcMainMenuHeight();

      protected:
        static void drawDockedTabWindows(ImGui::PanelManagerWindowData& wd);

      protected:
        bool* _showCentralWindow;
        bool* _simulationPaused;

        U64 _deltaTime;
        U32 _sceneStepCount;
        stringImpl _saveFile;
        std::array<Texture_ptr, to_base(TextureUsage::COUNT)> _textures;
        std::unique_ptr<ImGui::PanelManager> _manager;

        std::array<std::unique_ptr<TabbedWindow>, to_base(PanelPositions::COUNT)> _tabbedWindows;
        // No center toolbar
        std::array<std::unique_ptr<PanelManagerPane>, to_base(PanelPositions::COUNT) - 1> _toolbars;

     public:
        static vectorImpl<ImGui::TabWindow> s_tabWindows;
        static vectorImpl<DockedWindow*> s_dockedWindows;
        static ResourceCache* s_globalCache;
        static hashMapImpl<U32, Texture_ptr> s_imageEditorCache;
    }; //class PanelManager


    namespace Attorney {
        class PanelManagerWidgets {
          private:
            static ImGui::PanelManager& internalManager(Divide::PanelManager& mgr) {
                return *mgr._manager;
            }

            static void drawDockedTabWindows(ImGui::PanelManagerWindowData& wd) {
                PanelManager::drawDockedTabWindows(wd);
            }

            friend class Divide::TabbedWindow;
            friend class Divide::PanelManagerPane;
        };

        class PanelManagerDockedWindows {
            private:
              static bool* showCentralWindow(Divide::PanelManager& mgr) {
                  return mgr._showCentralWindow;
              }

              friend class Divide::PreferencesWindow;
        };
    };

}; //namespace Divide

#endif //_DIVIDE_EDITOR_PANEL_MANAGER_H_

Commits for Divide-Framework/trunk/Source Code/Editor/Widgets/Headers/PanelManager.h

Diff revisions: vs.
Revision Author Commited Message
1022 Diff Diff IonutCava picture IonutCava Thu 25 Jan, 2018 16:13:30 +0000

[Ionut]
- Editor work: move docked windows to their own classes and files

1009 Diff Diff IonutCava picture IonutCava Sat 30 Dec, 2017 23:42:48 +0000

[Ionut]
- Fix some Profile build errors

989 Diff Diff IonutCava picture IonutCava Fri 01 Dec, 2017 16:10:10 +0000

[Ionut]
- Moved MainMenuBar out of PanelManager and modified it a bit
- Updated Imgui and addons to the latest version
- Added “Step 1 frame” and “Step 60 frames” buttons to the editor (when the simulation is paused, these advance time by the given number of frames only)
- Removed per-scene base camera and added a utility default camera, also used by the editor

976 Diff Diff IonutCava picture IonutCava Sun 19 Nov, 2017 23:10:18 +0000

[Ionut]
- Texture mipmaps are now compute before bind if they need a refresh (to avoid recalculation if they’re not used)
- More work on the editor: cleanup, load/save functionality, etc
- Input scaling: Mouse position is now relative to the scene preview position in editor mode. (the scene preview rect is used to re-map X/Y absolute and relative mouse positions)

975 IonutCava picture IonutCava Thu 16 Nov, 2017 14:49:12 +0000

[Ionut]
- Editor work. Port most of imgui-addons demo2.
- Add Editor render target into which we will render the scene when the editor is on