annotate include/core/session.h @ 348:6b0768158dcd

text: redesign almost every widget i.e. Paragraph is now a QLabel, etc etc, some things will probably break, idc
author Paper <paper@paper.us.eu.org>
date Tue, 25 Jun 2024 11:19:54 -0400
parents 1faa72660932
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
261
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
1 #ifndef MINORI_CORE_SESSION_H_
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
2 #define MINORI_CORE_SESSION_H_
85
c69230dc2b5d *: cleanup includes
Paper <mrpapersonic@gmail.com>
parents: 51
diff changeset
3
319
d928ec7b6a0d services/kitsu: implement GetAnimeList()
Paper <paper@paper.us.eu.org>
parents: 315
diff changeset
4 #include "core/time.h"
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
5 #include "core/config.h"
108
2004b41d4a59 *: huge commit
Paper <mrpapersonic@gmail.com>
parents: 85
diff changeset
6 #include "gui/locale.h"
292
ac1451035c85 dialog/about: add utf8proc
Paper <paper@paper.us.eu.org>
parents: 291
diff changeset
7
315
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
8 #include <QObject>
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
9 #include <QElapsedTimer>
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
10
221
53211cb1e7f5 library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents: 195
diff changeset
11 #include "semver/semver.hpp"
53211cb1e7f5 library: add initial library stuff
Paper <paper@paper.us.eu.org>
parents: 195
diff changeset
12
291
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
13 #include <atomic>
315
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
14 #include <string>
319
d928ec7b6a0d services/kitsu: implement GetAnimeList()
Paper <paper@paper.us.eu.org>
parents: 315
diff changeset
15 #include <random>
250
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
16
315
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
17 class MainWindow;
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
18
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
19 struct Session : public QObject {
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
20 Q_OBJECT
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
21
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
22 public:
315
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
23 Session();
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
24
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
25 void SetMainWindow(MainWindow* window);
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
26
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
27 void SetStatusBar(const std::string& message);
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
28
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
29 /* we literally *cannot* be lying to the user by doing this */
315
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
30 void IncrementRequests();
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
31 unsigned int GetRequests();
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
32 int uptime();
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
33
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
34 Config config;
343
1faa72660932 *: transfer back to cmake from autotools
Paper <paper@paper.us.eu.org>
parents: 319
diff changeset
35
319
d928ec7b6a0d services/kitsu: implement GetAnimeList()
Paper <paper@paper.us.eu.org>
parents: 315
diff changeset
36 std::mt19937 gen;
118
39521c47c7a3 *: another huge megacommit, SORRY
Paper <mrpapersonic@gmail.com>
parents: 108
diff changeset
37
343
1faa72660932 *: transfer back to cmake from autotools
Paper <paper@paper.us.eu.org>
parents: 319
diff changeset
38 static constexpr semver::version version{
1faa72660932 *: transfer back to cmake from autotools
Paper <paper@paper.us.eu.org>
parents: 319
diff changeset
39 MINORI_VERSION_MAJOR,
1faa72660932 *: transfer back to cmake from autotools
Paper <paper@paper.us.eu.org>
parents: 319
diff changeset
40 MINORI_VERSION_MINOR,
1faa72660932 *: transfer back to cmake from autotools
Paper <paper@paper.us.eu.org>
parents: 319
diff changeset
41 MINORI_VERSION_PATCH,
1faa72660932 *: transfer back to cmake from autotools
Paper <paper@paper.us.eu.org>
parents: 319
diff changeset
42 };
1faa72660932 *: transfer back to cmake from autotools
Paper <paper@paper.us.eu.org>
parents: 319
diff changeset
43
315
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
44 signals:
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
45 void StatusBarChange(const std::string& message);
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
46
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
47 private:
291
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 261
diff changeset
48 /* IncrementRequests() gets called by different threads */
315
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
49 std::atomic<unsigned int> requests_ = 0;
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
50 QElapsedTimer timer_;
34347fd2a2de session: allow printing status messages
Paper <paper@paper.us.eu.org>
parents: 292
diff changeset
51 MainWindow* window_;
10
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
52 };
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
53
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
54 extern Session session;
Paper <mrpapersonic@gmail.com>
parents: 9
diff changeset
55
261
3ec7804abf17 include: make header guards more sane
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
56 #endif // MINORI_CORE_SESSION_H_