File: rocket_ui.h

package info (click to toggle)
freespace2 24.2.0%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 43,716 kB
  • sloc: cpp: 595,001; ansic: 21,741; python: 1,174; sh: 457; makefile: 248; xml: 181
file content (70 lines) | stat: -rw-r--r-- 1,622 bytes parent folder | download | duplicates (2)
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
#pragma once

// Forward definition
namespace Rocket {
namespace Core {
class Context;
}
} // namespace Rocket

/**
 * @brief Contains all functions and types related to the libRocket based UI system
 */
namespace scpui {

/**
 * @brief Initialzes libRocket and the associated interfaces
 */
void initialize();

/**
 * @brief Sets an offset by which the libRocket interface is moved by.
 *
 * @details This translates all drawing operations by the specified offset and transforms input events by the same
 * offset to bring them back into the same frame of reference for libRocket.
 *
 * @param x The x-offset
 * @param y The y-offset
 */
void setOffset(float x, float y);

/**
 * @brief Reloads all libRocket contexts currently active
 *
 * This can be used to reload the active documents if the files contained documents.
 */
void reloadAllContexts();

/**
 * @brief Returns the current context
 */
Rocket::Core::Context* getContext();

/**
 * @brief Enables mouse and text input on the specified input
 *
 * If there was another context with input enabled then input will be disabled for that context before enabling input
 * on this context.
 *
 * @param main_ctx The context ot enable input for
 */
void enableInput(Rocket::Core::Context* main_ctx);

/**
 * @brief Disable all input handling
 */
void disableInput();

/**
 * @brief Shutdown the scripting part of libRocket
 *
 * This needs to be called before the scripting state is destroyed so that all resources are deallocated properly.
 */
void shutdown_scripting();

/**
 * @brief Frees all resources of the UI system
 */
void shutdown();

} // namespace scpui