2.5 KiB
HACKING
Check out the issue tracker if you don't know yet what you want to hack on.
Coding style
- match the sorroundings
- no overcomplicated pointfree style
- normal indenting 2 whitespaces
- just make things pretty and readable
- use the provided hsimport.hs
Documentation
Everything must be documented. :)
Hacking Guide
The main data structure for the IO related File type is in HSFM.FileSystem.FileType, which should be seen as a library. This is the entry point where directory contents are read and the File type in general is constructed. The File type uses a safe Path type under the hood instead of Strings, utilizing the hpath library. Note that mostly only absolute paths are allowed on type level to improve path and thread safety.
File operations (like copy, delete etc) are defined at HSFM.FileSystem.FileOperation which use this File type.
Only a GTK GUI is currently implemented, the entry point being HSFM.GUI.Gtk. From there it flows down to creating a MyGUI object in HSFM.GUI.Gtk.MyGUI, which is sort of a global object for the whole window. Inside this object are theoretically multiple MyView objects allowed which represent the actual view on the filesystem and related widgets, which are constructed in HSFM.GUI.Gtk.MyView. Both MyGUI and MyView are more or less accessible throughout the whole GTK callstack, expclicitly passed as parameters.
For adding new GTK widgets with functionality you mostly have to touch the following files:
- builder.xml: this defines the main GUI widgets which are static, use the glade editor to add stuff
- HSFM.GUI.Gtk.Data: add the widget to e.g. the MyGUI type so we can access it throughout the GTK call stack
- HSFM.GUI.Gtk.MyGUI: add initializers for the GUI buttons to be fetched from the GTK builder.xml file
- HSFM.GUI.Gtk.Callbacks: define the callbacks and the actual functionality here