Moved browser related stuff to browser.c

This commit is contained in:
TheFloW 2018-09-13 14:46:10 +02:00
parent dc3220f10d
commit acf8956404
15 changed files with 1120 additions and 1009 deletions

View File

@ -80,6 +80,7 @@ add_executable(VitaShell
${vitashell_res}
main.c
main_context.c
browser.c
init.c
usb.c
qr.c

1025
browser.c Normal file

File diff suppressed because it is too large Load Diff

53
browser.h Normal file
View File

@ -0,0 +1,53 @@
/*
VitaShell
Copyright (C) 2015-2018, TheFloW
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __BROWSER_H__
#define __BROWSER_H__
extern FileList file_list, mark_list, copy_list, install_list;
extern char cur_file[MAX_PATH_LENGTH];
extern char archive_copy_path[MAX_PATH_LENGTH];
extern char archive_path[MAX_PATH_LENGTH];
extern int base_pos, rel_pos;
extern int sort_mode, copy_mode;
extern int last_set_sort_mode;
// minimum time to pass before shortcutting to recent files/ bookmarks via L/R keys
extern SceInt64 time_last_recent_files, time_last_bookmarks;
#define THRESHOLD_LAST_PAD_RECENT_FILES_WAIT 1000000
#define THRESHOLD_LAST_PAD_BOOKMARKS_WAIT 1000000
void dirLevelUp();
void setDirArchiveLevel();
void setInArchive();
int isInArchive();
void setFocusName(const char *name);
void setFocusOnFilename(const char *name);
int refreshFileList();
int jump_to_directory_track_current_path(char *path);
int browserMain();
#endif

1
file.c
View File

@ -17,6 +17,7 @@
*/
#include "main.h"
#include "browser.h"
#include "init.h"
#include "archive.h"
#include "file.h"

1
hex.c
View File

@ -17,6 +17,7 @@
*/
#include "main.h"
#include "browser.h"
#include "archive.h"
#include "file.h"
#include "text.h"

7
init.c
View File

@ -17,6 +17,7 @@
*/
#include "main.h"
#include "browser.h"
#include "init.h"
#include "file.h"
#include "package_installer.h"
@ -167,6 +168,10 @@ SceUID patch_modid = -1, kernel_modid = -1, user_modid = -1;
// System params
int language = 0, enter_button = 0, date_format = 0, time_format = 0;
int isSafeMode() {
return is_safe_mode;
}
static void initSceAppUtil() {
// Init SceAppUtil
SceAppUtilInitParam init_param;
@ -415,7 +420,7 @@ void initVitaShell() {
sceIoMkdir(VITASHELL_RECENT_PATH, 0777);
}
time_last_recent_files = 0;
time_last_bookmars = 0;
time_last_bookmarks = 0;
}
void finishVitaShell() {

1
init.h
View File

@ -40,6 +40,7 @@ typedef struct {
vita2d_pgf *loadSystemFonts();
int isSafeMode();
void initVitaShell();
void finishVitaShell();

View File

@ -46,7 +46,6 @@ typedef struct {
FileList *copy_list;
const char *archive_path;
int copy_mode;
int file_type;
} CopyArguments;
typedef struct {

1002
main.c

File diff suppressed because it is too large Load Diff

30
main.h
View File

@ -250,44 +250,28 @@ enum DialogSteps {
DIALOG_STEP_ADHOC_RECEIVED,
};
extern FileList file_list, mark_list, copy_list, install_list;
extern char cur_file[MAX_PATH_LENGTH];
extern char archive_copy_path[MAX_PATH_LENGTH];
extern char archive_path[MAX_PATH_LENGTH];
extern int base_pos, rel_pos;
extern int sort_mode, copy_mode;
extern int last_set_sort_mode;
// minimum time to pass before shortcutting to recent files/ bookmarks via L/R keys
extern SceInt64 time_last_recent_files, time_last_bookmars;
#define THRESHOLD_LAST_PAD_RECENT_FILES_WAIT 1000000
#define THRESHOLD_LAST_PAD_BOOKMARKS_WAIT 1000000
extern vita2d_pgf *font;
extern char font_size_cache[256];
extern char vita_ip[16];
extern unsigned short int vita_port;
extern VitaShellConfig vitashell_config;
extern int SCE_CTRL_ENTER, SCE_CTRL_CANCEL;
extern int use_custom_config;
void dirLevelUp();
int getDialogStep();
void setDialogStep(int step);
int dialogSteps();
void initFtp();
void initUsb();
void drawScrollBar(int pos, int n);
void drawShellInfo(const char *path);
int isInArchive();
int refreshFileList();
void ftpvita_PROM(ftpvita_client_info_t *client);
int jump_to_directory_track_current_path(char *path);
#endif

View File

@ -17,6 +17,7 @@
*/
#include "main.h"
#include "browser.h"
#include "init.h"
#include "io_process.h"
#include "context_menu.h"

View File

@ -17,6 +17,7 @@
*/
#include "main.h"
#include "browser.h"
#include "archive.h"
#include "photo.h"
#include "file.h"

View File

@ -17,6 +17,7 @@
*/
#include "main.h"
#include "browser.h"
#include "archive.h"
#include "init.h"
#include "theme.h"

1
sfo.c
View File

@ -17,6 +17,7 @@
*/
#include "main.h"
#include "browser.h"
#include "archive.h"
#include "file.h"
#include "text.h"

1
text.c
View File

@ -17,6 +17,7 @@
*/
#include "main.h"
#include "browser.h"
#include "context_menu.h"
#include "archive.h"
#include "file.h"