Commit f214bfe4 authored by Ercan Ersoy's avatar Ercan Ersoy

Fix all warnings

Fix all warnings via declared variables in "dosshell.h"
in main function. But, file manager window doesn't open.
parent 35094f13
No preview for this file type
......@@ -19,60 +19,60 @@
// Common Variables
// Current directory string pointer variable
char *current_directory = (char *)malloc(MAX_PATH_LENGTH + 1);
static char *current_directory;
// Selected directory or file
int selected_directory_or_file = 0;
static int selected_directory_or_file;
// Selected drive
int selected_drive = 0;
static int selected_drive;
// Show archive item variable
bool show_archive_item = true;
static bool show_archive_item;
// Show hidden item variable
bool show_hidden_item = false;
static bool show_hidden_item;
// Show read only item variable
bool show_read_only_item = true;
static bool show_read_only_item;
// Show system item variable
bool show_system_item = false;
static bool show_system_item;
// Clipboard item name string pointer variable
char *clipboard_item_name = (char *)calloc(NAME_MAX, 1);
static char *clipboard_item_name;
// Clipboard item path string pointer variable
char *clipboard_item_path = (char *)calloc(MAX_PATH_LENGTH, 1);
static char *clipboard_item_path;
// Clipboard status variable
unsigned char clipboard_status = 0; // 0 for nothing, 1 for copying, 2 for cutting.
static unsigned char clipboard_status; // 0 for nothing, 1 for copying, 2 for cutting.
// History path names string array variable
char history_path_names[HISTORY_LENGTH][MAX_PATH_LENGTH + 1];
static char history_path_names[HISTORY_LENGTH][MAX_PATH_LENGTH + 1];
// History index variable
int history_index = 0;
static int history_index;
// Item attributes variable
unsigned char *item_attributes = (unsigned char *)"----";
static unsigned char *item_attributes;
// Open Kitten library
int kitten_status = kittenopen("DOSSHELL");
static int kitten_status;
// Disable ESC key variable from FDOSTUI
extern bool _wm_esc_flag = false;
extern bool _wm_esc_flag;
// Bar
// Window of bar pointer variable
window *bar = new window(0, 0, _video_cols, 3);
static window *bar;
// Menubar of bar pointer variable
menubar *bar_menus = new menubar(0, 0, _video_cols, 1);
static menubar *bar_menus;
// File Manager
// Window of file manager pointer variable
window *file_manager = new window(5, 4, 68, 19);
static window *file_manager;
// Menubar of file manager pointer variable
menubar *file_manager_menus = new menubar(0, 0, _video_cols, 1);
static menubar *file_manager_menus;
// Current directory label of file manager pointer variable
label *current_directory_label = new label(1, 2, 65, 1);
static label *current_directory_label;
// Current drivers listbox of file manager pointer variable
listbox *drivers = new listbox(0, 3, 66, 5);
static listbox *drivers;
// Current directories and files of file manager pointer variable
listbox *directories_and_files = new listbox(0, 8, 66, 8);
static listbox *directories_and_files;
// "Item Attribute:" message label
label *item_attributes_label = new label(0, 16, 16, 1);
static label *item_attributes_label;
// Item attribute label
label *item_attributes_view = new label(17, 16, 4, 1);
static label *item_attributes_view;
// Function prototypes
......@@ -150,82 +150,27 @@ void show_system_items(menuitem *, void *);
// Bar Menus
// Internal applications menu of bar
struct menuitem internal_applications_menu[] =
{
{reinterpret_cast<unsigned char const*>(kittengets(2, 1, "File Manager")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, 0, show_file_manager, 0}, // File manager
{reinterpret_cast<unsigned char const*>(kittengets(2, 2, "Run")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, 0, show_run, 0}, // Run
{0}
};
static struct menuitem internal_applications_menu[3];
// Exit menu of bar
struct menuitem exit_menu[] =
{
{reinterpret_cast<unsigned char const*>(kittengets(3, 1, "Quit")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, 0, quit, 0}, // Quit
{0}
};
static struct menuitem exit_menu[2];
// Menubar of bar
struct menuitembar menus_of_bar[] =
{
{reinterpret_cast<unsigned char const*>(kittengets(2, 0, "Internal Applications")), 0, SCAN_NONE, internal_applications_menu}, // Internal Applications
{reinterpret_cast<unsigned char const*>(kittengets(3, 0, "Exit")), 0, SCAN_NONE, exit_menu}, // Exit
{0}
};
static struct menuitembar menus_of_bar[3];
// File Manager Menus
// File menu of file manager
struct menuitem file_menu[] =
{
{reinterpret_cast<unsigned char const*>(kittengets(5, 1, "Open")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_SEPERATOR, item_open, 0}, // Open
{reinterpret_cast<unsigned char const*>(kittengets(5, 2, "New Directory")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_SEPERATOR, new_directory, 0}, // New directory
{reinterpret_cast<unsigned char const*>(kittengets(5, 3, "Exit")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, 0, file_manager_exit, 0}, // Exit
{0}
};
static struct menuitem file_menu[4];
// Edit menu of file manager
struct menuitem edit_menu[] =
{
{reinterpret_cast<unsigned char const*>(kittengets(6, 1, "Cut")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, 0, cut_item, 0}, // Cut
{reinterpret_cast<unsigned char const*>(kittengets(6, 2, "Copy")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, 0, copy_item, 0}, // Copy
{reinterpret_cast<unsigned char const*>(kittengets(6, 3, "Paste")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_SEPERATOR, paste_item, 0}, // Paste
{reinterpret_cast<unsigned char const*>(kittengets(6, 4, "Rename")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_SEPERATOR, rename_item, 0}, // Reanme
{reinterpret_cast<unsigned char const*>(kittengets(6, 5, "Change Attribute")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_SUBMENU | MENUITEM_SEPERATOR, 0, 0}, // Change Attribute
{reinterpret_cast<unsigned char const*>(kittengets(6, 6, "Archive")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_CHECKBOX, change_archive_attribute, 0}, // Archive
{reinterpret_cast<unsigned char const*>(kittengets(6, 7, "Hidden")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_CHECKBOX, change_hidden_attribute, 0}, // Hidden
{reinterpret_cast<unsigned char const*>(kittengets(6, 8, "Read Only")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_CHECKBOX, change_read_only_attribute, 0}, // Read Only
{reinterpret_cast<unsigned char const*>(kittengets(6, 9, "System")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_CHECKBOX, change_system_attribute, 0}, // System
{0},
{reinterpret_cast<unsigned char const*>(kittengets(6, 10, "Delete")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, 0, delete_item, 0}, // Delete
{0}
};
static struct menuitem edit_menu[12];
// View menu of file manager
struct menuitem view_menu[] =
{
{reinterpret_cast<unsigned char const*>(kittengets(7, 1, "Refresh")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_SEPERATOR, directory_view, 0}, // Refresh
{reinterpret_cast<unsigned char const*>(kittengets(7, 2, "Show Archive Items")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_CHECKBOX | MENUITEM_VALUE, show_archive_items, 0}, // Show archive files
{reinterpret_cast<unsigned char const*>(kittengets(7, 3, "Show Hidden Items")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_CHECKBOX | MENUITEM_VALUE, show_hidden_items, 0}, // Show hidden files
{reinterpret_cast<unsigned char const*>(kittengets(7, 4, "Show Readonly Items")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_CHECKBOX, show_read_only_items, 0}, // Show read only files
{reinterpret_cast<unsigned char const*>(kittengets(7, 5, "Show System Items")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_CHECKBOX, show_system_items, 0}, // Show system files
{0}
};
static struct menuitem view_menu[6];
// Go menu of file manager
struct menuitem go_menu[] =
{
{reinterpret_cast<unsigned char const*>(kittengets(8, 1, "Back")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_DISABLED, history_back, 0}, // Back
{reinterpret_cast<unsigned char const*>(kittengets(8, 2, "Foward")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_DISABLED, history_foward, 0}, // Foward
{reinterpret_cast<unsigned char const*>(kittengets(8, 3, "Up")), MENUITEM_MNEMONIC_NONE, 0, SCAN_NONE, MENUITEM_DISABLED, change_to_upper_directory, 0}, // Up
{0}
};
static struct menuitem go_menu[4];
// Menubar of file manager
struct menuitembar menus_of_file_manager[] =
{
{reinterpret_cast<unsigned char const*>(kittengets(5, 0, "File")), 0, SCAN_NONE, file_menu}, // File
{reinterpret_cast<unsigned char const*>(kittengets(6, 0, "Edit")), 0, SCAN_NONE, edit_menu}, // Edit
{reinterpret_cast<unsigned char const*>(kittengets(7, 0, "View")), 0, SCAN_NONE, view_menu}, // View
{reinterpret_cast<unsigned char const*>(kittengets(8, 0, "Go")), 0, SCAN_NONE, go_menu}, // Go
{0}
};
static struct menuitembar menus_of_file_manager[5];
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment