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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
//
// Template header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 2016-2018 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
// file is missing or damaged, see the license at:
//
// https://www.fltk.org/COPYING.php
//
// Please see the following page on how to report bugs and issues:
//
// https://www.fltk.org/bugs.php
//
// Do not directly include this file, instead use <FL/android.H>.
// These types and variables give access to internal, platform-specific data through the public API.
// They require to include platform.H (in contrast to types defined in platform_types.h)
#if !defined(FL_PLATFORM_H)
# error "Never use <FL/android.H> directly; include <FL/platform.H> instead."
#endif // !FL_PLATFORM_H
#ifdef __cplusplus
extern "C" {
#endif
/*
This is the function that application code must implement, representing
the main entry to the app.
*/
extern int main(int argc, char **argv);
#ifdef __cplusplus
}
#endif
typedef void *Window; // used by fl_find(), fl_xid() and class Fl_X
/* Reference to the current device context
For back-compatibility only. The preferred procedure to get this reference is
Fl_Surface_Device::surface()->driver()->gc().
*/
extern void *fl_gc;
/**
These events are specific to the Android OS driver system. They can
be read by adding a callback via Fl::add_system_handler() and reading Fl::event()
Don't change the order of these enums! See Fl_Android_Application.H .
*/
enum Fl_Android_Platform_Event
{
FL_ANDROID_EVENTS = 0x00010000,
/**
* Command from main thread: the AInputQueue has changed. Upon processing
* this command, android_app->inputQueue will be updated to the new queue
* (or NULL).
*/
FL_ANDROID_EVENT_INPUT_CHANGED,
/**
* Command from main thread: a new ANativeWindow is ready for use. Upon
* receiving this command, android_app->window will contain the new window
* surface.
*/
FL_ANDROID_EVENT_INIT_WINDOW,
/**
* Command from main thread: the existing ANativeWindow needs to be
* terminated. Upon receiving this command, android_app->window still
* contains the existing window; after calling android_app_exec_cmd
* it will be set to NULL.
*/
FL_ANDROID_EVENT_TERM_WINDOW,
/**
* Command from main thread: the current ANativeWindow has been resized.
* Please redraw with its new size.
*/
FL_ANDROID_EVENT_WINDOW_RESIZED,
/**
* Command from main thread: the system needs that the current ANativeWindow
* be redrawn. You should redraw the window before handing this to
* android_app_exec_cmd() in order to avoid transient drawing glitches.
*/
FL_ANDROID_EVENT_WINDOW_REDRAW_NEEDED,
/**
* Command from main thread: the content area of the window has changed,
* such as from the soft input window being shown or hidden. You can
* find the new content rect in android_app::contentRect.
*/
FL_ANDROID_EVENT_CONTENT_RECT_CHANGED,
/**
* Command from main thread: the app's activity window has gained
* input focus.
*/
FL_ANDROID_EVENT_GAINED_FOCUS,
/**
* Command from main thread: the app's activity window has lost
* input focus.
*/
FL_ANDROID_EVENT_LOST_FOCUS,
/**
* Command from main thread: the current device configuration has changed.
*/
FL_ANDROID_EVENT_CONFIG_CHANGED,
/**
* Command from main thread: the system is running low on memory.
* Try to reduce your memory use.
*/
FL_ANDROID_EVENT_LOW_MEMORY,
/**
* Command from main thread: the app's activity has been started.
*/
FL_ANDROID_EVENT_START,
/**
* Command from main thread: the app's activity has been resumed.
*/
FL_ANDROID_EVENT_RESUME,
/**
* Command from main thread: the app should generate a new saved state
* for itself, to restore from later if needed. If you have saved state,
* allocate it with malloc and place it in android_app.savedState with
* the size in android_app.savedStateSize. The will be freed for you
* later.
*/
FL_ANDROID_EVENT_SAVE_STATE,
/**
* Command from main thread: the app's activity has been paused.
*/
FL_ANDROID_EVENT_PAUSE,
/**
* Command from main thread: the app's activity has been stopped.
*/
FL_ANDROID_EVENT_STOP,
/**
* Command from main thread: the app's activity is being destroyed,
* and waiting for the app thread to clean up and exit before proceeding.
*/
FL_ANDROID_EVENT_DESTROY
};
|