* Added asynchronous logging library
Did some rudimentary testing, might need more for safety.
Fixes#316 at least in part
* Included missing stdbool include
* Added console logging (in addition to file logging)
* Force a file flush at every write
This might be useful if we want to analyze the cause of a crash, if we
don't flush the file, one to several log lines might be missing.
* Added default log settings for release and debug versions
* Added LOG_*F formattable logging functions
* Allow the main thread to close the logger
Or LS will keep on logging from a detached thread.
* Empty the logger queue on thread exit.
This should remove the possibility of losing messages on exit.
* Add timestamps to logs and avoid double newlines
* Put the log file in XDG_DATA_DIR/libresplit
* Default LogLevel at Warns + Errors
Debug LogLevel stays at "everything"
* Bunch'o'statics
* Move prctl to the beginning of the logging thread code
* Properly free the splits icon paths on game release
This fixes a small memory leak when you load/unload/reload splits with
icons
* Correctly free stuff in the splits component too
* Fix two segfaults when timer is not loaded
A check is missing for the presence of timer, so if you right click ->
close and then try to open a split or auto splitter, libresplit
segfaults.
* Correctly free welcome_box on closing
* Make sure that malloc() in gui_settings actually works
In low-memory conditions the malloc may fail with undefined behaviour
* Revert connection of destroy signal
The widget is freed just before LibreSplit closes already. I thought it
was a disconnected signal handler.
* Autoimporter mon amour (non)
* Actually this one isn't needed anymore
In my system (and others) initializing a char* with strchr might turn up
as an error (in those cases the signature is `const char* strchr` instead of `char* strchr`).
Some sources say the signatures differ when the first argument is const,
others don't. This should fix the compilation issue at least.
* Added rough str2ida implementation
* Added small documentation.
* Move the lua pushed string to the heap
Works with compilers that don't support VLA and avoids
stack-overflow-induced headaches.
* Check if malloc actually mallocs
* Fix possible segfault if no type is defined.
The type of value to read is a mandatory argument, skipping directly to
the address (`readAddress(0x...)`) will lead to a segfault
* Fix possible segfault on calls without arguments
Just to be safe.
* Added main-window class
Seems that editing the `.window` class affects all windows in
LibreSplit, which is definitely unwanted.
Left the note in the CSS classes for posterity.
* Added another note on LibreSplit/GTK's theming capabilities
* Added a reset stylesheet as string
Theoretically, if it works as it should should fix both #272 and #63
* Applied suggestions and fixes
* Changed function signature and error handling
* Pointer Confusion
This shows the error in case of bad reset rules, tested by stepping with
GDB
* Fix segfault on first start
If no split_file is defined, there will be a NULL-point dereference,
leading to a segfault. This fixes that.
* First idea of "delayed keybind handlers"
* Trying to make the structure more reusable
Not sure it worked.
* Added missing pragma
* Fill out descriptions of themes.md
Some are self explanitory, but I got confused by a lot while making a theme so I thought I'd try and add something to everything.
* Update themes.md
From review from penaz
* Disallow changing splits or autosplitter if a run is on
Fixes#241
* Define external function to see if a run is started
Uses the RTA timer "running" property and the atomic_bool run_started
from the Auto splitter
* Replace or statement with relative descriptive function
* Use is_run_started for autosplitter warnings too
* Create confirm reset dialog
* Add detection logic for a gold in the current run
* Prompt for confirmation when run has a gold split
* Switch to using stdbool
* Move reset logic to not interfere with other logic
* Add a decimals parameter
Somewhat crudely fixes#178. Tends to hit onto the settings struct at
30/60/whatever times a second, but allows to have the decimals update
immediately after changing in the settings window.
* Allow to hide all digits from timers
The detailed timer will still show all 6 digits if "0" is used.
* Show welcome screen only when there is no timer or game loaded
Also fixes a SegFault due to removing the welcome screen being destroyed
by the "close splits" option.
Fixes#239
* Beautify welcome screen a little bit
* Removed useless else branch
If a game is loaded, the if statement will be false anyway
* Added basic help dialog
Is probably missing some destructor logic and might leak memory, idk
Co-authored-by: Pedro Montes Alcalde <pedro.montes.alcalde@gmail.com>
* Settings dialog experiments
* Make sections into tabs
* Present settings to the user
* Create a new CFG_KEYBIND setting
It's a copy of the string setting, but it can be used for special
treatment in the settings GUI
* Make the context menu more pleasing to the eye
* Allow to hide sections from the GUI
* Try to avoid writing to null pointer
* Try to fix the int->char issue for GUI
* Try to tie the actual settings to the GTK widgets
* Added missing saving code for KEYBIND settings
* Added settings saving
* Fix some jank, do some cleanup
* Insert hatred for auto-importer here
* Apply suggestions
* Remove settings_number from global scope
* Delete duplicate code
---------
Co-authored-by: Pedro Montes Alcalde <pedro.montes.alcalde@gmail.com>
* Create object file for fallback css at build time
* Include css object in LibreSplit binary
* Replace embed directive with linker-provided symbols
* Load fallback css using new method
* Adjust helper function
Linter had raised concern about pointer mathematics
* Set ld as required
Co-authored-by: Pedro Montes Alcalde <pedro.montes.alcalde@gmail.com>
---------
Co-authored-by: Pedro Montes Alcalde <pedro.montes.alcalde@gmail.com>
* Set up cppcheck for linting LibreSplit
Currently needs further tweaking, and to implement the ctl module. Long
term goal is for us to be able to catch common errors/mistakes.
* Add test job for CTL
* Add error with exit code 1
Currently causes the 2 linting jobs to fail, because cppcheck finds
problems with the code. The flags need tweaking to configure what we
want to mark as a problem, etc.
* Enable some suppressions for GTK/GLib
* Remove style warnings for now
* Rename format job to check
* Add action for checking linting
* Install Meson from pip to get newer version
* Add PPA for gcc-15
* Add LibreSplit deps to linter action
* Use c23 over aliased gnu23
* Update code to reflect new rules
* Add PPA for newer version of cppcheck
* Fix spelling mistake in step name
* Remove cppcheck/ppa
* Revert debug step
* Add GTK module for cppcheck
* Remove redundant if statement
* Check for potential allocation fail
* Print unsigned int with %u instead of %d
* Immediately detach/unraf GThread when saving game
---------
Co-authored-by: EXtremeExploit <pedro.montes.alcalde@gmail.com>
* Refactor source files into a files() list
This can then be re-used for both executable() compilation and
formatting
* Run code formatting check as meson test
Currently running test suite with "meson test -C build", add -v flag to
show output of tests
* Seperate into 2 seperate test jobs