2016-02-01 05:03:42 +00:00
|
|
|
/*
|
|
|
|
* Mr. 4th Dimention - Allen Webster
|
|
|
|
*
|
2016-05-06 15:34:08 +00:00
|
|
|
* 06.05.2016 (dd.mm.yyyy)
|
2016-02-01 05:03:42 +00:00
|
|
|
*
|
|
|
|
* Global app level settings definition
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
// TOP
|
|
|
|
|
2018-03-24 21:43:57 +00:00
|
|
|
#if !defined(FRED_APP_MODELS_H)
|
|
|
|
#define FRED_APP_MODELS_H
|
|
|
|
|
2016-02-01 05:03:42 +00:00
|
|
|
struct App_Settings{
|
|
|
|
char *init_files[8];
|
|
|
|
i32 init_files_count;
|
|
|
|
i32 init_files_max;
|
2017-01-30 18:41:08 +00:00
|
|
|
|
2017-06-23 23:07:18 +00:00
|
|
|
char **custom_flags;
|
|
|
|
i32 custom_flags_count;
|
|
|
|
|
2016-02-01 05:03:42 +00:00
|
|
|
i32 initial_line;
|
|
|
|
b32 lctrl_lalt_is_altgr;
|
2016-03-21 22:27:27 +00:00
|
|
|
|
2017-11-20 23:31:57 +00:00
|
|
|
i32 font_size;
|
|
|
|
b32 use_hinting;
|
2016-02-01 05:03:42 +00:00
|
|
|
};
|
|
|
|
|
2016-03-07 05:13:20 +00:00
|
|
|
struct Models{
|
2016-03-04 01:41:52 +00:00
|
|
|
Mem_Options mem;
|
|
|
|
App_Settings settings;
|
|
|
|
|
2017-11-20 23:31:57 +00:00
|
|
|
Face_ID global_font_id;
|
2017-03-11 18:35:12 +00:00
|
|
|
|
2017-11-08 18:24:30 +00:00
|
|
|
Mapping mapping;
|
2016-03-04 01:41:52 +00:00
|
|
|
|
|
|
|
Command_Binding prev_command;
|
|
|
|
|
2018-08-04 02:41:38 +00:00
|
|
|
i32 prev_x;
|
|
|
|
i32 prev_y;
|
|
|
|
b32 animated_last_frame;
|
|
|
|
|
2017-07-19 20:07:50 +00:00
|
|
|
Coroutine_Head *command_coroutine;
|
2016-03-04 01:41:52 +00:00
|
|
|
u32 command_coroutine_flags[2];
|
|
|
|
|
2016-03-07 05:13:20 +00:00
|
|
|
Hook_Function *hooks[hook_type_count];
|
2016-05-14 20:08:11 +00:00
|
|
|
Application_Links app_links;
|
2016-03-04 01:41:52 +00:00
|
|
|
|
2016-09-09 13:04:51 +00:00
|
|
|
Custom_API config_api;
|
|
|
|
|
2017-06-23 23:07:18 +00:00
|
|
|
Start_Hook_Function *hook_start;
|
2016-09-09 13:04:51 +00:00
|
|
|
Open_File_Hook_Function *hook_open_file;
|
|
|
|
Open_File_Hook_Function *hook_new_file;
|
2016-12-26 22:49:01 +00:00
|
|
|
Open_File_Hook_Function *hook_save_file;
|
2017-04-18 15:41:49 +00:00
|
|
|
Open_File_Hook_Function *hook_end_file;
|
2016-09-09 13:04:51 +00:00
|
|
|
Command_Caller_Hook_Function *command_caller;
|
|
|
|
Input_Filter_Function *input_filter;
|
|
|
|
Scroll_Rule_Function *scroll_rule;
|
2017-11-30 23:25:49 +00:00
|
|
|
Buffer_Name_Resolver_Function *buffer_name_resolver;
|
2016-09-09 13:04:51 +00:00
|
|
|
|
2016-03-04 01:41:52 +00:00
|
|
|
Style_Library styles;
|
|
|
|
u32 *palette;
|
|
|
|
|
|
|
|
Editing_Layout layout;
|
|
|
|
Working_Set working_set;
|
2017-07-17 23:35:13 +00:00
|
|
|
Live_Views live_set;
|
2017-05-19 23:55:50 +00:00
|
|
|
Parse_Context_Memory parse_context_memory;
|
|
|
|
|
2018-08-11 05:42:00 +00:00
|
|
|
Dynamic_Variable_Layout variable_layout;
|
2018-08-18 08:16:52 +00:00
|
|
|
Dynamic_Workspace dynamic_workspace;
|
2018-08-12 03:45:09 +00:00
|
|
|
Lifetime_Allocator lifetime_allocator;
|
2018-06-23 03:03:58 +00:00
|
|
|
|
2016-03-20 21:51:58 +00:00
|
|
|
Editing_File *message_buffer;
|
2016-06-29 17:45:26 +00:00
|
|
|
Editing_File *scratch_buffer;
|
2016-05-19 18:01:36 +00:00
|
|
|
|
2016-03-04 01:41:52 +00:00
|
|
|
Hot_Directory hot_directory;
|
2016-05-19 18:01:36 +00:00
|
|
|
|
2016-03-04 01:41:52 +00:00
|
|
|
Panel *prev_mouse_panel;
|
|
|
|
|
2016-05-29 21:34:52 +00:00
|
|
|
b32 keep_playing;
|
2016-06-07 16:26:11 +00:00
|
|
|
|
2017-02-17 22:03:19 +00:00
|
|
|
Key_Code user_up_key;
|
|
|
|
Key_Code user_down_key;
|
2017-04-15 21:47:23 +00:00
|
|
|
Key_Modifier user_up_key_modifier;
|
|
|
|
Key_Modifier user_down_key_modifier;
|
2017-11-30 19:02:37 +00:00
|
|
|
|
|
|
|
b32 has_new_title;
|
|
|
|
char *title_space;
|
|
|
|
i32 title_capacity;
|
2018-03-10 02:06:55 +00:00
|
|
|
|
|
|
|
i32 frame_counter;
|
|
|
|
|
|
|
|
i32 previous_mouse_x;
|
|
|
|
i32 previous_mouse_y;
|
2016-03-04 01:41:52 +00:00
|
|
|
};
|
|
|
|
|
2018-03-24 21:43:57 +00:00
|
|
|
////////////////////////////////
|
|
|
|
|
2018-08-12 03:45:09 +00:00
|
|
|
typedef i32 Lifetime_Object_Type;
|
|
|
|
enum{
|
|
|
|
LifetimeObject_File = 0,
|
|
|
|
LifetimeObject_View = 1,
|
|
|
|
};
|
|
|
|
|
2018-03-24 21:43:57 +00:00
|
|
|
enum App_State{
|
|
|
|
APP_STATE_EDIT,
|
|
|
|
APP_STATE_RESIZING,
|
|
|
|
// never below this
|
|
|
|
APP_STATE_COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
struct App_State_Resizing{
|
|
|
|
Panel_Divider *divider;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Command_Data{
|
|
|
|
Models *models;
|
|
|
|
struct App_Vars *vars;
|
|
|
|
System_Functions *system;
|
|
|
|
Live_Views *live_set;
|
|
|
|
|
|
|
|
i32 screen_width;
|
|
|
|
i32 screen_height;
|
|
|
|
|
|
|
|
Key_Event_Data key;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Input_Types{
|
|
|
|
Input_AnyKey,
|
|
|
|
Input_Esc,
|
|
|
|
Input_MouseMove,
|
|
|
|
Input_MouseLeftButton,
|
|
|
|
Input_MouseRightButton,
|
|
|
|
Input_MouseWheel,
|
|
|
|
Input_Count
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Consumption_Record{
|
|
|
|
b32 consumed;
|
|
|
|
char consumer[32];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Available_Input{
|
|
|
|
Key_Input_Data *keys;
|
|
|
|
Mouse_State *mouse;
|
|
|
|
Consumption_Record records[Input_Count];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct App_Vars{
|
|
|
|
Models models;
|
|
|
|
|
|
|
|
CLI_List cli_processes;
|
|
|
|
|
|
|
|
App_State state;
|
|
|
|
App_State_Resizing resizing;
|
|
|
|
|
|
|
|
Command_Data command_data;
|
|
|
|
|
|
|
|
Available_Input available_input;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Coroutine_Type{
|
|
|
|
Co_View,
|
|
|
|
Co_Command
|
|
|
|
};
|
|
|
|
struct App_Coroutine_State{
|
|
|
|
void *co;
|
|
|
|
i32 type;
|
|
|
|
};
|
2016-02-01 05:03:42 +00:00
|
|
|
|
2018-03-24 21:43:57 +00:00
|
|
|
struct Command_In{
|
|
|
|
Command_Data *cmd;
|
|
|
|
Command_Binding bind;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct File_Init{
|
|
|
|
String name;
|
|
|
|
Editing_File **ptr;
|
|
|
|
b32 read_only;
|
|
|
|
};
|
2016-05-06 15:34:08 +00:00
|
|
|
|
2018-03-24 21:43:57 +00:00
|
|
|
enum{
|
|
|
|
Event_Keyboard,
|
|
|
|
Event_Mouse,
|
|
|
|
};
|
|
|
|
struct Coroutine_Event{
|
|
|
|
u32 type;
|
|
|
|
u32 key_i;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Command_Line_Action{
|
|
|
|
CLAct_Nothing,
|
|
|
|
CLAct_Ignore,
|
|
|
|
CLAct_UserFile,
|
|
|
|
CLAct_CustomDLL,
|
|
|
|
CLAct_InitialFilePosition,
|
|
|
|
CLAct_WindowSize,
|
|
|
|
CLAct_WindowMaximize,
|
|
|
|
CLAct_WindowPosition,
|
|
|
|
CLAct_WindowFullscreen,
|
|
|
|
CLAct_FontSize,
|
|
|
|
CLAct_FontUseHinting,
|
|
|
|
CLAct_LogStdout,
|
|
|
|
CLAct_LogFile,
|
|
|
|
//
|
|
|
|
CLAct_COUNT,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Command_Line_Mode{
|
|
|
|
CLMode_App,
|
|
|
|
CLMode_Custom
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// BOTTOM
|
2016-05-06 15:34:08 +00:00
|
|
|
|