-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskClass.h
More file actions
92 lines (85 loc) · 2.65 KB
/
Copy pathTaskClass.h
File metadata and controls
92 lines (85 loc) · 2.65 KB
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
#ifndef TASKCLASS_H
#define TASKCLASS_H
#include <ncursesw/cursesapp.h>
#include <ncursesw/ncurses.h>
#include <ncursesw/menu.h>
#include <ncursesw/form.h>
#include <ncursesw/panel.h>
#include <ncursesw/unctrl.h>
#include <iostream>
#include <sstream>
#include <fstream>
#include <csignal>
#include <thread>
#include <cstring>
#include <string>
#include <stdio.h>
#include <unistd.h>
#include <cmath>
#include <vector>
#include <locale.h>
#include <term.h>
#include <cassert>
#include <set>
#include <systemd/sd-bus-vtable.h>
#include <systemd/sd-bus.h>
#ifndef CTRL
#define CTRL(c) ((c) & 037)
#endif
//#define CTRLD 4
#define BUFSIZE 8192
#define CLEARSCR system ( "clear" )
#define UNUSED(x) (void) (x)
#define SAFE_DELETE(p) { if(p) { delete (p); (p) = nullptr; } }
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p) = nullptr; } }
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
#define SIZEOF(table) (sizeof(table) / sizeof(table[0]))
#define VARNAME(name) #name
#define RST "\x1B[0m";
#define KRED "\x1B[31m";
#define KGRN "\x1B[32m";
#define KYEL "\x1B[33m";
#define KBLU "\x1B[34m";
#define KMAG "\x1B[35m";
#define KCYN "\x1B[36m";
#define KWHT "\x1B[37m";
#define FRED(x) KRED x RST;
#define FGRN(x) KGRN x RST;
#define FYEL(x) KYEL x RST;
#define FBLU(x) KBLU x RST;
#define FMAG(x) KMAG x RST;
#define FCYN(x) KCYN x RST;
#define FWHT(x) KWHT x RST;
using namespace std;
struct DatumUhrZeit {
int n = 0;
time_t Zeitstempel;
tm* UHRZEIT;
char UHRZEITchar[19];
std::string UHRZEITstr;
void TIMEFIELD(WINDOW* TMPWin, int TMPmax_xc) {
Zeitstempel = time(nullptr);
UHRZEIT = localtime(&Zeitstempel);
strftime(UHRZEITchar, size_t(UHRZEITchar), "%d.%m.%Y %T", UHRZEIT);
UHRZEITstr = std::string(UHRZEITchar);
wattr_on(TMPWin, COLOR_PAIR(79) | A_STANDOUT | A_BOLD, nullptr); //|A_BOLD,0);
mvwaddnstr(TMPWin, 0, 0, UHRZEITstr.c_str(), -1);
wattr_off(TMPWin, COLOR_PAIR(79) | A_STANDOUT | A_BOLD, nullptr); //|A_BOLD,0);
refresh();
wrefresh(TMPWin); //TMPmax_xc-2
}
};
class TaskClass {
public:
/*##############################################################################*/
int ZahlenWerk(int zahlen, std::string i, int max);
int Zeilen(std::string data, int maxbreite);
vector<string> StringTeiler(const std::string& str, char delimiter);
string TERM_AUSGABE(std::string cmd);
WINDOW* ClearWindow(WINDOW* W);
int WinFullSize(WINDOW* TmpWin, int WHCRXY, std::string WorH);
TaskClass();
~TaskClass();
/*##############################################################################*/
};
#endif // TASKCLASS_H