aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk
AgeCommit message (Collapse)AuthorFilesLines
2011-09-14Add template copy constructor to FbTk::RefcountPavel Labath1-2/+8
and remove a an "almost" copy constructor (almost, because it takes a non-const reference parameter) which was useless.
2011-09-11FbString: fix build without iconvPeter Korsgaard1-1/+2
Commit 690d926 (introduced FbTk::BidiString) broke building without HAVE_ICONV, because of wrong variable name and use of iconv_t type. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-05-10Make SignalTracker always disconnect itself from SignalsPavel Labath1-4/+3
previously, the tracker disconnected itself only when the caller passed withTracker = true to the leave() function. However, the default value was for the parameter was false. Non disconnecting from signal when stopping tracking creates very dangerous situation because the signal still holds a pointer to the tracker. This resulted in a segfault when exiting fluxbox, because the tracker (FluxboxWindow) got destroyed before the signal (BScreen::focusedWindowSig), and the signal was using an invalid pointer when it tried to disconnect itself from the tracker. Instead of setting withTracker to true by default or changing all invocations of leave(), I decided to make the tracker disconnect itself unconditionally because I could not find a use case for the opposite behaviour. PS: This message is in fact longer than the actual commit.
2011-05-10Remove all trace of Observers and SubjectsPavel Labath7-344/+1
this marks the completion of the transition to FbTk::Signal
2011-05-10Added FbTk::MemFunBind - a functor which binds all arguments of a functionPavel Labath1-0/+94
2011-05-10Make FbTk::MemFun[12] inherit from std::unary/binary_functionPavel Labath1-2/+3
this way, they can be used as inputs to std::bind1st and friends
2011-05-10Make FbTk::MemFun[0-3] use their ResultType parameterPavel Labath1-33/+33
previously they declared the parameter, but ignored the return value of the member function. I've changed it so they pass the return value, if it is not void. MemFunSelectArg didn't have the ReturnType template parameter, so I added it for consistency. Since I was already editing the, I made all the operator()s const.
2011-05-10Last round of simplification of Signal/Slot classesPavel Labath4-108/+72
- merged all the common stuff from 0,1,2,3 argument versions into one common base class - removed ReturnType template parameter as it was instantiated with "void" everywhere and the current ignores the return value of the callbacks anyway
2011-05-10Don't crash when a slot is deregistered in the middle of signal processingPavel Labath1-15/+46
this was possible (and used) with FbTk::Subject, but the implemetation of FbTk::Signal didn't support it, which made it impossible to continue with conversion.
2011-05-10Simplify Slot.hhPavel Labath2-254/+70
Replace CallbackHolder, FunctorHolder and SlotHolder with a (smaller) set of polymorphic classes. SignalHolder now stores a (smart) pointer to the class.
2011-05-10Make RefCount<> more sensiblePavel Labath6-12/+16
the previous version of operator*() made no sense. E.g., it violated the invariant (*ptr).foo <=> ptr->foo. The dereferencing operator now returns a reference to the pointed-to object, rather than a pointer to it. I also added a bool conversion operator, which can be used in testing the NULL-ness of the pointer. Anyone wondering if that could be done in a simpler way is encouraged to read <http://www.artima.com/cppsource/safebool.html>. And, finally, I removed the mutable flag from the m_data member, since it does not need it.
2011-05-10Remove the Observer dependency from FbTk::MenuPavel Labath2-7/+3
2011-05-10Convert FbTk::Theme::reconfigSig and friends to the new Signal systemPavel Labath5-12/+11
I removed the const versions of reconfigSig() in the process since FbTk::Signal has no const methods anyway.
2011-05-10Simplify FbTk::Signal template classes a bitPavel Labath1-64/+30
basically, i just got rid of Signal[0-3] classes and moved their contents to the appropriate specialization of FbTk::Signal also, this fixes the no matching function for call to 'MemFunIgnoreArgs(FbTk::Signal<void, FbTk::SigImpl::EmptyArg, FbTk::SigImpl::EmptyArg, FbTk::SigImpl::EmptyArg>&, void (FbTk::SigImpl::Signal0<void>::*)())' error i had in the following commit.
2011-05-08Can check CARDINAL properties in CLIENT PATTERNSnacitar sevaht2-19/+38
Introduces a new member function, FbWindow::cardinalProperty() This change also changes other code that previously used FbWindow::property() to do the same thing as the new function; this reduces code duplication. There are still some bits of code (Ewmh.cc, extractNetWmIcon()) that use FbWindow::property() to retrieve XA_CARDINAL values, but as the new method is designed for getting a _single_ property, and that code uses FbWindow::property() to retrieve the number of values present, and then grab all of them; it's a different use case. I opted to not try to make cardinalProperty() into some monolithic all-purpose cardinal method; FbWindow::property() works just fine for that. This change also adds an optional (default=NULL) boolean to FbWindow::textProperty and friends that allows the caller to determine whether or not a value was actually retrieved. This was necessary for integrating FbWindow::cardinalProperty with the codebase, and it seemed to fit with FbWindow::textProperty as well. Prior to this change, if you got a return value of "", you wouldn't know if you successfully retrieved the value which happened to be blank, or if you failed to retrieve the value. Now, you can pass the address of a boolean if you so choose in order to differentiate these situations; the same applies to the new FbWindow::cardinalProperty().
2011-04-11Fix a pair of warnings reported by clangPavel Labath1-2/+2
2011-04-11Menu.cc: send debug output to cerr, make the output more sensiblePavel Labath1-9/+15
2011-03-28compile fix: added <cstdlib> to provide declaration for 'size_t' (gcc-4.6.x ↵Daniel Diaz3-0/+3
likes it that way)
2011-03-23cosmeticsMathias Gumz2-6/+6
2011-03-23compile fix: sunCC again, wants a compile time constant for arraysMathias Gumz1-2/+2
2011-02-25bugfix: submenus didn't hide if a delay was setMathias Gumz1-2/+2
use the FbTk::Timer API correctly, bug(s) introduced by 1f0adef4daa2da5b08ed7f41e7a0ce1e3f71e46f e68511794130388ab9668fdef0dcf48dbbf002fd
2011-02-24little helper function 'isTitleVisible()' for FbTk::MenuMathias Gumz1-0/+1
2011-02-23renamed FbTk::XLayer to FbTk::Layer and FbTk::XLayerItem to FbTk::LayerItemMathias Gumz9-327/+177
2011-02-23disabled overhead base classes 'FbTk::Layer' and 'FbTk::LayerItem'Mathias Gumz4-21/+25
had to add <algorithm> at various other files as a result of this change.
2011-02-23irrelevant 'virtual' destructorMathias Gumz1-1/+1
2011-02-23code deduplicationMathias Gumz3-94/+68
2011-02-22moved rarely used 'cpccpc' out of class declarationMathias Gumz2-12/+13
2011-02-22bugfix: consistent use of 'int' for alpha values (#3187373)Mathias Gumz7-20/+20
WindowMenuAccessor returned strange alpha values if compiled with 'g++ -Os'; unholy black magic happens if template<int> faces functions returning only 'usigned char'.
2011-02-22bugfix: render 'sunken' gradients correctlyMathias Gumz1-1/+1
2011-02-22use FbTk::StringUtil APIMathias Gumz1-15/+4
2011-02-22renamed Texture:DEFAULT_BEVEL to Texture::DEFAULT_LEVELMathias Gumz3-3/+3
2011-02-22cosmeticsMathias Gumz1-15/+6
2011-02-22Bugfix: don't render textures with dimension of 0Mathias Gumz1-1/+4
At least 'invertRGB()' does not like 'width' or 'height' being 0. 341b2f43e511e39dd was triggered by this problem as well.
2011-02-21Fix bug: 'src_image' might be NULL if width||height are 0 (#3188223)Mathias Gumz1-40/+49
With ROT90-SystemTray fluxbox crashed. It is a bit unclear of where to catch pixmaps / windows with either width or height equal to 0; IMHO this needs more investigation.
2011-02-20Fixed a possible crash when using a slot m_holder = 0Henrik Kinnunen1-5/+9
2011-01-18bug fix: make fluxbox work under nxserver, closes #2813828Mathias Gumz1-0/+50
nxserver-3.x creates a XExposeEvent for the unmapped FbTk::Menu(), which is not configured completely yet (hence unmapped). this causes a call to FbTk::Menu::clearItem() which then uses a value of 0 for m_rows_per_column to divide the current index which triggers a SIGFPE. it is still unclear, why nxserver-3.x creates the XExposeEvent for the unmapped (menu) window. doing nothing if the menu is unmapped 'fixes' the problem for now. many thanks to Lars Engels (bsd-geek.de) to assist me in debugging this issue.
2011-01-15removed useless include statementsMathias Gumz1-4/+0
'typeinfo' was needed for RTTI in isItemSelectable() (see last commit) 'algorithm' is already included some lines above
2011-01-15better use of API, no need for 'timeval' in MenuMathias Gumz1-4/+1
2011-01-15MenuItem::isEnabled() is sufficient to decide Menu::isItemSelectable()Mathias Gumz1-3/+1
MenuSeparator is never enabled since it returns always 'false' in its implementation of isEnabled(). no need to use RTTI imho.
2011-01-15small refactoring of FbTk/Menu codeMathias Gumz2-227/+252
* removed useless struct _menu * code deduplication via renderMenuPixmap() * improved documentation: - 'sublevel' actually means 'column' - 'persub' means 'row_per_column'
2010-09-20bugfix: ' floating point exception' due wrongly placed codeMathias Gumz1-1/+2
while integrating the old 'getSqrt()' function into the 'bsqrt()' function i misplaced some code. this lead to 'r' being 0 on the first run. doh.
2010-09-17bugfix: avoid naive use of 'putenv' by providing 'FbTk::App::setenv()'Mathias Gumz2-0/+60
to quote from 'man putenv': The string pointed to by string becomes part of the environment, so altering the string changes the environment. so, using putenv like { std::string foo("FOO=bar"); putenv(foo.c_str()); } is wrong and leads to a potentially corrupted environment. valgrind complaint correctly. FbTk::App seems to be the appropriate place to hold '::seten()' because it alters the environment of the application.
2010-09-17request explicitly as many elements for the gradient tables as we needMathias Gumz2-18/+8
the next step is to not use 'unsigned int' and then only store 'chars' in it, maybe even using RGBA data instead of separated arrays for r, g and b.
2010-09-17bugfix: forgot to resize 'pixels' before putting values into it (facepalm)Mathias Gumz1-2/+2
2010-09-17lots of code cleanup, reordering, trimming public API, bugfixesMathias Gumz4-896/+918
## FbTk/ImageControl.hh: * moved 'getSqrt()' over to TextureRender.cc because it is used only there * removed unused members m_root_window * use std::vector<> for colors and for the gradient buffers. ## FbTk/ImageControl.cc: * fixed memory leak in '~ImageControl', 'pixels' where not deleted[] at all. switched to std::vector, non-issue anymore. * moved identical code into functions 'allocateUnallocatedColors', 'initColortables' ## FbTk/TextureRenderer: * removed 'from', 'to', 'interlaced' from class, only used in 'renderGradient()' and are actually part of the given texture. * removed 'xtable', 'ytable' from class, only used in 'renderGradient()' * removed 'colors' from the class, is part of 'control' * moved render actions (invert, bevel1, bevel2, *gradient), they need more love but for now this is sufficient
2010-09-17use FbTk::API to reduce code duplicationMathias Gumz2-3/+25
2010-09-15code deduplication by using <algorithm> and FbTk/STLUtil.hhMathias Gumz3-53/+53
2010-09-14bugfix: 'reset' nr_shapes to '0' after last instance of 'Shape'Mathias Gumz1-1/+3
2010-09-14cleanup and code deduplicationMathias Gumz3-2/+3
* ClientPattern.cc: make compiler happy (complaints about XPROP not handled in switch) * FbTk/FbPixmap.cc FbTk/StringUtil.cc: signed vs unsigned * FbTk/FbString.cc: missing return * WinClient.cc: create atoms only once; use helper function * Window.cc: use a helper function
2010-09-14use one array instead of two to hold both 'names' and 'atoms' for the rootwindowMathias Gumz1-30/+29