2018-03-24 10:06:45 +00:00
|
|
|
/*
|
|
|
|
* Mr. 4th Dimention - Allen Webster
|
|
|
|
*
|
|
|
|
* 24.01.2018
|
|
|
|
*
|
|
|
|
* Buffer types
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
// TOP
|
|
|
|
|
|
|
|
#if !defined(FRED_FILE_H)
|
|
|
|
#define FRED_FILE_H
|
|
|
|
|
2019-02-10 02:56:29 +00:00
|
|
|
typedef i32 Edit_Pos_Set_Type;
|
|
|
|
enum{
|
2018-03-24 10:06:45 +00:00
|
|
|
EditPos_None,
|
|
|
|
EditPos_CursorSet,
|
|
|
|
EditPos_ScrollSet
|
|
|
|
};
|
|
|
|
struct File_Edit_Positions{
|
2019-02-10 02:56:29 +00:00
|
|
|
Edit_Pos_Set_Type last_set_type;
|
2019-09-02 18:59:36 +00:00
|
|
|
Buffer_Scroll scroll;
|
2019-06-20 23:43:27 +00:00
|
|
|
i64 cursor_pos;
|
2018-03-24 10:06:45 +00:00
|
|
|
};
|
|
|
|
|
2019-04-01 04:24:13 +00:00
|
|
|
// TODO(allen): do(replace Text_Effect with markers over time)
|
2018-03-24 10:06:45 +00:00
|
|
|
struct Text_Effect{
|
2019-09-02 18:59:36 +00:00
|
|
|
i64 start;
|
|
|
|
i64 end;
|
2018-03-24 10:06:45 +00:00
|
|
|
u32 color;
|
2019-02-10 00:20:55 +00:00
|
|
|
f32 seconds_down;
|
|
|
|
f32 seconds_max;
|
2018-03-24 10:06:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Editing_File_Settings{
|
|
|
|
i32 base_map_id;
|
|
|
|
Parse_Context_ID parse_context_id;
|
|
|
|
b32 dos_write_mode;
|
|
|
|
Face_ID font_id;
|
|
|
|
b8 tokens_exist;
|
|
|
|
b8 tokens_without_strings;
|
|
|
|
b8 is_initialized;
|
|
|
|
b8 unimportant;
|
|
|
|
b8 read_only;
|
|
|
|
b8 never_kill;
|
2019-09-02 18:59:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Line_Layout_Key{
|
|
|
|
Face_ID face_id;
|
|
|
|
i32 face_version_number;
|
|
|
|
f32 width;
|
|
|
|
i64 line_number;
|
2018-03-24 10:06:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Editing_File_State{
|
|
|
|
Gap_Buffer buffer;
|
|
|
|
|
2019-02-08 10:03:48 +00:00
|
|
|
History history;
|
|
|
|
i32 current_record_index;
|
2018-03-24 10:06:45 +00:00
|
|
|
|
2019-09-02 18:59:36 +00:00
|
|
|
// TODO(allen): eliminate this too
|
2018-03-24 10:06:45 +00:00
|
|
|
Cpp_Token_Array token_array;
|
2019-08-04 05:36:13 +00:00
|
|
|
b32 in_edit_handler;
|
2018-03-24 10:06:45 +00:00
|
|
|
|
|
|
|
Text_Effect paste_effect;
|
|
|
|
|
|
|
|
Dirty_State dirty;
|
|
|
|
u32 ignore_behind_os;
|
|
|
|
|
2019-02-09 22:48:53 +00:00
|
|
|
File_Edit_Positions edit_pos_most_recent;
|
2019-02-04 03:51:43 +00:00
|
|
|
File_Edit_Positions edit_pos_stack[16];
|
|
|
|
i32 edit_pos_stack_top;
|
2019-03-21 03:18:08 +00:00
|
|
|
|
|
|
|
Child_Process_ID attached_child_process;
|
2019-09-02 18:59:36 +00:00
|
|
|
|
|
|
|
Arena cached_layouts_arena;
|
|
|
|
Table_Data_u64 line_layout_table;
|
2018-03-24 10:06:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Editing_File_Name{
|
2019-06-01 23:58:28 +00:00
|
|
|
u8 name_space[256];
|
|
|
|
umem name_size;
|
2018-03-24 10:06:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Editing_File{
|
2019-08-12 09:16:04 +00:00
|
|
|
union{
|
|
|
|
Editing_File *next;
|
|
|
|
Node main_chain_node;
|
|
|
|
};
|
2019-08-13 00:51:27 +00:00
|
|
|
Node touch_node;
|
2019-08-13 18:54:15 +00:00
|
|
|
Node external_mod_node;
|
2019-08-13 04:19:02 +00:00
|
|
|
Node edit_finished_mark_node;
|
|
|
|
b32 edit_finished_marked;
|
|
|
|
b32 is_loading;
|
2019-08-12 09:16:04 +00:00
|
|
|
Buffer_ID id;
|
2018-03-24 10:06:45 +00:00
|
|
|
Editing_File_Settings settings;
|
|
|
|
Editing_File_State state;
|
2019-02-13 23:15:22 +00:00
|
|
|
File_Attributes attributes;
|
2018-08-12 03:45:09 +00:00
|
|
|
Lifetime_Object *lifetime_object;
|
2018-03-24 10:06:45 +00:00
|
|
|
Editing_File_Name base_name;
|
|
|
|
Editing_File_Name unique_name;
|
|
|
|
Editing_File_Name canon;
|
|
|
|
};
|
|
|
|
|
2019-09-02 18:59:36 +00:00
|
|
|
struct Buffer_Point_Delta{
|
|
|
|
Buffer_Point new_point;
|
|
|
|
f32 y_shift;
|
|
|
|
};
|
|
|
|
|
2018-03-24 10:06:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// BOTTOM
|
|
|
|
|