RetroArch
ozone.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2018 - natinusala
3  *
4  * RetroArch is free software: you can redistribute it and/or modify it under the terms
5  * of the GNU General Public License as published by the Free Software Found-
6  * ation, either version 3 of the License, or (at your option) any later version.
7  *
8  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10  * PURPOSE. See the GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License along with RetroArch.
13  * If not, see <http://www.gnu.org/licenses/>.
14  */
15 
16 #ifndef _OZONE_H
17 #define _OZONE_H
18 
20 
21 #include "ozone_theme.h"
22 #include "ozone_sidebar.h"
23 
24 #include <retro_miscellaneous.h>
25 
26 #include "../../menu_driver.h"
27 #include "../../../retroarch.h"
28 
29 #define FONT_SIZE_FOOTER 18
30 #define FONT_SIZE_TITLE 36
31 #define FONT_SIZE_TIME 22
32 #define FONT_SIZE_ENTRIES_LABEL 24
33 #define FONT_SIZE_ENTRIES_SUBLABEL 18
34 #define FONT_SIZE_SIDEBAR 24
35 
36 #define ANIMATION_PUSH_ENTRY_DURATION 10
37 #define ANIMATION_CURSOR_DURATION 8
38 #define ANIMATION_CURSOR_PULSE 30
39 
40 #define ENTRIES_START_Y 127
41 
42 #define INTERVAL_BATTERY_LEVEL_CHECK (30 * 1000000)
43 #define INTERVAL_OSK_CURSOR (0.5f * 1000000)
44 
46 {
48 
49  struct
50  {
57  } fonts;
58 
59  struct
60  {
67  } raster_blocks;
68 
72 
74 
79 
82 
83  size_t categories_selection_ptr; /* active tab id */
85 
88 
89  struct
90  {
91  float cursor_alpha;
92  float scroll_y;
94 
95  float list_alpha;
96 
98  } animations;
99 
100  bool fade_direction; /* false = left to right, true = right to left */
101 
102  size_t selection; /* currently selected entry */
103  size_t selection_old; /* previously selected entry (for fancy animation) */
105 
106  unsigned entries_height;
107 
108  int depth;
109 
112 
116 
118 
119  struct {
120  float selection_border[16];
121  float selection[16];
122  float entries_border[16];
123  float entries_icon[16];
124  float entries_checkmark[16];
125  float cursor_alpha[16];
126 
127  unsigned cursor_state; /* 0 -> 1 -> 0 -> 1 [...] */
128  float cursor_border[16];
130  } theme_dynamic;
131 
133 
135 
137  float scroll_old;
138 
141 
144 
146 
147  bool osk_cursor; /* true = display it, false = don't */
151 
153 
154  file_list_t *horizontal_list; /* console tabs */
155 };
156 
157 /* If you change this struct, also
158  change ozone_alloc_node and
159  ozone_copy_node */
160 typedef struct ozone_node
161 {
162  /* Entries */
163  unsigned height;
164  unsigned position_y;
165  bool wrap;
166 
167  /* Console tabs */
171 } ozone_node_t;
172 
174  unsigned selection, unsigned selection_old,
175  file_list_t *selection_buf, float alpha, float scroll_y,
176  bool is_playlist);
177 
179 
180 void ozone_change_tab(ozone_handle_t *ozone,
181  enum msg_hash_enums tab,
182  enum menu_settings_type type);
183 
184 void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection);
185 
187 
189 
191 
193 
195 
197 
199 
201 
203 
204 size_t ozone_list_get_size(void *data, enum menu_list_type type);
205 
206 void ozone_free_list_nodes(file_list_t *list, bool actiondata);
207 
208 bool ozone_is_playlist(ozone_handle_t *ozone);
209 
210 #endif
float messagebox_alpha
Definition: ozone.h:97
video_font_raster_block_t title
Definition: ozone.h:62
unsigned entry_font_glyph_width
Definition: ozone.h:114
video_font_raster_block_t time
Definition: ozone.h:63
char icons_path[PATH_MAX_LENGTH]
Definition: ozone.h:77
_W64 unsigned int uintptr_t
Definition: stdint.h:165
int depth
Definition: ozone.h:108
size_t selection
Definition: ozone.h:102
font_data_t * title
Definition: ozone.h:52
static const unsigned char tag[MAX_TESTS *3][16]
Definition: gcm.c:696
void ozone_context_destroy_horizontal_list(ozone_handle_t *ozone)
Definition: ozone_sidebar.c:612
float cursor_alpha
Definition: ozone.h:91
font_data_t * footer
Definition: ozone.h:51
Definition: ozone_sidebar.h:44
float scroll_y_sidebar
Definition: ozone.h:93
video_font_raster_block_t entries_sublabel
Definition: ozone.h:65
bool should_draw_messagebox
Definition: ozone.h:150
char * console_name
Definition: ozone.h:168
bool is_playlist_old
Definition: ozone.h:143
struct ozone_node ozone_node_t
bool cursor_in_sidebar
Definition: ozone.h:86
float cursor_border[16]
Definition: ozone.h:128
bool wrap
Definition: ozone.h:165
struct ozone_handle::@807 fonts
font_data_t * entries_label
Definition: ozone.h:54
bool draw_old_list
Definition: ozone.h:136
uint8_t tabs[OZONE_SYSTEM_TAB_LAST]
Definition: ozone.h:81
Definition: ozone.h:160
char png_path[PATH_MAX_LENGTH]
Definition: ozone.h:76
Definition: ibxm.h:9
bool ozone_is_playlist(ozone_handle_t *ozone)
Definition: ozone_sidebar.c:636
size_t ozone_list_get_size(void *data, enum menu_list_type type)
Definition: ozone.c:63
#define PATH_MAX_LENGTH
Definition: retro_miscellaneous.h:83
float entries_checkmark[16]
Definition: ozone.h:124
struct ozone_handle::@810 theme_dynamic
void ozone_draw_entries(ozone_handle_t *ozone, video_frame_info_t *video_info, unsigned selection, unsigned selection_old, file_list_t *selection_buf, float alpha, float scroll_y, bool is_playlist)
Definition: ozone_entries.c:106
char * pending_message
Definition: ozone.h:139
void ozone_free_list_nodes(file_list_t *list, bool actiondata)
Definition: ozone.c:96
char tab_path[PATH_MAX_LENGTH]
Definition: ozone.h:78
ozone_theme_t * theme
Definition: ozone.h:117
GLenum type
Definition: glext.h:6233
void ozone_init_horizontal_list(ozone_handle_t *ozone)
Definition: ozone_sidebar.c:407
uintptr_t menu_texture_item
Definition: menu_driver.h:348
Definition: video_driver.h:405
float sidebar_offset
Definition: ozone.h:111
bool draw_sidebar
Definition: ozone.h:110
unsigned height
Definition: ozone.h:163
void ozone_context_reset_horizontal_list(ozone_handle_t *ozone)
Definition: ozone_sidebar.c:463
menu_settings_type
Definition: menu_driver.h:132
float scroll_old
Definition: ozone.h:137
float selection_border[16]
Definition: ozone.h:120
float entries_icon[16]
Definition: ozone.h:123
void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
Definition: ozone_sidebar.c:107
uintptr_t icon
Definition: ozone.h:169
font_data_t * entries_sublabel
Definition: ozone.h:55
Definition: ozone_theme.h:121
video_font_raster_block_t footer
Definition: ozone.h:61
unsigned ozone_get_sidebar_height(ozone_handle_t *ozone)
Definition: ozone_sidebar.c:288
bool need_compute
Definition: ozone.h:132
struct ozone_handle::@809 animations
Definition: video_coord_array.h:84
font_data_t * sidebar
Definition: ozone.h:56
Definition: video_driver.h:332
file_list_t * selection_buf_old
Definition: ozone.h:134
video_font_raster_block_t sidebar
Definition: ozone.h:66
float scroll_y
Definition: ozone.h:92
Definition: ozone_texture.h:201
float message_background[16]
Definition: ozone.h:129
font_data_t * time
Definition: ozone.h:53
Definition: ozone_texture.h:72
unsigned title_font_glyph_width
Definition: ozone.h:113
Definition: file_list.h:47
uint8_t system_tab_end
Definition: ozone.h:80
bool fade_direction
Definition: ozone.h:100
Definition: ozone.h:45
GLfloat GLfloat GLfloat alpha
Definition: glext.h:6290
bool messagebox_state
Definition: ozone.h:148
file_list_t * horizontal_list
Definition: ozone.h:154
ozone_node_t * ozone_alloc_node()
Definition: ozone.c:50
void ozone_leave_sidebar(ozone_handle_t *ozone, uintptr_t tag)
Definition: ozone_sidebar.c:258
menu_list_type
Definition: menu_entries.h:55
msg_hash_enums
Definition: msg_hash.h:152
bool osk_cursor
Definition: ozone.h:147
bool has_all_assets
Definition: ozone.h:140
size_t selection_old
Definition: ozone.h:103
Definition: ozone_texture.h:49
uintptr_t content_icon
Definition: ozone.h:170
size_t categories_selection_ptr
Definition: ozone.h:83
const GLuint * textures
Definition: glext.h:9001
char assets_path[PATH_MAX_LENGTH]
Definition: ozone.h:75
void ozone_change_tab(ozone_handle_t *ozone, enum msg_hash_enums tab, enum menu_settings_type type)
Definition: ozone_sidebar.c:374
size_t selection_old_list
Definition: ozone.h:104
struct ozone_handle::@808 raster_blocks
unsigned entries_height
Definition: ozone.h:106
float entries_border[16]
Definition: ozone.h:122
bool empty_playlist
Definition: ozone.h:145
menu_texture_item tab_textures[OZONE_TAB_TEXTURE_LAST]
Definition: ozone.h:71
unsigned cursor_state
Definition: ozone.h:127
bool cursor_in_sidebar_old
Definition: ozone.h:87
bool is_playlist
Definition: ozone.h:142
unsigned old_list_offset_y
Definition: ozone.h:152
unsigned sublabel_font_glyph_width
Definition: ozone.h:115
video_font_raster_block_t entries_label
Definition: ozone.h:64
unsigned ozone_get_selected_sidebar_y_position(ozone_handle_t *ozone)
Definition: ozone_sidebar.c:283
uint64_t frame_count
Definition: ozone.h:47
void ozone_go_to_sidebar(ozone_handle_t *ozone, uintptr_t tag)
Definition: ozone_sidebar.c:236
bool messagebox_state_old
Definition: ozone.h:149
size_t categories_active_idx_old
Definition: ozone.h:84
float list_alpha
Definition: ozone.h:95
unsigned __int64 uint64_t
Definition: stdint.h:136
void ozone_refresh_horizontal_list(ozone_handle_t *ozone)
Definition: ozone_sidebar.c:442
unsigned char uint8_t
Definition: stdint.h:124
void ozone_sidebar_goto(ozone_handle_t *ozone, unsigned new_selection)
Definition: ozone_sidebar.c:294
Definition: font_driver.h:119
menu_texture_item icons_textures[OZONE_ENTRIES_ICONS_TEXTURE_LAST]
Definition: ozone.h:70
unsigned position_y
Definition: ozone.h:164