aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
AgeCommit message (Collapse)AuthorFilesLines
2011-08-21Don't spam with the "Unable to convert ... from nil" messagesPavel Labath1-3/+7
2011-08-18Add lua::quote function, for safe (and pretty) quoting of stringsPavel Labath2-0/+28
2011-08-16fluxbox-update_configs: add conversion of init filesPavel Labath1-0/+2
2011-08-15More preparation for automatic updating of config filesPavel Labath3-32/+51
2011-08-09Make AutoReloadHelper truly "automatic"Pavel Labath2-1/+15
by adding the ability to automatically check for modifications at specified intervals. Using inotify() would be better, but that's not always present.
2011-08-08Enable connecting to const SignalsPavel Labath1-17/+19
The idea is that connecting to a signal doesn't change it's state or the state of the object owning the signal (even though it needs to add the functor to the list for later reference). Emitting, on the other hand, is usually done as a result of a state change and therefore remains non-const. Additional benefit of this arrangement is that objects can export const references to signals to allow connecting, while keeping the ability to emit to themselves.
2011-08-04Move most of the resource loading code into ResourceManager_basePavel Labath4-42/+45
I mostly do this to avoid code duplication between fluxbox and fluxbox-update_configs.
2011-08-02Automatically save init file when a resource is modifiedPavel Labath3-5/+38
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-08-02Add explicit ReturnType cast to operator() of FbTk::SlotsPavel Labath1-4/+5
without this it wasn't possible to construct a Slot returning void from functors returning some real value because the compiler would complain about "return statement with a value in a function returning void". Theoretically, this may produce some unexpected type conversions, because static_cast is slightly stronger than implicit cast, but I judge the risk to be negligable (the alternative would be to provide explicit specializations for slots returning void - too much typing)
2011-08-02Upgrade FbTk::Timer so it can take an arbitrary functor as a parameterPavel Labath2-2/+20
2011-08-02Rename Signal::connect function taking an already-constructed slot to ↵Pavel Labath1-7/+7
connectSlot I do this to avoid compiler ambiguity between the two versions of connect()
2011-08-01Remove remnants of old menu parsing codePavel Labath3-79/+1
as it's no longed needed
2011-08-01Refactoring: move details if init file loading into LResourceManagerPavel Labath2-0/+36
2011-07-30Create a completely new lua state upon USR2 reconfigurePavel Labath2-15/+40
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-07-29Add checkstring() to lua::statePavel Labath2-4/+21
2011-07-25Add checkudata and checkargno functions to lua::statePavel Labath2-0/+43
These can be used by functions to check the saneness of arguments. They throw an exception on error. In the future, I might add more informative error messages.
2011-07-25Add readOnlySetField to FbTk::LuaPavel Labath2-0/+10
an equivalent of rawsetfield, but for "read only" tables.
2011-07-25Add comparison operators to FbTk::RefCountPavel Labath1-0/+30
without them, gcc would compare them by converting them to bool first, which is not exactly what one would expect. Frankly, I'm surprised it even worked without this.
2011-07-24luamm: add lua_isuserdata C++ bindingPavel Labath1-0/+1
2011-07-22Remove the assignment operator from a regular pointer to a RefCountPavel Labath3-9/+7
it is too easy too shoot yourself in the foot with it, other smart pointers also don't allow such assignments. If you do want to assign to a RefCount pointer, use reset(). ps: assignment between two RefCounts remains possible, of course.
2011-07-15Attach a modifiedSig handler to the session.cacheMax resourcePavel Labath2-5/+10
2011-07-14Attach a modifiedSig handler to the session.cacheLife resourcePavel Labath2-8/+14
2011-07-14Fix a small leak in FbTk::LuaPavel Labath1-1/+7
2011-07-13Emit the "modified" signal when a resource value is changed through C++ codePavel Labath1-2/+6
2011-07-12Add RangeTraits class which automatically clamps the value of resourcesPavel Labath2-0/+39
and start using it.
2011-07-12Enable the resource traits classes to hold non-static membersPavel Labath2-11/+19
ps: the Resource class inherits from the Traits class instead of holding it as a member because it's more size-efficient (base classes can have zero size, members cannot).
2011-07-10add FbTk::makeRef function, for easier construction of RefCount pointersPavel Labath1-0/+20
2011-07-10FbTk::Timer accepts Slots instead of Commands as the former are more generalPavel Labath2-8/+8
2011-07-10Signal::connect now also accepts an already-constructed SlotPavel Labath1-3/+27
This way we can use Commands as signal handlers out-of-the-box.
2011-07-10Make FbTk::Command inherit from FbTk::SlotPavel Labath1-3/+8
Command offers a subset of functionality and could be completely removed at some point.
2011-07-10Add a "modified" signal to resourcesPavel Labath1-2/+12
This way, an object can be informed when a resource changes (e.g. by a lua function).
2011-07-08Lua: Make global variables read-onlyPavel Labath3-19/+20
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-07-08Small optimization of the newindexDeny{Write,Modify} functionsPavel Labath1-3/+20
2011-07-08use Lua::registerInitFunction to simplify some parts of codePavel Labath2-32/+26
2011-07-08A lightweight version of lua::state::pushclosure which handles the simple casesPavel Labath2-3/+12
2011-07-07FbTk::Lua - a class which augments lua::state with additional featuresPavel Labath3-0/+183
2011-07-02Luamm: add lua_istable C++ wrapperPavel Labath1-0/+1
2011-07-02Add a version of lua::state::loadstring which accepts std::stringPavel Labath1-0/+1
2011-07-02Store menus if smart pointers (RefCount)Pavel Labath7-31/+15
This was originally intended to be a bugfix for an memory error reported by valgrind (accessing freed memory). While debugging it, I found the menu ownership semantics confusing (setInternalMenu() et al.), so I decided to get rid of it and store it in smart pointers everywhere. Looking back, I'm not sure if this was worth all the trouble, but the good news is that the valgrind error disappeared. :)
2011-07-02Add a reset() function to FbTk::RefCountPavel Labath1-0/+1
to make it's interface more compatible with other smart pointers.
2011-06-27A veeeery rough implementation of lua menu parsersPavel Labath3-4/+4
2011-06-26Mark FbTk::StringConvertor as NotCopyablePavel Labath1-1/+3
2011-06-19Fix saving of resources.Pavel Labath1-29/+66
2011-06-16Vector resources can now specify which char to use as delimitersPavel Labath1-2/+2
when saving/loading to/from string representation. This is needed for the next commit.
2011-06-16Add LocaleStringTraits resource classPavel Labath1-2/+19
for resources which need to work with localised strings.
2011-06-16Replace ResourceManager with the lua versionPavel Labath1-0/+8
Loading of an init file with the new manager works ok. Saving and restarting is still not completed. This touches many files because i removed the alternative name of resources. Unlike Xrm, lua does not have native support for alt names. It should be fairly easy to add them, but I think that is unnecessary and would be confusing.
2011-06-16Fix bug in LResources: they were unable to handle resources with numbers in ↵Pavel Labath1-6/+6
names
2011-06-15Make lua resource manager automatically initialize lua state if neededPavel Labath1-0/+5
2011-06-15Add a function for converting from XResources to lua onesPavel Labath3-0/+21
2011-06-15Lua resources: Add support for saving of boolean valuesPavel Labath1-6/+15