You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
notepad_squared/types.odin

79 lines
1.2 KiB
Plaintext

package main
import "core:thread"
import rl "vendor:raylib"
Colour :: rl.Color
// Font configuration
FontConfig :: struct {
font: rl.Font,
size: f32,
name: string
}
// Text selection
Selection :: struct {
start: int,
end: int,
active: bool
}
// Wrapped line information
WrappedLine :: struct {
text: string,
original_line: int,
character_offset: int
}
// File buffer structure
File_Buffer :: struct {
filename: string,
content: string,
modified: bool,
cursor_pos: int,
scroll_y: f32,
selection: Selection,
thread: ^thread.Thread,
finished_saving: bool
}
Colours :: struct {
background: Colour,
text: Colour,
line_numbers_background: Colour,
line_numbers: Colour,
highlight: Colour,
status_bar: Colour,
status_bar_text: Colour,
active_tab: Colour,
inactive_tab: Colour,
tab_border: Colour,
cursor: Colour
}
Config :: struct {
font: string,
font_size: int,
colours: Colours
}
App :: struct {
files: [dynamic]File_Buffer,
active_tab: int,
fonts: [dynamic]FontConfig,
current_font_index: int,
line_height: f32,
tab_height: f32,
window_width: i32,
window_height: i32,
text_area_y: f32,
line_number_width: f32,
mouse_drag_start: int,
is_dragging: bool,
copied_text: string,
config: Config,
file_dialog_open: bool
}