2018-03-24 10:06:45 +00:00
|
|
|
/*
|
|
|
|
* Mr. 4th Dimention - Allen Webster
|
|
|
|
*
|
|
|
|
* 17.07.2017
|
|
|
|
*
|
|
|
|
* File editing view for 4coder.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
// TOP
|
|
|
|
|
|
|
|
#if !defined(FRED_VIEW_H)
|
|
|
|
#define FRED_VIEW_H
|
|
|
|
|
2019-02-10 09:18:34 +00:00
|
|
|
struct View{
|
2018-03-24 10:06:45 +00:00
|
|
|
struct View *next;
|
|
|
|
struct View *prev;
|
|
|
|
struct Panel *panel;
|
|
|
|
b32 in_use;
|
|
|
|
|
2019-02-27 05:49:35 +00:00
|
|
|
Editing_File *file;
|
2018-08-12 03:45:09 +00:00
|
|
|
Lifetime_Object *lifetime_object;
|
2018-03-24 10:06:45 +00:00
|
|
|
|
2019-02-09 22:48:53 +00:00
|
|
|
File_Edit_Positions edit_pos_;
|
2019-06-20 23:43:27 +00:00
|
|
|
i64 mark;
|
2019-02-10 09:18:34 +00:00
|
|
|
f32 preferred_x;
|
2018-03-24 10:06:45 +00:00
|
|
|
|
2019-02-10 02:56:29 +00:00
|
|
|
i32 temp_view_top_left_pos;
|
|
|
|
i32 temp_view_top_left_target_pos;
|
|
|
|
|
2018-09-14 19:02:02 +00:00
|
|
|
b32 ui_mode;
|
2019-02-26 19:59:57 +00:00
|
|
|
i32 ui_map_id;
|
2018-07-17 03:21:22 +00:00
|
|
|
GUI_Scroll_Vars ui_scroll;
|
2019-02-26 19:59:57 +00:00
|
|
|
UI_Quit_Function_Type *ui_quit;
|
|
|
|
|
2019-02-10 07:48:07 +00:00
|
|
|
Vec2_i32 prev_target;
|
2018-03-24 10:06:45 +00:00
|
|
|
|
|
|
|
b32 hide_scrollbar;
|
|
|
|
b32 hide_file_bar;
|
2019-02-27 05:49:35 +00:00
|
|
|
b32 show_whitespace;
|
2018-03-24 10:06:45 +00:00
|
|
|
|
|
|
|
// misc
|
|
|
|
|
|
|
|
Query_Set query_set;
|
2019-03-31 18:55:26 +00:00
|
|
|
|
|
|
|
// Render Context
|
|
|
|
Arena layout_arena;
|
|
|
|
|
|
|
|
struct{
|
|
|
|
i32_Rect view_rect;
|
|
|
|
i32_Rect buffer_rect;
|
|
|
|
Full_Cursor cursor;
|
|
|
|
Range range;
|
|
|
|
Buffer_Render_Item *items;
|
|
|
|
i32 item_count;
|
|
|
|
} render;
|
2018-03-24 10:06:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Live_Views{
|
|
|
|
View *views;
|
|
|
|
View free_sentinel;
|
2018-09-22 00:29:32 +00:00
|
|
|
i32 count;
|
|
|
|
i32 max;
|
2018-03-24 10:06:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Cursor_Limits{
|
2019-02-10 07:48:07 +00:00
|
|
|
i32 min;
|
|
|
|
i32 max;
|
|
|
|
i32 delta;
|
2018-03-24 10:06:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum{
|
|
|
|
GROW_FAILED,
|
|
|
|
GROW_NOT_NEEDED,
|
|
|
|
GROW_SUCCESS,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Wrap_Indent_Pair{
|
|
|
|
i32 wrap_position;
|
|
|
|
f32 line_shift;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Potential_Wrap_Indent_Pair{
|
|
|
|
i32 wrap_position;
|
|
|
|
f32 line_shift;
|
|
|
|
|
|
|
|
f32 wrap_x;
|
|
|
|
i32 wrappable_score;
|
|
|
|
|
|
|
|
b32 adjust_top_to_this;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Shift_Information{
|
2018-09-22 00:29:32 +00:00
|
|
|
i32 start;
|
|
|
|
i32 end;
|
|
|
|
i32 amount;
|
2018-03-24 10:06:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct File_Bar{
|
2019-02-24 22:54:57 +00:00
|
|
|
Vec2 pos;
|
|
|
|
Vec2 text_shift;
|
2018-03-24 10:06:45 +00:00
|
|
|
i32_Rect rect;
|
|
|
|
Face_ID font_id;
|
|
|
|
};
|
|
|
|
|
2019-06-01 23:58:28 +00:00
|
|
|
#if 0
|
2018-03-24 10:06:45 +00:00
|
|
|
struct Style_Color_Edit{
|
|
|
|
Style_Tag target;
|
|
|
|
Style_Tag fore;
|
|
|
|
Style_Tag back;
|
2019-06-01 23:58:28 +00:00
|
|
|
String_Const_u8 text;
|
2018-03-24 10:06:45 +00:00
|
|
|
};
|
2019-06-01 23:58:28 +00:00
|
|
|
#endif
|
2018-03-24 10:06:45 +00:00
|
|
|
|
|
|
|
struct Single_Line_Input_Step{
|
|
|
|
b8 hit_newline;
|
|
|
|
b8 hit_ctrl_newline;
|
|
|
|
b8 hit_a_character;
|
|
|
|
b8 hit_backspace;
|
|
|
|
b8 hit_esc;
|
|
|
|
b8 made_a_change;
|
|
|
|
b8 did_command;
|
|
|
|
b8 no_file_match;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Single_Line_Input_Type{
|
|
|
|
SINGLE_LINE_STRING,
|
|
|
|
SINGLE_LINE_FILE
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Single_Line_Mode{
|
|
|
|
Single_Line_Input_Type type;
|
2019-06-01 23:58:28 +00:00
|
|
|
String_Const_u8 *string;
|
2018-03-24 10:06:45 +00:00
|
|
|
Hot_Directory *hot_directory;
|
|
|
|
b32 fast_folder_select;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct View_Step_Result{
|
|
|
|
b32 animating;
|
|
|
|
b32 consume_keys;
|
|
|
|
b32 consume_esc;
|
|
|
|
};
|
|
|
|
|
2019-02-25 23:42:13 +00:00
|
|
|
struct Render_Marker_Brush{
|
|
|
|
b8 color_noop;
|
|
|
|
b8 text_color_noop;
|
|
|
|
argb_color color;
|
|
|
|
argb_color text_color;
|
|
|
|
};
|
|
|
|
|
2018-09-22 00:29:32 +00:00
|
|
|
struct Render_Marker{
|
2018-10-01 19:32:28 +00:00
|
|
|
Marker_Visual_Type type;
|
2019-02-25 23:42:13 +00:00
|
|
|
Render_Marker_Brush brush;
|
2018-09-22 00:29:32 +00:00
|
|
|
i32 pos;
|
2018-09-30 12:14:47 +00:00
|
|
|
i32 one_past_last;
|
|
|
|
i32 priority;
|
|
|
|
};
|
|
|
|
|
2019-06-01 23:58:28 +00:00
|
|
|
struct Render_Marker_Node{
|
|
|
|
Render_Marker_Node *next;
|
|
|
|
Render_Marker render_marker;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Render_Marker_List{
|
|
|
|
Render_Marker_Node *first;
|
|
|
|
Render_Marker_Node *last;
|
|
|
|
i32 count;
|
|
|
|
};
|
|
|
|
|
2018-09-30 12:14:47 +00:00
|
|
|
struct Render_Range_Record{
|
2019-02-25 23:42:13 +00:00
|
|
|
Render_Marker_Brush brush;
|
2018-09-30 12:14:47 +00:00
|
|
|
i32 one_past_last;
|
|
|
|
i32 priority;
|
2018-09-22 00:29:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Render_Marker_Array{
|
|
|
|
Render_Marker *markers;
|
|
|
|
i32 count;
|
|
|
|
};
|
|
|
|
|
2018-03-24 10:06:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// BOTTOM
|
|
|
|
|