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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
notepad/types.odin

58 lines
962 B
Plaintext

package main
import sdl "vendor:sdl2"
import ttf "vendor:sdl2/ttf"
// Text buffer for a single file
Text_Buffer :: struct {
lines: [dynamic]string,
filename: string,
modified: bool,
cursor_line: int,
cursor_col: int,
scroll_y: int,
max_line_width: int,
}
// Tab structure
Tab :: struct {
name: string,
buffer: Text_Buffer,
rect: sdl.Rect,
}
Colours :: struct {
background: sdl.Colour,
text: sdl.Colour,
line_numbers_background: sdl.Colour,
line_numbers: sdl.Colour,
active_tab: sdl.Colour,
inactive_tab: sdl.Colour,
tab_border: sdl.Colour,
cursor: sdl.Colour
}
Config :: struct {
font: string,
font_size: int,
colours: Colours,
}
// Application state
App :: struct {
window: ^sdl.Window,
renderer: ^sdl.Renderer,
font: ^ttf.Font,
tabs: [dynamic]Tab,
active_tab: int,
running: bool,
char_width: i32,
char_height: i32,
text_area_width: i32,
visible_lines: int,
cursor_blink_timer: u32,
show_cursor: bool,
config: Config,
}