import fpath "core:path/filepath"
-import nc "ncurses"
+import nc "../ncurses"
-import "../common"
+COLOR_FIRST :: 16
+COLOR_SECOND :: 17
+COLOR_THIRD :: 18
+COLOR_FOURTH :: 19
+ COLOR_FIRST :: 16
+ COLOR_SECOND :: 17
+ COLOR_THIRD :: 18
+
Config :: struct {
selected_profile: Maybe(string),
}
nc.init_color(COLOR_FIRST, 800, 800, 800)
nc.init_color(COLOR_SECOND, 500, 500, 500)
++<<<<<<< HEAD
+ nc.init_color(COLOR_THIRD, 200, 200, 200)
+ nc.init_color(COLOR_FOURTH, 000, 000, 000)
+
+ nc.init_pair(1, COLOR_FIRST, COLOR_THIRD)
+ nc.init_pair(2, COLOR_FIRST, COLOR_FOURTH)
++=======
+ nc.init_color(COLOR_THIRD, 100, 100, 100)
+
+ nc.init_pair(1, nc.COLOR_WHITE, COLOR_THIRD)
++>>>>>>> refs/remotes/origin/master
screen_height, screen_width := nc.getmaxyx(screen)
}
app := App{
++<<<<<<< HEAD
+ running = true,
+
++=======
++>>>>>>> refs/remotes/origin/master
screen = screen,
storage_path = storage_path,
input_window = input_window,
}
++<<<<<<< HEAD
+ app_clear_info_bar(app)
++=======
+ app_set_state(&app, .Load_Config)
++>>>>>>> refs/remotes/origin/master
return app
}
nc.clear()
nc.refresh()
++<<<<<<< HEAD
++=======
+ app_clear_box_message(app)
++>>>>>>> refs/remotes/origin/master
app_clear_info_bar(app^)
app.state = state
}
app_set_info_bar :: proc(app: ^App, content: string) {
++<<<<<<< HEAD
+ app_clear_info_bar(app^)
+
+ c_content := strings.clone_to_cstring(content, context.temp_allocator)
+
+ nc.wattron(app.info_bar, nc.COLOR_PAIR(1))
+ nc.wprintw(app.info_bar, c_content)
+ nc.wattroff(app.info_bar, nc.COLOR_PAIR(1))
+
+ nc.wrefresh(app.info_bar)
++=======
+ c_content := strings.clone_to_cstring(content, context.temp_allocator)
+
+ color := nc.COLOR_PAIR(1)
+
+ nc.wattron(app.info_bar, color)
+ nc.wprintw(app.info_bar, c_content)
+ nc.wattroff(app.info_bar, color)
++>>>>>>> refs/remotes/origin/master
}
app_set_box_message :: proc(app: ^App, lines: []string) {
(screen_width - width) / 2,
)
++<<<<<<< HEAD
+ color := nc.COLOR_PAIR(2)
+
+ nc.wattron(box_message, color)
++=======
+ nc.refresh()
+
+ nc.wattron(box_message, COLOR_FIRST)
++>>>>>>> refs/remotes/origin/master
for line, i in lines {
c_line := strings.clone_to_cstring(line, context.temp_allocator)
}
nc.box(box_message, 0, 0)
++<<<<<<< HEAD
+ nc.wattroff(box_message, color)
++=======
+ nc.wattroff(box_message, COLOR_FIRST)
++>>>>>>> refs/remotes/origin/master
nc.wrefresh(box_message)
app_clear_info_bar :: proc(app: App) {
height, width := nc.getmaxyx(app.info_bar)
++<<<<<<< HEAD
+ color := nc.COLOR_PAIR(1)
+
+ nc.wclear(app.info_bar)
+ nc.wattron(app.info_bar, color)
+
+ for _ in 0..<width {
+ nc.waddch(app.info_bar, ' ')
+ }
+
+ nc.wattroff(app.info_bar, color)
++=======
+
+ color := nc.COLOR_PAIR(1)
+
+ nc.wclear(app.info_bar)
+
+ nc.wattron(app.info_bar, color)
+
+ for _ in 0..<width {
+ nc.waddch(app.info_bar, ' ')
+ }
+
+ nc.wattroff(app.info_bar, color)
++>>>>>>> refs/remotes/origin/master
nc.wrefresh(app.info_bar)
}
screen_height, screen_width := nc.getmaxyx(app.screen)
nc.curs_set(1)
++<<<<<<< HEAD
+ nc.wgetnstr(app.input_window, raw_data(buffer[:]), len(buffer))
++=======
+ nc.mvwgetnstr(app.input_window, 0, 0, raw_data(buffer[:]), len(buffer))
++>>>>>>> refs/remotes/origin/master
nc.curs_set(0)
+ nc.wclear(app.input_window)
+
return strings.clone_from_cstring(cstring(raw_data(&buffer)))
}