Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Source/CursesDialog/cmCursesForm.h
4998 views
1
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2
file LICENSE.rst or https://cmake.org/licensing for details. */
3
#pragma once
4
5
#include "cmConfigure.h" // IWYU pragma: keep
6
7
#include <string>
8
9
#include "cmsys/FStream.hxx"
10
11
#include "cmCursesStandardIncludes.h"
12
13
class cmCursesForm
14
{
15
public:
16
cmCursesForm();
17
virtual ~cmCursesForm();
18
19
cmCursesForm(cmCursesForm const&) = delete;
20
cmCursesForm& operator=(cmCursesForm const&) = delete;
21
22
// Description:
23
// Handle user input.
24
virtual void HandleInput() = 0;
25
26
// Description:
27
// Display form.
28
virtual void Render(int left, int top, int width, int height) = 0;
29
30
// Description:
31
// This method should normally called only by the form.
32
// The only exception is during a resize.
33
virtual void UpdateStatusBar() = 0;
34
35
// Description:
36
// During a CMake run, an error handle should add errors
37
// to be displayed afterwards.
38
virtual void AddError(std::string const&, char const*) {}
39
40
// Description:
41
// Turn debugging on. This will create ccmakelog.txt.
42
static void DebugStart();
43
44
// Description:
45
// Turn debugging off. This will close ccmakelog.txt.
46
static void DebugEnd();
47
48
// Description:
49
// Write a debugging message.
50
static void LogMessage(char const* msg);
51
52
// Description:
53
// Return the FORM. Should be only used by low-level methods.
54
FORM* GetForm() { return this->Form; }
55
56
static cmCursesForm* CurrentForm;
57
58
// Description:
59
// Handle resizing the form with curses.
60
void HandleResize();
61
62
protected:
63
static cmsys::ofstream DebugFile;
64
static bool Debug;
65
66
FORM* Form;
67
};
68
69