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
/*
   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 _GUI_CONSOLE_H_
#define _GUI_CONSOLE_H_

#define CEGUI_MAX_INPUT_HISTORY 5

#if !defined(CEGUI_STATIC)
#define CEGUI_STATIC
#endif
#include <CEGUI/CEGUI.h>

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

namespace CEGUI {
class FormattedListboxTextItem;
};

namespace Divide {

class GUI;
class ResourceCache;
class PlatformContext;
class GUIConsoleCommandParser;
/// GUIConsole implementation, CEGUI based, as in the practical tutorial series
class GUIConsole : public PlatformContextComponent {
   public:
    explicit GUIConsole(GUI& parent, PlatformContext& context, ResourceCache& cache);
    ~GUIConsole();

    /// Hide or show the console
    void setVisible(bool visible);
    /// Return true if console is visible, false if is hidden
    bool isVisible();

    void update(const U64 deltaTimeUS);

    /// Add text to the console Window. Uses a text buffer if the console isn't ready for display yet
    void printText(const Console::OutputEntry& entry);

   protected:
    void RegisterHandlers();  //< Register our handler functions
    bool Handle_TextSubmitted(
        const CEGUI::EventArgs& e);  //< Handle when we press Enter after typing
    bool Handle_TextInput(const CEGUI::EventArgs& e);  //< A key is pressed in
                                                       //the console input
                                                       //editbox

   protected:
    friend class GUI;
    void createCEGUIWindow();  //< The function which will load in the CEGUI Window and register event handlers
    // Post the message to the ChatHistory listbox with a white colour default
    void OutputText(const Console::OutputEntry& text);

   protected:
    GUI& _parent;
    /// used to check if the console is ready
    bool _init;
    bool _closing;
    Console::EntryType _lastMsgType;
    CEGUI::String _lastMsg;
    /// pointer to the editBox to reduce typing and casting
    CEGUI::Editbox* _editBox;
    /// pointer to the listbox that will contain all of the text we output to
    /// the console
    CEGUI::Listbox* _outputWindow;
    /// pointer to the command parser instance used
    GUIConsoleCommandParser* _cmdParser;
    /// This will be a pointer to the ConsoleRoot Window.
    CEGUI::Window* _consoleWindow;
    /// Used to check the text we are typing so that we don't close the console
    /// in the middle of a sentence/command
    CEGUI::String _inputBuffer;
    /// Used to manage the input history
    std::deque<CEGUI::String> _inputHistory;
    /// Used to cycle through history
    I16 _inputHistoryIndex;
    
    SharedLock _outputLock;
    boost::circular_buffer<Console::OutputEntry> _outputBuffer;

    size_t _consoleCallbackIndex;
};

};  // namespace Divide

#endif

Commits for Divide-Framework/trunk/Source Code/GUI/Headers/GUIConsole.h

Diff revisions: vs.
Revision Author Commited Message
1004 Diff Diff IonutCava picture IonutCava Wed 20 Dec, 2017 17:16:32 +0000

[Ionut]
- More GUI cleanup (added multiple GUIButton events)
- Typedef vec4<U8> and vec4<F32> to UColour and FColour respectively for easier to read code.

983 Diff Diff IonutCava picture IonutCava Sun 26 Nov, 2017 23:34:26 +0000

[Ionut]
- Finishing up CEGUI RTT rendering. Still have alpha issues

977 Diff Diff IonutCava picture IonutCava Mon 20 Nov, 2017 17:13:16 +0000

[Ionut]
- Add an “ApplicationOutput” class that the Editor uses to show console entries and parse commands
- Add “Warning” messages to console outputs

969 Diff Diff IonutCava picture IonutCava Mon 13 Nov, 2017 00:15:57 +0000

[Ionut]
- Further improve DisplayWindow <-> Input relationship
- Add Flip-Y 2D camera (D3D style projection)
- Fix IMGUI rendering
- Add IMGUI sample and IMWINDOW sample rendering at the same time
- Improve IMWINDOW multi-window support
— Bug: nothing rendering in child platform windows
- Add draw command to move render context from one window to another

968 Diff Diff IonutCava picture IonutCava Tue 07 Nov, 2017 17:32:31 +0000

[Ionut]
- Consistent naming between timing variables

952 Diff Diff IonutCava picture IonutCava Wed 25 Oct, 2017 00:35:37 +0000

[Ionut]
- Added the CEGUI rendering project to our solution for easier modification, debugging and integration
- Updated to OIS 1.4
- Some updates to the WindowHandle struct

  • Only compiled in Debug*
941 Diff Diff IonutCava picture IonutCava Mon 04 Sep, 2017 20:55:02 +0000

[Ionut]
- Update CEGUI from static to dynamic config (some dlls might still be missing)
- Attempt to work around a weird string issue with the newest VS2017 update

891 Diff Diff IonutCava picture IonutCava Mon 15 May, 2017 16:18:45 +0000

[Ionut]
- Some memory-friendly optimizations

890 Diff Diff IonutCava picture IonutCava Sun 14 May, 2017 20:54:59 +0000

[Ionut]
- Add pre-compiled header support
- Initial code for per-stage tessellation computation

836 IonutCava picture IonutCava Fri 27 Jan, 2017 14:59:56 +0000

[IonutCava]
- Update copyright notice