4coder/code/4ed_file.h

94 lines
1.6 KiB
C
Raw Permalink Normal View History

/*
* Mr. 4th Dimention - Allen Webster
*
* 24.01.2018
*
* Buffer types
*
*/
// TOP
#if !defined(FRED_FILE_H)
#define FRED_FILE_H
struct File_Edit_Positions{
Buffer_Scroll scroll;
i64 cursor_pos;
};
struct Editing_File_Settings{
Layout_Function *layout_func;
Face_ID face_id;
b8 dos_write_mode;
b8 is_initialized;
b8 unimportant;
b8 read_only;
b8 unkillable;
b8 never_kill;
};
struct Line_Layout_Key{
Face_ID face_id;
i32 face_version_number;
f32 width;
i64 line_number;
};
typedef i32 File_Save_State;
enum{
FileSaveState_Normal,
FileSaveState_SavedWaitingForNotification,
};
struct Editing_File_State{
Gap_Buffer buffer;
2019-02-08 10:03:48 +00:00
History history;
i32 current_record_index;
Dirty_State dirty;
File_Save_State save_state;
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;
Child_Process_ID attached_child_process;
Arena cached_layouts_arena;
Table_Data_u64 line_layout_table;
};
struct Editing_File_Name{
2019-06-01 23:58:28 +00:00
u8 name_space[256];
u64 name_size;
};
struct Editing_File{
2019-08-12 09:16:04 +00:00
union{
Editing_File *next;
Node main_chain_node;
};
Node touch_node;
2019-08-13 18:54:15 +00:00
Node external_mod_node;
2019-08-12 09:16:04 +00:00
Buffer_ID id;
Editing_File_Settings settings;
Editing_File_State state;
File_Attributes attributes;
Lifetime_Object *lifetime_object;
Editing_File_Name base_name;
Editing_File_Name unique_name;
Editing_File_Name canon;
};
struct Buffer_Point_Delta{
Buffer_Point new_point;
f32 y_shift;
};
#endif
// BOTTOM