forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem.h
More file actions
80 lines (64 loc) · 2.43 KB
/
system.h
File metadata and controls
80 lines (64 loc) · 2.43 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
// SHE library
// Copyright (C) 2012-2016 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef SHE_SYSTEM_H_INCLUDED
#define SHE_SYSTEM_H_INCLUDED
#pragma once
#include "gfx/fwd.h"
#include "she/capabilities.h"
#include "she/keys.h"
#include <stdexcept>
namespace she {
class Display;
class EventQueue;
class Font;
class Logger;
class NativeDialogs;
class Surface;
class DisplayCreationException : public std::runtime_error {
public:
DisplayCreationException(const char* msg) throw()
: std::runtime_error(msg) { }
};
class System {
public:
virtual ~System() { }
virtual void dispose() = 0;
virtual void activateApp() = 0;
virtual void finishLaunching() = 0;
virtual Capabilities capabilities() const = 0;
virtual Logger* logger() = 0;
virtual NativeDialogs* nativeDialogs() = 0;
virtual EventQueue* eventQueue() = 0;
virtual bool gpuAcceleration() const = 0;
virtual void setGpuAcceleration(bool state) = 0;
virtual gfx::Size defaultNewDisplaySize() = 0;
virtual Display* defaultDisplay() = 0;
virtual Display* createDisplay(int width, int height, int scale) = 0;
virtual Surface* createSurface(int width, int height) = 0;
virtual Surface* createRgbaSurface(int width, int height) = 0;
virtual Surface* loadSurface(const char* filename) = 0;
virtual Surface* loadRgbaSurface(const char* filename) = 0;
virtual Font* loadSpriteSheetFont(const char* filename, int scale = 1) = 0;
virtual Font* loadTrueTypeFont(const char* filename, int height) = 0;
// Returns true if the the given scancode key is pressed/actived.
virtual bool isKeyPressed(KeyScancode scancode) = 0;
// Returns the active pressed modifiers.
virtual KeyModifiers keyModifiers() = 0;
// Returns the latest unicode character that activated the given
// scancode.
virtual int getUnicodeFromScancode(KeyScancode scancode) = 0;
// Clears the keyboard buffer (used only in the Allegro port).
// TODO (deprecated)
virtual void clearKeyboardBuffer() = 0;
// Indicates if you want to use dead keys or not. By default it's
// false, which behaves as regular shortcuts. You should set this
// to true when you're inside a text field in your app.
virtual void setTranslateDeadKeys(bool state) = 0;
};
System* create_system();
System* instance();
} // namespace she
#endif