2020-08-03 18:10:06 -04:00
|
|
|
#ifndef NX_SHELL_GUI_H
|
|
|
|
#define NX_SHELL_GUI_H
|
|
|
|
|
2020-08-11 01:01:42 -04:00
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2020-08-03 18:10:06 -04:00
|
|
|
#include <SDL.h>
|
2020-08-11 01:01:42 -04:00
|
|
|
#include <switch.h>
|
|
|
|
|
2020-08-29 17:10:27 -04:00
|
|
|
#include "textures.h"
|
|
|
|
|
2020-08-11 01:01:42 -04:00
|
|
|
enum MENU_STATES {
|
2020-10-23 01:36:55 -04:00
|
|
|
MENU_STATE_FILEBROWSER,
|
2020-08-19 17:40:15 -04:00
|
|
|
MENU_STATE_OPTIONS,
|
|
|
|
MENU_STATE_DELETE,
|
|
|
|
MENU_STATE_PROPERTIES,
|
|
|
|
MENU_STATE_SETTINGS,
|
2020-08-28 22:32:56 -04:00
|
|
|
MENU_STATE_IMAGEVIEWER,
|
2020-09-06 12:07:28 -04:00
|
|
|
MENU_STATE_ARCHIVEEXTRACT,
|
|
|
|
MENU_STATE_TEXTREADER
|
2020-08-11 01:01:42 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct {
|
2020-10-23 01:36:55 -04:00
|
|
|
MENU_STATES state = MENU_STATE_FILEBROWSER;
|
2020-08-11 01:01:42 -04:00
|
|
|
int selected = 0;
|
2020-10-13 01:47:29 -04:00
|
|
|
std::vector<FsDirectoryEntry> entries;
|
2020-08-11 01:01:42 -04:00
|
|
|
std::vector<bool> checked;
|
|
|
|
std::vector<bool> checked_copy;
|
|
|
|
std::string checked_cwd;
|
|
|
|
int checked_count = 0;
|
|
|
|
s64 used_storage = 0;
|
|
|
|
s64 total_storage = 0;
|
2020-10-22 12:17:10 -04:00
|
|
|
std::vector<Tex> textures;
|
|
|
|
long unsigned int frame_count = 0;
|
2021-01-24 16:39:35 -05:00
|
|
|
float zoom_factor = 1.0f;
|
2020-08-11 01:01:42 -04:00
|
|
|
} MenuItem;
|
2020-08-03 18:10:06 -04:00
|
|
|
|
2020-09-06 12:07:28 -04:00
|
|
|
typedef struct {
|
|
|
|
char *buf;
|
|
|
|
size_t buf_size;
|
|
|
|
} TextReader;
|
|
|
|
|
2020-08-24 11:59:33 -04:00
|
|
|
extern SDL_Window *window;
|
|
|
|
extern MenuItem item;
|
2020-09-06 12:07:28 -04:00
|
|
|
extern TextReader text_reader;
|
2020-08-24 11:59:33 -04:00
|
|
|
|
2020-08-03 18:10:06 -04:00
|
|
|
namespace GUI {
|
2020-08-24 11:59:33 -04:00
|
|
|
inline void ResetCheckbox(void) {
|
|
|
|
item.checked.clear();
|
|
|
|
item.checked_copy.clear();
|
2020-10-13 01:47:29 -04:00
|
|
|
item.checked.resize(item.entries.size());
|
2020-08-24 11:59:33 -04:00
|
|
|
item.checked.assign(item.checked.size(), false);
|
|
|
|
item.checked_cwd.clear();
|
|
|
|
item.checked_count = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
int RenderLoop(void);
|
2020-08-03 18:10:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|