package dev.fyloz.plannervio.ui import dev.fyloz.plannervio.core.repository.IBoardRepository import dev.fyloz.plannervio.core.repository.memory.MemoryBoardRepository import dev.fyloz.plannervio.core.service.BackgroundImageService import dev.fyloz.plannervio.core.service.BoardService import dev.fyloz.plannervio.core.service.IBackgroundImageService import dev.fyloz.plannervio.core.service.IBoardService import dev.fyloz.plannervio.ui.style.Style import dev.fyloz.plannervio.ui.view.MainView import org.kodein.di.DI import org.kodein.di.DIAware import org.kodein.di.bind import org.kodein.di.singleton import org.kodein.di.tornadofx.installTornadoSource import tornadofx.App import tornadofx.launch import tornadofx.loadFont import tornadofx.reloadStylesheetsOnFocus fun main(args: Array) { launch(args) } class Plannervio : App(MainView::class, Style::class), DIAware { override val di: DI get() = DI { installTornadoSource() bind() with singleton { MemoryBoardRepository() } bind() with singleton { BoardService(di) } bind() with singleton { BackgroundImageService() } } init { loadFonts() reloadStylesheetsOnFocus() } private fun loadFonts() { loadFont("/fonts/biryani/Biryani-Regular.ttf", 12) loadFont("/fonts/biryani/Biryani-DemiBold.ttf", 12) } }