From 12f8ef6dbf8618aaa304d239fbfd3c1b7b4494d3 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Mon, 5 Jan 2026 14:26:32 -0700 Subject: [reog] Add separate Link.hs file. This file is a sibling to the Config file. It just provides the cold/hot start bindings for the plugin. This keeps the Config file clean and doesn't pollute it with non-config ceremony. --- plug/src/Config.hs | 14 +------------- plug/src/Link.hs | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 plug/src/Link.hs (limited to 'plug/src') diff --git a/plug/src/Config.hs b/plug/src/Config.hs index 50133b4..8ec06dd 100644 --- a/plug/src/Config.hs +++ b/plug/src/Config.hs @@ -1,4 +1,4 @@ -module Config () where +module Config (config) where import Control.Monad.IO.Class (liftIO) import Data.Bits (shiftL, (.&.)) @@ -9,18 +9,6 @@ import Montis.Standard.Drag (DragConfig (DragConfig)) import Montis.Standard.Keys (KeysConfig (KeysConfig), subkeys) import Montis.Standard.Mouse (MouseConfig (MouseConfig)) -foreign export ccall "plugin_cold_start" - coldStart :: MontisColdStart - -foreign export ccall "plugin_hot_start" - hotStart :: MontisHotStart - -coldStart :: MontisColdStart -coldStart = coldStartMontis config - -hotStart :: MontisHotStart -hotStart = hotStartMontis config - keys :: KeyEvent -> Montis Bool keys ev | keyEvent_modifiers ev .&. mod1Mask == 0 = return False diff --git a/plug/src/Link.hs b/plug/src/Link.hs new file mode 100644 index 0000000..4ac3f5c --- /dev/null +++ b/plug/src/Link.hs @@ -0,0 +1,18 @@ +-- | Module that provides the start hooks using the config required to link the +-- plugin's shared library. +module Link () where + +import Config (config) +import Montis.Core + +foreign export ccall "plugin_cold_start" + coldStart :: MontisColdStart + +foreign export ccall "plugin_hot_start" + hotStart :: MontisHotStart + +coldStart :: MontisColdStart +coldStart = coldStartMontis config + +hotStart :: MontisHotStart +hotStart = hotStartMontis config -- cgit