aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/LResource.cc
AgeCommit message (Collapse)AuthorFilesLines
2011-11-01Move most of the resource loading code into ResourceManager_basePavel Labath1-27/+3
I mostly do this to avoid code duplication between fluxbox and fluxbox-update_configs.
2011-11-01Automatically save init file when a resource is modifiedPavel Labath1-2/+19
previously, init was autosaved only when a resource was modified using the menu. I have also included modifications through lua code. To avoid wasting resources, the file is not saved immediately, but with a 5 second delay (to enable saving a bunch of changes in one go)
2011-11-01Refactoring: move details if init file loading into LResourceManagerPavel Labath1-0/+34
2011-11-01Create a completely new lua state upon USR2 reconfigurePavel Labath1-15/+37
This way, global variables set by the scripts don't persist between hard reconfigures. I also cleaned up the reconfig-handling code in fluxbox.cc. Instead of three reconfig functions (real_reconfig, timed_reconfig, reconfig) we have just one.
2011-11-01Lua: Make global variables read-onlyPavel Labath1-1/+5
This prevents the user from inadvertently overwriting e.g. the session table and then wondering why it does not work. I'm still not sure about this approach, as it's not 100% secure (the script can still use raw access to mess with it) and it adds some overhead to any operation referencing a global variable.
2011-11-01use Lua::registerInitFunction to simplify some parts of codePavel Labath1-25/+22
2011-11-01Make lua resource manager automatically initialize lua state if neededPavel Labath1-0/+5
2011-11-01Add a function for converting from XResources to lua onesPavel Labath1-0/+16
2011-11-01Factor out "session." from resource namesPavel Labath1-2/+2
this reduces typing and it makes more sense in lua, since there the resources are implemented as hierarchical tables and the topmost table has to be handled a bit specially.
2011-11-01Move more common stuff of (L)ResourceManagers to their base classPavel Labath1-27/+2
2011-11-01A rough version of resource implementation in luaPavel Labath1-0/+163
I added a new class, LResourceManager, which should handle loading and saving of resources like the old ResourceManager, only it does that with the help of lua. I moved the common features of the two managers (interface + a few functions) to a common base class ResourceManager_base. I augmented the Resource_base class with two new functions (setFromLua and pushToLua) which are used by the lua RM instead of getString and setFromString. Parts of the new RM are written in lua. To avoid loading scripts from a file at runtime I decided to link compiled lua code straight into the executable. For this purpose I created a small script which converts a binary file into a declaration of a C array of bytes.